Package com.logicaldoc.core.document
Class HibernateDocumentDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Document>
com.logicaldoc.core.document.HibernateDocumentDAO
- All Implemented Interfaces:
- DocumentDAO,- PersistentObjectDAO<Document>
@Repository("documentDAO")
public class HibernateDocumentDAO
extends HibernatePersistentObjectDAO<Document>
implements DocumentDAO
Hibernate implementation of 
DocumentDAO- Since:
- 3.0
- Author:
- Marco Meschieri - LogicalDOC
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Method SummaryModifier and TypeMethodDescriptionvoidapplyParentFolderSecurity(long docId, DocumentHistory transaction) Replaces the document's security policies with those from the parent foldervoidarchive(long docId, DocumentHistory transaction) Archives a documentvoidCleans all references to expired transactions.voidCleans the ld_uniquetag table removing no more used tags, this method is optimized and uses a couple of prepared statements, in case of error it switches toDocumentDAO.cleanUnexistingUniqueTagsOneByOne()voidCleans the ld_uniquetag table removing no more used tags programmatically one by one.longcomputeTotalSize(Long tenantId, Long userId, boolean computeDeleted) Obtains the total size of the repository, that is the sum of sizes of all documents and their versionslongCounts the number of documentslongcountByIndexed(IndexingStatus indexingStatus) Counts the number of documents in a given indexation status(@seeAbstractDocument.getIndexed()voiddelete(long docId, int delCode, DocumentHistory transaction) This method deletes the document object and insert a new document history entry.voiddelete(long docId, DocumentHistory transaction) Shortcut for delete(docId, 1, transaction)voiddeleteAll(Collection<Document> documents, int delCode, DocumentHistory transaction) Deletes all documents form the database and modifies the custom ids of all documentsvoiddeleteAll(Collection<Document> documents, DocumentHistory transaction) Shortcut for deleteAll(documents, 1, transaction)voiddeleteOrphaned(long deleteUserId) This method deletes the documents into deleted folders.findAliasIds(long docId) Gets the ids of all aliases associated to the document with the given docIdfindAllTags(String firstLetter, Long tenantId) Searches for all tags,findArchivedByFolder(long folderId) Finds archived documents in a folder (direct childeren only)findByCustomId(String customId, long tenantId) This method finds a document by the custom ID.findByFileNameAndParentFolderId(Long folderId, String fileName, Long excludeId, Long tenantId, Integer max) Finds that document that lies under a specific folder (given by the id) an with a given fileName(like operator is used)findByFolder(long folderId, Integer max) Finds all documents direct children of the given folder.Finds all documents whose id is included in the given pool of idsfindByIndexingStatus(IndexingStatus indexingStatus) Finds all documents by the indexing status.findByLockUserAndStatus(Long userId, DocumentStatus status) Finds all document of0 the specified status and locked by the specified userfindByPath(String path, long tenantId) Finds a document by it's full pathfindByUserId(long userId) Finds all documents for a user.findByUserIdAndTag(long userId, String tag, Integer max) Finds authorized documents for a user having a specified tag.findDeleted(long userId, Integer maxHits) Finds all deleted docs of a specific user.Gets the collection of deleted document idsFinds the list of deleted documents.findDocIdByFolder(long folderId, Integer max) Finds all document ids inside the given folder.findDocIdByTag(String tag) This method finds all Doc Ids by a tag.findDocIdByUserIdAndTag(long userId, String tag) Finds authorized documents ids for a user having a specified tag.findDocument(long docId) This method finds a document by the ID and if it is an alias the referenced document is returned instead.findDuplicatedDigests(Long tenantId, Long folderId) Retrieves the list of duplicated checksumsfindLastDownloadsByUserId(long userId, int maxResults) Finds the last downloaded documents by the given userfindLastModifiedByUserId(long userId, int maxElements) Finds a max number of documents last modified by an user.findLinkedDocuments(long docId, String linkType, Integer direction) This method enlists documents linked to the given document.findPublishedIds(Collection<Long> folderIds) Finds all document ids inside the specified folders that are published in the current date.findTags(long docId) Retrieves the alphabetically ordered list of all the document's tagsSelects all tags and counts the occurrences.getAllowedPermissions(long docId, long userId) Finds all permissions of a user enabled on the specified documentgetTagCloud(long tenantId, int maxTags) Gets the tag cloud for the given tenantgetTagCloud(String sid) Gets the tag cloud for the given tenantgetWorkspace(long docId) Retrieves, the workspace where the document(or alias) is storedvoidinitialize(Document doc) Doesn't do anything by defaultvoidPuts into ld_uniquetag the new unique tagsbooleanisDownloadAllowed(long id, long userId) booleanisMoveAllowed(long id, long userId) booleanisPermissionAllowed(Permission permission, long documentId, long userId) This method checks if the given permission is enabled for a document and an user.booleanisPreviewAllowed(long docId, long userId) booleanisPrintAllowed(long id, long userId) booleanisReadAllowed(long docId, long userId) booleanisWriteAllowed(long id, long userId) This method is looking up for writing rights for a document and an user.voidmakeImmutable(long docId, DocumentHistory transaction) Marks the document, with the given docId, as immutable.voidrestore(long docId, long folderId, DocumentHistory transaction) Restores a previously deleted documentvoidsaveDocumentHistory(Document doc, DocumentHistory transaction) Saves a document's historyvoidsetPassword(long docId, String password, DocumentHistory transaction) Protects the document with a password.voidThis method persists the entity objectvoidstore(Document doc, DocumentHistory transaction) This method persists the document object and insert a new document history entryvoidunarchive(long docId, DocumentHistory transaction) Restores a previously archived documentvoidunsetPassword(long docId, DocumentHistory transaction) Removes the password protection from the document.voidUpdates the count of the unique tagsvoidupdateDigest(Document doc) Updates the document's digest (SHA-1)Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAObulkUpdate, delete, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, setSessionFactoryMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.logicaldoc.core.PersistentObjectDAObulkUpdate, delete, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString
- 
Method Details- 
archiveDescription copied from interface:DocumentDAOArchives a document- Specified by:
- archivein interface- DocumentDAO
- Parameters:
- docId- identifier of the document
- transaction- entry to log the event
- Throws:
- PersistenceException- error at data layer
 
