BSCW ServerHelp top
 previous Chapterpreviousupnextnext Chapter  german   Contents    Index  

8.1.4 Templates

A template is a document of type Document Template (text/x-bscw-template). Such a document should be created with a normal ASCII text editor (e.g.., with MS Windows Notepad), not with a document processing system such as MS Word. When uploading a template document into a Document Set, the Mime Type text/x-bscw-template has to be specified. Otherwise the evaluation process does not recognize the document as a template.

It is recommended to use an extension such as '.dtm' for documents of type BSCW Template so they can easily be identified within folder listings by their names. A template is represented by the icon  .

There are two classes of BSCW Templates: templates of the first class create a document directly during the evaluation process. A template belongs to this class if the evaluation parameter document is specified for the template.

Templates of the second class contribute indirectly to the creation of a document because they are referenced from other templates. A template belongs to this class if the evaluation parameter document is missing.

Besides the evaluation parameter document, there also exists the evaluation parameter template. Both evaluation parameters specify file names within the Document Set.

The following rules apply during the evaluation process:

8.1.4.1 Evaluation parameter document specified for a template X

In this case the evaluation process will evaluate template X and create a document with the name specified by the parameter document. In this case, the template consists, in general, of text and of entity references which are resolved from the evaluation process before the document is inserted into the Document Set

8.1.4.2 Evaluation parameters document and template specified for template X

In this case the evaluation process will evaluate the template specified by the parameter template and create a document with the name specified by the parameter document. During the evaluation process, the entity definitions of template X are used. In this case, the template consists, in general, of entity definitions, which are inserted into the template specified by the parameter template from the evaluation process before the document is inserted into the Document Set.

8.1.4.3 No evaluation parameter specified for a template X

In this case the evaluation process will evaluate template X. The name of the document to be created is specified within another template via the parameter document and template X is referenced by another template via the parameter template.

8.1.4.4 Evaluation parameter template specified for a template X

In this case the evaluation process will evaluate the template specified by the parameter template (see case 2. above). Template X is referenced by another template via the evaluation parameter template, i.e., at least three templates are involved in the evaluation process. The name of the document to be created is specified within another template via the parameter document.

8.1.4.5 Nested Templates

Templates can have references to other templates, i.e., a template can be used by several other templates. A reference to a template is denoted by including its name within #( and )#:

#(name of template)#
During the evaluation process the reference to a template will be replaced by the actual text of the template. The reference to a template may also contain path information to locate the template in the folder hierarchy of the document set. Path names are considered relative to the location of the including template. Templates defining entities can also be included in another template. In this case the result of the evaluation process will be inserted.

With

#(name of template, name of combined template)#
one can define the combined template at the point of inclusion. In this way templates defining entities can be included in various contexts by other templates.

Template names may contain the wildcards '*' and '?'. In this case all templates that match the pattern will be included consecutively.

For example:

#(&(content_dir);/faq/questions*.dtm, &(template_dir);/faq.dtm)#
In this case, all templates which are found in the directory &(content_dir);/faq and whose name matches the pattern question*.dtm will be included and combined with the template &(template_dir);/faq.dtm.


 previous Chapterpreviousupnextnext Chapter  german   Contents    Index