public class ScriptSiteService extends BaseScopableProcessorExtension
Modifier and Type | Field and Description |
---|---|
static String |
MODERATED_SITE |
static String |
PRIVATE_SITE |
static String |
PUBLIC_SITE
Visibility helper constants
|
Constructor and Description |
---|
ScriptSiteService() |
Modifier and Type | Method and Description |
---|---|
void |
cleanSitePermissions(org.alfresco.service.cmr.repository.NodeRef targetNode)
It removes permissions which pertain to sites other than the node's current site.
|
void |
cleanSitePermissions(ScriptNode targetNode)
This method cleans up the permissions on the specified node and all its primary children.
|
Site |
createSite(String sitePreset,
String shortName,
String title,
String description,
boolean isPublic)
Deprecated.
as of version 3.2, replaced by
createSite(String, String, String, String, String) |
Site |
createSite(String sitePreset,
String shortName,
String title,
String description,
String visibility)
Create a new site.
|
Site |
createSite(String sitePreset,
String shortName,
String title,
String description,
String visibility,
String siteType)
Create a new site.
|
Site[] |
findSites(String filter,
int size)
Find (search) the sites available in the repository.
|
Site[] |
findSites(String filter,
String sitePresetFilter,
int size)
Find (search) the sites available in the repository.
|
Site |
getSite(String shortName)
Get a site for a provided site short name.
|
Site |
getSiteInfo(String shortName)
Get a site for a provided site short name.
|
Site[] |
getSites(String filter,
String sitePresetFilter,
int size)
Retrieves the sites available in the repository.
|
boolean |
hasCreateSitePermissions()
This method checks if the currently authenticated user has permission to create sites.
|
boolean |
hasSite(String shortName)
Site existence check.
|
boolean |
isSiteManager(String siteId)
Determines if the current user is a manager of the given site.
|
String[] |
listSiteRoles()
Returns an array of all the roles that can be assigned to a member of a site.
|
String[] |
listSiteRoles(String shortName)
Returns an array of all the roles that can be assigned to a member of a
specific site.
|
Site[] |
listSites(String filter,
String sitePresetFilter)
List the sites available in the repository.
|
Site[] |
listSites(String filter,
String sitePresetFilter,
int size)
List the sites available in the repository.
|
Site[] |
listUserSites(String userName)
List all the sites that the specified user has an explicit membership to.
|
Site[] |
listUserSites(String userName,
int size)
List all the sites that the specified user has an explicit membership to.
|
protected Site[] |
makeSitesArray(List<SiteInfo> siteInfos)
Converts the given List of SiteInfo objects to a JavaScript friendly array
of Site objects.
|
void |
setServiceRegistry(ServiceRegistry serviceRegistry)
Sets the Service Registry
|
void |
setSiteService(SiteService siteService)
Set the site service
|
getScope, setScope
getExtensionName, register, setExtensionName, setProcessor
public static final String PUBLIC_SITE
public static final String MODERATED_SITE
public static final String PRIVATE_SITE
public void setServiceRegistry(ServiceRegistry serviceRegistry)
serviceRegistry
- ServiceRegistrypublic void setSiteService(SiteService siteService)
siteService
- the site servicepublic Site createSite(String sitePreset, String shortName, String title, String description, boolean isPublic)
createSite(String, String, String, String, String)
sitePreset
- site presetshortName
- site short nametitle
- site titledescription
- site descriptionisPublic
- whether the site is public or notcreateSite(String, String, String, String, String)
public Site createSite(String sitePreset, String shortName, String title, String description, String visibility)
The site short name will be used to uniquely identify the site so it must be unique.
sitePreset
- site presetshortName
- site short nametitle
- site titledescription
- site descriptionvisibility
- visibility of the site (public|moderated|private)public Site createSite(String sitePreset, String shortName, String title, String description, String visibility, String siteType)
The site short name will be used to uniquely identify the site so it must be unique.
sitePreset
- site presetshortName
- site short nametitle
- site titledescription
- site descriptionvisibility
- visibility of the site (public|moderated|private)siteType
- qname of site type to createpublic boolean hasSite(String shortName)
shortName
- site short namepublic boolean hasCreateSitePermissions()
true
if the current user is a Contributor to "Sites" node, else false
.public boolean isSiteManager(String siteId)
siteId
- The short name of the site to checkpublic Site[] getSites(String filter, String sitePresetFilter, int size)
filter
- inclusion filter for returned sites. Only sites whose cm:name OR cm:title
OR cm:description start with the filter string will be returned.sitePresetFilter
- site preset filtersize
- max results size crop if >0public Site[] listSites(String filter, String sitePresetFilter)
If no filters are specified then all the available sites are returned.
filter
- inclusion filter for returned sites. Only sites whose cm:name OR cm:title
OR cm:description start with the filter string will be returned.sitePresetFilter
- site preset filterfor a description of the limitations of this method.
public Site[] listSites(String filter, String sitePresetFilter, int size)
filter
- inclusion filter for returned sites. Only sites whose cm:name OR cm:title
OR cm:description start with the filter string will be returned.sitePresetFilter
- site preset filtersize
- max results size crop if >0for a description of the limitations of this method.
public Site[] findSites(String filter, String sitePresetFilter, int size)
filter
- inclusion filter for returned sites. Only sites whose cm:name OR cm:title
OR cm:description CONTAIN the filter string will be returned.sitePresetFilter
- site preset filtersize
- max results size crop if >0for a description of the limitations of this method.
public Site[] findSites(String filter, int size)
filter
- inclusion filter for returned sites. Only sites whose cm:name OR cm:title
OR cm:description CONTAIN the filter string will be returned.size
- max results size crop if >0for a description of the limitations of this method.
protected Site[] makeSitesArray(List<SiteInfo> siteInfos)
public Site[] listUserSites(String userName, int size)
userName
- user namesize
- maximum list sizepublic Site[] listUserSites(String userName)
userName
- user namepublic Site getSite(String shortName)
Returns null if the site does not exist.
shortName
- short name of the sitepublic Site getSiteInfo(String shortName)
Returns null if the site does not exist.
shortName
- short name of the sitepublic String[] listSiteRoles()
public void cleanSitePermissions(org.alfresco.service.cmr.repository.NodeRef targetNode)
targetNode
- the root node which is to have its permissions cleaned.SiteService.cleanSitePermissions(NodeRef, SiteInfo)
public void cleanSitePermissions(ScriptNode targetNode)
SiteService.cleanSitePermissions(NodeRef, SiteInfo)
Copyright © 2005–2017 Alfresco Software. All rights reserved.