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 TypeMethodDescriptioncreateDocumentFromTemplate(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.createMultipleDocumentsFromTemplate(PublicationId parentPublicationId, DocumentId documentTemplateId, List<String> newDocumentNames, String masterPage) Creates multiple documents from document templatevoiddelete(DocumentId documentId) Deletes an existing document.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.voidUpdates 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
-