You are on page 1of 43

iD 实践文档

文档编号:EZ-ID-006
文档版本号:ID-006-1.0  
文档名称:实施人员环境架构说明及维护手册  
 
 
 
 
 

ID 实践文档  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

北京易知信息技术有限公司  
2015 年 12 月 11 日  
 
 
 
 
 

1  
北京易知信息技术有限公司  
iD 实践文档  

目         录  
1   文档说明  ...........................................................................................................................  1  
1.1   术语、定义、缩略语  ..................................................................................................  1  
1.2   修改记录  ......................................................................................................................  1  
2   系统安装  ...........................................................................................................................  2  
2.1   网络拓扑图  ..................................................................................................................  2  
2.2   环境说明  ......................................................................................................................  3  
2.3   iD 安装部署  ...................................................................................................................  3  
2.3.1   PostgreSQL 数据库安装及配置  ........................................................................  3  
2.3.1.1   RPM 包安装  ..........................................................................................  3  
2.3.1.2   源码包安装  ..........................................................................................  3  
2.3.1.3   Postgresql   启动环境参数设置  ............................................................  4  
2.3.2   数据库初始化  ..................................................................................................  4  
2.3.2.1   数据库创建脚本  ..................................................................................  4  
2.3.2.2   脚本导入  ..............................................................................................  5  
2.3.2.3   数据库升级补丁  ..................................................................................  5  
2.3.3   ID   安装及配置  .................................................................................................  6  
2.3.3.1   ID 安装  ..................................................................................................  6  
2.3.3.2   ID 启动  ..................................................................................................  6  
2.4   集群环境部署  ..............................................................................................................  6  
2.4.1   配置会话数据源  ..............................................................................................  6  
2.4.2   集群会话配置  ..................................................................................................  7  
3   iD 系统定制化  ....................................................................................................................  8  

3.1   iD 权限模型  ...................................................................................................................  8  


3.1.1   角色  ..................................................................................................................  8  
4   iD 功能配置  ........................................................................................................................  9  
4.1   基本表配置流程  ..........................................................................................................  9  
4.1.1   创建表(Table)  ...................................................................................................  9  
4.1.2   创建元素(Element)  .....................................................................................  9  
4.1.3   创建列(Column)  ...............................................................................................  9  
4.1.4   创建窗口(Window)  ....................................................................................  9  
4.1.5   创建页签(Tab)  ............................................................................................  9  
4.1.6   创建引用(Reference)  .......................................................................................  9  
4.1.7   创建校验规则(Validation  Rule)  .......................................................................  9  
4.1.8   创建信息窗口(Info  Window)  .....................................................................  9  
4.2   树形结构配置流程  ......................................................................................................  9  
4.2.1   数据库表中增加树字段  ..................................................................................  9  
4.2.2   在 Window|Tab 中设置树特性  .......................................................................  9  
4.2.3   在对应的实体(Client)创建表对应的树类型;  .......................................  10  
4.2.4   树的关系维护  ................................................................................................  11  
4.2.5   Info 窗口  .........................................................................................................  11  

2  
北京易知信息技术有限公司  
iD 实践文档  

4.2.5.1   默认 Info 窗口分析  ............................................................................  11  


4.2.5.2   自定义 Info 窗口(信息窗口)过程  ................................................  12  
4.2.6   升级策略  ........................................................................................................  12  
4.2.7   汉化  ................................................................................................................  13  
4.2.8   。。。  .................................................................................................................  13  
4.3   页面元素配置  ............................................................................................................  13  
4.3.1   页面按钮配置  ................................................................................................  13  
4.4   数据导入  ....................................................................................................................  13  
4.4.1   单表导入导出  ................................................................................................  13  
4.5   软件包(Packin&PackOut)导入导出  ...........................................................................  13  
4.5.1   导出  ................................................................................................................  14  
5   iD 定制开发  ......................................................................................................................  15  

5.1   开发环境配置  ............................................................................................................  15  


5.1.1   Eclipse 下环境搭建  .........................................................................................  16  
5.2   开发流程  ....................................................................................................................  23  
5.3   组件开发  ....................................................................................................................  23  
5.3.1   ZK  framework 流程  .........................................................................................  23  
5.3.2   单据流程开发  ................................................................................................  24  
5.3.2.1   创建单据模型  ....................................................................................  24  
5.3.2.2   定义窗口  ............................................................................................  24  
5.3.2.3   创建自定义流程  ................................................................................  24  
5.3.2.4   创建 DocType  .....................................................................................  25  
5.3.2.5   配置流程权限  ....................................................................................  25  
5.3.3   Process 开发  ....................................................................................................  25  
5.3.3.1   基于扩展点  ........................................................................................  25  
5.3.3.2   使用 Process  Factory 开发  .................................................................  26  
5.3.3.3   开发 Process 的小技巧  ......................................................................  26  
5.3.4   Form 开发  .......................................................................................................  27  
5.3.4.1   传统方式  ............................................................................................  27  
5.3.4.2   使用 Factory  .......................................................................................  28  
5.3.5   Model 开发  .....................................................................................................  28  
5.3.6   Validation 开发  ...............................................................................................  28  
5.3.7   Callout 开发  ....................................................................................................  28  
5.3.7.2   其他  ....................................................................................................  29  
5.3.8   其他  ................................................................................................................  30  
5.4  ..........................................................................................................................................  30  
6   工作流  .............................................................................................................................  30  
6.1   工作流重要属性  ........................................................................................................  30  
6.2   工作流类型  ................................................................................................................  31  
6.2.1   一般流程  ........................................................................................................  31  
6.2.2   单据流程  ........................................................................................................  31  
6.2.3   记录值流程  ....................................................................................................  31  
7   iD 中一些常用工具类  ......................................................................................................  32  

3  
北京易知信息技术有限公司  
iD 实践文档  

7.1   关键代码位置  ............................................................................................................  32  


7.2   获取持久化对象  ........................................................................................................  32  
7.3   清空表的缓存  ............................................................................................................  35  
7.4   报表或过程调用  ........................................................................................................  35  
7.5   在过程中显示窗口  ....................................................................................................  35  
7.6   自动创建行号  ............................................................................................................  36  
7.7   数据库更新脚本查看  ................................................................................................  37  
7.8   Packout 细节查看  .......................................................................................................  37  
7.9   其他  ............................................................................................................................  37  
8   学校管理平台开发计划  ..................................................................................................  37  

8.1   通用标准使用  ............................................................................................................  37  


