Documentation:User:GettingStarted:View
From SIDE-Labs.org
Contents |
View Modeling and Generation
Usually, the last one to create is the view model which describes the organization of the portal which will be used by the application. For Alfresco based application, view is composed of two View Portal: 'Composed View List' and 'Composed View Details'. The following paragraphs gives for beginners a basic overview of view modeling and generation and for users more familiar a quick solution for the need at hand. For additional information, refer to the SIDE View user guide.
Model Creation
Create a new folder 'view' under your existing GTYaMma project (already created with data and workflow models), or right click on your existing 'view' folder if you have import the 'NewSideProject' (GTYaMma).
'File / New / Folder'Folder Name / Click on 'Finish'Let's create a workflow model:
File / New / Other... / SIDE / Side Workflow Model / Click on Next
Figure 1.1. View Model
Enter the name of your model, for instance Digitization, and click on Finish. The view model has been created under your view folder. Contrary to data and workflow models, here is only one model 'Digitization.view', looking at a tree, containing all the designed view structure. The 'Digitization.view' model is automatically opened in the SIDE form modeler. SIDE Modeler Layout
View and Class relationship
Link your current view diagram to your data model
First click on 'Collection', and on the properties pane (part E), set the Name 'ViewPortal'. Then right click on 'ViewPortal' '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 view model.
Figure 1.2. View Model link to Data Model
Synchronize View model with Class diagram
This command allows synchronizing the view 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 view elements. This command uses a model to model transformation to propagate the updates. Right click on 'ViewPortal' / Select 'Synchronize views with Class Diagram'.
Figure 1.3. Option 'Synchronize with Class Diagram'
Creation of the View Model
Right click on 'ViewPortal'
'Select 'New Child' / 'Composed View Composed View''Click on the newly created 'Composed View'In the Properties Pane, set the Name by 'List'. An create another one create 'Details'.
Right click on 'Composed View List'
'Select 'New Child' / 'Children Data List''Click on the newly created 'Data List'In the Properties Pane, click on the line 'View Of' 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'
Next right click on the 'Data List' and select 'Initialize', every attributes are loaded under your Data List now called 'Document'.
Proceed the same way to link the two other Data List successively with 'Clazz InboxMail' and 'Clazz OutboxMail'. Don't forget to initialize the Data List.
Note that it is important to save your mode regularly (File/Save or Ctrl + S).
Proceed exactly the same way for the second 'Composed View Details', with the same Data List and the same Data Class.
Note that you can validate your model by clicking on the green arrow item on the toolbar in the top of your IDE. If your model is valid, you should see a 'Validation successful' window indicating 'The model is valid'.
Drag and Drop on Attributes
Note that you can organize the views by moving the different attributes with a 'drag and drop': just click on a attribute and move it where you want. Note that you can also delete some attributes if necessary.
Figure 1.4. 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 view model is design in function of the Alfresco Share Portal presentation, with 'List' an 'Details' portlets structured around a PageLibrary.
Application
Creation
Prior to generate the view model, we must create or reuse 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.5. 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.6. Application Model Configuration Tab
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.view' under 'myProject/src/models/view'. 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.7. 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 Alfresco Content Model Generator for AlfrescoThen select the options of the generator. Click on: 'Alfresco Common Webscript'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. Next click on: KSR200 Portal / Alfresco / Alfresco 3.x Labs and Enterprise / SIDE Alfresco Portal GeneratorThen select the options of the generator. Click on: 'Alfresco Share document library components'document details editingFinally click on: KSR300 View / Alfresco / SIDE Alfresco View Generator for Alfresco Share Some parameters of the generator must be set up on the right lower table of the window. 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 first select: Alfresco / Alfresco 3.x Labs and Enterprise / SIDE Alfresco Direct Deployer / Cleanto 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.8. 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.
View structure generation & deployment
At this point we can launch the generation of our 'Digitization.dt', 'Digitization.portal' and 'Digitization.view' models. 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.9. 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.10. SIDE : MDA report procedure
In order to check that the views have been created, connect to Alfresco Sharehttp://localhost:8080/share Click on a Site (or create a Test Site) / Document Library / Upload a document if necessary and look at the Details and Lists perspectives. You should see the different attributes of your models, as 'name', 'author', 'digitizationDate' ...
Figure 1.11. Share View Lists
Figure 1.12. Share View Details






