Interface TemplateBasedDocument

    • Method Detail

      • setTemplate

        DocumentModel setTemplate​(DocumentModel template,
                                  boolean save)
                           throws PropertyException
        Associate the document to a Template.
        Parameters:
        template - DocumentModel holding the template
        save - flag to indicate if target DocumentModel must be saved or not
        Returns:
        the updated DocumentModel
        Throws:
        PropertyException
      • getSourceTemplateDocRef

        DocumentRef getSourceTemplateDocRef​(String templateName)
        Retrieve the Template DocumentRef for a given template name
        Parameters:
        templateName - name of the template
        Returns:
        the associated template DocumentRef
      • getSourceTemplateDoc

        DocumentModel getSourceTemplateDoc​(String templateName)
        Retrieve the Template DocumentModel for a given template name
        Parameters:
        templateName - name of the template
        Returns:
        the associated template DocumentModel
      • getTemplateType

        String getTemplateType​(String templateName)
        Return the template type for a given template name
      • initializeFromTemplate

        DocumentModel initializeFromTemplate​(String templateName,
                                             boolean save)
        Initialize the template parameters from the associated template
        Parameters:
        save - flag to indicate if target DocumentModel must be saved or not
        Returns:
        the updated DocumentModel
      • renderAndStoreAsAttachment

        Blob renderAndStoreAsAttachment​(String templateName,
                                        boolean save)
        Render the named template against the underlying DocumentModel and store the result in the main Blob
        Parameters:
        save - flag to indicate if target DocumentModel must be saved or not
        Returns:
        the resulting Blob
      • renderWithTemplate

        Blob renderWithTemplate​(String templateName)
        Render the named template against the underlying DocumentModel
        Returns:
        the resulting Blob
      • hasParams

        boolean hasParams​(String templateName)
        Indicate of the associated Template requires parameters or not
      • getParams

        List<TemplateInput> getParams​(String templateName)
        Retrieve parameters for the associated template
      • saveParams

        DocumentModel saveParams​(String templateName,
                                 List<TemplateInput> params,
                                 boolean save)
        Save parameters changes.
        Parameters:
        params - the updated list of parameters
        save - flag to indicate if target DocumentModel must be saved or not
      • getTemplateBlob

        Blob getTemplateBlob​(String templateName)
        Return the Blob of the associated template
      • hasEditableParams

        boolean hasEditableParams​(String templateName)
        Indicate of the associated Template has editable parameters or not
      • getTemplateNameForRendition

        String getTemplateNameForRendition​(String renditionName)
        Find the template associated to a given RenditionName
        Returns:
        the template name if any, null otherwise
      • getTemplateNames

        List<String> getTemplateNames()
        Get the names of all the associated templates