Class GetFeedsContentsAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.mobileapp.action.GetFeedsContentsAction
- All Implemented Interfaces:
Component,LogEnabled,Serviceable,Action
Returns the list of feeds for a user
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classContent fetched from a query -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderThe current user providerprotected JSONUtilsJSON Utilsprotected QueriesHelperThe Ametys object resolverFields inherited from class org.apache.cocoon.acting.ServiceableAction
managerFields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionact(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) protected intcompareDates(Object o1, Object o2) contentToJson(GetFeedsContentsAction.QuerySearchresult searchResult) Transform a content into a json mapExecute the actiondoLoggedInAction(Request request, Map<String, Object> jsonParams) Execute the action that requires to be logged inprotected ObjectGet a parameter either from the POST body or directly from the request parametersgetParameters(Map objectModel) Get a map of parameters from the POST bodyvoidservice(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_queryHelper
The Ametys object resolver -
_currentUserProvider
The current user provider -
_jsonUtils
JSON Utils
-
-
Constructor Details
-
GetFeedsContentsAction
public GetFeedsContentsAction()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
doLoggedInAction
Execute the action that requires to be logged in- Parameters:
request- the requestjsonParams- map of parameters passed in the post body as json- Returns:
- the json map to return
-
contentToJson
Transform a content into a json map- Parameters:
searchResult- the search result containing tho content- Returns:
- a json map
-
compareDates
- Parameters:
o1- aZonedDateTimeand/orLocalDateand/orDateo2- aZonedDateTimeand/orLocalDateand/orDate- Returns:
- -1 if o1 is before o2, +1 if o1 is after o2, 0 if same date (not equals)
- Throws:
ClassCastException- one of the object is not aZonedDateTimeorLocalDateorDate
-
doAction
Execute the action- Parameters:
request- the requestjsonParams- map of parameters passed in the post body as json- Returns:
- the json map to return
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception - Throws:
Exception
-
getParameters
Get a map of parameters from the POST body- Parameters:
objectModel- the objectModel from whidh the body will be read- Returns:
- a Map representing the body, parsed as json
- Throws:
IOException- something went wrong
-
getParameter
Get a parameter either from the POST body or directly from the request parameters- Parameters:
name- the name of the parameter to fetchjsonParams- the json parameters passedrequest- the request to read from- Returns:
- an Object (if from json) or a String (if from the request)
-