Own Templates
Default order templates
The order templates delivered by STOLL together with the STOLL PPS (see Order template management, Default order templates and their parameters) allow for a fast entry into the use of templates.
A template serves for creating a XML ticket
You can adapt the templates to your application case by:
- Removing parameters
- Adding parameters
- Pre-allocating parameters
- Lock pre-allocations for changes for the use of the template to protect against incorrect entries.
- Everything that is mentioned in the template XML under TEMPLATE_TAGS, serves for generating edit boxes in the ticket.
- Everything that is contained in the CDATA blocks is written into an *.XML ticket file via the Velocity mechanism by the entered data and with the help of the AddTag macro.
- The Velocity mechanism processes each entry line in the template regardless of the previously processed lines and searches for the specified reference in the XML template, to replace it with the input and to write the line in the ticket. If the reference is integrated in a macro, the macro is called up to generate the output in the XML file.
Parameters of Default Order Templates
Among the parameters of the default order templates are different formats of input which have the following points in common:
- The edit box for a parameter generally contains a comment between brackets [ ]. This comment will be removed when the ticket is generated by the Velocity macro AddTag.
- The edit box for a parameter can be used for recording several parameter elements.
- In this case, they are separated by semicolon (;). To support the user, it is possible to describe in a comment field, which single elements are expected.
- With optional parameters out of use, you have to keep the semicolon to retain the sorting order of parameters. In the example, the third parameter was omitted. Most of the parameters are not optional and must be specified as soon as only one parameter is filled out.
- If no entry is made, the tag is not included in the XML order. Exceptions:
- You can preset default value by using the Velocity AddTAG macro.
These default values are included in the resulting XML ticket if an edit box is provided for this parameter but nothing is entered. (For example: IMAGE, LOGO or OP_AUTHENTICATION_NEEDED)
Example:#AddTAG("<LOGO>$ParamList[0]</LOGO>" $LOGO "Templates/Logo.png")
- If the edit box LOGO is kept empty, the LOGO tab will get Templates/Logo.png in the ticket.
- If a line in the ORDER_VELOCITY and CUSTOM_VELOCITY blocks has no reference specification to an edit box, the line is automatically entered in the ticket XML.
Example:<STOLL:MACHINE_INFO>
<STOLL:TC_LOAD_DATE/>
<STOLL:TC_DONE_DATE/>
<STOLL:DONE_EXECUTIONS/>
<STOLL:TC_STATE/>
<STOLL:PATTERN_NAME/>
<STOLL:CURRENT_SHIFT/>
<STOLL:USER_NAME/>
</STOLL:MACHINE_INFO> - The Velocity AddTAG- macro mentioned in template enables the input of several parameters and the comment in one line.
- Each ORDER_VELOCITY and CUSTOM_VELOCITY block has its ownAddTAG- macro, which, however, are currently not identical.
- Note that the entry must not contain any XML control characters like <>,. In case you need them anyway, there are alternatives like {}, or you must transform the characters (Special characters in XML)
- If the macro is applied, the input data additionally may not contain any ; nor [ since these characters are seen as separator characters by the AddTAGmacro.
If necessary, you can modify the macro in the template or add another one, which uses other separator characters. - In the following table there are three example parameters TITLE, LOGO and DIMENSION of the default Auto Production template.
- All of them have a comment.
- The LOGO parameter is a path to an image file. It may be either absolute or relative to the template directory.
- The DIMENSION parameter consists of the elements size, length, width, weight.
Template name | Extended parameters |
Auto Production | TITLE; [Title for ticket] LOGO; [String; FilePath to Logo] : DIMENSION;;;; [Size;Length;Width;Weight]: |
How to create your own templates:
- 1084
- Use a Stoll template file as basis.
(see XML files under D:\PPS\SampleTickets\PpsTicketTemplate) - 1085
- Assign a unique name to your template and enter it in the name attribute of the ORDER_TEMPLATE tag.
- 1086
- With the TEMPLATE_DESCRIPTION you provide a descriptive text with your templates.
- 1087
- In the heading outside the ORDER_VELOCITY and CUSTOM_VELOCITY blocks, you can place the tags that are to be contained in the resulting ticket, but do not need any input With it, they are not a default field and do not appear visible.
Refer to the PRODUCTION_INFO block placed in the provided templates directly below TEMPLATE_DESCRIPTION. - 1088
- An edit box that the user has to see in the order template must be mentioned in the TEMPLATE_TAGS block.
A distinction is made between:
CUSTOM_TAG
Here, you define all tags that belong to the USER_TAGs.
Example:<CUSTOM_TAG label="LOAD_PAT_CONTAINER_COMP" editable="true">;;; [SIN;JAC;SET; Each [1||0], 0 prevents loading pattern component. Consider need of ERASE_ALL=false.]</CUSTOM_TAG>
- The label attribute specifies the name the way it will be displayed in the ticket template.
- The name also is the reference ($LOAD_PAT_CONTAINER_COMP) for its utilization in the ORDER_VELOCITY \ CDATA block if is about tags from the StollTicket.xsd.
- With tags from the name range that is specified in the CustomTicket.xsd, the references are to be listed under the CUSTOM_VELOCITY \ CDATA block.
- With the reference, the relation to the edit box is created. The Velocity mechanism searches for the reference and assigns the input to the line that was found.
- The editable attribute specifies whether the input field can be changed.
A lock is reasonable if you want to specify a value that is not to be changeable. - The CUSTOM_TAG value consists of a value that you want to assign to the tag.
- If you use the AddTag macro under CDATA, you can use the tags with several parameters, which must be specified separated by semicolons.
- The AddTag macro separates the comment starting with the first parenthesis ([) of the parameters (;) and splits the parameter with (;) in an ParamList[] array.
- On the tag you provided in AddTag, you can distribute the $ParamList[n] between attributes and the main value.
Whereas n specifies the parameter position in the input starting with 0. - Example:
#AddTAG("<STOLL:LOAD_PAT_CONTAINER_COMP SIN='$ParamList[0]' JAC='$ParamList[1]' SET='$ParamList[2]' />" $LOAD_PAT_CONTAINER_COMP)
- Optional attributes
- For controlling optional attributes, the macro needs to be informed about which are the optional attributes. This is setup with a Opt[n]: prefix in front of an attribute. n must correspond to the position of the parameter in the input, as it is already the case for ParamList.
- Example:
#AddTAG("<STOLL:LOAD_PAT_CONTAINER_COMP Opt[0]:SIN='$ParamList[0]' Opt[1]:JAC='$ParamList[1]' Opt[2]:SET='$ParamList[2]' />" $LOAD_PAT_CONTAINER_COMP)
USER_TAG
Here you define the tags that will be offered on the machine as user feedbacks and are listed as customer data (4).
Window Example:<USER_TAG label="Faulty pieces" editable="true">30%</USER_TAG>
- The label attribute specifies the name the way it will be displayed in the list of .
You can specify an input value as default (here 30%).
This makes sens for the supposedly correct value, for orientation of as information. - In contrast to CUSTOM_TAG, USER_TAG is not subject to the Velocity mechanism and implicitly generates an input in the XML ticket via the PPS software.
- 1089
- Validate your templates against the StollOrderTemplates.xsd before loading the template file into the PPS.
Suitable tools:
Notepad++ and XML Tools Addin
(see the PpsInstallation\Tools\Notepad++folder of your installations files) - 1090
- Save the template file under a name of its own, which ends with ...,,,OrderTemplate.xml.
- 1091
- Load your new template only then into the PPS:
Assign an own file name and template name to your templates.
- If you have edited a default template or a Stoll default template model file (D:\PPS\SampleTickets\PpsTicketTemplate), your changes will get lost by updating the PPS software.
- Existing Stoll template files are secured through an update under D:\PPS\PpsJBossServer\PpsServerInstallScripts\PpsLast\ PpsSwUsedTillSetup_....
- Changes made to a Stoll default template, which you carried out directly in the PPS are lost when loading updated templates.
- You can only get these changes back via a data base recovery to a date before replacing the template.
- In case of an update, read the supporting documentation (especially What is new) and apply the important changes to your templates.
- Technical changes in the Stoll templates are not automatically applied to your templates.