private void setup(org.dspace.content.MetadataSchema schema, String expand, Context context) throws SQLException { List<String> expandFields = new ArrayList<String>(); if (expand != null) { expandFields = Arrays.asList(expand.split(",")); } this.setSchemaID(schema.getID()); this.setPrefix(schema.getName()); this.setNamespace(schema.getNamespace()); if (expandFields.contains("fields") || expandFields.contains("all")) { List<org.dspace.content.MetadataField> fields = metadataFieldService.findAllInSchema(context, schema); this.addExpand("fields"); for (org.dspace.content.MetadataField field : fields) { this.fields.add(new MetadataField(schema, field, "", context)); } } }
if (schema.getNamespace().startsWith( SubmissionLookupService.SL_NAMESPACE_PREFIX)) { List<MetadataValue> slCache = itemService.getMetadata(item, schema.getName(),
String namespace = mdSchema.getNamespace();
@Override public void update(Context context, MetadataSchema metadataSchema) throws SQLException, AuthorizeException, NonUniqueMetadataException { // Check authorisation: Only admins may update the metadata registry if (!authorizeService.isAdmin(context)) { throw new AuthorizeException( "Only administrators may modify the metadata registry"); } // Ensure the schema name is unique if (!uniqueShortName(context, metadataSchema.getID(), metadataSchema.getName())) { throw new NonUniqueMetadataException("Please make the name " + metadataSchema.getName() + " unique"); } // Ensure the schema namespace is unique if (!uniqueNamespace(context, metadataSchema.getID(), metadataSchema.getNamespace())) { throw new NonUniqueMetadataException("Please make the namespace " + metadataSchema.getNamespace() + " unique"); } metadataSchemaDAO.save(context, metadataSchema); log.info(LogManager.getHeader(context, "update_metadata_schema", "metadata_schema_id=" + metadataSchema.getID() + "namespace=" + metadataSchema.getNamespace() + "name=" + metadataSchema.getName())); }
} else { if (s.getNamespace().equals(namespace)) {
for (MetadataSchema schema : schemas) toSchema.addOption(schema.getSchemaID(), schema.getNamespace());
row.addCell().addContent(schema.getNamespace()); row.addCell().addContent(schema.getName());
String namespace = schema.getNamespace(); String name = schema.getName(); String url = contextPath
MetadataField[] fields = MetadataField.findAllInSchema(context, schemaID); String schemaName = schema.getName(); String schemaNamespace = schema.getNamespace();