- 
unarchiveDescription copied from interface:DocumentDAORestores a previously archived document- Specified by:
- unarchivein interface- DocumentDAO
- Parameters:
- docId- Ids of the document to be restored
- transaction- entry to log the event
- Throws:
- PersistenceException- error at data layer
 
- 
deleteDescription copied from interface:DocumentDAOShortcut for delete(docId, 1, transaction)- Specified by:
- deletein interface- DocumentDAO
- Parameters:
- docId- identifier of the document
- transaction- entry to log the event
- Throws:
- PersistenceException- error at data layer
 
- 
deletepublic void delete(long docId, int delCode, DocumentHistory transaction) throws PersistenceException Description copied from interface:DocumentDAOThis method deletes the document object and insert a new document history entry.- Specified by:
- deletein interface- DocumentDAO
- Parameters:
- docId- The id of the document to delete
- delCode- The deletion code
- transaction- entry to log the event
- Throws:
- PersistenceException- error at data layer
 
- 
findByUserIdDescription copied from interface:DocumentDAOFinds all documents for a user.- Specified by:
- findByUserIdin interface- DocumentDAO
- Parameters:
- userId- ID of the user.
- Returns:
- Collection of all documentId required for the specified user.
- Throws:
- PersistenceException- error at data layer
 
- 
findByLockUserAndStatusDescription copied from interface:DocumentDAOFinds all document of0 the specified status and locked by the specified user- Specified by:
- findByLockUserAndStatusin interface- DocumentDAO
- Parameters:
- userId- The user id(optional)
- status- The status(optional)
- Returns:
- Collection of all Documents locked by the specified user and of the specified status.
 
