System Configuration




The System Configuration has various parts:

Name XML file Table Description
Application application.xml - Application properties (Locale, Application Name, Application Manager)
System system-config.xml - System configuration
Data Source application-context-ds.xml - Data Source configuration
JDBC jdbc.properties - JDBC properties
RMI application-context-rmi.xml (Server)
rmi.properties (Client)
- RMI properties
Entitites - system_entity Entitites configuration
Plazma ERM erm.properties - Plazma ERM configuration
Services application-context.xml
packages/<package name>/service.xml
packages/<package name>/service-impl.xml
- Spring configuration (services)
Forms form-config.xml - Forms configuration
Reports report-config.xml - Reports configuration
Acceptors acceptor-config.xml - Report acceptors configuration
Actions action-config.xml - Actions configuration
MenuBar menubar-config.xml - Menu configuration
ToolBar toolbar-config.xml - ToolBar configuration
Interface interface-config.xml - Interface configuration
Associations association-config.xml - Associations configuration
Packages package-config.xml - Packages configuration


The configuration of each part can be presented in a file or a table.
Consider the detail configuration.



Application

Application pproperties is presented in file application.xml
For example:


<properties>
  <locale>en_US</locale>
  <application-name>Plazma ERP+CRM</application-name>
  <application-manager>org.plazmaforge.bsolution.base.client.SWTClientApplicationManager</application-manager>
  <is-external-config>true</is-external-config> 
</properties>
   
You can use following application managers:

System

System configuration is presented in file system-config.xml (DTD)
For example:

   
<system-config>

    <!-- 
        Configure components
    -->       
    
    <configurer name="PackageConfigurer" type="XMLPackageConfigurer"></configurer> <!-- Configure packages -->    
    <configurer name="ActionConfigurer" type="XMLActionConfigurer"></configurer> <!--Configure actions -->
    <configurer name="InterfaceConfigurer" type="XMLInterfaceConfigurer"></configurer> <!-- Configure UIs -->    
    <configurer name="MenuBarConfigurer" type="XMLMenuBarConfigurer"></configurer> <!-- Configure menu -->   
    <configurer name="ToolBarConfigurer" type="XMLToolBarConfigurer"></configurer> <!-- Configure toolbar -->
    <configurer name="FormConfigurer" type="XMLFormConfigurer"></configurer> <!-- Configure forms -->       

    <configurer name="AssociationConfigurer" type="XMLAssociationConfigurer"></configurer> <!-- Configure associations -->           
    

    <!-- 
        Configure reporting system entities
    -->
    <configurer name="ReportConfigurer" type="XMLReportConfigurer"></configurer>  <!-- Configure reports -->  
    <configurer name="AcceptorConfigurer" type="XMLAcceptorConfigurer"></configurer> <!-- Configure report acceptors --> 
               
    
    <!-- 
        System properties
    -->
    <system-properties>
        <property name="javax.xml.transform.TransformerFactory">org.apache.xalan.processor.TransformerFactoryImpl</property>
        <property name="report.engine.class">org.plazmaforge.framework.report.engine.jasperreports.JasperReportsEngine</property> <!-- Set reporting system -->
    </system-properties>


    <!-- 
        Platform properties
    -->
    <platform-properties>
    
        <property name="config.loader.class">org.plazmaforge.bsolution.base.EnterpriseConfigLoader</property>
        <property name="period.creator.class">org.plazmaforge.bsolution.base.EnterprisePeriodCreator</property>

        <!-- 
            Configure report storage
        -->
        <property name="report.storage.path">${root.dir}/reports</property>
         
        <!-- 
            Configure Service Locator
        --> 
        
        <!-- RMIServiceLocator (Lite Server) -->
        <!--
        <property name="service.locator.class">org.plazmaforge.framework.platform.service.impl.rmi.RMIServiceLocator</property>
        --> 
        
    </platform-properties>


    <property-stores>

        <!-- Stores example -->
        <!--
        <store name="storename">
            <property name="prop1">value1</property>                
            <property name="prop2">value2</property>                
        </store>
        -->
        

    </property-stores>

 </system-config>
   
Consider following points

What is configurer?
This component, which configures a part of the system. At the moment in general used XML configurers.
They read data from XML files, but you can use other implementation (other file formats, tables in database, storages, etc.)

What is the Service Locator?
This component, which is responsible for services in the search for a particular name. The default is org.plazmaforge.framework.platform.service.impl.spring.SpringServiceLocator

What is the report storage?
This folder in the file system where reports are stored.



Data Source

You can configure Data Source in file application-context-ds.xml (DTD).




