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
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
OwSettings(OwMainAppContext context_p)
Creates a new instance of OwSettings, must be called after login
|
Modifier and Type | Method and Description |
---|---|
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
|
protected static final String BASE_NODE_NAME
protected OwMainAppContext m_Context
protected OwObject m_UserPreferences
protected OwObject m_SitePreferences
protected Map m_SettingsSetMap
protected List m_SettingsSetList
public OwSettings(OwMainAppContext context_p) throws Exception
Exception
public void saveUserPrefs() throws Exception
Exception
public void saveSitePrefs() throws Exception
Exception
protected void savePrefs(OwObject prefsObject_p, boolean fUser_p) throws Exception
Exception
public Collection getCollection()
public OwSettingsProperty getProperty(String strID_p, String strName_p) throws Exception
strID_p
- String the ID of the settingsset, i.e. the plugin ID for which the setting is to be retrievedstrName_p
- Name of setting property to retrieveException
public OwSettingsSet getSettingsInfo(String strID_p) throws Exception
strID_p
- String the ID of the settingsset, i.e. the plugin ID for which the setting is to be retrievedException
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.