|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.svc.repository.service.RepositoryService
public class RepositoryService
Provides convenience service for updating and saving new beans implementations for a single repository represented by the home provided in the configuration. The bean implementations are converted to repository implementations inside of a transaction so the business code doesn't have to worry about transaction support. Why is all this necessary? 1. There is no relationship in r2j generated code between the bean and repository implementations. In order to commit a bean to the repository you first have to turn the bean into a repository impl. r2j generates a copyTo() method to do this but it's not easy to do so in a generic way because the generated beans and repository impls do not share any interfaces, base classes, etc. The alternative to some base services is that every business method that does a create(), update() or delete() has to write these methods by hand. 2. We often want to group heterogenous bean type operations together in a single transaction. Again, since the generated code doesn't share any interfaces or base classes and we want to do this in a generic manner we have to write all the code to do so and it's complicated. Again, the alternative to some base services is that every business method that does a create(), update() or delete() has to write these methods by hand.
Nested Class Summary | |
---|---|
protected class |
RepositoryService.SaveCollectionRunner
Save Runner that creates a collection of new repository objects from a collection of new beans. |
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
REMOVE_REFERENCES_ON_DELETE_ATTRIBUTE
|
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
RepositoryService()
|
Method Summary | |
---|---|
void |
delete(java.lang.Object pRepositoryObject)
Deletes a repository item represented by the given repository object. |
void |
deleteCollection(java.util.Collection pObjects)
Deletes a collection of repository items represented by the given bean impls. |
atg.repository.tojava.runtime.RJBeanObject |
edit(java.lang.Object pRepositoryObject)
Deprecated. Bean impl objects are not required to edit repository impl objects. |
java.util.List |
editCollection(java.util.Collection pCollection)
Deprecated. Bean impl objects are not required to edit repository impl objects. |
atg.repository.tojava.runtime.RJBeanObject |
getBeanImpl(java.lang.Object pRepositoryObject)
Gets a bean impl copy of a repository object by creating a bean of the same item-descriptor and then copying the properties and id into the newly created bean impl. |
java.util.List |
getBeanImplCollection(java.util.Collection pReposImplCollection)
Gets a list with bean impl copies of the given collection of repository impl objects. |
java.lang.String[] |
getExcludedProperties()
Gets the set of excluded properties that should not be copied in transformMembers(). |
atg.repository.RepositoryItem |
getRepositoryItem(java.lang.Object pRepositoryObject)
Gets a repository item from an r2j repository impl. |
TransactionService |
getTransactionService()
Gets the transaction service used by this service. |
boolean |
isBean(java.lang.Object pBeanObject)
Returns true if the given object is a bean impl vs. |
boolean |
isNew(java.lang.Object pBeanObject)
Returns true if the bean is new. |
void |
removeRepositoryCollection(java.util.Collection pObjects)
Removes a collection of repository items from the repository. |
void |
save(java.lang.Object pBeanObject)
Saves the given bean object to the repository. |
void |
saveCollection(java.util.Collection pObjects)
Saves a collection of bean objects to the repository. |
void |
setExcludedProperties(java.lang.String[] pExcludedProperties)
Sets the set of excluded properties that should not be copied in transformMembers(). |
void |
setTransactionService(TransactionService pTransactionService)
Sets the transaction service used by this service. |
void |
writeRepositoryCollection(java.util.Collection pObjects)
Writes a collection of repository items to the repository. |
Methods inherited from class atg.nucleus.GenericService |
---|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String REMOVE_REFERENCES_ON_DELETE_ATTRIBUTE
Constructor Detail |
---|
public RepositoryService()
Method Detail |
---|
public TransactionService getTransactionService()
public void setTransactionService(TransactionService pTransactionService)
pTransactionService
- public java.lang.String[] getExcludedProperties()
public void setExcludedProperties(java.lang.String[] pExcludedProperties)
pExcludedProperties
- The set of excluded properties that should not be copied in transformMembers().public atg.repository.tojava.runtime.RJBeanObject getBeanImpl(java.lang.Object pRepositoryObject)
pRepositoryObject
- The repository object to copy into a bean object.
java.lang.IllegalArgumentException
- If the impl underlying the input param doesn't implement RJRepositoryObject an IllegalArgumentException is thrown.public atg.repository.tojava.runtime.RJBeanObject edit(java.lang.Object pRepositoryObject)
pRepositoryObject
- The repository object to create the editable bean from.public java.util.List getBeanImplCollection(java.util.Collection pReposImplCollection)
pReposImplCollection
- A collection of repository impl object to create bean copies from.
public java.util.List editCollection(java.util.Collection pCollection)
pCollection
- The non-null collection of repository objects.
public void save(java.lang.Object pBeanObject) throws ObjectNotFoundException, PersistenceException
pBeanObject
- The bean to save.
This is passed as an object because the objects used by r2j implement an interface
specific to each object that is generated. It's the underlying implementation that we care about but we shouldn't
force the caller to do the cast.
ObjectNotFoundException
- In the case of update, if the repository item represented by the bean is not found.
PersistenceException
- If the save operation fails.
java.lang.IllegalArgumentException
- If the impl underlying the input param doesn't implement RJBeanObject an IllegalArgumentException is thrown.public void saveCollection(java.util.Collection pObjects) throws ObjectNotFoundException, PersistenceException
pObjects
- The collection of bean impls to save.
PersistenceException
- If the save fails.
ObjectNotFoundException
public void writeRepositoryCollection(java.util.Collection pObjects) throws PersistenceException
pObjects
- A collection of RJRepositoryObjects.
PersistenceException
public void delete(java.lang.Object pRepositoryObject) throws ObjectNotFoundException, PersistenceException
pRepositoryObject
- The bean object to delete.
ObjectNotFoundException
- If the repository object is not found.
PersistenceException
- If the repository object cannot be deleted.
java.lang.IllegalArgumentException
- If the impl underlying the input param doesn't implement RJBeanObject an IllegalArgumentException is thrown.public void deleteCollection(java.util.Collection pObjects) throws ObjectNotFoundException, PersistenceException
pObjects
- The collection of bean impls.
ObjectNotFoundException
- If a repository item is not found (no longer used).
PersistenceException
- If a repository item cannot be deleted.public void removeRepositoryCollection(java.util.Collection pObjects) throws PersistenceException
pObjects
- A collection of RJRepositoryObjects.
PersistenceException
- If the remove operation fails.public atg.repository.RepositoryItem getRepositoryItem(java.lang.Object pRepositoryObject)
pRepositoryObject
- The repository object impl.
java.lang.IllegalArgumentException
- If the impl underlying the input param doesn't implement RepositoryItemWrapper an IllegalArgumentException is thrown.public boolean isNew(java.lang.Object pBeanObject)
pBeanObject
- The bean to check.
public boolean isBean(java.lang.Object pBeanObject)
pBeanObject
- The object to test.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |