Apache OFBiz Framework Quick Reference Book brought to you by: Revision 1.6.3 - ofbiz.apache.org HOTWAX MEDIA, INC. SVN rev 514251 www.hotwaxmedia.com

Development Flow Configuration & Deployment Start Data Layer General Configuration

Entity Group Entity Definition JNDI Servers Cache Properties entitygroup*.xml entitymodel.xml jndiservers.xml cache.properties

URL Properties Debug Properties Entity ECA url.properties debug.properties eecas*.xml

Security Logic Layer security.properties security.xml

Service Service Definition Implementation services*.xml *Services.xml, Containers & Components *Services., etc.

Component Load component-load.xml Containers Service ECA Service Group *containers.xml secas*.xml groups*.xml Component ofbiz-component.xml User Interface Layer

Request & View Entity & Service Config Screen Widget Definitions *Screens.xml (web only) controller.xml Entity Config entityengine.xml Service Config serviceengine.xml BeanShell Form Widget *.bsh *Forms.xml Entity Field Type fieldtype*.xml Menu Widget *Menus.xml

FreeMarker Tree Widget *.ftl *Trees.xml

This diagram represents the recommend process for development. See the last page for a diagram that shows how the artifacts refer to each other.

Copyright © 2004-2007 HOTWAX MEDIA, INC. Main Diagram page 1 page 2 Entity Definition, Group, ECA Copyright © 2004-2007 HOTWAX MEDIA, INC. Entity Definition Entity ECA Entity Group [Root Element] [Root Element] [Root Element] [0..1] <entity-group/> [0..*] <eca/> [1..*] <description/> [0..1] </entitygroup> </entity-eca> <copyright/> [0..1] <entity-group group="string [r]" <eca entity="string [r]" <author/> [0..1] entity="string [r]"/> operation="(create|store|remove|find| <version/> [0..1] create-store|create-remove| store- Start Choice [0..*] remove|create-store-remove|any) [r]" <entity/> [1] Entity Definition: View Entities event="(validate|run|return|cache- <view-entity/> [1] check|cache-put|cache-clear) [r]" End Choice [Part of Entity Definition] run-on-error="(true|false) [o]"> </entitymodel> <view-entity entity-name="string [r]" Start Choice [0..*] <title>string package-name="string [r]" [1] string dependent-on="string [o]" [1] string default-resource-name="str[o]" End Choice string never-cache="(true|false) [o]" [1..*] string auto-clear-cache="(true|false)[o]" title="s[o]" copyright="s[o]" operator="(less|greater|less-equals| Entity Definition: Entities [0..1] greater-equals|equals|not-equals|is- [1..*] empty|is-not-empty|contains) [r]" [Part of Entity Definition] [0..*] [0..*] value="string [o]" [0..*] [0..*] type="(PlainString|String|BigDecimal| table-name="string [o]" Double|Float|Long|Integer|Date|Time| package-name="string [r]" format="string [o]"/> dependent-on="string [o]" [0..1] operator="(less|greater|less-equals| no-auto-stamp="(true|false) [o]" contains) [r]" auto-clear-cache="(true|false)[o]" [0..1] to-field-name="string [o]" title="s[o]" copyright="s[o]" [0..*] type="(PlainString|String|BigDecimal| author="s[o]" version="s[o]"> Double|Float|Long|Integer|Date|Time| [0..1] Timestamp|Boolean|Object) [o]" [1..*] [0..*] [0..*] [0..*] name="str [r]" field="str [o]" col-alias="string [o]" mode="(sync|async) [r]" prim-key="string [o]" result-to-value="(true|false) [o]" group-by="(true|false) [o]"> persist="(true|false) [o]" [0..1] [0..*] [0..1] run-as-user="string [0..1:system]" [0..1] value-attr="string [o]"/> rel-entity-name="string [r]" Start Choice [0..*] Entity Group type="(one|many|one-nofk) [r]" [1] fk-name="string [o]"> [1] [based on product/entitydef/entitygroup.xml] [0..1] [1..*] End Choice xsi:noNamesp...="...dtds/entitygroup.xsd"> rel-field-name="string [o]"/> unique="(true|false) [o]"> count-distinct|upper|lower) [o]" [0..1] field="string [r]"/> entity="SomeDataWarehouseEntity" /> [1..*] rel-entity-alias="string [r]" rel-optional="(true|false) [o]"> [0..1] [0..*] [1..*] Entity ECA [0..*] [0..*] [from product/entitydef/eecas.xml] mode="sync" value-attr="productInstance"/> operation="create-store" event="return"> mode="sync"/> operation="create-store-remove" event="return"> service="updateInventoryItemFromDetail" mode="sync"/> Copyright © 2004-2007 HOTWAX MEDIA, INC. Service Definition, Group, ECA page 3

