System Configuration

The default system-config.xml is packaged inside war: WEB-INF/system-config.xml. It can be overridden by creating system-config.xml under [cmobilecom.home]/conf.

System configuration defines the modules to load and configures the InstanceTypes that are composed of modules. Exactly one system InstanceType is required. Subsystem InstanceTypes are optional, and multiple subsystem InstanceTypes can be configured. For example,


<system-config>

  <description><![CDATA[
    #{bundle.About_CMOBILECOM_WAF_Examples}
    <p>
    <a href="http://www.cmobilecom.com" target="_blank">http://www.cmobilecom.com</a> ]]>	
  </description>
  
  <!-- supported locales -->
  <property name="supported.locales" value="en,zh_CN"/>

  <!-- the resource bundle base name in addition to
	   framework resources.messages and module bundles [moduleName].resources.messages
  <property name="resource.bundle.basename" value="my.resources.messages"/>  -->
    
  <!-- override default EntityPropertyFactory
  <property name="entity.property.factory" value="mypackage.EntityPropertyFactoryImpl"/>  -->  

  <!-- transaction type: JTA or RESOURCE_LOCAL. 
  	Default: JTA if Java EE, RESOURCE_LOCAL for Java SE without JTA support.
  	Must match META-INF/persistence.xml. -->
  <property name="transaction.type" value="RESOURCE_LOCAL"/> 

  <!-- If transaction.type is JTA, specify JTA transaction implementation class. 
  -->
  <property name="jta.transaction.class" value="mypackage.JTATransaction"/> 
  
  <!-- whether to show entity version to help debug with optimistic locking -->
  <property name="show.entity.version" value="true"/> 
  
  <!-- responsive.type: auto, mobile, desktop. default is auto. -->
  <property name="responsive.type" value="auto"/>
    
  <module name="System">
     <class>com.cmobilecom.af.module.system.SystemModule</class>
  </module>
  
  <module name="ExampleHR">
     <class>com.cmobilecom.af.example.hr.HrModule</class>
     <param name="paramName" value="paramValue"/>
  </module>
         
  <system id="00" name="CmobilecomAF">
    <version>5.12</version>
    <icon>/images/logo.gif</icon>
    
    <moduleNode module="System"/>
  </system>  
      
  <subsystem id="01" name="CmobilecomAFExamples">
    <version>5.12</version>
    <icon>/images/logo.gif</icon>

    <moduleNode module="ExampleHR"/>	
    <moduleNode module="System"/>    
    
    <param name="supported.locales" value="en"/>
    
  </subsystem>
  
</system-config>
The description is a piece of html code that will be shown under the About/Application in the Help menu. It can contain bundle expressions such as #{bundle.Key}.

A parameter in an InstanceType will override its corresponding global property setting with the same name if applicable. Properties:

This example defines ExampleHR and system modules. The order of loading modules is important if there is any dependency between modules. One system InstanceType and one subsystem InstanceType are configured. Each InstanceType defines name, version, logo, icon, and tree-structured module nodes.

A module node refers to a defined Module and can have child module nodes.


	<moduleNode module="ModuleA" containers="indexCntrBean,manageCntrBean">
  		<moduleNode module="ModuleB" name="ModuleVisibleName" position="8"
    		menuNodeFactories="MenuNodeFactoryName1,MenuNodeFactoryName2">
    		<param name="paramName" value="paramValue"/>
  		</moduleNode>			
	</moduleNode>

Module Groups

A module can define groups so that the module can be partially assembled into an InstanceType. For example, module Bar define group 1, 2, and 3. assembly the group 2 and 3 of the module Bar into the InstanceType Foo.

	<subsystem id="01" name="Foo">
		<moduleNode module="Bar"/>
		
		<moduleGroups module="Bar">2,3</moduleGroups>
	</subsystem>
The module groups are used to partition entity type O/R mapping, and will be passed to the Module API methods when called. see Module Development.

System or Subsystem

Should any subsystem InstanceType be configured? For a subsystem InstanceType, many instances (subsystem) can be created. Subsystem instances can be exported and imported. But for the system InstanceType, only one instance. It can not be exported or imported.

If there are subsystem InstanceTypes configured, then a MenuNode of Instances will in the System module for managing subsystem instances. They will be available for selection during login. Users can login into a subsystem instance directly.