try { mdSchema = metadataSchemaService.create(context, schema, String.valueOf(new Date().getTime())); mdSchema.setNamespace("unknown" + mdSchema.getID()); metadataSchemaService.update(context, mdSchema); } catch (NonUniqueMetadataException e) {
s.setNamespace(namespace); metadataSchemaService.update(context, s); } else {
schema.setNamespace(namespace); schema.setName(name); schema.create(context);
schema.setNamespace(request.getParameter("namespace")); schema.setName(request.getParameter("short_name")); schema.create(context); schema.setNamespace(request.getParameter("namespace")); schema.setName(request.getParameter("short_name")); schema.update(context);
@Override public MetadataSchema create(Context context, String name, String namespace) throws SQLException, AuthorizeException, NonUniqueMetadataException { // Check authorisation: Only admins may create metadata schemas if (!authorizeService.isAdmin(context)) { throw new AuthorizeException( "Only administrators may modify the metadata registry"); } // Ensure the schema name is unique if (!uniqueShortName(context, -1, name)) { throw new NonUniqueMetadataException("Please make the name " + name + " unique"); } // Ensure the schema namespace is unique if (!uniqueNamespace(context, -1, namespace)) { throw new NonUniqueMetadataException("Please make the namespace " + namespace + " unique"); } // Create a table row and update it with the values MetadataSchema metadataSchema = metadataSchemaDAO.create(context, new MetadataSchema()); metadataSchema.setNamespace(namespace); metadataSchema.setName(name); metadataSchemaDAO.save(context, metadataSchema); log.info(LogManager.getHeader(context, "create_metadata_schema", "metadata_schema_id=" + metadataSchema.getID())); return metadataSchema; }