Class EntityServiceImpl

    • Field Detail

      • entityTypeService

        @Autowired(required=true)
        protected EntityTypeService entityTypeService
      • relationshipService

        @Autowired(required=true)
        protected RelationshipService relationshipService
      • itemService

        @Autowired(required=true)
        protected ItemService itemService
    • Constructor Detail

      • EntityServiceImpl

        public EntityServiceImpl()
    • Method Detail

      • findByItemId

        public Entity findByItemId​(Context context,
                                   UUID itemId)
                            throws SQLException
        Description copied from interface: EntityService
        This will construct an Entity object that will be returned with the Item that matches the ItemID that was passed along as well as a list of relationships for that Item.
        Specified by:
        findByItemId in interface EntityService
        Parameters:
        context - The relevant DSpace context
        itemId - The ItemID for the Item that is to be used in the Entity object
        Returns:
        The constructed Entity object with the Item and the list of relationships
        Throws:
        SQLException - If something goes wrong
      • findByItemId

        public Entity findByItemId​(Context context,
                                   UUID itemId,
                                   Integer limit,
                                   Integer offset)
                            throws SQLException
        Description copied from interface: EntityService
        This will construct an Entity object that will be returned with the Item that matches the ItemID that was passed along as well as a list of relationships for that Item.
        Specified by:
        findByItemId in interface EntityService
        Parameters:
        context - The relevant DSpace context
        itemId - The ItemID for the Item that is to be used in the Entity object
        limit - paging limit
        offset - paging offset
        Returns:
        The constructed Entity object with the Item and the list of relationships
        Throws:
        SQLException - If something goes wrong
      • getType

        public EntityType getType​(Context context,
                                  Entity entity)
                           throws SQLException
        Description copied from interface: EntityService
        Returns the EntityType for the Item that is attached to the Entity that is passed along to this method. The EntityType String logic is in the Metadata for that Item and will be searched on in the EntityTypeService to retrieve the actual EntityType object
        Specified by:
        getType in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity object which contains the Item
        Returns:
        The EntityType that belongs to this Item
        Throws:
        SQLException - If something goes wrong
      • getLeftRelations

        public List<Relationship> getLeftRelations​(Context context,
                                                   Entity entity)
        Description copied from interface: EntityService
        Retrieves the list of relationships, which are attached to the Entity object that is passed along, where the left item object of each relationship is equal to the Item object of the Entity object that is passed along
        Specified by:
        getLeftRelations in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity object to be returned
        Returns:
        The list of relationships that have the Item in the Entity object as their left item
      • getRightRelations

        public List<Relationship> getRightRelations​(Context context,
                                                    Entity entity)
        Description copied from interface: EntityService
        Retrieves the list of relationships, which are attached to the Entity object that is passed along, where the right item object of each relationship is equal to the Item object of the Entity object that is passed along
        Specified by:
        getRightRelations in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity object to be returned
        Returns:
        The list of relationships that have the Item in the Entity object as their right item
      • getRelationsByTypeName

        public List<Relationship> getRelationsByTypeName​(Context context,
                                                         String typeName)
                                                  throws SQLException
        Description copied from interface: EntityService
        Retrieves the list of relationships for which their relationshiptype has a left or right label that is equal to the passed along label String
        Specified by:
        getRelationsByTypeName in interface EntityService
        Parameters:
        context - The relevant DSpace context
        typeName - The label that needs to be in the relationshiptype of the relationship
        Returns:
        The list of relationships that have a relationshiptype with a left or right label that is equal to the label param
        Throws:
        SQLException - If something goes wrong
      • getRelationsByTypeName

        public List<Relationship> getRelationsByTypeName​(Context context,
                                                         String typeName,
                                                         Integer limit,
                                                         Integer offset)
                                                  throws SQLException
        Description copied from interface: EntityService
        Retrieves the list of relationships for which their relationshiptype has a left or right label that is equal to the passed along label String
        Specified by:
        getRelationsByTypeName in interface EntityService
        Parameters:
        context - The relevant DSpace context
        typeName - The label that needs to be in the relationshiptype of the relationship
        limit - paging limit
        offset - paging offset
        Returns:
        The list of relationships that have a relationshiptype with a left or right label that is equal to the label param
        Throws:
        SQLException - If something goes wrong
      • getAllRelationshipTypes

        public List<RelationshipType> getAllRelationshipTypes​(Context context,
                                                              Entity entity)
                                                       throws SQLException
        Description copied from interface: EntityService
        Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in either the leftEntityType or the rightEntityType variables
        Specified by:
        getAllRelationshipTypes in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity for which the EntityType should be checked for relationships
        Returns:
        The list of relationships that each contain a relationshiptype in which there is a right or left entity type that is equal to the entity type for the given entity
        Throws:
        SQLException - If something goes wrong
      • getAllRelationshipTypes

        public List<RelationshipType> getAllRelationshipTypes​(Context context,
                                                              Entity entity,
                                                              Integer limit,
                                                              Integer offset)
                                                       throws SQLException
        Description copied from interface: EntityService
        Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in either the leftEntityType or the rightEntityType variables
        Specified by:
        getAllRelationshipTypes in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity for which the EntityType should be checked for relationships
        limit - paging limit
        offset - paging offset
        Returns:
        The list of relationships that each contain a relationshiptype in which there is a right or left entity type that is equal to the entity type for the given entity
        Throws:
        SQLException - If something goes wrong
      • getLeftRelationshipTypes

        public List<RelationshipType> getLeftRelationshipTypes​(Context context,
                                                               Entity entity)
                                                        throws SQLException
        Description copied from interface: EntityService
        Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the leftEntityType
        Specified by:
        getLeftRelationshipTypes in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity for which the EntityType should be checked for relationships
        Returns:
        The list of relationships that each contain a relationshiptype in which there is a left entity type that is equal to the entity type for the given entity
        Throws:
        SQLException - If something goes wrong
      • getLeftRelationshipTypes

        public List<RelationshipType> getLeftRelationshipTypes​(Context context,
                                                               Entity entity,
                                                               boolean isLeft,
                                                               Integer limit,
                                                               Integer offset)
                                                        throws SQLException
        Description copied from interface: EntityService
        Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the leftEntityType
        Specified by:
        getLeftRelationshipTypes in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity for which the EntityType should be checked for relationships
        isLeft - Boolean value used to filter by left_type or right_type. If true left_type results only else right_type results.
        limit - paging limit
        offset - paging offset
        Returns:
        The list of relationships that each contain a relationshiptype in which there is a left entity type that is equal to the entity type for the given entity
        Throws:
        SQLException - If something goes wrong
      • getRightRelationshipTypes

        public List<RelationshipType> getRightRelationshipTypes​(Context context,
                                                                Entity entity)
                                                         throws SQLException
        Description copied from interface: EntityService
        Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the rightEntityType
        Specified by:
        getRightRelationshipTypes in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity for which the EntityType should be checked for relationships
        Returns:
        The list of relationships that each contain a relationshiptype in which there is a right entity type that is equal to the entity type for the given entity
        Throws:
        SQLException - If something goes wrong
      • getRightRelationshipTypes

        public List<RelationshipType> getRightRelationshipTypes​(Context context,
                                                                Entity entity,
                                                                boolean isLeft,
                                                                Integer limit,
                                                                Integer offset)
                                                         throws SQLException
        Description copied from interface: EntityService
        Retrieves the list of relationships that have a relationshiptype that contains the EntityType for the given Entity in the rightEntityType
        Specified by:
        getRightRelationshipTypes in interface EntityService
        Parameters:
        context - The relevant DSpace context
        entity - The Entity for which the EntityType should be checked for relationships
        isLeft - Boolean value used to filter by left_type or right_type. If true left_type results only else right_type results.
        limit - paging limit
        offset - paging offset
        Returns:
        The list of relationships that each contain a relationshiptype in which there is a right entity type that is equal to the entity type for the given entity
        Throws:
        SQLException - If something goes wrong
      • getRelationshipTypesByTypeName

        public List<RelationshipType> getRelationshipTypesByTypeName​(Context context,
                                                                     String type)
                                                              throws SQLException
        Description copied from interface: EntityService
        Retrieves a list of RelationshipType objects for which either their left or right label is equal to the label parameter that's being passed along
        Specified by:
        getRelationshipTypesByTypeName in interface EntityService
        Parameters:
        context - The relevant DSpace context
        type - The typeName for which the relationshiptype's labels must be checked
        Returns:
        The list of relationshiptypes that each contain a left or right label that is equal to the given label parameter
        Throws:
        SQLException - If something goes wrong
      • getRelationshipTypesByTypeName

        public List<RelationshipType> getRelationshipTypesByTypeName​(Context context,
                                                                     String typeName,
                                                                     Integer limit,
                                                                     Integer offset)
                                                              throws SQLException
        Description copied from interface: EntityService
        Retrieves a list of RelationshipType objects for which either their left or right label is equal to the label parameter that's being passed along
        Specified by:
        getRelationshipTypesByTypeName in interface EntityService
        Parameters:
        context - The relevant DSpace context
        typeName - The label for which the relationshiptype's labels must be checked
        limit - paging limit
        offset - paging offset
        Returns:
        The list of relationshiptypes that each contain a left or right label that is equal to the given label parameter
        Throws:
        SQLException - If something goes wrong