- 
findDocIdByTagDescription copied from interface:DocumentDAOThis method finds all Doc Ids by a tag.- Specified by:
- findDocIdByTagin interface- DocumentDAO
- Parameters:
- tag- Tag of the document.
- Returns:
- Document with specified tag.
- Throws:
- PersistenceException- error at data layer
 
- 
storeDescription copied from interface:PersistentObjectDAOThis method persists the entity object- Specified by:
- storein interface- PersistentObjectDAO<Document>
- Overrides:
- storein class- HibernatePersistentObjectDAO<Document>
- Parameters:
- doc- entity to be stored
- Throws:
- PersistenceException- raised in case of errors in the database
 
- 
storeDescription copied from interface:DocumentDAOThis method persists the document object and insert a new document history entry- Specified by:
- storein interface- DocumentDAO
- Parameters:
- doc- the document
- transaction- entry to log the event
- Throws:
- PersistenceException- error at data layer
 
- 
updateDigestDescription copied from interface:DocumentDAOUpdates the document's digest (SHA-1)- Specified by:
- updateDigestin interface- DocumentDAO
- Parameters:
- doc- The document to be processed
- Throws:
- PersistenceException- error at data layer
 
- 
findLastModifiedByUserIdpublic List<Document> findLastModifiedByUserId(long userId, int maxElements) throws PersistenceException Description copied from interface:DocumentDAOFinds a max number of documents last modified by an user.- Specified by:
- findLastModifiedByUserIdin interface- DocumentDAO
- Parameters:
- userId- ID of the user.
- maxElements- maximum number of returned elements
- Returns:
- Collection of the last documents changed by the specified user.
- Throws:
- PersistenceException- error at data layer
 
- 
findTagsDescription copied from interface:DocumentDAORetrieves the alphabetically ordered list of all the document's tags- Specified by:
- findTagsin interface- DocumentDAO
- Parameters:
- docId- identifier of the document
- Returns:
- list of the document's tags
- Throws:
- PersistenceException- error at data layer
 
- 
findTagsDescription copied from interface:DocumentDAOSelects all tags and counts the occurrences.- Specified by:
- findTagsin interface- DocumentDAO
- Parameters:
- firstLetter- the first letter
- tenantId- identifier of the tenant
- Returns:
- the map tag - count
- Throws:
- PersistenceException- error at data layer
 
- 
findAllTagsDescription copied from interface:DocumentDAOSearches for all tags,- Specified by:
- findAllTagsin interface- DocumentDAO
- Parameters:
- firstLetter- Optional first letter hint
- tenantId- ID of the tenant to search in
- Returns:
- The list of all tags in the system
- Throws:
- PersistenceException- error at data layer
 
- 
findByUserIdAndTagpublic List<Document> findByUserIdAndTag(long userId, String tag, Integer max) throws PersistenceException Description copied from interface:DocumentDAOFinds authorized documents for a user having a specified tag.- Specified by:
- findByUserIdAndTagin interface- DocumentDAO
- Parameters:
- userId- ID of the user
- tag- Tag of the document
- max- Optional, defines the maximum records number
- Returns:
- Collection of found documents
- Throws:
- PersistenceException- error at data layer
 
- 
findDocIdByUserIdAndTagDescription copied from interface:DocumentDAOFinds authorized documents ids for a user having a specified tag.- Specified by:
- findDocIdByUserIdAndTagin interface- DocumentDAO
- Parameters:
- userId- ID of the user.
- tag- Tag of the document
- Returns:
- Set of found ids.
- Throws:
- PersistenceException- error at data layer
 
- 
findLastDownloadsByUserIdpublic List<Document> findLastDownloadsByUserId(long userId, int maxResults) throws PersistenceException Description copied from interface:DocumentDAOFinds the last downloaded documents by the given user- Specified by:
- findLastDownloadsByUserIdin interface- DocumentDAO
- Parameters:
- userId- id of the user
- maxResults- maximum number of returned elements
- Returns:
- list of documents
- Throws:
- PersistenceException- error at data layer
 
