Class OrbeonFormController
java.lang.Object
de.hybris.platform.xyformsweb.controllers.integration.AbstractController
de.hybris.platform.xyformsweb.controllers.integration.OrbeonFormController
OrbeonFormController 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
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final org.apache.log4j.Loggerprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class de.hybris.platform.xyformsweb.controllers.integration.AbstractController
FORWARD_PREFIX, REDIRECT_PREFIX, ROOT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFormDataData(String applicationId, String formId, String formDataId, javax.servlet.http.HttpServletResponse response) Retrieves the DATA version of a form data.getFormDataDraft(String applicationId, String formId, String formDataId, javax.servlet.http.HttpServletResponse response) Retrieves the DRAFT version of a form data.getFormDefinition(String applicationId, String formId, String documentId, javax.servlet.http.HttpServletResponse response) Get yForm Definition.protected StringgetSearchFormDefinitionBody(String applicationId, String formId) voidvoidputFormData(String applicationId, String formId, String formDataType, String formDataId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Saves the amend form data back to the database.voidputFormDefinition(String applicationId, String formId, String documentId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Put Form Definition.voidsearchFormData(String applicationId, 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 Details
-
LOG
protected static final org.apache.log4j.Logger LOG -
FR_SERVICE_RESOURCE_PREFIX
- See Also:
-
ORBEON_FORM_DEFINITION_VERSION
- See Also:
-
FORM_BUILDER_NEXT_VERSION
- See Also:
-
SEARCH_FORMDATA_EMPTY_SET
- See Also:
-
SEARCH_FORMDEFINITIONS_RESPONSE
- See Also:
-
-
Constructor Details
-
OrbeonFormController
public OrbeonFormController()
-
-
Method Details
-
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 String getFormDefinition(@PathVariable String applicationId, @PathVariable String formId, @RequestParam(value="document",required=false) String documentId, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, YFormServiceException Get 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.ServletExceptionIOExceptionYFormServiceException
-
putFormDefinition
@RequestMapping(method=PUT, value="/fr/service/hybris/crud/{applicationId}/{formId}/form/form.xhtml") @PreAuthorize("isAuthenticated()") public void putFormDefinition(@PathVariable String applicationId, @PathVariable String formId, @RequestParam(value="document",required=false) String documentId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Put 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.ServletExceptionIOException
-
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 String getFormDataDraft(@PathVariable String applicationId, @PathVariable String formId, @PathVariable String formDataId, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, YFormServiceException Retrieves the DRAFT version of a form data.- Parameters:
applicationId-formId-formDataId-response-- Throws:
javax.servlet.ServletExceptionIOExceptionYFormServiceException
-
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 String getFormDataData(@PathVariable String applicationId, @PathVariable String formId, @PathVariable String formDataId, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, YFormServiceException Retrieves the DATA version of a form data.- Parameters:
applicationId-formId-formDataId-response-- Throws:
javax.servlet.ServletExceptionIOExceptionYFormServiceException
-
putFormData
@RequestMapping(method=PUT, value="/fr/service/hybris/crud/{applicationId}/{formId}/{formDataType:data|draft}/{formDataId}/data.xml") @PreAuthorize("isAuthenticated()") public void putFormData(@PathVariable String applicationId, @PathVariable String formId, @PathVariable String formDataType, @PathVariable String formDataId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, YFormServiceException Saves 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.ServletExceptionIOExceptionYFormServiceException
-
searchFormData
@RequestMapping(method=POST, value="/fr/service/hybris/search/{applicationId}/{formId}") @PreAuthorize("isAuthenticated()") public void searchFormData(@PathVariable String applicationId, @PathVariable String formId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException, YFormServiceException Search 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:
<?xml version="1.0" encoding="UTF-8"?>only <page-size>10</page-size> <page-number>1</page-number>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.ServletExceptionIOExceptionYFormServiceException
-
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, IOException Search 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.ServletExceptionIOException
-
getSearchFormDefinitionBody
-
handleAuthenticationCredentialsNotFoundException
@ResponseStatus(UNAUTHORIZED) @ResponseBody @ExceptionHandler(org.springframework.security.authentication.AuthenticationCredentialsNotFoundException.class) public void handleAuthenticationCredentialsNotFoundException(Exception ex)
-