Class ScriptProcessesController

java.lang.Object
org.dspace.app.rest.ScriptProcessesController

@RestController @RequestMapping("/api/system/scripts/{name}/processes") public class ScriptProcessesController extends Object
This controller adds additional subresource methods to allow connecting scripts with processes
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>
    startProcess(String scriptName, List<org.springframework.web.multipart.MultipartFile> files)
    This method can be called by sending a POST request to the system/scripts/{name}/processes endpoint This will start a process for the script that matches the given name
    org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>>
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ScriptProcessesController

      public ScriptProcessesController()
  • Method Details

    • startProcess

      @RequestMapping(method=POST, consumes="multipart/form-data") @PreAuthorize("hasAuthority(\'AUTHENTICATED\')") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> startProcess(@PathVariable(name="name") String scriptName, @RequestParam(name="file",required=false) List<org.springframework.web.multipart.MultipartFile> files) throws Exception
      This method can be called by sending a POST request to the system/scripts/{name}/processes endpoint This will start a process for the script that matches the given name
      Parameters:
      scriptName - The name of the script that we want to start a process for
      files - (Optional) any files that need to be passed to the script for it to run
      Returns:
      The ProcessResource object for the created process
      Throws:
      Exception - If something goes wrong
    • startProcessInvalidMimeType

      @RequestMapping(method=POST, consumes="!multipart/form-data") @PreAuthorize("hasAuthority(\'AUTHENTICATED\')") public org.springframework.http.ResponseEntity<org.springframework.hateoas.RepresentationModel<?>> startProcessInvalidMimeType(@PathVariable(name="name") String scriptName) throws Exception
      Throws:
      Exception