• Default boolean values in config.java

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #42317  by Catscratch
 
Hi.

I wonder about the default boolean values in config.java.

E.g.:
Code: Select all
STORE_NODE_PATH = ConfigDAO.getBoolean(PROPERTY_STORE_NODE_PATH, "on".equalsIgnoreCase(cfg.getProperty(PROPERTY_STORE_NODE_PATH, "off")));
This always is set to "false" on my installation (fresh install).

Shouldn't it be
Code: Select all
STORE_NODE_PATH = ConfigDAO.getBoolean(PROPERTY_STORE_NODE_PATH, "true".equalsIgnoreCase(cfg.getProperty(PROPERTY_STORE_NODE_PATH, "false")));
?

I'm using community source code.
 #42331  by pavila
 
Well, it's the same thing because the boolean value is generated from the "on".equalsIgnoreCase(...) method. In the first case the value should be "on" so the "equalsIgnoreCase()" method would return true. In the second code the value should be "true" because it's making a comparison with the "true" string.

Perhaps it's a bit confusing an the right code should be:
Code: Select all
STORE_NODE_PATH = ConfigDAO.getBoolean(PROPERTY_STORE_NODE_PATH, cfg.getProperty(PROPERTY_STORE_NODE_PATH, "false"));

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.