- 
findDocIdByFolderDescription copied from interface:DocumentDAOFinds all document ids inside the given folder.- Specified by:
- findDocIdByFolderin interface- DocumentDAO
- Parameters:
- folderId- Folder identifier
- max- Optional, maximum number of returned elements
- Returns:
- Collection of all document id in the folder.
- Throws:
- PersistenceException- error at data layer
 
- 
findByFolderDescription copied from interface:DocumentDAOFinds all documents direct children of the given folder.- Specified by:
- findByFolderin interface- DocumentDAO
- Parameters:
- folderId- Folder identifier
- max- Optional, defines the maximum records number
- Returns:
- Collection of all documents in the folder
- Throws:
- PersistenceException- error at data layer
 
- 
findArchivedByFolderDescription copied from interface:DocumentDAOFinds archived documents in a folder (direct childeren only)- Specified by:
- findArchivedByFolderin interface- DocumentDAO
- Parameters:
- folderId- identifier of the folder
- Returns:
- list of documents
- Throws:
- PersistenceException- error at data layer
 
- 
findLinkedDocumentspublic List<Document> findLinkedDocuments(long docId, String linkType, Integer direction) throws PersistenceException Description copied from interface:DocumentDAOThis method enlists documents linked to the given document.Important: The attribute directiondefines the search logic as follows:- 1: docId will be compared to link's document1
- 2: docId will be compared to link's document2
- null: docId will be compared to both document1 and document2
 - Specified by:
- findLinkedDocumentsin interface- DocumentDAO
- Parameters:
- docId- All documents linked to this one will be searched
- linkType- Type of the link (optional)
- direction- if 1 docId will be compared to link's document1, id 2 docId will be compared to link's document2, if null docId will be compared to both document1 and document2 of the link.
- Returns:
- The collection of linked documents
- Throws:
- PersistenceException- error at data layer
 
- 
findByFileNameAndParentFolderIdpublic List<Document> findByFileNameAndParentFolderId(Long folderId, String fileName, Long excludeId, Long tenantId, Integer max) throws PersistenceException Description copied from interface:DocumentDAOFinds that document that lies under a specific folder (given by the id) an with a given fileName(like operator is used)- Specified by:
- findByFileNameAndParentFolderIdin interface- DocumentDAO
- Parameters:
- folderId- The folder id (it can be null).
- fileName- name of the file or a part of it (you can use SQL % jolly chars, eg: contract.pdf, %ontrac%)
- excludeId- Optional id of a document that must not be considered
- tenantId- Optional id of the tenant
- max- Optional maximum number of returned elements
- Returns:
- The list of documents with the given fileName. If the folder id is null, the searched document can belong to any folder in the repository
- Throws:
- PersistenceException- error at data layer
 
- 
initializeDescription copied from class:HibernatePersistentObjectDAODoesn't do anything by default- Specified by:
- initializein interface- DocumentDAO
- Specified by:
- initializein interface- PersistentObjectDAO<Document>
- Overrides:
- initializein class- HibernatePersistentObjectDAO<Document>
- Parameters:
- doc- The entity to be initialised
 
- 
findDeletedDocIdsDescription copied from interface:DocumentDAOGets the collection of deleted document ids- Specified by:
- findDeletedDocIdsin interface- DocumentDAO
- Returns:
- collection of document identifiers
- Throws:
- PersistenceException- error at data layer
 
- 
findDeletedDocsDescription copied from interface:DocumentDAOFinds the list of deleted documents.Attention: The returned objects are not fully operative and are populated with a minimal set of data. - Specified by:
- findDeletedDocsin interface- DocumentDAO
- Returns:
- the list of documents
- Throws:
- PersistenceException- error at data layer
 
- 
computeTotalSizepublic long computeTotalSize(Long tenantId, Long userId, boolean computeDeleted) throws PersistenceException Description copied from interface:DocumentDAOObtains the total size of the repository, that is the sum of sizes of all documents and their versions- Specified by:
- computeTotalSizein interface- DocumentDAO
- Parameters:
- tenantId- identifier of the tenant(optional)
- userId- identifier of the publisher user (optional)
- computeDeleted- If true, even deleted documents are considered
- Returns:
- the total size expressed in bytes
- Throws:
- PersistenceException- error at data layer
 