8.1.1   EMGI 代码引用  ...............................................................................................  37  
8.1.2   数据项引用  ....................................................................................................  38  
8.1.3   数据子类引用  ................................................................................................  38  
8.1.4   关于扩展教育标准处理  ................................................................................  38  
9   移动化  .............................................................................................................................  38  

10   常见问题处理  ...............................................................................................................  39  

10.1   ID 大小写  ..................................................................................................................  39  


10.2   问题  ..........................................................................................................................  39  
 

 
总页数   43   正文   40   附 录   3   生效日期:2014   年   1   月   10   日  
编制:桂艳峰   审批:桂艳峰

4  
北京易知信息技术有限公司  
iD 实践文档  

   

1 文档说明  

1.1 术语、定义、缩略语  

英文名称   中文名称   备注  
Client   集团、公司企业、学校   iD 支持的  
Org   机构、单位、部门    
Document   单据   具有流程的  
     
     
 

1.2 修改记录  

! 文档修改控制  
 
修改记录编
修改状态   修改页码及条款   修改人   审核人   批准人   修改日期  
号  
             
             

 
 

   

1  
北京易知信息技术有限公司  
iD 实践文档  

2   系统安装  

2.1 网络拓扑图  

外网访问链路

防火墙

双机热备
VIP:136

WEB服务器IP:132 WEB服务器IP:133

172网段 交换机 internal connect

Portal CAS
CAS Portal

CAS和Portal
双机互备
启停 ⽤用系 服 器
学⼯工、 公、⼈人事、 量量

DB数据库服务器 DB数据库服务器
m5000db1 m5000db2

光纤交换机 光纤交换机

存储 存储

2  
北京易知信息技术有限公司  
iD 实践文档  

2.2 环境说明  

推荐:  

IDempiere  3.1  

jdk  1.7.0   以上;  

Postgresql  9.4.1   ;  

2.3 iD 安装部署  

2.3.1 PostgreSQL 数据库安装及配置  

简单采用 yum 即可。  


 

2.3.1.1RPM 包安装  

对应 Cent  OS  6   以上  

#yum  install  readline  readline-­‐devel  zlib  zlib-­‐devel  

#yum   install   postgresql-­‐server   postgresql-­‐contrib  

postgresql-­‐devel  

2.3.1.2源码包安装  

$./configure  -­‐-­‐with-­‐ossp-­‐uuid  -­‐-­‐without-­‐readline  

$make  &&  sudo  make  install  

$cd  contrib  

3  
北京易知信息技术有限公司  
iD 实践文档  

$make  &&  sudo  make  install  

2.3.1.3Postgresql   启动环境参数设置  

#vi  /etc/profile  

PGHOME=/usr/local/pgsql  

PGLIB=${PGHOME}/lib  

PGDATA=$PGHOME/data  

PATH=$PATH:/usr/local/pgsql/bin  

MANPATH=$MANPATH:/usr/local/pgsql/man  

export  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib  

export  PGLIB  PGDATA  PATH  MANPATH  

#useradd  postgres  

#mkdir  /usr/local/pgsql/data  

#chown  -­‐R  postgres  /usr/local/pgsql/data  

#su  -­‐  postgres  

$initdb  

$pg_ctl  start  

2.3.2 数据库初始化  

2.3.2.1数据库创建脚本  

解压缩ID程序包后,

4  
北京易知信息技术有限公司  
iD 实践文档  

$  psql  -­‐U  postgres  -­‐c  "CREATE  ROLE  adempiere  SUPERUSER  

LOGIN  PASSWORD  'adempiere'"  

$  createdb    -­‐-­‐template=template0  -­‐E  UNICODE  -­‐O  adempiere  

-­‐U  adempiere  idempiere  

$  psql  -­‐d  idempiere  -­‐U  adempiere  -­‐c  "ALTER  ROLE  adempiere  

SET  search_path  TO  adempiere,  pg_catalog"  

$  psql  -­‐d  idempiere  -­‐U  adempiere  -­‐c  'CREATE  EXTENSION  

"uuid-­‐ossp"'  
 

2.3.2.2脚本导入  

$cd  /tmp  

$jar  xvf  $IDEMPIERE_REPOSITORY/org.adempiere.server-­‐f

eature/data/seed/Adempiere_pg.jar  

$psql  -­‐d  idempiere  -­‐U  adempiere  -­‐f  Adempiere_pg.dmp  

equals:导入脚本  

$utils/RUN_ImportIdempiere.sh  

2.3.2.3数据库升级补丁  

$migrate_postgresql.sh   [DIRECTORY   ...   DIRECTORY]  

[commit]  

5  
北京易知信息技术有限公司  
iD 实践文档  

2.3.3 ID   安装及配置  

2.3.3.1ID 安装  

$tar  –zxf  idempiere-­‐XX-­‐.tar.gz  

$./setup.sh(或 console-­‐setup-­‐alt.sh)  

2.3.3.2ID 启动  

$./idempiere-­‐server.sh  

2.4 集群环境部署  

据称 terracotta 比 memcache 性 能 更 好 。  

2.4.1 配置会话数据源  
在 JETTY_HOME/etc 目 录 下 找 到 jetty.xml 文 件 。 添 加 如 下 配 置 :

启 动 后 , 会 自 动 创 建 jettysessionids 和 jettysessions 两 张 表 .

?
1   <!-- ===================== session mysql demo ================== -->  
2   <Set  name="sessionIdManager">  
3   <New  id="jdbcidmgr"    
4   class="org.eclipse.jetty.server.session.JDBCSessionIdManager">  
5   <Arg>  
6   <Ref  id="Server"  />  
7   </Arg>  
8   <Set  name="workerName">fred</Set>  
9   <Call  name="setDriverInfo">  
10   <Arg>com.mysql.jdbc.Driver</Arg>  
11   <Arg>jdbc:mysql://127.0.0.1:3306/mydb?user=root&amp;password=123123
12   </Call>  
13   <Set  name="scavengeInterval">60</Set>  
14   </New>  
15   </Set>  
16   <Call  name="setAttribute">  
17   <Arg>jdbcIdMgr</Arg>  

6  
北京易知信息技术有限公司  
iD 实践文档  

18   <Arg>  
19   <Ref  id="jdbcidmgr"  />  
20 </Arg>  
</Call>

