Class GetNewslettersAction
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.cocoon.acting.AbstractAction
-
- org.apache.cocoon.acting.ServiceableAction
-
- org.ametys.plugins.newsletter.actions.GetNewslettersAction
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
public class GetNewslettersAction extends ServiceableAction
SAX events for category providers, categories and newsletters
-
-
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 GetNewslettersAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map
act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters)
protected Map<String,Object>
categoryToJSON(Category category, CategoryProvider categoryProvider, boolean categoriesOnly)
Gets category's properties to JSON formatprotected Map<String,Object>
newsletterToJSON(Content newsletter, CategoryProvider categoryProvider)
Gets newsletter's properties to JSON formatprotected Map<String,Object>
providerToJSON(CategoryProvider categoryProvider, String siteName, String lang)
Gets category provider's properties to JSON formatvoid
service(ServiceManager serviceManager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
GetNewslettersAction
public GetNewslettersAction()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) 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
-
providerToJSON
protected Map<String,Object> providerToJSON(CategoryProvider categoryProvider, String siteName, String lang)
Gets category provider's properties to JSON format- Parameters:
categoryProvider
- The category providersiteName
- The site namelang
- The lang- Returns:
- The category provider properties
-
categoryToJSON
protected Map<String,Object> categoryToJSON(Category category, CategoryProvider categoryProvider, boolean categoriesOnly)
Gets category's properties to JSON format- Parameters:
category
- The categorycategoryProvider
- The category providercategoriesOnly
- true if only categories are displayed- Returns:
- The category properties
-
newsletterToJSON
protected Map<String,Object> newsletterToJSON(Content newsletter, CategoryProvider categoryProvider)
Gets newsletter's properties to JSON format- Parameters:
newsletter
- The newslettercategoryProvider
- The category provider- Returns:
- The newsletter's properties
-
-