4. Server-side Scripting

DRAFT VERSION. This functionality is under development

Crafter Rivet for Grails provides the ability to do Server-side scripting. With server side scripting you can modify the application functionality dynamically. You can modify following dynamically

i) Groovy Server Pages (GSP)

ii) Groovy Objects (POGO)

iii) Controller Classes

iv) Service Classes

Crafter Rivet for Grails Component Model make use of server side scripting to achieve dynamicity.

What are the examples of server side scripting at various levels?

 Two of the most prominent features of Crafter rivet for Grails Component Model are

i) Ability to dynamically modify contents of the components on the fly without requiring any application restarts.

ii) Ability to modify core programmatic files via WCM UI console. For example, a non-technical user can modify the contents of the component and just publish it to make the changes effective. Technical users can modify server side files and publish the changes to make the changes effective.

These gives reduces the turnaround time for making trivial changes effective.

Let's take the example of a list component which lists the office locations. Initially the list component is listing just the city. For example, Reston, Boston, San Antonio de Escazú, Bangalore etc. For the sake of example we will assume that we are using Alfresco WCM. These are the files we can change from Alfresco to make the changes effective

i) GSPs - If the changes involve the changes in style, content or formatting, most appropriate place to make changes are GSP files. For example, if we want the state and countries also to be included in the list then we can change the GSP files. Like Reston, VA, US; Boston, MA, US etc. Or if you want to change the list style - color, font etc, then GSP is the most appropriate place to make the change

ii) Controllers - If you want your controller to call any other service, or modify the call to service because service API is changed then you will have to modify the controller

iii)  Services - Currently the list component controller reads it from an xml file to list the contents. If you want to read it from database, or you want to make any other changes like changes in the logging code or exception handling, you can directly do it through Alfresco's admin console

iv) POGOs - List components are backed by generic ListComponentItem domain object with three generic fields, property1, property2, property3. If you have to add more fields or remove the existing fields then you have to modify this domain object

v) List Component XMLs  - Contents of the list components are dynamic and externalized to listComponent.xml. Initially, when the list is empty, this component will not even show up on your application page. You have to use Alfresco's webform to modify the contents. In the web form you have to mention the list's title, and the list contents. Once you publish the changes the list will show up on your page. In future, we will externalize the list style - font, color, format etc to this list.

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.