|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Start point for a user to access the repository.
An instance of this object is obtained from the RepositoryManager
and
is contextualized for a certain user. Thus instead of having to supply
credentials to each method, you authenticate once via the RepositoryManager
and can then do all further operations on this Repository object.
Method Summary | |
void |
addListener(RepositoryListener listener)
Add an event listener. |
Document |
createDocument(java.lang.String name,
long documentTypeId)
Same as createDocument(String, long, long, long) but assumes branch id 1
and language id 1. |
Document |
createDocument(java.lang.String name,
long documentTypeId,
long branchId,
long languageId)
Creates a new document. |
Document |
createDocument(java.lang.String name,
java.lang.String documentTypeName)
Same as createDocument(String, long) but takes a document type
name instead of an id. |
Document |
createDocument(java.lang.String name,
java.lang.String documentTypeName,
java.lang.String branchName,
java.lang.String languageName)
Same as createDocument(String, long, long, long) but takes names instead
of ids. |
Document |
createVariant(long documentId,
long startBranchId,
long startLanguageId,
long startVersionId,
long newBranchId,
long newLanguageId,
boolean copyContent)
Creates a new variant on a document. |
Document |
createVariant(long documentId,
java.lang.String startBranchName,
java.lang.String startLanguageName,
long startVersionId,
java.lang.String newBranchName,
java.lang.String newLanguageName,
boolean copyContent)
|
void |
deleteDocument(long documentId)
Deletes a document permanently (unrecoverable) from the repository (including all its variants). |
void |
deleteVariant(long documentId,
long branchId,
long languageId)
|
void |
deleteVariant(VariantKey variantKey)
Deletes a document variant permanently (unrecoverable) from the repository. |
AccessManager |
getAccessManager()
|
long[] |
getActiveRoleIds()
The roles of the user that are currently active. |
java.lang.String[] |
getActiveRolesDisplayNames()
Returns the names of the active roles. |
long[] |
getAvailableRoles()
The id's of the available roles of the user. |
AvailableVariants |
getAvailableVariants(long documentId)
Gets the available variants of a document. |
CollectionManager |
getCollectionManager()
Returns the Collection Manager for this Repository. |
CommentManager |
getCommentManager()
|
Document |
getDocument(long documentId,
boolean updateable)
|
Document |
getDocument(long documentId,
long branchId,
long languageId,
boolean updateable)
Gets a document from the repository. |
Document |
getDocument(long documentId,
java.lang.String branchName,
java.lang.String languageName,
boolean updateable)
|
Document |
getDocument(VariantKey key,
boolean updateable)
|
java.lang.Object |
getExtension(java.lang.String name)
Retrieves an extension of the standard repository functionality. |
java.io.InputStream |
getPartData(long documentId,
long versionId,
long partTypeId)
Retrieves part data for the branch "main", language "default". |
java.io.InputStream |
getPartData(long documentId,
long branchId,
long languageId,
long versionId,
long partTypeId)
Retrieves the specified blob without the need to go through the Document object. |
QueryManager |
getQueryManager()
|
RepositorySchema |
getRepositorySchema()
|
java.lang.String |
getUserDisplayName()
The name of the user with who this Repository instance is associated, the same as returned from User.getDisplayName() . |
long |
getUserId()
Id of the user with who this Repository instance is associated. |
org.outerx.daisy.x10.UserInfoDocument |
getUserInfoAsXml()
Returns an XML document containing some information about the user with which this Repository instance is associated. |
java.lang.String |
getUserLogin()
The login of the user with who this Repository instance is associated. |
UserManager |
getUserManager()
Returns the User Manager for this Repository |
VariantManager |
getVariantManager()
|
boolean |
isInRole(long roleId)
|
boolean |
isInRole(java.lang.String roleName)
|
void |
removeListener(RepositoryListener listener)
Removes an event listener. |
void |
setActiveRoleIds(long[] roleIds)
Sets the active roles of the user. |
void |
switchRole(long roleId)
Changes the user's role for this Repository instance. |
Method Detail |
public Document createDocument(java.lang.String name, long documentTypeId, long branchId, long languageId)
RepositorySchema
.
The document will not be stored physically
in the repository until Document.save()
is called. Thus
calling this method has no permanent side effects.
public Document createDocument(java.lang.String name, java.lang.String documentTypeName, java.lang.String branchName, java.lang.String languageName)
createDocument(String, long, long, long)
but takes names instead
of ids.
public Document createDocument(java.lang.String name, long documentTypeId)
createDocument(String, long, long, long)
but assumes branch id 1
and language id 1.
public Document createDocument(java.lang.String name, java.lang.String documentTypeName)
createDocument(String, long)
but takes a document type
name instead of an id.
public Document createVariant(long documentId, long startBranchId, long startLanguageId, long startVersionId, long newBranchId, long newLanguageId, boolean copyContent) throws RepositoryException
Document.getVariantCreatedFromBranchId()
etc. methods).
If copyContent is false, a document object for the new variant will
be returned, with no data copied from the start variant (except for
the document name), and the new variant will not yet be persisted
(i.o.w. you need to call save on the returned Document object to do
this). Thus using copyContent = false allows to create a variant
from scratch, while copyContent = true branches of from an existing
variant.
startVersionId
- -1 for last version, -2 for live version
RepositoryException
public Document createVariant(long documentId, java.lang.String startBranchName, java.lang.String startLanguageName, long startVersionId, java.lang.String newBranchName, java.lang.String newLanguageName, boolean copyContent) throws RepositoryException
RepositoryException
public Document getDocument(long documentId, long branchId, long languageId, boolean updateable) throws RepositoryException
updateable
- if false, you won't be able to make modifications
to the document (and thus to save it). The repository
can return a cached copy in this case.
DocumentReadDeniedException
- if read access to the document is denied.
RepositoryException
public Document getDocument(long documentId, java.lang.String branchName, java.lang.String languageName, boolean updateable) throws RepositoryException
branchName
- a branch name, or a branch id as stringlanguageName
- a language name, or a language id as string
RepositoryException
public Document getDocument(VariantKey key, boolean updateable) throws RepositoryException
RepositoryException
public Document getDocument(long documentId, boolean updateable) throws RepositoryException
RepositoryException
public AvailableVariants getAvailableVariants(long documentId) throws RepositoryException
RepositoryException
public void deleteDocument(long documentId) throws RepositoryException
RepositoryException
public void deleteVariant(long documentId, long branchId, long languageId) throws RepositoryException
RepositoryException
deleteVariant(VariantKey)
public void deleteVariant(VariantKey variantKey) throws RepositoryException
To delete a document variant virtually, but not permanently, you can set it
retired (see Document.setRetired(boolean)
).
RepositoryException
public java.io.InputStream getPartData(long documentId, long branchId, long languageId, long versionId, long partTypeId) throws RepositoryException
DocumentReadDeniedException
- if read access to the document is denied.
RepositoryException
public java.io.InputStream getPartData(long documentId, long versionId, long partTypeId) throws RepositoryException
RepositoryException
public RepositorySchema getRepositorySchema()
public AccessManager getAccessManager()
public QueryManager getQueryManager()
public CommentManager getCommentManager()
public VariantManager getVariantManager()
public CollectionManager getCollectionManager()
public UserManager getUserManager()
public long getUserId()
public java.lang.String getUserDisplayName()
User.getDisplayName()
.
public java.lang.String getUserLogin()
public long[] getActiveRoleIds()
setActiveRoleIds(long[])
.
public boolean isInRole(long roleId)
public boolean isInRole(java.lang.String roleName)
public void setActiveRoleIds(long[] roleIds)
roleIds
- a subset of, or equal to, the roles returned by getAvailableRoles()
.public java.lang.String[] getActiveRolesDisplayNames()
public long[] getAvailableRoles()
public void switchRole(long roleId)
setActiveRoleIds(long[])
with a one-length array.
roleId
- a valid roleId, thus one of those returned by getAvailableRoles()
.public org.outerx.daisy.x10.UserInfoDocument getUserInfoAsXml()
public void addListener(RepositoryListener listener)
See also the comments in RepositoryListener
.
Not all events are per-se also implemented in the repository client, and for so far as they are, they only provide events for operations done through that client, and not other ones happening on the server or through other clients.
This listener functionality is mostly meant for internal use, usually to clear caches. For most usecases you should use the JMS-based (assynchronous) event notification system.
A listener stays in effect until it is removed using
removeListener(org.outerj.daisy.repository.RepositoryListener)
.
public void removeListener(RepositoryListener listener)
public java.lang.Object getExtension(java.lang.String name)
The reason for making this extension functionality part of the Repository API, instead of using completely separate and standalone components, is that in this way the extensions can operate in the authenticated context of the current user (ie Repository instance).
So, for as far as the extension performs any operations that depend on the current user and its role, the extension will operate using the same credentials as associated with the Repository object from which the extension instance has been retrieved.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |