public class ExtensionUserManagement extends ExtensionAdaptor implements ContextPanelFactory, ContextDataFactory
Users
, Roles
, and related entities.
This class also handles the loading of AuthenticationMethodType
and AuthenticationMethodType
classes in the system using the AddOnLoader ( ExtensionFactory.getAddOnLoader()
).
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_CONFIG_USERS |
static String |
CONTEXT_CONFIG_USERS_USER |
static int |
EXTENSION_ORDER
The extension's order during loading.
|
static String |
NAME
The NAME of the extension.
|
Constructor and Description |
---|
ExtensionUserManagement()
Instantiates a new extension.
|
Modifier and Type | Method and Description |
---|---|
void |
addSharedContextUser(Context sharedContext,
User user)
Add a new user shown in the UI (for the Users context panel) that corresponds to a particular
shared Context.
|
void |
discardContext(Context ctx) |
void |
discardContexts() |
void |
exportContextData(Context ctx,
org.apache.commons.configuration.Configuration config)
Export the Context data into the given configuration
|
String |
getAuthor() |
AbstractContextPropertiesPanel |
getContextPanel(Context ctx) |
ContextUserAuthManager |
getContextUserAuthManager(int contextId)
Gets the context user auth manager for a given context.
|
List<Class<? extends Extension>> |
getDependencies()
Gets the list of
Extension s that this extension depends on. |
protected ExtensionHttpSessions |
getExtensionHttpSessions()
Gets the ExtensionHttpSessions, if it's enabled.
|
List<User> |
getSharedContextUsers(Context sharedContext) |
List<User> |
getUIConfiguredUsers(int contextId)
Gets an unmodifiable view of the users that are currently shown in the UI.
|
UsersTableModel |
getUIConfiguredUsersModel(int contextId)
Gets the model of the users that are currently shown in the UI.
|
String |
getUIName()
By default returns the name returned by
getName() . |
URL |
getURL() |
void |
hook(ExtensionHook extensionHook)
Called during extension's initialisation to allow to add new functionality to core
components.
|
void |
importContextData(Context ctx,
org.apache.commons.configuration.Configuration config)
Import the Context data from the given configuration
|
void |
loadContextData(Session session,
Context context)
Loads the Context data from the given session.
|
void |
persistContextData(Session session,
Context context)
Save the Context data into the given session.
|
void |
removeContextUsers(int contextId)
Removes all the that correspond to a Context with a given id.
|
void |
removeSharedContextUsers(Context sharedContext)
Removes all the users that are shown in the UI (for the Users context panel) and correspond
to a particular shared Context.
|
boolean |
supportsDb(String type)
No database tables used, so all supported
|
canUnload, databaseOpen, destroy, getActiveActions, getAddOn, getDescription, getExtensionMenu, getExtensionView, getI18nPrefix, getMessages, getModel, getName, getOrder, getUnsavedResources, getView, init, initModel, initView, initXML, isCore, isDepreciated, isEnabled, optionsLoaded, postInit, postInstall, setAddOn, setDescription, setEnabled, setI18nPrefix, setMessages, setName, setOrder, start, stop, supportsLowMemory, unload
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getVersion
public static final String CONTEXT_CONFIG_USERS
public static final String CONTEXT_CONFIG_USERS_USER
public static final int EXTENSION_ORDER
public static final String NAME
public ExtensionUserManagement()
protected ExtensionHttpSessions getExtensionHttpSessions()
public String getUIName()
ExtensionAdaptor
getName()
.getUIName
in interface Extension
getUIName
in class ExtensionAdaptor
null
ExtensionAdaptor.getName()
public void hook(ExtensionHook extensionHook)
Extension
hook
in interface Extension
hook
in class ExtensionAdaptor
extensionHook
- the hook to add the components.public List<Class<? extends Extension>> getDependencies()
Extension
Extension
s that this extension depends on.getDependencies
in interface Extension
getDependencies
in class ExtensionAdaptor
null
) if none.public URL getURL()
getURL
in interface Extension
getURL
in class ExtensionAdaptor
public AbstractContextPropertiesPanel getContextPanel(Context ctx)
getContextPanel
in interface ContextPanelFactory
public ContextUserAuthManager getContextUserAuthManager(int contextId)
contextId
- the context idpublic List<User> getUIConfiguredUsers(int contextId)
contextId
- the context idpublic UsersTableModel getUIConfiguredUsersModel(int contextId)
contextId
- the context idpublic void discardContexts()
discardContexts
in interface ContextPanelFactory
public void discardContext(Context ctx)
discardContext
in interface ContextPanelFactory
public void loadContextData(Session session, Context context)
ContextDataFactory
loadContextData
in interface ContextDataFactory
session
- the session to load from, not null
.context
- the context to load into, not null
.public void persistContextData(Session session, Context context)
ContextDataFactory
persistContextData
in interface ContextDataFactory
session
- the session to persist into, not null
.context
- the context to persist from, not null
.public void removeSharedContextUsers(Context sharedContext)
sharedContext
- the shared contextpublic void addSharedContextUser(Context sharedContext, User user)
sharedContext
- the shared contextuser
- the userpublic void removeContextUsers(int contextId)
contextId
- the context idpublic void exportContextData(Context ctx, org.apache.commons.configuration.Configuration config)
ContextDataFactory
exportContextData
in interface ContextDataFactory
ctx
- the context to export, not null
.config
- the Configuration
where to export the context data, not null
.public void importContextData(Context ctx, org.apache.commons.configuration.Configuration config)
ContextDataFactory
importContextData
in interface ContextDataFactory
ctx
- the context to import the context data toconfig
- the Configuration
containing the context data, not null
.public boolean supportsDb(String type)
supportsDb
in interface Extension
supportsDb
in class ExtensionAdaptor
type
- the db typeDatabase.getType()