Package org.ametys.web.repository.site
Class GetSitesAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.web.repository.site.GetSitesAction
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
GetAdminSitesAction
,UserSitesAction
public class GetSitesAction extends ServiceableAction
Action for getting the list of existingSite
.
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver
_ametysResolver
Ametys resolverprotected GroupDirectoryContextHelper
_groupDirectoryContextHelper
The group directory context helperprotected GroupDirectoryDAO
_groupDirectoryDAO
The group directory DAOprotected PopulationContextHelper
_populationContextHelper
The population context helperprotected RightManager
_rightManager
The rights managerprotected SiteConfigurationManager
_siteConfigurationManager
Site configurationprotected SiteManager
_siteManager
The site managerprotected SiteTypesExtensionPoint
_siteTypeExtensionPoint
Site type EPprotected UserPopulationDAO
_userPopulationDAO
The user population DAOprotected CurrentUserProvider
_userProvider
The current user provider-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description GetSitesAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<Map<String,Object>>
_childSites2json(Request request, Site site, String currentSiteName, int depth, boolean readAccessOnly, boolean sharedSitesOnly)
Child site to JSONprotected AmetysObjectIterable<Site>
_getRootSites(String id)
Get root sitesprotected List<Map<String,Object>>
_rootSite2json(Request request, Site site, String currentSiteName, boolean recursive, boolean readAccessOnly, boolean sharedSitesOnly, UserIdentity user)
Retrieves the JSON for a root siteprivate long
_sharedContentsSize(Site site, String currentSiteName)
protected Map<String,Object>
_site2json(Site site)
Get the JSON representation of a siteprotected Map<String,Object>
_site2json(Request request, Site site, String currentSiteName, int depth, boolean readAccessOnly, boolean sharedSitesOnly)
Site to JSONMap
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
protected boolean
canRead(Site site, Request request)
Determines if the current user has a read access on sitevoid
service(ServiceManager smanager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_rightManager
protected RightManager _rightManager
The rights manager
-
_userProvider
protected CurrentUserProvider _userProvider
The current user provider
-
_populationContextHelper
protected PopulationContextHelper _populationContextHelper
The population context helper
-
_groupDirectoryContextHelper
protected GroupDirectoryContextHelper _groupDirectoryContextHelper
The group directory context helper
-
_userPopulationDAO
protected UserPopulationDAO _userPopulationDAO
The user population DAO
-
_groupDirectoryDAO
protected GroupDirectoryDAO _groupDirectoryDAO
The group directory DAO
-
_siteTypeExtensionPoint
protected SiteTypesExtensionPoint _siteTypeExtensionPoint
Site type EP
-
_siteConfigurationManager
protected SiteConfigurationManager _siteConfigurationManager
Site configuration
-
_ametysResolver
protected AmetysObjectResolver _ametysResolver
Ametys resolver
-
-
Constructor Detail
-
GetSitesAction
public GetSitesAction()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
- Throws:
Exception
-
_getRootSites
protected AmetysObjectIterable<Site> _getRootSites(String id)
Get root sites- Parameters:
id
- Optionnal root id- Returns:
- Ametys iterable of sites
-
_rootSite2json
protected List<Map<String,Object>> _rootSite2json(Request request, Site site, String currentSiteName, boolean recursive, boolean readAccessOnly, boolean sharedSitesOnly, UserIdentity user)
Retrieves the JSON for a root site- Parameters:
request
- The requestsite
- The root sitecurrentSiteName
- The name of the current siterecursive
- True to handle child sitesreadAccessOnly
- Only read access sitesharedSitesOnly
- Only shared sitesuser
- The current user- Returns:
- The root site info
-
_childSites2json
protected List<Map<String,Object>> _childSites2json(Request request, Site site, String currentSiteName, int depth, boolean readAccessOnly, boolean sharedSitesOnly)
Child site to JSON- Parameters:
request
- The requestsite
- The root sitecurrentSiteName
- The name of the current sitedepth
- The depth from the root sitereadAccessOnly
- Only read access sitesharedSitesOnly
- Only shared sites- Returns:
- The child sites info
-
_site2json
protected Map<String,Object> _site2json(Request request, Site site, String currentSiteName, int depth, boolean readAccessOnly, boolean sharedSitesOnly)
Site to JSON- Parameters:
request
- The requestsite
- The root sitecurrentSiteName
- The name of the current sitedepth
- The depth from the root sitereadAccessOnly
- Only read access sitesharedSitesOnly
- Only shared sites- Returns:
- The site info
-
_site2json
protected Map<String,Object> _site2json(Site site)
Get the JSON representation of a site- Parameters:
site
- The site- Returns:
- The site as JSON object
-
_sharedContentsSize
private long _sharedContentsSize(Site site, String currentSiteName)
-
-