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 Modifier and Type Field Description private static String
__WORKSPACE_ATTRIBUTE
private Context
_context
-
Fields inherited from interface org.ametys.plugins.repository.provider.WorkspaceSelector
ROLE
-
-
Constructor Summary
Constructors Constructor Description RequestAttributeWorkspaceSelector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextualize(Context context)
static String
getForcedWorkspace(Request request)
Retrieves the workspace forced.String
getWorkspace()
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
-
-
-
-
Field Detail
-
__WORKSPACE_ATTRIBUTE
private static final String __WORKSPACE_ATTRIBUTE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RequestAttributeWorkspaceSelector
public RequestAttributeWorkspaceSelector()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
setForcedWorkspace
public static void setForcedWorkspace(Request request, String workspaceName)
Forces the workspace to use.- Parameters:
request
- the current requestworkspaceName
- the workspace name.
-
getForcedWorkspace
public static String getForcedWorkspace(Request request)
Retrieves the workspace forced.- Parameters:
request
- the current request- Returns:
- the workspace forced or
null
for the default one.
-
getWorkspace
public String getWorkspace()
Description copied from interface:WorkspaceSelector
Returns the current JCR workspace- Specified by:
getWorkspace
in interfaceWorkspaceSelector
- Returns:
- the current JCR workspace
-
-