Package org.dspace.app.rest.utils
Class AuthorityUtils
- java.lang.Object
-
- org.dspace.app.rest.utils.AuthorityUtils
-
@Component public class AuthorityUtils extends Object
Utility methods to expose the authority framework over REST- Author:
- Andrea Bollini (andrea.bollini at 4science.it)
-
-
Field Summary
Fields Modifier and Type Field Description static StringPRESENTATION_TYPE_AUTHORLOOKUPstatic StringPRESENTATION_TYPE_LOOKUPstatic StringPRESENTATION_TYPE_SUGGESTstatic StringRESERVED_KEYMAP_PARENT
-
Constructor Summary
Constructors Constructor Description AuthorityUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VocabularyRestconvertAuthority(org.dspace.content.authority.ChoiceAuthority source, String authorityName, Projection projection)TODO the authorityName MUST be a part of ChoiceAuthority modelVocabularyEntryRestconvertEntry(org.dspace.content.authority.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 modelVocabularyEntryDetailsRestconvertEntryDetails(org.dspace.content.authority.Choice choice, String authorityName, boolean isHierarchical, Projection projection)TODO the authorityName MUST be a part of Choice modelStringgetAuthorityName(String schema, String element, String qualifier)StringgetPresentation(String schema, String element, String qualifier)booleanisChoice(String schema, String element, String qualifier)booleanisClosed(String schema, String element, String qualifier)
-
-
-
Field Detail
-
PRESENTATION_TYPE_LOOKUP
public static final String PRESENTATION_TYPE_LOOKUP
- See Also:
- Constant Field Values
-
PRESENTATION_TYPE_AUTHORLOOKUP
public static final String PRESENTATION_TYPE_AUTHORLOOKUP
- See Also:
- Constant Field Values
-
PRESENTATION_TYPE_SUGGEST
public static final String PRESENTATION_TYPE_SUGGEST
- See Also:
- Constant Field Values
-
RESERVED_KEYMAP_PARENT
public static final String RESERVED_KEYMAP_PARENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
convertEntryDetails
public VocabularyEntryDetailsRest convertEntryDetails(org.dspace.content.authority.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(org.dspace.content.authority.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(org.dspace.content.authority.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:
-
-