Package com.priint.pubserverapi.document
Interface DocumentServiceLocal
public interface DocumentServiceLocal
Interface for a document service class.
- Since:
- 4.5.0-object-storage
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<DocumentParameter> addDocumentParameter(DocumentId documentId, ParameterDefinitionId parameterId) Add parameter to document.createDocumentFromTemplate(PublicationId parentPublicationId, DocumentId documentTemplateId, String newDocumentName, String masterPage) Creates a new document from document templatedefault DocumentParameterQueryCreates a newDocumentParameterQueryfor querying document parameters.Creates a newDocumentQueryfor querying documents.default DocumentIdcreateDocumentTemplate(String documentTemplateName, DocumentTemplateStatus status) Creates a new document templatecreateMultipleDocumentsFromTemplate(PublicationId parentPublicationId, DocumentId documentTemplateId, List<String> newDocumentNames, String masterPage) Creates multiple documents from document templatevoiddelete(DocumentId documentId) Deletes an existing document.default voiddeleteDocumentParameter(DocumentParameter parameter) Delete DocumentParameter.duplicateDocument(DocumentId documentId, PublicationId destinationPublicationId, String name, boolean tryToUseDocumentTemplate) Duplicates a documentgetDocumentById(DocumentId documentId) default Optional<DocumentParameter> getDocumentParameterById(ParameterId parameterId) Retrieves a document parameter by its ID.default voidpermanentlyDeleteDocument(DocumentId documentId) Deletes the document at the specified IDdefault voidrestoreDeletedDocument(DocumentId documentId) change "deleted" the flag to "0" document at the specified IDvoidUpdates an existing documentvoidUpdates existing documentsdefault voidupdateDocumentParameter(DocumentParameter documentParameter) Updates an existing document parameter.default voidupdateDocumentParameters(List<DocumentParameter> documentParameters) Updates a list of document parameters.
-
Method Details
-
getDocumentById
- Parameters:
documentId- id of the document- Returns:
- document object
-
createDocumentQuery
DocumentQuery createDocumentQuery()Creates a newDocumentQueryfor querying documents.- Returns:
- a new
DocumentQueryinstance
-
duplicateDocument
DocumentId duplicateDocument(DocumentId documentId, PublicationId destinationPublicationId, String name, boolean tryToUseDocumentTemplate) throws DocumentServiceException Duplicates a document- Parameters:
documentId- id of the (source) document to duplicatedestinationPublicationId- id of the destination publicationname- new name of the document or empty for the same nametryToUseDocumentTemplate- create a new document based on the document template from the source document- Returns:
- id of the new created (duplicated) document
- Throws:
DocumentServiceException
-
createDocumentFromTemplate
DocumentId createDocumentFromTemplate(PublicationId parentPublicationId, DocumentId documentTemplateId, String newDocumentName, String masterPage) throws DocumentServiceException Creates a new document from document template- Parameters:
parentPublicationId- id of the destination publicationdocumentTemplateId- id of the document templatenewDocumentName- name of the new documentmasterPage- master page of document template- Returns:
- id of the new created document
- Throws:
DocumentServiceException
-
createMultipleDocumentsFromTemplate
List<DocumentId> createMultipleDocumentsFromTemplate(PublicationId parentPublicationId, DocumentId documentTemplateId, List<String> newDocumentNames, String masterPage) throws DocumentServiceException Creates multiple documents from document template- Parameters:
parentPublicationId- id of the destination publicationdocumentTemplateId- id of the document templatenewDocumentNames- list of names of the new documentsmasterPage- master page of document template- Returns:
- id of the new created document
- Throws:
DocumentServiceException
-
update
Updates an existing document- Parameters:
document- the document to update- Throws:
DocumentServiceException
-
update
Updates existing documents- Parameters:
documents- list of the documents to update- Throws:
DocumentServiceException
-
delete
Deletes an existing document. It is a soft deletion - moving a document to the trash- Parameters:
documentId- the id of the document to delete- Throws:
DocumentServiceException
-
createDocumentParameterQuery
Creates a newDocumentParameterQueryfor querying document parameters.- Returns:
- a new
DocumentParameterQueryinstance - Throws:
NotImplementedException- if the method is not implemented
-
getDocumentParameterById
Retrieves a document parameter by its ID.- Parameters:
parameterId- the ID of the document parameter- Returns:
- an
Optionalcontaining the document parameter if found, or an emptyOptionalif not - Throws:
NotImplementedException- if the method is not implemented
-
updateDocumentParameter
Updates an existing document parameter.- Parameters:
documentParameter- the document parameter to update- Throws:
NotImplementedException- if the method is not implemented
-
updateDocumentParameters
Updates a list of document parameters.- Parameters:
documentParameters- the list of document parameters to update- Throws:
NotImplementedException- if the method is not implemented
-
createDocumentTemplate
default DocumentId createDocumentTemplate(String documentTemplateName, DocumentTemplateStatus status) throws DocumentServiceException Creates a new document template- Parameters:
documentTemplateName- name of the document templatestatus- enabled or disabled- Returns:
- new DocumentId
- Throws:
DocumentServiceException
-
addDocumentParameter
default Optional<DocumentParameter> addDocumentParameter(DocumentId documentId, ParameterDefinitionId parameterId) throws DocumentServiceException Add parameter to document.- Parameters:
documentId- the id of documentparameterId- the id of parameter to add- Returns:
- an
Optionalcontaining the created document parameter - Throws:
NotImplementedException- if the method is not implementedDocumentServiceException
-
deleteDocumentParameter
Delete DocumentParameter.- Parameters:
parameter- the parameter object to delete- Throws:
NotImplementedException- if the method is not yet implemented
-
permanentlyDeleteDocument
Deletes the document at the specified IDDeletes document from trash, file, spreads and previews, plannings, document parameters, workflow items and workflow todos.
- Parameters:
documentId- the id of the document to delete- Throws:
DocumentServiceException
-
restoreDeletedDocument
change "deleted" the flag to "0" document at the specified IDRestore document from the trash.
- Parameters:
documentId- the id of the document to restore- Throws:
DocumentServiceException
-