ifoundation developer guide - ebaotech...ifoundation provides runtime engine, common utilities,...

204
iFoundation Developer Guide iFoundation V3.5 November, 2009

Upload: others

Post on 22-May-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer GuideiFoundation V3.5

November, 2009

Page 2: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Part No. F00-1-350-01 Copyright © eBaoTech 2009. All Rights Reserved. Disclaimer No part of this document may be reproduced in any form without the written permission of the copyright owner. The contents of this document are subject to revision without notice due to continued progress in methodology, design and manufacturing. eBaoTech shall have no liability for any error or damage of any kind resulting from the use of this document.

Page 3: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Contents

1 Introduction............................................................................................ 1 1.1 Intended Audiences................................................................................. 1 1.2 Typographical Conventions ..................................................................... 1

2 Overview of iFoundation....................................................................... 2

3 Functionalities of iFoundation ............................................................. 6 3.1 Service and Utility .................................................................................... 6 3.1.1 Data Source Utility ................................................................................... 6 3.1.2 Transaction Service................................................................................. 9 3.1.3 Configuration ......................................................................................... 11 3.1.4 Log......................................................................................................... 22 3.1.5 Version API............................................................................................ 24 3.1.6 Internationalization ................................................................................ 27 3.1.7 Audit API................................................................................................ 28 3.1.8 Error Definition....................................................................................... 29 3.1.9 Security API........................................................................................... 30 3.2 Frameworks........................................................................................... 30 3.2.1 XMS....................................................................................................... 30 3.2.2 Metadata................................................................................................ 52 3.2.3 Rate Table ............................................................................................. 62 3.2.4 Web Framework (Struts) ....................................................................... 79 3.2.5 Hibernate ............................................................................................... 95 3.2.6 Application Context................................................................................ 95 3.2.7 Error Handling ....................................................................................... 96 3.3 Library.................................................................................................. 106 3.3.1 JSP Tag............................................................................................... 106 3.4 Tools and Solutions ............................................................................. 106 3.4.1 Error Code Maintenance ..................................................................... 106 3.4.2 Public Data Definition Maintenance..................................................... 109 3.4.3 User Interface Configuration Tool........................................................ 113 3.4.4 Unit Test Template .............................................................................. 128 3.4.5 String Resource Maintenance ............................................................. 131 3.4.6 Parameter Definition............................................................................ 133 3.4.7 Module Definition................................................................................. 135 3.4.8 Theme Management and Customized Pages ..................................... 137 3.4.9 Help Framework .................................................................................. 138 3.4.10 EMS..................................................................................................... 139

4 Glossary ............................................................................................. 197

5 Reference ........................................................................................... 200

Page 4: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of
Page 5: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Introduction

1

1 Introduction This document is intended to provide information on the functionalities of the eBaoTech iFoundation for developers to design and develop features to the system.

1.1 Intended Audiences

The intended audiences of this document are: Developers System administrators

1.2 Typographical Conventions

This section describes the typographical conventions used in this document.

Table 1 Typographical Conventions

Convention Description Example

User Input A command to enter in a CLI exactly as written.

cd HOME

GUI Objects Menus, fields, buttons, and so on.

Choose Exit in the File menu.

System Elements Command and parameter names, program names, path names, Uniform Resource Locators (URLs), and directory names.

The files are located in c:/HOME/bin.

Code Examples Code examples. grep ’:title. ’ $i | \awk -f.’

Page 6: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

2 Overview of iFoundation iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management.

The main target of iFoundation is to provide an enterprise class platform for eBaoTech insurance system.

Figure 1 shows the whole picture of iFoundation.

2

Page 7: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Overview of iFoundation

iFoundation

Service & Utility (API)

Data Source Utility Transaction Service Configuration

Log

Cache

Frameworks

Web Framework(Struts)

Error Handlng

I18N & Locale (API)

Application Context

Metadata

Spring IOC

Audit (API)

Extend Point (XMS)

Version API

Tools & Solutions (Developer)

Library

JSP Tag

Rate Table

UI Configuration Tool

Hibernate

EMS

Foundation Application ( End User & Admin)

Login Page

Unit Test Template

Help Framework

User Management Role Management

Module Definition

Table Data Mantenance

String Resource Maintenance

Theme Management & Customize Pages

Change Theme Change Language

Change Password

Parameter Definition

Audit Query

Working Day Configuration

Cache MonitorChange System Date

Error Code Maintenance

Public Data Definition Maintenance

Error Reporting

Error Definition Security API

Figure 1 iFoundation

From the picture, we can see that modules in iFoundation are classified into five layers from bottom to top: Services & Utilities, Frameworks, Libraries, Tools & Solutions, and Foundation Applications.

3

Page 8: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Services & Utilities

This layer provides basic APIs and SPIs for developers. They are independent of each other.

Note: SPIs are used for customization purpose. All SPIs are realized or provided in Interface/Implementation mode. Its Java Interface must be added with @SPI. All the specialized classes used by external parameters related to SPI must be added with @Parameter4SPI. Use spring to configure the relation between API and implementation. SPI cannot be used directly. Whether to allow user to inherit the default implementation of SPIs can be configured through iFoundation. For the customized service/tool API, its Java Interface must be added with @ Inheritable4External. For the inheritable default implementation of API, its Java Class must be added with @ Inheritable4External.

Frameworks

This layer provides integrated solutions for technique domains like web framework, ORM framework and so on.

This layer depends on the Services & Utility layer.

Libraries

Libraries are a set of APIs developed to improve productivity.

Tools & Solutions

This layer provides developer tools with UI.

Foundation Applications

This layer provides UI for system administrators and end users.

Figure 2 shows how developers use iFoundation.

4

Page 9: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Overview of iFoundation

5

Develop Entity

Develop Business Logic

Unit Test

Develop Web Controller

Develop View

EMS Hibernate

Metadata

Spring IOC

Rate Table

Code Table

Struts

JSP TagJavaScript

Library

UI Configuration Tool

Transaction Service

Configuration

Security API

Cache

Performance

Monitor

Audit

Data Source Utility

XMS

Figure 2 How developers use iFoundation

This guide mainly describes the first four layers. For details about the Foundation Applications layer, refer to iFoundation User Manual.

Note: Please always query and modify data via iCP’s web user interfaces or APIs. Do not modify database data directly to avoid data inconsistency and errors.

Page 10: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3 Functionalities of iFoundation

3.1 Service and Utility

3.1.1 Data Source Utility

Data source means the definition of database connection.

3.1.1.1 Implementation JDBC Data Source

Provide a data source implementation which gets connection by JDBC.

3.1.1.2 Implementation JNDI Data Source

Provide a data source implementation which gets connection by JNDI.

3.1.1.3 Data Source Configuration

Driver, URL, user name and password which are definitions for JDBC connection should be configurable.

The context factory, provider URL, principal, credentials and JNDI name which are used to look up connection are configurable.

Whether to use JDBC connection and JNDI connection is configurable.

Note: JDBC Connection

DATASOURCE_TYPE=jdbc //connection type NON_POOL_DB_URL=XXX //data source address NON_POOL_DB_USERNAME=XXX //user name NON_POOL_DB_PASSWORD=XXX //password

JNDI Connection DATASOURCE_TYPE=jndi //connection type JDBC_INITIAL_CONTEXT_FACTORY=XXX //connection factory of directory service provider JDBC_PROVIDER_URL=XXX //URL of directory service APP_SERVER_PRINCIPAL=XXX //jndi user name

6

Page 11: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

APP_SERVER_CREDENTIALS=XXX //jndi password JDBC_DATA_SOURCE=TxLife //data source name

3.1.1.4 Get and Release Connection

Provide uniform APIs for getting and releasing connection. Whether it is a JDBC connection or a JNDI connection is transparent to the API caller.

Note: DBean code example: DBean db = null; PreparedStatement ps = null; ResultSet rs = null; Connection con = null; try { db = new DBean(false, false); db.connect(); con = db.getConnection(); String sql=...; ps = con.prepareStatement(sql); ps.setString(1, ...); ps.setString(2, ...); rs = ps.executeQuery(); while (rs.next()) { ...... } } catch (Exception ex) { throw new RTException(ex); } finally { DBean.closeAll(rs, ps, db); }

3.1.1.5 Connection Management in Thread

Our strategy is per connection per thread. It means regardless of how many get connection methods are called, the returned connection is the same, in the same thread.

3.1.1.6 Connection Release

For web application, connection is released in HttpFilter before the request ends.

Provide connection close API for standalone application, and the connection should be closed explicitly.

3.1.1.7 Configuration

Configuration sample:

7

Page 12: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

//----------- config.properties.foundation --------------- /**********************/ /******DataSource******/ /**********************/ //Simple connection datasource NON_POOL_DB_USERNAME=foundation_v3 NON_POOL_DB_PASSWORD=foundation_v3 NON_POOL_DB_URL=jdbc:oracle:thin:@172.16.7.219:1521:ora219 DRIVER_CLASS=oracle.jdbc.driver.OracleDriver //Jndi datasource JDBC_INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLInitialContextFactory JDBC_PROVIDER_URL=t3\://172.16.28.33\:7001 APP_SERVER_PRINCIPAL=weblogic APP_SERVER_CREDENTIALS=weblogic JDBC_DATA_SOURCE=TxLife //Datasource option : 'jdbc', 'hibernate', 'jndi' DATASOURCE_TYPE=hibernate

The description of configuration items is as follows: Simple connection datasource: configure JDBC DataSource information. Jndi datasource: configure JNDI datasource information. DataSource option: select the datasource to be used. JDBC: use JDBC datasource. JNDI: use JNDI datasource. Hibernate: use Hibernate datasource. Hibernate datasource is maintained by the

Hibernate configuration file. Hibernate configuration file is hibernate.cfg.xml.

3.1.1.8 DBean Operation

Constructor Method Description

Public DBean() Constructor method without parameters, instantiating DBean. If Hibernate session exists in the context, execute Flush and Clear of session.

public DBean(boolean needFlushAndClear)

The parameter needFlushAndClear controls whether to perform the Flush and Clear operation. If needFlushAndClear is true, execute Flush and Clear; if false, no execution.

public DBean(boolean needFlush, boolean needClear)

Constructor method with two parameters, used to achieve fine-grained control of the Flush and Clear execution.

A typical DBean operation sample: public Object doQuery(PrepareStatementCreator pstmtCreator, ResultSetHandler resultSetHandler) throws GenericException {

8

Page 13: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Object returnValue = null; Connection conn = null; PreparedStatement pstmt = null; ResultSet rs = null; DBean dbean = new DBean(true); try { dbean.connect(); conn = dbean.getConnection(); pstmt = pstmtCreator.createPstmt(conn); rs = pstmt.executeQuery(); returnValue = resultSetHandler.handResultSet(rs); } catch (SQLException e) { throw new GenericException(10010010002L, e); } catch (ClassNotFoundException e) { throw new GenericException(10010010002L, e); } catch (RuntimeException e) { throw e; } catch (Error e) { throw e; } finally { JdbcUtils.closeResultSet(rs); JdbcUtils.closeStatement(pstmt); JdbcUtils.closeConnection(conn); } return returnValue; }

3.1.2 Transaction Service

Configuration file is config.properties(.xxx)

3.1.2.1 Transaction Configuration

The procedure for transaction configuration is as follows:

1 Determine transaction type. Options: jdbc(using local transaction), ebao_jta (using transaction service on app server)

Sample: TRANSACTION_TYPE=jdbc

2 Configure jndi context properties for looking up ebao_jta. #context initialize factory JDBC_INITIAL_CONTEXT_FACTORY #looking up url JDBC_PROVIDER_URL=t3\://172.16.28.33\:7001 #looking up user name APP_SERVER_PRINCIPAL=weblogic

9

Page 14: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

#looking up password APP_SERVER_CREDENTIALS=weblogic #transaction name USER_TRANSACTION_JNDI=weblogic/transaction/UserTransaction

Sample: JDBC_INITIAL_CONTEXT_FACTORY=weblogic.jndi.WLInitialContextFactory JDBC_PROVIDER_URL=t3\://172.16.28.33\:7001 APP_SERVER_PRINCIPAL=weblogic APP_SERVER_CREDENTIALS=weblogic USER_TRANSACTION_JNDI=weblogic/transaction/UserTransaction

3 Configure sub thread transaction (websphere).

On websphere, the transaction name of the sub thread of current request is different. So additional configuration is needed as follows: OUTOF_SERVLET_TRANSACTION_JNDI =jta/usertransaction

3.1.2.2 API Get transaction:

- Get transaction of current thread com.ebao.foundation.module.db.Trans.getUserTransaction()

- Get transaction according to parameter, true means transaction of sub thread, false means transaction of current thread.

com.ebao.foundation.module.db.Trans.getUserTransaction(Boolean outOfServlet)

Do transaction process.

- Begin transaction begin()

- Commit transaction commit()

- Rollback transaction rollback()

Full sample: UserTransaction trans = Trans.getUserTransaction(); Try{ trans.begin(); ……………

10

Page 15: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

trans.commit(); } Catch(Exceptione){ trans.rollback(); }

3.1.3 Configuration

Many components have been integrated into the eBaoTech system, such as spring, structs and so on. This section describes how to configure these components.

The configuration reads code following the general pattern, for example, the struct configuration reads code like this: IModuleConfigManager configManager=ModuleConfigManager.getInstance(); Map<String, String> structsConfig=((IStructConfigLocalizer) configManager.getLocalizer(IStructConfigLocalizer.class)) .findStructConfigs();

According to the configuration interface, the actual code will have a little change.

As the Properties configurations are widely used, there is a general configuration read pattern. It is similar to the previous code only that the interface changes to com.ebao.foundation.module.configframework.support.IGeneralReferencePropertiesConfigLocalizer: public interface IGeneralReferencePropertiesConfigLocalizer extends IConfigLocalizer { /** * find the config according to the namespace's name * @param namespace * @return */ public Properties findProperties(ConfigNamespace namespace); }

The namespace is an Enum type, defining the configuration’s catalog.

The ConfigNamespace can be modified by foundation. If you want to add new catalog properties on other layers, please extend the configframework.

3.1.3.1 Struts

3.1.3.1.1 How to Configure Struts

The struct is defined in the segments of ‘struts’, with the children of ‘include’,each child has two attributes: module-context: which module the struts configuration files belong to. You can

get more information from the struts documents. relative-path: the struts configuration file relative to this mcf file.

11

Page 16: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Example: <structs> <include module-context="config" relative-path="/structs/struts-config.xml" /> <include module-context="config/demo" relative-path="/structs/struts-config-demo-found.xml" /> <include module-context="config/demo" relative-path="/structs/struts-config-demo.xml" /> <include module-context="config/pub" relative-path="/structs/struts-config-pub.xml" /> <include module-context="config/tool" relative-path="/structs/struts-config-tool.xml" /> <include module-context="config/sys" relative-path="/structs/struts-config-sys.xml" /> <include module-context="config/navigationbar" relative-path="/structs/struts-config-bar.xml" /> </structs>

3.1.3.1.2 How to Use Struts

You can get the struct configurations like this: public interface IStructConfigLocalizer extends IConfigLocalizer { Map<String,String> findStructConfigs(); }

The key of the result is the structs configuration file name, with the Protocol prefix such as jar or file. The key can be converted to URL. The value of the result is the module name.

3.1.3.1.3 Notes

There must be one struts module named ‘config’(struts 1.x required), which is used by foundation, so any layer, including iCP, should not use ‘config’ as module-context any more.

The module-context can appear many times, so it is a best practice to split struts configurations to multiple files. This can reduce the maintenance cost of the feature.

The web.xml must be edited to adopt the new style, as follows: <servlet> <servlet-name>action</servlet-name> <servlet-class> com.ebao.foundation.module.web.struts.StrutsProxyServlet </servlet-class> <init-param> <param-name>debug</param-name> <param-value>2</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>0</param-value> </init-param>

12

Page 17: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

<init-param> <param-name>validate</param-name> <param-value>true</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping>

3.1.3.2 Spring

3.1.3.2.1 How to Configure Spring

The spring configuration is defined in the ‘spring’ segments with the children of ‘include’. Each child has a attribute named relative-path, which points to the spring files relative to this mcf.

Example: <module>

<spring> <include relative-path="/spring.xml" /> </spring> </module>

3.1.3.2.2 How to Use Spring

The spring configuration is read by this interface: public interface ISpringConfigLocalizer extends IConfigLocalizer { public Set<String> findAllSpringConfigFiles(); public ApplicationContext initApplicationContext(); }

This interface has two methods: The method named findAllSpringConfigFiles will return all the spring

files, except the spring file included by the import elements in spring files. You can read spring document for more infomation.

The method named initApplicationContext will initialize a spring context. Each layer will be a context, which has a parent context according to the layer’s hierarchy.

You never need to use this API if you are not a developer for com.ebao.foundation.module.configframework.support.spring.BeanFactory.

13

Page 18: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.1.3.2.3 Notes

The spring is initialized in the com.ebao.foundation.module.configframework. upport.spring.BeanFactory, which you can get spring beans: BeanFactory.getInstance().getBean("superAdminDetectorTwo").

If you use <import … /> to load other spring files, the loaded files should not be included in the mcf file.

If duplicate bean name is found in the same layer, error will occur. However, the same name beans in different layers are valid. In this case, the getBean(String) API will return the bean defined in the lowest layer.

3.1.3.3 Hibernate2

3.1.3.3.1 How to Configure Hibernate2

The Hibernate2 configuration is defined in the ‘hibernate2’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the hibernate files relative to this mcf.

Example: <module>

<hibernate2> <include

relative-path="/hibernate/hibernate.v2.properties " />

</hibernate2> </module>

3.1.3.3.2 How to Use Hibernate2 public interface IHibernate2ConfigLocalizer extends IConfigLocalizer { public static final String SEGMENT_NAME="hibernate2"; public Properties getHibernate2Configs(); }

The getHibernate2Configs() method will return all the configurations about Hiberante2, except the username and password.

3.1.3.3.3 Notes

The username and password are configured in the database segment.

The properties in hibernate2 will be supported by eBaoTech system. You can find more information in the documents of the Hibernate2.

The Hibernate2 will not be used any more. If you develop new code, please use Hibernate3 instead.

14

Page 19: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.1.3.4 Hibernate3

3.1.3.4.1 How to Configure Hibernate3

The Hibernate3 configuration is defined in the ‘hibernate3’ segments with the children of ‘include’. Each child has two attributes, one is named relative-path, which points to the Hibernate files relative to this mcf; another is named mode, alternative values are properties and xml, the default value is properties.

When the mode attribute is properties (or no mode attribute), the relative-path must point to a properties file.

When the mode attribute is xml, the relative-path must point to a Hibernate configuration xml file.

Example: <module>

<hibernate3> <include

relative-path="/hibernate/hibernate.v3.properties " />

<include mode="xml" relative-path="/hibernate/hibernate.jbpm.xml" />

</hibernate3> </module>

