Saturday, 27 February 2016

Elements Of Repository API



Mutable Repository

The base interfaces of a repository define an immutable data store. It provides a read-only version of the elements contained in the repository.

Mutable Repository is extension of the Repository interfaces that provide facilities to create, update, and remove items from a repository 


Elements of Repository API


   •atg.repository.Repository
           –This interface provides methods to access RepositoryItems, RepositoryViews and ItemDescriptors corresponding to the three main elements of the repository
 
    •atg.repository.RepositoryView
          –RepositoryView can be used to search for items in repository when you don’t have an exact repository ID
         –Item descriptors and RepositoryViews often have a one-to-one relationship and often have the same name
         –viewNames property of the Repository component gives the list of views available for the Repository
         –Default View returns all items of the Repository which can be accessed by defaultViewName property
    •atg.repository.RepositoryItem
    –The atg.repository.RepositoryItem interface is the immutable interface that represents an element from a repository. Each RepositoryItem is uniquely identified through its repositoryId property
    –The ItemDescriptor that describes the dynamic bean info about the item is available through the ItemDescriptor property
    –getPropertyValue(String pPropertyName) method can be used to retrieve the attributes of the RepositoryItem
atg.repository.MutableRepository
createItem
           •createItem(String pDescriptorName)
           •createItem(String pId, String pDescriptorName).
addItem
           •RepositoryItem addItem(MutableRepositoryItem pItem)
removeItem
           •removeItem(String pId, String pDescriptorName)
updateItem
      •Fetch a mutable version of the repository item through the getItemForUpdate and getItemsForUpdate methods. These methods return instances of MutableRepositoryItem. This interface extends RepositoryItem
setPropertyValue(String pPropertyName, Object pPropertyValue)
Use the setPropertyValue method of MutableRepositoryItem to change as many properties as you wish. These changes will not be reflected in the repository until the final updateItem operation is invoked.
Save the changes with the updateItem method. This method extracts all the changes required for the item and updates the item in the data store. Depending on how you have configured transactional behavior, the update can be committed immediately, or the update may happen automatically when the associated transaction commits
 

0 comments:

Post a Comment

 
;