For my zimlet I need to have a global configuration that applies to all users. So I created an admin extension where this configuration can be managed. Now I am having difficulties with storing the configuration values. First, I tried to store the values in the 'global configuration' in LDAP, but that requires modification of the schema. Then I thought about storing it in the local config, but it appears the local config can only be edited using the command line client.
At last I found the DbConfig (accessible via com.zimbra.cs.util.Config), I finally managed to store the configuration, but now Zimbra fails to start after it has been stopped, this is caused by a NullPointerException being thrown from com.zimbra.cs.util.Confg.init(), line 71 (the line containing the else if).
Code:
mConfigMap = DbConfig.getAll(conn, ts);
for (Iterator<DbConfig> it = mConfigMap.values().iterator(); it.hasNext();) {
DbConfig c = it.next();
if (mYoungest == null) {
mYoungest = c.getModified();
} else if (c.getModified().after(mYoungest)) {
mYoungest = c.getModified();
} I think this would be solved by ordering the results of the query by modification and using a LinkedHashMap in com.zimbra.cs.db.DbConfig.getAll(), or by adding some null-handling in com.zimbra.cs.util.Config.
Is there any work-around, or another way of have custom global configuration values without modifying the zimlet definition, or the LDAP schema?