Sub Application Deployment

Top  Previous  Next

"Sub Application" term is not defined by the Java Servlet Standards. It is purely specific to the MoreMotion AF to support independent and parallel development.

Assume that there is a sub-application called "admin";  The web files of this sub-application (*.html, *.xsl, *.gif, *.js, etc.) will be deployed to folder "admin" under the root folder of the target main application and the links existing in the pages of the application will be arranged according to this.

The global configuration files belonging to the sub-application will be deployed to WEB-INF/MM-INF/config folder and the
page configuration files will be deployed to WEB-INF/MM-INF/config/pages folder.

The sub-applications and the main application share the same servlet context and the user sessions since they are natural parts or the same web application. All the jar files and the Java classes belonging to these applications are gathered under WEB-INF/lib and WEB-INF/classes directories of the main application.

When the parts of a big web application are developed independently from each other as sub-applications there are certain rules that must be observed.

1.The names of the data sources and the process templates that are defined in the configuration pages must be unique within the whole web application.  If the same name is used by the two data sources whose content are different may cause to conflicts.
2.If a component is used by more than one sub-application the property values of it must be identical.
3.When giving links from the main application or from a sub-application to another sub-application the name of the target sub-application must be included in the link definition as follows:
display.doms?pg=/admin/index
 
When linking from a sub-application to the main application this rule does not apply. Just the name of the target page must be given.
display.doms?pg=index

How a site is deployed as a sub application?

1.To be able to mention about a sub-application, a main application is necessary. Therefore configure a main application in another project where the application name remains as "ROOT" and sub-application checkbox is not checked. Do not leave the build folder as blank, assign a value and build the project.
2.In the Deployment dialog of the sub-application project let the application name remain as "ROOT" again but this time check the sub-application checkbox and assign a sub-application name.The build folder of the sub-application must be identical to the build folder of the main application. Build this project too.

 

After main application and the sub-applications were build the folder structure of that target web application will be similar to the following

 

subapp_folders

 

The web files (*.html, *.xsl, *.gif, *.js, etc.) of a sub application will be deployed under the directory "subAppl1" under the main applications root folder and the hyperlinks used in the sub application will be automatically adjusted by the Application Studio during the build.

The MoreMotion AF configuration files (datasources.xml, sysinfo.xml, proclist.xml and altpages.xml) will be created under WEB-INF/MM-INF/config/subAppl1 directory. Please be aware that although the sub applications have separate configuration files, MoreMotion AF merges them to the main application's configuration collections during loading them into the memory. Therefore, for example, if you have a data source definition called "products" in both main application and the sub application, the one in the main application will be significant.