Package org.dspace.app.rest.utils
Class AuthorityUtils
java.lang.Object
org.dspace.app.rest.utils.AuthorityUtils
Utility methods to expose the authority framework over REST
- Author:
- Andrea Bollini (andrea.bollini at 4science.it)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertAuthority(ChoiceAuthority source, String authorityName, Projection projection) TODO the authorityName MUST be a part of ChoiceAuthority modelconvertEntry(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 modelconvertEntryDetails(Choice choice, String authorityName, boolean isHierarchical, Projection projection) TODO the authorityName MUST be a part of Choice modelgetAuthorityName(String schema, String element, String qualifier) getPresentation(String schema, String element, String qualifier) booleanboolean
-
Field Details
-
PRESENTATION_TYPE_LOOKUP
- See Also:
-
PRESENTATION_TYPE_AUTHORLOOKUP
- See Also:
-
PRESENTATION_TYPE_SUGGEST
- See Also:
-
RESERVED_KEYMAP_PARENT
- See Also:
-
-
Constructor Details
-
AuthorityUtils
public AuthorityUtils()
-
-
Method Details
-
isChoice
-
getAuthorityName
-
isClosed
-
getPresentation
-
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, ornull.- 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 entryauthorityName- the name of the vocabularystoreAuthority-trueif the entry id should be exposed as an authority for storing it in the metadatavalueprojection- 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:
-