Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The resource-loader tag is used to configure a named resource loader that can be used elsewhere to load XML and other resources. It has the following attributes.

 

Attribute NameRequired?Description
nameYThe name of the resource loader. Used in other tags in the "loader" attribute.
classYThe class to use that extends the abstract class org.ofbiz.entity.config.ResourceLoader. Available classes include FileLoader, UrlLoader, and ClasspathLoader, all in the same package as the ResourceLoader class.
prepend-envNThe name of a Java environment property to put at the very beginning of the full location, before the prefix. This is optional.
prefixNA string to put before the location when making the full location. This is optional. If used will go after the prepended environment property and before the location specified for each resource.

...

For JTA support the Entity Engine needs access to the javax.transaction.UserTransaction and optionally the javax.transaction.TransactionManager interface implementations for the TX Manager being used. These are retrieved through the org.ofbiz.entity.TransactionFactory class. This class uses the class specified with the class attribute of the transaction-factory. This class may be changed depending on which application server or transaction manager you are running OFBiz on.

 

The default TX Manager is JOTM from ObjectWeb and the factory class for JOTM is org.ofbiz.entity.transaction.JotmFactory. There is also a special class for Weblogic:

org.ofbiz.entity.transaction.WeblogicFactory,

which must be changed to include the Weblogic specific stuff and then compiled with weblogic.jar on the classpath.

 

The most widely useful transaction factory class is the org.ofbiz.entity.transaction.JNDIFactory class. This class uses some additional elements from the entityengine.xml file to locate the UserTransaction and TransactionManager objects in JNDI.

 

The user-transaction-jndi and transaction-manager-jndi tags are used to specify the object names in JNDI and the name of the JNDI Server to use, as configured above. Both tags have two required attributes: jndi-server-name and jndi-name. An example jndi-name for the UserTransaction object is java:comp/UserTransaction and for the TransactionManager object is java:comp/TransactionManager. 

Delegator Elements

...

The GenericDelagator is created through a factory method that takes a String argument containing the delegator name. This delegator name is used to look up a delegator tag in the entityengine.xml file.

 

Attribute NameRequired?Description
nameYThe name of the Delegator. Used to look up this tag by delegator name.
entity-model-readerYThe name of the entity-model-reader to use for this delegator.
entity-group-readerYThe name of the entity-group-reader to use for this delegator.
entity-eca-readerNThe name of the entity-eca-reader to use for this delegator. If not specified no Entity ECAs will be used.
distributed-cache-clear-enabledNUsed to specify if the distributed cache clear should be enabled. If not specified defaults to "false". If set to true the other DCC attributes will be used.
distributed-cache-clear-class-nameNUsed to specify if the name of the class to use for DCC and that implements the distributed cache clear interface. If not specified defaults to "org.ofbiz.entityext.cache.EntityCacheServices", which is a good default for most cases that uses the Service Engine for configuration and remote calls.
distributed-cache-clear-user-login-idNUsed to specify if the userLoginId (to use for any security checks) is needed related to distributed cache clear operation. If not specified defaults to "admin".

 

The delegator tag must contain one or more group-map tags specifying a datasource to use for each group of entities that the delegator will know about from the entity-group-reader. The delegator uses this file to assign a group to each entity. When an operation on an entity is performed it looks up the group and the datasource helper that corresponds to the group and uses that Helper to perform lower level Data Source operations. With this technique when the application is written it does not have to know which Helper is responsible for a given entity, and can therefore handle an entity or groups of entities assigned to different Data Sources with a simple configuration.

...