MetadataSchema schema = new MetadataSchema(); schema.setNamespace(namespace); schema.setName(name);
MetadataSchema schema = new MetadataSchema(); schema.setNamespace(request.getParameter("namespace")); schema.setName(request.getParameter("short_name"));
@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; }