Class MetadataSchemaRestRepository

    • Constructor Detail

      • MetadataSchemaRestRepository

        public MetadataSchemaRestRepository()
    • Method Detail

      • findAll

        public org.springframework.data.domain.Page<MetadataSchemaRest> 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<MetadataSchemaRest,​Integer>
        Parameters:
        context - the dspace context
        pageable - object embedding the requested pagination info
        Returns:
      • createAndReturn

        @PreAuthorize("hasAuthority(\'ADMIN\')")
        protected MetadataSchemaRest createAndReturn​(org.dspace.core.Context context)
                                              throws org.dspace.authorize.AuthorizeException,
                                                     SQLException
        Description copied from class: DSpaceRestRepository
        Method to implement to support the creation of a new instance. Usually require to retrieve the http request from the thread bound attribute
        Overrides:
        createAndReturn in class DSpaceRestRepository<MetadataSchemaRest,​Integer>
        Parameters:
        context - the dspace context
        Returns:
        the created REST object
        Throws:
        org.dspace.authorize.AuthorizeException
        SQLException
      • delete

        @PreAuthorize("hasAuthority(\'ADMIN\')")
        protected void delete​(org.dspace.core.Context context,
                              Integer id)
                       throws org.dspace.authorize.AuthorizeException
        Description copied from class: DSpaceRestRepository
        Method to implement to support delete of a single object instance
        Overrides:
        delete in class DSpaceRestRepository<MetadataSchemaRest,​Integer>
        Parameters:
        context - the dspace context
        id - the id of the rest object to delete
        Throws:
        org.dspace.authorize.AuthorizeException
      • put

        @PreAuthorize("hasAuthority(\'ADMIN\')")
        protected MetadataSchemaRest put​(org.dspace.core.Context context,
                                         javax.servlet.http.HttpServletRequest request,
                                         String apiCategory,
                                         String model,
                                         Integer id,
                                         com.fasterxml.jackson.databind.JsonNode jsonNode)
                                  throws SQLException,
                                         org.dspace.authorize.AuthorizeException
        Description copied from class: DSpaceRestRepository
        Implement this method in the subclass to support updating a REST object.
        Overrides:
        put in class DSpaceRestRepository<MetadataSchemaRest,​Integer>
        Parameters:
        context - the dspace context
        apiCategory - the API category e.g. "api"
        model - the DSpace model e.g. "metadatafield"
        id - the ID of the target REST object
        jsonNode - the part of the request body representing the updated rest object
        Returns:
        the updated REST object
        Throws:
        SQLException - when the database returns an error
        org.dspace.authorize.AuthorizeException - if the context user is not authorized to perform this operation