Class RelationshipRestRepository

    • Constructor Detail

      • RelationshipRestRepository

        public RelationshipRestRepository()
    • Method Detail

      • findAll

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

        public RelationshipRest put​(org.dspace.core.Context context,
                                    String contextPath,
                                    Integer id,
                                    List<String> stringList,
                                    Boolean itemToReplaceIsRight)
                             throws SQLException
        Method to replace either the right or left item of a relationship with a given new item Called by request mappings in RelationshipRestController - For replace right item (itemToReplaceIsRight = true) => Newly proposed changed relationship: left = old-left; right = new-item - For replace left item (itemToReplaceIsRight = false) => Newly proposed changed relationship: left = new-item; right = old-right
        Parameters:
        context -
        contextPath - What API call was made to get here
        id - ID of the relationship we wish to modify
        stringList - Item to replace either right or left item of relationship with
        itemToReplaceIsRight - Boolean to decide whether to replace right item (true) or left item (false)
        Returns:
        The (modified) relationship
        Throws:
        SQLException
      • delete

        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<RelationshipRest,​Integer>
        Parameters:
        context - the dspace context
        id - the id of the rest object to delete
        Throws:
        org.dspace.authorize.AuthorizeException
      • findByLabel

        public org.springframework.data.domain.Page<RelationshipRest> findByLabel​(String label,
                                                                                  UUID dsoId,
                                                                                  org.springframework.data.domain.Pageable pageable)
                                                                           throws SQLException
        This method will find all the Relationship objects that a RelationshipType that corresponds to the given Label It's also possible to pass a DSO along to this method with a parameter which will only return Relationship objects that have this DSO as leftItem or rightItem. This endpoint is paginated
        Parameters:
        label - The label of a RelationshipType which the Relationships must have if they're to be returned
        dsoId - The dsoId of the object that has to be a leftItem or rightItem if this parameter is present
        pageable - The page object
        Returns:
        A page with all the RelationshipRest objects that correspond to the constraints
        Throws:
        SQLException - If something goes wrong