Class RequestAttributeWorkspaceSelector
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.repository.provider.RequestAttributeWorkspaceSelector
- All Implemented Interfaces:
WorkspaceSelector,LogEnabled,Contextualizable
public class RequestAttributeWorkspaceSelector
extends AbstractLogEnabled
implements Contextualizable, WorkspaceSelector
Workspace selector using a context attribute for selecting
the workspace.
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.provider.WorkspaceSelector
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) static StringgetForcedWorkspace(Request request) Retrieves the workspace forced.Returns the current JCR workspacestatic voidsetForcedWorkspace(Request request, String workspaceName) Forces the workspace to use.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
RequestAttributeWorkspaceSelector
public RequestAttributeWorkspaceSelector()
-
-
Method Details
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
setForcedWorkspace
Forces the workspace to use.- Parameters:
request- the current requestworkspaceName- the workspace name.
-
getForcedWorkspace
Retrieves the workspace forced.- Parameters:
request- the current request- Returns:
- the workspace forced or
nullfor the default one.
-
getWorkspace
Description copied from interface:WorkspaceSelectorReturns the current JCR workspace- Specified by:
getWorkspacein interfaceWorkspaceSelector- Returns:
- the current JCR workspace
-