Class ScriptRestRepository

  • All Implemented Interfaces:
    org.springframework.data.repository.CrudRepository<ScriptRest,​String>, org.springframework.data.repository.PagingAndSortingRepository<ScriptRest,​String>, org.springframework.data.repository.Repository<ScriptRest,​String>

    @Component("system.script")
    public class ScriptRestRepository
    extends DSpaceRestRepository<ScriptRest,​String>
    This is the REST repository dealing with the Script logic
    • Constructor Detail

      • ScriptRestRepository

        public ScriptRestRepository()
    • Method Detail

      • findOne

        @PreAuthorize("hasAuthority(\'ADMIN\')")
        public ScriptRest findOne​(org.dspace.core.Context context,
                                  String name)
        Description copied from class: DSpaceRestRepository
        Method to implement to support retrieval of a specific REST object instance
        Specified by:
        findOne in class DSpaceRestRepository<ScriptRest,​String>
        Parameters:
        context - the dspace context
        name - the rest object id
        Returns:
        the REST object identified by its ID
      • findAll

        @PreAuthorize("hasAuthority(\'ADMIN\')")
        public org.springframework.data.domain.Page<ScriptRest> findAll​(org.dspace.core.Context context,
                                                                        org.springframework.data.domain.Pageable pageable)
        Description copied from class: DSpaceRestRepository
        Method to implement to support scroll of entity instances from the collection resource endpoint
        Specified by:
        findAll in class DSpaceRestRepository<ScriptRest,​String>
        Parameters:
        context - the dspace context
        pageable - object embedding the requested pagination info
        Returns:
      • startProcess

        public ProcessRest startProcess​(org.dspace.core.Context context,
                                        String scriptName,
                                        List<org.springframework.web.multipart.MultipartFile> files)
                                 throws SQLException,
                                        IOException,
                                        org.dspace.authorize.AuthorizeException,
                                        IllegalAccessException,
                                        InstantiationException
        This method will take a String scriptname parameter and it'll try to resolve this to a script known by DSpace. If a script is found, it'll start a process for this script with the given properties to this request
        Parameters:
        scriptName - The name of the script that will try to be resolved and started
        Returns:
        A ProcessRest object representing the started process for this script
        Throws:
        SQLException - If something goes wrong
        IOException - If something goes wrong
        org.dspace.authorize.AuthorizeException
        IllegalAccessException
        InstantiationException