How to configure the SweetDEV RIA main parameters?
SweetDEV RIA configuration can be easily done through the ria-config.xml file.

This file is located at the root level of sweetdev-ria-core-XXX.jar

To override and configure some of the properties inside, create a simple file named ria-config.xml in your project and fill it the way it is described in this section.

Be careful to respect the dtd given in the header of the file to avoid mistakes.



Note that since the 3.0 version, you no longer need to copy the whole file content in your custom ria-config.xml. Only your own custom code is required.

Furthermore, the file sweetdev-ria.properties is not present anymore. Its content has been moved in ria-config.xml
[top]

How to configure the look of my components ?
A full documentation has been written in the section "Customization". This will help you to understand the customization structure and you should get ready to start developing your own skin after the documentation has been read (if not let us know :)).
[top]

How to set up internationalization in SweetDEV RIA?
SweetDEV RIA provides an easy way to inject some internationalized strings into your RIA components. The only pre-requisite is to define the i18n file into our configuration file.

To add a bundle, create (or edit) a ria-config.xml file (located in the jar core for example) and write the tag :

	<message-resources></message-resources>						
						
  • Attribute parameter is related to the name of the bundle file, amputated from its extension.
  • Attribute null specify whether the values not found should return null or not. Should be set to false.
  • Attribute key permits to override some properties files already defined.
Some bundles are already defined in the ria-config.xml. Have a look for a sample on the way to process.
[top]

How to configure the HTML output of a component ?
Each component use a velocity template to render itself as HTML.

These templates are mapped for each component into the ria-config.xml.
    You can easily override the default template by following theses steps :
  • Look into the ria-config.xml for the component's builder's id.
  • This id refer to a specific drawer. Get this drawer id, this is the element we will use.
  • Create a ria-config.xml (validating the dtd given in our one) and write a drawer tag identified by the previous id found.
  • Through the <set-property> tag, set "templateStart" and "templateEnd" to your custom velocity files.
Here is a simple example showing the way to trigger an "alert" event on each accordionItem header click :
  • ria-config.xml :

    <ria-config>
    	<drawers>
    		<drawer>
    			<set-property></set-property>
    			<set-property></set-property>
    		</drawer>
    	</drawers>
    </ria-config>
    
  • example/velocity/accordionitem_start.vm :

    <div>
    	${title}
    </div>
    <div id="${id}" #if(${contentStyle})style="${contentStyle}"#end #if(${contentStyleClass})class="${contentStyleClass}"#end>
    	<script>
    		SweetDevRia.$('${accordionId}').addItem( new SweetDevRia.AccordionItem('${id}', '${title}') );
    	</script>
    
    Focus on the alert('open item'); added in the middle of the first line of the template copied. This adds a simple default behavior to this component.
[top]

How to override the SweetDEV RIA resources files ?
Since the 2.2-SNAPSHOT version, the resources are stored in the core jar.

By the way, if you want to override our resources in a folder of your choice, you can set the folder where are placed the resources by adding an init-param to the SweetDevRiaResourcesProvider servlet.

This can be done with the following code in your web.xml :


<servlet>
        <servlet-name>SweetDevRiaResourcesProvider</servlet-name>
        <servlet-class>com.ideo.sweetdevria.servlet.SweetDevRiaResourcesProvider</servlet-class>
        <init-param>
        	<param-name>resourcesPath</param-name>
        	<param-value>%RESOURCES_PATH_FOLDER%</param-value>
       </init-param>
</servlet>
                       
Your webapp resources folder will always be looked up before trying to get resources into the jar.
[top]

How to configure the JavaScript console?
On SweetDevRIA.js, SweetDevRIAComplete.js and Components/SweetDevRia.js, check for lines :
	SweetDevRia.log = new SweetDevRiaLog(Log.NONE, Log.alertLogger);
	SweetDevRia.errorLog = new SweetDevRiaLog(Log.NONE,  Log.alertLogger);
And change first parameter to desired level log : Log.DEBUG, Log.INFO, Log.ERROR, Log.FATAL, Log.WARN or Log.NONE.
[top]

How to define the locale targeting ?
The SweetDEV RIA internationalization use, by default, the locale set into the request.

If you want to set your own way to target the locale from the request or the session, you will have to redefine the class processing the messages bundling.



This can be done by writing a class extending com.ideo.sweetdevria.i18n.impl.DefaultResourcesManagerImpl, overriding the method public Locale getLocale(HttpSession session) and defining this class in the ria-config.xml :
<ria-config>
	<property></property>
</ria-config>
The local will now be retrieved the way you want it to.
[top]