|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Allows to customise some of the behaviour of the CommonRepository
, and especially
DocumentImpl
.
The typical use of this is to provide two implementations of the repository API's: one for local (in-server) use, and one for remote (= client) use, by only having to implement twice those aspects which differ in each implementation.
The most important difference between the client and server API implementations will be how they load and store entities (such as Document objects): the client API implementation will do this by contacting the server, the server implementation will do this by using its persistence mechanisms (such as an RDBMS).
Note that this API is not really meant for public consumption, and the correct workings of its implementations (especially the server-side one) are crucial for the correct operation of the repository. It is important that the strategy implementation correctly initialiases, updates and interprets the internal state of the objects it handles.
Certain methonds, like load(AuthenticatedUser,long,long,long)
and store(org.outerj.daisy.repository.commonimpl.DocumentImpl)
need to check
if the user has the rights to perform this operation. This is especially true for the serverside
implementation, the client side implementation doesn't need to do this as it will contact the
server which will automatically do this checks.
Certain methods, like store(org.outerj.daisy.repository.commonimpl.DocumentImpl)
might
also need to send out events to eventlisteners.
Method Summary | |
void |
completeVersion(DocumentVariantImpl variant,
VersionImpl version)
Loads the additional information skipped when the version was loaded via loadShallowVersions(org.outerj.daisy.repository.commonimpl.DocumentVariantImpl) . |
org.outerj.daisy.repository.Document |
createVariant(long documentId,
long startBranchId,
long startLanguageId,
long startVersionId,
long newBranchId,
long newLanguageId,
AuthenticatedUser user)
|
void |
deleteDocument(long documentId,
AuthenticatedUser user)
|
void |
deleteVariant(long documentId,
long branchId,
long languageId,
AuthenticatedUser user)
|
AvailableVariantImpl[] |
getAvailableVariants(long documentId,
AuthenticatedUser user)
|
java.io.InputStream |
getBlob(long documentId,
long branchId,
long languageId,
long versionId,
long partTypeId,
AuthenticatedUser user)
|
java.io.InputStream |
getBlob(java.lang.String blobKey)
This method does not check access rights (unlike getBlob(long, long, long, long, long, AuthenticatedUser) ,
because this one is only intended for use by Part objects. |
LockInfoImpl |
getLockInfo(DocumentVariantImpl documentVariant)
|
org.outerj.daisy.repository.Document |
load(AuthenticatedUser user,
long documentId,
long branchId,
long languageId)
|
VersionImpl[] |
loadShallowVersions(DocumentVariantImpl variant)
Loads all Version objects for this document as shallow Version objects (i.e. |
VersionImpl |
loadVersion(DocumentVariantImpl documentVariant,
long versionId)
|
LockInfoImpl |
lock(DocumentVariantImpl documentVariant,
long duration,
org.outerj.daisy.repository.LockType lockType)
Tries to create a lock on the document. |
LockInfoImpl |
releaseLock(DocumentVariantImpl documentVariant)
|
void |
setVersionState(DocumentImpl document,
VersionImpl version,
org.outerj.daisy.repository.VersionState versionState)
|
void |
store(DocumentImpl document)
Stores a document. |
Method Detail |
public org.outerj.daisy.repository.Document load(AuthenticatedUser user, long documentId, long branchId, long languageId) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public void store(DocumentImpl document) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public org.outerj.daisy.repository.Document createVariant(long documentId, long startBranchId, long startLanguageId, long startVersionId, long newBranchId, long newLanguageId, AuthenticatedUser user) throws org.outerj.daisy.repository.RepositoryException
startVersionId
- -1 for last version, -2 for live version
org.outerj.daisy.repository.RepositoryException
public AvailableVariantImpl[] getAvailableVariants(long documentId, AuthenticatedUser user) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public void deleteDocument(long documentId, AuthenticatedUser user) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public void deleteVariant(long documentId, long branchId, long languageId, AuthenticatedUser user) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public VersionImpl loadVersion(DocumentVariantImpl documentVariant, long versionId) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public void completeVersion(DocumentVariantImpl variant, VersionImpl version) throws org.outerj.daisy.repository.RepositoryException
loadShallowVersions(org.outerj.daisy.repository.commonimpl.DocumentVariantImpl)
.
org.outerj.daisy.repository.RepositoryException
public VersionImpl[] loadShallowVersions(DocumentVariantImpl variant) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public void setVersionState(DocumentImpl document, VersionImpl version, org.outerj.daisy.repository.VersionState versionState) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public java.io.InputStream getBlob(long documentId, long branchId, long languageId, long versionId, long partTypeId, AuthenticatedUser user) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public java.io.InputStream getBlob(java.lang.String blobKey) throws org.outerj.daisy.repository.RepositoryException
getBlob(long, long, long, long, long, AuthenticatedUser)
,
because this one is only intended for use by Part objects.
org.outerj.daisy.repository.RepositoryException
public LockInfoImpl lock(DocumentVariantImpl documentVariant, long duration, org.outerj.daisy.repository.LockType lockType) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public LockInfoImpl getLockInfo(DocumentVariantImpl documentVariant) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
public LockInfoImpl releaseLock(DocumentVariantImpl documentVariant) throws org.outerj.daisy.repository.RepositoryException
org.outerj.daisy.repository.RepositoryException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |