-
Notifications
You must be signed in to change notification settings - Fork 3
Templating Documentation
CS108-PET
's core are the six entities:
requirement
milestone
catalogue
progress
progress-summary
group
Those entites are represented as objects with respective
properties on their own (e.g. requirement
has a property
name
). Those properties are called fields. There are several
types of fields:
- Simple fields return text (or a number)
- Entity fields return an entity (which thus has its own fields)
- Subentity field's return type is equal to the one of the field of the sub entity
- Parametrized fields do have a parameter
- Conditional fields do have two parameters, the first one being rendered, when the field's value is true, the second one if the field's value is false
- List fields render the complete list of what they stand for.
CS108-PET
's templating language (PMTL) is built upon **expression*s, which address
a certain field of an entity.
The syntax of such expressions is as follow:
${<entity>.<simple-field>}
${<entity>.<entity-field>}
${<entity>.<subentity-field>.<field>}
${<entity>.<parametrized-field>[<param>]}
${<entity>.<conditional-field>[<condition-met>][<condition-missed>]}
Where <entity>
stands for an entity, <X-field>
for a field of type X,
<param>
for the accepted parameter and <condition-met> is what gets rendered if the conditional field meets its condition, while
` is the what gets rendered if the conditional
field does ont meet its condition.
As of version 0.4 PMTL does not support expressions as parameter (parametrized field parameter as well as conditional field parameters). Thus
${<entity>.<field>[${<entity>.<field>]}
is not allowed.As of version 0.4 PMTL does not support expressions with parametrized or conditional sub entity fields. Thus
${<entity>.<subentity-field>.<parametrized-field>[<param>]}
is not allowed.
Templates for cs108pet
are written in any language or format desired. The only
requirement for templating files is the one, that they must be plain text.
Probably the most common use case would be to either have a html
or tex
export.
To achieve this, one must simple use that specified format within the
template itself and combine it with RMTL expressions.
Within the scope of a template file, only certain entities are visible.
(The headers below refer to the template with that name, not to the entity!)
Within the requirement template, the following entities are visible:
requirement
Within the milestone template, the following entities are visible:
milestone
Within the catalogue template, the following entities are visible:
catalogue
Within the progress template, the following entities are visible:
progress
requirement
Within the progress-summary template, the following entities are visible:
groupMilestone
milestone
Within the group template, the following entities are visible:
group
catalogue
The field names mostly are self-explanatory or match the documentation
of ReqMan
core. Fields have case sensitive names.
(The headers below refer to the entity with that name, not the template)
The entity requirement
has the following fields:
-
name
(Type: Simple) -
excerpt
(Type: Simple) -
description
(Type: Simple) -
maxPoints
(Type: Simple) -
minMS
(Type: Subentity:milestone
) -
predecessorNames
(Type: List, Simple) -
binary
(Type: Conditional) -
mandatory
(Type: Conditional) -
malus
(Type: Conditional) -
meta
(Type: Parametrized) Parameter: key of meta data property. -
type
(Type: Simple) -
category
(type: Simple)
The entity milestone
has the folliwng fields:
-
name
(Type: Simple) -
date
(Type: Simple) Pre-formatted withjava.text.SimpleDateFormat("dd.MM.YYYY")
-
ordinal
(Type: Simple) -
sumMax
(Type: Simple) -
dateFormatted
(Type: Parametrized) Parameter: Format string forjava.text.SimpleDateFormat
The entity catalogue
has the following fields:
-
name
(Type: Simple) -
description
(Type: Simple) -
lecture
(Type: Simple) -
semester
(type: Simple) -
requirements
(Type: List, Entity:requirement
) -
milestones
(Type: List, Entity:milestone
) -
sumTotal
(Type: Simple) -
sumMS
(Type: Parametrized) Parameter: The ordinal of the milestone -
milestoneName
(type: Parametrized) Parameter: The ordinal of the milestone
The entity progress
has the following fields:
-
points
(Type: Simple) -
hasPoints
(Type: Conditional)
The entity groupMilestone
has the following fields:
-
name
(Type: Simple) same as${milestone.name}
-
progressList
(Type: List, Entity:progress
) -
sum
(Type: Simple) -
percentage
(Type: Simple) -
comment
(Type: Simple)
The entity group
has the following fields:
-
name
(Type: Simple) -
project
(Type: Simple) -
milestones
(Type: List, Entity:groupMilestone
) -
sumMS
(Type: Parametrized) Parameter: The ordinal of the milestone -
sumTotal
(Type: Simple)