Package lumis.service.document
Class DocumentManager
- java.lang.Object
-
- lumis.service.document.DocumentManager
-
- All Implemented Interfaces:
IDocumentManager
public class DocumentManager extends java.lang.Object implements IDocumentManager
- Since:
- 4.0.0
- Version:
- $Revision$ $Date$
-
-
Field Summary
Fields Modifier and Type Field Description protected IResource
resource
-
Fields inherited from interface lumis.service.document.IDocumentManager
TYPE_ALL
-
-
Constructor Summary
Constructors Constructor Description DocumentManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentConfig
get(SessionConfig sessionConfig, java.lang.String documentId, ITransaction transaction)
Returns the DocumentConfig for a document with the given id.java.util.Collection<DocumentConfig>
getChildren(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String folderId, int type, ITransaction transaction)
Returns the entries in the specified folder.java.util.Collection<java.lang.String>
getDocumentPublishToPrincipals(java.lang.String parentFolderId)
Return a the list of principals for which thedocument
is published to.java.util.Collection<java.lang.String>
getFolderIdsByParentAndName(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String parentFolderId, java.lang.String folderName, ITransaction transaction)
Returns the ids of the folders child of the given parent and with the given name.java.lang.String
getFolderPath(SessionConfig sessionConfig, java.lang.String folderId, ITransaction transaction)
Returns the virtual path to the folder.void
moveDocument(SessionConfig sessionConfig, java.lang.String documentId, java.lang.String destFolderId, ITransaction transaction)
Moves a document (or a folder) to another folder.void
updateDocumentHierarchyPublishTo(java.lang.String documentId, java.util.Collection<java.lang.String> heritagePrincipalsId)
Update the list of principals thedocument
is published to
-
-
-
Field Detail
-
resource
protected IResource resource
-
-
Method Detail
-
get
public DocumentConfig get(SessionConfig sessionConfig, java.lang.String documentId, ITransaction transaction) throws PortalException
Description copied from interface:IDocumentManager
Returns the DocumentConfig for a document with the given id.- Specified by:
get
in interfaceIDocumentManager
- Parameters:
sessionConfig
- identifier for the session.documentId
- the id of the document.transaction
- the transaction for persistence access.- Returns:
- the DocumentConfig for the document, or null if it is not found.
- Throws:
PortalException
-
getFolderIdsByParentAndName
public java.util.Collection<java.lang.String> getFolderIdsByParentAndName(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String parentFolderId, java.lang.String folderName, ITransaction transaction) throws PortalException
Description copied from interface:IDocumentManager
Returns the ids of the folders child of the given parent and with the given name.- Specified by:
getFolderIdsByParentAndName
in interfaceIDocumentManager
- Parameters:
sessionConfig
- identifier for the session.serviceInstanceId
- the content's service instance id.parentFolderId
- the parent folder's id. Null if the folder must not have parent.folderName
- the folder name.transaction
- the transaction for persistence access.- Returns:
- Throws:
PortalException
-
getChildren
public java.util.Collection<DocumentConfig> getChildren(SessionConfig sessionConfig, java.lang.String serviceInstanceId, java.lang.String folderId, int type, ITransaction transaction) throws PortalException
Description copied from interface:IDocumentManager
Returns the entries in the specified folder.- Specified by:
getChildren
in interfaceIDocumentManager
- Parameters:
sessionConfig
- identifier for the session.serviceInstanceId
- the document service instance id.folderId
- the id of the folder.type
- the entry types to be returned. Must beDocumentConfig.TYPE_FOLDER
,DocumentConfig.TYPE_DOCUMENT
orIDocumentManager.TYPE_ALL
.transaction
- the transaction for persistence access.- Returns:
- the entries in the specified folder, or an empty collection if none is found.
- Throws:
PortalException
-
getFolderPath
public java.lang.String getFolderPath(SessionConfig sessionConfig, java.lang.String folderId, ITransaction transaction) throws PortalException
Description copied from interface:IDocumentManager
Returns the virtual path to the folder.- Specified by:
getFolderPath
in interfaceIDocumentManager
- Parameters:
sessionConfig
- identifier for the session.folderId
- the id of the folder.transaction
- the transaction for persistence access.- Returns:
- the virtual path to the folder.
- Throws:
PortalException
-
moveDocument
public void moveDocument(SessionConfig sessionConfig, java.lang.String documentId, java.lang.String destFolderId, ITransaction transaction) throws PortalException
Description copied from interface:IDocumentManager
Moves a document (or a folder) to another folder.- Specified by:
moveDocument
in interfaceIDocumentManager
- Parameters:
sessionConfig
- identifier for the session.documentId
- the document's id.destFolderId
- the id of the destination folder.transaction
- the transaction for persistence access.- Throws:
PortalException
-
updateDocumentHierarchyPublishTo
public void updateDocumentHierarchyPublishTo(java.lang.String documentId, java.util.Collection<java.lang.String> heritagePrincipalsId) throws PortalException
Description copied from interface:IDocumentManager
Update the list of principals the
document
is published toWhen the
document
type is afolder
, the entire file tree inside it will also be updated taking into account theirinheritance
.- Specified by:
updateDocumentHierarchyPublishTo
in interfaceIDocumentManager
- Parameters:
documentId
- Thedocument identifier
to updateheritagePrincipalsId
- The list of principals to set.- Throws:
PortalException
-
getDocumentPublishToPrincipals
public java.util.Collection<java.lang.String> getDocumentPublishToPrincipals(java.lang.String parentFolderId) throws PortalException
Description copied from interface:IDocumentManager
Return a the list of principals for which thedocument
is published to.- Specified by:
getDocumentPublishToPrincipals
in interfaceIDocumentManager
- Parameters:
parentFolderId
- Thedocument identifier
- Returns:
- A list containing the identifier of all principals.
- Throws:
PortalException
-
-