JDBC

Setting JDBC connection to the database
For example:

# Set connection properties to the database Firebird
jdbc.driverClassName=org.firebirdsql.jdbc.FBDriver
jdbc.url=jdbc:firebirdsql:localhost/3050:C:\\DATA\\plazma.gdb
jdbc.username=sysdba
jdbc.password=masterkey




RMI

Setting RMI properties to connect to Server Application.

For example:

rmi.host = localhost
rmi.port = 2005



Entitites

Meta info of the entities (persistence objects) is stored in the table SYSTEM_ENTITY.
General fileds::

Why need the SYSTEM_ENTITY ?
It serves two important functions: You can execute simple query
SELECT * FROM system_entity
and get more useful information about system entities. Anywhere program, knowing only the code of entity, you can quickly build association of the entity.
For example:

Class Country.
The class corresponds to other elements (classes) different type.

Association simplifies development process when you need to manipulate classes.
More
Associations.



Plazma ERM

The system uses technology Plazma ERM, DAO (Data Access Object) layer uses the mapping between database objects and Java objects.
Setting Plazma ERM made in the file erm.properties.



ERM mapping is configured in *.erm.xml files. 
In general, a single object is presented in a single file. For example:
<!-- org/plazmaforge/bsolution/base/server/entities/Country.erm.xml -->

<entity-mapping>
    <entity class="org.plazmaforge.bsolution.base.common.beans.Country" table="COUNTRY">
        <key name="id" column="ID" type="Integer" generator-type="increment"/>
        <attribute name="code" column="COUNTRY_CODE" type="String" />
        <attribute name="name" column="NAME" type="String"  reqired="true" />
    </entity>
</entity-mapping>

Services

Services are an important part of the system. They manage entities (persistence objects). Services are responsible for loading, adding, changing, deleting data. Also, the services execute other actions in the system. In general, each entity corresponds to own service. Each service has own implementation.

For example:

Country -> CountyService -> CountryServiceImpl

Common services are configured in file application-context.xml
(DTD)

For each package we can configure service in files packages/<package name>/service-impl.xml, packages/<package name>/service.xml (DTD)

For example:

   
<!-- 
   Configure Country Service Implementation
   packages/base/service-impl.xml  
-->
<bean id="CountryServiceImpl" class="org.plazmaforge.bsolution.base.server.services.CountryServiceImpl" lazy-init="true">
	<property name="sessionFactory"><ref local="sessionFactory"/></property> <!-- set session factory -->
</bean>
	
....	
	
<!-- 
   Configure Country Service
   packages/base/service.xml  
-->	
<bean id="CountryService" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
	<property name="transactionManager"><ref local="transactionManager"/></property> <!-- set transaction manager -->
	<property name="target"><ref bean="CountryServiceImpl"/></property> <!-- set CountryService implementation -->
	<property name="transactionAttributes"> <!-- set transaction attributes -->
		<props>
			<prop key="*">PROPAGATION_REQUIRED</prop>
		</props>
	</property>
       <property name="preInterceptors"> <!-- set security interceptor -->
           <list>
               <ref local="securityInterceptor"/>
           </list>
       </property>			
</bean>
More information about configure services see on the site Spring Framework



Forms

GUI client uses forms (Java classes). In general, each entity corresponds to two base forms: List (Table) form and Edit form.

For example, for Country:

You can don't configure simple forms, but if the form uses
actions or reports, you have to configure it in the file form-config.xml (DTD)

For example:
<form-config>

    <form id="PersonEditForm">
        <actions>
            <action id="PersonEducationListForm"/>
            <action id="PersonFamilyListForm"/>
            <action id="PersonJobListForm"/>
            <action id="PersonLanguageListForm"/>
         </actions>
    </form>
    
    <form id="EmployeeListForm">
         <reports>
            <report id="PersonCardReport"/>
         </reports>
    </form>
    
<form-config>
The PersonEditForm form can execute the actions, which configure in the file action-config.xml (DTD).
The EmployeeListForm form can execute the report PersonCardReport, which configure in the file report-config.xml (DTD).
See also actions and reports.



Reports

The basic reporting system is JasperReports. Report templates are located in the Report Storage. The Report Storage is configured in the file system-config.xml (DTD)

For example:

   
<system-config>   
   <property name="report.storage.path">${root.dir}/reports</property>
</system-config>
It is relative path. You can also set the absolute path: C:\MyReports
To design report templates you can use iReport. To connection report templates to the system you have to configure reports in the file report-config.xml (DTD)

