public class DocumentManagerImpl extends Object implements DocumentManager
DocumentManager
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
DocumentManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
changeIndexingStatus(Document doc,
int status)
Utility method used to declare that:
a document must be taken into consideration by the indexer (status =
AbstractDocument.INDEX_TO_INDEX).
|
void |
checkin(long docId,
File file,
String filename,
boolean release,
Document docVO,
History transaction)
Checks in the given document
|
void |
checkin(long docId,
InputStream content,
String filename,
boolean release,
Document docVO,
History transaction)
Checks in the given document
|
void |
checkout(long docId,
History transaction)
Checks out the given document
|
Document |
copyToFolder(Document doc,
Folder folder,
History transaction)
Copy a document to the specified folder.
|
Document |
create(File file,
Document docVO,
History transaction)
Creates a new Document.
|
Document |
create(InputStream content,
Document docVO,
History transaction)
Creates a new Document.
|
Document |
createShortcut(Document doc,
Folder folder,
History transaction)
Create a shortcut associated to the given doc to the specified folder.
|
void |
deleteFromIndex(Document doc)
Utility method for document removal from index
|
Version |
deleteVersion(long versionId,
History transaction)
Deletes a specific version.
|
void |
lock(long docId,
int status,
History transaction)
Locks the given document
|
void |
makeImmutable(long docId,
History transaction)
Marks the document, with the given docId, as immutable and save the given
document history
|
void |
moveToFolder(Document doc,
Folder folder,
History transaction)
Moves a document to the specified folder.
|
void |
reindex(long docId)
Reindexes an existing document in the full-text index.
|
void |
rename(Document doc,
String newName,
boolean title,
History transaction)
Rename an existing document title/filename.
|
void |
setConfig(ContextProperties config) |
void |
setDocumentDAO(DocumentDAO documentDAO) |
void |
setDocumentTemplateDAO(DocumentTemplateDAO documentTemplateDAO) |
void |
setFolderDAO(FolderDAO folderDAO) |
void |
setIndexer(SearchEngine indexer) |
void |
setListenerManager(DocumentListenerManager listenerManager) |
void |
setStorer(Storer storer) |
void |
setUserDAO(UserDAO userDAO) |
void |
setVersionDAO(VersionDAO versionDAO) |
void |
unlock(long docId,
History transaction)
UNChecks out the given document
|
void |
update(Document doc,
Document docVO,
History transaction)
Updates an existing document and marks it to be re-indexed
|
public void setListenerManager(DocumentListenerManager listenerManager)
public void setDocumentDAO(DocumentDAO documentDAO)
public void setDocumentTemplateDAO(DocumentTemplateDAO documentTemplateDAO)
public void setIndexer(SearchEngine indexer)
public void checkin(long docId, File file, String filename, boolean release, Document docVO, History transaction) throws Exception
DocumentManager
checkin
in interface DocumentManager
docId
- the document to be checked infile
- of the new document versionfilename
- new filename (can also be the old one)release
- True if this is a new release(eg: 2.0) rather than a
subversion(eg: 1.1)docVO
- The value object containing document's metadata applied
during the checkin (optional)transaction
- entry to log the event, set the user and commentException
- if an error occurs, this exception is thrownpublic void checkin(long docId, InputStream content, String filename, boolean release, Document docVO, History transaction) throws Exception
DocumentManager
checkin
in interface DocumentManager
docId
- the document to be checked incontent
- input stream pointing to the new document versionfilename
- new filename (can also be the old one)release
- True if this is a new release(eg: 2.0) rather than a
subversion(eg: 1.1)docVO
- The value object containing document's metadata applied
during the checkin (optional)transaction
- entry to log the event, set the user and commentException
- if an error occurs, this exception is thrownpublic void checkout(long docId, History transaction) throws Exception
DocumentManager
checkout
in interface DocumentManager
docId
- the document to be checked outException
- if an error occurs, this exception is thrownpublic void lock(long docId, int status, History transaction) throws Exception
DocumentManager
lock
in interface DocumentManager
docId
- the document to be lockedstatus
- the lock type (used to populate status attribute of the
document)transaction
- entry to log the event (set the user)Exception
- if an error occurs, this exception is thrownpublic void deleteFromIndex(Document doc)
deleteFromIndex
in interface DocumentManager
doc
- public void reindex(long docId) throws Exception
DocumentManager
reindex
in interface DocumentManager
docId
- The document to be indexedException
- if an error occurs, this exception is thrownpublic void update(Document doc, Document docVO, History transaction) throws Exception
DocumentManager
update
in interface DocumentManager
doc
- The document to be updateddocVO
- value object containing the new metadatatransaction
- entry to log the event (set the user)Exception
- if an error occurs, this exception is thrownpublic void moveToFolder(Document doc, Folder folder, History transaction) throws Exception
DocumentManager
moveToFolder
in interface DocumentManager
doc
- The document to movefolder
- The target foldertransaction
- entry to log the event (set the user)Exception
public Document create(File file, Document docVO, History transaction) throws Exception
DocumentManager
create
in interface DocumentManager
file
- The document's filedocVO
- The value object containing the document's metadatatransaction
- The trandaction metadata (remember to set the user and
the comment)Exception
public Document create(InputStream content, Document docVO, History transaction) throws Exception
DocumentManager
create
in interface DocumentManager
content
- The document's contentdocVO
- The value object containing the document's metadatatransaction
- The transaction metadata (remember to set the user and
the comment)Exception
public Document copyToFolder(Document doc, Folder folder, History transaction) throws Exception
DocumentManager
copyToFolder
in interface DocumentManager
doc
- The document to movefolder
- The target foldertransaction
- entry to log the event (set the user)Exception
public void unlock(long docId, History transaction) throws Exception
DocumentManager
unlock
in interface DocumentManager
docId
- the document to be unchecked outtransaction
- entry to log the eventException
- if an error occurs, this exception is thrownpublic void makeImmutable(long docId, History transaction) throws Exception
DocumentManager
makeImmutable
in interface DocumentManager
transaction
- entry to log the event (set the user)Exception
public void rename(Document doc, String newName, boolean title, History transaction) throws Exception
DocumentManager
rename
in interface DocumentManager
doc
- The document to be renamednewName
- The new title/filename of the documenttitle
- True if the title must be renamed, False for the filenametransaction
- entry to log the event (set the user)Exception
- if an error occurs, this exception is thrownpublic Document createShortcut(Document doc, Folder folder, History transaction) throws Exception
DocumentManager
createShortcut
in interface DocumentManager
doc
- The document for which will be created the shortcutfolder
- The target foldertransaction
- entry to log the event (set the user)Exception
public void setVersionDAO(VersionDAO versionDAO)
public void setStorer(Storer storer)
setStorer
in interface DocumentManager
public void setConfig(ContextProperties config)
public void changeIndexingStatus(Document doc, int status)
DocumentManager
changeIndexingStatus
in interface DocumentManager
doc
- The document for which will be changed the indexer status.status
- The new document indexer status.public void setUserDAO(UserDAO userDAO)
public void setFolderDAO(FolderDAO folderDAO)
public Version deleteVersion(long versionId, History transaction) throws Exception
DocumentManager
deleteVersion
in interface DocumentManager
versionId
- The version to deleteException
Copyright © 2008-2014 Logical Objects. All Rights Reserved.