Document Templates in MatchPoint Snow
Date: 09.05.2014
This blog post offers an overview over the MatchPoint Snow document template functionality and describes the architecture as well as some technical details.
Feature Overview
When working with different kinds of digital documents within an enterprise, certain standards need to be met: for example the corporate identity needs to be satisfied, or a common set of information is required to be present on all documents. The need for such standardization appears on all levels of an organization, from global over division and team right down to a very specific project.
These requirements can be fulfilled using the document template functionality of MatchPoint Snow, which enables document templates to be defined and maintained on the different levels of the workspace-tag structure using tags (Snowflake, workspace type, specific workspace).
When using the "Create a document" action within MatchPoint Snow, the user will be presented the templates available in his current context. After choosing one, the document will be created and stored in the workspace?s document library.
Document templates utilize the MatchPoint office template functionality to prefill the document with values originating from MatchPoint expressions, e.g. containing workspace-specific data. Thanks to the tag inheritance mechanism, the appropriate tags will automatically be applied. Next to that, all tags originally applied to the template item are automatically applied to the document created from it.
All of this combined makes it easy for administrators and workspace owners to define document templates the way they want them to be (metadata, context specific content and layout). And the users simply need to create a new document based on a template and do not need to fuss around with recurring issues like applying metadata or typing their own or the workspaces name.
Architecture and Technical Details
Document templates are physically maintained within MatchPoint Snow, on global- and on workspace-instance-level. The global document templates are stored in a document library named "Document Templates" on the MatchPoint Snow site collection. Global templates are available within all associated workspaces and Snowflakes. This association is represented via tags which are applied on the document template list item. Depending on the associated tags, a template will be available within different scopes:
- Global: No tags means the document template is available on all workspace types
- Snowflake: Snowflake tags means the document template is available on all workspace types belonging to the specified Snowflake(s)
- Workspace type: Workspace type tags means the document template is available on all workspaces based on the specified Workspace type(s)
- Workspace instance: Workspace tags means the document template is available on all of these specific workspace instances.
- As multiple tags can be applied to a document template, a combination of the above scopes is possible as well.
Each workspace instance has its own list, where workspace owners can add and remove document templates specific to that workspace instance only. The list is deployed to a site collection using a site-scoped feature named "Colygon.MatchPoint.Snow.DocumentTemplates" (Feature Id: c840e23f-c674-4848-b08c-b7a449eab90f). When the workspace type uses a provisioning configuration which inherits the MatchPoint base provisioning (MPSnow.Workspaces.BaseProvisioning.xml), this feature is automatically enabled.
To programmatically get all relevant document templates, MatchPoint Snow provides an extension method for the Workspace class named GetAvailableDocumentTemplates(). This method has a parameter named filter of type string, which can be used to filter the document templates by FileLeafRef or by Title.