ofbiz Condition,Action,Screen

来源:互联网 发布:淘宝联盟引流人数 编辑:程序博客网 时间:2024/06/16 21:54

一 Condition

<condition>

<if-compare field-name="parameters.show" operator="equals"
value="widgets"/>

</condition>

Condition 可以放12种类型

4种逻辑操作或者链接节点<and>, <xor>, <or>and <not>

3种权限判断<if-service-permission>,<if-has-permission>, and <if-entity-permission>

5种比较操作<if-validate-method>, <if-compare>, <if-compare-field>, <ifregexp>,and <if-empty>.


二<Action></Action>

可以放10种类型

5种查询<entity-and>, <entity-condition>, <entity-one>,<get-related-one>, and <get-related>.

2种可以完成复杂的业务逻辑
The action type <script> invokes codes written using BeanShell. The action type
<service> invokes codes wrapped in an OFBiz service (a major benefit of OFBiz and
explained later in the book).

3种简单的赋值

 <property-map> and<property-to-field> retrieve values from a property or configuration file.

 <set>, places any value we want and assigns it any variable.

三<widgets>

widgets包含15种类型

1)<container>, <image>, <link>, and <label>.是4中简单的类型

<container>对应于DIV,IMAGE对应于img,link对应于a,label则是文本

2)9种include类型

<include-screen>

<platform-specific><html>
<html-template location="<path-to-some-ftl-file>"/>
</html></platform-specific>


<decorator-section-include name="body"/>被替换模块


<decorator-screen name="xhtml-decorator">
<decorator-section name="body">
<include-screen name="SimplestScreen"/>
<include-screen name="AnotherSimpleScreen"/>
</decorator-section>
</decorator-screen>

<form>表单类型

表单有single,list,multi三种类型

可以有可选的action,方便添加和修改的重用

四Context Object

screens is an org.ofbiz.widget.screen.ScreenRenderer object
globalContext is an org.ofbiz.base.util.collections.MapStack object
nullField is an org.ofbiz.entity.GenericEntity$NullField object
availableLocales is a java.util.List object
locale is a java.util.Locale object
delegator is an org.ofbiz.entity.GenericDelegator object
dispatcher is an org.ofbiz.service.GenericDispatcher object
security is an org.ofbiz.security.OFBizSecurity object
userLogin is an org.ofbiz.entity.GenericValue object
parameters is an java.util.Map object


五section

section可以被嵌套在widgets里面


六脚本语言

globalContext = context.get("globalContext");
globalContext.put("global2", "Global Value B");
context.put("local2", "Local Value b");


原创粉丝点击