Refactored the usages of MetadataSchema.DC to use the enum instead

This commit is contained in:
Raf Ponsaerts
2018-11-21 09:35:11 +01:00
parent b8d6fa2fba
commit b905f69d63
51 changed files with 229 additions and 185 deletions

View File

@@ -122,7 +122,8 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
*/
@Override
public String getName() {
return getBitstreamService().getMetadataFirstValue(this, MetadataSchema.DC_SCHEMA, "title", null, Item.ANY);
return getBitstreamService().getMetadataFirstValue(this, MetadataSchemaEnum.DC.getName(),
"title", null, Item.ANY);
}
/**
@@ -133,7 +134,8 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* @throws SQLException if database error
*/
public void setName(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "title", null, null, n);
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchemaEnum.DC.getName(),
"title", null, null, n);
}
/**
@@ -144,7 +146,8 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* @return the source of the bitstream
*/
public String getSource() {
return getBitstreamService().getMetadataFirstValue(this, MetadataSchema.DC_SCHEMA, "source", null, Item.ANY);
return getBitstreamService().getMetadataFirstValue(this, MetadataSchemaEnum.DC.getName(),
"source", null, Item.ANY);
}
/**
@@ -155,7 +158,8 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* @throws SQLException if database error
*/
public void setSource(Context context, String n) throws SQLException {
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "source", null, null, n);
getBitstreamService().setMetadataSingleValue(context, this, MetadataSchemaEnum.DC.getName(),
"source", null, null, n);
}
/**
@@ -166,7 +170,8 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
*/
public String getDescription() {
return getBitstreamService()
.getMetadataFirstValue(this, MetadataSchema.DC_SCHEMA, "description", null, Item.ANY);
.getMetadataFirstValue(this, MetadataSchemaEnum.DC.getName(), "description",
null, Item.ANY);
}
/**
@@ -178,7 +183,7 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
*/
public void setDescription(Context context, String n) throws SQLException {
getBitstreamService()
.setMetadataSingleValue(context, this, MetadataSchema.DC_SCHEMA, "description", null, null, n);
.setMetadataSingleValue(context, this, MetadataSchemaEnum.DC.getName(), "description", null, null, n);
}
/**
@@ -227,7 +232,8 @@ public class Bitstream extends DSpaceObject implements DSpaceObjectLegacySupport
* @return the user's format description.
*/
public String getUserFormatDescription() {
return getBitstreamService().getMetadataFirstValue(this, MetadataSchema.DC_SCHEMA, "format", null, Item.ANY);
return getBitstreamService().getMetadataFirstValue(this, MetadataSchemaEnum.DC.getName(),
"format", null, Item.ANY);
}
protected BitstreamFormat getBitstreamFormat() {