public class SiteServiceImpl extends org.springframework.extensions.surf.util.AbstractLifecycleBean implements SiteServiceInternal, SiteModel, NodeArchiveServicePolicies.BeforePurgeNodePolicy, NodeServicePolicies.OnRestoreNodePolicy
SiteService.SiteMembersCallback, SiteService.SortFields
Policy.Arg
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
logger
Logger
|
static org.alfresco.service.cmr.repository.StoreRef |
SITE_STORE
The DM store where site's are kept
|
DOCUMENT_LIBRARY
ASPECT_SITE_CONTAINER, PROP_COMPONENT_ID, PROP_SITE_PRESET, PROP_SITE_VISIBILITY, SITE_COLLABORATOR, SITE_CONSUMER, SITE_CONTRIBUTOR, SITE_CUSTOM_PROPERTY_PREFIX, SITE_CUSTOM_PROPERTY_URL, SITE_MANAGER, SITE_MODEL_PREFIX, SITE_MODEL_URL, STANDARD_PERMISSIONS, TYPE_SITE, TYPE_SITES
QNAME
QNAME
Constructor and Description |
---|
SiteServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
beforePurgeNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Called before a node is purged (deleted from archive).
|
boolean |
canAddMember(String shortName,
String authorityName,
String role)
Can the current user add the authority "authorityName" to the site "shortName" with role "role"?
|
void |
cleanSitePermissions(org.alfresco.service.cmr.repository.NodeRef targetNode,
SiteInfo containingSite)
This method recursively cleans the site permissions on the specified NodeRef and all its primary
descendants.
|
int |
countAuthoritiesWithRole(String shortName,
String role) |
org.alfresco.service.cmr.repository.NodeRef |
createContainer(String shortName,
String componentId,
org.alfresco.service.namespace.QName containerType,
Map<org.alfresco.service.namespace.QName,Serializable> containerProperties)
Creates a container for a component is a site of the given container type (must be a sub-type of st:siteContainer)
|
SiteInfo |
createSite(String sitePreset,
String passedShortName,
String title,
String description,
boolean isPublic)
Create a new site.
|
SiteInfo |
createSite(String sitePreset,
String passedShortName,
String title,
String description,
SiteVisibility visibility)
Create a new site.
|
SiteInfo |
createSite(String sitePreset,
String passedShortName,
String title,
String description,
SiteVisibility visibility,
org.alfresco.service.namespace.QName siteType)
Create a new site.
|
void |
deleteSite(String shortName)
Delete the site.
|
List<SiteInfo> |
findSites(String filter,
int size)
This method will find all
sites available to the currently authenticated user based on
the specified site filter and result set size. |
List<SiteInfo> |
findSites(String filter,
String sitePresetFilter,
int size)
This method will find all
sites available to the currently authenticated user based on
the specified site filter, site preset filter and result set size. |
org.alfresco.service.cmr.repository.NodeRef |
getContainer(String shortName,
String componentId)
Gets the "container" folder for the specified
component.
|
String |
getMembersRole(String shortName,
String authorityName) |
SiteMemberInfo |
getMembersRoleInfo(String shortName,
String authorityName)
Gets the extended role information of the specified user.
|
List<String> |
getMembersRoles(String shortName,
String authorityName) |
Comparator<String> |
getRoleComparator() |
SiteInfo |
getSite(org.alfresco.service.cmr.repository.NodeRef nodeRef)
This method gets the
SiteInfo for the Share Site which contains the given NodeRef. |
SiteInfo |
getSite(String shortName)
Gets site information based on the short name of a site.
|
static org.alfresco.service.cmr.repository.NodeRef |
getSiteContainer(String siteShortName,
String componentName,
boolean create,
SiteService siteService,
TransactionService transactionService,
TaggingService taggingService)
Helper method to create a container if missing, and mark it as a
tag scope if it isn't already one
|
String |
getSiteGroup(String shortName)
Gets the sites group.
|
String |
getSiteGroup(String shortName,
boolean withGroupPrefix)
Helper method to get the name of the site group
|
String |
getSiteRoleGroup(String shortName,
String role)
Gets the sites role group.
|
String |
getSiteRoleGroup(String shortName,
String permission,
boolean withGroupPrefix)
Helper method to get the name of the site permission group
|
List<String> |
getSiteRoles()
Gets a list of all the currently available roles that a user can perform on
all sites
|
List<String> |
getSiteRoles(org.alfresco.service.namespace.QName type) |
List<String> |
getSiteRoles(String shortName)
Gets a list of all the currently available roles that a user can perform on
a specific site.
|
org.alfresco.service.cmr.repository.NodeRef |
getSiteRoot()
Get the node reference that is the site root
|
String |
getSiteShortName(org.alfresco.service.cmr.repository.NodeRef nodeRef)
This method gets the shortName for the Share Site which contains the given NodeRef.
|
boolean |
hasContainer(String shortName,
String componentId)
Determines if a "container" folder for the specified component exists.
|
boolean |
hasCreateSitePermissions()
This method checks if the currently authenticated user has permission to create sites.
|
boolean |
hasSite(String shortName)
Returns true if the site exists.
|
void |
init()
Checks that all necessary properties and services have been provided.
|
boolean |
isMember(String shortName,
String authorityName)
Indicates whether an authority is a member of a site or not
|
boolean |
isSiteAdmin(String userName)
Indicates whether the specified user is a site administrator or not.
|
org.alfresco.query.PagingResults<FileInfo> |
listContainers(String shortName,
org.alfresco.query.PagingRequest pagingRequest)
Returns a paged list of top level containers for the site
|
void |
listMembers(String shortName,
String nameFilter,
String roleFilter,
boolean collapseGroups,
SiteService.SiteMembersCallback callback)
List the members of the site.
|
Map<String,String> |
listMembers(String shortName,
String nameFilter,
String roleFilter,
int size)
List the members of the site.
|
Map<String,String> |
listMembers(String shortName,
String nameFilter,
String roleFilter,
int size,
boolean collapseGroups)
List the members of the site.
|
protected void |
listMembersImpl(String shortName,
String nameFilter,
String roleFilter,
boolean collapseGroups,
SiteService.SiteMembersCallback callback) |
protected Map<String,String> |
listMembersImpl(String shortName,
String nameFilter,
String roleFilter,
int size,
boolean collapseGroups) |
List<SiteMemberInfo> |
listMembersInfo(String shortName,
String nameFilter,
String roleFilter,
int size,
boolean collapseGroups)
List the members of the site.
|
protected List<SiteMemberInfo> |
listMembersInfoImpl(String shortName,
String nameFilter,
String roleFilter,
int size,
boolean collapseGroups) |
org.alfresco.query.PagingResults<SiteMembership> |
listMembersPaged(String shortName,
boolean collapseGroups,
List<org.alfresco.util.Pair<SiteService.SortFields,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
Gets the role of the specified user.
|
List<SiteMembership> |
listSiteMemberships(String userName,
int size)
Lists all the memberships in sites that the specified user is in.
|
org.alfresco.query.PagingResults<SiteInfo> |
listSites(List<FilterProp> filterProps,
List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
|
List<SiteInfo> |
listSites(Set<String> siteNames) |
List<SiteInfo> |
listSites(String userName)
List all the sites that the specified user has a explicit membership to.
|
List<SiteInfo> |
listSites(String userName,
int size)
List all the sites that the specified user has a explicit membership to.
|
List<SiteInfo> |
listSites(String nameFilter,
String sitePresetFilter)
List the available sites.
|
List<SiteInfo> |
listSites(String filter,
String sitePresetFilter,
int size)
List the available sites.
|
org.alfresco.query.PagingResults<SiteMembership> |
listSitesPaged(String userName,
List<org.alfresco.util.Pair<SiteService.SortFields,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
List all the sites that the specified user has a explicit membership to.
|
protected void |
onBootstrap(org.springframework.context.ApplicationEvent event) |
void |
onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Called after an archived node is restored.
|
protected void |
onShutdown(org.springframework.context.ApplicationEvent event) |
void |
removeMembership(String shortName,
String authorityName)
Clears an authorities role within a site
|
String |
resolveSite(String group) |
void |
setActivityService(ActivityService activityService)
Set activity service
|
void |
setAuthenticationContext(AuthenticationContext authenticationContext)
Set authentication component
|
void |
setAuthorityService(AuthorityService authorityService)
Set the authority service
|
void |
setBehaviourFilter(BehaviourFilter behaviourFilter) |
void |
setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry)
Set the registry of
canned queries |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service
|
void |
setDirectNodeService(org.alfresco.service.cmr.repository.NodeService directNodeService)
Set the unprotected node service
|
void |
setEventPublisher(org.alfresco.repo.events.EventPublisher eventPublisher) |
void |
setFileFolderService(FileFolderService fileFolderService)
Set file folder service
|
void |
setMembership(String shortName,
String authorityName,
String role)
Sets the role of an authority within a site
|
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Set Namespace service
|
void |
setNodeDAO(NodeDAO nodeDAO) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set node service
|
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Set permission service
|
void |
setPersonService(PersonService personService)
Set person service
|
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setPreferenceService(PreferenceService preferenceService)
Deprecated.
|
void |
setPublicServiceAccessService(PublicServiceAccessService publicServiceAccessService) |
void |
setRoleComparator(Comparator<String> roleComparator) |
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Set search service
|
void |
setSingletonCache(org.alfresco.repo.cache.SimpleCache<String,Object> singletonCache) |
void |
setSiteNodeRefCache(org.alfresco.repo.cache.SimpleCache<String,org.alfresco.service.cmr.repository.NodeRef> siteNodeRefCache) |
void |
setSitesPermissionsCleaner(SitesPermissionCleaner sitesPermissionsCleaner) |
void |
setSitesXPath(String sitesXPath)
Set the path to the location of the sites root folder.
|
void |
setSysAdminParams(SysAdminParams sysAdminParams) |
void |
setTaggingService(TaggingService taggingService)
Set the tagging service
|
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
Set the tenant service
|
void |
setTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
Sets helper that provides transaction callbacks
|
void |
updateSite(SiteInfo siteInfo)
Update the site information.
|
protected static org.apache.commons.logging.Log logger
public static final org.alfresco.service.cmr.repository.StoreRef SITE_STORE
public void setSitesXPath(String sitesXPath)
./app:company_home/st:sites
sitesXPath
- a valid XPath@Deprecated public void setPreferenceService(PreferenceService preferenceService)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setDirectNodeService(org.alfresco.service.cmr.repository.NodeService directNodeService)
public void setFileFolderService(FileFolderService fileFolderService)
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
public void setActivityService(ActivityService activityService)
public void setPersonService(PersonService personService)
public void setAuthenticationContext(AuthenticationContext authenticationContext)
public void setTaggingService(TaggingService taggingService)
public void setAuthorityService(AuthorityService authorityService)
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService
- dictionary servicepublic void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
tenantService
- tenant servicepublic void setSingletonCache(org.alfresco.repo.cache.SimpleCache<String,Object> singletonCache)
public void setSiteNodeRefCache(org.alfresco.repo.cache.SimpleCache<String,org.alfresco.service.cmr.repository.NodeRef> siteNodeRefCache)
public void setTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setRoleComparator(Comparator<String> roleComparator)
public void setSysAdminParams(SysAdminParams sysAdminParams)
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
public void setSitesPermissionsCleaner(SitesPermissionCleaner sitesPermissionsCleaner)
public void setPublicServiceAccessService(PublicServiceAccessService publicServiceAccessService)
public void setNodeDAO(NodeDAO nodeDAO)
public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry)
canned queries
public Comparator<String> getRoleComparator()
public void init()
protected void onBootstrap(org.springframework.context.ApplicationEvent event)
onBootstrap
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
protected void onShutdown(org.springframework.context.ApplicationEvent event)
onShutdown
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
public boolean hasCreateSitePermissions()
SiteService
hasCreateSitePermissions
in interface SiteService
true
if current user can create sites, else false
.public SiteInfo createSite(String sitePreset, String passedShortName, String title, String description, boolean isPublic)
SiteService
createSite
in interface SiteService
sitePreset
- site preset namepassedShortName
- site short name, must be uniquetitle
- site titledescription
- site descriptionisPublic
- whether the site is public or not (true = public, false = private)SiteService.createSite(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)
public SiteInfo createSite(String sitePreset, String passedShortName, String title, String description, SiteVisibility visibility)
SiteService
createSite
in interface SiteService
sitePreset
- site preset namepassedShortName
- site short name, must be uniquetitle
- site titledescription
- site descriptionvisibility
- site visibility (public|moderated|private)SiteService.createSite(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)
public SiteInfo createSite(String sitePreset, String passedShortName, String title, String description, SiteVisibility visibility, org.alfresco.service.namespace.QName siteType)
SiteService
createSite
in interface SiteService
sitePreset
- site preset namepassedShortName
- site short name, must be uniquetitle
- site titledescription
- site descriptionvisibility
- site visibility (public|moderated|private)siteType
- type of site to create, must be a sub-type of st:sitepublic String getSiteGroup(String shortName)
SiteService
getSiteGroup
in interface SiteService
shortName
- site short nameSiteService.getSiteGroup(java.lang.String)
public String getSiteRoleGroup(String shortName, String role)
SiteService
getSiteRoleGroup
in interface SiteService
shortName
- site short namerole
- membership roleSiteService.getSiteRoleGroup(java.lang.String,
java.lang.String)
public String getSiteGroup(String shortName, boolean withGroupPrefix)
shortName
- site short namepublic String getSiteRoleGroup(String shortName, String permission, boolean withGroupPrefix)
shortName
- site short namepermission
- permission namewithGroupPrefix
- - should the name have the GROUP_ prefix?public org.alfresco.service.cmr.repository.NodeRef getSiteRoot()
getSiteRoot
in interface SiteServiceInternal
getSiteRoot
in interface SiteService
public List<SiteInfo> findSites(String filter, int size)
SiteService
sites
available to the currently authenticated user based on
the specified site filter and result set size.
The filter parameter will match any sites whose cm:name
, cm:title
or cm:description
contain the specified string (ignoring case).
Note that this method uses Alfresco Full Text Search to retrieve results
and depending on server Lucene, SOLR configuration may only offer eventually consistent results.findSites
in interface SiteService
filter
- Any supplied filter will be wrapped in asterisks (e.g. 'foo*') and used to match the sites' cm:name, cm:title or cm:description.size
- this parameter specifies a maximum result set size.public List<SiteInfo> findSites(String filter, String sitePresetFilter, int size)
SiteService
sites
available to the currently authenticated user based on
the specified site filter, site preset filter and result set size.
The filter parameter will match any sites whose cm:name
, cm:title
or cm:description
contain the specified string (ignoring case).
Note that this method uses Alfresco Full Text Search to retrieve results
and depending on server Lucene, SOLR configuration may only offer eventually consistent results.findSites
in interface SiteService
filter
- Any supplied filter will be wrapped in asterisks (e.g. '*foo*') and used to match the sites' cm:name, cm:title or cm:description.sitePresetFilter
- a site preset filter name to match against.size
- this parameter specifies a maximum result set size.public List<SiteInfo> listSites(String nameFilter, String sitePresetFilter)
SiteService
cm:name
or
cm:title
or cm:description
start with
the specified string (ignoring case). The listing of sites whose cm:names (or titles or descriptions) contain the
specified string is no longer supported. To retrieve sites whose cm:names etc contain a substring, SiteService.findSites(String, String, int)
should be used instead.listSites
in interface SiteService
nameFilter
- filtersitePresetFilter
- site preset filterSiteService.listSites(java.lang.String, java.lang.String)
public List<SiteInfo> listSites(String filter, String sitePresetFilter, int size)
SiteService
cm:name
or
cm:title
or cm:description
start with
the specified string (ignoring case). The listing of sites whose cm:names (or titles or descriptions) contain the
specified string is no longer supported. To retrieve sites whose cm:names etc contain a substring, SiteService.findSites(String, String, int)
should be used instead.
THIS METHOD CAN RETURN INCOMPLETE RESULTS WHILE CACHES CATCH UP WITH REALITY
(BM-0012: Run v420b1494_01: (CMIS) GetSites is Slow).listSites
in interface SiteService
filter
- filter (sites whose cm:name, cm:title or cm:description START WITH filter)sitePresetFilter
- site preset filter (sites whose preset EQUALS sitePresetFilter)size
- list maximum size or zero for allSiteService.listSites(java.lang.String, java.lang.String, int)
public List<SiteInfo> listSites(String userName)
SiteService
listSites
in interface SiteService
userName
- user namepublic List<SiteInfo> listSites(String userName, int size)
SiteService
listSites
in interface SiteService
userName
- user namesize
- list maximum size or zero for allSiteService.listSites(java.lang.String, int)
public org.alfresco.query.PagingResults<SiteInfo> listSites(List<FilterProp> filterProps, List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
listSites
in interface SiteService
filterProps
- property filterssortProps
- sorting optionspagingRequest
- paging optionspublic String resolveSite(String group)
resolveSite
in interface SiteService
public SiteInfo getSite(String shortName)
SiteService
Returns null if the site can not be found.
getSite
in interface SiteService
shortName
- the site short nameSiteService.getSite(java.lang.String)
public SiteInfo getSite(org.alfresco.service.cmr.repository.NodeRef nodeRef)
SiteService
SiteInfo
for the Share Site which contains the given NodeRef.
If the given NodeRef is not contained within a Share Site, then null
is returned.getSite
in interface SiteService
nodeRef
- the node whose containing site's info is to be found.null
if node is not in a site.SiteService.getSite(org.alfresco.service.cmr.repository.NodeRef)
public String getSiteShortName(org.alfresco.service.cmr.repository.NodeRef nodeRef)
SiteService
null
is returned.getSiteShortName
in interface SiteService
nodeRef
- the node whose containing site's info is to be found.null
if node is not in a site.SiteService.getSiteShortName(org.alfresco.service.cmr.repository.NodeRef)
public boolean hasSite(String shortName)
SiteService
hasSite
in interface SiteService
shortName
- the site short nameSiteService.hasSite(java.lang.String)
public void updateSite(SiteInfo siteInfo)
SiteService
Note that the short name and site preset of a site can not be updated once the site has been created.
updateSite
in interface SiteService
siteInfo
- site informationSiteService.updateSite(org.alfresco.service.cmr.site.SiteInfo)
public void deleteSite(String shortName)
SiteService
deleteSite
in interface SiteService
shortName
- site short nameSiteService.deleteSite(java.lang.String)
public void beforePurgeNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeArchiveServicePolicies.BeforePurgeNodePolicy
beforePurgeNode
in interface NodeArchiveServicePolicies.BeforePurgeNodePolicy
nodeRef
- the node referencepublic void listMembers(String shortName, String nameFilter, String roleFilter, boolean collapseGroups, SiteService.SiteMembersCallback callback)
SiteService
Name and role filters are optional and if not specified all the members of the site are returned.
listMembers
in interface SiteService
shortName
- site short namenameFilter
- name filterroleFilter
- role filtercollapseGroups
- true if collapse member groups into user list, false otherwisecallback
- callbackprotected void listMembersImpl(String shortName, String nameFilter, String roleFilter, boolean collapseGroups, SiteService.SiteMembersCallback callback)
public org.alfresco.query.PagingResults<SiteMembership> listMembersPaged(String shortName, boolean collapseGroups, List<org.alfresco.util.Pair<SiteService.SortFields,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
SiteService
listMembersPaged
in interface SiteService
shortName
- site short namecollapseGroups
- true if collapse member groups into user list, false otherwisepagingRequest
- the paging requestpublic void onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
NodeServicePolicies.OnRestoreNodePolicy
onRestoreNode
in interface NodeServicePolicies.OnRestoreNodePolicy
childAssocRef
- the newly created child association referenceNodeServicePolicies.OnRestoreNodePolicy.onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
public Map<String,String> listMembers(String shortName, String nameFilter, String roleFilter, int size)
SiteService
Name and role filters are optional and if not specified all the members of the site are returned.
listMembers
in interface SiteService
shortName
- site short namenameFilter
- name filterroleFilter
- role filtersize
- max results size crop if >0SiteService.listMembers(java.lang.String, java.lang.String, java.lang.String, int)
public Map<String,String> listMembers(String shortName, String nameFilter, String roleFilter, int size, boolean collapseGroups)
SiteService
listMembers
in interface SiteService
shortName
- site short namenameFilter
- name filterroleFilter
- role filtersize
- max results size crop if >0collapseGroups
- true if collapse member groups into user list, false otherwisepublic List<SiteMemberInfo> listMembersInfo(String shortName, String nameFilter, String roleFilter, int size, boolean collapseGroups)
SiteService
listMembersInfo
in interface SiteService
shortName
- site short namenameFilter
- name filterroleFilter
- role filtersize
- max results size crop if >0collapseGroups
- true if collapse member groups into user list, false otherwiseSiteService.listMembersInfo(String,
String, String, int, boolean)
protected Map<String,String> listMembersImpl(String shortName, String nameFilter, String roleFilter, int size, boolean collapseGroups)
protected List<SiteMemberInfo> listMembersInfoImpl(String shortName, String nameFilter, String roleFilter, int size, boolean collapseGroups)
public SiteMemberInfo getMembersRoleInfo(String shortName, String authorityName)
SiteService
getMembersRoleInfo
in interface SiteService
shortName
- site short nameauthorityName
- full authority name (so if it's a group then its prefixed with 'GROUP_')SiteService.getMembersRoleInfo(java.lang.String, java.lang.String)
public String getMembersRole(String shortName, String authorityName)
getMembersRole
in interface SiteService
SiteService.getMembersRole(java.lang.String,
java.lang.String)
public List<String> getSiteRoles()
SiteService
getSiteRoles
in interface SiteService
SiteService.getSiteRoles()
public List<String> getSiteRoles(String shortName)
SiteService
SiteService.getSiteRoles()
if your site is of a custom type.getSiteRoles
in interface SiteService
SiteService.getSiteRoles(String)
public boolean isMember(String shortName, String authorityName)
SiteService
isMember
in interface SiteService
shortName
- site short nameauthorityName
- authority name (so if it's a group then its prefixed with 'GROUP_')SiteService.isMember(java.lang.String, java.lang.String)
public void removeMembership(String shortName, String authorityName)
SiteService
removeMembership
in interface SiteService
shortName
- site short nameauthorityName
- authority name (so if it's a group then its prefixed with 'GROUP_')SiteService.removeMembership(java.lang.String, java.lang.String)
public boolean canAddMember(String shortName, String authorityName, String role)
SiteService
canAddMember
in interface SiteService
shortName
- site short name, must be uniqueauthorityName
- authority to addrole
- site roleSiteService.canAddMember(java.lang.String,
java.lang.String, java.lang.String)
public void setMembership(String shortName, String authorityName, String role)
SiteService
setMembership
in interface SiteService
shortName
- site short nameauthorityName
- authority name (so if it's a group then its prefixed with 'GROUP_')role
- site roleSiteService.setMembership(java.lang.String,
java.lang.String, java.lang.String)
public org.alfresco.service.cmr.repository.NodeRef createContainer(String shortName, String componentId, org.alfresco.service.namespace.QName containerType, Map<org.alfresco.service.namespace.QName,Serializable> containerProperties)
SiteService
If no container type is specified then a node of type st:siteContainer is created.
The map of container properties are set on the created container node. Null can be provided when no properties need to be set.
createContainer
in interface SiteService
shortName
- site short namecomponentId
- component idcontainerType
- container type to create (can be null)containerProperties
- container property values (can be null)SiteService.createContainer(java.lang.String,
java.lang.String, org.alfresco.service.namespace.QName,
java.util.Map)
public void cleanSitePermissions(org.alfresco.service.cmr.repository.NodeRef targetNode, SiteInfo containingSite)
null
then the targetNode's current containing site is used.cleanSitePermissions
in interface SiteService
targetNode
- NodeRefcontainingSite
- the site which the site is a member of. If null
, it will be calculated.public org.alfresco.service.cmr.repository.NodeRef getContainer(String shortName, String componentId)
SiteService
getContainer
in interface SiteService
shortName
- short name of sitecomponentId
- component idSiteService.getContainer(java.lang.String, String)
public org.alfresco.query.PagingResults<FileInfo> listContainers(String shortName, org.alfresco.query.PagingRequest pagingRequest)
SiteService
listContainers
in interface SiteService
shortName
- short name of sitepagingRequest
- paging requestpublic boolean hasContainer(String shortName, String componentId)
SiteService
hasContainer
in interface SiteService
shortName
- short name of sitecomponentId
- component idSiteService.hasContainer(java.lang.String, String)
public static org.alfresco.service.cmr.repository.NodeRef getSiteContainer(String siteShortName, String componentName, boolean create, SiteService siteService, TransactionService transactionService, TaggingService taggingService)
public int countAuthoritiesWithRole(String shortName, String role)
countAuthoritiesWithRole
in interface SiteService
public List<SiteMembership> listSiteMemberships(String userName, int size)
SiteService
listSiteMemberships
in interface SiteService
userName
- Stringsize
- list maximum size or zero for allpublic org.alfresco.query.PagingResults<SiteMembership> listSitesPaged(String userName, List<org.alfresco.util.Pair<SiteService.SortFields,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
SiteService
listSitesPaged
in interface SiteService
userName
- user namepublic boolean isSiteAdmin(String userName)
Note: The super/repo admin is considered to be a site administrator too.
isSiteAdmin
in interface SiteService
userName
- The user namepublic void setEventPublisher(org.alfresco.repo.events.EventPublisher eventPublisher)
Copyright © 2005–2017 Alfresco Software. All rights reserved.