2.4.2 集群会话配置  
然 后 ,在 JETTY_HOME/webapps 中 创 建 一 个 文 件 夹 ,并 命 名 为 :ROOT。这 个 ROOT 和 t
omcat 中 的 ROOT 是 同 一 回 事 ,将 自 己 的 项 目 复 制 到 该 目 录 下 。并 且 在 项 目 的 WEB-INF 中
新 建 jetty-env.xml,

jetty-env.xml 中 配 置 内 容 如 下 :

?
<!DOCTYPE  Configure PUBLIC "-//Jetty//Configure//EN"
1   "http://www.eclipse.org/jetty/configure.dtd">  
2   <Configure  id="webappContext"  class="org.eclipse.jetty.webapp.WebAppContext">  
3      
4   <Set  name="contextPath">/</Set>  
5      
6   <Get  name="server">  
7   <Get  id="jdbcIdMgr"  name="sessionIdManager"/>  
8   </Get>  
9      
10   <Set  name="sessionHandler">  
11   <New  class="org.eclipse.jetty.server.session.SessionHandler">  
12   <Arg>  
13   <New   id="j
14   class="org.eclipse.jetty.server.session.JDBCSessionManager">  
15   <Set  name="sessionIdManager">  
16   <Ref  id="jdbcIdMgr"/>  
17   </Set>  
18   </New>  
19   </Arg>  
20   </New>  
21 </Set>  
</Configure>

7  
北京易知信息技术有限公司  
iD 实践文档  

3 iD 系统定制化  

3.1 iD 权限模型  

3.1.1 角色  
RoleAccessLevel 角色访问级别(系统|客户|机构)按位保存,分别为  
      *   -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐  
      *   SCO#  Levels       S__  100     4   System  info  
      *             SCO   111     7   System  shared  info  
      *             SC_  110     6   System/Client  info  
      *             _CO  011     3   Client  shared  info  
      *             _C_   010     2   Client  
      *             __O   001     1   Organization  info  
关键属性  
属性名称   含义   举例  
Menu  Tree   角色菜单树    
Org  Tree   组织机构树   AD_Tree_Org_ID  
Use  User  Org  Access   使用用户组织访问,替 IsUseUserOrgAccess(Yes|No)  
代默认的角色组织访问  
Approve  Own  Document   是否允许审核自己的单 IsCanApproveOwnDoc(Y|N)  
据  
Supervisor   主管,用于审核    
Preference  Level     PreferenceType(Client|Nnone|Org|User)  
Show  Accounting   是否可以查看会计信息   IsShowAcct(Yes|No)  
Access  All  Orgs   是否允许访问所有机构   IsAccessAllOrgs(Yes|No)  
Personal  Lock   用户锁定记录,防止其 IsPersonalLock(Yes|No)  
他人查看个人信息  
Personal  Access   允许查看所有个人锁定 IsPersonalAccess(Yes|No)  
的信息  
     
 
其他  

8  
北京易知信息技术有限公司  
iD 实践文档  

4 iD 功能配置  

4.1 基本表配置流程  

4.1.1 创建表(Table)  
4.1.2 创建元素(Element)  
4.1.3 创建列(Column)  
4.1.4 创建窗口(Window)  
4.1.5 创建页签(Tab)  
4.1.6 创建引用(Reference)  
4.1.7 创建校验规则(Validation  Rule)  
4.1.8 创建信息窗口(Info  Window)  

4.2 树形结构配置流程  

4.2.1 数据库表中增加树字段  
l Name 名称,把这个字段替换具体的业务中的名称字段
l Description 描述信息
l isSummary 是否汇总,也是是否有子节点的意思。
 
ALTER   TABLE   adempiere.EMGI_META   ADD   IsSummary   CHAR(1)   DEFAULT   NULL   CHECK  
(IsSummary  IN  ('Y','N'));  
 

4.2.2 在 Window|Tab 中设置树特性  

9  
北京易知信息技术有限公司  
iD 实践文档  

4.2.3 在对应的实体(Client)创建表对应的树类型;  

 
还可以定义通过 Value(查询关键字)组织的树。实现根据 Key 编号自动快速构建树。
(【注】
要求从根节点开始输入树,否则叶子节点显示不正常。)  

10  
北京易知信息技术有限公司  
iD 实践文档  

 
【说明】此处有一点小 bug,需要在设置树的类型时,先选择其他类型,再选择 Custom  Table,
表下拉框才会显示正常的下拉列表。  
【注意】要在添加数据记录之前增加树形定义。  

4.2.4 树的关系维护  
在实体中维护表的关联关系不能保存,只能在树关系中维护?  
如何定义 system 实体的树,其他实体用户直接使用即可?  
树形结构装载语句:  
MTree.LoadNodes(int)  
SELECT   tn.Node_ID,tn.Parent_ID,tn.SeqNo,st.IsActive   FROM   adempiere.EMGI_META   st   LEFT  
OUTER   JOIN   adempiere.AD_TreeNode   tn   ON   (tn.Node_ID=st.EMGI_META_ID)   WHERE  
tn.AD_Tree_ID=1000014   AND   st.AD_Client_ID=0   AND   st.AD_Org_ID=0   AND     (st.EMGI_META_ID  
IS  NULL  OR  st.EMGI_META_ID  NOT  IN  (  SELECT  Record_ID  FROM  adempiere.AD_Private_Access  
WHERE   AD_Table_ID   =   1000002   AND   AD_User_ID   <>   0   AND   IsActive   =   'Y'   ))     ORDER   BY  
COALESCE(tn.Parent_ID,  -­‐1),  tn.SeqNo  

4.2.5 Info 窗口  

4.2.5.1默认 Info 窗口分析  

InfoManager.create(Lookup   lookup,GridField   field,tablename , keyColumn , queryValue ,


multiSelection,whereClause)  
àDefaultInfoFactory.create(lookup,field,tablename,keycolumn,queryValue,multiSelection,
whereClause,AD_InfoWindow_ID)  
ànew  
InfoWindow(windowNo,tablename,keyColumn,value,multiSelection,whereClause,AD_Info
Window_ID,lookup)   或  
new  
InfoGeneralPanel(value,WindowNo,tablename,keyColumn,multiSelection,whereClause,look
up);  
Info 窗 口 是 做 字 段 关 联 时 选 中 检 索 时 显 示 的 窗 口 , 系 统 中 定 义 了 ( 代 码 中 写 死 的
org.adempiere.webui.factoryDefaultInfoFactory 类 ) 9 个 特 殊 Info 窗 口 , 其 他 都 基 于
InfoGeneralPane 构造。  
11  
北京易知信息技术有限公司  
iD 实践文档  

