java-middle-tier/src/main/java/com/marklogic/pipes/ui/customStep/CustomStepController.java
/**
   * Will copy incoming body (hopefully a Pipes-generated main.sjs for the custom step) to the proper location specified by the "name" parameter
   * Additionally, it will deploy the main.sjs, if requested by using param deploy=true in the request
   *
   * @param body    content of main.sjs
   * @param method  not used
   * @param request name: name of the custom step; deploy=true will also push the code to ML
   * @throws IOException
   */
Will copy incoming body (hopefully a Pipes-generated main.sjs for the custom step) to the proper location specified by the "name" parameter
Additionally, it will deploy the main.sjs, if requested by using param deploy=true in the request

@param body    content of main.sjs
@param method  not used
@param request name: name of the custom step; deploy=true will also push the code to ML
@throws IOException
Will copy incoming body ( hopefully a Pipes - generated main . sjs for the custom step ) to the proper location specified by the " name " parameter Additionally it will deploy the main . sjs if requested by using param deploy = true in the request @param body content of main . sjs @param method not used @param request name : name of the custom step ; deploy = true will also push the code to ML @throws IOException
@RequestMapping(value = "/customSteps", method = RequestMethod.POST)
  public ResponseEntity<Object> deployCustomStep(@RequestBody String body, HttpMethod method, HttpServletRequest request) throws IOException {
    try {
      if (request.getParameter("name") != null) {
        String customStepName = request.getParameter("name");
        customStepService.copyCustomStepToDhf(body, customStepName);
        String[] dependencies = null;
        String dependenciesString = request.getParameter("dependencies");
        if (dependenciesString != null) {
          dependenciesString = URLDecoder.decode(dependenciesString);
          dependencies = dependenciesString.split(",");
        }
        if (dependencies != null) {
          customStepService.copyDepdenciesToDHfSource(dependencies);
        }
        if (request.getParameter("deploy") != null && request.getParameter("deploy").equals("true")) {
          customStepService.loadCustomStepToMl(body, customStepName);
        }
        return new ResponseEntity<>(null, HttpStatus.OK);
      } else {
        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body("Parameter 'name' is mandatory.");
      }
    } catch (IOException e) {
      logger.error("Error occured during deployCustomStep", e);
      throw e;
    }
  }
@ RequestMapping ( value = "/customSteps" , method = RequestMethod . POST ) public ResponseEntity < Object > deployCustomStep ( @ RequestBody String body , HttpMethod method , HttpServletRequest request ) throws IOException { try { if ( request . getParameter ( "name" ) != null ) { String customStepName = request . getParameter ( "name" ) ; customStepService . copyCustomStepToDhf ( body , customStepName ) ; String [ ] dependencies = null ; String dependenciesString = request . getParameter ( "dependencies" ) ; if ( dependenciesString != null ) { dependenciesString = URLDecoder . decode ( dependenciesString ) ; dependencies = dependenciesString . split ( "," ) ; } if ( dependencies != null ) { customStepService . copyDepdenciesToDHfSource ( dependencies ) ; } if ( request . getParameter ( "deploy" ) != null && request . getParameter ( "deploy" ) . equals ( "true" ) ) { customStepService . loadCustomStepToMl ( body , customStepName ) ; } return new ResponseEntity < > ( null , HttpStatus . OK ) ; } else { return ResponseEntity . status ( HttpStatus . BAD_REQUEST ) . body ( "Parameter 'name' is mandatory." ) ; } } catch ( IOException e ) { logger . error ( "Error occured during deployCustomStep" , e ) ; throw e ; } }
Will copy incoming body (hopefully a Pipes-generated main.sjs for the custom step) to the proper location specified by the "name" parameter
 Additionally, it will deploy the main.sjs, if requested by using param deploy=true in the request
Will copy incoming body ( hopefully a Pipes - generated main . sjs for the custom step ) to the proper location specified by the " name " parameter Additionally it will deploy the main . sjs if requested by using param deploy = true in the request