Package org.ametys.web.site
Class SiteStatisticsAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.web.site.SiteStatisticsAction
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
GlobalStatisticsAction
public class SiteStatisticsAction extends ServiceableAction
Provides some statistics about aSite
, such as :
- Number of pages
- Number of live contents
- Number of orphaned contents
- Number of external contents
-
-
Field Summary
Fields Modifier and Type Field Description protected PageHelper
_pageCacheHelper
The page cache helper.protected ServiceExtensionPoint
_serviceExtPt
The service extension point.protected SiteManager
_siteManager
The site manager.-
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 SiteStatisticsAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
_contents2json(Site site)
Statistics on contentsprotected void
_processContents(Site site, Map<String,Long> values)
Process the contents of the site to gather information on themprotected void
_processPages(PagesContainer pages, Map<String,Long> values)
Process statistics on a pages containerprotected void
_processResources(TraversableAmetysObject resourceContainer, HashMap<String,Long> values)
Process statistics on a resourcesprotected Map<String,Object>
_resources2json(Site site)
Statistics on resourcesprotected Map<String,Object>
_sitemap2json(Sitemap sitemap)
Statistics on sitemapMap
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
void
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.
-
_serviceExtPt
protected ServiceExtensionPoint _serviceExtPt
The service extension point.
-
_pageCacheHelper
protected PageHelper _pageCacheHelper
The page cache helper.
-
-
Constructor Detail
-
SiteStatisticsAction
public SiteStatisticsAction()
-
-
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
-
_contents2json
protected Map<String,Object> _contents2json(Site site) throws RepositoryException
Statistics on contents- Parameters:
site
- the site- Returns:
- the statistics on contents
- Throws:
RepositoryException
- if an error occurs
-
_processContents
protected void _processContents(Site site, Map<String,Long> values) throws RepositoryException
Process the contents of the site to gather information on them- Parameters:
site
- the sitevalues
- the information on the contents- Throws:
RepositoryException
- if an error occurs on the repository
-
_resources2json
protected Map<String,Object> _resources2json(Site site)
Statistics on resources- Parameters:
site
- the site- Returns:
- the statistics on resources
-
_sitemap2json
protected Map<String,Object> _sitemap2json(Sitemap sitemap)
Statistics on sitemap- Parameters:
sitemap
- the sitemap- Returns:
- the statistics on sitemap
-
_processPages
protected void _processPages(PagesContainer pages, Map<String,Long> values)
Process statistics on a pages container- Parameters:
pages
- The pages container (page or sitemap)values
- The values
-
_processResources
protected void _processResources(TraversableAmetysObject resourceContainer, HashMap<String,Long> values)
Process statistics on a resources- Parameters:
resourceContainer
- The resources containervalues
- The values
-
-