Package org.dspace.app.rest.converter
Class MetadataConverter
- java.lang.Object
-
- org.dspace.app.rest.converter.MetadataConverter
-
- All Implemented Interfaces:
DSpaceConverter<MetadataValueList,MetadataRest>
@Component public class MetadataConverter extends Object implements DSpaceConverter<MetadataValueList,MetadataRest>
Converter to translate between lists of domainMetadataValues andMetadataRestrepresentations.
-
-
Constructor Summary
Constructors Constructor Description MetadataConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends org.dspace.content.DSpaceObject>
voidaddMetadata(org.dspace.core.Context context, T dso, MetadataRest metadataRest)Add to a DSpace object's domain metadata values from a rest representation.MetadataRestconvert(MetadataValueList metadataValues, Projection projection)Class<MetadataValueList>getModelClass()<T extends org.dspace.content.DSpaceObject>
voidmergeMetadata(org.dspace.core.Context context, T dso, MetadataRest metadataRest)Merge into a DSpace object's domain metadata values from a rest representation.<T extends org.dspace.content.DSpaceObject>
voidsetMetadata(org.dspace.core.Context context, T dso, MetadataRest metadataRest)Sets a DSpace object's domain metadata values from a rest representation.
-
-
-
Method Detail
-
convert
public MetadataRest convert(MetadataValueList metadataValues, Projection projection)
- Specified by:
convertin interfaceDSpaceConverter<MetadataValueList,MetadataRest>
-
getModelClass
public Class<MetadataValueList> getModelClass()
- Specified by:
getModelClassin interfaceDSpaceConverter<MetadataValueList,MetadataRest>
-
setMetadata
public <T extends org.dspace.content.DSpaceObject> void setMetadata(org.dspace.core.Context context, T dso, MetadataRest metadataRest) throws SQLException, org.dspace.authorize.AuthorizeExceptionSets a DSpace object's domain metadata values from a rest representation. Any existing metadata value is deleted or overwritten.- Parameters:
context- the context to use.dso- the DSpace object.metadataRest- the rest representation of the new metadata.- Throws:
SQLException- if a database error occurs.org.dspace.authorize.AuthorizeException- if an authorization error occurs.
-
addMetadata
public <T extends org.dspace.content.DSpaceObject> void addMetadata(org.dspace.core.Context context, T dso, MetadataRest metadataRest) throws SQLException, org.dspace.authorize.AuthorizeExceptionAdd to a DSpace object's domain metadata values from a rest representation. Any existing metadata value is preserved.- Parameters:
context- the context to use.dso- the DSpace object.metadataRest- the rest representation of the new metadata.- Throws:
SQLException- if a database error occurs.org.dspace.authorize.AuthorizeException- if an authorization error occurs.
-
mergeMetadata
public <T extends org.dspace.content.DSpaceObject> void mergeMetadata(org.dspace.core.Context context, T dso, MetadataRest metadataRest) throws SQLException, org.dspace.authorize.AuthorizeExceptionMerge into a DSpace object's domain metadata values from a rest representation. Any existing metadata value is preserved or overwritten with the new ones- Parameters:
context- the context to use.dso- the DSpace object.metadataRest- the rest representation of the new metadata.- Throws:
SQLException- if a database error occurs.org.dspace.authorize.AuthorizeException- if an authorization error occurs.
-
-