public abstract class AbstractUserWorkspaceImpl extends Object implements UserWorkspaceService
UnrestrictedSessionRunner
while creating UserWorkspaces
and associated resourcesModifier and Type | Class and Description |
---|---|
protected class |
AbstractUserWorkspaceImpl.RootDomainFinder |
protected class |
AbstractUserWorkspaceImpl.UnrestrictedRootCreator |
protected class |
AbstractUserWorkspaceImpl.UnrestrictedUserWorkspaceFinder |
Modifier and Type | Field and Description |
---|---|
protected static char |
ESCAPE_CHAR |
protected static String |
ESCAPED_CHARS |
protected int |
maxsize |
protected String |
targetDomainName |
Constructor and Description |
---|
AbstractUserWorkspaceImpl() |
Modifier and Type | Method and Description |
---|---|
protected String |
buildUserWorkspaceTitle(Principal principal,
String userName) |
protected String |
computePathUserWorkspaceRoot(CoreSession userCoreSession,
String usedUsername,
DocumentModel currentDocument) |
protected String |
digest(String username,
int maxsize) |
protected abstract DocumentModel |
doCreateUserWorkspace(CoreSession unrestrictedSession,
PathRef wsRef,
Principal principal,
String userName) |
protected abstract DocumentModel |
doCreateUserWorkspacesRoot(CoreSession unrestrictedSession,
PathRef rootRef) |
protected String |
escape(String string)
Bijective escaping for user names.
|
protected void |
generateCandidates(List<String> names,
String username,
int max) |
List<String> |
getCandidateUserWorkspaceNames(String username)
Finds the list of potential names for the user workspace.
|
protected UserWorkspaceServiceImplComponent |
getComponent() |
DocumentModel |
getCurrentUserPersonalWorkspace(CoreSession userCoreSession,
DocumentModel context) |
protected DocumentModel |
getCurrentUserPersonalWorkspace(Principal principal,
String userName,
CoreSession userCoreSession,
DocumentModel context)
This method handles the UserWorkspace creation with a Principal or a username.
|
DocumentModel |
getCurrentUserPersonalWorkspace(String userName,
DocumentModel currentDocument)
Gets the current user personal workspace from a lower level.
|
protected String |
getDomainName(CoreSession userCoreSession,
DocumentModel currentDocument) |
protected PathRef |
getExistingUserWorkspace(CoreSession session,
PathRef rootref,
Principal principal,
String username) |
protected PathRef |
getExistingUserWorkspaceRoot(CoreSession session,
String username,
DocumentModel context) |
protected String |
getUserName(Principal principal,
String username)
Gets the base username to use to determine a user's workspace.
|
DocumentModel |
getUserPersonalWorkspace(NuxeoPrincipal principal,
DocumentModel context)
Gets a detached user workspace of a specified user depending of the passed principal.
|
DocumentModel |
getUserPersonalWorkspace(String userName,
DocumentModel context)
Gets a detached user workspace of a specified user.
|
boolean |
isUnderUserWorkspace(Principal principal,
String username,
DocumentModel doc)
Checks whether the passed document is under the user's workspace (or is the workspace itself).
|
protected void |
notifyEvent(CoreSession coreSession,
DocumentModel document,
NuxeoPrincipal principal,
String eventId,
Map<String,Serializable> properties) |
protected static final char ESCAPE_CHAR
protected static final String ESCAPED_CHARS
protected String targetDomainName
protected final int maxsize
public AbstractUserWorkspaceImpl()
protected String getDomainName(CoreSession userCoreSession, DocumentModel currentDocument)
protected String getUserName(Principal principal, String username)
public List<String> getCandidateUserWorkspaceNames(String username)
protected String escape(String string)
Escapes some chars not allowed in a path segment or URL. The escaping character is a ~
followed by the
one-byte hex value of the character.
protected void generateCandidates(List<String> names, String username, int max)
protected String computePathUserWorkspaceRoot(CoreSession userCoreSession, String usedUsername, DocumentModel currentDocument)
public DocumentModel getCurrentUserPersonalWorkspace(String userName, DocumentModel currentDocument)
UserWorkspaceService
If this personal workspace does not exist then a new one will be created for the user who is represented by first argument.
getCurrentUserPersonalWorkspace
in interface UserWorkspaceService
userName
- the current usercurrentDocument
- the current document on which the user was onpublic DocumentModel getCurrentUserPersonalWorkspace(CoreSession userCoreSession, DocumentModel context)
getCurrentUserPersonalWorkspace
in interface UserWorkspaceService
protected DocumentModel getCurrentUserPersonalWorkspace(Principal principal, String userName, CoreSession userCoreSession, DocumentModel context)
protected PathRef getExistingUserWorkspaceRoot(CoreSession session, String username, DocumentModel context)
protected PathRef getExistingUserWorkspace(CoreSession session, PathRef rootref, Principal principal, String username)
public DocumentModel getUserPersonalWorkspace(NuxeoPrincipal principal, DocumentModel context)
UserWorkspaceService
getUserPersonalWorkspace
in interface UserWorkspaceService
principal
- of the wanted user's workspace ownercontext
- is a document to determine the domainpublic DocumentModel getUserPersonalWorkspace(String userName, DocumentModel context)
UserWorkspaceService
getUserPersonalWorkspace
in interface UserWorkspaceService
userName
- is the username of the wanted user's workspace ownercontext
- is a document to determine the domainpublic boolean isUnderUserWorkspace(Principal principal, String username, DocumentModel doc)
UserWorkspaceService
isUnderUserWorkspace
in interface UserWorkspaceService
principal
- the userusername
- the username, if principal is not availabledoc
- the documenttrue
if the document is under the user's workspaceprotected String buildUserWorkspaceTitle(Principal principal, String userName)
protected void notifyEvent(CoreSession coreSession, DocumentModel document, NuxeoPrincipal principal, String eventId, Map<String,Serializable> properties)
protected UserWorkspaceServiceImplComponent getComponent()
protected abstract DocumentModel doCreateUserWorkspacesRoot(CoreSession unrestrictedSession, PathRef rootRef)
protected abstract DocumentModel doCreateUserWorkspace(CoreSession unrestrictedSession, PathRef wsRef, Principal principal, String userName)
Copyright © 2017 Nuxeo. All rights reserved.