public class SiteManager extends AbstractLogEnabled implements Serviceable, Component, Contextualizable
Modifier and Type | Field and Description |
---|---|
private AdminSessionProvider |
_adminSessionProvider |
private Context |
_context |
private CopySiteComponent |
_copySiteComponent |
private CurrentUserProvider |
_currentUserProvider |
private PopulationContextHelper |
_populationContextHelper |
private Repository |
_repository |
private AmetysObjectResolver |
_resolver |
private RightManager |
_rightManager |
private SynchronizeComponent |
_synchronizeComponent |
private WorkspaceSelector |
_workspaceSelector |
static String |
ROLE
Avalon Role
|
static String |
ROOT_SITES
sites root's JCR node name
|
static String |
ROOT_SITES_PATH
sites root's JCR path
|
static String |
SITES_KEY
Constant for storing the sites cache in request attribute.
|
Constructor and Description |
---|
SiteManager() |
Modifier and Type | Method and Description |
---|---|
private Request |
_getRequest() |
private Site |
_getSite(String siteName) |
private boolean |
_hasSite(String siteName) |
void |
clearCache()
Clear the site cache
|
void |
contextualize(Context context) |
Site |
copySite(Site site,
String siteName)
Creates a site with the given name, from another site to copy
|
Site |
copySite(Site site,
String parentId,
String siteName)
Creates a site with the given name, from another site to copy
|
Site |
createSite(String siteName)
Creates a site with the given name.
|
Site |
createSite(String siteName,
String parentId)
Creates a site with the given name.
|
Set<String> |
getGrantedSites()
Get the granted site names for the current user
|
Set<String> |
getGrantedSites(UserIdentity user)
Get the granted site names for user
|
ModifiableTraversableAmetysObject |
getRoot()
Returns the root for sites.
|
Collection<String> |
getRootSiteNames()
Returns the sites names.
|
AmetysObjectIterable<Site> |
getRootSites()
Returns the root sites.
|
Site |
getSite(String siteName)
Returns the named
Site . |
Collection<String> |
getSiteNames()
Returns the sites names.
|
AmetysObjectIterable<Site> |
getSites()
Returns the all sites.
|
boolean |
hasSite(String siteName)
Returns true if the given site exists.
|
boolean |
isGrantedSite(UserIdentity user,
String siteName)
Determines if the user has granted access to the site
|
void |
service(ServiceManager manager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
public static final String SITES_KEY
public static final String ROOT_SITES
public static final String ROOT_SITES_PATH
private AmetysObjectResolver _resolver
private Repository _repository
private AdminSessionProvider _adminSessionProvider
private SynchronizeComponent _synchronizeComponent
private CopySiteComponent _copySiteComponent
private WorkspaceSelector _workspaceSelector
private RightManager _rightManager
private CurrentUserProvider _currentUserProvider
private PopulationContextHelper _populationContextHelper
public SiteManager()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
private Request _getRequest()
public Collection<String> getRootSiteNames()
public Collection<String> getSiteNames()
public Set<String> getGrantedSites()
public Set<String> getGrantedSites(UserIdentity user)
user
- The userpublic boolean isGrantedSite(UserIdentity user, String siteName)
user
- The usersiteName
- The site nametrue
if the user can access to the sitepublic ModifiableTraversableAmetysObject getRoot()
public AmetysObjectIterable<Site> getRootSites()
public AmetysObjectIterable<Site> getSites()
public Site createSite(String siteName, String parentId) throws RepositoryIntegrityViolationException
siteName
- the site name.parentId
- the id of the parent site. Can be null.Site
.RepositoryIntegrityViolationException
- if the named site already exists.public Site createSite(String siteName) throws RepositoryIntegrityViolationException
siteName
- the site name.Site
.RepositoryIntegrityViolationException
- if the named site already exists.public Site copySite(Site site, String siteName) throws RepositoryIntegrityViolationException
site
- the site to be copiedsiteName
- the site nameSite
.RepositoryIntegrityViolationException
- if the named site already exists.public Site copySite(Site site, String parentId, String siteName) throws RepositoryIntegrityViolationException
site
- the site to be copiedparentId
- the id of the parent site. Can be null.siteName
- the site nameSite
.RepositoryIntegrityViolationException
- if the named site already exists.public boolean hasSite(String siteName)
siteName
- the site name.public Site getSite(String siteName) throws UnknownAmetysObjectException
Site
.siteName
- the site name.Site
.UnknownAmetysObjectException
- if the named site does not exist.public void clearCache()
private Site _getSite(String siteName) throws UnknownAmetysObjectException
UnknownAmetysObjectException