目前 Info 窗口有一些限制:    

§ 每张表最多用于过滤的字段数为: 4
§ 过滤字段由下面的 SQL 决定:

SELECT c.ColumnName, t.AD_Table_ID, t.TableName, c.ColumnSql FROM AD_Table


t INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID) WHERE
c.AD_Reference_ID IN (10,14) AND t.TableName='  EMGI_META ' AND EXISTS
(SELECT * FROM AD_Field f WHERE f.AD_Column_ID=c.AD_Column_ID AND
f.IsDisplayed='Y' AND f.IsEncrypted='N' AND f.ObscureType IS NULL) ORDER BY
c.IsIdentifier DESC, c.AD_Reference_ID, c.SeqNo

§ 显示列由下面的 SQL 决定(标黄色的表 ID 换成实际的表 ID)

SELECT c.ColumnName, c.AD_Reference_ID, c.IsKey, f.IsDisplayed,


c.AD_Reference_Value_ID, c.ColumnSql FROM AD_Column c INNER JOIN AD_Table
t ON (c.AD_Table_ID=t.AD_Table_ID) INNER JOIN AD_Tab tab ON
(t.AD_Window_ID=tab.AD_Window_ID) INNER JOIN AD_Field f ON
(tab.AD_Tab_ID=f.AD_Tab_ID AND f.AD_Column_ID=c.AD_Column_ID) WHERE
t.AD_Table_ID=276 AND (c.IsKey='Y' OR (f.IsEncrypted='N' AND
f.ObscureType IS NULL)) ORDER BY c.IsKey DESC, f.SeqNo

§ 从上面可以看出,当前窗口中如果有两个 tab 都是基于同一张表时,Info 窗口还会出现


重复的字段。

4.2.5.2自定义 Info 窗口(信息窗口)过程  

1. 创建 Info 窗口(Application  Dictionary|  Info  Window),并配置列及翻译。  


【注】默认表别名为 a,需要统一修改成 m,否则可能会导致冲突。  
2. 创建 Reference  Key   ,并制定类型为 T(Table)  
3. 在 Reference  Key 的表配置中,指定 Info 窗口为前述窗口。  

