Class MetadataFieldRestRepository

    • Constructor Detail

      • MetadataFieldRestRepository

        public MetadataFieldRestRepository()
    • Method Detail

      • findAll

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

        public org.springframework.data.domain.Page<MetadataFieldRest> findBySchema​(String schemaName,
                                                                                    org.springframework.data.domain.Pageable pageable)
      • findByFieldName

        public org.springframework.data.domain.Page<MetadataFieldRest> findByFieldName​(String schemaName,
                                                                                       String elementName,
                                                                                       String qualifierName,
                                                                                       String query,
                                                                                       String exactName,
                                                                                       org.springframework.data.domain.Pageable pageable)
                                                                                throws SQLException
        Endpoint for the search in the MetadataField objects by various different params representing the field name. Query being a partial
        Parameters:
        schemaName - an exact match of the prefix of the metadata schema (e.g. "dc", "dcterms", "eperson")
        elementName - an exact match of the field's element (e.g. "contributor", "title")
        qualifierName - an exact match of the field's qualifier (e.g. "author", "alternative")
        query - part of the fully qualified field, should start with the start of the schema, element or qualifier (e.g. "dc.ti", "contributor", "auth", "contributor.ot")
        exactName - exactName, The exact fully qualified field, should use the syntax schema.element .qualifier or schema.element if no qualifier exists (e.g. "dc.title", "dc.contributor .author"). It will only return one value if there's an exact match
        pageable - the pagination options
        Returns:
        List of MetadataFieldRest objects representing all MetadataField objects that match the given params
        Throws:
        SQLException
      • put

        @PreAuthorize("hasAuthority(\'ADMIN\')")
        protected MetadataFieldRest put​(Context context,
                                        javax.servlet.http.HttpServletRequest request,
                                        String apiCategory,
                                        String model,
                                        Integer id,
                                        com.fasterxml.jackson.databind.JsonNode jsonNode)
                                 throws SQLException,
                                        AuthorizeException
        Description copied from class: DSpaceRestRepository
        Implement this method in the subclass to support updating a REST object.
        Overrides:
        put in class DSpaceRestRepository<MetadataFieldRest,​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
        AuthorizeException - if the context user is not authorized to perform this operation