Vine Tutorials

In addition to our javadocs documents we would like to present some vital practical aspect of working with Vine Toolkit. Thus, we've decided to present some cook book examples of Vine's applications.

Flex applications in Vine

All components in Vine are based on Adobe Flex technology. In the past we evaluated other solutions starting from pure jsp pages, tapestry and jsf frameworks, looking at some new and nifty looking ones ( Echo 2 ) and ending up with our own UI framework - Sportlets. What we learned is that with the old fashion HTML and Java Script approach it's very hard to manage crossbrowser compatibility issues and it's almost impossible to create and maintain a product which could be deployed into other heavily featured (ui-wise) environments ( eg. Liferay ).

A couple months ago we've taken a look at Flex 2 and did some first tests with it. Now we know that Flex gives us more freedom in terms of components designing than anything else. Moreover, we get rid of all compatibility issues and got a powerful data services solution in a form of BlazeDs. Currently with Flex 3, BlazeDs which are open source projects based on Mozilla Public Licence, we did a bit of integration with Vine Toolkit and give you a complete solution for developing grid-aware components.

Creating new flex project

In order to accomplish this task please refer the "Creating new project" section. Remember to check the 'Flex support' box.

At this stage you should have you project directory created with the following structure:

Example project - directory treeExample project - directory tree

You can see that as well as the directories, some additional files have been added. This is our template project, your starting point, from where you can start building your own application.

In the next section we describe briefly the purpose of every file in the example project.

Project component description

Vine's build system is taking care of proper compilation of sources and deployment of binaries to the target sevlet/portlet container. To fulfill these tasks your files need to be in a specific locations. Thereby it is vital to understand those rules.

ant/project.properties file

Properties from this file are used during project build, you can change these properties according to your needs, keep in mind that project name has to match with the name of project directory.

src/web/ui/flex/app/ directory

In this directory all Flex files are stored and compiled. By default, with the core project we provide flash binaries. If you want to change them in any way, you need to have flex sdk installed in your system with the FLEX_HOME environmental variable set up properly. Then during the install of Vine project installer detect this fact and tries to compile your flex sources.

src/web/ui/flex/locale directory

In this directory locale properties are kept, this section will be extended when this feature will be done.

src/web/ui/flex/java directory

In this directory there is a place for java source code, again the package structure needs to be created in a way described in the packaging rules section.

General concepts

Terms and definitions used in Vine

Vine has a modular nature that stands for many aspects, getting familiar with those let you use Vine more efficiently.

Project
New functionality encapsulated in a set of source trees and libraries. Typically it extends core functionality by adding new implementations for Vine concepts, i.e.

activedirectory - project adds new authentication module which could be used with Vine.
uitutorials> - project adds new flex components to show examples regarding Vine integration with Flex/BlazeDs.

Additionally project allows to separate jars and thus let you use different plugins which are difficult to deploy into a one webapp at one time ( i.e. unicore and globus plugins ).

Project is using inheritance model ( by default project extends from the core vine ) which allow you to add new functionality incrementally.

Installer
A set of projects which will be deployed to the Vine webapp. Apart from the business logic every installer has its own deployment settings in the installer's directory ( build.properties ) and may contain additional file required by the destination environment ( i.e. layouts for Gridsphere ).

Last but not least in the {installer_name}/WEB-INF/vine/resources you can find your Domain.xml file where the Vine's resources configuration is described. This is the place for adding your resources like new hosts, job managers, authentication modules etc.

Installers can be easily customized by adding/removing ( application.projects ) property, settings various flags which could alter compilation or deployment process ( i.e. software.installer.excludeFlex flag prevents from the compilation of flex sources ).

In case you want to create new installer, you can copy existing one and modify it according to your needs.

Settings from the BlazeDs installer :

#----------------------------------------------------------
# Installer title
#----------------------------------------------------------
software.installer.title=BlazeDs example installer

#----------------------------------------------------------
# Installer type
#----------------------------------------------------------
software.installer.type=dist

#----------------------------------------------------------
# Application projects
#----------------------------------------------------------
application.projects=uitutorials

#----------------------------------------------------------
# Application type
#----------------------------------------------------------
application.type=web

#----------------------------------------------------------
# Web aplication type
#----------------------------------------------------------
application.web.type=portlet

#----------------------------------------------------------
# Servlet container
#----------------------------------------------------------
servlet.container=tomcat_5_x

#----------------------------------------------------------
# Portlet container
#----------------------------------------------------------
portlet.container=gridsphere_3_0

#software.installer.excludeFlex=true