- 
countpublic long count(Long tenantId, boolean computeDeleted, boolean computeArchived) throws PersistenceException Description copied from interface:DocumentDAOCounts the number of documents- Specified by:
- countin interface- DocumentDAO
- Parameters:
- tenantId- The tenant to search in
- computeDeleted- If true, even deleted documents are considered
- computeArchived- If true, even archived documents are considered
- Returns:
- number of documents
- Throws:
- PersistenceException- error at data layer
 
- 
findByIndexingStatuspublic List<Document> findByIndexingStatus(IndexingStatus indexingStatus) throws PersistenceException Description copied from interface:DocumentDAOFinds all documents by the indexing status. Order by ascending lastModifed- Specified by:
- findByIndexingStatusin interface- DocumentDAO
- Parameters:
- indexingStatus- the indexing status
- Returns:
- Collection of all documents
- Throws:
- PersistenceException- error at data layer
 
- 
restorepublic void restore(long docId, long folderId, DocumentHistory transaction) throws PersistenceException Description copied from interface:DocumentDAORestores a previously deleted document- Specified by:
- restorein interface- DocumentDAO
- Parameters:
- docId- Id of the document to be restored
- folderId- Id of the folder the document will be restored into
- transaction- entry to log the event
- Throws:
- PersistenceException- error at data layer
 
- 
findByCustomIdDescription copied from interface:DocumentDAOThis method finds a document by the custom ID.- Specified by:
- findByCustomIdin interface- DocumentDAO
- Parameters:
- customId- custom ID of the document.
- tenantId- ID of the contained tenant.
- Returns:
- Document with given ID.
- Throws:
- PersistenceException- error at data layer
 
- 
makeImmutableDescription copied from interface:DocumentDAOMarks the document, with the given docId, as immutable. Unlocks the document if it was locked.- Specified by:
- makeImmutablein interface- DocumentDAO
- Parameters:
- docId- identifier of the document
- transaction- entry to log the event
- Throws:
- PersistenceException- error at data layer
 
- 
deleteAllpublic void deleteAll(Collection<Document> documents, DocumentHistory transaction) throws PersistenceException Description copied from interface:DocumentDAOShortcut for deleteAll(documents, 1, transaction)- Specified by:
- deleteAllin interface- DocumentDAO
- Parameters:
- documents- the documents
- transaction- the current session
- Throws:
- PersistenceException- error at data layer
 
- 
deleteAllpublic void deleteAll(Collection<Document> documents, int delCode, DocumentHistory transaction) throws PersistenceException Description copied from interface:DocumentDAODeletes all documents form the database and modifies the custom ids of all documents- Specified by:
- deleteAllin interface- DocumentDAO
- Parameters:
- documents- The documents to be deleted
- delCode- The deletion code
- transaction- entry to log the event
- Throws:
- PersistenceException- error at data layer
 
- 
saveDocumentHistorypublic void saveDocumentHistory(Document doc, DocumentHistory transaction) throws PersistenceException Description copied from interface:DocumentDAOSaves a document's history- Specified by:
- saveDocumentHistoryin interface- DocumentDAO
- Parameters:
- doc- the document
- transaction- the current session
- Throws:
- PersistenceException- error at data layer
 
