If it's something you intend to contribute to the project, then it would
be best if the current artifacts are left where they are and then come
up with some kind of configurable properties loader. Something along the
lines of using the ServiceLoader class to locate classes that implement
code to create/update Properties objects. The
UtilProperties.getProperties(String resource, Locale locale) method
could then delegate to those classes.
-Adrian
On 4/2/2011 6:50 AM, Paul Ray wrote:
Thanks Adrian. Tried adding org.ofbiz.entity.DelegatorFactory under
META-INF/services in base but still get the ClassNotFoundException for
DelegatorFactory. Reckon it is still something to do with the classpath.
As an alternative explored if I could move the UtilProperties
relevant methods under entity module. Still working on it but wanted
to check if this is right approach. To be specific looking to move
public static ResourceBundleMapWrapper getResourceBundleMap(String
resource, Locale locale, Map<String, Object> context)
under a new Utility Class within entity module.
PR
The factory code uses the Java ServiceLoader class, so you will need
to create a service properties file for it to load. Look in the
META-INF folder of the entity component.
-Adrian
On 4/1/2011 5:03 PM, Paul Ray wrote:
Hello Ofbiz user community,
I am trying to avoid file base properties files and uilabels and
rather load them from Database. Reason, support configuration without
touching the code and eventually multi-tenant. As part of the
attempt, trying to load a few properties entries from DB in
org.ofbiz.base.util.UtilProperties class. The trouble is delegator
is not available here. As work around initialized for "default" using
DelegatorFactory after adding entity module classes in the build
path. The build goes through , however, at runtime get classnotfound
exception for Delegator Factory. Not sure if this is a classloader
issue since adding the entity/lib directly to the classpath didn't
help either. What am I missing?
Also alternatively is there a better way to query DB (need to be
multi-tenent aware since eventually all property file entries would
need to move there) as part of base module?
Thanks
PR