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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) static String
getForcedWorkspace
(Request request) Retrieves the workspace forced.Returns the current JCR workspacestatic void
setForcedWorkspace
(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:
contextualize
in 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
null
for the default one.
-
getWorkspace
Description copied from interface:WorkspaceSelector
Returns the current JCR workspace- Specified by:
getWorkspace
in interfaceWorkspaceSelector
- Returns:
- the current JCR workspace
-