4.2.6 升级策略  
创建 Pack-­‐out,添加导出资源,更新版本(在安装包管理中,显示版本用);  
创建 plugin-­‐project,采用 Incremental2PackActivator(初始包可以用 AdempiereActivator)作
为激活类。将原有安装包改名为 2Pack_1.1.0.zip(后面标黄的为包的版本号),新打出的包
可以依次升级,比如 2Pack_1.1.1.zip(即新服务包的版本)。包的部署可以通过 Web 服务端
口直接完成:(如 http://daemona:9080/osgi/system/console/bundles)。  
【注:】部署包时,为安全起见要先进行数据库的备份(utils/   RUN_DBExport.sh)一定要检
查包中内容的正确性,否则包处于 installing 状态时,进退维谷。  

12  
北京易知信息技术有限公司  
iD 实践文档  

4.2.7 汉化  
https://launchpad.net/aderp 下载中文包,  
用 SuperUser 访问 iDempeire,打开 Language 菜单,把中文 zh_CN 设置成系统语言后,点击
Language  Maintenance 按钮。  
打开 Translation  Import/Export 菜单,点击 Import 按钮后选择下载的语言包文件夹。  
打开 Synchronize  Terminology 菜单,同步信息。  
重新访问系统后即可看到可以使用中文。  
 

4.2.8 。。。  
 

4.3 页面元素配置  

4.3.1 页面按钮配置  
SystemAdmin  Role 登录后,通用配置:àApplication  Directory|Toolbar  Button  
禁用特定页面按钮:àSystem  Admin|General  Rles|Security|Role  Toolbar  Button  Access 中设定
特定窗口、特定 Field 中禁用哪个按钮。  

4.4 数据导入  

4.4.1 单表导入导出  
CSV 格式导入,要求在导入文件首行的关键列后加“/KT”(大写)。导入时,如果出异常则回
滚所有记录。  

4.5 软件包(Packin&PackOut)导入导出  

PackIn  &  PackOut 总体流程:  


在 OSGI   控制台安装,路径为:http://HOSTNAME:PORT/osgi/system/console/bundles  
或者通过命令行登入:$telnet  localhost  12612 即可进入。  

13  
北京易知信息技术有限公司  
iD 实践文档  

4.5.1 导出  
通过 2Pack 可以:  
ü 通过 UUID 实现在数据库之间移动任何业务对象;  
ü 通过表间源 UUID 和新 UUID 实现 Client 间对象移动;  
导出的内容包括:  
ü 可以选择特定日期后修改的对象;  

14  
北京易知信息技术有限公司  
iD 实践文档  

 
ü 未定义对象的类型,可以通过数据类型进行导出  

 
ü 特定表和明细记录可以在对象维护窗口直接导出;  

 
 

5 iD 定制开发  

5.1 开发环境配置  

搭建 3.1 环境,与 zk7 相关的常见问题处理见官网。  


15  
北京易知信息技术有限公司  
iD 实践文档  

5.1.1 Eclipse 下环境搭建    

1. 安装Eclipse 3.7/4.4 R2

2. 安装Mercurial 客户端

3. 获取源码工程
$hg  clone  https://bitbucket.org/idempiere/idempiere  idempiere  

4. 可以在本地先备份idempiere
$hg  clone  ~/opensource/idempiere  idempiere  

5. 运行hg update release-3.1,切换到3.1 release分支。

6. 安装插件MercurialEclipse update

site:http://cbes.javaforge.com/update参照

http://www.javaforge.com/project/HGE

选择安装 MecurialEclipse 包即可  

7. 配置Unicode 打开菜单Eclipse ->> Preferences
 选择

General ->> Workspace,针对右侧的最下方的Text file

encoding选择Other: UTF-8


安装插件 Buckminster(自动构建、组装、部署工

具) http://download.eclipse.org/tools/buckminster/updates

-3.7(或4.4)

ü buckminster core

ü buckminster maven

ü buckminster pde

9. 设置workspace为idempiere的源码目录,配置Plugin

16  
北京易知信息技术有限公司  
iD 实践文档  

² 【注意】必须是检出idempiere的目录,否则

buckmaster导入时会出错!

² 【注意】设置Unicode ,Preference —>

General —>Workspace —> Text file encoding:

Other:UTF-8

10. 设置targetPlatform
l cd workspace/idempiere
l mkdir targetPlatform 


l eclipse->plugin

11. 手动下载jars(可选)

iD3.1之后的版本包往往下载超时,需要手动下载(在有

copyjars.xml的目录中执行)

$ant  –f  copyjars.xml

12. 通过buckminster导入工程

org.adempiere.sdk-feature/adempiere.cquery

13. 调试:修改Run--> Debug Configure -->install.app

(x)Argument:

l change -arch ${target.arch} to -arch x86

l add --launcher.secondThread

14. 修改Run--> Debug Configure --> Server.product (x)

Argument:

-os ${target.os} -arch x86 -nl ${target.nl}

-consoleLog

17  
北京易知信息技术有限公司  
iD 实践文档  

15. Run "install.app" or "install.console.app" to create

Adempiere.properties and tomcat configuration


16. 导入数据库( cd utils) sh RUN_ImportIdempiere.sh

1. 建角色、数据库;

2. #jar
-xf ../../org.adempiere.server-feature/data/se

ed/Adempiere_pg.jar

3. #psql -h daemonA -d idempiere -U adempiere -f

Adempiere_pg.dmp!

4. sql>CREATE EXTENSION “uuid-ossp”;

17. 更新脚本migration下
#./migrate_postgresql.sh i2.1z

commit | psql -U $ADEMPIERE_DB_USER -d $ADEM

PIERE_DB_NAME >

i2.1z.lst 
echo ==== ... Run migration scripts done!
启动

服务端:run configure --> server.product

18. 运行客户端:org.adempiere.ui.swing package and right click

-> run as -> Eclipse application.

2. 建库流程

1. 创建登录用户(adempiere/adempiere)
1.
2. $sudo su - postgres
3. $psql -h localhost -U postgres -c "CREATE
ROLE adempiere SUPERUSER LOGIN PASSWORD
'adempiere'"
4. logout
18  
北京易知信息技术有限公司  
iD 实践文档  

5. 


2. 创建数据库(idempiere)
1. $createdb -h localhost --template=template0
-E UNICODE -O adempiere -U adempiere
idempiere
2. $psql -h localhost -d idempiere -U adempiere
-c "ALTER ROLE adempiere SET search_path
TO adempiere, pg_catalog"
3.
4. 


3. 安装UUID

1. 8.x,9.0

2. 9.1 and above

1. $psql -h localhost -d idempiere -U adempiere

-c 'CREATE EXTENSION "uuid-ossp"'

4. 导入种子

1. 8.x or 9.0

2. 9.1 or higer
1. $cd /tmp
2. $jar xvf
$IDEMPIERE_REPOSITORY/org.adempier
e.server-feature/data/seed/Adempie
re_pg.jar
3. $psql -d idempiere -U adempiere -f
Adempiere_pg.dmp
4.
5. 


5. 应用补丁

1. 当前已打补丁可以通过 select name from

ad_migrationscript order by 1;

19  
北京易知信息技术有限公司  
iD 实践文档  

2. 可打补丁位于migration/i2.1/postgres/*.sql

3. 依次执行补丁目录下的脚本

1. 【注】#./migrate_postgresql.sh i2.1z

commit | psql -U $ADEMPIERE_DB_USER

-d $ADEMPIERE_DB_NAME > i2.1z.lst

2. 实现内部过程为两步:
$cat ~/stone/idempiere/migration/i2.1/postgresql/*.sql |psql -h
localhost -d idempiere -U adempiere
$cat
~/stone/idempiere/migration/processes_post_migration/postgresq
l/*.sql |psql -h localhost -d idempiere -U adempiere

3. Eclipse中运行idempiere

1. MAC 下运行install.app,需要修改:打开(x) Arguments 做如

下修改
-os ${target.os} -arch x86 -nl ${target.nl}

-consoleLog --launcher.secondThread

2. 运行server.p 只需要设定arch 为x86即可;

4. Eclipse 中产品(服务端)打包

1. Right click on org.adempiere.server-feature—>

2. Navigate to Buckminster > Invoke Action… —》

3. On the popup dialog select create.product.zip

4. Fill the box "Properties file" choosing the proper file describing

the target operating system and architecture, for example

browse

to $IDEMPIERE_REPOSITORY/org.adempiere.server-feat

ure and select


20  
北京易知信息技术有限公司  
iD 实践文档  

1. buckminster_linux_gtk_x86_64.properties - to create

installer for linux 64 bits

2. buckminster_linux_gtk_x86.properties - to create

installer for linux 32 bits

3. buckminster_macosx_x86.properties - to create

installer for MAC OS

4. buckminster_win32_x86.properties - to create

installer for Windows 32 bits

5. If your operating system / architecture is not listed,

you can create one, just copy one of those files

above and check its contents and fill it properly

5. Buckminster compile the project

6. At the end you can find the installer file at

$HOME/buckminster.output/org.adempiere.server_2.1

.0-eclipse.feature/idempiereServer.gtk.linux.x86_64.zi

p (or the corresponding name for your OS and

architecture)

7. 【注意】打包Mac版本时,需要修改idempiere-server.sh的

BASE路径;同时采用setup-alt.sh即可;

5. 客户端打包

1. 右键选org.adempiere.ui.swing-feature,其他操作基本同上;


6. Eclipse中打包

21  
北京易知信息技术有限公司  
iD 实践文档  

1. 注意调整~/tmp的目录权限,修改为775,并重置owner ,否

则打包失败。

2. Right click on org.adempiere.server-feature(选

org.adempiere.ui.swing-feature 生成客户端包)

3. Navigate to Buckminster > Invoke Action...

4. On the popup dialog select create.product.zip

5. Fill the box "Properties file" choosing the proper file

describing the target operating system and

architecture, for example browse to

$IDEMPIERE_REPOSITORY/org.adempiere.server-feat

ure and select:

1. buckminster_linux_gtk_x86_64.properties - to create

installer for linux 64 bits

6. 打包好的内容在:

$HOME/buckminster.output/org.adempiere.server_1.0.0-ec

lipse.feature/idempiereServer.gtk.linux.x86_64.zip


7. 开发
 
 

22  
北京易知信息技术有限公司  
iD 实践文档  

5.2 开发流程  

5.3 组件开发  

5.3.1 ZK  framework 流程  
iD 基于 ZK7,处理流程如下:  

23  
北京易知信息技术有限公司  
iD 实践文档  

5.3.2 单据流程开发  

5.3.2.1创建单据模型  

§ Except for the other mandatory fields the model must contain the following fields
§ C_DocType_ID numeric(10,0) NOT NULL DEFAULT 0::numeric (Reference = Table,
Reference Key = C_DocType)
§ C_DocTypeTarget_ID numeric(10,0) NOT NULL DEFAULT 0::numeric
§ DocAction character varying(2) NOT NULL DEFAULT 'CO'::bpchar (Reference = Button,
Process = Custom Workflow, Reference Key = _Document Action)
§ DocStatus character varying(2) NOT NULL DEFAULT 'DR'::character varying (Reference =
List, Reference Key = _Document Status)
§ DocumentNo character varying(30) NOT NULL
§ processed character(1) DEFAULT 'N'::bpchar
§ processing character(1) DEFAULT 'N'::bpchar
§ isapproved character(1) NOT NULL DEFAULT 'Y'::bpchar
 

5.3.2.2定义窗口  

Define the window as you normally do. The following fields must be present to enable the document
workflow.

§ Processed
§ DocStatus, set to "Read Only"
§ DocAction
 

5.3.2.3创建自定义流程  

§ Create Workflow
§ Create Node (DocComplete)

§ Action = Document Action

§ Document Action = Complete


§ Create Node (DocPrepare)

§ Action = Document Action

§ Document Action = Prepare

§ Create Transition. Next Node = (DocComplete)


§ Create Node (Start)
24  
北京易知信息技术有限公司  
iD 实践文档  

§ Action = Wait (Sleep)

§ Create Transition. Next Node = (DocPrepare)


§ Go back to workflow and select Start Node = (Start)
§ Set Workflow Type = Document Process
§ Table = same table as the model.

5.3.2.4创建 DocType  

5.3.2.5配置流程权限  

流程中的角色需要设定访问 DocType 的权限,否则会报“WARNING: Could not

find DocBaseType for **”的错误。  

5.3.3 Process 开发  
一般用于定制化功能处理,  

5.3.3.1基于扩展点  

5.3.3.1.1 创建 plug-­‐in  

5.3.3.1.2 实现过程类  

继承 SvrProcess  

25  
北京易知信息技术有限公司  
iD 实践文档  

5.3.3.1.3 配置扩展点  

 
配置文件如:  

5.3.3.2使用 Process  Factory 开发  

【推荐方案】这是 OSGI 中的推荐做法。  


1、 创建自己的工厂类,扩展 IProcessFactory  
2、 创建组件定义(推荐组件名称直接使用 Factory 类名)  
 

5.3.3.3开发 Process 的小技巧  

5.3.3.3.1 获取用户交互信息  

@Override protected String doIt() throws Exception {


this.processUI.ask("Yes or No?", new Callback<Boolean>() {
public void onCallback(Boolean result) {
addLog("You selected " + (result ? "Yes" : "No"));
}
});

26  
北京易知信息技术有限公司  
iD 实践文档  

return null;
}

5.3.3.3.2 获取用户输入  

processUI.askForInput("Please enter some String", new Callback<String>() {


@Override public void onCallback(String result) {
addLog("You entered: " + result); } });

5.3.3.3.3 等待用户输入  

final StringBuffer answer = new StringBuffer();


final StringBuffer retVal = new StringBuffer();
processUI.askForInput("Please enter some String", new Callback<String>() {
@Override
public void onCallback(String result) {
addLog("You entered: " + result);
retVal.append(result);
answer.append("done");
}
});

while (answer.length() == 0) {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
}
}

5.3.4 Form 开发  

5.3.4.1传统方式  

创建实现类(继承 ADForm),并注册到系统中。  

27  
北京易知信息技术有限公司  
iD 实践文档  

5.3.4.2使用 Factory  

首先在 META-INF 的 Dependencies 中添加必要的插件:

org.adempiere.base

org.adempiere.plugin.utils

org.adempiere.ui.zk

org.zkoss.zk.library

 
创建 Form 实现类,实现接口 IFormController,EventListener<Event>;  
创建 FormFactory,实现接口 IFormFactory;  
创建组件,注意名称一致。  

5.3.5 Model 开发  
自动生成的模型类继承层次:PO (Persistent Object) --> X_<table> classes -->
M<shortTable>

Class X_ is looked up with complete Name (and case) of the table

Class M is looked up with table name without prefix (if prefix is <= 2 char), and without
underscore symbols “_”。

AD_Element - M_Element
AD_Registration – M_Registration
AD_Tree – MTree_Base
R_Category – MRequestCategory
GL_Category – MGLCategory
K_Category – MKCategory
C_ValidCombination – MAccount
C_Phase – MProjectTypePhase
C_Task – MProjectTypeTask

5.3.6 Validation 开发  
5.3.7 Callout 开发  

5.3.7.1.1 使用扩展点  

1) 编写 callout 实现类,实现 IColumnCallout 接口  


28  
北京易知信息技术有限公司  
iD 实践文档  

2) 在 MANIFEST.MF 的 extension 页签中添加扩展点 org.adempiere.base.IColumnCallout  


3) 在上述(2)扩展点下,创建 callout,选中 1 中的实现类。  

5.3.7.1.2 Java 类  

1) 编写 java  callout 实现类,继承父类 CalloutEngine;

§ public String myMethodName(Properties ctx, int WindowNo, GridTab mTab, GridField mField,
Object value)
2) 在 MAINFEST.MF 的 Runtime 页签中添加实现类。
3) 在 MAINFEST.MF 中添加行 Eclipse-­‐Registerbuddy:  org.adempiere.base
 

5.3.7.1.3 使用 CalloutFactory  

【推荐方案】需要实现两个类:一个 Factory 类和一个实现类。  


1) 实现 IColumnCallout 接口  
 
2) 实现 IColumnCalloutFactory  
 
 
3) 创建 OSGI-­‐INF 目录  
4) 创建组件定义(确保名称唯一)  
 
5) 在提供的服务中添加 org.adempiere.base.IColumnCalloutFactory

6) 打包发布服务即可  

5.3.7.2其他  

 
 

29  
北京易知信息技术有限公司  
iD 实践文档  

5.3.8 其他  

5.4  

6 工作流  

6.1 工作流重要属性  

iD 工作流可配置为 BPM 解决方案,包括静态部分和动态部分。  


静态部分包括:  
u 工作流(workflow):任务的流程,即节点和转换;  
u 节点(Node):一项工作;  
u 转换(Transaction):节点间转换的规则;  
动态部分包括:  
u 过程(Process):活动的流程实例;  
u 活动(Activity):活动的节点;  
工作流的状态包括:  
u Not  Started  
u Running  
u Completed  
u Suspended  
u Aborted  
u Terminated  
责任人(Responsibles):在流程级别定义,可以在节点上深入定义。比如可以设定超时提醒
责任人。责任人可以是如下:  
u Human(人):如果没有指定,则为流程的发起人;  
u Organization(组织):即组织的主管  
u Role(角色):具有该角色的用户  
工作流的操作(Action)包括:  
u 应用过程  
u 应用报表  
u 单据操作  
u 邮件  
u 设置变量(设置表中的某列)  
u 用户选择  
u 等待(Sleep)特定时间  
转换设置包括如下:  
u 为空:无条件  
u 通过(Approval)  
u 条件  
30  
北京易知信息技术有限公司  
iD 实践文档  

n AND/OR  
n @Variable@/Constant Operator @Variable@/Constant
u 有多个转换时,根据优先级判断执行;  
u 当有多个转换出口条件满足时  
n XOR  split   (仅执行第一个转换)  
n AND  split   (并行活动)  
u 当多个转换入口条件满足时  
n XOR  join   (第一个到达的执行)  
n AND  join(等所有的活动执行完毕后流程继续)  
超时提醒:可以根据优先级设定给责任人发送警告、提醒。  
优先级:活动是根据优先级排序的。可以配置优先级增长规则(如:每天优先级增加 5)  

6.2 工作流类型  

6.2.1 一般流程  
(General  workflow):没有条件转换的顺序任务,通常直接作为菜单项;  

6.2.2 单据流程  
(Document  workflow):每个单据都有预定义的过程,通过过程按钮触发,有预定的单据上
下文和责任人。默认包括如下状态:  
u Start(Draft)  
u Auto  
u Prepare(In  Progress)  
u Complete(Completed)  
单据可以进行定制,包括:  
对所有 client  
  添加自定义节点、转换以及(或)非活动的标准转换  
对特定 client 或组织  
  修改非 Directory/Adempiere 实体类型的系统工作流;  
  执行过程  

6.2.3 记录值流程  
( Record   Value   Workflow ): 在 保 存 记 录 时 特 定 条 件 满 足 时 触 发 。 比 如 : 新 纪 录
(@Created@=@Updated@)  

31  
北京易知信息技术有限公司  
iD 实践文档  

7 iD 中一些常用工具类  

7.1 关键代码位置  

ü 点击按钮触发:  
AbstractDesktop.onMenuSelected(int  menuId)  

TabbedDesktop: public void openWindow(int windowId, MQuery query,


Callback<ADWindow> callback) { final ADWindow adWindow = new
ADWindow(Env.getCtx(), windowId, query);
TabbedDesktop.openWindow AbstractDesktop onMenuSelected
AbstractADWindowContent

ü 信息窗口  
n 信息窗口构建类 DefaultInfoFactory  
n 定制信息窗口(AD_InfoWindow 中仅限配置),在 InfoWindow;  
n 默认信息窗口通过 InfoGeneralPanel 实现;  

7.2 获取持久化对象  

ü 获取持久化对象  

MBPartner partner = new MBPartner(getCtx(), {0 for new record, or record id},


get_TrxName());

推荐采用 Query 来获取对象。  


ü 获取单条记录:  

StringBuilder whereClause = new StringBuilder();


whereClause.append("AD_Client_ID=?"); // #1
whereClause.append(" AND AD_Org_ID=?"); // #2
whereClause.append(" AND C_AcctSchema_ID=?"); // #3
whereClause.append(" AND Account_ID=?"); // #4 MAccount
existingAccount = new Query(ctx, I_C_ValidCombination.Table_Name,
whereClause.toString(), null).setParameters(new Object[]{AD_Client_ID,
AD_Org_ID, C_AcctSchema_ID, Account_ID}).first();

ü 返回满足条件的一条记录:  

MAccount existingAccount = new Query(ctx,


I_C_ValidCombination.Table_Name, whereClause, null)

32  
北京易知信息技术有限公司  
iD 实践文档  

.setParameters(new Object[]{AD_Client_ID, AD_Org_ID,


C_AcctSchema_ID, Account_ID}).firstOnly();

ü 返回对象组:  

public static MAchievement[] getOfMeasure (Properties ctx, int


PA_Measure_ID) {
final String whereClause = COLUMNNAME_PA_Measure_ID+"=?";
List<MAchievement> list = new Query(ctx,
I_PA_Achievement.Table_Name, whereClause, null)
.setParameters(new Object[]{PA_Measure_ID})
.setOrderBy(COLUMNNAME_SeqNo+", "+COLUMNNAME_DateDoc).list();
return list.toArray(new MAchievement[list.size()]);
}

ü 传递时间参数:  

Timestamp dateAcct = ...;


String trxName = ...;
StringBuilder whereClause = new StringBuilder();
whereClause.append("C_CashBook_ID=?"); //#1
whereClause.append(" AND TRUNC(StatementDate)=?");//#2
whereClause.append(" AND Processed=?");//#3
MCash retValue = new Query(ctx, MCash.Table_Name,
whereClause.toString(), trxName).setParameters(new
Object[]{C_CashBook_ID, TimeUtil.getDay(dateAcct), true})
.first() ;

ü 使用 PreparedStatement/ResultSet  

final String sql = "''your SQL SELECT code''";


PreparedStatement pstmt = null;
ResultSet rs = null;
try {
pstmt = DB.prepareStatement(sql, trxName);
DB.setParameters(pstmt, new Object[]{...''parameters''...});
rs = pstmt.executeQuery();
while(rs.next()) {
''// process fetched row''
}
} // If your method is not throwing Exception or SQLException you need
this block to catch SQLException
// and convert them to unchecked DBException
catch (SQLException e) {
throw new DBException(e, sql);

33  
北京易知信息技术有限公司  
iD 实践文档  

} // '''ALWAYS''' close your ResultSet in a finally statement


finally {
DB.close(rs, pstmt);
rs = null;
pstmt = null;
}

ü 尽量使用 DB.getSQLValue*Ex 方法  
  当出现 SQLException 时,可以抛出 DBException(unchecked)  
ü 尽量使用 Trx.run 方法  

1. Trx.run(TrxRunnable r) - creates a new transaction, runs the runnable object and if


something fails then rollbacks the transaction and throw AdempiereException (extends
RuntimeException). If all is ok, the transaction is commited.
2. Trx.run(String trxName, TrxRunnable r) - similar with previous run method, but instead of
creating a new transaction it is creating a new savepoint.
 

Example 1:
...
/** * saves the partner, user and employee */
private void cmd_save() {
Trx.run(new TrxRunnable() {
public void run(String trxName) {
MBPartner bp = new MBPartner(getCtx(), bpartner_id,
trxName);
bp.setValue(fValue.getText());
bp.setName(fName.getText());
if (bp.get_ID() <=0){
bp.setIsEmployee(true);
}
bp.saveEx();
......
});
}
Example 2:
...
/** * get Connection object */
private void cmd_save() {
Trx.run(new TrxRunnable() {
public void run(String trxName) {
try {
Trx trx = Trx.get(trxName, true);

34  
北京易知信息技术有限公司  
iD 实践文档  

conn = trx.getConnection();
...
}catch (SQLException e) {
throw new AdempiereException(e);
}
}
});
}

7.3 清空表的缓存  

CacheMgt.get().reset(Table_Name);
 

7.4 报表或过程调用  

ProcessUtil.startJavaProcess(ctx, poInfo, trx);


(参加类:FinReportJasper)

7.5 在过程中显示窗口  

使用 Runnable 类:  

Runnable runnable = new Runnable() {


@Override
public void run() {
MPrintFormat pf = getPrintFormat();
Window viewer = new SMJReportViewer(getAD_PInstance_ID(),
get_TrxName(), PA_ReportLineSet_ID, p_C_Period_ID,
pf.getAD_PrintFont_ID(), m_columns);
viewer.setAttribute(Window.MODE_KEY,
Window.MODE_EMBEDDED);
viewer.setAttribute(Window.INSERT_POSITION_KEY,
Window.INSERT_NEXT);
AEnv.showWindow(viewer);
}
};
AEnv.executeAsyncDesktopTask(runnable);

使用匿名类:  
35  
北京易知信息技术有限公司  
iD 实践文档  

AEnv.executeAsyncDesktopTask(new Runnable() {
@Override
public void run() {
//Window viewer = new SfrReportViewer(ren,"");
ReportEngine re =
createReportEngine(getProcessInfo(),Env.WINDOW_MAIN,pf);
if (p_Org_ID==0)
p_Org_ID = Env.getAD_Org_ID(getCtx());
Window viewer = (Window)new
SfrReportViewer(getAD_PInstance_ID(), get_TrxName(), PA_ReportLineSet_ID,
p_C_Period_ID, pf.getAD_PrintFont_ID(), m_columns,re,p_Org_ID);
viewer.setAttribute(WindowContainer.DEFER_SET_SELECTED_TAB,
Boolean.TRUE);
SessionManager.getAppDesktop().showWindow(viewer);
}
});

7.6 自动创建行号  

ü 方法 1:  
参见 MInvoiceLine.beforeSave(boolean)  
//   Get  Line  No  
    if  (getLine()  ==  0)  
    {  
      String   sql   =   "SELECT   COALESCE(MAX(Line),0)+10   FROM   C_InvoiceLine   WHERE  
C_Invoice_ID=?";  
      int  ii  =  DB.getSQLValue  (get_TrxName(),  sql,  getC_Invoice_ID());  
      setLine  (ii);  
    }  
ü 方法 2:  
在 Table&Column 的 Line 列的”standard  Logic”  

@SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_InvoiceLine WHERE


C_InvoiceLine_ID=@C_InvoiceLine_ID@

(SQL 中可以使用全局变量如@#Date@)  
 
ü 方法 3:  
 

36  
北京易知信息技术有限公司  
iD 实践文档  

7.7 数据库更新脚本查看  

select releaseno,created,name,status,isapply,filename, script from


ad_migrationscript order by releaseno, name;

7.8 Packout 细节查看  

select det.created, det.updated, det.ad_package_exp_id,


det.AD_Package_Exp_Detail_id, det.line, det.description, det.dbtype,
det.sqlstatement, det.ad_table_id, tbl.tablename from
AD_Package_Exp_Detail det left join ad_table tbl on tbl.ad_table_id
= det.ad_table_id where det.AD_Package_Exp_ID = 1000041 order by
updated desc;

7.9 其他  

8 学校管理平台开发计划  
修改部门结构、  

8.1 通用标准使用  

8.1.1 EMGI 代码引用  


系统中所有的代码都 EMGI_XX_YY;  
其中 XX 为代码分类;  
分类代号   含义  
JY   教育部标  
GA   公安部标准  
GB   国家标准  
DA   档案  
XB   学校标准  
DM   自定义代码标准  
特殊编码:  
37  
北京易知信息技术有限公司  
iD 实践文档  

EMGI_META   数据子集/类/子类列表  
EMGI_METALINE   数据项列表  
 
YY 为代码名称  
如:系统的代码 EMGI_JY_JTLB   即为(教育部表-­‐家庭类别)  
EMGI 代码基于系统的引用(AD_Reference),但增加了属性(代码分类,ID 自带的为空;)  
元素包含 0..1 代码应用;元素包括 0..1EMGI_METALINE 的引用。  

8.1.2 数据项引用  
所有数据项引用最多为一级。即 A 引用 B,则 B 必须明确描述该数据项的长度、类型和值空
间;  
【注意】同编号的数据项仅在一个地方定义其数据项名和中文简称,目前的区分源的方法是
lx 字段是否为空;  
column  à  element(columnName,entityType,description,help,PrintName)  

8.1.3 数据子类引用  
数据子类的引用表明其保护对应的所有数据项列表引用。即 A 引用 B,则 A 中将自动增加 B
子类所包含的所有数据项(包括名称、字段、引用代码等)。  

8.1.4 关于扩展教育标准处理  

9 移动化  
1、【注意】确保服务器启动状态下,安装 iuimobile 组件;
2、配置角色允许访问移动;

38  
北京易知信息技术有限公司  
iD 实践文档  

3、重启服务。可以在移动端通过 http://daemona:8080/mobile 直接访问服务;  


4、修改 Msg 的翻译,Application  Dictionary|Message;  

 
可以通过 http://daemona:8080/mobile/  

10 常见问题处理  

10.1 ID 大小写  

创建表时确保主键为表名+_ID;  
但通过 Alter  table 增加、修改字段时,如果字段属性有大写,一定要加上引号;  
一旦出现由于_ID 小写问题,在调整字段后,一定要同时修改 Element 中对于元素的定义;  

10.2 问题  

39  
北京易知信息技术有限公司  

You might also like