Mendix Runtime
Documentation for the Mendix Runtime Environment API
com.mendix.systemwideinterfaces.ClientAction Class Reference

List of all members.

Public Member Functions

abstract Map< String,?extends
Object > 
execute (JSONObject params) throws Exception
final String getName ()
final String getDescription ()
final void setContext (IContext context)
final IContext getContext ()
final void setName (String name)
final void setDescription (String description)
void setJSONGenerator (JSONGenerator generator)
ClientAction clone ()
List< String > getParameterNames ()
void setMxRuntimeRequest (IMxRuntimeRequest request)

Protected Member Functions

Map< String,?extends Object > convertJSONObject (JSONObject jsonObject) throws JSONException
List<?extends Object > convertJSONArray (JSONArray array) throws JSONException

Protected Attributes

IContext context
IMxRuntimeRequest request
JSONGenerator generator

Detailed Description

Abstract class used to define ExternalInterface actions
The definition consist of three element: name, params and returnValue
name: unique name identifying this action
params: number of params defined by name and ParamType
returnValue: result of executing this action, defined by name-ParamType pairs

Example:
public RetrieveXPathAction extends ExternalInterfaceAction
{

public RetrieveXPathAction
{
this.setName("retrieveXPath");
}

public abstract Map<String, Object> execute(Map<String, Object> params)
{
String xpath = (String) params.get("xpath");
Integer limit = (Integer) params.get("limit");
Integer offset = (Integer) params.get("offset");
Map<String,String> sort = (Map<String,String>) params.get("sort");
Integer depth = (Integer) params.get("depth");
List<IMendixObject> mxobjects = Core.retrieveXPath(xpath, limit, offset, sort, depth);
Map<String, Object> result = new LinkedHashMap<String, Object>();
result.put("mxobjects", mxobjects);
return result;
}

}


Member Function Documentation

ClientAction com.mendix.systemwideinterfaces.ClientAction.clone ( )
List<? extends Object> com.mendix.systemwideinterfaces.ClientAction.convertJSONArray ( JSONArray  array) throws JSONException [protected]
Map<String,? extends Object> com.mendix.systemwideinterfaces.ClientAction.convertJSONObject ( JSONObject  jsonObject) throws JSONException [protected]
abstract Map<String, ? extends Object> com.mendix.systemwideinterfaces.ClientAction.execute ( JSONObject  params) throws Exception [pure virtual]

Execute this action

Parameters:
paramshas to have the same structure as this.params, but instead of ParamType's it should contain values
Returns:
result should have the same structure as this.returnValue, but instead of ParamType's is should contain values
final IContext com.mendix.systemwideinterfaces.ClientAction.getContext ( )
Returns:
the context
final String com.mendix.systemwideinterfaces.ClientAction.getDescription ( )
Returns:
the description
final String com.mendix.systemwideinterfaces.ClientAction.getName ( )
Returns:
the name
List<String> com.mendix.systemwideinterfaces.ClientAction.getParameterNames ( )
Returns:
the parameternames
final void com.mendix.systemwideinterfaces.ClientAction.setContext ( IContext  context)
Parameters:
contextthe context
final void com.mendix.systemwideinterfaces.ClientAction.setDescription ( String  description)
Parameters:
descriptionthe description to set
void com.mendix.systemwideinterfaces.ClientAction.setJSONGenerator ( JSONGenerator  generator)
Parameters:
generatorthe json generator to set
void com.mendix.systemwideinterfaces.ClientAction.setMxRuntimeRequest ( IMxRuntimeRequest  request)
Parameters:
requestthe mxruntime request to set
final void com.mendix.systemwideinterfaces.ClientAction.setName ( String  name)
Parameters:
namethe name to set

Member Data Documentation


The documentation for this class was generated from the following file: