org.alfresco.repo.site.script
Class ScriptSiteService

java.lang.Object
  extended by org.alfresco.repo.processor.BaseProcessorExtension
      extended by org.alfresco.repo.jscript.BaseScopableProcessorExtension
          extended by org.alfresco.repo.site.script.ScriptSiteService
All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension, Scopeable

public class ScriptSiteService
extends BaseScopableProcessorExtension

Script object representing the site service.


Field Summary
static java.lang.String MODERATED_SITE
           
static java.lang.String PRIVATE_SITE
           
static java.lang.String PUBLIC_SITE
          Visibility helper constants
 
Constructor Summary
ScriptSiteService()
           
 
Method Summary
 Site createSite(java.lang.String sitePreset, java.lang.String shortName, java.lang.String title, java.lang.String description, boolean isPublic)
          Deprecated. as of version 3.2, replaced by ScriptSiteService.createSite(String, String, String, String, String)
 Site createSite(java.lang.String sitePreset, java.lang.String shortName, java.lang.String title, java.lang.String description, java.lang.String visibility)
          Create a new site.
 Site getSite(java.lang.String shortName)
          Get a site for a provided site short name.
 boolean hasCreateSitePermissions()
          This method checks if the currently authenticated user has permission to create sites.
 java.lang.String[] listSiteRoles()
          Returns an array of all the roles that can be assigned to a member of a site.
 Site[] listSites(java.lang.String nameFilter, java.lang.String sitePresetFilter)
          List the sites available in the repository.
 Site[] listSites(java.lang.String nameFilter, java.lang.String sitePresetFilter, int size)
          List the sites available in the repository.
 Site[] listUserSites(java.lang.String userName)
          List all the sites that the specified user has an explicit membership to.
 void setServiceRegistry(ServiceRegistry serviceRegistry)
          Sets the Service Registry
 void setSiteService(SiteService siteService)
          Set the site service
 
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension
getScope, setScope
 
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLIC_SITE

public static final java.lang.String PUBLIC_SITE
Visibility helper constants

See Also:
Constant Field Values

MODERATED_SITE

public static final java.lang.String MODERATED_SITE
See Also:
Constant Field Values

PRIVATE_SITE

public static final java.lang.String PRIVATE_SITE
See Also:
Constant Field Values
Constructor Detail

ScriptSiteService

public ScriptSiteService()
Method Detail

setServiceRegistry

public void setServiceRegistry(ServiceRegistry serviceRegistry)
Sets the Service Registry

Parameters:
serviceRegistry -

setSiteService

public void setSiteService(SiteService siteService)
Set the site service

Parameters:
siteService - the site service

createSite

public Site createSite(java.lang.String sitePreset,
                       java.lang.String shortName,
                       java.lang.String title,
                       java.lang.String description,
                       boolean isPublic)
Deprecated. as of version 3.2, replaced by ScriptSiteService.createSite(String, String, String, String, String)

Parameters:
sitePreset - site preset
shortName - site short name
title - site title
description - site description
isPublic - whether the site is public or not
Returns:
Site the created site
See Also:
#createSite(String, String, String, String, String)}

createSite

public Site createSite(java.lang.String sitePreset,
                       java.lang.String shortName,
                       java.lang.String title,
                       java.lang.String description,
                       java.lang.String visibility)
Create a new site.

The site short name will be used to uniquely identify the site so it must be unique.

Parameters:
sitePreset - site preset
shortName - site short name
title - site title
description - site description
visibility - visibility of the site (public|moderated|private)
Returns:
Site the created site

hasCreateSitePermissions

public boolean hasCreateSitePermissions()
This method checks if the currently authenticated user has permission to create sites.

Returns:
true if the current user is a Contributor to "Sites" node, else false.
Since:
3.4

listSites

public Site[] listSites(java.lang.String nameFilter,
                        java.lang.String sitePresetFilter)
List the sites available in the repository. The returned list can optionally be filtered by name and site preset.

If no filters are specified then all the available sites are returned.

Parameters:
nameFilter - name filter
sitePresetFilter - site preset filter
Returns:
Site[] a list of the site filtered as appropriate

listSites

public Site[] listSites(java.lang.String nameFilter,
                        java.lang.String sitePresetFilter,
                        int size)
List the sites available in the repository. The returned list can optionally be filtered by name and site preset.

If no filters are specified then all the available sites are returned.

Parameters:
nameFilter - name filter
sitePresetFilter - site preset filter
size - max results size crop if >0
Returns:
Site[] a list of the site filtered as appropriate

listUserSites

public Site[] listUserSites(java.lang.String userName)
List all the sites that the specified user has an explicit membership to.

Parameters:
userName - user name
Returns:
Site[] a list of sites the user has an explicit membership to

getSite

public Site getSite(java.lang.String shortName)
Get a site for a provided site short name.

Returns null if the site does not exist.

Parameters:
shortName - short name of the site
Returns:
Site the site, null if does not exist

listSiteRoles

public java.lang.String[] listSiteRoles()
Returns an array of all the roles that can be assigned to a member of a site.

Returns:
String[] roles available to assign to a member of a site


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