public interface DocumentDAO extends PersistentObjectDAO<Document>
Modifier and Type | Method and Description |
---|---|
void |
cleanExpiredTransactions()
Cleans all references to expired transactions.
|
long |
count(boolean computeDeleted)
Counts the number of documents
|
long |
countByIndexed(int indexed)
Counts the number of documents indexed or not
|
boolean |
delete(long docId,
History transaction)
This method deletes the document object and insert a new document history
entry.
|
void |
deleteAll(Collection<Document> documents,
History transaction)
Deletes all documents form the database and modifies the custom ids of
all documents
|
boolean |
deleteOrphaned(long deleteUserId)
This method deletes the documents into deleted folders.
|
List<String> |
findAllTags(String firstLetter)
Searches for all tags,
|
Document |
findByCustomId(String customId)
This method finds a document by the custom ID.
|
List<Document> |
findByFileNameAndParentFolderId(Long folderId,
String fileName,
Long excludeId,
Integer max)
Finds that document that lies under a specific folder (given by the id)
an with a given fileName(like operator is used)
|
List<Document> |
findByFolder(long folderId,
Integer max)
Finds all documents inside the given folder.
|
List<Document> |
findByIds(Long[] ids,
Integer max)
Finds all documents whose id is included in the given pool of ids
|
List<Document> |
findByIndexed(int indexed)
Finds all documents by the indexed state.
|
List<Document> |
findByLockUserAndStatus(Long userId,
Integer status)
Finds all document of the specified status and locked by the specified
user
|
List<Document> |
findByTitleAndParentFolderId(long folderId,
String title,
Long excludeId)
Finds that document that lies under a specific folder (given by the id)
an with a given title(like operator is used)
|
List<Long> |
findByUserId(long userId)
Finds all documents for an user.
|
List<Document> |
findByUserIdAndTag(long userId,
String tag,
Integer max)
Finds authorized documents for a user having a specified tag.
|
List<Document> |
findDeleted(long userId,
Integer maxHits)
Finds all deleted docs of a specific user.
|
List<Long> |
findDeletedDocIds()
Gets the collection of deleted document ids
|
List<Document> |
findDeletedDocs()
Finds the list of deleted documents.
|
List<Long> |
findDocIdByFolder(long folderId,
Integer max)
Finds all document ids inside the given folder.
|
List<Long> |
findDocIdByTag(String tag)
This method finds all Doc Ids by a tag.
|
List<Long> |
findDocIdByUserIdAndTag(long userId,
String tag)
Finds authorized documents ids for a user having a specified tag.
|
List<Document> |
findLastDownloadsByUserId(long userId,
int maxResults)
Finds the last downloaded documents by the given user
|
List<Document> |
findLastModifiedByUserId(long userId,
int maxResults)
Finds a max number of documents last modified by an user.
|
List<Document> |
findLinkedDocuments(long docId,
String linkType,
Integer direction)
This method enlists documents linked to the given document.
|
List<Document> |
findLockedByUserId(long userId)
Deprecated.
|
Collection<Long> |
findPublishedIds(Collection<Long> folderIds)
Finds all document ids inside the specified folders that are published in
the current date.
|
List<Long> |
findShortcutIds(long docId)
Gets the ids of all shortcuts associated to the document with the given
docId
|
Map<String,Integer> |
findTags(String firstLetter)
This method selects all tags and counts the occurrences.
|
long |
getTotalSize(boolean computeDeleted)
Obtains the total size of the archive, that is the sum of sizes of all
documents
|
void |
initialize(Document doc)
Initializes lazy loaded collections
|
void |
makeImmutable(long docId,
History transaction)
Marks the document, with the given docId, as immutable.
|
void |
restore(long docId,
long folderId,
History transaction)
Restores a previously deleted document
|
boolean |
store(Document doc,
History transaction)
This method persists the document object and insert a new document
history entry.
|
void |
updateDigest(Document doc)
Updates the document's digest (SHA-1)
|
bulkUpdate, delete, deleteAll, findAll, findAllIds, findById, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForRowSet, store
Document findByCustomId(String customId)
customId
- custom ID of the document.List<Long> findByUserId(long userId)
userId
- ID of the user.List<Long> findDocIdByFolder(long folderId, Integer max)
folderId
- Folder identifierList<Document> findByFolder(long folderId, Integer max)
folderId
- Folder identifier@Deprecated List<Document> findLockedByUserId(long userId)
userId
- Id of the user.List<Document> findByLockUserAndStatus(Long userId, Integer status)
userId
- The user id(optional)status
- The status code(optional)List<Document> findLastModifiedByUserId(long userId, int maxResults)
userId
- ID of the user.List<Document> findLastDownloadsByUserId(long userId, int maxResults)
userId
- id of the usermaxResults
- maximum number of returned elementsList<Document> findByIds(Long[] ids, Integer max)
List<Long> findDocIdByTag(String tag)
tag
- Tag of the document.Map<String,Integer> findTags(String firstLetter)
List<String> findAllTags(String firstLetter)
firstLetter
- Optional first letter hintList<Document> findByUserIdAndTag(long userId, String tag, Integer max)
userId
- ID of the usertag
- Tag of the documentmax
- Optional, defines the maximum records numberList<Long> findDocIdByUserIdAndTag(long userId, String tag)
userId
- ID of the user.tag
- Tag of the documentList<Document> findLinkedDocuments(long docId, String linkType, Integer direction)
Important: The attribute direction
defines the search
logic as follows:
docId
- All documents linked to this one will be searchedlinkType
- 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.List<Document> findByFileNameAndParentFolderId(Long folderId, String fileName, Long excludeId, Integer max)
folderId
- The folder id (it can be null).fileName
- excludeId
- Optional id of a document that must not be consideredmax
- Optional maximum number of returned elementsList<Document> findByTitleAndParentFolderId(long folderId, String title, Long excludeId)
folderId
- The folder id (it can be null).title
- excludeId
- Optional id of a document that must not be consideredvoid initialize(Document doc)
initialize
in interface PersistentObjectDAO<Document>
doc
- The document to be initializedlong getTotalSize(boolean computeDeleted)
computeDeleted
- If true, even deleted documents are consideredList<Document> findDeletedDocs()
Attention: The returned objects are not fully operative and are populated with a minimal set of data.
long count(boolean computeDeleted)
computeDeleted
- If true, even deleted documents are consideredList<Document> findByIndexed(int indexed)
indexed
- the indexed propertylong countByIndexed(int indexed)
void restore(long docId, long folderId, History transaction)
docId
- Id of the document to be restoredfolderId
- Id of the folder the document will be restored intotransaction
- entry to log the eventvoid makeImmutable(long docId, History transaction)
docId
- transaction
- entry to log the eventvoid deleteAll(Collection<Document> documents, History transaction)
documents
- The documents to be deletedtransaction
- entry to log the eventboolean store(Document doc, History transaction)
doc
- transaction
- entry to log the eventboolean delete(long docId, History transaction)
docId
- The id of the document to deletetransaction
- entry to log the eventList<Long> findShortcutIds(long docId)
docId
- The document IdList<Document> findDeleted(long userId, Integer maxHits)
userId
- The user that performed the deletionmaxHits
- Optional defines the max number of returned hitsboolean deleteOrphaned(long deleteUserId)
deleteUserId
- The id of the user that performs the deleting.Collection<Long> findPublishedIds(Collection<Long> folderIds)
folderIds
- Set of folder ids in which the method will searchvoid updateDigest(Document doc)
doc
- The document to be processedvoid cleanExpiredTransactions()
Copyright © 2008-2014 Logical Objects. All Rights Reserved.