Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This class contains constants that are used to represent types of object and actions in the database. For example, authorization policies can relate to objects of different types, so the resourcepolicy table has columns resource_id, which is the internal ID of the object, and resource_type_id, which indicates whether the object is an item, collection, bitstream etc. The value of resource_type_id is taken from the Constants class, for example Constants.ITEM.

Here are a some of the most commonly used constants you might come across:

DSpace types

  • Bitstream: 0
  • Bundle: 1
  • Item: 2
  • Collection: 3
  • Community: 4
  • Site: 5
  • Group: 6
  • Eperson: 7

DSpace actions

  • Read: 0
  • Write: 1
  • Delete: 2
  • Add: 3
  • Remove: 4

Refer to the org.dspace.core.Constants for all of the Constants.

Context

The Context class is central to the DSpace operation. Any code that wishes to use the any API in the business logic layer must first create itself a Context object. This is akin to opening a connection to a database (which is in fact one of the things that happens.)

...