Class AuthorityUtils


  • @Component
    public class AuthorityUtils
    extends Object
    Utility methods to expose the authority framework over REST
    Author:
    Andrea Bollini (andrea.bollini at 4science.it)
    • Constructor Detail

      • AuthorityUtils

        public AuthorityUtils()
    • Method Detail

      • isChoice

        public boolean isChoice​(String schema,
                                String element,
                                String qualifier)
      • isClosed

        public boolean isClosed​(String schema,
                                String element,
                                String qualifier)
      • convertEntryDetails

        public VocabularyEntryDetailsRest convertEntryDetails​(Choice choice,
                                                              String authorityName,
                                                              boolean isHierarchical,
                                                              Projection projection)
        TODO the authorityName MUST be a part of Choice model
        Parameters:
        choice -
        authorityName -
        projection - the name of the projection to use, or null.
        Returns:
      • convertEntry

        public VocabularyEntryRest convertEntry​(Choice choice,
                                                String authorityName,
                                                boolean storeAuthority,
                                                Projection projection)
        This utility method is currently a workaround to enrich the REST object with information from the parent vocabulary that is not referenced by the Choice model
        Parameters:
        choice - the dspace-api choice to expose as vocabulary entry
        authorityName - the name of the vocabulary
        storeAuthority - true if the entry id should be exposed as an authority for storing it in the metadatavalue
        projection - the rest projection to apply
        Returns:
        the vocabulary entry rest reppresentation of the provided choice
      • convertAuthority

        public VocabularyRest convertAuthority​(ChoiceAuthority source,
                                               String authorityName,
                                               Projection projection)
        TODO the authorityName MUST be a part of ChoiceAuthority model
        Parameters:
        source -
        authorityName -
        projection - the projecton to use.
        Returns: