com.wewebu.ow.server.app
Class OwSettings

java.lang.Object
  extended by com.wewebu.ow.server.app.OwSettings

public class OwSettings
extends Object

Settings which hold the user and application settings, which can be changed during runtime.
The settings store the nodes in two XML documents. One for the user settings and one for the application settings. Since the setting nodes come from several plugins and may contain user and application nodes, they must be mapped two the two XML documents.

NOTE: Settings are available upon login, not before.
Unlike configuration node entries, the settings are stored for each user or for a site, where the configuration via getConfigNode is only set during startup

You can retrieve settings by calling getSafeSetting form within your plugin function, document or view class.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Field Summary
protected static String BASE_NODE_NAME
           
protected  OwMainAppContext m_Context
          reference to the application context, used to read and write Configuration.
protected  List m_SettingsSetList
          the above map is not ordered, so we need a backup ordered list.
protected  Map m_SettingsSetMap
          map containing the settings nodes
protected  OwObject m_SitePreferences
          OwObject holding application scope preferences, identical for all users
protected  OwObject m_UserPreferences
          OwObject holding user scope preferences, one for each user
 
Constructor Summary
OwSettings(OwMainAppContext context_p)
          Creates a new instance of OwSettings, must be called after login
 
Method Summary
 Collection getCollection()
          get collection to the settingssets
 OwSettingsProperty getProperty(String strID_p, String strName_p)
          retrieve a OwSettingsProperty
 OwSettingsSet getSettingsInfo(String strID_p)
          retrieve a OwSettingsSet
 void refresh()
          reload the setting
protected  void savePrefs(OwObject prefsObject_p, boolean fUser_p)
           
 void saveSitePrefs()
          save the app preferences
 void saveUserPrefs()
          save the user preferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_NODE_NAME

protected static final String BASE_NODE_NAME
See Also:
Constant Field Values

m_Context

protected OwMainAppContext m_Context
reference to the application context, used to read and write Configuration.


m_UserPreferences

protected OwObject m_UserPreferences
OwObject holding user scope preferences, one for each user


m_SitePreferences

protected OwObject m_SitePreferences
OwObject holding application scope preferences, identical for all users


m_SettingsSetMap

protected Map m_SettingsSetMap
map containing the settings nodes


m_SettingsSetList

protected List m_SettingsSetList
the above map is not ordered, so we need a backup ordered list. With JDK 1.4.x we can use a ordered HashMap.

Constructor Detail

OwSettings

public OwSettings(OwMainAppContext context_p)
           throws Exception
Creates a new instance of OwSettings, must be called after login

Throws:
Exception
Method Detail

refresh

public void refresh()
             throws Exception
reload the setting

Throws:
Exception

saveUserPrefs

public void saveUserPrefs()
                   throws Exception
save the user preferences

Throws:
Exception

saveSitePrefs

public void saveSitePrefs()
                   throws Exception
save the app preferences

Throws:
Exception

savePrefs

protected void savePrefs(OwObject prefsObject_p,
                         boolean fUser_p)
                  throws Exception
Throws:
Exception

getCollection

public Collection getCollection()
get collection to the settingssets

Returns:
Collection of OwSettingsSet settings nodes

getProperty

public OwSettingsProperty getProperty(String strID_p,
                                      String strName_p)
                               throws Exception
retrieve a OwSettingsProperty

Parameters:
strID_p - String the ID of the settingsset, i.e. the plugin ID for which the setting is to be retrieved
strName_p - Name of setting property to retrieve
Returns:
OwSettingsProperty
Throws:
Exception

getSettingsInfo

public OwSettingsSet getSettingsInfo(String strID_p)
                              throws Exception
retrieve a OwSettingsSet

Parameters:
strID_p - String the ID of the settingsset, i.e. the plugin ID for which the setting is to be retrieved
Returns:
OwSettingsSet
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.