public abstract class OwStandardRoleManager extends Object implements OwRoleManager
Standard implementation for the rolemanager.
Override this class to implement your own rolemanager
and set the rolemanager in the bootstrap settings.
You get a instance of the RoleManager by calling getContext().getRoleManager().
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 | Class and Description |
---|---|
static class |
OwStandardRoleManager.CategoryNames
Inner class that holds the mapping of the categories to category names.
|
static class |
OwStandardRoleManager.StandardFunctionResources
Inner class that holds the map that maps the standard function IDs to display names.
|
Modifier and Type | Field and Description |
---|---|
static String |
APPLICATION_PREFIX_DELIMITER
delimiter for the resource ID and the application prefix
|
protected Map |
m_AllowedPluginTypesMap
map to the lists of plugin description nodes, DO NEVER access directly, rather use getAllowedPluginsMap()
The allowed plugin map maps only those plugins which the logged on user has access rights.
|
protected OwXMLUtil |
m_ConfigNode
configuration node with XML config information
|
protected Map |
m_DefaultMimeMap
default MIME table with the default MIME types when mimetype could not be resolved, DO NEVER access directly, rather use getDefaultMimeMap()
The MIME table is static, so it get only loaded once upon application server startup
and not each time a user logs on.
|
protected Map |
m_DesignCategoryMap
a map of resources for the category: design
|
protected Map |
m_GroupBoxCategoryMap
a map of resources for the category: search template
|
protected Map |
m_indexFieldsMap
a map of resources for category: object classes
|
protected Map |
m_MimeMap
MIME table, DO NEVER access directly, rather use getMimeMap()
The MIME table is static, so it get only loaded once upon application server startup
and not each time a user logs on.
|
protected Map |
m_objectClassesMap
a map of resources for category: object classes
|
protected Map |
m_PluginCategoryMap
a map of resources for the plugins
|
protected Map |
m_PluginMap
map to the description nodes, keyed by their id, DO NEVER access directly, rather use getPlugin()
The plugin map is static, so it gets only loaded once upon application server startup
and not each time a user logs on.
|
protected Map |
m_PluginTypesMap
map to the lists of plugin description nodes, keyed by their type
DO NEVER access directly, rather use getAllowedPluginsMap()
The plugin map is static, so it gets only loaded once upon application server startup
and not each time a user logs on.
|
protected Map |
m_SearchTemplateCategoryMap
a map of resources for the category: search template
|
protected Map |
m_SelectiveConfigurationMap
map of all selective configuration names (elements with a "optionid" attribute) in the config files.
|
protected String |
m_strDesign
the design name
|
protected Map<String,String> |
m_VirtualFolderCategoryMap
a map of resources for the category: virtual folder
|
static String |
MS_OFFICE_EMBEDED_DESIGN
special office design to use in case we run embedded in msoffice
|
m_predefinedcategories, ROLE_ACCESS_MASK_FLAG_DYNAMIC_RESOURCE_MODIFY, ROLE_ACCESS_MASK_FLAG_INDEX_FIELD_MODIFY, ROLE_ACCESS_MASK_FLAG_INDEX_FIELD_VIEW, ROLE_ACCESS_MASK_FLAG_OBJECT_CLASSES_CHECKIN, ROLE_ACCESS_MASK_FLAG_OBJECT_CLASSES_CREATE, ROLE_ACCESS_MASK_FLAG_OBJECT_CLASSES_VIEW, ROLE_ACCESS_RIGHT_ALLOWED, ROLE_ACCESS_RIGHT_DENIED, ROLE_ACCESS_RIGHT_NOT_ALLOWED, ROLE_CATEGORY_BPM_PROCESS_DEFINITION, ROLE_CATEGORY_DESIGN, ROLE_CATEGORY_INDEX_FIELDS, ROLE_CATEGORY_OBJECT_CLASSES, ROLE_CATEGORY_PLUGIN, ROLE_CATEGORY_SEARCH_TEMPLATE, ROLE_CATEGORY_SELECTIVE_CONFIGURATION, ROLE_CATEGORY_STANDARD_FUNCTION, ROLE_CATEGORY_STARTUP_FOLDER, ROLE_CATEGORY_USER_START, ROLE_CATEGORY_VIRTUAL_FOLDER, ROLE_CATEGORY_VIRTUAL_QUEUE, ROLE_RESOURCE_CONTEXT_CHECKIN, ROLE_RESOURCE_CONTEXT_CREATE, ROLE_RESOURCE_CONTEXT_VIEW, STD_FUNC_CAN_EDIT_SITE_SETTINGS
Constructor and Description |
---|
OwStandardRoleManager() |
Modifier and Type | Method and Description |
---|---|
static void |
applicationInitalize(OwBaseInitializer initializer_p)
Init role config data upon startup,
make sure the servlet listener
OwStandardRoleManagerInitialisingContextListener is configured for your application. |
boolean |
canRefreshStaticConfiguration()
check if update the configuration data is supported
|
protected abstract String |
dynamicResourceNameFromId(Locale locale_p,
String resourceId_p,
int category_p) |
Map |
getAccessMaskDescriptions(int category_p)
Returns a map between the access right flag and the localized display name.
|
protected Map<String,OwWorkflowDescription> |
getBpmProcessDefinitionsCategoryMap()
get a map of workflow descriptions by there ID.
|
Collection |
getCategories()
get all defined categories and displaynames as a map
|
String |
getCategoryDisplayName(Locale locale_p,
int categorie_p)
get a display name for the given category
|
protected Map |
getCategoryMap()
the map that maps the categories to category names
|
protected OwXMLUtil |
getConfigNode()
get configuration node with XML config information
|
Collection |
getConfiguredCategories()
Get configured categories and displaynames as a map.
|
protected OwRoleManagerContext |
getContext()
get the application context
|
protected OwBaseUserInfo |
getCurrentUser()
get the current logged on user
|
OwXMLUtil |
getDefaultMIMENode(int iObjectType_p)
get the default MIME XML Entry for the given object type.
|
String |
getDesign()
get the name of the design for the current user can be overridden by rolemanager implementation
Specifies the subfolder under /designs/ where to retrieve the design files.
|
protected Map |
getDesignCategoryMap()
get a map of resources for the category: design
|
protected abstract Collection<String> |
getDynamicResources(int category_p) |
protected Map |
getGroupBoxCategoryMap()
get a map of resources for the category: search template
|
protected Map |
getIndexFieldsMap()
get a map of resources for the category: index fields
|
OwXMLUtil |
getMIMENode(String strMIMEType_p)
get the MIME XML Entry for the given MIMEType.
|
protected Map |
getObjectClassesMap()
get a map of resources for the category: object classes
|
OwXMLUtil |
getPlugin(String strID_p)
get a plugin description by its key
that are allowed for the logged on user.
|
protected Map |
getPluginCategoryMap()
get a map of resources for the plugins
|
List |
getPlugins(String strType_p)
get a list of plugin description nodes by type as defined in OwBaseConfiguration,
that are allowed for the logged on user.
|
protected Map |
getRepositories()
overridable, create a map of repositories that can be searched
|
String |
getResourceDisplayName(Locale locale_p,
int categorie_p,
String strID_p)
get a display name for the given category
|
Collection |
getResources(int category_p)
get all available resources for a given category
|
protected Map |
getSearchTemplateCategoryMap()
get a map of resources for the category: search template
|
protected Map |
getStandardFunctionResourceMap()
the map that maps the standard function IDs to display names
|
protected <T> List<T> |
getUnmamangedApplicationObjects(OwAOType<T> type,
String name,
boolean forceSpecificObj) |
protected Map<String,String> |
getVirtualFoldersCategoryMap()
get a map of resources for the category: virtual folders
|
void |
init(OwRoleManagerContext mainContext_p,
OwXMLUtil configNode_p)
init the manager, set context
optionally set a prefix to distinguish several different applications.
|
boolean |
isGlobalRole(String rolename_p)
Determine if the given role name is a global role or a mandator specific role.
|
protected boolean |
isInitialized()
true after login init
|
protected boolean |
isMsOfficeEmbedded()
check if we run embedded in office
|
boolean |
isStaticResourceCategory(int category_p) |
void |
loginInit()
init called AFTER the user has logged in.
|
void |
refreshStaticConfiguration()
update the configuration data
|
protected void |
updateAllowedPlugins()
update the allowed plugins after role change
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canExplicitDeny, canPersistAccessMask, getAccessMask, getAccessRights, getAllowedResources, getMasterRole, getMasterRoleDisplayName, getMasterRoles, hasAccessMaskRight, hasMasterRoles, isAllowed, isGlobalRoleModificationAllowed, replaceResource, setAccessMask, setAccessRights, setMasterRole
public static final String MS_OFFICE_EMBEDED_DESIGN
public static final String APPLICATION_PREFIX_DELIMITER
protected OwXMLUtil m_ConfigNode
protected Map m_MimeMap
protected Map m_DefaultMimeMap
protected Map m_PluginTypesMap
protected Map m_PluginMap
protected Map m_AllowedPluginTypesMap
protected Map m_SelectiveConfigurationMap
protected String m_strDesign
protected Map m_PluginCategoryMap
protected Map m_DesignCategoryMap
protected Map m_SearchTemplateCategoryMap
protected Map<String,String> m_VirtualFolderCategoryMap
protected Map m_GroupBoxCategoryMap
protected Map m_objectClassesMap
protected Map m_indexFieldsMap
protected Map getCategoryMap()
protected Map getStandardFunctionResourceMap()
protected boolean isInitialized()
protected OwXMLUtil getConfigNode()
protected OwBaseUserInfo getCurrentUser() throws Exception
Exception
public static void applicationInitalize(OwBaseInitializer initializer_p) throws OwConfigurationException
OwStandardRoleManagerInitialisingContextListener
is configured for your application.initializer_p
- OwConfigurationException
public void refreshStaticConfiguration() throws OwConfigurationException
refreshStaticConfiguration
in interface OwRoleManager
OwConfigurationException
public boolean canRefreshStaticConfiguration() throws Exception
canRefreshStaticConfiguration
in interface OwRoleManager
Exception
public void init(OwRoleManagerContext mainContext_p, OwXMLUtil configNode_p) throws OwException
init
in interface OwRoleManager
configNode_p
- OwXMLUtil node with configuration informationmainContext_p
- reference to the main app context of the applicationOwException
protected boolean isMsOfficeEmbedded()
public void loginInit() throws Exception
loginInit
in interface OwRoleManager
Exception
protected OwRoleManagerContext getContext()
public String getDesign() throws Exception
getDesign
in interface OwRoleManager
Exception
public List getPlugins(String strType_p) throws Exception
getPlugins
in interface OwRoleManager
Exception
public OwXMLUtil getPlugin(String strID_p) throws Exception
getPlugin
in interface OwRoleManager
Exception
protected void updateAllowedPlugins()
public OwXMLUtil getMIMENode(String strMIMEType_p) throws Exception
<?xml version="1.0" ?> <mimetable> <mime typ="file/txt"> <icon>file_txt.png</icon> <viewerservlet>getConent</viewerservlet> </mime> <!-- further MIME entries--> </mimetable>
getMIMENode
in interface OwRoleManager
strMIMEType_p
- OwObject MIMETypeException
public OwXMLUtil getDefaultMIMENode(int iObjectType_p) throws Exception
getDefaultMIMENode
in interface OwRoleManager
iObjectType_p
- ObjecttypeException
public Collection getCategories()
OwRoleManager
getCategories
in interface OwRoleManager
public Collection getConfiguredCategories()
OwRoleManager
getConfiguredCategories
in interface OwRoleManager
Collection
of Integer
keys (categories).public String getCategoryDisplayName(Locale locale_p, int categorie_p)
getCategoryDisplayName
in interface OwRoleManager
locale_p
- Locale to usecategorie_p
- Integer from getCategories() methodprotected Map getPluginCategoryMap()
protected Map getDesignCategoryMap()
protected Map getRepositories()
protected Map<String,String> getVirtualFoldersCategoryMap() throws Exception
Exception
protected Map<String,OwWorkflowDescription> getBpmProcessDefinitionsCategoryMap() throws Exception
Exception
protected Map getSearchTemplateCategoryMap() throws Exception
Exception
protected Map getGroupBoxCategoryMap() throws OwException
OwException
protected <T> List<T> getUnmamangedApplicationObjects(OwAOType<T> type, String name, boolean forceSpecificObj) throws OwException
OwException
protected Map getObjectClassesMap() throws Exception
Exception
protected Map getIndexFieldsMap() throws Exception
Exception
protected abstract String dynamicResourceNameFromId(Locale locale_p, String resourceId_p, int category_p)
locale_p
- resourceId_p
- category_p
- public boolean isStaticResourceCategory(int category_p)
isStaticResourceCategory
in interface OwRoleManager
protected abstract Collection<String> getDynamicResources(int category_p) throws OwException
category_p
- OwException
public Collection getResources(int category_p) throws Exception
getResources
in interface OwRoleManager
category_p
- int categoryException
public String getResourceDisplayName(Locale locale_p, int categorie_p, String strID_p)
getResourceDisplayName
in interface OwRoleManager
locale_p
- Locale to usecategorie_p
- Integer from getCategories() methodstrID_p
- String resource idpublic Map getAccessMaskDescriptions(int category_p)
getAccessMaskDescriptions
in interface OwRoleManager
category_p
- the category to retrieve the flag map forpublic boolean isGlobalRole(String rolename_p)
isGlobalRole
in interface OwRoleManager
rolename_p
- the name of the role to checkCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.