Class OrbeonFormController
- java.lang.Object
-
- de.hybris.platform.xyformsweb.controllers.integration.AbstractController
-
- de.hybris.platform.xyformsweb.controllers.integration.OrbeonFormController
-
@Controller @Scope("tenant") public class OrbeonFormController extends AbstractControllerOrbeonFormController Integration for Orbeon Persistence API Use for providing Create, Read, Update and delete services for integrated Orbeon functions. This will also handle Search and other Orbeon provided functions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.xyformsweb.controllers.integration.AbstractController
AbstractController.HttpNotFoundException
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringFORM_BUILDER_NEXT_VERSIONprotected static java.lang.StringFR_SERVICE_RESOURCE_PREFIXprotected static org.apache.log4j.LoggerLOGprotected static java.lang.StringORBEON_FORM_DEFINITION_VERSIONprotected static java.lang.StringSEARCH_FORMDATA_EMPTY_SETprotected static java.lang.StringSEARCH_FORMDEFINITIONS_RESPONSE-
Fields inherited from class de.hybris.platform.xyformsweb.controllers.integration.AbstractController
FORWARD_PREFIX, REDIRECT_PREFIX, ROOT
-
-
Constructor Summary
Constructors Constructor Description OrbeonFormController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetFormDataData(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, javax.servlet.http.HttpServletResponse response)Retrieves the DATA version of a form data.java.lang.StringgetFormDataDraft(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataId, javax.servlet.http.HttpServletResponse response)Retrieves the DRAFT version of a form data.java.lang.StringgetFormDefinition(java.lang.String applicationId, java.lang.String formId, java.lang.String documentId, javax.servlet.http.HttpServletResponse response)Get yForm Definition.protected java.lang.StringgetSearchFormDefinitionBody(java.lang.String applicationId, java.lang.String formId)voidhandleAuthenticationCredentialsNotFoundException(java.lang.Exception ex)voidputFormData(java.lang.String applicationId, java.lang.String formId, java.lang.String formDataType, java.lang.String formDataId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Saves the amend form data back to the database.voidputFormDefinition(java.lang.String applicationId, java.lang.String formId, java.lang.String documentId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Put Form Definition.voidsearchFormData(java.lang.String applicationId, java.lang.String formId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Search for form data, no actual implementation yet, only returns an empty xml, this to minimize error logs on the orbeon side.voidsearchFormDefinitions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Search for form definitions, no actual implementation yet, only returns an empty xml, this to minimize error logs on the orbeon side.-
Methods inherited from class de.hybris.platform.xyformsweb.controllers.integration.AbstractController
addRequestToModel, getBean
-
-
-
-
Field Detail
-
LOG
protected static final org.apache.log4j.Logger LOG
-
FR_SERVICE_RESOURCE_PREFIX
protected static final java.lang.String FR_SERVICE_RESOURCE_PREFIX
- See Also:
- Constant Field Values
-
ORBEON_FORM_DEFINITION_VERSION
protected static final java.lang.String ORBEON_FORM_DEFINITION_VERSION
- See Also:
- Constant Field Values
-
FORM_BUILDER_NEXT_VERSION
protected static final java.lang.String FORM_BUILDER_NEXT_VERSION
- See Also:
- Constant Field Values
-
SEARCH_FORMDATA_EMPTY_SET
protected static final java.lang.String SEARCH_FORMDATA_EMPTY_SET
- See Also:
- Constant Field Values
-
SEARCH_FORMDEFINITIONS_RESPONSE
protected static final java.lang.String SEARCH_FORMDEFINITIONS_RESPONSE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getFormDefinition
@RequestMapping(method=GET, value="/fr/service/hybris/crud/{applicationId}/{formId}/form/form.xhtml", produces="application/xhtml+xml; charset=utf-8") @ResponseBody @PreAuthorize("isAuthenticated()") public java.lang.String getFormDefinition(@PathVariable java.lang.String applicationId, @PathVariable java.lang.String formId, @RequestParam(value="document",required=false) java.lang.String documentId, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException, YFormServiceExceptionGet yForm Definition.
On passing in the applicationId and the formId will return a form.xhtml for the Persistence service call. If documentId is provided then it will return the form definition associated to it. This is valid when dealing with a form definition that has multiple versions.- Parameters:
applicationId-formId-documentId-response-- Throws:
javax.servlet.ServletExceptionjava.io.IOExceptionYFormServiceException
-
putFormDefinition
@RequestMapping(method=PUT, value="/fr/service/hybris/crud/{applicationId}/{formId}/form/form.xhtml") @PreAuthorize("isAuthenticated()") public void putFormDefinition(@PathVariable java.lang.String applicationId, @PathVariable java.lang.String formId, @RequestParam(value="document",required=false) java.lang.String documentId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOExceptionPut Form Definition.
Publish at the FormBuilder will save the new form definition by calling this service function.- Parameters:
applicationId-formId-documentId-request-- Throws:
javax.servlet.ServletExceptionjava.io.IOException
-
getFormDataDraft
@RequestMapping(method=GET, value="/fr/service/hybris/crud/{applicationId}/{formId}/draft/{formDataId}/data.xml", produces="application/xml;charset=UTF-8") @ResponseBody @PreAuthorize("isAuthenticated()") public java.lang.String getFormDataDraft(@PathVariable java.lang.String applicationId, @PathVariable java.lang.String formId, @PathVariable java.lang.String formDataId, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException, YFormServiceExceptionRetrieves the DRAFT version of a form data.- Parameters:
applicationId-formId-formDataId-response-- Throws:
javax.servlet.ServletExceptionjava.io.IOExceptionYFormServiceException
-
getFormDataData
@RequestMapping(method=GET, value="/fr/service/hybris/crud/{applicationId}/{formId}/data/{formDataId}/data.xml", produces="application/xml;charset=UTF-8") @ResponseBody @PreAuthorize("isAuthenticated()") public java.lang.String getFormDataData(@PathVariable java.lang.String applicationId, @PathVariable java.lang.String formId, @PathVariable java.lang.String formDataId, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException, YFormServiceExceptionRetrieves the DATA version of a form data.- Parameters:
applicationId-formId-formDataId-response-- Throws:
javax.servlet.ServletExceptionjava.io.IOExceptionYFormServiceException
-
putFormData
@RequestMapping(method=PUT, value="/fr/service/hybris/crud/{applicationId}/{formId}/{formDataType:data|draft}/{formDataId}/data.xml") @PreAuthorize("isAuthenticated()") public void putFormData(@PathVariable java.lang.String applicationId, @PathVariable java.lang.String formId, @PathVariable java.lang.String formDataType, @PathVariable java.lang.String formDataId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException, YFormServiceExceptionSaves the amend form data back to the database. Creates a new YFormData if it does not exist previously.- Parameters:
applicationId-formId-formDataType-formDataId-request-response-- Throws:
javax.servlet.ServletExceptionjava.io.IOExceptionYFormServiceException
-
searchFormData
@RequestMapping(method=POST, value="/fr/service/hybris/search/{applicationId}/{formId}") @PreAuthorize("isAuthenticated()") public void searchFormData(@PathVariable java.lang.String applicationId, @PathVariable java.lang.String formId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException, YFormServiceExceptionSearch for form data, no actual implementation yet, only returns an empty xml, this to minimize error logs on the orbeon side.This method is also called when versioning is enabled and the query is as follows:
only 10 1 en When a draft record is found for this document a dialog is shown to the user to make a choice, whether to use the DRAFT record or the DATA one.
In this implementation, an empty set is returned and the responsibility to deal with this scenario is for
getFormDataData()- Parameters:
applicationId-formId-request-response-- Throws:
javax.servlet.ServletExceptionjava.io.IOExceptionYFormServiceException
-
searchFormDefinitions
@RequestMapping(method=GET, value={"/fr/service/hybris/form","/fr/service/hybris/form/{applicationId}","/fr/service/hybris/form/{applicationId}/{formId}"}) @PreAuthorize("isAuthenticated()") public void searchFormDefinitions(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException, YFormServiceExceptionSearch for form definitions, no actual implementation yet, only returns an empty xml, this to minimize error logs on the orbeon side.- Parameters:
request-response-- Throws:
javax.servlet.ServletExceptionjava.io.IOExceptionYFormServiceException
-
getSearchFormDefinitionBody
protected java.lang.String getSearchFormDefinitionBody(java.lang.String applicationId, java.lang.String formId) throws YFormServiceException- Throws:
YFormServiceException
-
handleAuthenticationCredentialsNotFoundException
@ResponseStatus(UNAUTHORIZED) @ResponseBody @ExceptionHandler(org.springframework.security.authentication.AuthenticationCredentialsNotFoundException.class) public void handleAuthenticationCredentialsNotFoundException(java.lang.Exception ex)
-
-