Service Definiton: Attributes Service Definition Service ECA [Root Element] [Part of Service Definition] [Root Element] [0..1] [1..*] [0..1] [0..1] type="string [r]" [0..1] [1..*] mode="(IN | OUT | INOUT) [r]" optional="(true | false) [o]" event="(global-commit|global- string form-label="string [o]" rollback|auth|in-validate|out- string entity-name="string [o]" validate|invoke|commit|return) [r]" string field-name="string [o]" run-on-failure="(true|false) [o]" string string-map-prefix="str [o]" run-on-error="(true|false) [o]"> string string-list-suffix="str [o]" Start Choice [0..*] [1] [1] engine="string [r]" [0..*] [1] End Choice location="str [o]" invoke="str [o]" Start Choice [1..*] auth="(true|false) [o]" [1] [1] End Choice export="(true|false) [o]" type="s[o]" entity-name="s[o]" validate="(true|false) [o]" field-name="string [o]" empty|is-not-empty|contains) [r]" transaction-timeout="str [o]" [0..*] value="string [o]" max-retry="string [o:-1]" type="(PlainString|String|BigDecimal| debug="(true|false) [o]"> [0..1] class="str[0..1:org.ofbiz.base.util.UtilValidate]"> Timestamp|Boolean|Object) [o]" [0..1] Start Choice [1] format="string [o]"/> [0..*] [1] [1] [0..*] End Choice field-name="string [r]" [0..*] operator="(less | greater | less- [0..*] [0..*] equals | greater-equals | equals | to-map-name="string [o]" service-name="string [r]" to-field-name="string [o]" resource-description="string [o]" type="(PlainString|String|BigDecimal| main-action="(CREATE|UPDATE|DELETE| Double|Float|Long|Integer|Date|Time| VIEW) [o]"> Timestamp|Boolean|Object) [o]" join-type="(AND|OR) [r]"> [0..*] service-name="string [r]"/> [0..*] Service ECA mode="(sync|async) [r]" xsi:noNam...="...dtds/service-eca.xsd"> new-transaction="(true|false) [o]" event="commit"> ignore-failure="(true|false) [o]" mode="(IN|OUT|INOUT) [r]" name="oldStatusId"/> env-name="str [o]" value="str [o]" form-display="(true|false) [o]"> hash-code|long|double|upper-first- char|lower-first-char|db-to-java|java- to-db) [o]"/>

Service Definition Service Group [from ofbiz/applications/product/servicedef/services.xml] [Root Element] [1..*] xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/services.xsd"> Product Component Services OFBiz 1.0 send-mode="(none|all|first-available| random|round-robin) [o]"> [1..*] mode="(sync|async) [o]" preserve="(optional|preserve) [o]"/> Service Group xsi:noNam...="...dtds/service-group.xsd"> mode="sync" result-to-context="true"/> page 4 simple-methods 1 of 4 Copyright © 2004-2007 HOTWAX MEDIA, INC.

