Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-16147

Allow configuring the Http Status from Automation operation response

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.0-HF02, 7.1
    • Component/s: Automation
    • Tags:
    • Upgrade notes:
      Hide

      Automation:

      It's now possible to extend org.nuxeo.ecm.automation.server.jaxrs.RestOperationException to throw in an operation for instance:

      ExceptionTest exception = new ExceptionTest("Exception Message");
      exception.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
      throw exception;

      It's now possible to specify in the org.nuxeo.ecm.automation.jaxrs.io.operations.RestOperationContext the status code when succeeding before returning the output:

      context.setHttpStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);

      Rest API:
      Rest API has been aligned on these new changes.
      org.nuxeo.ecm.restapi.server.jaxrs.APIRoot overrides now Webengine ModuleRoot handleError method to define specific status from Automation exception.

      Show
      Automation: It's now possible to extend org.nuxeo.ecm.automation.server.jaxrs.RestOperationException to throw in an operation for instance: ExceptionTest exception = new ExceptionTest("Exception Message"); exception.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); throw exception; It's now possible to specify in the org.nuxeo.ecm.automation.jaxrs.io.operations.RestOperationContext the status code when succeeding before returning the output: context.setHttpStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED); Rest API: Rest API has been aligned on these new changes. org.nuxeo.ecm.restapi.server.jaxrs.APIRoot overrides now Webengine ModuleRoot handleError method to define specific status from Automation exception.
    • Sprint:
      TGV 7.1-2

      Description

      When throwing exception in Automation operation, it's not possible to define http error status to return the appropriate remote exception. We can add a new "RestOperationException" extending OperationException adding this status and handle it in Automation server. (cf. SUPNXP-12002)

      Furthermore, we can add the possibility to specify the http status code when success in the RestOperationContext.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: