org.alfresco.repo.site
Class SiteServiceImpl

java.lang.Object
  extended by org.springframework.extensions.surf.util.AbstractLifecycleBean
      extended by org.alfresco.repo.site.SiteServiceImpl
All Implemented Interfaces:
java.util.EventListener, NodeServicePolicies.OnRestoreNodePolicy, ClassPolicy, Policy, SiteModel, SiteServiceInternal, SiteService, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

public class SiteServiceImpl
extends org.springframework.extensions.surf.util.AbstractLifecycleBean
implements SiteServiceInternal, SiteModel, NodeServicePolicies.OnRestoreNodePolicy

Site Service Implementation. Also bootstraps the site AVM and DM stores.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.Arg
 
Field Summary
static org.alfresco.service.cmr.repository.StoreRef SITE_STORE
          The DM store where site's are kept
 
Fields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
log
 
Fields inherited from interface org.alfresco.service.cmr.site.SiteService
DOCUMENT_LIBRARY
 
Fields inherited from interface org.alfresco.repo.site.SiteModel
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
 
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy
QNAME
 
Fields inherited from interface org.alfresco.repo.policy.Policy
NAMESPACE
 
Constructor Summary
SiteServiceImpl()
           
 
Method Summary
 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.
 org.alfresco.service.cmr.repository.NodeRef createContainer(java.lang.String shortName, java.lang.String componentId, org.alfresco.service.namespace.QName containerType, java.util.Map 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(java.lang.String sitePreset, java.lang.String passedShortName, java.lang.String title, java.lang.String description, boolean isPublic)
          Create a new site.
 SiteInfo createSite(java.lang.String sitePreset, java.lang.String passedShortName, java.lang.String title, java.lang.String description, SiteVisibility visibility)
          Create a new site.
 SiteInfo createSite(java.lang.String sitePreset, java.lang.String passedShortName, java.lang.String title, java.lang.String description, SiteVisibility visibility, org.alfresco.service.namespace.QName siteType)
          Create a new site.
 void deleteSite(java.lang.String shortName)
          Delete the site.
 java.util.List findSites(java.lang.String filter, java.lang.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(java.lang.String shortName, java.lang.String componentId)
          Gets the "container" folder for the specified component.
 java.lang.String getMembersRole(java.lang.String shortName, java.lang.String authorityName)
          Gets the role of the specified user.
 java.util.List getMembersRoles(java.lang.String shortName, java.lang.String authorityName)
           
 java.util.Comparator 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(java.lang.String shortName)
          Gets site information based on the short name of a site.
static org.alfresco.service.cmr.repository.NodeRef getSiteContainer(java.lang.String siteShortName, java.lang.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
 java.lang.String getSiteGroup(java.lang.String shortName)
          Gets the sites group.
 java.lang.String getSiteGroup(java.lang.String shortName, boolean withGroupPrefix)
          Helper method to get the name of the site group
 java.lang.String getSiteRoleGroup(java.lang.String shortName, java.lang.String role)
          Gets the sites role group.
 java.lang.String getSiteRoleGroup(java.lang.String shortName, java.lang.String permission, boolean withGroupPrefix)
          Helper method to get the name of the site permission group
 java.util.List getSiteRoles()
          Gets a list of all the currently available roles that a user can perform on all sites
 java.util.List getSiteRoles(org.alfresco.service.namespace.QName type)
           
 java.util.List getSiteRoles(java.lang.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
 boolean hasContainer(java.lang.String shortName, java.lang.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.
 void init()
          Checks that all necessary properties and services have been provided.
 boolean isMember(java.lang.String shortName, java.lang.String authorityName)
          Indicates whether an authority is a member of a site or not
 java.util.Map listMembers(java.lang.String shortName, java.lang.String nameFilter, java.lang.String roleFilter, int size)
          List the members of the site.
 java.util.Map listMembers(java.lang.String shortName, java.lang.String nameFilter, java.lang.String roleFilter, int size, boolean collapseGroups)
          List the members of the site.
 org.alfresco.query.PagingResults listSites(java.util.List filterProps, java.util.List sortProps, org.alfresco.query.PagingRequest pagingRequest)
          This method uses canned queries to retrieve st:site NodeRefs with support for result paging.
 java.util.List listSites(java.lang.String userName)
          List all the sites that the specified user has a explicit membership to.
 java.util.List listSites(java.lang.String userName, int size)
          List all the sites that the specified user has a explicit membership to.
 java.util.List listSites(java.lang.String nameFilter, java.lang.String sitePresetFilter)
          List the available sites.
 java.util.List listSites(java.lang.String filter, java.lang.String sitePresetFilter, int size)
          List the available sites.
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(java.lang.String shortName, java.lang.String authorityName)
          Clears an authorities role within a site
 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 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 setFileFolderService(FileFolderService fileFolderService)
          Set file folder service
 void setMembership(java.lang.String shortName, java.lang.String authorityName, java.lang.String role)
          Sets the role of an authority within a site
 void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
          Set Namespace service
 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 setRoleComparator(java.util.Comparator roleComparator)
           
 void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
          Set search service
 void setSitesPermissionsCleaner(SitesPermissionCleaner sitesPermissionsCleaner)
           
 void setSitesXPath(java.lang.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 setTenantAdminService(TenantAdminService tenantAdminService)
          Sets the tenant admin 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.
 
Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SITE_STORE

public static final org.alfresco.service.cmr.repository.StoreRef SITE_STORE
The DM store where site's are kept

Constructor Detail

SiteServiceImpl

public SiteServiceImpl()
Method Detail

setSitesXPath

public void setSitesXPath(java.lang.String sitesXPath)
Set the path to the location of the sites root folder. For example:
 ./app:company_home/st:sites
 

Parameters:
sitesXPath - a valid XPath

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set node service


setDirectNodeService

public void setDirectNodeService(org.alfresco.service.cmr.repository.NodeService directNodeService)
Set the unprotected node service


setFileFolderService

public void setFileFolderService(FileFolderService fileFolderService)
Set file folder service


setSearchService

public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Set search service


setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Set Namespace service


setPermissionService

public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Set permission service


setActivityService

public void setActivityService(ActivityService activityService)
Set activity service


setPersonService

public void setPersonService(PersonService personService)
Set person service


setAuthenticationContext

public void setAuthenticationContext(AuthenticationContext authenticationContext)
Set authentication component


setTaggingService

public void setTaggingService(TaggingService taggingService)
Set the tagging service


setAuthorityService

public void setAuthorityService(AuthorityService authorityService)
Set the authority service


setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Set the dictionary service

Parameters:
dictionaryService - dictionary service

setTenantService

public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
Set the tenant service

Parameters:
tenantService - tenant service

setTenantAdminService

public void setTenantAdminService(TenantAdminService tenantAdminService)
Sets the tenant admin service


setTransactionHelper

public void setTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
Sets helper that provides transaction callbacks


setPolicyComponent

public void setPolicyComponent(PolicyComponent policyComponent)

setRoleComparator

public void setRoleComparator(java.util.Comparator roleComparator)

setSysAdminParams

public void setSysAdminParams(SysAdminParams sysAdminParams)

setBehaviourFilter

public void setBehaviourFilter(BehaviourFilter behaviourFilter)

setSitesPermissionsCleaner

public void setSitesPermissionsCleaner(SitesPermissionCleaner sitesPermissionsCleaner)

setCannedQueryRegistry

public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry cannedQueryRegistry)
Set the registry of canned queries


getRoleComparator

public java.util.Comparator getRoleComparator()

init

public void init()
Checks that all necessary properties and services have been provided.


onBootstrap

protected void onBootstrap(org.springframework.context.ApplicationEvent event)
Specified by:
onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean

onShutdown

protected void onShutdown(org.springframework.context.ApplicationEvent event)
Specified by:
onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean

hasCreateSitePermissions

public boolean hasCreateSitePermissions()
Description copied from interface: SiteService
This method checks if the currently authenticated user has permission to create sites.

Specified by:
hasCreateSitePermissions in interface SiteService
Returns:
true if current user can create sites, else false.

createSite

public SiteInfo createSite(java.lang.String sitePreset,
                           java.lang.String passedShortName,
                           java.lang.String title,
                           java.lang.String description,
                           boolean isPublic)
Description copied from interface: SiteService
Create a new site.

Specified by:
createSite in interface SiteService
Parameters:
sitePreset - site preset name
passedShortName - site short name, must be unique
title - site title
description - site description
isPublic - whether the site is public or not (true = public, false = private)
Returns:
SiteInfo information about the created site
See Also:
SiteService.createSite(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)

createSite

public SiteInfo createSite(java.lang.String sitePreset,
                           java.lang.String passedShortName,
                           java.lang.String title,
                           java.lang.String description,
                           SiteVisibility visibility)
Description copied from interface: SiteService
Create a new site.

Specified by:
createSite in interface SiteService
Parameters:
sitePreset - site preset name
passedShortName - site short name, must be unique
title - site title
description - site description
visibility - site visibility (public|moderated|private)
Returns:
SiteInfo information about the created site
See Also:
SiteService.createSite(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)

createSite

public SiteInfo createSite(java.lang.String sitePreset,
                           java.lang.String passedShortName,
                           java.lang.String title,
                           java.lang.String description,
                           SiteVisibility visibility,
                           org.alfresco.service.namespace.QName siteType)
Description copied from interface: SiteService
Create a new site.

Specified by:
createSite in interface SiteService
Parameters:
sitePreset - site preset name
passedShortName - site short name, must be unique
title - site title
description - site description
visibility - site visibility (public|moderated|private)
siteType - type of site to create, must be a sub-type of st:site
Returns:
SiteInfo information about the created site

getSiteGroup

public java.lang.String getSiteGroup(java.lang.String shortName)
Description copied from interface: SiteService
Gets the sites group. All members of the site are contained within this group.

Specified by:
getSiteGroup in interface SiteService
Parameters:
shortName - site short name
Returns:
String group name
See Also:
SiteService.getSiteGroup(java.lang.String)

getSiteRoleGroup

public java.lang.String getSiteRoleGroup(java.lang.String shortName,
                                         java.lang.String role)
Description copied from interface: SiteService
Gets the sites role group. All members assigned the given role will be members of the returned group.

Specified by:
getSiteRoleGroup in interface SiteService
Parameters:
shortName - site short name
role - membership role
Returns:
String group name
See Also:
SiteService.getSiteRoleGroup(java.lang.String, java.lang.String)

getSiteGroup

public java.lang.String getSiteGroup(java.lang.String shortName,
                                     boolean withGroupPrefix)
Helper method to get the name of the site group

Parameters:
shortName - site short name
Returns:
String site group name

getSiteRoleGroup

public java.lang.String getSiteRoleGroup(java.lang.String shortName,
                                         java.lang.String permission,
                                         boolean withGroupPrefix)
Helper method to get the name of the site permission group

Parameters:
shortName - site short name
permission - permission name
withGroupPrefix - - should the name have the GROUP_ prefix?
Returns:
String site permission group name

getSiteRoot

public org.alfresco.service.cmr.repository.NodeRef getSiteRoot()
Get the node reference that is the site root

Specified by:
getSiteRoot in interface SiteServiceInternal
Specified by:
getSiteRoot in interface SiteService
Returns:
NodeRef node reference

findSites

public java.util.List findSites(java.lang.String filter,
                                java.lang.String sitePresetFilter,
                                int size)
Description copied from interface: SiteService
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. 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.

Specified by:
findSites in interface SiteService
Parameters:
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.
Returns:
Site objects for all matching sites up to the maximum result size.

listSites

public java.util.List listSites(java.lang.String nameFilter,
                                java.lang.String sitePresetFilter)
Description copied from interface: SiteService
List the available sites. This list can optionally be filtered by site name/title/description and/or site preset.

Note: Starting with Alfresco 4.0, the filter parameter will only match sites whose 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.

Specified by:
listSites in interface SiteService
Parameters:
nameFilter - filter
sitePresetFilter - site preset filter
Returns:
List list of site information
See Also:
SiteService.listSites(java.lang.String, java.lang.String)

listSites

public java.util.List listSites(java.lang.String filter,
                                java.lang.String sitePresetFilter,
                                int size)
Description copied from interface: SiteService
List the available sites. This list can optionally be filtered by site name/title/description and/or site preset.

Note: Starting with Alfresco 4.0, the filter parameter will only match sites whose 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.

Specified by:
listSites in interface SiteService
Parameters:
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 all
Returns:
List list of site information
See Also:
SiteService.listSites(java.lang.String, java.lang.String, int)

listSites

public java.util.List listSites(java.lang.String userName)
Description copied from interface: SiteService
List all the sites that the specified user has a explicit membership to.

Specified by:
listSites in interface SiteService
Parameters:
userName - user name
Returns:
List list of site information

listSites

public java.util.List listSites(java.lang.String userName,
                                int size)
Description copied from interface: SiteService
List all the sites that the specified user has a explicit membership to.

Specified by:
listSites in interface SiteService
Parameters:
userName - user name
size - list maximum size or zero for all
Returns:
List list of site information
See Also:
SiteService.listSites(java.lang.String, int)

listSites

public org.alfresco.query.PagingResults listSites(java.util.List filterProps,
                                                  java.util.List sortProps,
                                                  org.alfresco.query.PagingRequest pagingRequest)
This method uses canned queries to retrieve st:site NodeRefs with support for result paging.

Specified by:
listSites in interface SiteService
Parameters:
filterProps - property filters
sortProps - sorting options
pagingRequest - paging options
Returns:
a page of SiteInfo objects.

getSite

public SiteInfo getSite(java.lang.String shortName)
Description copied from interface: SiteService
Gets site information based on the short name of a site.

Returns null if the site can not be found.

Specified by:
getSite in interface SiteService
Parameters:
shortName - the site short name
Returns:
SiteInfo the site information
See Also:
SiteService.getSite(java.lang.String)

getSite

public SiteInfo getSite(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Description copied from interface: SiteService
This method gets the 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.

Specified by:
getSite in interface SiteService
Parameters:
nodeRef - the node whose containing site's info is to be found.
Returns:
SiteInfo site information for the containing site or null if node is not in a site.
See Also:
SiteService.getSite(org.alfresco.service.cmr.repository.NodeRef)

updateSite

public void updateSite(SiteInfo siteInfo)
Description copied from interface: SiteService
Update the site information.

Note that the short name and site preset of a site can not be updated once the site has been created.

Specified by:
updateSite in interface SiteService
Parameters:
siteInfo - site information
See Also:
SiteService.updateSite(org.alfresco.service.cmr.site.SiteInfo)

deleteSite

public void deleteSite(java.lang.String shortName)
Description copied from interface: SiteService
Delete the site.

Specified by:
deleteSite in interface SiteService
Parameters:
shortName - site short name
See Also:
SiteService.deleteSite(java.lang.String)

onRestoreNode

public void onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Description copied from interface: NodeServicePolicies.OnRestoreNodePolicy
Called after an archived node is restored.

Specified by:
onRestoreNode in interface NodeServicePolicies.OnRestoreNodePolicy
Parameters:
childAssocRef - the newly created child association reference
See Also:
NodeServicePolicies.OnRestoreNodePolicy.onRestoreNode(org.alfresco.service.cmr.repository.ChildAssociationRef)

listMembers

public java.util.Map listMembers(java.lang.String shortName,
                                 java.lang.String nameFilter,
                                 java.lang.String roleFilter,
                                 int size)
Description copied from interface: SiteService
List the members of the site. This includes both users and groups.

Name and role filters are optional and if not specified all the members of the site are returned.

Specified by:
listMembers in interface SiteService
Parameters:
shortName - site short name
nameFilter - name filter
roleFilter - role filter
size - max results size crop if >0
Returns:
Map the authority name and their role
See Also:
SiteService.listMembers(java.lang.String, java.lang.String, java.lang.String, int)

listMembers

public java.util.Map listMembers(java.lang.String shortName,
                                 java.lang.String nameFilter,
                                 java.lang.String roleFilter,
                                 int size,
                                 boolean collapseGroups)
Description copied from interface: SiteService
List the members of the site. This includes both users and groups if collapseGroups is set to false, otherwise all groups that are members are collapsed into their component users and listed.

Specified by:
listMembers in interface SiteService
Parameters:
shortName - site short name
nameFilter - name filter
roleFilter - role filter
size - max results size crop if >0
collapseGroups - true if collapse member groups into user list, false otherwise
Returns:
Map the authority name and their role
See Also:
SiteService.listMembers(String, String, String, int, boolean)

getMembersRole

public java.lang.String getMembersRole(java.lang.String shortName,
                                       java.lang.String authorityName)
Description copied from interface: SiteService
Gets the role of the specified user.

Specified by:
getMembersRole in interface SiteService
Parameters:
shortName - site short name
authorityName - full authority name (so if it's a group then its prefixed with 'GROUP_')
Returns:
String site role, null if none
See Also:
SiteService.getMembersRole(java.lang.String, java.lang.String)

getMembersRoles

public java.util.List getMembersRoles(java.lang.String shortName,
                                      java.lang.String authorityName)

getSiteRoles

public java.util.List getSiteRoles()
Description copied from interface: SiteService
Gets a list of all the currently available roles that a user can perform on all sites

Specified by:
getSiteRoles in interface SiteService
Returns:
List list of available roles
See Also:
SiteService.getSiteRoles()

getSiteRoles

public java.util.List getSiteRoles(java.lang.String shortName)
Description copied from interface: SiteService
Gets a list of all the currently available roles that a user can perform on a specific site. This will generally only differ from SiteService.getSiteRoles() if your site is of a custom type.

Specified by:
getSiteRoles in interface SiteService
Returns:
List list of available roles
See Also:
SiteService.getSiteRoles(String)

getSiteRoles

public java.util.List getSiteRoles(org.alfresco.service.namespace.QName type)
See Also:
SiteService.getSiteRoles(), SiteService.getSiteRoles(String)

isMember

public boolean isMember(java.lang.String shortName,
                        java.lang.String authorityName)
Description copied from interface: SiteService
Indicates whether an authority is a member of a site or not

Specified by:
isMember in interface SiteService
Parameters:
shortName - site short name
authorityName - authority name (so if it's a group then its prefixed with 'GROUP_')
Returns:
boolean true if the authority is a member of the site, false otherwise
See Also:
SiteService.isMember(java.lang.String, java.lang.String)

removeMembership

public void removeMembership(java.lang.String shortName,
                             java.lang.String authorityName)
Description copied from interface: SiteService
Clears an authorities role within a site

Specified by:
removeMembership in interface SiteService
Parameters:
shortName - site short name
authorityName - authority name (so if it's a group then its prefixed with 'GROUP_')
See Also:
SiteService.removeMembership(java.lang.String, java.lang.String)

setMembership

public void setMembership(java.lang.String shortName,
                          java.lang.String authorityName,
                          java.lang.String role)
Description copied from interface: SiteService
Sets the role of an authority within a site

Specified by:
setMembership in interface SiteService
Parameters:
shortName - site short name
authorityName - authority name (so if it's a group then its prefixed with 'GROUP_')
role - site role
See Also:
SiteService.setMembership(java.lang.String, java.lang.String, java.lang.String)

createContainer

public org.alfresco.service.cmr.repository.NodeRef createContainer(java.lang.String shortName,
                                                                   java.lang.String componentId,
                                                                   org.alfresco.service.namespace.QName containerType,
                                                                   java.util.Map containerProperties)
Description copied from interface: SiteService
Creates a container for a component is a site of the given container type (must be a sub-type of st:siteContainer)

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.

Specified by:
createContainer in interface SiteService
Parameters:
shortName - site short name
componentId - component id
containerType - container type to create (can be null)
containerProperties - container property values (can be null)
Returns:
noderef of container or null if a container can't be created.
See Also:
SiteService.createContainer(java.lang.String, java.lang.String, org.alfresco.service.namespace.QName, java.util.Map)

cleanSitePermissions

public 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. This consists of If the containingSite is null then the targetNode's current containing site is used.

Specified by:
cleanSitePermissions in interface SiteService
Parameters:
targetNode -
containingSite - the site which the site is a member of. If null, it will be calculated.

getContainer

public org.alfresco.service.cmr.repository.NodeRef getContainer(java.lang.String shortName,
                                                                java.lang.String componentId)
Description copied from interface: SiteService
Gets the "container" folder for the specified component.

Specified by:
getContainer in interface SiteService
Parameters:
shortName - short name of site
componentId - component id
Returns:
noderef of container
See Also:
org.alfresco.service.cmr.site.SiteService#getContainer(java.lang.String)

hasContainer

public boolean hasContainer(java.lang.String shortName,
                            java.lang.String componentId)
Description copied from interface: SiteService
Determines if a "container" folder for the specified component exists.

Specified by:
hasContainer in interface SiteService
Parameters:
shortName - short name of site
componentId - component id
Returns:
true => "container" folder exists for component
See Also:
org.alfresco.service.cmr.site.SiteService#hasContainer(java.lang.String)

getSiteContainer

public static org.alfresco.service.cmr.repository.NodeRef getSiteContainer(java.lang.String siteShortName,
                                                                           java.lang.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



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.