simple-method: General Operations simple-method: Call Operations simple-method [Root Element] [Part of simple-method] [Part of simple-method] [1..*] method-name="string [r]" short-description="string [r]" login-required="(true|false) [o]" use-transaction="(true|false) [o]" default-error-code="str [0..1:error]" [Used when method default-success-code="[0..1:success]" called as a Control Servlet Event] parameter-map-name="[0..1:parameter]" event-request-object-name="string [0..1:request]" event-response-object-name="string [0..1:response]" simple-method: Entity Operations event-response-code-name="string [0..1:_response_code_]" [Part of simple-method] event-error-message-name="string [Used when method [0..1:_error_message_]" called as an OFBiz Service] event-event-message-name="string [0..1:_event_message_]" service-response-message-name="string [0..1:responseMessage]" service-error-message-name="string [0..1:errorMessage]" See Shared service-error-message-list- See Shared name="string [0..1:errorMessageList]" See Shared service-error-message-map- name="string [0..1:errorMessageMap]" See Shared service-success-message-name="string See Shared [0..1:successMessage]" service-success-message-list- simple-method: Control Operations name="str [0..1:successMessageList]" locale-name="string [0..1:locale]" [Part of simple-method] delegator-name="str [0..1:delegator]" security-name="str [0..1:security]" dispatcher-name="s [0..1:dispatcher]" user-login-name="s [0..1:userLogin]"> Start Group: AllOperations [0..*] Start Choice [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] [1] End Choice simple-method example End Group: AllOperations [Example CrUD methods from framework/example/script/org/ofbiz/example/ExampleServices.xml] type="string [o]"/> ... property="str [o]"/> property="str [o]"/> property="str [o]"/> property="str [o]"/> property="str [o]"/> ... property="str [o]"/> property="str [o]"/> property="str [r]"/> ... Copyright © 2004-2007 HOTWAX MEDIA, INC. simple-methods 2 of 4 page 5

simple-method: If Operations 1 of 2 simple-method: If Operations 2 of 2 simple-method: Control Operations

[Part of simple-method] [Part of simple-method] [Part of simple-method] map-name="s[o]" field-name="s[r]" entry-name="string [r]" method="string [r]" list-name="string [r]"> class="s [0..1:org.ofbiz.base.util.UtilValidate]"> Group: AllOperations [0..*] [1] [1] Group: AllOperations [0..*] [0..*] [0..1] [0..1] key-name="string [r]" [1] class="string [r]"> Group: AllOperations [0..*] [1] Group: AllOperations [0..*] End Choice [0..1] count="str [r]" field="str [r]"> value="string [r]" format="string [o]" error-code="string [0..1:error]" [1] [1] operator="(less|greater|less-equals| error-list-name="s[0..1:error_list]"> greater-equals|equals|not-equals| [0..1] contains) [r]" [0..1] Group: AllOperations [0..*] type="(PlainString|String|BigDecimal| [0..1] Double|Float|Long|Integer|Date|Time| [0..1] Timestamp|Boolean|Object) [o]"> Start Group: IfConditions [1..*] Group: AllOperations [0..*] [0..1] error-list-name="s[0..1:error_list]"> [1] Start Choice [1] [1] [1] End Choice map-name="s[o]" field-name="s[r]" [1] End Group: IfConditions to-map-name="string [o]" End Choice to-field-name="string [o]" format="string [o]" greater-equals|equals|not-equals| contains) [r]" Group: IfConditions [1..*] type="(PlainString|String|BigDecimal| If & Service Example Double|Float|Long|Integer|Date|Time| Timestamp|Boolean|Object) [o]"> [from applications/product/script/org/ofbiz/ Group: IfConditions [1] Start Group: AllOperations [0..*] shipment/shipment/ShipmentServices.xml] [0..1] title="string [o]" error-list-name="s[0..1:error_list]"> map-name="s[o]" field-name="s[r]" Group: IfConditions [1..*] expr="string [r]"> Group: AllOperations [0..*] [0..1] "parameters.estimatedShipDate"/> permission="string [r]" map-name="s[o]" field-name="s[r]"> operator="not-equals" to-field- name="lkdUpVal.estimatedShipDate"/> [0..1] Group: AllOperations [0..*] [0..*] [0..1] Start Choice [1] [1] [1] map-name="s[o]" field-name="s[r]"> map-name="parameters"/> End Choice Group: AllOperations [0..*] [0..1] name="parameters.originFacilityId" operator="not-equals" to-field- name="lkdUpVal.originFacilityId"/> party-id-env-name="string [o]"/> permission="string [r]" action="string [o]"> action="string [o]"/> Group: AllOperations [0..*] [0..1] value-name="estShipWe" auto-field-map="false"> map-name="string [o]" env-name="lkdUpVal.estimatedShipWorkEffId"/> Start Choice [0..1] [1] [1] from-field= End Choice "parameters.estimatedShipDate"/> Control Snippets Example service-name="updateWorkEffort" to-map-name="estShipWeUpdMap"/> service-name="updateWorkEffort" in-map-name="estShipWeUpdMap"/> page 6 simple-methods 3 of 4 Copyright © 2004-2007 HOTWAX MEDIA, INC.

