|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.silverpeas.attachment.SimpleDocumentService
@Service public class SimpleDocumentService
| Field Summary |
|---|
| Fields inherited from interface org.silverpeas.attachment.AttachmentService |
|---|
NO_UPDATE_MODE, UPDATE_DIRECT_MODE, UPDATE_SHORTCUT_MODE, VERSION_MODE |
| Constructor Summary | |
|---|---|
SimpleDocumentService()
|
|
| Method Summary | |
|---|---|
void |
addXmlForm(SimpleDocumentPK pk,
String language,
String xmlFormName)
|
SimpleDocumentPK |
changeVersionState(SimpleDocumentPK pk,
String comment)
Change the management of versions of the document. |
SimpleDocumentPK |
cloneDocument(SimpleDocument original,
String foreignCloneId)
Clone the attachment. |
List<SimpleDocumentPK> |
copyAllDocuments(WAPrimaryKey resourceSourcePk,
WAPrimaryKey targetDestinationPk)
Copies all the attachment linked to a resource to another one. |
SimpleDocumentPK |
copyDocument(SimpleDocument original,
ForeignPK targetPk)
Clone the attachment. |
SimpleDocument |
createAttachment(SimpleDocument document,
File content)
Create file attached to an object who is identified by the foreignId. |
SimpleDocument |
createAttachment(SimpleDocument document,
File content,
boolean indexIt)
Create file attached to an object who is identified by the foreignId. |
SimpleDocument |
createAttachment(SimpleDocument document,
File content,
boolean indexIt,
boolean invokeCallback)
Create file attached to an object who is identified by the foreignId. |
SimpleDocument |
createAttachment(SimpleDocument document,
InputStream content)
Create file attached to an object who is identified by the foreignId. |
SimpleDocument |
createAttachment(SimpleDocument document,
InputStream content,
boolean indexIt)
Create file attached to an object who is identified by the foreignId. |
SimpleDocument |
createAttachment(SimpleDocument document,
InputStream content,
boolean indexIt,
boolean invokeCallback)
Create file attached to an object who is identified by the foreignId. |
void |
createIndex(SimpleDocument document)
|
void |
createIndex(SimpleDocument document,
Date startOfVisibility,
Date endOfVisibility)
|
void |
deleteAllAttachments(String componentInstanceId)
Deletes all the documents related to the component instance identified by the specified identifier. |
void |
deleteAllAttachments(String resourceId,
String componentInstanceId)
Deletes all the document attached to a component resource. |
void |
deleteAttachment(SimpleDocument document)
Delete a given attachment. |
void |
deleteAttachment(SimpleDocument document,
boolean invokeCallback)
Delete a given attachment. |
void |
deleteIndex(SimpleDocument document)
|
SimpleDocument |
findExistingDocument(SimpleDocumentPK pk,
String fileName,
ForeignPK foreign,
String lang)
Find documents with the same name attached to the specified foreign id. |
void |
getBinaryContent(File file,
SimpleDocumentPK pk,
String lang)
Writes the binary content into the specified File. |
void |
getBinaryContent(OutputStream output,
SimpleDocumentPK pk,
String lang)
Writes the binary content into the specified OutputStream. |
void |
getBinaryContent(OutputStream output,
SimpleDocumentPK pk,
String lang,
long contentOffset,
long contentLength)
Writes the binary content contained between begin and end indexes into the specified OutputStream. |
void |
indexAllDocuments(WAPrimaryKey fk,
Date startOfVisibilityPeriod,
Date endOfVisibilityPeriod)
Indexes all the documents (whatever their type) of a container. |
SimpleDocumentList<SimpleDocument> |
listAllDocumentsByForeignKey(WAPrimaryKey foreignKey,
String lang)
Search all documents (files, xmlform content, wysiwyg) attached to a foreign object. |
SimpleDocumentList<SimpleDocument> |
listDocumentsByForeignKey(WAPrimaryKey foreignKey,
String lang)
Search all files attached to a foreign object. |
SimpleDocumentList<SimpleDocument> |
listDocumentsByForeignKeyAndType(WAPrimaryKey foreignKey,
DocumentType type,
String lang)
Search all file attached to a foreign object. |
List<SimpleDocument> |
listDocumentsLockedByUser(String usedId,
String language)
Search all the documents locked by a specific user. |
List<SimpleDocument> |
listDocumentsRequiringWarning(Date alertDate,
String language)
Search all the documents in an instance which are locked at the alert date. |
List<SimpleDocument> |
listDocumentsToUnlock(Date expiryDate,
String language)
Search all the documents in an instance requiring to be unlocked at the specified date. |
List<SimpleDocument> |
listExpiringDocuments(Date expiryDate,
String language)
Search all the documents in an instance which require an alert at the specified date. |
boolean |
lock(String attachmentId,
String userId,
String language)
Lock a file so it can be edited by an user. |
Map<String,String> |
mergeDocuments(ForeignPK originalForeignKey,
ForeignPK cloneForeignKey,
DocumentType type)
Merges the documents of cloned container with the original documents. |
List<SimpleDocumentPK> |
moveAllDocuments(WAPrimaryKey resourceSourcePk,
WAPrimaryKey targetDestinationPk)
|
SimpleDocumentPK |
moveDocument(SimpleDocument document,
ForeignPK destination)
Moves the attachment. |
void |
removeContent(SimpleDocument document,
String lang,
boolean invokeCallback)
To remove the content of the document in the specified language. |
void |
reorderAttachments(List<SimpleDocumentPK> pks)
Reorder the attachments according to the order in the list. |
void |
reorderDocuments(List<SimpleDocument> documents)
Reorder the attachments according to the order in the list. |
SimpleDocument |
searchDocumentById(SimpleDocumentPK primaryKey,
String lang)
Search the document. |
void |
switchAllowingDownloadForReaders(SimpleDocumentPK pk,
boolean allowing)
Allows or forbids the download for readers. |
void |
switchComponentBehaviour(String componentId,
boolean toVersionning)
Change the management of versions of the documents of a whole component (only attachments are taken into account). |
void |
unindexAttachmentsOfExternalObject(WAPrimaryKey foreignKey)
|
boolean |
unlock(UnlockContext context)
Release a locked file. |
void |
updateAttachment(SimpleDocument document,
boolean indexIt,
boolean invokeCallback)
To update the document : status, metadata but not its content. |
void |
updateAttachment(SimpleDocument document,
File content,
boolean indexIt,
boolean invokeCallback)
To update a document content by updating or adding some content. |
void |
updateAttachment(SimpleDocument document,
InputStream in,
boolean indexIt,
boolean invokeCallback)
To update a document content by updating or adding some content. |
void |
updateIndexEntryWithDocuments(FullIndexEntry indexEntry)
Add the documents to the index. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleDocumentService()
| Method Detail |
|---|
public void deleteAllAttachments(String componentInstanceId)
throws AttachmentException
AttachmentService
deleteAllAttachments in interface AttachmentServicecomponentInstanceId - the component instance identifier.
AttachmentExceptionpublic void createIndex(SimpleDocument document)
createIndex in interface AttachmentServicepublic void deleteIndex(SimpleDocument document)
deleteIndex in interface AttachmentService
public void createIndex(SimpleDocument document,
Date startOfVisibility,
Date endOfVisibility)
createIndex in interface AttachmentServicepublic void unindexAttachmentsOfExternalObject(WAPrimaryKey foreignKey)
unindexAttachmentsOfExternalObject in interface AttachmentService
public void addXmlForm(SimpleDocumentPK pk,
String language,
String xmlFormName)
addXmlForm in interface AttachmentService
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=CREATE)
public SimpleDocument createAttachment(@TargetObject@TargetPK
SimpleDocument document,
InputStream content)
throws AttachmentException
createAttachment in interface AttachmentServicedocument - the document to be created.content - the binary content of the document.
AttachmentException
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=CREATE)
public SimpleDocument createAttachment(@TargetObject@TargetPK
SimpleDocument document,
InputStream content,
boolean indexIt)
createAttachment in interface AttachmentServicedocument - the document to be created.content - the binary content of the document.indexIt - true if the document is to be indexed, false
otherwhise.
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=CREATE)
public SimpleDocument createAttachment(@TargetObject@TargetPK
SimpleDocument document,
InputStream content,
boolean indexIt,
boolean invokeCallback)
createAttachment in interface AttachmentServicedocument - the document to be created.content - the binary content of the document.indexIt - true if the document is to be indexed, false
otherwhise.invokeCallback - true if the callback methods of the components must be
called, false for ignoring thoose callbacks.
public void deleteAttachment(SimpleDocument document)
deleteAttachment in interface AttachmentServicedocument - the document to deleted.
public void deleteAllAttachments(String resourceId,
String componentInstanceId)
AttachmentService
deleteAllAttachments in interface AttachmentServiceresourceId - the identifier of the resource.componentInstanceId - the identifier of the component instance into which the resource is
referenced.
public void deleteAttachment(SimpleDocument document,
boolean invokeCallback)
deleteAttachment in interface AttachmentServicedocument - the attachmentDetail object to deleted.invokeCallback - true if the callback methods of the components must be
called, false for ignoring those callbacks.
public SimpleDocument searchDocumentById(SimpleDocumentPK primaryKey,
String lang)
AttachmentService
searchDocumentById in interface AttachmentServiceprimaryKey - the primary key of document.lang - the lang of the document.
public SimpleDocumentList<SimpleDocument> listAllDocumentsByForeignKey(WAPrimaryKey foreignKey,
String lang)
AttachmentService
listAllDocumentsByForeignKey in interface AttachmentServiceforeignKey - : the primary key of foreign object.lang - the language of the documents.
public SimpleDocumentList<SimpleDocument> listDocumentsByForeignKey(WAPrimaryKey foreignKey,
String lang)
AttachmentService
listDocumentsByForeignKey in interface AttachmentServiceforeignKey - : the primary key of foreign object.lang - the language of the documents.
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=UPDATE)
public void updateAttachment(@TargetObject@TargetPK
SimpleDocument document,
boolean indexIt,
boolean invokeCallback)
AttachmentService
updateAttachment in interface AttachmentService
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=UPDATE)
public void updateAttachment(@TargetObject@TargetPK
SimpleDocument document,
InputStream in,
boolean indexIt,
boolean invokeCallback)
AttachmentService
updateAttachment in interface AttachmentService
public void removeContent(SimpleDocument document,
String lang,
boolean invokeCallback)
AttachmentService
removeContent in interface AttachmentService
public SimpleDocumentPK cloneDocument(SimpleDocument original,
String foreignCloneId)
cloneDocument in interface AttachmentServiceoriginal - foreignCloneId -
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=COPY)
public SimpleDocumentPK copyDocument(@TargetObject
SimpleDocument original,
@TargetPK
ForeignPK targetPk)
copyDocument in interface AttachmentServiceoriginal - targetPk -
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=COPY)
public List<SimpleDocumentPK> copyAllDocuments(@SourcePK
WAPrimaryKey resourceSourcePk,
@TargetPK
WAPrimaryKey targetDestinationPk)
AttachmentService
copyAllDocuments in interface AttachmentServiceresourceSourcePk - the identifier of the resource and its location (component instance)
which linked attachments must be copied.targetDestinationPk - the identifier of the resource and its location (component
instance)
that will get the copied attachments.
public void reorderAttachments(List<SimpleDocumentPK> pks)
throws AttachmentException
reorderAttachments in interface AttachmentServicepks -
AttachmentException
public void reorderDocuments(List<SimpleDocument> documents)
throws AttachmentException
reorderDocuments in interface AttachmentServicedocuments -
AttachmentException
public void getBinaryContent(OutputStream output,
SimpleDocumentPK pk,
String lang)
AttachmentService
getBinaryContent in interface AttachmentServiceoutput - the stream where the content is to be written.pk - the id of the document.lang - the language of the content.
public void getBinaryContent(OutputStream output,
SimpleDocumentPK pk,
String lang,
long contentOffset,
long contentLength)
AttachmentService
getBinaryContent in interface AttachmentServiceoutput - the stream where the content is to be written.pk - the id of the document.lang - the language of the content.contentOffset - number of bytes to skip from input content before copying into output.contentLength - number of bytes to copy.
public List<SimpleDocument> listDocumentsRequiringWarning(Date alertDate,
String language)
AttachmentService
listDocumentsRequiringWarning in interface AttachmentServicealertDate - the date when a warning is required.language - the language in which the documents are required.
public List<SimpleDocument> listExpiringDocuments(Date expiryDate,
String language)
AttachmentService
listExpiringDocuments in interface AttachmentServiceexpiryDate - the date when the document reservation should alter.language - the language in which the documents are required.
public List<SimpleDocument> listDocumentsToUnlock(Date expiryDate,
String language)
AttachmentService
listDocumentsToUnlock in interface AttachmentServiceexpiryDate - the date when the document reservation should expire.language - the language in which the documents are required.
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=UPDATE)
public void updateAttachment(@TargetObject@TargetPK
SimpleDocument document,
File content,
boolean indexIt,
boolean invokeCallback)
AttachmentService
updateAttachment in interface AttachmentService
public void getBinaryContent(File file,
SimpleDocumentPK pk,
String lang)
AttachmentService
getBinaryContent in interface AttachmentServicefile - the file where the content is to be written.pk - the id of the document.lang - the language of the content.
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=CREATE)
public SimpleDocument createAttachment(@TargetObject@TargetPK
SimpleDocument document,
File content)
throws AttachmentException
AttachmentService
createAttachment in interface AttachmentServicedocument - the document to be created.content - the binary content of the document.
AttachmentException
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=CREATE)
public SimpleDocument createAttachment(@TargetObject@TargetPK
SimpleDocument document,
File content,
boolean indexIt)
AttachmentService
createAttachment in interface AttachmentServicedocument - the document to be created.content - the binary content of the document.indexIt - true if the document is to be indexed, false otherwhise.
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=CREATE)
public SimpleDocument createAttachment(@TargetObject@TargetPK
SimpleDocument document,
File content,
boolean indexIt,
boolean invokeCallback)
AttachmentService
createAttachment in interface AttachmentServicedocument - the document to be created.content - the binary content of the document.indexIt - true if the document is to be indexed, false otherwhise.invokeCallback - true if the callback methods of the components must be called, false for
ignoring thoose callbacks.
public boolean unlock(UnlockContext context)
unlock in interface AttachmentServicecontext - : the unlock parameters.
AttachmentException
public boolean lock(String attachmentId,
String userId,
String language)
lock in interface AttachmentServiceattachmentId - userId - language -
public SimpleDocumentPK changeVersionState(SimpleDocumentPK pk,
String comment)
AttachmentService
changeVersionState in interface AttachmentServicepk - the id of the document.comment - the comment of the versioned documetn if we are switching from simple to
versioned.
public SimpleDocument findExistingDocument(SimpleDocumentPK pk,
String fileName,
ForeignPK foreign,
String lang)
AttachmentService
findExistingDocument in interface AttachmentServicepk - the id of the document.fileName - the name of the file.foreign - the id of the container of the document.lang - the language of the document.
public SimpleDocumentList<SimpleDocument> listDocumentsByForeignKeyAndType(WAPrimaryKey foreignKey,
DocumentType type,
String lang)
AttachmentService
listDocumentsByForeignKeyAndType in interface AttachmentServiceforeignKey - : the primary key of foreign object.type - : the type of documentlang - the lang for the documents.
public List<SimpleDocument> listDocumentsLockedByUser(String usedId,
String language)
AttachmentService
listDocumentsLockedByUser in interface AttachmentServiceusedId - the id of the user.language - the language in which the documents are required.
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=MOVE)
public SimpleDocumentPK moveDocument(@TargetObject
SimpleDocument document,
@TargetPK
ForeignPK destination)
AttachmentService
moveDocument in interface AttachmentServicedocument - to be moved.destination - the foreign id to be moved to.
@SimulationActionProcess(elementLister=AttachmentSimulationElementLister.class)
@Action(value=MOVE)
public List<SimpleDocumentPK> moveAllDocuments(@SourcePK
WAPrimaryKey resourceSourcePk,
@TargetPK
WAPrimaryKey targetDestinationPk)
moveAllDocuments in interface AttachmentServicepublic void updateIndexEntryWithDocuments(FullIndexEntry indexEntry)
AttachmentService
updateIndexEntryWithDocuments in interface AttachmentServiceindexEntry - the entry to be updated with the document indexes.
public void indexAllDocuments(WAPrimaryKey fk,
Date startOfVisibilityPeriod,
Date endOfVisibilityPeriod)
AttachmentService
indexAllDocuments in interface AttachmentServicefk - the id of the container of the document.startOfVisibilityPeriod - can be null.endOfVisibilityPeriod - can be null.
public Map<String,String> mergeDocuments(ForeignPK originalForeignKey,
ForeignPK cloneForeignKey,
DocumentType type)
AttachmentService
mergeDocuments in interface AttachmentService
public void switchComponentBehaviour(String componentId,
boolean toVersionning)
AttachmentService
switchComponentBehaviour in interface AttachmentServicecomponentId - : the id of the component switching its behaviour.
public void switchAllowingDownloadForReaders(SimpleDocumentPK pk,
boolean allowing)
AttachmentService
switchAllowingDownloadForReaders in interface AttachmentServicepk - the id of the document.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||