Wiki

Imprimir Propiedades
Roma_users_module_customize

Customize Application

 

At this point we can manage all the data from our application without knowledge of other technology than pure java. Now we need to customize the visualization and navigation of it. First of all we will put a back button in the generated pages.

In the AttackMain class located in the gesfor.roma.swrisks.view.domain.attack package we create a back() method as follow:

 

public void back(){

  ObjectContext.getInstance().getComponent(ViewAspect.class).show(super.getBackObject());

}

 

The nameMain classes extends the CRUDMain class which stores the last object accessed and allow us to go back properly in navigation. Now copy the back method to the CompanyMain and RiskMain respectively. If we executes the application we observe that the back method are mixed with the Crud methods over the result list.

 

 

We must change it to show it at the bottom of the page. If we look at the generated packages with the crud commands we see that xml archives have been created with the disposition of the attributes and actions that will be rendered in the browser. They also can be ordered using annotations as we seen in the section 4 with the @CoreClass(orderActions... from AuthenticatedHomePage but with the xml annotation we have control to organize the positions of the different components showed. To work with the echo2 presentation we can handle the stylesheet files under the gesfor.roma.swrisks.view.style directory but this will be technology dependant. We want to customize the elements of the AttackMain class so we must create a file with the name AttackMain.xml with the content:

 

<?xml version="1.0" encoding="UTF-8"?>

<class xmlns="http://www.romaframework.org/xml/roma" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" xsd:schemaLocation="http://www.romaframework.org/xml/roma http://www.romaframework.org/schema/roma.xsd">

  <aspects>

     <view>

      <form>

       <area name="main" type="column">

        <area name="filter" />

        <area name="actions" type="row" />

        <area name="result" />

        <area name="paging" />

        <area name="back" type="row" />

      </area>

    </form>

   </view>

  </aspects>

</class>

 

Each area must contain a component and the way it displays it (placeholder, cell, column, grid, row, popup or tab). By default actions are rendered in the actions area and fields in the area. As we see in the xml file each area must be named equal as the component it will contain. Repeat this step creating the files and with the same content. Now we can login the application with different profiles and navigate viewing only the allowed options.

Last Update: 2008-08-18

 

<< Prev Roma Users module  
2171 Accesos, 0 Ficheros adjuntos 0 Ficheros adjuntos

  • Comentarios