Package org.nuxeo.template.api
Interface TemplateProcessorService
-
- All Known Implementing Classes:
TemplateProcessorComponent
public interface TemplateProcessorService
This is the service interface to manageTemplateProcessor
and associated templates.- Author:
- Tiry
-
-
Method Summary
-
-
-
Method Detail
-
findProcessorName
String findProcessorName(Blob templateBlob)
Finds the template processor name for a givenBlob
. The template processor is found based on mime-types.- Returns:
- the
TemplateProcessor
name
-
findProcessor
TemplateProcessor findProcessor(Blob templateBlob)
Finds theTemplateProcessor
for a givenBlob
. The template processor is found based on mime-types.- Returns:
- the
TemplateProcessor
-
getProcessor
TemplateProcessor getProcessor(String name)
Get aTemplateProcessor
by it's name. Name is defined in the associated descriptor.- Returns:
- the
TemplateProcessor
-
getRegisteredTemplateProcessors
Collection<TemplateProcessorDescriptor> getRegisteredTemplateProcessors()
Returns all registeredTemplateProcessor
s- Returns:
- collection of registered
TemplateProcessorDescriptor
-
getAvailableTemplateDocs
List<DocumentModel> getAvailableTemplateDocs(CoreSession session, String targetType)
FindTemplateSourceDocument
s that can be bound to a given doc type.- Parameters:
targetType
- the target Document Type- Returns:
- List of applicable DocumentModel
-
getAvailableTemplates
List<TemplateSourceDocument> getAvailableTemplates(CoreSession session, String targetType)
FindTemplateSourceDocument
s that can be bound to a given doc type.- Parameters:
targetType
- the target Document Type- Returns:
- List of applicable
TemplateSourceDocument
-
getTemplateDoc
DocumentModel getTemplateDoc(CoreSession session, String name)
Returns a template with a given templateName.- Parameters:
name
- the name of the template- Since:
- 9.1
-
getAvailableOfficeTemplates
List<TemplateSourceDocument> getAvailableOfficeTemplates(CoreSession session, String targetType)
Retrieve theTemplateSourceDocument
that can be used as an Office template (i.e that support to store the template file as main blob of target DocumentModel)
-
getLinkedTemplateBasedDocuments
List<TemplateBasedDocument> getLinkedTemplateBasedDocuments(DocumentModel source)
Retrieve the DocumentModels using a givenTemplateSourceDocument
- Parameters:
source
- theTemplateSourceDocument
-
getTypeMapping
Map<String,List<String>> getTypeMapping()
Retrieve the Map used for mapping Document Types to Template Names. This Map represent the Templates that must be automatically bound at creation time for each Document Type.- Returns:
- the Type2Template mapping
-
registerTypeMapping
void registerTypeMapping(DocumentModel doc)
Update Type2Template Mapping from the data contained in the source DocumentModel.
-
makeTemplateBasedDocument
DocumentModel makeTemplateBasedDocument(DocumentModel targetDoc, DocumentModel sourceTemplateDoc, boolean save)
Associate aDocumentModel
to aTemplateSourceDocument
. If the DocumentModel is not already aTemplateBasedDocument
, the associated facet will be automatically added.- Parameters:
targetDoc
- the DocumentModel to associate to a templatesourceTemplateDoc
- the DocumentModel holding the templatesave
- flag to indicate if target DocumentModel must be saved or not- Returns:
- the updated DocumentModel
-
detachTemplateBasedDocument
DocumentModel detachTemplateBasedDocument(DocumentModel targetDoc, String templateName, boolean save)
Detach a Template from aDocumentModel
- Parameters:
targetDoc
- the DocumentModel to detachtemplateName
- the name of the template to detachsave
- save flag to indicate if target DocumentModel must be saved or not- Returns:
- the updated DocumentModel
-
addContextExtensions
void addContextExtensions(DocumentModel currentDocument, DocumentWrapper wrapper, Map<String,Object> ctx)
-
getRegistredContextExtensions
Map<String,ContextExtensionFactoryDescriptor> getRegistredContextExtensions()
-
getOutputFormats
Collection<OutputFormatDescriptor> getOutputFormats()
- Returns:
- the list of registered Ouput formats used to convert output of a rendered document.
-
getOutputFormatDescriptor
OutputFormatDescriptor getOutputFormatDescriptor(String outputFormatId)
The returnedOutputFormatDescriptor
contains either an operation chain or a mime-type use to convert the output of a rendered document.- Returns:
OutputFormatDescriptor
-
-