simple-method: General Operations simple-method: Call Operations simple-method: Call Service Ops

[Part of simple-method] [Part of simple-method] [Part of simple-method] default-value="string [o]" out-map-name="string [r]" service-name="string [r]" Double|Float|Long|Integer|Date|Time| [0..1] in-map-name="string [o]" Timestamp|Boolean|Object) [o]" include-user-login="(true | false) set-if-null="(true|false) [o]" set-if-empty="(true|false) [o]"/> resource="string [o]" service-name="string [r]" map-name="s[o]" field-name="s[r]" xml-resource="string [o]" include-user-login="(true|false) [o]" break-on-error="(true|false) [o]" list-name="string [r]" obj-field-name="string [r]" success-code="string [0..1:success]"> [0..1] map-name="string [r]" method-name="string [r]" [0..1] to-map-name="string [o]"/> ret-field-name="string [o]" [0..1] [0..1] map-name="s[o]" field-name="s[r]" Start Choice [0..*] [0..1] string="string [r]" [1] [1] [0..1] arg-list-name="string [o]" End Choice [0..1] prefix="string [o]" Start Choice [0..*] suffix="string [o]"/> [1] [1] string="str [r]" list-name="str [r]" method-name="string [r]" [1] arg-list-name="string [o]" ret-field-name="string [o]" [1] message-field-name="string [o]"/> ret-map-name="string [o]"> [1] [1] [1] format="string [o]" End Choice numeric-padding="string [o]"/> class-name="string [r]" field-name="str [o]"/> request-name="str [o]"/> list-name="string [r]"/> Start Choice [0..*] [1] [1] session-name="str [o]"/> End Choice service-result-name="string [o]"/>

[Part of simple-method] message="string [o]"> [1] [1] request-name="string [o]"/> map-name="s[o]" field-name="s[r]" session-name="string [o]"/> env-name="string [r]"/> default="string [o]" or in RPN: "a=+(b,/(*(+(c,x,2),-d),e))" --> resource="s[r]" property="s[r]" map-name="s[o]" field-name="s[r]" EventOperations default="string [o]" request-name="string [r]" no-locale="(true | false) [o]" list-name="string [o]"/> arg-list-name="string [o]"/> value-name="string [r]"/> default="string [o]" field-name="d"/> map-name="s[o]" field-name="s[r]" | Integer | BigDecimal) [o]" resource="str [r]" property="str [r]" decimal-format="string [o]"> default="string [o]" Start Choice [0..*] field-name="string [r]" [1] [1] session-name="string [o]"/> End Choice map-name="s[o]" field-name="s[r]" multiply|divide|negative) [r]" map-name="s[o]" field-name="s[r]"> Start Choice [0..*] [1] [1] End Choice Copyright © 2004-2007 HOTWAX MEDIA, INC. simple-methods 4 of 4 page 7

