model.doxy
1 /*!
2 \page model Model
3 <div class="has-toc"></div>
4 
5 # Model # {#model_main}
6 
7 wCMF applications are based on a model. The model defines the key aspects of the
8 application on a higher abstraction level than code does. You can think of it as
9 a condensed description of the application.
10 
11 A template based code generator transforms the model into source code that will
12 run inside the wCMF framework. Where necessary, the code can then be enhanced
13 manually inside pre-defined regions. Further generation runs will protect these
14 manual additions.
15 
16 We believe that this approach helps to develop a clear concept of the application
17 and improves code quality and maintainability dramatically.
18 
19 ## Modeling ## {#model_create}
20 
21 Technically the model is an [UML](http://en.wikipedia.org/wiki/Unified_Modeling_Language)
22 model that uses the _Chronos_ [profile](http://en.wikipedia.org/wiki/Profile_%28UML%29)
23 from the [Olympos](http://sourceforge.net/projects/olympos/) project. It is stored
24 in an [Eclipse MDT/UML2](http://wiki.eclipse.org/MDT-UML2) compatible XML file
25 (e.g. `model.uml`). This file can be directly edited using
26 [Eclipse Papyrus](http://www.eclipse.org/papyrus/) or any other [compatible UML
27 modeling tool](http://wiki.eclipse.org/MDT-UML2-Tool-Compatibility). Alternatively
28 you can use the [Chronos Web Modeler](http://sourceforge.net/projects/olympos/)
29 that allows browser based collaborative modeling. wCMF uses a minimized version
30 of the code generator from the Olympos project with wCMF specific templates.
31 
32 The following diagram shows the workflow of the generator.
33 
34 \image html generator.png "Generator workflow"
35 
36 ### Chronos profile ### {#model_profile}
37 
38 _Profiles_ are used to extend UML for different domains. They consist of __stereotypes__
39 and __tags__ that are applied to model elements to express domain specific
40 features. The following sections describe the stereotypes and tags of the _Chronos_
41 profile that are used to define various aspects of a wCMF application. The complete
42 [Chronos profile](https://raw.githubusercontent.com/iherwig/wcmf-default-app/master/model/chronos.profile.uml)
43 is available on GitHub.
44 
45 You will notice that only a small part of UML is used to define the application
46 and not all aspects of the application are defined in the model. Especially the
47 actual behavior of controllers and domain classes is omitted, since we believe
48 that this is more efficiently expressed in code. For simplicity and compatibility
49 reasons all aspects can be modeled in __class diagrams__ using __classes__,
50 __attributes__ and __associations__.
51 
52 \note UML elements and concepts that are not mentioned in the following sections
53 are most likely not supported by the generator and will be ignored.
54 
55 ### Domain classes ### {#model_classes}
56 
57 The following __stereotypes__ are used to model persistent domain classes and their relations.
58 
59 | Name | UML meta class | Description | Example
60 |------|----------------|-------------|--------
61 | _ChiNode_ | Class | Persistent domain class, must inherit from the \link wcmf::lib::model::Node `Node`\endlink | _Article_
62 | _ChiValue_ | Attribute | Persistent attribute in a _ChiNode_ | _headline_ of Article
63 | _ChiValueRef_ | Attribute | ReadOnly-reference to an attribute of another _ChiNode_ | _author_name_ in Article references _name_ in Author
64 | _ChiManyToMany_ | Class | Connection class in a many to many relation between _ChiNode_ classes, must inherit from \link wcmf::lib::model::Node `Node`\endlink | One _Author_ writes nultiple _Articles_ and one _Article_ has multiple _Authors_
65 | _ChiAssociation_ | Association | Optional, e.g. used to define a foreign key name in a relation between _ChiNode_ instances | _author_id_ in Article as foreign key to Author table
66 
67 #### ChiNode / ChiManyToMany #### {#model_chinode}
68 
69 The following __tags__ are defined on the _ChiNode_ / _ChiManyToMany_ stereotypes.
70 
71 | Tag | Description | Example | Default value
72 |-----|-------------|---------|--------------
73 | _initparams_ | Name of the configuration section, which defines initialization parameters for the \link wcmf::lib::persistence::PersistenceMapper `PersistenceMapper`\endlink instance | _database_ | _database_
74 | _display_value_ | Attributes to display in a list view: A single attribute name or \|-separated list of attribute names | _name\|date_ | |
75 | _orderby_ | Definition of default sorting: _none_ (no order), _sortkey_ (generates a _sortkey_ column, that is used for explicit sorting) or the name of any attribute optionally followed by _ASC_ or _DESC_ | _name ASC_ | _none_
76 | _is_searchable_ | Boolean, indicating whether this type should be included in the default search | _true_ | _true_
77 | _is_soap_ | Boolean, indicating whether this type should be exposed to the SOAP interface | _true_ | _true_
78 | _table_name_ | The name of the database table in which instances will be stored | _Author_ | Class name
79 | _pk_name_ | The name of the primary key column: A single value or \|-separated list of values (the generator will add this automatically, if there is no appropriate attribute) | _fk_user_id\|fk_role_id_ | _id_
80 | _child_order_ | The order of the associated child types: A single type or \|-separated list of types | _Image\|Textblock\|Attachment_ in Article type | |
81 | _parent_order_ | The order of the associated parent types: A single type or \|-separated list of types | _Author\|Publisher_ in Article type | |
82 
83 \note Some of these tags are accessible in the application through the
84 \link wcmf::lib::persistence::PersistentObject::getProperty `PersistentObject::getProperty`\endlink
85 method.
86 
87 #### ChiValue #### {#model_chivalue}
88 
89 The following __tags__ are defined on the _ChiValue_ stereotype.
90 
91 | Tag | Description | Example | Default value
92 |-----|-------------|---------|--------------
93 | _app_data_type_ | Application specific attribute tags: A single value or \|-separated list of values (see \ref pers_values) | _TAG_A\|TAG_B_ | _DATATYPE_ATTRIBUTE_
94 | _db_data_type_ | The attribute's database type | _TEXT_ | _VARCHAR(255)_ |
95 | _is_editable_ | Boolean, indicating whether this attribute is editable | _true_ | _true_
96 | _input_type_ | Name of the attribute's input control as listed in the _InputTypes_ configuration section and additional configuration encoded as JSON string | _filebrowser_ or _ckeditor:{"toolbarSet":"full"}_ | _text_
97 | _display_type_ | Name of the attribute's display type as listed in the _DisplayTypes_ configuration section | _image_ | _text_
98 | _restrictions_match_ | Name of the attribute's validation type as listed in the _Validator_ configuration section (see \ref pers_validation) and additional configuration encoded as JSON string | _regexp:{"pattern":"^[0-9]*$"}_ or _image:{"height":[300,0]}_ | |
99 | _restrictions_not_match_ | _not used_ | | |
100 | _restrictions_description_ | Validation description used in case of a validation error | _The value must be an integer or empty_ | |
101 | _column_name_ | The name of the database column in which the attribute will be stored | _name_ | Attribute name
102 
103 \note Some of these tags are accessible in the application through the
104 \link wcmf::lib::persistence::PersistentObject::getValueProperty `PersistentObject::getValueProperty`\endlink
105 method.
106 
107 #### ChiValueRef #### {#model_chivalueref}
108 
109 The following __tags__ are defined on the _ChiValueRef_ stereotype.
110 
111 | Tag | Description | Example | Default value
112 |-----|-------------|---------|--------------
113 | _reference_type_ | Type, that owns the referenced attribute | _Author_ | |
114 | _reference_value_ | Name of the references attribute | _name_ | |
115 
116 #### ChiAssociation #### {#model_association}
117 
118 The following __tags__ are defined on the _ChiAssociation_ stereotype.
119 
120 | Tag | Description | Example | Default value
121 |-----|-------------|---------|--------------
122 | _fk_name_ | Name of the foreign key attribute (the generator will add this automatically, if there is no appropriate attribute) | _author_id_ | _fk_\_type\_ _id_ |
123 
124 #### Example class diagram #### {#model_class_example}
125 
126 A simple data model is shown in the diagram below. Each of the domain classes
127 _Author_, _Article_ and _Image_ is modeled with _ChiNode_ stereotype, their
128 attributes with _ChiValue_ stereotype. The only exception is the _author_name_ attribute,
129 which is a reference to the _name_ attribute of _Author_ and therefore uses the
130 stereotype _ChiValueRef_. As the relations between the classes show, one _Author_
131 can own several _Articles_ and each _Article_ in turn can contain several _Images_.
132 
133 All \link wcmf::lib::persistence::PersistenceMapper `PersistenceMapper`\endlink instances
134 are initialized using the parameters defined in the _database_ configuration section.
135 
136 In list views _Author_ instances are sorted by _name_ while _Article_ and _Image_
137 instances get an attribute _sortkey_ which is used to define an explicit order.
138 
139 \image html model.png "Example class diagram"
140 
141 #### Associations #### {#model_associations}
142 
143 Relations between domain classes - e.g. parent-child relations - are modeled as
144 associations. Three different __types of associations__ are supported: _compositions_,
145 _aggregations_ and _one-directional associations_ as shown in the following
146 diagram.
147 
148 \image html associations.png "Association types"
149 
150 It is important to understand how wCMF recognizes __parents and children__ in an
151 association. In case of compositions and aggregations the parent is always
152 the class, that is connected with the diamond end of the association. Other
153 associations are treated as parent-child relation, if they are only navigable
154 in one direction, which is then defined as the child to parent direction.
155 
156 The association types differ in the treatment of children in case of __deletion__
157 of the parent. In aggregations and normal associations children are not deleted,
158 while composite children are deleted on parent deletion. On the other hand the
159 \ref app "default application" allows __creation__ of child instances in a
160 composition, while the other two types only allow adding existing instances.
161 
162 The following table summarizes the behavior of the different association types
163 regarding the operations allowed on child instances:
164 
165 | Association type | Delete children | Create children | Associate children
166 |------------------|-----------------|-----------------|-------------------
167 | Composition | Yes | Yes | No
168 | Aggregation | No | Yes | Yes
169 | Association | No | No | Yes
170 
171 ##### Multiplicity #####
172 
173 The multiplicity at the association ends limits the amount of instances that
174 are allowed at that relation end. In a typical parent-child relation the parent
175 end has a value of `1` and the child end has a value of `0..*` meaning that a
176 child instance is connected to exactly one parent instance, while any number
177 of child instances may be connected to the parent instance (including zero).
178 This kind of relation is called __one-to-many relation__ and is easy to realize
179 in a database by using a _foreign key_ column.
180 
181 __Many-to-many relations__ on the other hand allow an arbitrary number of
182 instances at both ends and are typically realized in an database using a
183 _junction table_. The Chronos profile allows for this by providing the `ChiManyToMany`
184 stereotype. The following diagram shows how to model a many-to-many relation:
185 
186 \image html many-to-many.png "Many-to-many relation"
187 
188 Using compositions ensures that many-to-many instances are deleted correctly,
189 when the parent instances are deleted.
190 
191 ##### Navigability #####
192 
193 Another aspect of associations is the use of __arrow ends__ that define the
194 navigability. If an arrow end is omitted on one end, instances at that end
195 are not accessible from the other end. Regarding the database schema all three
196 association types will result in the creation of a foreign key column in the
197 child table that points to the parent table.
198 
199 ##### Role names #####
200 
201 Each end of an association can have a _role name_ assigned. It describes how the
202 element at that end participates in the relation. Generally the role name
203 defaults to the element's name, but there are two cases where it is necessary to
204 assign a dedicated name:
205 
206 - _Multiple associations_
207 - _Self associations_
208 
209 Sometimes __multiple associations__ have to be defined between two domain classes.
210 For example if there are `Person` and `Task` domain classes and tasks should be
211 associated with persons. If each task should have an owner and a creator, there
212 will be two aggregations between the two domain classes. To allow wCMF to know
213 which role a person has in relation to a given task, role names have to be
214 assigned to the association ends.
215 
216 The following diagram illustrates the given example:
217 
218 \image html multiple-associations.png "Role names in multiple associations"
219 
220 To build a hierarchy where one item contains items of the same type, an
221 association from the domain class to itself is required. An example would be a file
222 system with nested directories. In this case, role names are required at each end
223 of this __self association__.
224 
225 The following diagram illustrates the given example:
226 
227 \image html self-associations.png "Role names in self associations"
228 
229 #### Inheritance #### {#model_inheritance}
230 
231 If different domain classes should have the same attributes, a common base class
232 can make these available to inheriting classes. An example may be an `EntityBase` type,
233 which defines meta information like creation date and last modification date for
234 all domain classes. The diagram below illustrates the concept.
235 
236 \image html inheritance.png "Inheritance"
237 
238 Inheritance will cause the generator to create new relations in the following cases:
239 
240 <div class="image-table">
241 | Parent relations | Child relations
242 |------------------|----------------
243 \image html inherited-relation1.png "Subclass B becomes parent of A" | \image html inherited-relation3.png "Subclass B becomes child of A"
244 \image html inherited-relation2.png "Parent class of B becomes parent of A" | \image html inherited-relation4.png "Child class of B becomes child of A"
245 </div>
246 
247 ### Application flow ### {#model_flow}
248 
249 Since a wCMF application is based on the Model-View-Controller pattern, application
250 flow is defined in terms of _controllers_ and _views_. Controller execution is triggered
251 by _actions_ which are initiated by the application user.
252 
253 The following __stereotypes__ are used to model user interaction.
254 
255 | Name | UML meta class | Description | Example
256 |------|----------------|-------------|--------
257 | _ChiController_ | Class | Controller class, must inherit from the \link wcmf::lib::presentation::Controller `Controller`\endlink | _LoginController_
258 | _ChiView_ | Class | View assigned to a _ChiController_ | _login_
259 | _ChiActionKey_ | Association | Associates two _ChiController_ instances (to define a control flow) or a _ChiView_ with a _ChiController_ (to define a view attachment), must be _one directional_ | |
260 
261 \note _ChiActionKey_ realizes the concept of _action keys_ (see \ref arch_actionkey).
262 Multiple action keys may be defined between controllers or controllers and views
263 each one used in a different context and/or for a different action.
264 
265 #### ChiController #### {#model_chicontroller}
266 
267 No __tags__ are defined on the _ChiController_ stereotype.
268 
269 #### ChiView #### {#model_chiview}
270 
271 No __tags__ are defined on the _ChiView_ stereotype.
272 
273 #### ChiActionKey #### {#model_chiactionkey}
274 
275 The following __tags__ are defined on the _ChiActionKey_ stereotype.
276 
277 | Tag | Description | Example | Default value
278 |-----|-------------|---------|--------------
279 | _action_ | The action, which is triggered by this association. If empty, any action is valid | _save_ | |
280 | _context_ | The context, in which this association is valid. If empty, any context is valid | _author_ | |
281 | _config_ | The configuration, in which this association is defined | _config.ini_ | _config.ini_ |
282 
283 #### Example application flow #### {#model_example_flow}
284 
285 An example for a simple interaction model is given in the diagram below. The
286 controllers are modeled with the stereotype _ChiController_, the associations with
287 _ChiActionKey_ stereotype. Each association's tagged values are displayed in an
288 attached note. Since the association between _AuthorController_ and _author_ view
289 does not define the tagged values _action_ and _context_, _AuthorController_
290 displays this view for every action and context. The same applies to _ArticleController_
291 and the _article_ view. _SaveController_ does not display a view, it only stores
292 the data passed to it and returns to the next controller.
293 
294 For associations, which link controllers, at least the tagged value _action_ is set.
295 Since obviously all _save_ actions result in the execution of _SaveController_,
296 no context is necessary. The context is helpful, when we want to solve the
297 ambiguousness of the action _ok_ upon termination of _SaveController_.
298 We define, that the context is _author_ when editing the author and _article_
299 when editing articles. By this the application always knows to which controller it
300 should return to after executing _SaveController_.
301 
302 \image html flow.png "Example application flow"
303 
304 \note If the _controller_ value of the action key should be empty, meaning that the
305 action can be triggered from _any_ controller, the source of the _ChiActionKey_
306 association must be the \link wcmf::lib::presentation::Controller `Controller`\endlink
307 base class.
308 
309 #### Controller methods #### {#model_controller_methods}
310 
311 By default the framework calls the method _doExecute_ on the current controller
312 instance for any _context_ and _action_ value. For this reason an empty implementation
313 of this method will be added by the generator.
314 
315 To distinguish different actions or contexts it is also possible to model several
316 operations inside the controller class. To connect an action key to a controller
317 method, the action key's end that points to the controller must be named like
318 the method. The following diagram illustrates the concept:
319 
320 \image html controller-methods.png "Controller methods"
321 
322 ### Configuration ### {#model_config}
323 
324 The following __stereotypes__ are used to model the application configuration.
325 
326 | Name | UML meta class | Description | Example
327 |------|----------------|-------------|--------
328 | _ChiSystem_ | Class | A configuration section, class members and their default values become key-value pairs inside the section | _Database_
329 
330 #### ChiSystem #### {#model_chisystem}
331 
332 The following __tags__ are defined on the _ChiSystem_ stereotype.
333 
334 | Tag | Description | Example | Default value
335 |-----|-------------|---------|--------------
336 | _platform_ | The platform to which the configuration settings apply | _wcmf_ | |
337 | _config_ | The configuration, in which the settings are defined | _config.ini_ | _config.ini_ |
338 
339 #### Example configuration #### {#model_example_config}
340 
341 The following diagram shows the configuration of a database connection. The
342 connection parameters can be accessed later using the
343 \link wcmf::lib::config::Configuration::getSection `Configuration::getSection`\endlink
344 method and passing _database_ as `section` paramter.
345 
346 \image html config.png "Example configuration"
347 
348 ### Default model ### {#model_default}
349 
350 The \ref app "default application" inlcudes a demo UML model located in
351 `model/model.uml`. It is a good starting point for own experiments. For those who
352 want to start from scratch there are also base models in _model/base/cwm/_ (for
353 [Chronos Web Modeler](http://sourceforge.net/projects/olympos/)) and
354 _model/base/papyrus/_ (for [Eclipse Papyrus](http://www.eclipse.org/papyrus/)).
355 
356 The default model has the following package structure:
357 
358 - _model_
359  - _wcmf test_
360  - _Primitive types_
361  - _root_
362  - __configuration__ Application specific configuration
363  - _default_
364  - _config.ini_
365  - `«ChiSystem» Config`
366  - ...
367  - ...
368  - _wcmf_ Framework packages with useful (base-)classes
369  - _application_
370  - _controller_ Existing controllers
371  - `«ChiController» AssociateController`
372  - ...
373  - _lib_
374  - _presentation_
375  - `«ChiController» Controller` Base class for all controller classes
376  - _model_
377  - `«ChiNode» Node` Base class for all domain classes
378  - _security_
379  - _principal_
380  - _impl_
381  - `AbstractUser` Base class for custom user class
382  - `AbstractRole` Base class for custom role class
383  - _app_ Application specific packages
384  - _src_
385  - __model__ Domain class package
386  - _wcmf_ Default framework classes
387  - `«ChiNode» DBSequence`
388  - ...
389  - `«ChiNode» EntityBase` Base class for domain classes with audit info
390  - ...
391  - __controller__ Controller package
392  - `«ChiController» RootController` Main controller of \ref app "default application"
393  - __views__ Views package
394  - `«ChiView» cms` Main view of \ref app "default application"
395 
396 Application specific model elements will mostly reside in the __emphasized__ packages.
397 
398 ## Generator ## {#model_generator}
399 
400 wCMF uses the code generator from the [Olympos](http://sourceforge.net/projects/olympos/)
401 project which is originally based on _openArchitectureWare_. The generator is
402 a JAVA application that executes user defined workflows. Workflows are organized in
403 cartridges one of which is the wCMF cartridge. Cartridges are written in the
404 _Xtent/Xpand_ language.
405 
406 If you are using [Composer](https://getcomposer.org/), the generator will be installed
407 as a dependency in the directory _vendor/olympos/chronos-generator_. It may also
408 be downloaded from [SourceForge](https://sourceforge.net/projects/olympos/files/ChronosGenerator-wCMF/).
409 
410 ### Configuration ### {#generator_config}
411 
412 The configuration of the generator is stored as key-value pairs in a file called
413 `workflow.properties` in the _model_ directory. It contains the following __variables__:
414 
415 | Variable | Description | Default value
416 |----------|-------------|--------------
417 | _profilename_ | Name of the used UML profile | _Chronos_ |
418 | _profileUmlFile_ | Path to the profile file | <em>${basePath}/metamodel/chronos.profile.uml</em> |
419 | _modelUmlFile_ | Model file to generate code from | _model.uml_ |
420 | _transformedModelUmlFile_ | Location for the model transformed into the generator's internal format (used for debug purposes) | _model-transformed_ |
421 | _rootPackage_ | Model package containing _libraryPackage_ and _applicationPackage_. It's name will be stripped from paths to classes | _wcmf test::root_ |
422 | _libraryPackage_ | Model package, in which the wCMF framework is defined. From this package no files will be generated | _wcmf_ |
423 | _applicationPackage_ | Model package, in which the application is modeled | _app_ |
424 | _doCheck_ | Indicates whether the generator should run checks on the model | _true_ |
425 | _preCheckFile_ | Check file, that should be used before the transformation into the internal model format | _cartridge::Wcmf::checks::pre_ |
426 | _postCheckFile_ | Check file, that should be used after the transformation into the internal model format | _cartridge::Wcmf::checks::post_ |
427 | _requiredControllerSuperclass_ | Controller base class, from which all controllers must inherit, used in the checks | _model::${rootPackage}::${libraryPackage}::lib::presentation::Controller_ |
428 | _requiredNodeSuperclass_ | Domain base class, from which all domain classes must inherit, used in the checks | _model::${rootPackage}::${libraryPackage}::lib::model::Node_ |
429 | _doBackup_ | Indicates whether the generator should do a backup of the application, before generating any files | _false_ |
430 | _expand_ | Template definition to start the generation from | _cartridge::Wcmf::templates::Root::root_ |
431 | _outputEncoding_ | Encoding of the generated files | _UTF-8_ |
432 | _configFileDefault_ | Name of the default configuration file, general properties like type mapping are declared here | _config.ini_ |
433 | _projectname_ | Name of the application | _wcmf testapp_ |
434 | _targetDir_ | Directory, in which the application is created | _targetDir_ |
435 | _prExcludes_ | File patterns to be excluded when searching for protected regions | <em>*.svn-base, .git, vendor</em> |
436 | _printGenerateDate_ | Indicates whether the generation date should be printed in generated file headers | _false_ |
437 | _headerText_ | Text to be prepended to generated files | |
438 
439 The variables `${basePath}` (generator location) and `${targetDir}` (generated code
440 location) must be provided as __command line__ arguments when running the generator
441 (see \ref generator_run).
442 
443 ### Running ### {#generator_run}
444 
445 The generator is started using the __command__
446 
447 <pre>
448 java -Djava.library.path=<strong><em>libPath</em></strong> -jar ChronosGenerator.jar <strong><em>workflowFile</em></strong> -basePath=<strong><em>basePath</em></strong> -propertyFile=<strong><em>propertyFile</em></strong> -targetDir=<strong><em>targetDir</em></strong>
449 </pre>
450 
451 The __parameters__ are explained in the following table.
452 
453 | Parameter | Description | Default value
454 |-----------|-------------|--------------
455 | _libPath_ | Path to the generator libraries | <em>../vendor/olympos/chronos-generator/lib</em> |
456 | _workflowFile_ | Workflow definition file | <em>../vendor/olympos/chronos-generator/cartridge/Wcmf/workflow/wcmf.oaw</em> |
457 | _basePath_ | Path to the generator installation | <em>../vendor/olympos/chronos-generator/</em> |
458 | _propertyFile_ | Workflow configuration file | <em>../model/workflow.properties</em> |
459 | _targetDir_ | Path to the generated files | <em>../</em> |
460 
461 The __default values__ apply, if the generator is run from the _build_ directory of
462 the \ref app "default application".
463 
464 Since the code generator is integrated into the __ant deployment script__ of the
465 application, it's also sufficient to run the following command in the _build_
466 directory:
467 
468 <pre>
469 ant generate
470 </pre>
471 
472 ### Artefacts ### {#generator_artefacts}
473 
474 The generator creates the following files:
475 
476 #### Configuration #### {#generator_artefacts_config}
477 
478 - __SQL scripts__ are generated in the _install_ directory. They contain the
479  table definitions for [MySQL](http://www.mysql.com) databases (`install/tables_mysql.sql`)
480  and [SQLite](https://sqlite.org) databases (`install/tables_sqlite.sql`). For each domain
481  class one table is created, inherited attributes are stored in each table
482  ([Concrete Table Inheritance] (http://martinfowler.com/eaaCatalog/concreteTableInheritance.html)).
483 
484 - __Configuration files__ in the [INI file](http://en.wikipedia.org/wiki/INI_file)
485  format are generated in the _app/config_ directory. Configuration files are
486  implicitly defined in the model by the `ChiActionKey.config` and `ChiSystem.config`
487  tags. For each name mentioned in these tags, one configuration file will be
488  created, containing all definitions related to it. Furthermore, the default
489  configuration file (_config.ini_ per default) contains the domain class
490  mapping definitions.
491 
492 #### PHP Code #### {#generator_artefacts_php}
493 
494 - __Mapper classes__ are generated in directories corresponding to the
495  model packages (_app/src/model_, if the default model packages are used). For
496  each `ChiNode`/`ChiManyToMany` class one subclass of
497  \link wcmf::lib::model::mapper::NodeUnifiedRDBMapper `NodeUnifiedRDBMapper`\endlink
498  is created (e.g. `AuthorRDBMapper`).
499 
500 - __Domain classes__ are generated in the same directories as the mapper classes.
501  For each `ChiNode`/`ChiManyToMany` class two classes are created, one base class
502  that contains all generated code (e.g. `AuthorBase`) and one empty subclass,
503  that is used to add custom code (e.g. `Author`). The base class inherits from
504  \link wcmf::lib::model::Node `Node`\endlink or one of it's subclasses.
505 
506 - __Controller classes__ are generated in directories corresponding to the
507  model packages (_app/src/controller_, if the default model packages are used). For
508  each `ChiController` class one subclass of
509  \link wcmf::lib::presentation::Controller `Controller`\endlink will be created.
510 
511 - The __SOAP interface__ is generated in the file _app/public/soap-interface.php_.
512  \link wcmf::application::controller::SOAPController `SOAPController`\endlink
513  uses this file to configure the \link wcmf::lib::service::SoapServer `SoapServer`\endlink.
514 
515 #### Template Code #### {#generator_artefacts_tpl}
516 
517 - __View templates__ are generated in directories corresponding to the
518  model packages (_app/src/views_, if the default model packages are used). For
519  each `ChiView` class one empty template file will be created.
520 
521 #### JavaScript Code #### {#generator_artefacts_js}
522 
523 - __Domain classes__ are generated in a subdirectory of _public/js_
524  (_app/public/js/app/src/model_, if the default model packages are used).
525  For each `ChiNode`/`ChiManyToMany` one subclass of `Entity` is created.
526 
527 - An [AMD](http://en.wikipedia.org/wiki/Asynchronous_module_definition) file
528  referencing all domain classes is created in _public/js/model_
529  (_app/public/js/model/_TypeList.js_, if the default model packages are used).
530 
531 #### Protected regions #### {#generator_pr}
532 
533 The generator creates functional code, but of course __custom code__ must be added
534 to implement domain specific functionality. For this reason
535 the generator adds sections that are enclosed in `PROTECTED REGION` tags,
536 between which the user is supposed to place custom code. When re-generating
537 the code later (e.g. because of model changes), this custom code will be preserved.
538 
539 An example of a class file containing protected regions is shown below.
540 
541 ~~~~~~~~~~~~~{.php}
542 <?php
543 /**
544  * This file was generated by ChronosGenerator from model.uml.
545  * Manual modifications should be placed inside the protected regions.
546  */
547 namespace app\src\model;
548 
549 use app\src\model\AuthorBase;
550 // PROTECTED REGION ID(app/src/model/Author.php/Import) ENABLED START
551 // PROTECTED REGION END
552 
553 /**
554  * Author description:
555  *
556  * @author
557  * @version 1.0
558  */
559 class Author extends AuthorBase {
560 // PROTECTED REGION ID(app/src/model/Author.php/Body) ENABLED START
561 // PROTECTED REGION END
562 }
563 ?>
564 ~~~~~~~~~~~~~
565 
566 */