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
Action for getting the list of existing
Site
.-
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
Ametys resolverprotected GroupDirectoryContextHelper
The group directory context helperprotected GroupDirectoryDAO
The group directory DAOprotected PopulationContextHelper
The population context helperprotected RightManager
The rights managerprotected SiteColorsComponent
Handle site colorsprotected SiteConfigurationManager
Site configurationprotected SiteManager
The site managerprotected SiteTypesExtensionPoint
Site type EPprotected SkinsManager
The skins managerprotected UserPopulationDAO
The user population DAOprotected CurrentUserProvider
The current user providerFields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_childSites2json
(Request request, Site site, String currentSiteName, int depth, boolean readAccessOnly, boolean sharedSitesOnly) Child site to JSONprotected AmetysObjectIterable<Site>
_getRootSites
(String id) Get root sites_rootSite2json
(Request request, Site site, String currentSiteName, boolean recursive, boolean readAccessOnly, boolean sharedSitesOnly, UserIdentity user) Retrieves the JSON for a root site_site2json
(Site site) Get the JSON representation of a site_site2json
(Request request, Site site, String currentSiteName, int depth, boolean readAccessOnly, boolean sharedSitesOnly) Site to JSONact
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) protected boolean
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 Details
-
_siteManager
The site manager -
_rightManager
The rights manager -
_userProvider
The current user provider -
_populationContextHelper
The population context helper -
_groupDirectoryContextHelper
The group directory context helper -
_userPopulationDAO
The user population DAO -
_groupDirectoryDAO
The group directory DAO -
_siteTypeExtensionPoint
Site type EP -
_siteConfigurationManager
Site configuration -
_ametysResolver
Ametys resolver -
_siteColors
Handle site colors -
_skinsManager
The skins manager
-
-
Constructor Details
-
GetSitesAction
public GetSitesAction()
-
-
Method Details
-
service
- 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
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
Get the JSON representation of a site- Parameters:
site
- The site- Returns:
- The site as JSON object
-
canRead
Determines if the current user has a read access on site- Parameters:
site
- the siterequest
- the request- Returns:
- true if current user has read access
-