Package com.avoka.fc.core.service.form
Class AbstractDynamicDataWebService
- java.lang.Object
-
- com.avoka.fc.core.service.BaseService
-
- com.avoka.fc.core.service.CayenneService
-
- com.avoka.fc.core.service.form.AbstractDynamicDataWebService
-
public abstract class AbstractDynamicDataWebService extends CayenneService
Provides an abstract Web Service end point form PDF forms using Dynamic Data. Concrete subclasses need to be declared in the portal project to for Spring/CXF class loading to work.
-
-
Field Summary
Fields Modifier and Type Field Description static String
OPERATION_NAME_BACKGROUND_SAVE
The name identifying the background save operation when InvokeSfmService is usedstatic String
OPERATION_NAME_DYNAMIC_DATA
The name identifying the dynamic data retrieval operation when InvokeSfmService is usedstatic String
OPERATION_NAME_PING
The name identifying the ping operation when InvokeSfmService is usedstatic String
PARAMETER_NAME_REQUEST_KEY
The 'sfmRequestKey' parameter used in the dynamic data and ping operationsstatic String
PARAMETER_NAME_SERVICE_NAME
The 'sfmServiceName' parameter used in the dynamic data operationstatic String
PARAMETER_NAME_SERVICE_VERSION
The 'sfmServiceVersion' parameter used in the dynamic data operationstatic String
PARAMETER_NAME_XML_DATA
The 'xml_data' parameter used in the background save operation
-
Constructor Summary
Constructors Constructor Description AbstractDynamicDataWebService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SubmissionDataBean
extractBackgroundSaveData(String xmlDataString, HttpServletRequest request)
protected String
handleBackgroundSave(String jsonParams)
protected void
handleBackgroundSaveException(Throwable error, HttpServletRequest request, SubmissionDataBean submissionData)
protected String
handleDynamicDataRequest(String sfmRequestKey, String sfmServiceName, Integer sfmServiceVersion, String sfmJsonParams)
Return the JSON encoded dynamic service data for the given service request.protected String
handlePing(String sfmRequestKey, String sfmJsonParams)
Handle a ping from a form to the SFM server.String
InvokeService(String sfmOperationName, String sfmJsonParams)
Invokes an arbitrary SFM "service" (not limited to service definitions) and returns the result, if any.-
Methods inherited from class com.avoka.fc.core.service.CayenneService
commitChanges, deleteObject, deleteObjects, findObject, getDataContext, getDataDomain, getObjectForPK, getObjectStore, newObject, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, refetchEntity, refetchObject, registerNewObject, rollbackChanges, toMap, toMap
-
Methods inherited from class com.avoka.fc.core.service.BaseService
getLogger
-
-
-
-
Field Detail
-
OPERATION_NAME_BACKGROUND_SAVE
public static final String OPERATION_NAME_BACKGROUND_SAVE
The name identifying the background save operation when InvokeSfmService is used- See Also:
- Constant Field Values
-
OPERATION_NAME_DYNAMIC_DATA
public static final String OPERATION_NAME_DYNAMIC_DATA
The name identifying the dynamic data retrieval operation when InvokeSfmService is used- See Also:
- Constant Field Values
-
OPERATION_NAME_PING
public static final String OPERATION_NAME_PING
The name identifying the ping operation when InvokeSfmService is used- See Also:
- Constant Field Values
-
PARAMETER_NAME_XML_DATA
public static final String PARAMETER_NAME_XML_DATA
The 'xml_data' parameter used in the background save operation- See Also:
- Constant Field Values
-
PARAMETER_NAME_REQUEST_KEY
public static final String PARAMETER_NAME_REQUEST_KEY
The 'sfmRequestKey' parameter used in the dynamic data and ping operations- See Also:
- Constant Field Values
-
PARAMETER_NAME_SERVICE_NAME
public static final String PARAMETER_NAME_SERVICE_NAME
The 'sfmServiceName' parameter used in the dynamic data operation- See Also:
- Constant Field Values
-
PARAMETER_NAME_SERVICE_VERSION
public static final String PARAMETER_NAME_SERVICE_VERSION
The 'sfmServiceVersion' parameter used in the dynamic data operation- See Also:
- Constant Field Values
-
-
Method Detail
-
InvokeService
public String InvokeService(String sfmOperationName, String sfmJsonParams)
Invokes an arbitrary SFM "service" (not limited to service definitions) and returns the result, if any.- Parameters:
sfmOperationName
- the name of the operation to invokesfmJsonParams
- the parameters for the operation as a JSON string- Returns:
- a String, contents depending on the service that is invoked (may be null, or a JSON string encapsulating complex data)
-
handleDynamicDataRequest
protected String handleDynamicDataRequest(String sfmRequestKey, String sfmServiceName, Integer sfmServiceVersion, String sfmJsonParams) throws IllegalArgumentException, SecurityException
Return the JSON encoded dynamic service data for the given service request.- Parameters:
sfmRequestKey
- the request key rendered in the formsfmServiceName
- the Dynamic Data service definition namesfmServiceVersion
- the Dynamic Data service version number (optional)sfmJsonParams
- the URL encoded service parameters- Returns:
- the JSON encoded dynamic service data for the given service request
- Throws:
IllegalArgumentException
- if web service parameters were invalidSecurityException
- if web service invocation is not secured
-
handlePing
protected String handlePing(String sfmRequestKey, String sfmJsonParams) throws IllegalArgumentException, SecurityException
Handle a ping from a form to the SFM server.- Parameters:
sfmRequestKey
- the request key rendered in the formsfmJsonParams
- the URL encoded service parameters- Returns:
- the ping response generated by the service
- Throws:
IllegalArgumentException
- if web service parameters were invalidSecurityException
- if web service invocation is not secured
-
handleBackgroundSaveException
protected void handleBackgroundSaveException(Throwable error, HttpServletRequest request, SubmissionDataBean submissionData)
-
extractBackgroundSaveData
protected SubmissionDataBean extractBackgroundSaveData(String xmlDataString, HttpServletRequest request)
-
-