Documentation:User:GettingStarted:DataForm
From SIDE-Labs.org
Contents |
Data form collection
Usually, ECM application requires to use dematerialized forms to add content type description. The following paragraphs give for beginners a basic overview of data forms modeling and generation, and for users more familiar a quick solution for the need at hand. For additional information, refer to the SIDE Form Modeling Guide.
Model Creation
The NewSideProject has already been created with the data model, so continue with it. Right click on your existing 'form' folderOr create your 'form' folder 'File / New / Folder'Folder Name / Click on 'Finish'Let's create a form model: File / New / Other... / SIDE / Side Form Model / Click on Next
Figure 1.1. Form Model
Enter the name of your model, for instance 'Digitization.data', and click on Next. The following window allows to choose the kind of form model you want. You have got one choice between 'Class Form Collection' and 'Workflow Form Collection': 'Form Model'Model Object / Choose 'Class Form Collection''XML Encoding / Let the 'UTF-8' value'Click on Finish
Figure 1.2. Select Class Form Collection
The form model has been created under your form folder. Contrary to data and workflow models, here is only one model 'Digitization.data.form', looking at a tree, containing all the designed form structure. The 'Digitization.data.form' model is automatically opened in the SIDE form modeler. SIDE Modeler Layout
Form and Class relationship
Link your current form diagram to your data model
First click on 'Class Form Collection', and on the Properties pane, set the Name 'Digitization'. Then, Right click on 'Class Form Collection Digitization''Choose 'Load ressource...' / Click on 'Browse Workspace''Double click on your 'GTYaMma' project / Select your data model 'Digitization.dt'Be careful no to choose 'Digitization.dtdi' which only contains graphical information. Click on 'OK'Your data diagram is linked to your form model.
Figure 1.3. Form Diagram linked to Data Model
Synchronize Form model with Class diagram
This command allows synchronizing the form elements with the associated class models which have been updated. It is useful when an associated class model has been updated and the updates must be propagated to the form elements. This command uses a model to model transformation to propagate the updates. Right click on 'Class Form Collection Digitization' > select 'Synchronize with Class Diagram'.
Figure 1.4. Option 'Synchronize with Class Diagram'
Creation of the Class Form
Right click on 'Class Form Collection Digitization' 'Select 'New Child' / 'Form Class''Click on the newly created Form Class In the Properties view, Click on 'Real class' / and on the black arrow on the right of the line(enlarge the drop down list if you don't see it) Select 'Clazz Document'Come back to your main view and 'Right-click on Form Class'Choose 'Initialize form class' You can observed your three attributes: name, author, digitizationDate. Proceed the same way, and create two other Form Class: one called 'InboxMail', the other 'OutboxMail'. Note that it is important to save your model regularly (File/Save or Ctrl + S).
Design your Class Form
Group in a new group
This command allows to create a 'Form Group'. The Form group may then be populated by dragging and dropping other attribute fields.
Figure 1.5. Option 'Group in a new group'
Create a Group under the 'Document form class':
Right Click on the attribute 'digitizationDate'
Select 'Group in a new group'
Click on the 'New group' created
Go to the Property pane and set the 'Id' and the 'Label' with 'Date'
Proceed the same way to group:
'author' and 'digitizationDate' under 'Digitization'
'name' and 'answer' under 'Info'
Note that there is no limit at the overlapping of group in the modeler but most of the generators does not support more than one level of groups.
Presentation in Properties
When you click on a 'Form class', in the Properties Pan there is line called Presentation. Click on the line 'Properties'; you can see five kinds of presentations possible:
auto: organize automatically the different group if created
horizontal: organize horizontally the different group if created
vertical: organize vertically the different group if created
tabbed: organize the different group if created with tabbed
borderless: organize the different group if created with tabbed
So to complete the creation of Group by organizing the presentation of the form. It is necessary to drag and drop the attribute field which will have a specific presentation in this group and to choose the mode of presentation by setting the 'Presentation' property of the group through the Properties View.
Test your Form
Refresh Outline
There is a function called 'Refresh Outline', which enables to look at the result of the Class form collection design very quickly.
Right click on 'OutboxMail' / Choose 'Refresh Outline'
If the window is not automatically opened, click on the 'OutlineHTMLView' located near the Properties pane.
Figure 1.6. OutboxMail Refresh Outline
Drag and Drop on Attributes
Note that you can organize the forms by moving the different attributes with a 'drag and drop': just click on a attribute and move it where you want.
==
Figure 1.7. Drag & Drop on Attributes
====
Figure 1.8. Drag & Drop on Attributes
Activate/Deactivate SIDE Builder
Activate or deactivate the SIDE builder enables to control the dependency between different models. In case of creation, extinction, modification, transfer or another action, the builder traces information, control and indicate dependencies in the 'Problems' pane near the 'Properties' tab. 'Right click on your project 'GTYaMma''Go to SIDE / Click on Activate/Deactivate SIDE builderThe SIDE blue circle icon turns green. A .metadata folder is created. If a problems occurs, a red arrow appears in the Problems pane indicating the resource concerned by the error (for example the .form), the path where to find, and the type of the error, whether this is an SIDE, EMF error. The error occurs only when the models are recorded. This basic class form collection model structure three content types (Document, InboxMail, OutboxMail), each structured in different subcategories of attributes as Digitization and Info grouped around thematic way (time, general information, ).
Application
Creation
Prior to generate the form model, we must create an Application model which will store the description of our application and its components. Right click on 'models' in the Navigation pane and select: New / Other / SIDE / Side Application Model
Figure 1.9. Application model creation
Enter the File name 'Digitization.application' and click on Finish.
The application model 'Digitization.application' is created in your project.
Note that normally, you have ever create a .application model for the generation of your data model. In this case reuse it for the class form collection generation and deployment.
Select this file and
Right click to open the contextual menu'Select the menu item SIDE / Manage Configuration'to start the panel in which you will declare the steps of generation of your application:
Figure 1.10. Application Generation Configuration Model Lists
The application generation configuration is divided in 4 main parts.
Configuration List
The List of configurations allows defining several generation configurations. The first time there is no configuration and you must click on the green circle (with the little white arrow inside) to create the first configuration labeled by default 'New Configuration'. Click on the item representing a white page (with a little pen), to change the name of the configuration: Enter 'Main' in the name of the configuration input view. You may create several configurations all along your project: for instance, after finalizing a functional layer of your application, it is no more necessary to generate and deploy it all the times with the models you are working on.
Configuration 'Models' tab
The 'Models' tab allows to declare the models you want to generate on the targeted frameworks.Click on 'Add Models' and select 'Digitization.dt' and 'Digitization.data.form' under 'myProject/src/models/data'. You can add as many models as you need for your application.
Configuration Generation tab
The 'Generation' tab allows selecting the generators you want to use on top of the models you declare in the 'Models' tab : the selected generators produce the artifacts on specific frameworks they are associated to.This pane proposes, in the upper part, common options to set up:
- 'Log path' must be set up to indicate where to store the log of the generations; enter /GTYaMma/build/logs.
- 'Generation path' must be set up to indicate where to store the result of the generations; enter /GTYaMma/build/generated.
- Click on 'Sans Validation' [Skip validation] if you do not want to perform model validation before generation. Model validation is by default automatically performed to avoid generating on incorrect or inconsistent models. But, if you are sure that your models are valid (use 'Validate' to perform a direct validation), select this option.
- Click on 'Documentation generation' if you want to generate the documentation associated to your models. This feature will generate an .odt file that you can find under
GTYaMma / build / logs / Main(name of your configuration) / doc / Digitization-dt.odt
- Click on 'Documentation generation' if you want to generate the documentation associated to your models. This feature will generate an .odt file that you can find under
GTYaMma / build / logs / Main(name of your configuration) / doc / Digitization-dt.odt It proposes, in the lower part, a structured tree where each branch is conforming to the following schema:
- The first level indicates the type of metamodel.
Note that if you select a meta-model but you do not have declared under the models tab at least a model conform to this metamodel, obviously no generation will be performed. - The second level indicates the targeted technology: this is the kind of framework on which a part or all the application must be deployed. For instance, 'Alfresco' is a technology.
- The third level indicates the version of the targeted technology.
- The fourth level indicates the generator to use: it may exist several generators for a metamodel, a framework and a release.
- The fifth level gives the generation options.
Click on the label of each level to have description in the upper right part of the window. %%%
Figure 1.11. Application Generation Configuration Tab
To select a particular generator to apply on your models, first click on the circle checkbox of the metamodel first level, then on the technology second level, then on the version third level and then on the generator. First click on: KSR500 Data / Alfresco / Alfresco 3.x Labs and Enterprise / SIDE Content Model Generator for AlfrescoThen select the options of the generator. Click on (if not automatically tick): Alfresco Share ExtensionSome parameters of the generator must be set up on the right lower table of the window. For instance, for the SIDE Alfresco Content Model Generator it is necessary to set up the Module Version if you want to keep an historic of the generated artifacts. Click on: Save [Enregistrer]to save the generation configuration. Next click on: KSR400 Form / Xforms / Chiba 1.5.x / SIDE Chiba Form Generator for AlfrescoSome parameters of the generator must be set up on the right lower table of the window. Set the 'Webapp adress' with 'http://localhost:8080/xforms'. Click on: Save [Enregistrer]to save the generation configuration.
Configuration Deployer tab
The 'Deployer' tab contains a single tree similar to the generation one but without the first metamodel level. The purpose of the deployer tree is to select installed framework instance to install generated artifacts on them. Let's suppose that you follow the SIDE Installation guide and that you installed Alfresco 3.2 Enterprise. In the deployment tree, you can select: Alfresco / Alfresco 3.x Labs and Enterprise / SIDE Content Model Generator for Alfrescoto indicate that you want to deploy the generated artifacts on this special instance of Alfresco: in this case, all the models which have been generated using generators on the technology 'Alfresco' and the release '3.x' will be deployed on this Alfresco instance through the SIDE Alfresco deployer. SIDE is now compatible with Alfresco 3.2R2.
Figure 1.12. Application Deployment Configuration Tab
It is important to note that deployers are independent of meta-model; for instance, the SIDE Alfresco Deployer will deploy on the same Alfresco instance artifacts generated with a Data model and a Workflow model. Deployers are based on the deployment technique of the targeted framework. The SIDE Alfresco Deployer uses AMP Alfresco Module Package and WAR files to deploy the generated artifacts on Alfresco instance. On selection of a deployer, you usually have to set up some parameters which indicate where is installed the framework instance: for instance, for the 'SIDE Alfresco deployer'. If you previously install Alfresco on your machine, you can set up the Tomcat Installation directory to point on the 'tomcat' directory of Alfresco, for example C:\Alfresco\tomcat You need to stop Alfresco before running the generation & deployment to avoid conflicts during deployment. In the deployment tree, then select: Xforms / Chiba 1.5x / SIDE Chiba X-Forms Direct Deployer / CleanOn selection of a deployer, you usually have to set up some parameters which indicate where is installed the framework instance: for instance, for the 'SIDE Chiba X-Forms Direct Deployer', the 'Webapp context' is 'xforms'. You have to retrieve the webapp Xform and the message.properties file on the update-site http://www.side-labs.org/SIDE-Labs/2.0/ext/'Copy the xforms.war file'Paste it under in Alfresco directory / under Tomcat / webappsThe file will be deployed after SIDE Deployment.
Form structure generation & deployment
At this point we can launch the generation of our 'Digitization.dt' and 'Digitization.data.form' model. Click on 'Launch' Note: you can also launch the generation of one specific application configuration directly by right clicking the application model file and selecting 'Launch Generation':
Figure 1.13. Quick launch of generation
A generation window is opened and displayed the generation steps. At the end of the generation, it indicates if the generation is complete with or without errors: In case, there is error, errors are listed in the window and in the log files (one per generator) under the log paths. In case of no errors, the generation path will contain all the generated artifacts. Moreover, the 'side_report.xml' page has been generated in the logs path and gives information on the generation process. You can load this page directly in a browser:
- 'Stats' gives a consolidated view of the generation for all the generators and deployers and per generator and deployer.
- 'Generators' gives a detailed view of the generated artifacts per generator: you have access through this view to all the generated artifacts.
- 'Deployers' gives a detailed view of the deployed package per deployer: you have access through this view to the package the deployer has deployed on the targeted frameworks. These packages may be deployed on other instances of the framework on other machines.
- 'Documentation' gives access to the generated documentation for all the models declared in the application configuration.
- 'Services' gives entry points to load per generator all the services which have been generated and deployed on the targeted framework instances.
- 'Console' is an exact copy of the logs displayed in the generation console.
Figure 1.14. SIDE : MDA report procedure
In order to check that the new forms have been created, connect to Chibahttp://localhost:8080/xforms Click on Go / form / OutboxMail / click on tab 'info' and 'Digitization'
Figure 1.15. Info Form
Figure 1.16. Digitization Form