- 
countByIndexedDescription copied from interface:DocumentDAOCounts the number of documents in a given indexation status(@seeAbstractDocument.getIndexed()- Specified by:
- countByIndexedin interface- DocumentDAO
- Parameters:
- indexingStatus- the indexation status to check
- Returns:
- number of documents
- Throws:
- PersistenceException- error at data layer
 
- 
findAliasIdsDescription copied from interface:DocumentDAOGets the ids of all aliases associated to the document with the given docId- Specified by:
- findAliasIdsin interface- DocumentDAO
- Parameters:
- docId- identifier of the document
- Returns:
- list of identifiers of aliases
- Throws:
- PersistenceException- error at data layer
 
- 
findDeletedDescription copied from interface:DocumentDAOFinds all deleted docs of a specific user.- Specified by:
- findDeletedin interface- DocumentDAO
- Parameters:
- userId- The user that performed the deletion
- maxHits- Optional, defines the max number of returned elements
- Returns:
- The documents list
- Throws:
- PersistenceException- error at data layer
 
- 
findByIdsDescription copied from interface:DocumentDAOFinds all documents whose id is included in the given pool of ids- Specified by:
- findByIdsin interface- DocumentDAO
- Parameters:
- ids- identifiers of the documents
- max- Optional, maximum number of returned elements
- Returns:
- list of documents
 
- 
deleteOrphanedDescription copied from interface:DocumentDAOThis method deletes the documents into deleted folders.- Specified by:
- deleteOrphanedin interface- DocumentDAO
- Parameters:
- deleteUserId- The id of the user that performs the deleting
- Throws:
- PersistenceException- error at data layer
 
- 
findPublishedIdsDescription copied from interface:DocumentDAOFinds all document ids inside the specified folders that are published in the current date.- Specified by:
- findPublishedIdsin interface- DocumentDAO
- Parameters:
- folderIds- Set of folder ids in which the method will search
- Returns:
- List of published document ids
- Throws:
- PersistenceException- error at data layer
 
- 
cleanExpiredTransactionsDescription copied from interface:DocumentDAOCleans all references to expired transactions. If no lock is found for a document referencing a given transaction, the transactionId will be set to null.- Specified by:
- cleanExpiredTransactionsin interface- DocumentDAO
- Throws:
- PersistenceException- error at data layer
 
- 
cleanUnexistingUniqueTagsDescription copied from interface:DocumentDAOCleans the ld_uniquetag table removing no more used tags, this method is optimized and uses a couple of prepared statements, in case of error it switches toDocumentDAO.cleanUnexistingUniqueTagsOneByOne()- Specified by:
- cleanUnexistingUniqueTagsin interface- DocumentDAO
- Throws:
- PersistenceException- error at data layer
 
- 
cleanUnexistingUniqueTagsOneByOneDescription copied from interface:DocumentDAOCleans the ld_uniquetag table removing no more used tags programmatically one by one. This method is not as optimized asDocumentDAO.cleanUnexistingUniqueTags()and should not be invoked directly- Specified by:
- cleanUnexistingUniqueTagsOneByOnein interface- DocumentDAO
- Throws:
- PersistenceException- error at data layer
 
- 
insertNewUniqueTagsDescription copied from interface:DocumentDAOPuts into ld_uniquetag the new unique tags- Specified by:
- insertNewUniqueTagsin interface- DocumentDAO
- Throws:
- PersistenceException- error at data layer
 
- 
updateCountUniqueTagsDescription copied from interface:DocumentDAOUpdates the count of the unique tags- Specified by:
- updateCountUniqueTagsin interface- DocumentDAO
- Throws:
- PersistenceException- error at data layer
 
- 
getTagCloudDescription copied from interface:DocumentDAOGets the tag cloud for the given tenant- Specified by:
- getTagCloudin interface- DocumentDAO
- Parameters:
- tenantId- identifier of the tenant
- maxTags- maximum number of returned elements
- Returns:
- list of tag clouds
- Throws:
- PersistenceException- error at data layer
 
- 
getTagCloudDescription copied from interface:DocumentDAOGets the tag cloud for the given tenant- Specified by:
- getTagCloudin interface- DocumentDAO
- Parameters:
- sid- identifier of the session
- Returns:
- list of tag clouds
- Throws:
- PersistenceException- error at data layer
 
- 
findDocumentDescription copied from interface:DocumentDAOThis method finds a document by the ID and if it is an alias the referenced document is returned instead.- Specified by:
- findDocumentin interface- DocumentDAO
- Parameters:
- docId- ID of the document(or the alias)
- Returns:
- Document with given ID
- Throws:
- PersistenceException- an error happened in the database
 
- 
getWorkspaceDescription copied from interface:DocumentDAORetrieves, the workspace where the document(or alias) is stored- Specified by:
- getWorkspacein interface- DocumentDAO
- Parameters:
- docId- identifier of a document
- Returns:
- the parent workspace
- Throws:
- PersistenceException- error at data layer
 
- 
setPasswordpublic void setPassword(long docId, String password, DocumentHistory transaction) throws PersistenceException Description copied from interface:DocumentDAOProtects the document with a password. The same password is replicated to all the versions- Specified by:
- setPasswordin interface- DocumentDAO
- Parameters:
- docId- ID of the document
- password- The new password in clear
- transaction- history informations
- Throws:
- PersistenceException- error at data layer
 
- 
unsetPasswordDescription copied from interface:DocumentDAORemoves the password protection from the document. The same action is replicated to all the versions- Specified by:
- unsetPasswordin interface- DocumentDAO
- Parameters:
- docId- ID of the document
- transaction- session informations
- Throws:
- PersistenceException- error at data layer
 
- 
findByPathDescription copied from interface:DocumentDAOFinds a document by it's full path- Specified by:
- findByPathin interface- DocumentDAO
- Parameters:
- path- The path comprehensive of the file name
- tenantId- The tenant
- Returns:
- the found document
- Throws:
- PersistenceException- error at data layer
 
- 
findDuplicatedDigestsDescription copied from interface:DocumentDAORetrieves the list of duplicated checksums- Specified by:
- findDuplicatedDigestsin interface- DocumentDAO
- Parameters:
- tenantId- identifier of the tenant
- folderId- identifier of the folder
- Returns:
- list of duplicated digests
- Throws:
- PersistenceException- error at data layer
 
- 
isPrintAllowed- Specified by:
- isPrintAllowedin interface- DocumentDAO
- Throws:
- PersistenceException
 
- 
isWriteAllowedDescription copied from interface:DocumentDAOThis method is looking up for writing rights for a document and an user.- Specified by:
- isWriteAllowedin interface- DocumentDAO
- Parameters:
- id- ID of the document
- userId- ID of the user
- Returns:
- if the write permission is granted
- Throws:
- PersistenceException- error at data layer
 
- 
isDownloadAllowed- Specified by:
- isDownloadAllowedin interface- DocumentDAO
- Throws:
- PersistenceException
 
- 
isMoveAllowed- Specified by:
- isMoveAllowedin interface- DocumentDAO
- Throws:
- PersistenceException
 
- 
isReadAllowed- Specified by:
- isReadAllowedin interface- DocumentDAO
- Throws:
- PersistenceException
 
- 
isPreviewAllowed- Specified by:
- isPreviewAllowedin interface- DocumentDAO
- Throws:
- PersistenceException
 
- 
isPermissionAllowedpublic boolean isPermissionAllowed(Permission permission, long documentId, long userId) throws PersistenceException Description copied from interface:DocumentDAOThis method checks if the given permission is enabled for a document and an user.- Specified by:
- isPermissionAllowedin interface- DocumentDAO
- Parameters:
- permission- the permission to check
- documentId- ID of the folder
- userId- ID of the user
- Returns:
- if the permission is granted to the user
- Throws:
- PersistenceException- error at data layer
 
- 
getAllowedPermissionsDescription copied from interface:DocumentDAOFinds all permissions of a user enabled on the specified document- Specified by:
- getAllowedPermissionsin interface- DocumentDAO
- Parameters:
- docId- ID of the document
- userId- ID of the user
- Returns:
- Collection of enabled permissions
- Throws:
- PersistenceException- error at data layer
 
- 
applyParentFolderSecuritypublic void applyParentFolderSecurity(long docId, DocumentHistory transaction) throws PersistenceException Description copied from interface:DocumentDAOReplaces the document's security policies with those from the parent folder- Specified by:
- applyParentFolderSecurityin interface- DocumentDAO
- Parameters:
- docId- identifier of the document
- transaction- the current transaction
- Throws:
- PersistenceException- error at data layer
 
 
-