When a project administrator creates a new project, he or she can automatically inject content, such as a home page and any number of linked pages, into this project. The project administrator does this by selecting a project template at project creation time. Template designers can create project templates. CollabNet also provides a process-based template that supports application lifecycle management.
Project templates provide content and structure for a project. A template consists of a set of html files in the www/templates folder in the Subversion repository for the project-templates project.
For instance, you can configure a template for a project home page that provides links to all the critical documents in a project. When project owners configure a new project, they can select from among the templates in the project-templates project's trunk/www/templates folder. When a user creates a new project, the files in the template directory of the project-templates project are moved to the www directory for the new project. The new project's index.html file is replaced if an index.html was created in the templates folder, and the other template files from the project-templates project are also added to the www folder of the new project.
If you create a template, when a user creates a new project, the project creation page displays a Choose a Content Repository Template option. The template that you have created is presented as one of the options. The option name is based on a name that you provide in a template.properties file that resides in the www/templates folder.
In addition to creating the files that comprise the template, you must configure a template.properties file. The template.properties file must reside in the same folder as the new template. You must create template folders in your version control repository under the project-templates/trunk/www/templates folder, for example:
project-templates/trunk/www/templates/mytemplate
The following is a very simple template.properties file:
title=A pretty good template description=This contains an index.html file with corporate branding and links to specification.html, mission_statement.html, and other project resources active=true ignore=template.properties
title - The name that is displayed on the project creation page. You can edit the name at any time and re-submit the file to the version control repository. If you do not supply a title, the folder name is displayed on the project creation page. For example:
title=empty
description - A short description of the template files. The description cannot contain line breaks. You can edit the name at any time and re-submit the file to the version control repository. This information is displayed on the project creation page. For example:
description=Default 'empty' project template
active - This can take a value of either true or false. This property must be set to true for the template to be available for selection during project creation. False is the default. For example:
active=true
ignore - You can exclude particular files and folders within the template folder from being published at the time of project creation. The property ignore: takes a set of file or folder names as a value. Separate names using a semicolon (;). The path should be relative to the template folder. For example:
ignore=template.properties; docs/changes.txt
Note: See the Help topic on editing the template.properties file through the user interface. For information about additional properties, please see the Help topic on the contents of the template.properties file.
The following paragraphs describe how to create the contents of a template, and how to make the template available on the project creation page.
When you import a project template archive into a CollabNet site, it gets installed as a global project template in the project-templates project’s Subversion repository. You can then use this template when starting a new project. For further information on project template archives, please see the following Help files: