Package org.ametys.site
Class GeneratePageAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.site.GeneratePageAction
-
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,ThreadSafe,Action
public class GeneratePageAction extends ServiceableAction implements ThreadSafe
Call the BO for getting a page content and stores it in the local cache.
-
-
Field Summary
-
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 GeneratePageAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_copyHeaders(Request request, Response response, org.apache.http.HttpResponse cmsResponse, String[] names)Copy some response headers from the back-office.protected CacheAccessCounter_getCacheAccessCounter()Get the cache access counterprotected CacheAccessManager_getCacheAccessManager()Get the cache access managerprotected void_writePageOnDisk(String decodedPage, org.apache.http.HttpResponse cmsResponse)Read the page from the back-office response and write it into the cache.Mapact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)protected FilegetFile(File root, String pagePath)Get the cache file to write for the corresponding page.voidservice(ServiceManager sManager)-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
GeneratePageAction
public GeneratePageAction()
-
-
Method Detail
-
service
public void service(ServiceManager sManager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classServiceableAction- Throws:
ServiceException
-
_getCacheAccessCounter
protected CacheAccessCounter _getCacheAccessCounter()
Get the cache access counter- Returns:
- the CacheAccessCounter
-
_getCacheAccessManager
protected CacheAccessManager _getCacheAccessManager()
Get the cache access manager- Returns:
- the CacheAccessManager
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
-
_copyHeaders
protected void _copyHeaders(Request request, Response response, org.apache.http.HttpResponse cmsResponse, String[] names)
Copy some response headers from the back-office.- Parameters:
request- the front-office client request.response- the front-office client response.cmsResponse- the response from the back-office.names- the header names.
-
_writePageOnDisk
protected void _writePageOnDisk(String decodedPage, org.apache.http.HttpResponse cmsResponse) throws IOException
Read the page from the back-office response and write it into the cache.- Parameters:
decodedPage- the page path.cmsResponse- the back-office response, containing the page.- Throws:
IOException- if an error occurs writing the page into the cache.
-
-