simple-method: Entity Find Ops simple-method: Entity Misc Ops Simple Map Processor [Part of simple-method] [Part of simple-method] [Root Element] [1..*] EntityFindOperations EntityMiscOperations entity-name="string [o]" sequence-name="string [r]" name="string [r]"> delegator-name="string [o]"/> [0..*] [0..*] entity-name="string [r]" seq-field-name="string [r]" map-name="string [r]" numeric-padding="string [0..1:5]" order-by-list-name="string [o]" increment-by="string [0..1:1]"/> Start Choice [0..*] delegator-name="string [o]" [1] [1] use-cache="(true | false) [o]" location="string [r]" [1] use-iterator="(true | false) [o]" delegator-name="string [o]" End Choice list-name="string [r]"/> timeout="integer [0..1:-1]" entity-name="string [r]" mode="(assert | load) [o]"/> count-name="string [r]"> began-transaction-name="string string Start Choice [1] [0..1:beganTransaction]"/> [1] [1] began-transaction-name="string [1] End Choice [0..1:beganTransaction]"/> [1] [1] [0..1] [1] [1] EntityTxOperations [1] [1] order-by-list-name="string [r]"/> EntityFindOperations Start Choice [1] list-name="[r]" to-list-name="[o]" simple-method: Entity Change Ops [1] [1] map-name="string [o]"/> End Choice EntityFindOperations greater-equals|equals|not-equals| thru-field-name="str [0..1:thruDate]" value-name="string [r]" type="(PlainString|String|BigDecimal| new-value-name="string [r]"/> Double|Float|Long|Integer|Date|Time| Entity Misc Operations Example value-name="string [r]" Start Choice [1] do-cache-clear="(true|false)[o]"/> [1] [1] entity-name="ShipmentItem"/> do-cache-clear="(true|false)[o]"/> field="str [r]" format="str [o]" value-name="string [r]" operator="(less|greater|less-equals| value-name="newEntity"/> greater-equals|equals|not-equals| do-cache-clear="(true|false)[o]"/> Double|Float|Long|Integer|Date|Time| seq-field-name="shipmentItemSeqId"/> value-name="string [r]" [1] [1] field-name="newEntity.shipmentItemSeqId" do-cache-clear="(true|false)[o]"/> result-name="shipmentItemSeqId"/> End Choice entity-name="string [r]" do-cache-clear="(true|false)[o]"/> [1] [1] End Choice EntityValueOperations env-name="newEntity.shipmentId"/> map-name="string [o]"/> Start Choice [1] [1] [1] field-name="newEntity.shipmentId"/> EntityValueOperations/> End Choice value-name="string [r]" set-if-null="(true | false) [o]"/> set-if-null="(true | false) [o]"/> replace="(true | false) [o]" do-cache-clear="(true|false)[o]"/> Start Choice [1] [1] [1] list-name="string [r]" End Choice do-cache-clear="(true|false)[o]"/> page 8 Request & View Definition Copyright © 2004-2007 HOTWAX MEDIA, INC. Request & View Request & View Example

[Root Element] [from ofbiz/applications/product/webapp/catalog/WEB-INF/controller.xml] [0..1] [0..1] xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/site-conf.xsd"> [1] Catalog Module Site Configuration File The Open For Business Project (c) 2001-2004 [1..*] /error/error.jsp [0..1] [0..1] [0..1] [1..*] [1..*] string string string type="(view | request) [o]" class="string [r]"/> [0..*] [0..*] [0..*] Verify a user is logged in. [0..*] edit="(true | false) [o]"> [0..1] [0..1] [0..1] [1..*] auth="(true|false) [o]" direct-request="(true|false) [o]" external-view="(true|false) [o]"/> path="str[o]" invoke="str[o]"/> type="(none | view | request | request-redirect | url) [r]" value="string [o]"/> page="s[o]" type="s[0..1:default]" info="str[o]" encoding="str[o]" content-type="string [o]"> [0..1] Copyright © 2004-2007 HOTWAX MEDIA, INC. Screen Widget page 9

Screen Widget Screen Widget: Visual Widgets Screen Widget: Include Widgets

[Root Element] [Part of Screen Widget] [Part of Screen Widget] [1..*] id="str [o]" style="str [o]"> name="string [r]" [0..*] location="string [o]"> name="string [r]"> [1..*]

[1] src="string [o]" id="str [o]" name="string [o]"> height="str [o]" border="s [o]" [0..*] See Shared [0..1] url-mode="(ofbiz|content|raw)[o]"/> See Shared [0..1]
text="string [o]" id="str [o]" name="string [r]" [0..*] style="str [o]" target="s [o]" location="string [r]" name="str [o]" prefix="str [o]" share-scope="(true | false) [o]"/> target-window="string [o]" [0..*] url-mode="(intra-app | inter-app | name="string [r]" content | plain) [o]" location="string [r]"/> full-path="(true | false) [o]" secure="(true | false) [o]" name="string [r]" encode="(true | false) [o]"> location="string [o]" [0..1] share-scope="(true | false) [o]"/>