Additions:
Say you want to add a html documentation template for each WCMFNode class defined in the model. The template definition should be located in a file called Doc.tpl. There are 3 steps to execute:
1) Add the template call at the appropriate location. Using the preceeding example you may add a call to Doc::file to the Root template defined for WCMFNode.
3) Provide the template definition. Since the template name is //file//, you'll have to put a template called //file// in the file Doc.tpl. The type you define the template for must be WCMFNode. The complete template may look like this:
«REM
This template expands the documentation for model elements
»
«DEFINE file FOR WCMFNode»
«FILE Name".html"»
/**
* This file was generated by wCMFGenerator «GeneratorVersion» from «ModelFile» on «Date».
* Manual modifications should be placed inside the protected regions.
*/
Documentation for «Name»
«Documentation»
«ENDFILE»
The line «FILE Name".html"» instructs the generator to generate a file named Name.html in the target's root directory. If you like to reuse this template for different metamodel classes, you may replace the line «DEFINE file FOR WCMFNode» with «DEFINE file FOR ""ModelElement""», which will let the template match for all model elements.
Deletions:
Say you want to add a documentation template for each WCMF... class stereotype (Nodes, Controllers, Views) defined in the model. The template definition should be located in a file called Doc.tpl. There are 3 steps to execute:
1) Add the template call at the appropriate location. The mappings file says that all instances of //Class// are mapped to the metamodel class //WCMFClass//. Since the Node, Controller, View metamodel classes inherit from WCMFClass, we can put our call into the template defined for //Class//. Using the preceeding example you may add a call to Doc::file to the Root template defined for Class.
3) Provide the template definition. Since the template name is //file// , you'll have to put a template called //file// in the file Doc.tpl. To be
Additions:
===Adding a Template===
Say you want to add a documentation template for each WCMF... class stereotype (Nodes, Controllers, Views) defined in the model. The template definition should be located in a file called Doc.tpl. There are 3 steps to execute:
1) Add the template call at the appropriate location. The mappings file says that all instances of //Class// are mapped to the metamodel class //WCMFClass//. Since the Node, Controller, View metamodel classes inherit from WCMFClass, we can put our call into the template defined for //Class//. Using the preceeding example you may add a call to Doc::file to the Root template defined for Class.
«EXPAND Doc::file FOR This»
2) Create the template file. Since you decided to put the template definition in a file called //Doc//, you'll have create that file. We created all wCMF specific files in a folder wcmf (the generator automatically finds them if it is a subfolder). So put an empty Doc.tpl in the folder /templates/with_domain_classes/wcmf.
3) Provide the template definition. Since the template name is //file// , you'll have to put a template called //file// in the file Doc.tpl. To be