3.1.3.4.2 How to Use Hibernate3 public interface IHibernate3ConfigLocalizer extends IConfigLocalizer { public static final String SEGMENT_NAME="hibernate3"; public Properties getHibernate3Configs(); } public interface IHibernate3XmlConfigLocalizer extends IC o ronfigL calize { public static final String SEGMENT_NAME="hibernate3"; public InputStream getHibernate3ConfigsAsStream(); public Document getHibernate3ConfigsAsDocument(); }

The IHibernate3ConfigLocalizer interface is not recommened to use any more.

3.1.3.4.3 Notes

The username and password are configured in the database segment.

The properties in hibernate3 will be supported by eBaoTech system. You can find more information in the documents of the hibernate3.

15

Page 20: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

When the properties and the xml appear, the configframework will process them as follows: Firstly, load all the properties configurations in each layer with hierarchy overwrite; secondly, load all the xml configurations in each layer with hierarchy overwrite; finally, the properties configurations is overwritten by the xml configuration options.

As we recommended, the properties should not be used any more.

3.1.3.5 Hibernate3-Interceptor

3.1.3.5.1 How to Configure Hibernate3-Interceptor

The Hibernate3 supports interceptors, which is already used in eBaoTech System. Configuration is defined in the ‘hibernate3/interceptorFilter’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

Example: <module>

<hibernate3> <interceptorFilter>

<include relative-path="/hibernate/interceptor.xml" />

</interceptorFilter> </hibernate3> </module>

3.1.3.5.2 How to Use Hibernate3-Interceptor public interface IHibernateInterceptorConfigLocalizer

extends C Localizer { I onfigpublic static final String SEGMENT_NAME="hibernate3/interceptorFilter";

Set<String> findAcceptableInterceptors(); Set<String> findRejectiveInterceptors(); }

The findAcceptableInterceptors() method will return all the acceptable class names, maybe with the wildcard.

The findRejectiveInterceptors method will return all the refused class names, also maybe with the wildcard.

3.1.3.6 Cache

3.1.3.6.1 How to Configure Cache

The cache configuration is defined in the ‘caches’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

16

Page 21: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Example: <module>

<caches> <include relative-path="/cache/cache.xml" />

</caches> </module>

3.1.3.6.2 How to Use Cache public interface ICacheConfigLocalizer extends IConfigLocalizer { public static final String SEGMENT_NAME="caches"; public List<CacheConfig> findCacheConfigs(); }

The findCacheConfigs () method will return all the caches in the system by each layer if all the child layers are configured.

3.1.3.7 AOP

3.1.3.7.1 How to Configure AOP

The AOP configuration is defined in the ‘ebao-aop’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

Example: <module>

<ebao-aop> <include relative-path="/aop/aop.xml" />

</ebao-aop> </module>

3.1.3.7.2 How to Use AOP public interface IEbaoAopConfigLocalizer extends IConfigLocalizer { public static final String SEGMENT_NAME="ebao-aop"; /** * find all the config beans ,id as the key and the beandefine is the value * @return */ public Map<String, BeanDefinition> findBeanDefinitions(); }

The findBeanDefinitions () method will return all the bean definitions in the system by each layer, if the child layer is cofigurated with a bean named with parent layers’s bean, the bean will be customized by the child layer.

3.1.3.7.3 Notes

The old configuration is aop/aop.xml.

17

Page 22: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.1.3.8 Context Initialization

3.1.3.8.1 How to Configure Context Initialization

The context configuration is defined in the ‘contextInital’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

Example: <module>

<contextInital> <include relative-path="/contextInit/ contextLoad-conf.xml" />

</contextInital > </module>

3.1.3.8.2 How to Use Context Initialization public interface IContextInitialConfigLocalizer extends IConfigLocalizer { public static final String SEGMENT_NAME="contextInital"; List<InitialConfig> findInitialConfigs(); }

The findInitialConfigs () method will return all the contextInit configurations in the system by each layer. If a module in different layers has the same ID, the module will be overwritten by child layers.

3.1.3.9 CSS

3.1.3.9.1 How to Configure CSS

The CSS configuration is defined in the ‘contextInital’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

Example: <module>

<css-config> <include relative-path="/css-config.properties" />

</css-config> </module>

3.1.3.9.2 How to Use CSS public interface ICssConfigLocalizer extends IConfigLocalizer { public static final String SEGMENT_NAME="css-config"; Properties getCssConfigs(); }

18

Page 23: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

The getCssConfigs () method will return all the CSS configurations in the system by each layer. If the keys of CSS in different layers are the same, the configuration items on the parent layer will be overwritten by child layers.

3.1.3.10 LDAP

3.1.3.10.1 How to Configure LDAP

The LDAP configuration is defined in the ‘ldap’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

Example: <module>

<ldap> <include relative-path="/ldap.properties" />

</ldap> </module>

3.1.3.10.2 How to Use LDAP public interface ILDAPReferenceConfigLocalizer extends IConfigLocalizer { final String SEGMENT_NAME="ladp"; public void initLdapEnv(); }

The initLdapEnv () method will initialize a com.ebao.foundation.module.security.auth.providers.ldap.LDAPEnv object, and then you can get the ldapEnv Object from the LDAPEnv using the getDefaultLdapEnv method. Before creating the ldapEnv object, the configframework of child layers will overwrite the parent layer.

3.1.3.11 Rate Table

3.1.3.11.1 How to Configure Rate Table

The ratetable configuration is defined in the ‘ratetable’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

Example: <module>

<ratetable > <include relative-path="/ratetable.xml

</ratetable </module>

19

Page 24: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.1.3.11.2 How to Use Rate Table public interface IRatetableDefineLocalizer extends IConfigLocalizer { public static final String SEGMENT_NAME="ratetable"; public String getRetatableConfigFileName(); }

This interface only returns the rate table configuration file name. The file name may start with the prefix ‘jar:/. However, this string can be converted to the java.net.URL object.

3.1.3.11.3 Notes

This API will return the lowest layer’s configuration if available.

3.1.3.12 jBPM

3.1.3.12.1 How to Configure jBPM

The jBPM configuration is defined in the ‘workflow’ segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

The include element has an attribute named jbpm-email-template. When the value is true, it means the configuration file is a jBPM email template.

Example: <module>

<workflow> <include relative-path="/workflow/jbpm.cfg.xml"/> <include jbpm-email-template="true" relative-path="/workflow/jbpm.mail.templates.xml"/>

</workflow> </module>

3.1.3.12.2 How to Use jBPM public interface IJbpmReferenceConfigLocalizer extends IConfigLocalizer { public static final String SEGMENT_NAME="workflow"; /** * will combine the each layer jbpm configuration to the inputstream, * empty stream will return if no config find,when exception happen,null will be return ! * @return */ public InputStream getJbpmConfigInputStream();

20

Page 25: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

/** * the email template config will be unite to te result! the all * @return */ public EmailTemplateConfig findJbpmTemplates(); }

The jBPM configurations will be united as inputstream, and then iProcess module will use it to initialize the jbpmConfiguration.

The email templates also will be united to EmailTemplateConfig.

The configframework takes over the jBPM configuration. Then each module or layer can define its own configuration.

3.1.3.13 General Properties

3.1.3.13.1 How to Configure General Properties

The general properties configuration is defined in the different segments with the children of ‘include’. Each child has an attribute named relative-path, which points to the interception files relative to this mcf.

The segment name is defined by the ConfigNamespace. For example, one of Enum value is newface("locale/newface","newface config.."), so the configuration is:

<module> < locale>

<newface> <include relative-path="/newface1.prperties"/>

</newface> </locale

</module>

3.1.3.13.2 Namespaces

Namespace Xpath Description

esb esb ESB configurations

esb_serverCustomClasses esb/serverCustomClasses esb's child configuration serverCustomClasses

esb_juddi esb/juddi jUDDI configurations

currencyFormat currencyFormat Currency format configuration

performanceMonitor performanceMonitor Performance monitor configuration

newface locale/newface Newface configuration

multiCompanySupport locale/multiCompanySupport Multiple company support

21

Page 26: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Namespace Xpath Description

jspConverter jspConverter JSP converter configurations

datasource datasource Datasource configurations

env env Environment configurations

ems ems EMS configurations

uiconfig uiconfig UI configuration files

fms irule/fms FMS configuration in iRule module

rms irule/rms RMS configurations in the iRule module

ratetable ratetable/properties Rate table configurations

crystalReport report/crystal Crystal report

workflow workflow/properties Workflow configurations

batch batch/properties Batch configurations

sysadmin sysadmin System admin configurations

3.1.4 Log

Log module of iFoundation is based on Log4j.

3.1.4.1 Configuration File

Configuration file is log4j.properties(.xxx)

To write a configuration file, do as follows:

1 Configure root logger: log4j.rootLogger = [ level ] , appenderName, appenderName, …

“level” refers to the priority of log, which is classified into OFF, FATAL, ERROR, WARN, INFO, DEBUG, and ALL, or self-defined levels. For Log4j, four levels are recommended: ERROR, WARN, INFO, and DEBUG, in descending order by priority.

Description of levels: ERROR: severe error, usually program error WARN: general warning INFO: general information to be displayed, such as login and logout information DEBUG: debug information

22

Page 27: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Through level definition, you can control the output of corresponding level of logs. For example, if INFO is defined, then all the logs of DEBUG level will not be output. “appenderName” refers to the place where logs are output. You can specify multiple appenders.

2 Configure appender: log4j.appender.appenderName = fully.qualified.name.of.appender.class log4j.appender.appenderName.option1 = value1 … log4j.appender.appenderName.option = valueN

Log4j provides the following types of appender: org.apache.log4j.ConsoleAppender (console) org.apache.log4j.FileAppender (file) org.apache.log4j.DailyRollingFileAppender (generate one log file everyday) org.apache.log4j.RollingFileAppender (generate a new file when file reaches the

specified size) org.apache.log4j.WriterAppender (send logs to any specified place in streaming

format)

3 Configure log layout: log4j.appender.appenderName.layout = fully.qualified.name.of.layout.class log4j.appender.appenderName.layout.option1 = value1 … log4j.appender.appenderName.layout.option = valueN

Log4j provides the following types of layout: org.apache.log4j.HTMLLayout (HTML table) org.apache.log4j.PatternLayout (flexible layout pattern) org.apache.log4j.SimpleLayout (including log level and log character string) org.apache.log4j.TTCCLayout (including log generation time, thread, and class

information)

Log4j uses the print function which is similar to C programming to format logs. The print parameters are as follows: %m output the information specified in code %p output priority level: DEBUG, INFO, WARN, ERROR, FATAL %r output the milliseconds that are taken from application starting to log output %c output the class, usually the full name of class %t output the thread name that generates the log event %n output an ENTER character. Windows: “\r\n”; Unix: “\n” %d output the date or time of log time. Default format: ISO8601. You can also

specify a format after it, such as %d{yyyy MM dd HH:mm:ss,SSS} %l output the location of log event, including class name, thread name, and line

number in codes. For example, Testlog4.main(TestLog4.java:10)

4 You can specify the log output level for package or class.

23

Page 28: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

All logs are based on the output level of logger. However, if the output level of a class should be set to DEBUG while the level of root logger is ERROR, in this case, special setting is required: log4j.logger.your.class.or.package = DEBUG

5 The end.

3.1.4.2 API

API usage is as follows: Get log object by log factory Log log = com.ebao.foundation.core.logging.Log.getLogger(Class c)

Do log (debug, info, warn, error) log.debug(String m) log.info(String m) log.warn(String m) log.error(String m)

3.1.5 Version API

3.1.5.1 Scenario

eBaoTech insurance system consists of many components, and each component has its own version. Components depend on each other, so there is a version tree in the system.

GS 3.1

iRule3.3.0.0iFoundation3.3.0.0 iProcess3.3.0.0 iService3.3.0.0

Figure 3 Version Tree in System

This module should provide a standard version description method and a set of APIs to access the versions in the same class loader.

24

Page 29: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.1.5.2 Description File Schema

The content of version configuration file is an XML.

Construction of content

<!ELEMENT moduleVersion (module)> <!ELEMENT module (component*)> <!ELEMENT component EMPTY> <!ATTLIST module name CDATA #REQUIRED> <!ATTLIST module version CDATA #REQUIRED> <!ATTLIST component name CDATA #REQUIRED > <!ATTLIST component version CDATA #IMPLIED>

Explanation

Attribute Description

Module@name The name of module

Module@version The version of module

Module.component Components depended by the module

Module.component@name The name of component

Module.component@version The version of component

The name of version files should be version.ebao.xml, and the files are loaded from the root of class path.

For example, GS3.1 depends on iFoundation3.3.0.0, iRule3.3.0.0, iProcess3.3.0.0, and iService3.3.0.0.

There will be five version configuration files: version.ebao.xml in a jar of GS

<?xml version="1.0" encoding="UTF-8"?> <moduleVersion> <module name="GS" version="3.1"> <component name="iFoundation" /> <component name="iRule" /> <component name="iProcess" /> <component name="iService" /> </module>

Note that the versions of each component need not be configured; the version will be decided by the version.ebao.xml in the jar of each component.

version.ebao.xml in iFoundation.jar

25

Page 30: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

<?xml version="1.0" encoding="UTF-8"?> <moduleVersion> <module name="iFoundation" version="3.3.0.0" /> </moduleVersion>

version.ebao.xml in iRule.jar

version.ebao.xml in iProcess.jar

version.ebao.xml in iService.jar

<?xml version="1.0" encoding="UTF-8"?> <moduleVersion> <module name="iService" version="3.3.0.0" /> </moduleVersion>

<?xml version="1.0" encoding="UTF-8"?> <moduleVersion> <module name="iProcess" version="3.3.0.0" /> </moduleVersion>

<?xml version="1.0" encoding="UTF-8"?> <moduleVersion> <module name="iRule" version="3.3.0.0" /> </moduleVersion>

Versions of components are organized with tree models. The tree models have multiple root nodes, and the version API is used to get the whole version tree in the system.

API usage is as follows: Get builder VersionTreeBuilder builder = com.ebao.foundation.common.version.VersionTreeBuilder.getInstance();

Build version tree VersionTree tree = builder.build();

26

Page 31: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.1.6 Internationalization

3.1.6.1 Overview of Internationalization

The basic principle of Foundation internationalization is maintaining the mapping between one ID and the final text of each language through String Resource. String Resource is identified by STR_ID and LANG_ID. STR_ID identifies a message and LANG_ID identifies the language of message. Therefore, on a JSP page where messages are expressed by STR_ID, you can switch between different languages by simply changing LANG_ID.

3.1.6.2 String Resource Maintenance

Refer to section 3.4.5 String Resource Maintenance on page 131.

3.1.6.3 Get Translated Message Get string data of input message id by language id com.ebao.foundation.module.util.i18n.StringResource. getStringData(String pStringId, String pLangId)

Get string data of input message id and the language id is determined from

request com.ebao.foundation.module.util.i18n.StringResource.getStringData(String pStringId, HttpServletRequest request)

Get string data of input message id by language id, pParaList is used to replace

the place holders in string data. com.ebao.foundation.module.util.i18n.StringResource.getStringData(String pStringId, String pLangId, Hashtable pParaList)

Get string data of input message id and the language id is determined by

request, pParaList is used to replace the place holders in string data. com.ebao.foundation.module.util.i18n.StringResource.getStringData(String pStringId, HttpServletRequest request, Hashtable pParaList)

3.1.6.4 Country Template and Organization Settings

3.1.6.4.1 API

Refer to javadoc for class

com.ebao.foundation.app.sys.multicountry.util.CountryTemplateUtil

Provide API to copy the configuration data of country template to the configuration data of organization.

27

Page 32: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.1.6.4.2 Currency Value Type Extension

Use script to add extended value type to the table T_PARAM_ITEM and insert the internationalization information of the code. For example:

ITEM_ID ITEM_NAME PARAM_TYPE_ID

20 commission 3 (currency)

T_STRING_RESOURCE

STR_ID LANG_ID STR_DATA ORG_TABLE

COD_T_PARAM_ITEM_20 011 Generic Currency Format T_PARAM_ITEM

3.1.6.4.3 Organization Setting Extension

Use script to add extended organization setting to the table T_ORG_CONFIG_DEFINE and insert the internationalization information of the code. For example:

T_ORG_CONFIG_DEFINE:

DEFINE_ID

DEFINE_NAME URL PARENT_DEFINE_ID

LIST_ORDER

4 Underwriter Authority

/gs/servlet/com.ebao.gs.pub.auth.ctrl.UnderwritingUserAuthDefineAction

3 301

T_STRING_RESOURCE

STR_ID LANG_ID STR_DATA ORG_TABLE

COD_T_ORG_CONFIG_DEFINE_4

011 Underwriter Authority

T_ORG_CONFIG_DEFINE

3.1.7 Audit API

iFoundation provides the audit function. Call foundation API to write audit information. iFoundation programs also write some audit information, such as user login and logout information. iFoundation provides Audit module on UI. User can query audit information and configure transaction (audit type).

Audit API simply do logs of system information.

API:

28

Page 33: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

com.ebao.foundation.module.audit.doAudit(int transType, int objId, int objType, String transInfo) com.ebao.foundation.module.audit.doAudit(int transType, int objId, int objType,TransInfoObject transInfo)

Description: transType: transaction type ID objId: object ID objType: object type ID transInfo: detailed information

3.1.8 Error Definition

Errors are classified into three levels, warning, application exception, and system exception.

3.1.8.1 Warning

Warning refers to the not recommended situation occurred in eBaoTech system.

Warning will not block business process, which means the business process can continue without additional operation.

3.1.8.2 Application Exception

Application exception refers to the errors caused by mistaken operation or error data, for example, repeat submits.

Application exception will block business process until the error is corrected.

3.1.8.3 System Exception

Errors except for warnings and application exceptions are system exceptions. System exception is mainly caused by errors occurred in the framework itself, for example, cannot get database connection, file not found.

System exception indicates that there are bugs in the system.

3.1.8.4 Uniform Error Code

Use uniform error code to record the known and unknown errors.

Error code itself should tell whether it is warning, application exception, or system exception.

Each error code represents a known type of warning, application exception, or system exception.

29

Page 34: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Warnings and application exceptions must represent known problems.

Unknown problem is system exception and there should be an error code to represent exception.

3.1.9 Security API

Security API include authenticate and createAppUser.

Authenticate validates if the input user name and password is match.

The passed in password is already encrypted, the encryption method is provided by com.ebao.foundation.common.encrypt.OneWayHash.

CreateAppUser is used to build user information for authenticated user. com.ebao.foundation.module.security.AuthUtils.authenticate(String userName, String userPassword) com.ebao.foundation.module.security.AuthUtils.createAppUser(String userName)

3.2 Frameworks

3.2.1 XMS

3.2.1.1 Overview of XMS

Extension Management System (XMS) has three keys concepts: Extension Point: The location of variable business logic. It is a placeholder

located in business logic skeleton. Extension Service: The interface which encapsulate the variable business logic.

Physically, an Extension Service is a method of Java method. Extension Implementation: The implementation of an Extension Service.

