public class RequestAttributeWorkspaceSelector extends DefaultWorkspaceSelector implements LogEnabled, Contextualizable
DefaultWorkspaceSelector
using a context attribute for selecting
the workspace.Modifier and Type | Field and Description |
---|---|
private static String |
__WORKSPACE_ATTRIBUTE |
private Context |
_context |
private Logger |
_logger |
_repository
ROLE
Constructor and Description |
---|
RequestAttributeWorkspaceSelector() |
Modifier and Type | Method and Description |
---|---|
void |
contextualize(Context context) |
void |
enableLogging(Logger logger) |
static String |
getForcedWorkspace(Request request)
Retrieves the workspace forced.
|
String |
getWorkspace()
Returns the current JCR workspace
|
static void |
setForcedWorkspace(Request request,
String workspaceName)
Forces the workspace to use.
|
getWorkspaces, service
private static final String __WORKSPACE_ATTRIBUTE
public RequestAttributeWorkspaceSelector()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void enableLogging(Logger logger)
enableLogging
in interface LogEnabled
public static void setForcedWorkspace(Request request, String workspaceName)
request
- the current requestworkspaceName
- the workspace name.public static String getForcedWorkspace(Request request)
request
- the current requestnull
for the default one.public String getWorkspace()
WorkspaceSelector
getWorkspace
in interface WorkspaceSelector
getWorkspace
in class DefaultWorkspaceSelector