Class LatestVersionAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.plugins.mobileapp.action.LatestVersionAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
Returns the latest version compatible between client and server
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
Parameter containing the client versionprotected static final int
Application current versionprotected JSONUtils
JSON UtilsFields 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 TypeMethodDescriptionact
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) Execute the actionprotected Object
Get a parameter either from the POST body or directly from the request parametersgetParameters
(Map objectModel) Get a map of parameters from the POST bodyvoid
service
(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_CURRENT_VERSION
Application current version- See Also:
-
_CLIENT_VERSION
Parameter containing the client version- See Also:
-
_jsonUtils
JSON Utils
-
-
Constructor Details
-
LatestVersionAction
public LatestVersionAction()
-
-
Method Details
-
doAction
Execute the action- Parameters:
request
- the requestjsonParams
- map of parameters passed in the post body as json- Returns:
- the json map to return
-
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
-
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)
-