atg.repository
Interface Repository

All Superinterfaces:
RepositoryViewContainer
All Known Subinterfaces:
ContentRepository, MutableRepository, SecuredMutableRepository, SecuredRepository
All Known Implementing Classes:
atg.repository.content.ContentRepositoryService, GenericSecuredMutableContentRepository, GenericSecuredMutableRepository, GenericSecuredRepository, atg.adapter.html.ImmutableSimpleRepository, RepositoryImpl, SimpleRepository, XMLRepositoryService

public interface Repository
extends RepositoryViewContainer

Represents a collection of RepositoryItems. The Repository can access RepositoryItems by id, or can query the collection through supplied RepositoryViews. This base interface does not allow the modification of the repository (i.e. create, update or delete RepositoryItems).

The id datatypes are not predefined to allow a more flexible mechanism for referencing objects in the repository. For example, a repository for a set of user profiles would probably use a Long object for their id datatype. A Repository over a file system may use String objects which map directly to the file path of html files.

See Also:
MutableRepository, RepositoryView, RepositoryItemDescriptor, QueryBuilder

Field Summary
static java.lang.String CLASS_VERSION
           
 
Method Summary
 java.lang.String getDefaultViewName()
          Returns the name of the "default" or "root" RepositoryView
 RepositoryItem getItem(java.lang.String pId)
          Deprecated. this method is replaced by getItem(String,String). If the second argument, i.e. the descriptor name is unknown, then use getItem(String,getDefaultViewName()).
 RepositoryItem getItem(java.lang.String pId, java.lang.String pDescriptorName)
          Returns an item in the Repository with the given id
 RepositoryItemDescriptor getItemDescriptor(RepositoryItemDescriptor pDesc)
          Returns a RepositoryItemDescriptor accessed with the name of the given descriptor.
 RepositoryItemDescriptor getItemDescriptor(java.lang.String pName)
          Returns a RepositoryItemDescriptor accessed with the given name.
 java.lang.String[] getItemDescriptorNames()
          Returns an array of the names of the known RepositoryItemDescriptors.
 RepositoryItem[] getItems(java.lang.String[] pIds)
          Deprecated.  
 RepositoryItem[] getItems(java.lang.String[] pIds, java.lang.String pDescriptorName)
          Returns the items with the given ids
 java.lang.String getRepositoryName()
          Returns the name of this Repository
 RepositoryView getView(RepositoryItemDescriptor pDesc)
          Returns a RepositoryView accessed with the name of the given descriptor.
 RepositoryView getView(java.lang.String pName)
          Returns a RepositoryView accessed with the given name.
 java.lang.String[] getViewNames()
          Returns an array of the names of all contained top-level views
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values
Method Detail

getRepositoryName

java.lang.String getRepositoryName()
Returns the name of this Repository


getItem

RepositoryItem getItem(java.lang.String pId)
                       throws RepositoryException
Deprecated. this method is replaced by getItem(String,String). If the second argument, i.e. the descriptor name is unknown, then use getItem(String,getDefaultViewName()).

Returns an item in the Repository with the given id. This version retrieves the item from the default item descriptor.

Parameters:
pId - the id of the item to retrieve
Returns:
null if no item can be found
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItem

getItem

RepositoryItem getItem(java.lang.String pId,
                       java.lang.String pDescriptorName)
                       throws RepositoryException
Returns an item in the Repository with the given id

Parameters:
pId - the id of the item to retrieve
pDescriptorName - the name of the item descriptor that contains this item.
Returns:
null if no item can be found
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItem

getItems

RepositoryItem[] getItems(java.lang.String[] pIds)
                          throws RepositoryException
Deprecated. 

Returns the items with the given ids

Returns:
null if no items can be found
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItems

getItems

RepositoryItem[] getItems(java.lang.String[] pIds,
                          java.lang.String pDescriptorName)
                          throws RepositoryException
Returns the items with the given ids

Parameters:
pIds - the list of ids
pDescriptorName - the item descriptor containing these ids
Returns:
null if no items can be found
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItems

getDefaultViewName

java.lang.String getDefaultViewName()
Returns the name of the "default" or "root" RepositoryView


getViewNames

java.lang.String[] getViewNames()
Returns an array of the names of all contained top-level views

Specified by:
getViewNames in interface RepositoryViewContainer
Returns:
null if no sub-views exist

getView

RepositoryView getView(java.lang.String pName)
                       throws RepositoryException
Returns a RepositoryView accessed with the given name.

Specified by:
getView in interface RepositoryViewContainer
Parameters:
pName - the name of the view to find
Returns:
null if the requested view does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryView

getView

RepositoryView getView(RepositoryItemDescriptor pDesc)
                       throws RepositoryException
Returns a RepositoryView accessed with the name of the given descriptor.

Parameters:
pDesc - the descriptor of the view to find
Returns:
null if the requested view does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryView

getItemDescriptorNames

java.lang.String[] getItemDescriptorNames()
Returns an array of the names of the known RepositoryItemDescriptors. There should always be at least one item descriptor per Repository.


getItemDescriptor

RepositoryItemDescriptor getItemDescriptor(java.lang.String pName)
                                           throws RepositoryException
Returns a RepositoryItemDescriptor accessed with the given name.

Parameters:
pName - the name of the descriptor to find
Returns:
null if the requested descriptor does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItemDescriptor

getItemDescriptor

RepositoryItemDescriptor getItemDescriptor(RepositoryItemDescriptor pDesc)
                                           throws RepositoryException
Returns a RepositoryItemDescriptor accessed with the name of the given descriptor.

Parameters:
pDesc - the descriptor to find
Returns:
null if the requested descriptor does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItemDescriptor