Create Document from Template - tsgrp/HPI GitHub Wiki
Create document from template is a feature that allows a user to create new documents from existing content in their repository. This is a feature that can be configured in the Bulk Upload Action.
General Configuration
Enable this feature in the Bulk Upload Action Configuration.
Repository Requirements
In order to use this functionality there must be documents in the repository that have the Object Type: tsgTemplate
. These objects must have a the attribute: tsgTargetType
value must be set to the OC Name of an Object Type configured in OCMS. Additionally, the tsgTemplateType
attribute must be set to the value "Content".
Creating and Managing Templates
First, ensure that the template type is configured in OCMS and available to create in the repository:
- Go to the OCMS Admin and select the "Object Type" tab
- Add the Object Type
tsgTemplate
- Add the
tsgTemplate
Object Type to a form that is used for a Bulk Upload Action. Ensure that the form sets the attributetsgTargetType
as well astsgTemplateType
make these required attributes. Since the template type can only be one value, this is typically done with a picklist or a default read-only value on the form field.
Next, navigate to a folder where you would like to place templates. For example, this could be /hpi/default/ocmsTemplates
, but doesn't have to be. NOTE: The security on this folder will determine who can create and manage templates. Then, simply upload templates to the repository:
Content Templates:
- Navigate to the Template Management Config page in the Admin.
- Select the Content Template Tab.
- Select New Template.
- Upload a new template.
- Give the template a title and a description and upload.
FreeMarker Templates:
- Navigate to the Template Management Config page in the Admin.
- Select the FreeMarkerTemplate Tab.
- Select New Template.
- Upload a new template.
- Give the template a title and a description and upload.
Usage for Content Templates
Once there are objects of type tsgTemplate
in the repository a user can use this functionality while using the Bulk Upload Action.
- Click the Bulk Upload Action
- Click the "Create Document from Template" button in the lower right corner of the action
- Select the target object type
- Select the desired template(s)
- Click "Next"
Then proceed with the rest of the Bulk Upload Action.
Usage for FreeMarker Templates
These Templates should be pre installed into the repository and should already be available for modification in the admin. The FTL Templates are used for email population and creation when sending emails. Any automated email service within ocms uses a configured ftl template.