3.2.1.1.1 Extension Point

Extension Point and fixed logic form the core skeleton of business logic, as shown in Figure 4.

30

Page 35: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

[ [

Fixed part of business logic which form the skelecton

Variable part of business logic which form the Extension Point

Figure 4 Extension Point

3.2.1.1.2 Extension Service

Extension Service encapsulates variable business logic into one piece and provides the switch between different implements, as shown in Figure 5.

[ [

Figure 5 Extension Service

3.2.1.1.3 Extension Implementation

For each Extension Point, there are several Extension Implements to do the concrete business logic. Physically, an Extension Implement is an implement of a Java Interface which refers to an Extension Point, as shown in Figure 6. Formula Implement: Get a result of computing using a calculation formula. Rule Implement: Get a true/false result using a logic judgment. Code Implement: Some business logic implemented by hard coding, or a

mixture of several different implement. Rate Table Implement: Query a Rate Table and get a result of Rates. Parameter Configuration Implement: Return attributes using global or local

configuration files or properties.

31

Page 36: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

RMS Imp

FMS Imp

RTE Imp

BsExtPoint 1

Other Imp

BsExtPoint 2invode xxxBS

Code Imp

BsExtPoint Management

Create BO

EMS

Figure 6 Extension Implement

3.2.1.2 XMS Maintenance

iFoundation provides the web maintenance system to modify the configuration of XMS after coding phase. iFoundation also provides a plug-in for Eclipse IDE.

3.2.1.2.1 Web Maintenance System

3.2.1.2.1.1 XMS Management Tree

There are two types of tree view in XMS management: Service Tree and Point Tree.

Figure 7 shows the Service Tree model.

Domain

Expoint

Service

Module

ExtImp

32

Page 37: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 7 Service Tree Diagram

Figure 8 shows the Point Tree model.

Domain

Service

ExtPoint

Module

ExtImp

Figure 8 Point Tree Diagram

To view the XMS management tree, do as follows:

1 From the main menu, select CCP Management, and then click XMS Management.

Figure 9 XMS Management Module

2 The XMS Management page is displayed. View the XMS management tree, including Service Tree and Point Tree.

33

Page 38: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 10 XMS Management Page

Table 2 Description of Fields in the XMS Management Page

S/N Field Description

1 Tab of View User can click Service Tree and Point Tree to switch the View Tree.

2 Filter Bar User can select an item (Service, Impl, or Point) from the drop-down list to specify which type of children nodes to filter, and enter filter condition in the edit box.

3 Button Tools Button Filter: clicks this button and the tree view will be

filtered.

Button Clear: click this button to clear the filter condition, and the tree will be initialized.

Button Refresh: click this button and the tree view will be refreshed and collapsed.

Button Refresh: click this button and the tree view will be collapsed but it will not be refreshed.

4 Tree View XMS root

Domain/module

Service

Implementations (root of implementations)

Implementation (node)

Extension points (root of extension points)

34

Page 39: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

S/N Field Description

Extension point (node)

3 The end

3.2.1.2.1.2 XMS Service Management

In the XMS Service Management page, you can add/modify/delete binding rules, and add/delete implementations.

1 Click a service node on the tree view. The XMS Service Management page will be displayed on the right.

Figure 11 XMS Service Management Page

Table 3 Description of Fields in the XMS Service Management Page

S/N Field Description

1 Update To save current service description

2 Factor To display the Ratetable Definition page

3 Binding Rule To display the XMS Service Binding Rule Define page

4 Implementation List of implementation records

5 Points List of point records

6 Add User can click Add to add an implementation.

35

Page 40: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

S/N Field Description

7 Delete User can select one or more implementation records and click Delete to delete them.

If an implementation is in binding, it cannot be deleted.

2 Manage XMS service. Define an implementation.

[1] In the Implementations tab page, click Add.

[2] In the Implementation area, enter the implementation name, select a domain and module, and enter the resource. Then click Save. The new implementation will be listed in the Implementations tab page.

Figure 12 Implementation Definition

Table 4 Description of Fields in Implementation Definition

S/N Field Description

1 Name Enter an implementation name, which must be unique.

2 Domain Select a domain from the drop-down list.

3 Module Select a module from the drop-down list.

4 Resource Enter a resource name.

5 Adapterable Whether to turn on or turn off the public interface.

If selected, when user saves the implementation, the system will check whether the resource exists at interface. If not selected, the system only checks the resource at server.

36

Page 41: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Update service description.

In the XMS Service Management page, enter service description in Description field and click Update. The description will be saved.

Define the rate table.

[1] Click Factor. The Ratetable Definition page will be displayed.

Figure 13 Ratetable Definition Page

Table 5 Description of Areas in the Ratetable Definition Page

S/N Field Description

1 Basic Information

Basic information of the rate table

2 Rate table Columns

Columns of rate table (factor). User cannot modify the columns, but can edit the column value.

3 Result Columns Result column in current rate table (factor). User cannot modify them.

[2] In the Rate table Columns area, select a column and click Edit Column Value to display the FMS: Edit Rate table Column Value page.

37

Page 42: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

[3] For the non-range type, enter a column value and click button Add; for the range type, enter the lower value and upper value, and then click Add. The column value will be added. Then click Close.

Note: The lower value must be smaller than the upper value.

Figure 14 Edit Column Value (No Range)

Figure 15 Edit Column Value (Range)

[4] In the Ratetable Definition page, click Save to return to the XMS Service Management page.

Define the banding rule.

[1] In the XMS Service Management page, click Binding Rule. The XMS Service Banding Rule Define page will be displayed.

[2] The Column Value Filters area lists all the columns belonging to the rate table. You can set the column value filters if you want.

38

Page 43: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 16 Column Value Filters Area

[3] In the Rate Data area, click Add to add a new rate data record. Select a defined implementation and enter values in the rate table result columns. Then click Submit.

Figure 17 Rate Data Area

Table 6 Description of Fields in the Rate Data Area

S/N Field Description

1 Implementation A list of implementation already defined

2 Rate table result columns

Result columns of rate table

39

Page 44: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.1.2.2 Plug-in for Eclipse IDE

3.2.1.2.2.1 Configuring the Plug-in of Eclipse

1 Get the XMS release package and extract it.

2 Extract the zip package, copy *.jar from the extract file’s directory \\eclipse\plugins to eclipse’s plug-in directory.

3 Start the eclipse by command eclipse.exe –clean.

4 In the eclipse, select the menu Window and click Preferences.

Figure 18 Preferences

5 Select CCP in the tree view, and perform the general setting, including JDBC URL, user name and password.

40

Page 45: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 19 General Setting

6 The end.

3.2.1.2.2.2 Registering Extension Service

To register an Extension Service to database, do as follows:

1 Select CCP, XMS and click Register ExtService. The Register Extension Service wizard will be displayed.

Figure 20 Menu of Register ExtService

41

Page 46: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

2 Select a service type from the Service Type drop-down list. If you select Instance, go to step 3. If you select Resource, the Extendable Interface will display java.lang.String,

and the Select… button is unavailable. Then go to step 5.

3 Click the button Select… in the wizard Register Extension Service, and the Class Selection dialog box will be displayed. Go to step 4.

Figure 21 Register Extension Service (1)

4 Select a project in the list, and enter a class name. The Matching types field will list all the results matched. Select a class in the list and click OK to return to the wizard Register Extension Service.

42

Page 47: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 22 Class Selection

Table 7 Description of Fields in the Class Selection Dialog box

S/N Field Description

1 Project A list of all projects in the system.

2 Select a class User can enter a class name and the system will list all the matched classes in the Matching types field.

3 Matching types A list of all the results matching the user input.

5 In the wizard Register Extension Service, select a domain and a module in which the extension service will be registered, enter a unique extension service name, and enter a description if you want.

43

Page 48: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 23 Register Extension Service (2)

6 Click Finish to submit the information, or click Next to make some particular setting.

44

Page 49: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 24 Particular Setting

Table 8 Description of Fields in Particular Setting

S/N Field Description

1 Import To import another factor into the current extension service

2 New To add a new factor without the register class

3 Edit To modify the factor information, such as factor name, data type, range type and description

4 Remove To remove a factor from the factor list

5 Up To move up the record

6 Down To move down the record

7 The end.

3.2.1.2.2.3 Maintaining Extension Service

To maintain an existing extension service, do as follows:

45

Page 50: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

1 Select the menu CCP, XMS, and click Register ExtService to display the editor Maintain Extension Service.

Figure 25 Menu of Maintain ExtService

2 Maintain extension service.

You can maintain Extension Service and Extension Point. Extension Service

Figure 26 Extension Service Tab Page

Table 9 Description of Areas in the Extension Service Tab Page

S/N Field Description

1 Search Criteria Select a domain and module, and then click Search. The extension services in the module will be displayed.

If you do not set any search criteria, all the extension services in the system will be displayed.

2 Extension Service List

A list of extension services searched out by user.

46

Page 51: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

S/N Field Description

3 Tab User can click the tab to switch the view between Extension Service and Extension Point.

4 Button Register: Click Register to register another extension service into the system.

Modify: Select an extension service in the list and click Modify to modify Domain, Module and ExtService Desc. If the current extension service is not used, user also can change Service Type, and if service type is Instance, user can select a new class to register the extension service again.

Check: Select an extension service record in the list and click Check. The system will check whether the register class still exists. If the file exists, the system will change the current record’s status to valid; otherwise, it will set the status to invalid.

Delete: If there is an extension service not used, user can select it and click Delete to delete this record.

Extension Point

Click the Extension Point tab at the bottom of the editor to switch to editor Extension Point. You can also select the menu CCP, XMS, and click Register ExtPoint to go to this editor.

Figure 27 Extension Point Tab Page

Table 10 Description of Areas in the Extension Point Tab Page

S/N Field Description

47

Page 52: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

S/N Field Description

1 Search Criteria

Select a domain and module, and then click Search. The extension points in the module will be displayed.

If you do not set any search criteria, all the extension points in the system will be displayed.

2 Extension Point List

A list of extension points searched out by user.

3 Tab User can click the tab to switch the view between Extension Service and Extension Point.

4 Button Add: Click Add to create a new extension point.

Modify: select an extension point in the list and click Modify to modify Domain, Module and ExtPoint Desc.

Delete: If there is an extension point not used, user can select it and click Delete to delete this record.

3 The end.

3.2.1.2.2.4 Inserting Extension Service

To insert an extension service to a java method, do as follows:

1 Right-click in the javascript and choose Insert ExtService from the short-cut menu, or select eclipse’s menu CCP, XMS, and click Insert ExtService, or press hot key Alt+X.

48

Page 53: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 28 Insert ExtService (Short-Cut Menu)

2 The Insert Extension Service dialog box is displayed. Insert extension service and click OK.

49

Page 54: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 29 Insert Extension Service Dialog Box

Table 11 Description of Fields in Insert Extension Service Dialog Box

S/N Field Description

1 Select extension service and point

To select an extension service and an extension point

2 Factors After an extension service is selected, all the factors belonging to this extension service will be displayed in the Factors field. User can enter the factor value.

3 Variable User can enter the variable for instantiated service and factors.

3 The end.

50

Page 55: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.2.1.2.2.5 Synchronizing

Timing Building in Eclipse, but the Build Automatically option must be selected as

follows:

Figure 30 Select Build Automatically

Check in java files into Clear Case.

Rules Annotation

Annotation can be added only before constructor and method.

Extension service cannot be put in static block or used in field declaration.

For any extension service in any anonymous class or inner class who lives in a method or constructor, the annotation of the service will be put before the method which includes the class declaration.

At one method or constructor, more than one service can be defined, but the order of annotations and services call must be the same. Synchronizer will get binding information depending on them.

Notice

If two classes are defined in one file, A’s name is the same as the file, and B has another name, after deleting B, synchronizer will lose the information about B when checking into Clear Case. So it is strongly recommended that two top level classes should not be defined in one file.

51

Page 56: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.2 Metadata

3.2.2.1 Overview of Metadata

Metadata provides a common platform of all entity and business object (BO) related information. It also defines uniform categories of the system resources.

As one part of the Common Calculate Platform (CCP), Metadata is at the bottom of all the parts. The other parts of CCP must put their resources under one of the categories defined by Metadata.

The basic resources, entities and business objects must be defined in Metadata and only are referenced by RMS, FMS and so on. However, Metadata does not create the real entity itself. It defines a mechanism for other Metadata provider to provide the real Metadata managed by them. Metadata only supplies a common interface for Metadata usage. Currently known providers include EMS, which is an important part of CCP, and a default provider that uses java reflection.

3.2.2.2 Category Support

Metadata provider ICategoryService to deal with all category related functions.

How to identify a category

Each category has its unique identifier. You can always get category information by its identifier.

For example, IMetaService.getCategoryMeta(String categoryId)

How to get the whole category tree of system

ICategoryService provides an API getCategories for user to get all domain level, root level, and categories. And each category contains its children categories. So you can travel the whole tree of categories.

How to display category on web page

Metadata registers three code table items in database: V_CCP_META_DOMAIN, V_CCP_META_MODULE, and V_CCP_META_CATEGORY. The value field of these code tables is categoryId.

For convenience, ICategoryService provides a method to translate a category ID to String Array. Each element in this array refers to the corresponding level of category.

52

Page 57: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.2.2.3 BO and Entity Support

Metadata uses IMetaService to support BO and entity related functions.

How to get entity

There are two ways for you to get entity: Firstly, you can get entity by IMetaService. IMetaService has APIs to return entity by entity ID, entity name and category ID, and by entity’s class name; secondly, you can get entities under a category by invoking getChildren(MetaElementType.Entity) on category.

How to get BO

There are two ways for you to get BO. Firstly, you can get BO by IMetaService. IMetaService has APIs to return BO by BO identifier, BO name and category ID. Secondly, you can get entities under a category by invoking getChildren(MetaElementType.BO) on category.

3.2.2.4 Meta Data Provider

Metadata only defines the metadata interfaces, any the third part provider can provide metadata following the definition.

How to become a meta data provider

Metadata provider must implement the interface IMetaServiceApi. The most important method of IMetaServceiApi is Collection<? extend EntityMeta> initialize(). Provider must return all the entities managed by itself.

How to implement the meta element

Metadata defines an adapter for every Meta element interface, such as EntityMetaAdapter for EntityMeta. Provider must extend those adapters instead of implementing the interfaces to avoid compilation errors for future change of interfaces.

3.2.2.5 Data Transfer

Metadata has two ways for you to transfer data between two environments. You need to input a list of all BOs’ identifiers, and Metadata will return the content of data transfer as string or write to the specified output stream by utf-8 encode bytes.

53

Page 58: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.2.6 Entity Management

The physical object includes all information of the object, such as properties and methods. Each business object must be associated with an entity. Metadata provides the entity management function, including adding, searching and updating entity information.

3.2.2.6.1 Adding an Entity

1 From the main menu, select CCP Management, METADATA Management, and then click Entity Management.

2 The Entity Management page is displayed. In the Entity Tree pane on the left, click Entity. Then click Add in the right pane.

Figure 31 Entity Management Page

3 Enter the class name and then click Check to check whether the class exists and has not been registered in system.

54

Page 59: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 32 Input Class Name

4 If the class exists and has not been registered, the Domain/Module/Category area and the Class List area will be displayed. In the Domain/Module/Category area, select a domain and module, and select a category if necessary; in the Class List area, enter the name, label and description if necessary, and then click Register.

Figure 33 Register Entity

5 The registration result will be displayed, indicating that the registration is successful. Click Exit.

6 The end.

55

Page 60: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.2.6.2 Searching an Entity

1 From the main menu, select CCP Management, METADATA Management, and then click Entity Management.

2 The Entity Management page is displayed. In the Entity Tree pane on the left, click Entity.

3 In the right pane, set search criteria, including name, label, class name, domain, module, and category, and then click Search. The qualified entity records will be displayed in the Search Results area.

Figure 34 Entity Management Page (Search)

4 The end.

3.2.2.6.3 Updating Entity Information

1 Search out the entity to be updated in either of the following two ways: In the Entity Tree pane, select the target entity. The entity information will be

displayed in the right pane.

56

Page 61: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 35 Search Entity in Entity Tree

Use the search function to search out the entity. Then click the target entity name.

Figure 36 Search Entity Using Search Function

2 In the Entity Information area, modify the label and description, and then click Update.

Note: If the entity is registered by EMS, the Update button is unavailable and user cannot update any entity information.

57

Page 62: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 37 Update Entity Information

3 The end.

3.2.2.7 BO Management

BO is the logical object exists in business activities. It has both business information and physical information. Metadata provides BO management, including adding, searching and updating BO information.

3.2.2.7.1 Adding a BO

1 From the main menu, select CCP Management and METADATA Management, and then click Business Object Management.

2 The Business Object Management page is displayed. Click Add.

58

Page 63: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 38 Business Object Management Page (1)

3 In the Domain/Module/Category area, select a domain, module, and category. In the Business Object Information area, enter a BO name in the Name field. Then click Next.

Figure 39 Business Object Management Page (2)

4 In the Search Entity area, set search criteria and click Search. The target entity will be displayed in the Search Result area. Select the entity and click Register. The BO will be registered into the entity.

59

Page 64: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 40 Business Object Management Page (3)

5 The end.

3.2.2.7.2 Searching a BO

1 From the main menu, select CCP Management and METADATA Management, and then click Business Object Management.

2 The Business Object Management page is displayed. In the right pane, set search criteria, including BO name, label, entity ID, domain, module, and category, and then click Search. The qualified BO records will be displayed in the Search Results area.

60

Page 65: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 41 Business Object Management Page (Search)

3 The end.

3.2.2.7.3 Updating BO Information

1 Search out the BO to be updated in either of the following two ways: In the BO Tree pane, select the target BO. The BO information will be displayed

in the right pane.

Figure 42 Search BO in BO Tree

Use the search function to search out the BO. Then click the target BO name.

61

Page 66: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 43 Search BO Using Search Function

2 In the Business Object Information area, modify the label and description, and then click Update.

Figure 44 Update BO Information

3 The end.

3.2.3 Rate Table

3.2.3.1 Overview of Rate Table

Rate table is a data store for rate and the query criteria for the rate. A rate table is a multiple dimensions array with at least one result column. The result column holds the value of the rate and the criteria column holds the query criteria.

iFoundation provides the functions of defining a rate table, querying all the topics that are using a specific topic, and downloading rate tables.

3.2.3.2 Defining a Rate Table

You can define a rate table by creating a new rate table or by registering a rate table.

Note: Most operations on rate table definition do not take effect under cluster environment. These operations are:

Create rate table

Register rate table

62

Page 67: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Create relevance table

Edit column

- Add column

- Update column

- Edit column value

- Delete column

Edit result

- Add result

- Delete result

Import rate

Enter rate

Clear data

Save rate table (Save and Save As)

Delete rate table

Roll back rate table

3.2.3.2.1 Creating a Rate Table

Note: The APIs related to data update do not take effect under cluster environment.

1 From the main menu, select Rate table and then click Rate table Definition.

2 The List Usable Ratetable page is displayed. Select a module and then click Create. You can also select a domain and category if you want.

63

Page 68: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 45 List Usable Ratetable Page (Create)

3 The Rate table Definition page is displayed. In the Basic Information area, enter the rate table name and description.

Figure 46 Ratetable Definition Page – Basic Information

4 Add columns.

[1] In the Rate table Columns area, enter column information and then click Add Column. The new column record is displayed. Use the same method to add more columns.

64

Page 69: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 47 Rate table Definition Page – Rate Table Columns

Table 12 Description of Fields in the Rate table Columns Area of the Rate table Definition Page

S/N Field Description

1 Column Name Enter the name of the column

2 Value Type Select a value type from the drop-down list for the new column.

3 Is Range Whether a value range should be entered in the new column. If selected, the Range Type field is enabled.

4 Range Type The Range Type field is enabled after Is Range is selected. There are fours range types: ( , ), [ , ], ( , ], and [ , ).

5 Is Code If you need to add columns from the code table, select Is Code.

6 Code Table The Code Table field is enabled after Is Code is selected. Select a code table from the drop-down list.

7 Filter Where Clause The Filter Where Clause field is enabled after Is Code is selected.

8 Description Description of the new column

65

Page 70: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

[2] Select a column and click Edit Column Value. The FMS:Edit Ratetable Column Value page is displayed. If you select Is Range previously, enter the lower value and upper value for the column; if you do not select Is Range previously, enter the column value. Then click Add. You can add more than one value range or value for a column. Click Close.

Note:

Limitations on column are as follows: The maximum length of column value is 30 bytes. The maximum length of the lower/upper value of column scope is 100 bytes. The maximum length of column value description is 200 bytes.

Figure 48 FMS:Edit Ratetable Column Value Page (Is Range Selected)

Figure 49 FMS:Edit Ratetable Column Value Page (Is Range Not Selected)

5 Add result columns.

[1] In the Rate table Result Columns area, enter the result column information.

66

Page 71: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 50 Ratetable Definition Page – Ratetable Result Columns Area

Table 13 Description of Fields in the Ratetable Result Columns Area of the Ratetable Definition Page

S/N Field Description

1 Column Name Enter the name of the result column

2 Value Type Select a value type from the drop-down list for the result column.

3 Compulsory Whether rate data in the result column is compulsory or not. If Compulsory is selected, the system will check that the rate data is not empty when user enters or imports rate data from an excel file.

4 Related Code Table If you select a related code table, you can select values from the code table when setting rate. If you do not select a related code table, you need to enter values when setting rate.

[2] Click Add Result to add more result columns if any.

Note: After you add result columns, some buttons are enabled, as described in the following table.

67

Page 72: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Button Function

Import Rate Importing the existing rate table

Export Rate Exporting rate from the current rate table

Enter Rate Entering rate to the current rate table

Try Testing the current rate table and showing the result

Preview Showing information about the created rate table

Clear Data Clearing data if it is no longer used

Save Saving the current rate table

Exit Exiting rate table definition

Rollback Rolling back the rate table to the previous version. Each time the rate table is saved, the system will keeps a version. The rollback function will delete the current rate table and resumes the last version.

6 Set the rate.

Note: There are two methods to set the rate: importing the existing rate table or entering the rate manually.

Import rate

[1] Click Import Rate.

[2] The FMS:Import Ratetable Column Result page is displayed. Click Browse to select an .xls file, and then click Upload.

Note: You can also set Unrelated Value and Other Value, which are optional. Unrelated values refer to the values that do not affect the result. Other values refer to the values except the defined values.

Figure 51 FMS:Import Rate table Column Result Page

Enter rate

[1] Click Enter Rate.

[2] The FMS:Enter Rate table Column Result page is displayed. Click Add. Then select a value for each column and enter a rate for the result column.

68

Page 73: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 52 FMS:Enter Ratetable Column Result Page (1)

[3] Use the same method to enter all the rates. Then click Submit.

Figure 53 FMS:Enter Ratetable Column Result Page (2)

Note: In the above figure, the last row (policy id = 005, policy year = unrelated,

surrender charge = 0.5) means that when policy id = 005, no matter what the policy year is, the surrender charge will always be 0.5.

If the setting of a row is like this: policy id = 005, policy year = Other, surrender charge = 0.5. It means that when policy id = 005 and policy year is any year except the defined years, the surrender charge will be 0.5.

If there is any conflict among the settings of the columns, an error message will be displayed.

The maximum length of result value is 200 bytes.

7 Export rate to an .xls file.

[1] Click Export Rate.

69

Page 74: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

[2] The FMS:Export Rate table Data page is displayed. Set column value filters and export conditions. Then click Export.

Figure 54 FMS:Export Rate table Data Page

Table 14 Description of Fields in the FMS:Export Rate table Data Page

S/N Field Description

1 Column Value Filters All the columns belonging to the rate table are listed here. You can set filters and the system will export only the data of the selected filters.

2 Only Export Existing Data If selected, the system will export only the existing data; if not selected, the system will export all data including empty data.

3 Batch Number Number of batches. Each batch can export a maximum of 50,000 records. If the number of records is 51,000, the system will export them by two batches. Bath 1 exports 50,000 records and batch 2 exports the remaining 1000 records. The records are exported to an Excel file. If the records are exported by more than one batch, the system will add a new sheet in the Excel file.

4 Total Total number of batches and records to be exported

[3] The File Download dialog box is displayed. Click Save.

8 Click Save in the Rate table Definition page to save the rate table.

Note: You can also save the rate table in another domain, module, or category by clicking Save As. However, you need to click Save first, and then enter the Ratetable Definition page. Then the Save As button is available. Click it and select another domain, module, or category, and change the rate table name if you want.

9 Test the rate table.

[1] In the List Usable Rate table page, search out the target rate table.

[2] Select the target rate table and click Edit.

70

Page 75: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 55 Select Rate Table

[3] The Ratetable Definition page is displayed. Click Try.

Figure 56 Test Rate

[4] The FMS:Test Ratetable Column Result page is displayed. Enter values in the columns and then click Lookup.

71

Page 76: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 57 FMS:Test Rate table Column Result Page

[5] The result is displayed in the Query Rate table Result area. Click Close.

Figure 58 Query Rate Table Result

10 The end.

3.2.3.2.2 Registering a Rate Table

The function of registering a rate table is similar to that of creating a rate table. The difference between them is that the former makes a new rate table from existing data (or physical table) and the user cannot enter data but only query the rate table while the later makes a new rate table from scratch and the user needs to enter data to query the rate table.

Note: Averagely, 4000 rate data records will cost 1 MB memory to cache for logic table. Therefore, it is recommended to use physical table for large number of rate data records.

To register a rate table, do as follows:

1 From the main menu, select Rate table and then click Rate table Definition.

2 The List Usable Ratetable page is displayed. Select a module and then click Register. You can also select a domain and category if you want.

72

Page 77: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 59 List Usable Ratetable Page – Register

3 The Rate table Definition page is displayed. In the Basic Information area, enter the basic information of rate table.

[1] In the Ratetable Name textbox, enter the name of the new rate table.

[2] In the Real Table Name textbox, enter the name of the table from which the data will be loaded.

[3] Click View. The system will load the data from the real table and show them in the MapColumn drop-down list.

Note: The maximum length of real table name is 30 bytes.

Figure 60 Ratetable Definition Page – Basic Information Area

4 In the Rate table Columns area, add columns.

73

Page 78: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

[1] Enter a column name in the Column Name textbox and select a value type from the Value Type drop-down list.

[2] If you select Is Range, the RangeType field is enabled and the MapColumn field is divided into LowerValue Column and UpperValue Column fields. Select a range type, and select the lower value column and upper value column.

Note: LowerValue Column and UpperValue Column must match the Value Type.

[3] Click Add Column. The column is added to the rate table. You can add more than one column. Select a column and click Edit to edit the column or click Delete to delete it.

Figure 61 Ratetable Definition Page – Ratetable Columns Area

5 Add result columns.

[1] In the Rate table Result Columns area, select a value type and a map column. The name of the result column is displayed automatically and cannot be changed.

[2] Click Add Result to add more result columns.

74

Page 79: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 62 Ratetable Definition Page – Ratetable Result Columns Area

6 Preview the rate table.

[1] Click Preview.

[2] The FMS: Ratetable Preview page is displayed. View the rate table and then click Close.

75

Page 80: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 63 FMS: Ratetable Preview Page

7 Test the rate table.

[1] Click Try.

[2] The FMS: Test Ratetable Column Result page is displayed. In the Ratetable Columns area, enter a value in each column and then click Lookup.

[3] The result is displayed in the Query Ratetable Result area. Click Close.

Note: For real table type, you need to save the rate table before trying it.

Table 15 FMS: Test Ratetable Column Result Page

8 Save the rate table. To save the rate table in the previously selected domain, module, and category,

click Save.

76

Page 81: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

To save the rate table in another domain, module, and category, click Save As. The FMS: Save As Ratetable page is displayed. Select a domain, module, and category, modify the ratetable name if you want, and then click Save.

Figure 64 FMS: Save As Ratetable Page

9 The end.

3.2.3.3 Querying Topics

To query all the topics that are using a specific rate table, do as follows:

1 From the main menu, select Rate table, and then click Query Topic.

2 The List Usable Rate table page is displayed. Enter the rate table name or rate table code, and then click Search.

Note: If both the rate table name and rate table code are provided, the system searches topics according to the rate table code.

Figure 65 List Usable Rate table Page

3 All the topics that are using the rate table are displayed in the Related Topics area. Click Exit.

4 The end.

3.2.3.4 Downloading Rate Tables

To download rate tables, do as follows:

1 Search out the rate tables to be downloaded.

[1] From the main menu, select Rate table, and then click Rate table Download.

77

Page 82: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

[2] The Download Rate table page is displayed. Set search criteria, and then click Search.

Note: If you do not set any search criteria, all the rate tables will be displayed in the

Search Result area. iFoundation supports fuzzy search. User can enter one or several front letters

(case sensitive) in the Rate table Name field and select Fuzzy Search, and then click Search. All the qualified rate tables will be displayed in the Search Result area.

Figure 66 Download Rate table Page (1)

2 Download rate tables.

[1] Select rate tables in the Search Result area, and select a file type (Script or Excel). Then click Download Selected.

Note: If you want to download all the rate tables searched out, select a file type and click Download All.

78

Page 83: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 67 Download Rate table Page (2)

[2] The File Download dialog box is displayed. Click Save.

3 The end.

3.2.4 Web Framework (Struts)

3.2.4.1 Overview of Struts

The struts framework is based on Struts version 1.1. There also has been some customized taglibs added to meet the project requirements.

79

Page 84: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.4.2 Architecture

3.2.4.2.1 Class Diagram

ActionForm(from action)

ExceptionHandler(from action)

ExceptionHandler(from framework)

GenericAction

execute()checkAccess()processWarning()checkPermission()process()getHomeForward()checkRepeatedSubmit()

(from framework)GenericForm

GenericForm()toString()

(from framework)

MultiWarning(from framework)

GenericWarning(from framework)

Action(from action)

UserDefinedForm(from framework)

UserDefinedAction(from framework)

sturts-config.xmlstruts-config-pub.xmlstruts-config-nb.xmlstruts-config-cs.xml......

RequestProcessor(from action)

H S

ActionServlet(from action)

#servlet#processor

AppUser(from security)

Figure 68 Extended Struts Framework Class Diagram

80

Page 85: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

The above figure illustrates the class diagram for Struts implementation. For the application classes, UserDefinedAction overrides process() method and calls domain service(s) to implement the business logic, and if needed, it can override processWarning () method to process the potential warnings of this request, too. UserDefinedForm can override validate() method to validate the properties that have been set for this request.

For details about each class, refer to section 3.2.4.3 Class Detailed Specifications on page 84.

3.2.4.2.2 Sequence Diagram

viewJSP

H S

: ActionServlet

: RequestProcessor

: GenericAction : UserDefinedAction

: UserDefinedForm DomainService

1: submit

2: process()

6: execute()

7: checkAccess()

8: checkPermission()

9: checkRepeatedSubmit()

3: create instance

4: processPopulate()

13: process()

16: forward

10: processWarning()

11: get data

14: get data

5: validate()

12: call

15: call

81

Page 86: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 69 Extended Struts Framework Sequence Diagram

Figure 69 illustrates the brief sequence diagram to handle an application request in the extended Struts framework. On the 5th step, RequestProcessor calls validate() method to validate the properties that have been set for this request, the unattached validity and consistency of the properties will be check in here. And on the 10th step, processWarning() method will check the validity of this request and its data validity according to some business logical rules. For example, for the data entry in new business module, the proposal validation rules checking will be done in processWarning() method (it calls some domain services to implement.). Only after it passed the checking, the proposal can be registered into FFMS.

viewJSP

H S

: ActionServlet

: RequestProcessor

: GenericAction : UserDefinedAction

: UserDefinedForm

DomainService

1: submit

2: process()

4: processPopulate()

3: create instance

5: validate()

6: execute()

7: checkAccess()

8: checkPermission()

9: checkRepeatedSubmit()

10: processWarning()

11: get data

13: has warning(s)

14: return

15: forward

12: call

Figure 70 Extended Struts Framework Sequence Diagram with Warnings

82

Page 87: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 70 illustrates the brief sequence diagram to handle an application request encountering some warnings in the extended Struts framework. If there are any warning messages, the system will return back to the original page and show the warning message(s) on the page top. In here, multiple warnings are allowed, and they will be wrapped by a MultiWarning object and shown in the same page. But errors are not included in the warning list, and errors are handled as SysException. There is no classification of the warnings.

: GenericAction

session requestviewJSP

1: add page token to html form and session

2: submit/execute()

3: get page token

4: check whether the page token is in the session

5: found

6: remove the page token from session

7: if return false at 3rd step

8: throw AppException

Figure 71 Check Whether the Request is Submitted Repeatedly.

Figure 71 is the brief sequence diagram to check whether the request is submitted repeatedly. When a page loaded, the page token will be added to the html form and session by PageToken tag which is included in the page (the 1st step). Then user inputs the business data and submits the page (the 2nd step). The request is handed to GenericAction through ActionServlet and RequestProcessor (The steps are skipped over in the figure). In GenericAction, system gets the page token from the request (the 3rd step) and then checks whether the token exists in the user’s session (the 4th step), and if it does (the 5th step), system will removes the token from the session (the 7th step) and continues processing; but if it doesn’t, system will throw an AppException to prompt the repeatedly submitting (the 8th step).

83

Page 88: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.4.3 Class Detailed Specifications

3.2.4.3.1 ActionServlet

This is one of the original Struts classes representing the unique Servlet in the entire system. It acts as a controller and assigns the application requests to RequestProcessor.

3.2.4.3.2 RequestProcessor

An original class of Struts, it is the processor for all application requests. It will dispatch every request to the proper Action object.

3.2.4.3.3 Action

An original class of Struts, it is the base class of all actions in the system.

3.2.4.3.4 GenericAction

Extended from Action class, this is the base class of all application actions in the system. It provides some common functions, such as checking access permission.

Method Summary

public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception

Override the execute method to invoke our own business method and integrate the permission check function in the action

@param mapping the ActionMapping

@param form the ActionForm

@param request HttpServletRequest

@param response HttpServletResponse

@return the ActionForward

@throws java.lang.Exception throw this exception when there is an error occurred in the processing

protected boolean checkAccess(HttpServletRequest request)

Method used to check whether user has logged in.

@param request HttpServletRequest

@return whether the user has logged in.

protected MultiWarning processWarning(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception

Method used to check warning

@param mapping ActionMapping

@param form ActionForm

@param request HttpServletRequest

@param response HttpServletResponse

84

Page 89: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Method Summary

@throws Exception

@return MultiWarning the detected warnings.

protected boolean checkPermission(HttpServletRequest request)

Method used to check whether the user has the right privileges.

@param request HttpServletRequest

@return whether the user has the right privileges

public abstract ActionForward process(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception

To be overridden and writing business logic in the sub classes.

@param mapping the ActionMapping

@param form the ActionForm

@param request HttpServletRequest

@param response HttpServletResponse

@return the ActionForward

@throws java.lang.Exception throw this exception when there is an error occurred during the processing

public static ActionForward getHomeForward()

Get the actionForward to home page

@return ActionForward homeForward

Private boolean checkRepeatedSubmit(HttpServletRequest request) throws Exception

Check if the page is submitted repeatedly. If true, system will throw an exception.

@param request

@param response

@return boolean

@throws Exception

3.2.4.3.5 UserDefinedAction

Extended from GenericAction class, it handles a concrete application request. It overrides process() method and calls domain service(s) to implement the business logic. It can override the processWarning() to process the potential warnings of the request.

3.2.4.3.6 ActionForm

An original class of Struts, it is the base class of all FormBean in the system. It encapsulates the submitted data from page.

85

Page 90: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.4.3.7 GenericForm

Extended from ActionForm class, it is the base class of all application FormBean in the system. It provides some common functions and attributes.

Method Summary

public GenericForm() The default constructor

public String toString() Return the string composed by all attribute values.

3.2.4.3.8 UserDefinedForm

Extended from GenericForm class, it encapsulates a concrete application request data.

3.2.4.3.9 AppUser

This class encapsulates all user related information.

3.2.4.3.10 ExceptionHandler (from org.apache.struts.action)

An original class of Struts, it handles exceptions in the Struts system.

3.2.4.3.11 ExceptionHandler (from com.ebao.pub.framework)

Extended from org.apache.sutruts.action.ExceptionHander class, it catches and handles all kinds of Exception. When the exception is an instance of AppException, system will back to the original page to show the message, and if the exception is an instance of SysException or other unknown Exception, system will forwards to the error page to show the error message.

Method Summary

public static void addPageToken(HttpServletRequest request)

When there is an exception occurred ,recover the removed PageToken, excluding the condition that the page has been submit multiple times

@param request HttpServletRequest

public ActionForward execute(Exception ex, ExceptionConfig ae, ActionMapping mapping, ActionForm formInstance, HttpServletRequest request,

Override the execute method to provide our own exception handling. It invokes process() method to fulfill its function.

@param ex the throwed exception

@param ae the exception config

86

Page 91: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Method Summary

HttpServletResponse response) throws javax::servlet::ServletException

@param mapping the action mappings

@param formInstance the form instance

@param request HttpServletRequest

@param response HttpServletResponse

@return the ActionForward

@throws javax.servlet.ServletException throw this exception when there is any exception occurred during the exception processing

public static ActionForward process(Exception ex, HttpServletRequest request, HttpServletResponse response) throws javax::servlet::ServletException

The method used to implement exception handling in our own way.

@param ex the throwed exception

@param request HttpServletRequest

@param response HttpServletResponse

@return the ActionForward

@throws javax.servlet.ServletException throw this exception when there is any exception occurred

during the exception processing

protected void debug(Object obj)

Show the debug information.

When the param is an exception, output the particular information

@param obj an object to be print out

protected static ActionForward handleAppException(HttpServletRequest request, HttpServletResponse response, AppException ae)

Handle the customized application exception

@param request HttpServletRequest

@param response HttpServletResponse

@param ae the customized exception

@return the ActionForward

protected static ActionForward handleMultiWarningException(HttpServletRequest request, HttpServletResponse response, MultiWarningException mwe)

Handle the customized application exception.

@param request HttpServletRequest

@param response HttpServletResponse

@param ae the customized exception

@return the ActionForward

protected static ActionForward handleRTException(HttpServlet

Handle the customized runtime exception.

@param request HttpServletRequest

87

Page 92: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Method Summary

Request request, HttpServletResponse response, RTException re)

@param response HttpServletResponse

@param re the customized runtime exception

@return the ActionForward

protected static ActionForward handleSysException(HttpServletRequest request, HttpServletResponse response, SysException se)

Handle the customized system exception.

@param request HttpServletRequest

@param response HttpServletResponse

@param se the customized system exception

@return the ActionForward

protected static String getExceptionMsg(Throwable e)

Get the message from the exception.

@param e the exception

@return the message in the exception

protected static ActionForward handleError(HttpServletRequest request, HttpServletResponse response, Exception exception)

Output the error message to the error page.

@param request HttpServletRequest

@param response HttpServletResponse

@param exception Exception

@return the ActionForward

3.2.4.3.12 GenericWarning

It encapsulates internationalized warning information checked in server end.

Method Summary

public GenericWarning()

Default constructor

The default warning message is "Warning"

public GenericWarning(String strId)

Initialize an warning with the indicated warning message id

@param strId the warning message id

public GenericWarning(String strId, String addInfo)

Initialize an exception with the indicated warning message id and extra warning information

@param strId the warning message id

88

Page 93: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Method Summary

@param addInfo the extra warning information

public String toString()

Get the warning message and return its id for debug.

To get the particular description, you need to call getMessage method

@return the warning message and its id.

public String getMessage(HttpServletRequest request)

Get the localized warning message from the database

@param request: the language id can be retrieved from in the session

@return the localized warning message

public String getErrorDescription(String pLangId)

Get the localized error information from the database

@param pLangId: the indicated language id

@return the localized warning message

public String getAddInfo()

Get the extra warning information

@return String the extra warning information

public void setAddInfo(String addInfo)

Set the extra warning information

@param addInfo String the extra warning information

public String getStrId()

Get the message id.

@return String the message id.

public void setStrId(String strId)

Set the message id

@param strId String the message id

public Hashtable getMessageParameters()

@return Hashtable

public void setMessageParameters(Hashtable messageParameters)

@param messageParameters Hashtable

89

Page 94: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.4.3.13 MultiWarning

It encapsulates one or more internationalized warning information checked in server end.

Method Summary

public MultiWarning() The default constructor

public MultiWarning(String titleId)

Constructor with title.

@param titleId String the message id of the warnings' title.

public MultiWarning(String titleId, String addInfo)

Constructor with title and additional information.

@param titleId String the message id of the warnings' title.

@param addInfo String the additional information.

public void addWarning(String strId)

Add a warning message.

@param strId String the warning message id.

public void addWarning(String strId, String addInfo)

Add a warning message.

@param strId String the warning message id.

@param addInfo String the additional information.

public void addWarning(GenericException ex)

Add a warning message.

@param ex GenericException

public boolean isEmpty() @return boolean

public boolean isContinuable()

If the multiwarning contain any warning.

@return boolean

public void setContinuable(boolean continuable)

Set continuable

@param continuable boolean

public List getWarnings()

Get the warning list.

@return ArrayList

90

Page 95: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.2.4.4 Taglib of Struts

The Struts 1.1 framework contains several JSP taglibs which can be used as optional components.

Also, eBaoTech has designed and developed its own special taglibs to meet the system requirements, mainly for business oriented purpose. The taglibs will support internationalization, business codes according to insurance system (e.g. Proposal No, Policy Code, etc.), and some common page component (e.g. <table>).

These new taglibs can be used to improve the flexibility, maintainability and extensibility of system.

The table below displays the customized tags of eBaoTech taglibs.

Tag Name Tag Description Tag Library Document

strRes Retrieves and displays internationalized text from the database table.

StrRes.tld

pageConfig Defines title message, header style and footer style of page.

PageConfig.tld

navigator Defines the attributes of multi-page navigation bar to support pagination function.

MultiPage.tld

PageToken Avoids a page from being resubmitted multiple times.

PageToken.tld

table Displays a data table and define the table attributes.

DataTable.tld

column Defines the attributes of every column in the data table.

DataTable.tld

codeTable Displays the code value and description in one or two text boxes, or displays a dropdown list included the appropriate code table data.

Field.tld

text Displays a one-line text-entry box or a label.

Field.tld

hidden Creates a hidden form field. Field.tld

textarea Displays a multiline textarea. Field.tld

button Displays a button. Field.tld

creditCard Displays four text boxes of credit card to validate the credit card.

Field.tld

select Displays a select list. Field.tld

checkbox Displays a checkbox. Field.tld

radio Displays a radio button. Field.tld

91

Page 96: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Tag Name Tag Description Tag Library Document

link Displays a hyperlink text. Field.tld

email Displays a text box or a label to validate the email.

Field.tld

phone Displays a text box or a label to validate the phone.

Field.tld

mobile Displays a text box or a label to validate the mobile phone.

Field.tld

bankAccount Displays a text box or a label to validate the bank account.

Field.tld

value Displays a text box or a label to validate the minimum value and maximum value.

Field.tld

number Displays a text box or a label to validate the number, the minimum number and the maximum number . It is also used to display the number in the appropriate number format.

Field.tld

date Displays a text box or a label to validate the date, the minimum date and the maximum date. It is also used to display the date in the appropriate date format.

Field.tld

currency Displays a text box or a label to validate the currency, the minimum currency and the maximum currency. It is also used to display the currency in the appropriate currency format.

Field.tld

percent Displays a text box or a label to validate the percentage, the minimum number and the maximum number.

It is also used to display the value in the appropriate percentage format.

Field.tld

unitNumber Displays a text box with a unit name or a label with a unit name to validate the number, the minimum number and the maximum number.

It is also used to display the number format of the value.

Field.tld

weight Displays a text box with a weight unit or a label with a weight unit to validate the number, the minimum number and the maximum number.

It is also used to display the value in the appropriate format.

Field.tld

92

Page 97: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Tag Name Tag Description Tag Library Document

height Displays a text box with a height unit or a label with a height unit to validate the number, the minimum number and the maximum number.

It is also used to display the value in the appropriate format.

Field.tld

documentCode Displays a text box or a label. When displays a text box, it’s able to validate the input document code.

Field.tld

applyCode Displays a text box or a label. When displays a text box, it’s able to validate the input apply code.

Field.tld

policyCode Displays a text box or a label. When displays a text box, it’s able to validate the input policy code.

Field.tld

caseCode Displays a text box or a label. When displays a text box, it’s able to validate the input case code.

Field.tld

changeCode Displays a text box or a label. When displays a text box, it’s able to validate the input change code.

Field.tld

certiCode Displays a text box or a label. When displays a text box, it’s able to validate the input certificate code by certificate type.

Field.tld

3.2.4.5 Logging

3.2.4.5.1 Exception Handling

When Exception Handler catches an exception, the system will log the exception information into the log file. All kinds of Exception will be handled here, and AppExcetion is logged in warning level, and other exceptions are logged in error level.

3.2.4.6 Configuration

3.2.4.6.1 Struts Configuration

Struts’ configuration files contain the request-action mapping information for the application system. Strut 1.1 supports to relate configuration file to system modules.

93

Page 98: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Every component has its own Struts configuration file. In addition we extract the common configurations referenced by more than one module into one system configuration file.

The default configuration file in a struts system is the file struts-config.xml. Some components’ configuration files will be struts-config-<component name>.xml.

3.2.4.6.2 Taglib Configuration

As mentioned previously, the struts-html taglib and eBaoTech taglib will be used in system. They need a series configuration files to define. The followings are all taglib define files.

File Name URL

navigation.tld http://www.ebaotech.com/taglib/icp/ifoundation/navigation/2009

JTree.tld http://www.ebaotech.com/taglib/icp/ifoundation/dtree/2009

DataTable.tld http://www.ebaotech.com/taglib/icp/ifoundation/dataTable/2009

DisplayJspSource.tld http://www.ebaotech.com/taglib/icp/ifoundation/display/2009

Field_jp.tld http://www.ebaotech.com/taglib/icp/ifoundation/field/2009

Field.tld http://www.ebaotech.com/taglib/icp/ifoundation/field/2009

Logic.tld http://www.ebaotech.com/taglib/icp/ifoundation/logic/2009

ModuleLink.tld http://www.ebaotech.com/taglib/icp/ifoundation/moduleLink/2009

MultiPage.tld http://www.ebaotech.com/taglib/icp/ifoundation/multiPage/2009

Newface.tld http://www.ebaotech.com/taglib/icp/ifoundation/newface/2009

PageAccessControl.tld http://www.ebaotech.com/taglib/icp/ifoundation/pageAccessControl/2009

PageBody.tld http://www.ebaotech.com/taglib/icp/ifoundation/pagebody/2009

PageConfig.tld http://www.ebaotech.com/taglib/icp/ifoundation/pageconfig/2009

PageToken.tld http://www.ebaotech.com/taglib/icp/ifoundation/pagetoken/2009

StringResource.tld http://www.ebaotech.com/icp/ifoundation/stringresource/2009

Strres.tld http://www.ebaotech.com/taglib/icp/ifoundation/strres/2009

url.tld http://www.ebaotech.com/taglib/icp/ifoundation/url/2009

Utils.tld http://www.ebaotech.com/taglib/icp/ifoundation/utils/2009

94

Page 99: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.2.5 Hibernate

In iFoundation, obtaining Hibernate session is enough, so there is only one API: com.ebao.foundation.module.db.hibernate.HibernateSession3.currentSession()

It is recommended that all the .hbm files should be put in the classpath in jar.

For the .hbm files loaded from classpath, configure the file path description beginning with classpath*: in HIBERNATE_HBM_PATH3 and HIBERNATE_HBM_PATH in env namespace.

Default settings: HIBERNATE_HBM_PATH3=classpath:*:/com/ebao/foundation/**/*.hbm.xml

will search all the *.hbm.xml files in the package com/ebao/foundation in all classpath.

All the Hibernate files are configured in the iCP env namespace by classpath:*:/com/ebao/**/*.hbm.xml. Therefore, if you put your Hibernate file in the ebao jar, no configuration is needed.

Other features: Duplicate file will not be reloaded, and error will be thrown. The Hibernate 2 will be supported. By default, a key is configured in the env

namespace. HIBERNATE_HBM_PATH=classpath:*:/com/ebao/**/*.hbm2.xml, which means all the Hibernate 2 files should have the extension name as .hbm2.xml, and placed in the classpath.

3.2.6 Application Context

Application context is used to contain current application user.

APIs:

Get application user of current thread com.ebao.foundation.common.context.AppUserContext.getCurrentUser()

Set application user to current thread com.ebao.foundation.common.context.AppUserContext. setCurrentUser(AppUser appUser)

Remove application user from current thread com.ebao.foundation.common.context.AppUserContext.unBindCurrentUser()

95

Page 100: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.7 Error Handling

3.2.7.1 Exception Handler

In iFoundation, exceptions are classified into Application Exception (AppException) and System Exception (SysException). Exception Handler logic is processed in GenericAction. Application programs only need to inherit GenericAction. When throw exception, select a proper exception and GenericAction will process the exception.

AppException will return to and be displayed in the application page. If the input attribute is defined in XML, return to the path specified by the input attribute. Otherwise, return to the previous page.

SysException will go to the error report page.

3.2.7.2 Warning Handler

Except the Exception mechanism, iFoundation also provides the Warning mechanism. The application program can throw the predefined Warning, asking user to proceed or not.

Usage:

Inherit GenericAction, re-write processWarning method, throw MultiWarning.

3.2.7.3 Multiply Module Link

3.2.7.3.1 Introduction

Module link is a simple lib, which can help you to implement a function of entering from original module to target module and going back.

Using traditional methods, there are some issues to implement the function that is forward and go back from one module to another. It includes below problems The parameters transfer is very complex, which also breaks the primary program

logic. Can’t go back original module from target module. No consistent API for forwarding and going back.

For getting rid of above issues, we provide a solution which is called Module Link.

The goals of the module link include Hide the complexity of parameters transfer, the core application doesn’t care

about it. Can go back to original module from target module. Provide consistent common API.

96

Page 101: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.2.7.3.2 Design

It is well know that Http protocol is stateless. If you want to hold data across multi-request, in general, you can Hold the data on server-side

- Http session

- Http application

- Database Hold the data on client-side

- Cookie

- Hidden area and do continue for every request

Module link holds the data on client-side hidden area and does continue for every Http request.

The following three questions must been considered: How to enter the target module? How to return to original module from target module? How to avoid the problem of no right for target module?

3.2.7.3.2.1 How to Enter the Target Module

For entering into the target module from the original module, two parameters must be considered: entry link name

The entry link name is really a URL for the target module. For example: /pub/entryUserMaintain.do

entry parameters

The entry parameters include a set of parameters definition for forwarding to the target module. The format of the parameters is an object literal of JavaScript. For example: <script> var entryParameters = “{ userId: ‘1’ , perationType:’edit’ }”; </script>

3.2.7.3.2.2 How to Return to Original Module from Target Module

For returning original module from target module, we must consider The parameters for going back Store the parameters on client-side Different types of the link for going back

97

Page 102: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.7.3.2.2.1 Parameters for Going Back

There are two main parameters are used for going back, these are as follows:

Back link name

The back link name is really a URL for the original module. For example /pub/listParty.do

Back parameters

The back parameters include a set of parameters definition for backward. As the entry parameters, the format is an object literal of JavaScript. For example <script> var backParameters = “{partyType:’2’}”; </script>

3.2.7.3.2.2.2 Store the Parameters on Client Side

The back link name and back Parameters are very important, which are necessary for backward. They must be got on the latest page of the target module. As talked before, we store the parameters on client side. The outputs are hidden value areas on the pages and they will be submitted to server side for per request. They would look like this: <input type=”hidden” name=”com.ebao.pub.moduleLink.BACK_LINK” value=”/pub/listParty.do”/> <input type=”hidden” name=”com.ebao.pub.moduleLink.BACK_PARAMETERS” value=”{partyType:’2’}”/>

You do not need to care about them. A tag named BackLinkStorageTag will encapsulate the implementation of how to generate above parameters.

The only work you should do is to put the BackLinkStorageTag inside the html form which will be submitted to server side.

The GenericAction which is the root struts action of foundation web framework will process the request parameters for back link, and do continue for next request.

3.2.7.3.2.2.3 Different Types of Link for Going Back

In general, there are two different types of the link can be used for going back: direct URL link and action link.

Direct URL link

98

Page 103: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

If you use this type of the link, it means that there are no additional operations before going back to original module. A URL link with its parameters is enough for us. For example, use the tag below:

<Page:BackLink title=”go back”></Page:BackLink>

Action link

If you use this type of the link, it means that there are some additional operations would be processed before going back. For example, before back to party module, you must save or update the user information. We provide a global struts action forward, you can forward to this one inside your struts action.

3.2.7.3.2.3 How to Avoid the Problem of No Right for Target Module

Foundation’s security engine is checking whether the current user has right to access resource of URL when user requests the expected URL. Below is the policy of access check: Check whether user has right of current module. The module ID will be cached

in cookie and will be read for each process of check access. If user has right of current module, then check whether user has right of

expected URL. If authorization is successful, user can access this resource of URL, if it is failed, then send back to warning page.

So, we face a problem that there is no module ID of target module in cookie when user clicks the button and forward to the target module.

In order to avoid this problem, you must define a module code, which is the identifier for each module. The value of module code must keep unique in whole system and it will be used as a method parameter when you invoke the API which is provided by ModuleLink.

The diagram above represents the user interface of module code definition. You can find it in module management which is the sub menu of foundation.

99

Page 104: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.7.3.2.4 Forward to Target Module by Invoking Java API

Usually, before forward to the target module, user wants to do some additional operations, like save, delete or update.

The Java API below can help you to go to target module after your work.

Public void forward(String linked, String entryLinkName, String backLinkName, Map entryParameters, Map backParameters, String entryModuleCode, String backModuleCode, HttpServletRequest request, HttpServletResponse response)

In general, you should invoke this method in struts action or servlet.

3.2.7.3.3 API specification

3.2.7.3.3.1 Java API Specification

3.2.7.3.3.1.1 ModuleForward

ModuleForward

++

instance ()forward (String linkId, String entryLinkName, String backLinkName, Map entryParameters, Map backParameters, String entryModuleCode, String backModuleCode, HttpServletRequest request, HttpServletResponse response)

: ModuleForward: void

ModuleForward provides methods to forward to the target module.

Methods

Public static ModuleForward instance()

Description:

Get the instance of ModuleForward.

Public void forward(String linked, String entryLinkName, String backLinkName, Map entryParameters, Map backParameters, String entryModuleCode, String backModuleCode, HttpServletRequest request, HttpServletResponse response)

Description:

Go to the target module.

Parameters: LinkId: the identifier of module link EntryLinkName: the entry link name of target module BackLinkName: the back link name of original module

100

Page 105: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

EntryParameters: the entry parameters of target module BackParameters: the back parameters of original module EntryModuleCode: the module code of target module BackModuleCode: the module code of original module Request: the object value of request Response: the object value of response

3.2.7.3.3.2 Taglib Specification

We design and realize three of the taglibs: EntryLink Tag BackLinkStorage Tag BackLink Tag

3.2.7.3.3.2.1 EntryLink Tag

EntryLink tag is a taglib that print a button or a link for entering target module from original module, the main attributes are as follows:

Name Description Required

id The unique id of tag True

displayType The display type of the entry link. Optional values are ‘button’ and ‘link’. Default display type is ‘button’

False

title The display title of link or button. The value of title can be a message id that is in order to translate to different language.

False

entryLinkName The URL of target module True

entryParameters The entry parameters of target module. The type of the parameters is an object literal of JavaScript.

False

backLinkName The URL of original module False

backParameters The back parameters of target module. The type of the parameters is an object literal of JavaScript.

False

isDisplay Whether display the entry link False

moduleCode The module code of target module, which must be unique in whole system.

False

backModuleCode The module code of original module, which must be unique in whole system.

False

101

Page 106: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.2.7.3.3.2.2 BackLinkStorage Tag

The responsibility of the BackLinkStorage tag is storing backLinkName and backParameters in the browser. By using hidden variable, both backLinkName and backParameters can be submitted to server-side per request if it is needed.

3.2.7.3.3.2.3 BackLink Tag

BackLink tag is an API for going back original module from target module. It has only two attributes.

Name Description Required

displayType The display type of entry link. Optional values are ‘button’ and ‘link’. Default display type is ‘button’

False

title The display title of link or button. The value of title can be a message id that is in order to translate to different language

False

3.2.7.3.3.2.4 Two Types for Backward Operation

There are two types for going back to original module. One is simple URL forward, the other is action forward. ModuleLink can support both of them.

3.2.7.3.4 Example

The example below shows how to use ModuleLink.

MainPage EntryPage SubPage_1 SubPage_2 SubPage_3

MainPage can be thought as original module page, EntryPage can be thought as the first page of the target module. After going across the sub pages of the target module, the page flow will go back to MainPage of the original module.

PageAction.java public class PageAction extends GenericAction {

102

Page 107: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

public ActionForward process(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { String a = request.getParameter("a"); String b = request.getParameter("b"); if ("1".equals(a) && "2".equals(b)) { System.out.println("Go to the main index page."); return mapping.findForward("main_page"); } String c = request.getParameter("c"); if ("3".equals(c)) { System.out.println("Go to the entry page."); return mapping.findForward("entry_page"); } String pageNum = request.getParameter("pageNum"); if (pageNum != null) { return mapping.findForward("subpage_" + pageNum); } if (this.isNeedBack() && request.getParameter("action") != null) { return mapping.findForward("goBack"); } return null; } }

Entrypage.jsp <%@ taglib uri="ModuleLink.tld" prefix="Page" %> <html> <head> <link rel="stylesheet" href="<%=request.getContextPath()%>/pub/main_en.css" type="text/css"> </head> <body> <FORM id="testform" action="<%=request.getContextPath()%>/demo/pageAction.do" method="post"> <Page:BackLinkStorageTag></Page:BackLinkStorageTag> <input type="hidden" name="pageNum" value="1"/> </FORM> Entry page <br> <a href="#" onclick="javascript:document.getElementById('testform').submit()">Go to subpage_1</a> </body> </html>

Mainpage.jsp

103

Page 108: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

<%@ taglib uri="ModuleLink.tld" prefix="Page" %> <html> <head> <link rel="stylesheet" href="<%=request.getContextPath()%>/pub/main_en.css" type="text/css"> <script src="<%=request.getContextPath()%>/pub/js/modulelink/moduleLink.js"></script> <script> var entryParameters = "{c:'3'}"; var backParameters = "{a:'1',b:'2'}"; </script> </head> <body> Main index page <br> <Page:EntryLinkTag id="goEntryPage" title="Go entryPage" entryLinkName="pageAction.do" entryParameters="entryParameters" backLinkName="/demo/pageAction.do" backParameters="backParameters" moduleCode=”testTargetModule” backModuleCode=”testOriginalModule”> </Page:EntryLinkTag> </body> </html>

SubPage_1.jsp <%@ taglib uri="ModuleLink.tld" prefix="Page" %> <html> <head> <link rel="stylesheet" href="<%=request.getContextPath()%>/pub/main_en.css" type="text/css"> </head> <body> <FORM id="testform" action="<%=request.getContextPath()%>/demo/pageAction.do" method="post"> <Page:BackLinkStorageTag></Page:BackLinkStorageTag> <input type="hidden" name="pageNum" value="2"/> </FORM> Sub page 1 <br> <a href="#" onclick="javascript:document.getElementById('testform').submit()">Go to subpage_2</a> </body> </html>

104

Page 109: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

SubPage_2.jsp <%@ taglib uri="ModuleLink.tld" prefix="Page" %> <html> <head> <link rel="stylesheet" href="<%=request.getContextPath()%>/pub/main_en.css" type="text/css"> </head> <body> <FORM id="testform" action="<%=request.getContextPath()%>/demo/pageAction.do" method="post"> <Page:BackLinkStorageTag></Page:BackLinkStorageTag> <input type="hidden" name="pageNum" value="3"/> </FORM> sub page 2 <br> <a href="#" onclick="javascript:document.getElementById('testform').submit()">Go to subpage_3</a> </body> </html>

SubPage_3.jsp <%@ taglib uri="ModuleLink.tld" prefix="Page" %> <html> <head> <link rel="stylesheet" href="<%=request.getContextPath()%>/pub/main_en.css" type="text/css"> <script src="<%=request.getContextPath()%>/pub/js/modulelink/moduleLink.js"></script> </head> <body> sub page 3 <br> <Page:BackLinkTag title="Go back"> </Page:BackLinkTag> <br> <FORM id="testform" action="<%=request.getContextPath()%>/demo/pageAction.do" method="post"> <Page:BackLinkStorageTag></Page:BackLinkStorageTag> <input type="hidden" name="action" value="goBack"/> </FORM> <a href="#" onclick="javascript:document.getElementById('testform').submit()">Go

105

Page 110: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

back process by action </a> </body> </html>

3.3 Library

3.3.1 JSP Tag

Refer to iFoundation Tag Developer Guide V3.5.

3.4 Tools and Solutions

3.4.1 Error Code Maintenance

iFoundation provides the function of adding, modifying, and deleting error code.

To maintain error code, do as follows:

1 From the main menu, select Test&Debug, eBao Use Module, System Config, Basic Data, and then click Error Code Maintain.

Figure 72 Error Code Maintain

2 Select an error type in the left pane and all the defined error codes of the error type will be displayed in the right pane.

106

Page 111: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 73 Select Error Type

3 Maintain error code. To add a new error code, go to step 4. To modify an existing error code, go to step 5. To delete an error code, go to step 6.

4 Add an error code.

Click Add. An error code will be automatically generated. Enter the error name. Enter the cause and process if you want. Then click Add.

Figure 74 Add Error Code

5 Modify an error code.

Click the error code or error name. The related information will be displayed below. Modify the error name and cause and process. Then click Edit.

107

Page 112: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 75 Edit Error Code

6 Delete an error code.

Click the error code or error name. The related information will be displayed below. Click Delete.

Figure 76 Delete Error Code

7 The end.

108

Page 113: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.2 Public Data Definition Maintenance

Public data definition maintenance is performed to control the UI data operation of the public data table. Public data definition maintenance includes adding, modifying, and deleting table definition information.

To maintain public data definition, do as follows:

1 From the main menu, select Test&Debug, eBao Use Module, Tools, Public Data Maintenance Configuration, and then click Public Data Definition Maintain.

Figure 77 Public Data Definition Maintain

2 Maintain public data definition. To add table definition information, go to step 3. To modify table definition information, go to step 4. To delete table definition information, go to step 5.

3 Add table definition information.

[1] Click AddTableDefinitionInfo.

109

Page 114: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 78 Add Table Definition Information

[2] The Add Data Maintain Table Definition page is displayed. Enter the related information. Then click Save.

Figure 79 Add Data Maintain Table Definition Page (1)

Table 16 Description of Fields in the Add Data Maintain Table Definition Page

S/N Field Description

1 Component Name Select a component from the drop-down list.

2 Table Name Enter the name of the table for which the definition information will be added.

3 Table Description Automatically displayed if any.

4 Support Logic Delete Whether the records in the table can be deleted through UI

5 Allow Modify All Record Whether all the records in the table can be modified through UI

6 Save Click Save to save the definition information.

7 ColumnManage Click ColumnManage to define which operations can be performed on which columns through UI. The button is enabled after the definition information is saved.

[3] The information Success in add table definition! is displayed. The ColumnManage button is enabled. Click it to display the Common Data Maintain Column Definition page.

110

Page 115: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 80 Add Data Maintain Table Definition Page (2)

[4] Define operations for each column, including whether to allow modification, whether to allow display, and whether to be used as query condition. Then click Save.

Figure 81 Common Data Maintain Column Definition Page

4 Modify table definition information.

[1] Select a component name and a table name, and then click ModifyTableDefinitionInfo.

111

Page 116: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 82 Modify Table Definition Information

[2] The Modify Common Data Maintain Table Definition page is displayed. Modify Support Logic Delete and Allow Modify All Record. Then click Save.

Figure 83 Modify Common Data Maintain Table Definition Page

[3] Click ColumnManage to modify operations for each column in the Common Data Maintain Column Definition page. Then click Save.

5 Delete table definition information.

[1] Select a component name and a table name, and then click DeleteTableDefinitionInfo.

112

Page 117: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 84 Delete Table Definition Information

[2] The message Success in delete table definition! will be displayed.

Figure 85 Result of Table Definition Information Deletion

6 The end.

3.4.3 User Interface Configuration Tool

3.4.3.1 Performing Web Form Design

Web Form represents the section for data input and submit on the page. User may design the section by following the procedures below.

113

Page 118: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

1 Edit UI Form.

[1] From the main menu, select Workflow and click Work List Configuration.

Figure 86 Work List Configuration Module

[2] In the All Process Configuration page, click Configuration Monitor Search.

Figure 87 Configuration Monitor Search

[3] In the Edit UI Table page, enter the necessary information such as Name and other optional information such as HeaderTitle, Width and Height to define the basic information of UI form.

114

Page 119: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 88 Edit UI Form (1)

[4] Click Event to enter OnCreate content and then click Next.

Figure 89 Edit UI Form Event

Table 17 Description of Fields in the Edit UI Form Page

S/N Field Description

1 Name The unique name that references the web form

2 HeaderTitle The caption of the web form

3 Width(px) The width of the web form layout

4 Height(px) The height of the web form layout

5 Visible Condition The condition under which the web form is visible

It supports simple expression supported by UIC (Refer to dynamic field property)

6 ReadOnly Whether the web form is read only

7 Common A sign indicate whether the web form is common (used in API)

115

Page 120: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

S/N Field Description

8 OnCreate JavaScript function name, which will be called on creation event happen.

Note: The following operations on web form do not support cluster: Create Update properties Delete

2 Edit Form Layout

[1] In the Form Layout page, click Add Group to add a new group on the web form.

F ure 9 it Form Layout

[2] In the Form Group table, enter the necessary information such as Name, Columns, Rows and other optional information such as Title, Width,

ig 0 Ed

Height and then click Submit.

116

Page 121: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 91 Edit Form Group

Table 18 Description of Fields in the Edit Form Group Page

S/N Field Description

1 Name The unique name references to the form group

2 Title The caption of the form group. (This field does not take effect now)

3 Columns The column count of form group (Range [1, 4])

4 Rows The row count of form group

7 Expanded Whether expand layout automatically according to the layout size of web form

8 Visible Whether it is visible.

[3] them In the Form Layout page, select items from the left-hand tree and dragto a form layout section.

Figure 92 Add Item Screen

[4] Select one Item in the group and click Edit Item to edit all the property and

sary item. event of the item and click unneces

Submit. Click Delete Item to delete the

117

Page 122: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 93 Edit Item

Table 19 Description of Fields in the Edit Item Page

S/N Field Description

1 Name The unique name references to the item

2 Label The label of the item (Support i18n)

3 Visible Whether visible

4 ColumnSpan The column span of the item layout

5 Format Display format for number or date type

118

Page 123: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

S/N Field Description

6 DisplayType Display style for the item

7 DefaultValue Default value when display

8 Style Unused field

9 Tag Unused field

10 Tip Tip information for the item (Support i18n)

11 ReadOnly Whether it is read only

12 Required Whether its value is a not null

13 Always Display Whether it cannot be deleted in production model

(refer to UIC configuration)

14 Unmodifiable Whether it cannot be modify in production model

(refer to UIC configuration)

S/N Field Description

1 OnCreate JavaScript function name, which will be called on create event happened

2 OnActive JavaScript function name, which will be called on active event happened

3 OnRefresh JavaScript function name, which will be called on refresh event happened

4 OnBlur JavaScript function name, which will be called on blur event happened

5 OnChange JavaScript function name, which will be called on value change event happened

6 OnButtonClick JavaScript function name, which will be called on button click event happened

[5] Select one item in the group and click Validator. Then the Validator Screen will be displayed.

119

Page 124: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 94 Add Validator

and select Valirequired, validator-pattern .

[6] Click Add dator Type such as validator-custom, validator- and then click Submit

S/N Field Description

1 Validator Type The type name of validator. Refer to data dictionary for all supported types.

2 Custom Validate JavaScript function name, which will be called on

custom. validation. It takes effect when the type is validator-

3 Pattern The regulation expression used to validate the input value. It takes effect when the type is validator-pattern.

4 Min The minimum value when the type is validator-range or the minimum length when the type is validator-length.

5 Max The maximum value when the type is validator-range or the maximum length when the type is validator-length

120

Page 125: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

S/N Field Description

6 Error Msg Prompt message when validation fails

7 OnValidateFailed JavaScript function name, which will be called when validation fails

[7] When finished configuration of all fields, click Preview for an advance showing.

F

Note:

g operations on form group do not support cluster:

- Create

- U s

- Modify row count

- Modify column count

- Delete

The following operations on f

- Create

- Update properties

igure 95 Preview Web Form

The followin

pdate propertie

orm editor control do not support cluster:

121

Page 126: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

- Change item position

- U idation

- D

3 The end.

3.4.3.2 Perform Table Design

Data table represents the section which display data in a list way. User may design the section by following the procedures below.

Note: The APIs related to data update do not take effect under cluster environment.

1 Define data table.

[1] From the main menu, select Workflow and click Work List Configuration.

[2] In the All Process Configuration page, click Configure all Process Search Result.

[3] In the Edit UI Table page, enter the necessary information such as Name, DataSource and other optional information such as HeaderTitle, Width and Height to define the basic information.

pdate val

elete

ing Data

Figure 96 Edit UI Table – Property

122

Page 127: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Table 20 Description of Fields in the Property Tab Page

S/N Field Description

1 Name The unique name that references to the data table

2 DataSource The data model which represents a list

3 Height(px) The height of the data table layout

4 Width(px) The width of the data table layout

5 Max Height The max height of the data table layout, if the height is not set

6 Visible Condition The condition under which the web form is visible

It supports simple expression supported by UIC (Refer to dynamic field property)

7 Binding Action Whether to have add row and delete row function

8 Show Header Whether to show table head

9 Show Footer Whether to show table foot

10 Common A sign indicate whether the data table is common (used in API)

11 P p opup Edit Whether to edit popu

[4] Click Event to enter content and then click Next.

Figure 97 Edit UI Table – Event

123

Page 128: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Table 21 Description of Fields in the Event Tab Page

S/N Field Description

1 OnCreate JavaScript function name, which will be called on creation event happen

2 BeforeRemoveRecord called before JavaScript function name, which will be record remove event happen

3 AfterRemoveRecord ill be called after record remove event happen JavaScript function name, which w

4 BeforeAddRecord ent happen

JavaScript function name, which will be called before record add ev

5 AfterAddRecord JavaScript function name, which will be called after record add event happen

6 OnRowSelect JavaScript function name, which will be called on row select event happen

2 Ed yout.

ble Layout page them to the table layout s

it data table la

[1] In the Ta , select items from the left-hand tree and dragection.

Figure 98 Edit Table Layout

[2] Select an item and click Edit Item to edit it. Only modify the property label of all items with the value of property name.

124

Page 129: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 99 Edit Item – Property

Table 22 Description of Fields in the Property Tab Page

S/N Field Description

1 Name The unique name references to the item

2 L pport i18n) abel The label of the item (Su

3 Visible Whether visible

4 Format Display format for number or date type

5 DisplayType Display style for the item

125

Page 130: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

S/N Field Description

6 DefaultValue Default value when display

7 Style Unused field

8 Tag Unused field

9 ReadOnly Whether it is read only

10 Required Whether its value is required

11 Disable IME Whether to disable input method

12 TableName If the item is codetable, the option is table name defined into the database.

13 OrderBy The order column of table

14 WhereClause The condition to filter the data from table name

15 ChildItem The name of child item if united item is required

16 UnitedKey The UnitedKey of child item if united item is required

17 No Selection Load On the united table, if the option is selected on the parent item, the child item will load all records.

18 Always Display Whether it cannot be deleted in production model

(refer to UIC configuration)

19 Unmodifiable Whether it cannot be modify in production model

(refer to UIC configuration)

126

Page 131: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 100 Edit Item – Event

Table 23 Description of age Fields in the Event Tab P

S/N Field Description

1 OnCreate JavaScript function name, which will be called on create event happened

2 OnActive JavaScript function name, which will be called on active event happen

3 OnRefresh JavaScript function name, which will be called on refresh event happened

4 OnBlur JavaScript function name, which will be called on blur event happened

5 OnChange JavaScript function name, which will be called on value change event happened

6 OnHeadClick JavaScript function name, which will be called on head click event happened

[3] When finished configuration of all fields, click Preview for an advance showing.

127

Page 132: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 101 Preview Data Table

Note

The following operations on data table do not support cluster:

- Create

- Update properties

port cluster:

- Update operties

- tem position

- Update

- Update row range unique

- Delete

The APIs related to data upd t.

Th

3.4.4 Unit Test Template

3.4.4.1

Unit test frame inherits Junit and uses Mock strategy to simulate real environment.

- Delete

The following operations on table cell control do not sup

- Create

pr

Change i

validation

check

ate do not take effect under cluster environmen

3 e end.

Overview of Unit Test

128

Page 133: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.4.2 Foundation Unit Test Classes

Foundation test frame provides a group of Mock classes to simulate Servlet Context and a group of test case templates.

Table 24 Mock Classes

Class Name Description

MockEBaoFilterChain Mock of FilterChain, extends from MockFilterChain

MockExpressionEvaluator Mock of ExpressionEvaluator

MockFilterConfig Mock of FilterConfig

MockHttpServletRequest Mock of HttpServletRequest

MockHttpServletResponse Mock of HttpServletResponse

MockHttpSession Mock of HttpSession

MockPageContext Mock of PageContext

MockRequestDispatcher Mock of RequestDispatcher

MockServletConfig Mock of ServletConfig

Table 25 Test Case Class

Class Name Description

FilterTestCase Test case template used to test Filter

FoundationTestCase Test case template used to test Foundation functional module

JspTagTestCase Test case template used to test JSP Tag

StrutsActionTestCase Test case template used to test struts action

MockWebTestCase Test case Template used to test servlet

MockDataBaseTestCase Test case template used to test database related module

3.4.4.3 terTestCase Use the method protected void addInitParameter(String name,

String value) to add parameters for Filter Configuration. otected void doInitFilter(Filter filter)

throws ServletException to initialize Filter using the Filter Configuration. Use the method protected void doFilter(Filter filter) throws IOException,

xecute the initialized Filter.

How to Use Fil

Use the method pr

ServletException to e Use the method protected void doDestroyFilter(Filter filter) throws

ServletException to destroy the Filter.

129

Page 134: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.4.4.4 How to Use FoundationTestCase Use the method public void setNeedAppUser(boolean needAppUser)

AppUser are set to ThreadLocal.

tDeptId("0");

Id("1");

- user.setHeadId("1");

lic void olean needInitLog4j) to set whether to initialize Log4j in the setUp method.

d public void setNeedTransaction(boolean

to set whether to start tran e setUp method.

lic void olean set wheth the tearDown method.

is false, the tearDown method will execute transaction submit.

Use the method public void setCurrentUser(AppUser user) to set up a AppUser anytime during test.

3.4.4.5 pTagTestCase

protected voi Mock object of

3.4.4.6 kWebTestCase

r objects, Mo st, sponse, and M to simulate

the real ServletContext.

.4.4.7 How to Use StrutsActionTestCase

StrutsActionTestCase inherits MockWebTestCase. In the setUp method, two Mock objects ActionMapping and ActionForm,

according to

to set whether to create a AppUser in the setUp method. The following four default attributes for the created

- user.setUserId(0);

- user.se

- user.setOrgan

Use the method pub setNeedInitLog4j(bo

Use the methoneedTransaction) saction in th

Use the method pubneedRollback) to

setNeedRollback(boer to rollback transaction in

If needRollback

How to Use Js

Use the method d initTag(Tag tag) to set the PageContext for Tag object.

How to Use Moc

This class creates fou ckServletContext, MockHttpServletRequeMockHttpServletRe ockHttpSession in the setUp method

3

StrutsActionTestCase createsand also creates the Mock Control objects for the two Mock objects. The Mock objects use Easy Mock. Therefore, the test case should be writtenEasy Mock.

130

Page 135: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.4.8 How to Use MockDataBaseTestCase

six ent,

ResultSet, and TransactionManager, as well as the six Mock Control objects for the can be used to simulate the datasource management

and transaction management frame in Foundation.

Use the method public void setStrict(boolean isStrict) to set whether cts must strictly follow the order.

. . String Resource Maintenance

m

In the setUp method, MockDataBaseTestCase creates the Mock objects for the interfaces: Connection, EBaoDataSource, Statement, PreparedStatem

six interfaces. These objects

the execution of these Mock obje

3 4 5

The procedures for maintaining string resource are as follows:

1 From the main menu, select Test & Debug, eBao Use Module, SysteConfiguration, Basic Data, and then click Resource Table Maintain.

Figure 102 Resource Table Maintain Module

[1] Select the Resource Type from the dropdown list and select Maintain from and the Language Resource Table

displayed.

2 Maintain Resource Table

the Operation Type. Click SubmitMaintenance page will be

F

ta from the dropdown list and enter the optional information such as

String Code or String Content. Click Search and then the search result will be displayed. Click Export Table to export all the table of the search results and save the string resource zip file. Click Export Search Result to export all the search results and save the string resource zip file.

igure 103 Choose Resource and Operation Type

[2] In the Language Resource Table Maintenance page, select the Basic DaTable

131

Page 136: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 104 Language Resource Table Maintenance

Table 26 Description of Fields in the Language Resource Table Maintenance Page

S/N Field Description

1 Basic Code Dealing with the international information data for Table. The message ID of international informatio capitalized by COD_.

n is

2 Web Page Info Dealing with message of common pages. Message ID is capitalized by MSG_.

3 Error Code Particularly dealing with Error Code (T_ERROR_TYPE). ERROR CODE can also be maintained by Basic Code.

4 Maintain Maintaining modification

5 Synchronize Chinese Message

Add information to the resource table.

6 Incomplete String Whether display the non-internationalized records of the current table. If select, the system will set a Message ID for those non-internationalized records of the current table.

7 Fuzz Search Whether conduct fuzzy search.

3 Add information.

[1] Select the Resource Type from the dropdown list and select Synchronize Chinese Message from the Operation Type. Click Submit and Add Information page will be displayed.

132

Page 137: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 105 Add Information

[2] Select the Resource Type from the drop down list and click Submit. The information will be added to the resource table.

Note: If the message entered already exists in the database, the system will inform you that the content has been existed and the message ID of the message will be provided.

3.4.6 er Definition

sign dation. The co d in two tables, T_PARA_DEF and T_ T_PARA_DEF: define comm

mon paramparameter is related to organization/department/date or related to nothing. If this

ram d to organizat T_PARA_VALUE. If this parameter is not related to racts the parameter from the SINGLE_ _DEF.

T_PARA_VALUE: save the d nt/date.

3.4.6.1 ing New

1 From the main menu, click TeConfiguration, Basic Data and click define.

4 The end.

Paramet

Common parameters are used to setup some comprehensive parameter information de ed by iFoun nfiguration of common parameters is complete

PARA_VALUE. on parameters.

The definition of a com eter includes the definition of whether this

pa eter is relate ion/department/date, it is saved in organization/department/date, the system extPARA_VALUE of T_PARA

ata related to organization/departme

Procedures for Perform Parameter Definition

st & Debug, eBao Use Module, System new para

133

Page 138: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

F

2 Cho ameter on the right page

igure 106 New Parameter Define Module

ose a classification in the left tree, click Add Par

Figure 107 Add Parameter (1)

3 Enter detailed parameter information on the right top page and click Save. If the parameter is related to organization, department or time, tick related check box and do not set single value.

134

Page 139: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 108 Add Parameter (2)

4 If the parameter is related to organization, department or time, add parameter value in the right below page.

Figure 109 Add Parameter (3)

5 Return to the main page and clear cache to get immediate effect.

6 The end.

3.4.6.2 Common Para Java API

iFoundation provides API query for common parameters, com.ebao.pub.para.Para type.

For factor related parameter: com.ebao.foundation.module.para.Para.getParaValue (long pParaId, Object pOrganId, Object pDeptId, java.util.Date pDate)

3.4.7 Module Definition

iFoundation provides module management through UI.

1 From the main menu, select Test&Debug, eBao Use Module, System Config, Basic Data, and then click Module Mgmt.

Get parameter value of For factor unrelated parameter: com.ebao.foundation.module.para.Para.getParaValue(long pParaId)

135

Page 140: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Figure 110 Module Management

2 Select a module from the left pane and the module management page is displayed in the right pane.

DefaultURL: module entry URL. Area in blue circle: all Action .do contained in the current module “Add URL” button: add Action.do in the current module. “Delete URL” button: delete Action.do in the current module. “Add Sub-Module” button: add sub-module

Figure 111 Module Management Page

module, click Add Sub-Module, and set Parent 3 To add a sub-module under a Module Id to 0.

Figure 112 Add Sub-Module

4 The end.

136

Page 141: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.8 Theme Management and Customized Pages

3.4.8.1 Overview

Customized pages are configured through CustomPagesConfig.properties(.XXX).

es:

3.4.8.2

TITLEBAR=yes/no

3.4.8.3 Custom Page File key for page top jpg

PAGE_TOP=/foundation/special/eBao/pageTop_eBao.jsp

key for page bottom jpg

PAGE_BOTTOM=/foundation/special/eBao/pageBottom_eBao.jsp

key for page main page jsp

ao/main_eBao.jsp

LOGIN_PAGE=/foundation/special/eBao/login_eBao.jsp

ACCESS_DENY_PAGE=/foundation/special/eBao/accessDeny_eBao.jsp

CHANGE_PASSWORD_PAGE=/foundation/sys/sysmgmt/EnforceChangePwdEntry.jsp

3.4.8.4

roperties (provided by iFoundation and cannot be modified) and css-config.properties(.xxx) are generated by project. xxx is company name, defined by customer.company.name in config.properites.xxx.

Description of configuration file:

iFoundation supports the following typ

Custom Window

Configure IE page style. MENUBAR=yes/no TOOLBAR=yes/no LOCATION=yes/no

MAIN_PAGE=/foundation/special/eB

Security jsp configuration

Custom CSS

The css-config.p

137

Page 142: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

MAIN_XXX(XXX is LANUAGE ID)= define the uri (excluding contextpath) of the main css used in the language id. For example, MAIN_011=/pub/main_en.css. In the English environment, the uri

css file is /pub/main_en.css. MENU_XXX(XXX is LANUAGE_ID)= define the uri (excluding contextpath) of

enu_cn.css. In the Chinese environment, /menu_cn.css. ss uri. In a certain language id, if the css

file does not define the main css, use the default main css uri to define N_CSS. U_CSS= default menu css uri. In a certain language id, if the

e the menu css, use the default menu css uri to define S.

3.4.9

Users may encounter difficulties when they use the system. Help Documents are rs to refer to. The procedures are as follows:

click the question mark above the menu.

of main

the menu css used in the language id. For example, MENU_211=/sys/menu/mthe uri of menu css file is /sys/menu

DEFAULT_MAIN_CSS= default main c

DEFAULT_MAI DEFAULT_MEN

css file does not definDEFAULT_MENU_CS

Help Framework

provided for the use

1 In the user interface,

Figure 113

d on the right part of the page.

View Help Document

2 Select the information you want to know from the left panel, and then the relevant user manual will be displaye

138

Page 143: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Figure 114 Online Help Module

3.4.10 EMS

3.4.10.1 Prerequisites for EMS IDE Setup

Preparing Eclipse SDK

Because of EMS IDE display as Eclipse plug-in manner, user need set up Eclipse SDK v3.2 (or upwards version). Eclipse SDK can be downloaded from www.eclipse.org

3 The end.

.

Required third part Eclipse plug-in

User needs to set up Eclipse plug-in GEF v3.2 (or upwards version). GEF can be downloaded from www.eclipse.org/gef.

luding Foundation Biztypes

ry. prepare

database that includes business data dictionary (schema).

Required JDK Version

JDK1.5 (or upwards version) is required to run Eclipse.

Providing a database schema inc

The data types used in EMS are all from foundation business data dictionaBecause these data types are stored in database, EMS IDE user need

139

Page 144: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.4.10.2 EMS Metadata Structure

The section introduces EMS Metadata structure.

3.4.10.2.1 Biz-Type

BizType is data type in business data dictionary, not part of EMS Metadata.

3.4.10.2.2 Composite-Property

CompositeProperty is used to describe a group of property aggregate that can be reused in Entity.

CompositeProperty just includes property’s logic information, not including property’s permanence of information.

by user. It is also imported from external.

iteProperty, relationships such as correlate and reference are not supported.

SubProperty

siteProperty. One CompositeProperty include

3.4.10.2.3 Ent

ntity is created by EMS and permanence of data entity.

mation, but also includes business operation.

Uniquely identifier of business objects. Generally, Id is displayed by number, no

e

Property

perty. It includes not only logic information, but also ion.

Component

The reference of Entity to CompositeProperty is called Component.

CompositeProperty can be created

Among Compos

SubProperty is a property in Compo1…* SubProperty.

ity

E

Entity not only includes data entity infor

Id

business meaning.

Generally, Entity uses single and unique identifier (Single Id), but it also can us(Composite Id).

Property is an Entity Propermanence of informat

140

Page 145: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Component just includes persistent information. Its logic information is decided by CompositeProperty that it refers to.

In Component, there is 1…* RefProperty and CompositeProperty corresponding to SubProperty. RefProperty just includes property’s persistent information.

Biz Method

Biz Method is business operation of Entity.

Java type directly instead of BizType.

3.4.10.2.4

ce

ionship.

ationship. It is stronger reference relationship in logic sense; it means the end of the life cycle of Entity composite cannot exceed the life cycle-Entity.

3.4.10.2.5

S IDE Diagram Editor, it is used to support Entity modeling, not part of metadata.

data.

Note

ect a Note and an Entity or CompositeProperty, and display object of Note auxiliary information description. Note Link is not part

ta.

In Biz Method, use

Relation

This section introduces the relationship between entities.

Inheritance

Inheritance relationship, only supports single inheritance.

Referen

Reference relat

Composition

Composition rel

Others

Diagram

In EMEMS

Note

Maintain Note in Diagram and provide some auxiliary information. Note is not part of EMS meta

Link

In Diagram, it is used to conn

of EMS metada

141

Page 146: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.4.10.3 EM

The section mainly introduces EMS IDE setup.

.4.10.3.1 Copying Files

Copy EMS release package of documents plug-in directory com .pub.ems.metadata_*.jar and folders com.ebao.pub.ems.generator_* to folder plug-in under eclipse install pat

To upgrade EMS IDE, delete com.ebao.pub.ems.ide_*.jar, .pub.ems.metadata_*.jar and folders

com.ebao.pub.ems.generator_* in plug-in folder under eclipse install path,

3.4.10.3.2 Starting up Eclipse

Before launching Eclipse, you need to use the parameter clean to clear original ion.

For eclipse-SDK-3.2-win32\eclipse>eclipse.exe -clean

is finished, choose Help > About Eclipse SDK > About winIDERef

S IDE Installation

3

.ebao.pub.ems.ide_*.jar, com.ebao

h.

com.ebao

and then copy files.

plug-in configurat

example, D:\eclipse\

After Eclipse launchdow, and click Plug-in Details button. If you find EMS Metadata Plug-in, EMS Plug-in and EMS Generator Plug-in in popup windows, the install is successful. er to snapshot below:

142

Page 147: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.10.4 EMS IDE Preferences

, and select EMS Preferences in popup Preferences dialog box. The corresponding EMS IDE configure item will be displayed in the dialog box.

3.4.10.4.1

In Eclipse, click menu Window > Preferences…

CCP General Setting

Description:

BizType database

If setup error occurs or jdbc driver does not exist, then will pop-up load biztype failure.

In EMS Preference page, do not set up jar path that jdbc driver needs. EMS IDE will find every project’s class path configuration in order in Eclipse workspace at present, trying to find out configured jdbc driver in these project class paths. If not found, the error information no database driver found will be displayed. If several project’s class paths have the same jdbc driver, then use jdbc driver that the first project refers to.

143

Page 148: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

After launching EMS IDE, if a BizType database configuration error occurs, the following dialog box will be displayed. Click Detail to view the cause for error.

3.4.10.4.2 EMS Option

General Tab Page

144

Page 149: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description:

Development Mode: If Core layer development is selected, use core layer development mode; if not selected, use customer layer development mode. If the development mode is changed, the EMS metadata needs to be reloaded (refresh action).

BizType Tab Page

145

Page 150: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Default BizType of Java Type

Used to set the default java type counterparts Biz Type

ng workload of user.

When importing Entity from external, the system will set external Entity Property todefault BizType according to property’s javaType in Entity Class’s property, thus decreasi

Meta Tab Page

146

Page 151: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description:

Set extension attribute.

Set Entity, Relation, and Property extension attribute information.

When selecting metadata such as Entity, Relation, or Property Properties, user can

ibute from external, or export exist extension attribute to external.

Generator Tab Page

set attribute value directly for extension attribute.

User can import extension attr

147

Page 152: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Description: ta coverts export

presents Integer less than 9 digits,

proxy interface: When EMS metadata converts export, Entity module is Interface + Implementation class module.

3.4.10.5 EMS IDE Function Description

EMS IDE is a perspective view in Eclipse. It uses the same Eclipse project as other Eclipse develop tools. It is user-friendly for the integration of EMS modeling and conversion.

Generate audit columns: Create audit field when EMS metadahbm, sql. Default audit fields include insertTime, updateTime, recorderId, updaterId and version.

Support Integer type: Use java.lang. Integer rewhen EMS metadata converts export java. If not selected, all integers are represented by java.lang.Long.

Support

148

Page 153: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.10.5.1 EMS IDE Perspective

3.4.10.5.1.1 EMS IDE Overview

Description: Metadata Navigator: Show all EMS metadata at present. Diagram Editor: Show metadata in diagram a present. One metadata can

display several diagrams and different diagram can have different format.

gator rties of metadata will be displayed in Property

Outline View: Show Thumbnails of diagram at present. Propertysheet Page: When user selects one of metadata in Metadata Navi

or diagram, corresponding propesheet page. User can modify metadata property directly in Propertysheet.

EMS Menu/Tool bar

3.4.10.5.1.2 Operating Procedure

1 In Eclipse, select Window and Open Perspective, and then click EMS IDE. If EMS IDE is not displayed, click Other… to find it out.

149

Page 154: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

2 The Open Perspective page is displayed. Select EMS IDE and click OK. Eclipse will open EMS IDE perspective.

3 The end.

150

Page 155: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.10.5.2 Meta Navigator

3.4.10.5.2.1 Overview

3.4.10.5.2.2 Toolbar

Add child node for selected node

Delete selected node

Refresh/Reload node, just refresh all module under one project or all Entity under one module

Synchronization nodes. CompositeProperty/Entity import from external can pdate latest change for the metadata by Synchronization function. u

Export java, class, hbm, sql script that convert from metadata selected

Note: If a button becomes gray when you select a node in metadata tree, it means the

data does not support the operation.

151

Page 156: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

When you add a child node under the selected node, a dialog box will be displayed for you to input mandatory information.

3.4.10.5.2.3 Metadata Icons

Eclipse Project

EMS Module

Composite-Property

EMS Entity, B->A means Entity B Inherited from A

Biz Method

Single Id property of Entity

Composite Id property of Entity (Not recommended)

Property of Entity or Component

Component of Entity

, , Navigation between entities is available. “1-1” represents one-to-one relationship; “1-N” represents one-to-many relationship; “N-1” represents many-to-one relationship. For example, one policy corresponds to multiple parties, and a policy can navigate to its corresponding parties.

, , Navigation between entities is unavailable (related Entity can navigate to current BO). “1-1” represents one-to-one relationship; “1-N” represents one-to-many relationship; “N-1” represents many-to-one relationship. For example, multiple

rrespond to one policy, but the parties cannot navigate to their ding policy.

parties cocorrespon

Biz-Method of Entity

Meta Diagram aid Entity modeling

3.4.10.5.2.4 peration Add Child O

Select a node in MetaNavigator, and click in toolbar to add child node. Thensystem will popup dialogue window according to corresponding selec

ted node for

user to input new child node information.

Add child for Eclipse project

1 Select an Eclipse Project in MetaNavigator, and click button on toolbar (or popup menu).

2 Input information in the popup dialogue box:

152

Page 157: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Domain Name: Specified domain that the module belongs to. Select one from th d

ts to java Pure Meta Driven, you need not enter the package name.

Pure Meta Driven: Indicate whether the module uses Meta Driven. Meta Driven Entity, ID, Property, and Reference. There are extension

attributes in Properties sheet when Pure Meta Driven. Metadata information can

Description:

e rop-down list. Module Name: Specified module, relationship of module and domain is stored in

database. Select one from the drop-down list. Package Name: Corresponding java package when metadata conver

code. If you select

just has 4 metadata:

be extended in it.

153

Page 158: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

When creating a module, the folder with the same name under Eclipse Project root path will be created. If the folder already exists, the module will not be created. The following figure shows the EMS Module file in Eclipse Resource Navigator.

154

Page 159: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3 The end.

Add child for EMS module

1 Select a module in MetaNavigator, and click button on toolbar (or popup menu). If the button is disabled, click icon before . This is because metadata in module is delay loading, only metada aded when expanding node.

2 Enter information in popup dialogue window.

ta will be lo

155

Page 160: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Description: Child Type: Diagram or Entity Child Name: Corresponding Module child node name Diagram is not a part of EMS Metadata. It is used to support modeling Entity.

There is no difference between the core layer and customer layer.

3 The end.

Add child for entity

1 Select an Entity in MetaNavigator, and click button on toolbar (or popup menu).

ation on popup dialogue window.

2 Enter inform

156

Page 161: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description: Property Type: Id Property, Property, Component, Reference Relation, or

BizMethod Child Name:

when Entity Child name when new child node is Entity child (or refer name

called) If added node is Reference, default current Entity can navigate to the referred

d when core development belongs to core layer; others

Add child for CompositeProperty

1 Select a CompositeProperty in MetaNavigator, and click button

Entity. Child node is adde

belong to customer layer.

3 The end.

in toolbar (or popup menu).

2 Enter information on popup dialogue window.

157

Page 162: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Description: Property Name: Name of New child Node when it is SubProperty of

eProperty.

stomer layer.

3.4.10.5.2.5

teProperty from external, can use CompositeProperty for Component way in Entity, then the Component is external Component.

MetaNavigator, and select Import and

Composit Child node is added when core development belongs to core layer; others

belong to cu

3 The end.

Im ration

Import CompositeProperty

port Ope

Import Composi

1 Right-click a module expanded inComposite Property from the popup menu.

158

Page 163: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

2 Select corresponding Java class called from external CompositeProperty.

159

Page 164: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Description: Java Class need in current projects class patch.

3 Configure each property’s information for CompositeProperty.

160

Page 165: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description: BizType is a mandatory item. If EMS Preference has configured corresponding

default BizType of java type, the system will fill up BizType automatically.

Import Interface

Confirm Java Interface for Entity need take effect, it means import business operate aggregate that Entity need take effect.

1 Right-click an Entity in MetaNavigator, and click Import and Interface in popup menu.

4 The end.

161

Page 166: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

ace that need take effect in popup window, and the system will list in interface.

2 Select Interfthe method

162

Page 167: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description: User can configure method’s display name and parameters’ information.

3 Select parameters in method. Click button “…” and set parameter information in popup window.

Java Interface need in class path of current project.

163

Page 168: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

4 The end.

Import Entity

dule

1 Right-click a project in MetaNavigator, and click Import and Entity in popup

Import external Entity, Java package for the unit to import, organize a new Mowith import Entity.

menu.

164

Page 169: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

2 Set module name and import java package in popup window.

165

Page 170: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Description: Java Package need in class path of current project.

3 If Entity is imported with the form of java interface, you need to manually confirm the corresponding Entity’s parent.

Description: If Entity imported is java class or has no parent interface, the page will not be

displayed. Double-clicking the name column title can sort the grid data by ascending,

descending, or default order.

4 Select Entity that needs import.

166

Page 171: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description: Double-clicking the importable class, CompositeProperty grid title, can sort the

grid data by ascending, descending, or default order. Click checkbox at first time, after double-click Entity line, and go to Entity detail

configuration page. Click the button Finish, and the system will validate the configured data. If any

nd, you need to modify data to finish the import Entity process.

error is fou

167

Page 172: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

5 Configure detail information of Entity imported.

Description: Import Type: Select an import class: Entity or CompositeProperty.

168

Page 173: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Properties: Configure property information of Entity/CompositeProperty. Name: Property’s name in java class, also is metadata name after imported,

cannot be modified. Display name: display name after metadata import, cannot be modified. Id: whether current property is ID, can be modified. Java type: Property’s data type in java class, cannot be modified. Biz type: Business data type after imported can modify. If corresponding default

bizType of java type has configured in EMS Preference, system will fill in default BizType automatically.

Double-clicking the name, java type, or id grid title can sort the grid data by ascending, descending, or default order.

Components/References: Set information of Entity reference to Entity or Composite. The grid is disabled when Import type is CompositeProperty.

t be modified. Java type: java class that be referenced, cannot be modified. Ref class: when type of java class referenced is aggregate, user need choose

actual ref class. It can be modified when java type is aggregate. Ref type: Invoke java type approach, values are: ignore/component/relation. ignore: ignore current reference. component: Refer to the reference class by Component method. Corresponding

java type must be CompositeProperty. relation: Refer to the reference class by relation method. If java type is

aggregate, refer to the reference class with 1:0..* method, otherwise reference with 1:0..1.

Double-clicking the name or grid title can sort the grid data by ascending, descending, or default order.

Biz Methods: Set Corresponding information of Biz method. The grid cannot be modified if import type is CompositeProperty.

Method name: method name in Java class, it is also business method name, cannot be modified.

Display name: Display name after business method imported, can be modified. Return type: return type of business method, cannot be modified. Parameters: Parameter information of business method. Parameter name and

description can be modified; parameter type cannot be modified.

Double-clicking the name or grid title can sort the grid data by ascending, descending, or default order.

6 The end.

3.4.10.5.2.6 Synchronize Operation

For the CompositeProperty and Entity imported from external, if the java class used for import has changed, you need to update latest change to EMS metadata with Synchronize operation.

Outer CompositeProperty

Ref name: Reference name in java class, canno

Synchronize

169

Page 174: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

1 Select a CompositeProperty in MetaNavigator. If the CompositepProperty is p

lick mouse. Click Synchronize. imported from external, the sub-menu “Synchronize” will be displayed in popumenu after you right c

ynchronize the outer composite property. 2 Confirm whether to s

3 System synchronizes latest update of java class.

170

Page 175: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

4 The end.

Synchronize Outer Entity

1 Right-click a module imported from external in MetaNavigator, and click Synchronize from the shortcut menu.

171

Page 176: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Description: ta Entity, CompositeProperty under EMS Module is delay loading.

To avoiding data error when synchronizing, the Synchronize menu will not be d in Module. Click “+” before Module to

d node.

ule.

The metada

displayed before child node is loadetrigger the loading of chil

2 Confirm whether to synchronize the mod

3 If Entity is synchronized with java interface method, the page for manually confirming corresponding Parent of Entity will be displayed; otherwise, the Configure Entity page will be displayed.

172

Page 177: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description: User can add, delete, and modify Entity and corresponding information imported.

3.4.10.5.2.7 Edit Method Body Operation

1 Select an Entity in MetaNavigator, if Entity has editable Biz Method, sub-menu Edit Methods will display on pop-up menu after right click. Click Edit Methods sub menu.

4 The end.

173

Page 178: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

2 Set file path save method script temporarily.

3 Edit Method script.

174

Page 179: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description: Use Java Editor that Eclipse build-in to edit method script. When user saves files, method script will be synchronized to metadata. Biz method that user added or deleted in editor will not synchronize to metadata. User modify biz method name will lead to synchronize fail. Method parameter name user modified can synchronize to metadata.

same time.

4 System writes method script to metadata after user saves method script edited, user can select biz method node edited in MetaNavigator and check the method body in Property sheet page.

Edit one Entity’s biz methods one time at the

175

Page 180: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

5 The end.

176

Page 181: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.10.5.3 Diagram Editor

3.4.10.5.3.1 Overview

3.4.10.5.3.2 Editor Palette

177

Page 182: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Icon description:

Note: add a comment in diagram, not a part of metadata

Note Link: Connect Note and Entity/CompositeProperty in diagram, not a part of metadata

CompositeProperty: Create a CompositeProperty in diagram, MetaNavigator will management the new CompositeProperty.

Sub Property: Create a Sub Property for CompositeProperty in diagram.

Entity: Create a Entity in diagram, MetaNavigator will management the new Entity

Id: Create a Single Id Property for Entity in diagram

Composite Id: Create a Composite Id Property for Entity in diagram

Property: Create a Property for Entity or Component in diagram

Component: Create a Component for Entity in diagram

Biz Method: Create a Biz Method for Entity in diagram

Inheritance: Create Inheritance relationship between two entities in diagram.

Reference/Ct

omposition: Create Reference/Composition relationship between iagram

3.4.10.5.3.3 Toolbar

After open the diagram Editor, corresponding operator button will be displayed in toolbar:

wo entities in d

Button description:

: undo/redo button

: Three vertical alignment modes. Selection of two or more than two nodes is enabled in diagram.

: Three alignment modes. Selection of two or more than two nodes is enabled in diagram.

178

Page 183: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

: Set width and height. Selection of two or more than two nodes is enabled in diagram.

: On the diagram to zoom

: Export diagram to picture.

3.4.10.5.3.4 O

D

utline View

isplay thumbnails or metadata of current diagram.

3.4.10.5.3.5

gram editor

le click diagram node in MetaNavigator, and the system will open corresponding Diagram Editor of diagram node.

3 The end.

1 Open a diagram.

2 Dra e relation from MetaNavigator to diagram:

Operation Description

Open dia

1 Add a diagram node in MetaNavigator.

2 Doub

Drag Metadata from MetaNavigator and drop into diagram

g Entity or Referenc

179

Page 184: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Description: Entity/Reference Relation under a Module can be dragged to the diagram in the

same module.

[2] Select Note, CompositeProperty or Entity on palette.

Note, perty or Entity in diagram.

3 The end.

Add Metadata

1 Add diagram node.

[1] Open a diagram.

[3] Click in the space of diagram, and the system will createCompositePro

180

Page 185: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Description: If new metadata is CompositeProperty or Entity, the system will name the new

utomatically.

2 Add sub property of CompositeProperty.

siteProperty in diagram.

d the

metadata a

[1] Create a Compo

[2] Select Sub Property in palette.

[3] Click CompositeProperty icon that need SubProperty addition, ansystem will create corresponding child node.

181

Page 186: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3 Add entity child.

[1] Create one Entity in diagram.

[2] Select Id Property/Property/Component in Palette.

] Click Entity icon that need child node addition, and the system will create ponding child node.

[3corres

Description: System will name the new node automatically.

182

Page 187: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

When adding Component, Component will reference a CompositeProperty automatically. User can modify Property’s data persistent information of the referenced CompositeProperty or Component, but cannot add or delete property in Component.

4 Create link.

[1] Create two entities in Diagram. If you create Note Link, an Entity (or CompositeProperty) and a Note are needed.

[2] Select Note Link/Inheritance/Reference/Component in Palette.

[3] Click begin Node Entity (also can be Note if you create Note). Click end node Entity (or Note). The system will create link between two nodes automatically to show connection. If user creates Inheritance/Reference/Component, the system will display new relationship in MetaNavigator.

self reference can be created in one Entity. is Entity.

Delete Metadata

1 Delete Note/Note Link/Id Property/Property/Component/Inheritance.

[1] Select metadata node that need to be deleted, and click Delete.

[2] If Delete is disabled, the node cannot be deleted. For example, the core layer metadata when customer development cannot be deleted.

[3] You can also use shortcut menu Delete to delete metadata selected.

Description: If it is Reference, NoteLink’s a point is Note, another NoteLink is not a part of Metadata.

5 The end.

2 Delete Entity/Reference Relation.

183

Page 188: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

If user does not deleted access (delete core layer metadata when customer development) but only deletes metadata in diagram, metadata still exist in MetaNavigator. If user deletes access, a dialog box will be displayed:

Descrip Del Metadata still exists in

Met Delete Object: Delete metadata directly.

.

Move mouse to another link port to display the “+” icon. Click and drag link need reconnect’s port (Entity or Note).

e).

4 Loose mouse and the system will reconnect the link.

5 The end.

When set connection router’s property to Manual in diagram, you can add or delete curve port for corresponding link NoteLink/Inheritance/Reference/Composition.

tion: ete symbol only: Delete metadata in diagram only. aNavigator.

3 The end.

Reconnect link

1 Select a link

2selected to the port that

3 If there is still a “+” icon, it means can reconnect to the port (Entity or Not

Create/Delete Bendpoint of link

1 Select a link.

r curve port, mouse will become a“ ”, click 2 Move mouse to the middle of line oand drag the link.

184

Page 189: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3 Loosen mouse, system will add/delete curve port automatically. Correspochange will be stored in diagram, but there is no impact in metadata.

4 The end.

nding

Change Format

When selecting Note, Entity, NoteLink, Inheritance, or ReferenceRelation in diagram, you can change format below diagram category of PropertySheet. The format changed in a Diagram takes effect for the diagram only.

ation

modifying metadata in diagram, user can use button

Undo/Redo Oper

After selecting and on

etaNavigator do

as Image (Document Support)

you need to export modeling result created in diagram to part of document, do as llows:

mat file.

2 Copy diagram (figures) to clipboard.

Select one or more than one Note, Entity, NoteLink, Inheritance, or ReferenceRelation, use shortcut Ctrl+C, or through menu Edit > Copy to copy metadata selected to system clipboard with image format. User can paste image (Ctrl+V) to word or other program.

, function that metadata image copy to system clipboard just can

toolbar, or use menu Edit > Undo/Edit > Redo to undo/redo operation.

Note: At present, the selection and modification of metadata in Mnot support the Undo/Redo function.

Export Diagram

Iffo

1 Export to Image

Open a diagram, and click menu CCP > Export to Image to save the diagram as an image file. At present, diagram can be exported to a jpg, bmp, png for

Note: At presentbe used in windows.

3 The end.

185

Page 190: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.4.10.5.4

ule, ole Module, if it is a BO, generate the BO and corresponding related

Entity.

Transfer Metadata into Artifacts

1 Select a Module or Entity in MetaNavigator. If metadata selected is Modgenerate wh

2 Click button on MetaNavigator toolbar, set generate information in pop-up dialogue:

Description: Output Path: Save path of generated result, able to generate output hbm/java

rate test code: Generate junit test code to check whether the generated

Compile java code: Compile java code. n configure

4 The

(pojo and java doc)/create table sql. Clean before generating the artifacts: Clean output path before generating artifacts. Generesult is the same as metadata.

Run test case: If test code and compile code are generated, user casystem to run the test code automatically. Generate drop sql: Add drop db statement to sql script generated.

3 After configuration is finished, click button Finish.

end.

186

Page 191: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.10.5.5 Core/Custom Layer

3.4.10.5.5.1

core development mode is the core layer; metadata created in customer development mode is the customer layer. Core layer metadata cannot be deleted during customer development. The core layer metadata such as display name secondary information can be modified.

Metadata of core layer and customer layer is stored in different folders: During core layer development, metadata file naming rule is Entity name plus

suffix .core. For example, Role as metadata file in core development name is Role.core.ems.

During customer layer development, metadata file naming rule is Entity name plus suffix .cust. For example, Role as metadata file in core development name is Role.cust.ems

In an example of documents in Eclipse:

Overview

Metadata Entity (and corresponding child node), Inheritance Relation, Reference Relation are separate from core layer and customer layer (also called extension layer, Customization layer). Metadata created in

3.4.10.5.5.2

data of Entity and Relation always have

nsolidates them into one metadata.

changed to the corresponding folder.

Merge Core/Custom Layer Metadata

During development in customer layer, metatwo parts. When EMS IDE loads metadata, it reads core layer metadata firstly, customer layer metadata secondly, and then co

When system stores metadata, according to development layer, it saves metadata

187

Page 192: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

3.4.10.5.5.3 Release/Upgrade Core Layer Metadata

It is necessary to release EMS metadata and generate file java/hbm/sql script to r user to perform extension development when core layer development

is finished.

ith script.

3.4.10.5.5.4

tadata that develops during customer layer, system will add

3.4.10.5.6

3.4.10.5.6.1 Overview

When creating a module, you can decide whether the module uses Meta Driven or not. EMS metadata takes effect immediately when run Meta Driven, and there is no need to generate Java code, hbm, or sql script operator, and metadata can extend at the same time.

If a module uses Meta Driven, the module name will be add [Meta Driven] in EMS IDE, e.g. New Business [Meta Driven]

.4.10.5.6.2 Meta Data Type in Meta Driven

Meta Driven has four kinds of Meta Data: Entity, ID, Property, and Reference. Page display is as follows:

customer fo

Re-generate java/hbm/sql script after user extension development metadata. Newoutput file will include all files in core layer and customer layer.

After Core layer data upgrade, customer need to cover old core layer metadata wnew, consolidate customer layer data, and re-generate new java/hbm/sql

Avoid Naming Conflict

For the customer mesuffix ‘_e’ after metadata name to avoid naming conflict after core layer metadata upgrade.

Meta Driven

3

188

Page 193: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Extension3.4.10.5.6.3 Attribute in Meta Driven

of Entity, Property, and Reference can be extended.

1 Select a Meta (Entity, Property, Reference).

xtension Attribute.

Only metadata

2 Select E

Entity:

Property:

189

Page 194: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Reference:

3 Click Button “…”

The initial configure extension information in Preference will be displayed. You can

click to add new extension information, or click to delete selected extension information (extension info e deleted).

Click

rmation set in Preference cannot b

to refresh.

190

Page 195: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

4 Enter value and click Finish.

191

Page 196: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

5 The end.

192

Page 197: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

3.4.10.5.7 Version Control and Team Work

3.4.10.5.7.1 Version Control

EMS IDE does not include the metadata version control function, but metadata is stored as files, so user can use third version control management tools (e.g. CC/CQ, CVS, Source safe) to control version of metadata files.

3.4.10.5.7.2 Team Work

To confirm that all team members use the same metadata during Team work, it is necessary to use version control tool to manage all EMS modules. An EMS module includes .emsflag, *.diagram,*.core.ems,*.cust.ems files. *.diagram: EMS module image store file *.core.ems: core layer metadata file *.cust.ems: customization layer metadata file

Use Resource Navigator

Use menu Window > Show View > Navigator Open Navigator. Select EMS Module ( ModuleName[EMS Meta Module]).

Use version control tool management all folder.

193

Page 198: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

Change Package Explorer Configuration

Use menu Window > Show View > Package Explorer to open Package Explorer. s In Explorer Tool menu, select Filter…. Set *.resource file in popup dialogue box a

follows:

194

Page 199: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Functionalities of iFoundation

Then the file .emsflag will appear in package explorer view:

195

Page 200: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

196

Page 201: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Glossary

4 Glossary AOP

Aspect-Oriented Programming

API

Application Programming Interface

BO

Business Object

CCP

Common Calculation Platform

CSS

Cascading Style Sheets

DBean

Database Bean

EMS

Entity Management System

ESB

Enterprise Service Bus

FMS

Formula Management System

iCP

Insurance Common Platform

IOC

Inversion of Control

jBPM

A workflow engine written in Java that can execute processes described in BPEL or its own process definition language jPDL. It is released under the LGPL license.

197

Page 202: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

JDBC

Java Naming and Directory Interface

An open source Java implementation of the Universal Description, Discovery, and cification for Web Services

hine

Protocol, an application protocol for querying and over TCP/IP

ement System

Java Database Connectivity

JDK

Java Development Kit

JNDI

JSP

Java Server Pages

JTA

Java Transaction API

jUDDI

Integration (UDDI v3) spe

JVM

Java Virtual Mac

LDAP

Lightweight Directory Accessmodifying directory services running

LOG4J

A Java-based logging utility

ORM

Object-Relational Mapping

RMS

Rule Manag

XMS

Extension Management System

UI

User Interface

198

Page 203: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

Glossary

UIC

User Interface Configuration

URL

Uniform Resource Locator

199

Page 204: iFoundation Developer Guide - eBaoTech...iFoundation provides runtime engine, common utilities, frameworks, component libraries and some UI for system management. The main target of

iFoundation Developer Guide

5 Reference

None

200