For example:
<report id="SaleOrder" single="true" folder="goods" file="SaleOrder"/>
Here full path is <ReportStorage>/goods/SaleOrder.jasper Extention .jasper is added automatically, because we use JasperReports by default. To set report parameters you can use repport acceptors.

For example:
<report id="GoodsSale" folder="goods" file="GoodsSale">
    <acceptor id="OrganizationPeriodDialogAcceptor"/>
</report>
In this example acceptor is dialog which read start and end date. You can use other type of acceptors too.
After configuring the report you can execute the report by code or name in anywhere



Acceptors

Acceptors are components that read parameters of reports.
Acceptors is configured in the file acceptor-config.xml
(DTD)

For example:

<acceptor id="OrganizationAcceptor" class="org.plazmaforge.bsolution.base.common.acceptors.OrganizationAcceptor"/>
    
<acceptor id="OrganizationPeriodAcceptor" class="org.plazmaforge.bsolution.base.common.acceptors.OrganizationPeriodAcceptor"/>
    
<acceptor id="OrganizationPeriodDialogAcceptor" class="org.plazmaforge.bsolution.base.client.swt.acceptors.OrganizationPeriodDialogAcceptor"/>
    
<acceptor id="OrganizationYearDialogAcceptor" class="org.plazmaforge.bsolution.base.client.swt.acceptors.OrganizationYearDialogAcceptor"/>    
1 and 2 acceptors read parameters without a dialog, 3 and 4 acceptors show a dialog for input parameters.



Actions

Actions that execute on the client part are configured in the file action-config.xml (DTD). Here you can set Java class or specify command

For example:

   
<action id="AboutAction" class="org.plazmaforge.bsolution.base.client.swt.actions.AboutAction"/>

<action id="CountryListForm" command="OPEN_LIST_FORM" parameters="base/CountryListForm"/>

<action id="PriceListReport" command="PREVIEW_REPORT" parameters="PriceListReport"/>
Here the action AboutAction uses Java class. The action CountryListForm uses command OPEN_LIST_FORM with form name (perform form). The action PriceListReport uses command PREVIEW_REPORT with report name (perform report).



MenuBar

The System menu is configured in the file menubar-config.xml (DTD)

   
<menubar-config>
    <menubar>
	....
      <!--  Documents menu -->
        <menu code="Documents" text="">
            <menuitem action="NewDocument"/>            
            <menuitem action="ChooseDocument"/>            
            <menuitem text="-"/>                
        
            <menuitem action="DocumentListForm"/>
            <menuitem text="-"/>
            <menuitem action="ContractListForm"/>
            <menuitem text="-"/>
            <menu code="Documents.Sale" text="">
                <menuitem action="SalePlanListForm"/>
                <menuitem text="-"/>
                <menuitem action="SaleOrderListForm"/>
                ....
            </menu>
       </menu>     
   </menubar>         
</menubar-config>            
The attribute action of tag menuitem is name of action, which configure in the file action-config.xml.



ToolBar

The ToolBar is configured in the file toolbar-config.xml (DTD)

For example:

<toolbar-config>
    <toolbar>
        <toolitem action="PartnerListForm"/>
        <toolitem action="EmployeeListForm"/>
        <toolitem action="BankListForm"/>
        <toolitem action="-"/>
        <toolitem action="GoodsListForm"/>        
        <toolitem action="-"/>
        <toolitem action="DocumentListForm"/>
        <toolitem action="ContractListForm"/>                
        <toolitem action="-"/>    
        <toolitem action="ProjectListForm"/>
        <toolitem action="TaskListForm"/>
        <toolitem action="-"/>    
        <toolitem action="ReportListForm"/>
    <toolbar> 
<toolbar-config>           
The attribute action of tag toolitem is name of action which configure in the file action-config.xml.



Interface

The Interface is configured in the file interface-config.xml (DTD)

For example:

<interface-config>
    <interface id="Sale"/>
    <interface id="Purchase"/>
    <interface id="Inventory"/>    
    <interface id="Accounting"/>
    <interface id="HR"/>    
    <interface id="Payroll"/>    
    <interface id="Project"  is-enable="false"/>            
    <interface id="Admin"/>    
<interface-config>           

Associations

The Association is union of class, which have different type, but they have common characteristic. In general, the characteristic is entity (persistence object), which is center of the association. Each member of the association has own type. For example: service, list-form, edit-form, etc. In general, association is created automatically (using standard rules for creating name of java classes and packages). You can configure associations in the file association-config.xml (DTD)

Packages

The Packages (Java package) are configured in the file package-config.xml (DTD)