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 AbstractController
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.
  • Field Details

  • 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.ServletException
      IOException
      YFormServiceException
    • 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.ServletException
      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 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.ServletException
      IOException
      YFormServiceException
    • 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.ServletException
      IOException
      YFormServiceException
    • 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.ServletException
      IOException
      YFormServiceException
    • 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.ServletException
      IOException
      YFormServiceException
    • 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.ServletException
      IOException
    • getSearchFormDefinitionBody

      protected String getSearchFormDefinitionBody(String applicationId, String formId)
    • handleAuthenticationCredentialsNotFoundException

      @ResponseStatus(UNAUTHORIZED) @ResponseBody @ExceptionHandler(org.springframework.security.authentication.AuthenticationCredentialsNotFoundException.class) public void handleAuthenticationCredentialsNotFoundException(Exception ex)