Chapter 2: Working with OFBiz

来源:互联网 发布:excel透视数据图的字段 编辑:程序博客网 时间:2024/06/06 08:15

特别注意:OFBiz版本是Release 4.0,其他版本的可能会导致显示不正确的问题!!


Create Our First Webapp


在ofbiz-compnent.xml中,有着如下定义:
<webapp name="practice"title="Practice"server="default-server"base-permission="OFBTOOLS"location="webapp/practice"mount-point="/practice"app-bar-display="true"/>

需要注意的是,这里的title,影响的是menu bar上的显示:


如果我将title改成Practice11111,重启ofbiz后,显示就编变成了:


MVC of OFBiz


M - Model, static, refers to the data structure of the software. A "model" is a collection of data entities in a network of relationships with one another.

The  Model in OFBiz is defined in ${component:party}\entitydef\entitymodel.xml. Each OFBiz component can have one (or zero) of such folders.

V - View, static, that is, the user-interface.static.

When using the OFBiz widget technology, user-interface definitions reside in folders named widget.

When using HTML or FTL technologies, user-interface definitions should reside in folders named webapp.


C - Controller, dynamic, refers to the wiring between the Model and the View, defines business logic and work flow of software.

When using pure Java, business logic definitions should reside in folders named src .

When using Minilang or BeanShell, business logic definitions usually reside in folders named script, and also in the folder WEB-INF\actions inside webapp.

When using Event-Condition-Action (ECA), business logic is defined in the folder servicedef, in file seca.xml or eeca.xml.

When using OFBiz Services, business logic definitions span over the folders servicedef and script. In the folder servicedef, files with names starting "services" (for example services.xml, service_view.xml) declare the usage pattern of services. Complementing that, in the folder script or src , we have the actual implementation or definition of those services. script和src中才是具体实现!

The files controller.xml and web.xml in the folder WEB-INF are also considered controller components in the MVC architecture.




原创粉丝点击