Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-26-2009, 05:16 AM
Member
 
Posts: 10
Default Storing custom global config values

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?

Last edited by NetForce1; 02-26-2009 at 05:25 AM..
Reply With Quote
  #2 (permalink)  
Old 02-27-2009, 01:47 AM
Member
 
Posts: 10
Default

Just found out that the NPE mentioned in my previous post only occurs in Zimbra Desktop, on ZCS, the modified column is filled for every value in the config table.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.