/** * Add the current date to the item metadata. This looks up * the field in which to store this metadata in the configuration * sword.updated.field * * @param item * @throws DSpaceSWORDException */ private void setUpdatedDate(Item item) throws DSpaceSWORDException { String field = ConfigurationManager.getProperty("sword-server", "updated.field"); if (field == null || "".equals(field)) { throw new DSpaceSWORDException("No configuration, or configuration is invalid for: sword.updated.field"); } DCValue dc = this.configToDC(field, null); item.clearMetadata(dc.schema, dc.element, dc.qualifier, Item.ANY); DCDate date = new DCDate(new Date()); item.addMetadata(dc.schema, dc.element, dc.qualifier, null, date.toString()); swordService.message("Updated date added to response from item metadata where available"); }
item.addMetadata(dc.schema, dc.element, dc.qualifier, null, slugVal);
item.addMetadata(schema, element, qualifier, language, value, authority, confidence); MetadataSchema schema = MetadataSchema.find(context, field .getSchemaID()); item.addMetadata(schema.getName(), field.getElement(), field .getQualifier(), lang, value);
item.addMetadata(schema.getName(),field.getElement(), field.getQualifier(), lang, value);
item.addMetadata(parts[0], parts[1], parts[2], lang, value, authority, iconf);
MetadataSchema schema = MetadataSchema.find(context,field.getSchemaID()); item.addMetadata(schema.getName(), field.getElement(), field.getQualifier(), language, value);