Package org.dspace.content

Examples of org.dspace.content.MetadataSchema.create()


       
        if (s == null)
        {
            // Schema does not exist - create
            MetadataSchema schema = new MetadataSchema(namespace, name);
            schema.create(context);
            System.out.println("created");
        }
        else
        {
            // Schema exists - if it's the same namespace, allow the type imports to continue
View Full Code Here


        if (mdSchema == null && !clearList.contains(value.schema)) {
          // add a new schema, giving it a namespace of "unknown". Possibly a very bad idea.
          if (schemaChoice.equals("add")) {
            mdSchema = new MetadataSchema(value.schema,String.valueOf(new Date().getTime()));
            try {
            mdSchema.create(ourContext);
            mdSchema.setName(value.schema);
            mdSchema.setNamespace("unknown"+mdSchema.getSchemaID());
              mdSchema.update(ourContext);
          } catch (NonUniqueMetadataException e) {
            // This case should not be possible
View Full Code Here

                {
                    // Create a new metadata schema
                    MetadataSchema schema = new MetadataSchema();
                    schema.setNamespace(request.getParameter("namespace"));
                    schema.setName(request.getParameter("short_name"));
                    schema.create(context);
                    showSchemas(context, request, response);
                    context.complete();
                }
                else
                {
View Full Code Here

    if (result.getErrors() == null)
    {
      MetadataSchema schema = new MetadataSchema();
        schema.setNamespace(namespace);
        schema.setName(name);
        schema.create(context);

        context.commit();
       
        result.setContinue(true);
        result.setOutcome(true);
View Full Code Here

        if (mdSchema == null && !clearList.contains(value.schema)) {
          // add a new schema, giving it a namespace of "unknown". Possibly a very bad idea.
          if (schemaChoice.equals("add")) {
            mdSchema = new MetadataSchema(value.schema,String.valueOf(new Date().getTime()));
            try {
            mdSchema.create(ourContext);
            mdSchema.setName(value.schema);
            mdSchema.setNamespace("unknown"+mdSchema.getSchemaID());
              mdSchema.update(ourContext);
          } catch (NonUniqueMetadataException e) {
            // This case should not be possible
View Full Code Here

        if (s == null)
        {
            // Schema does not exist - create
            log.info("Registering Schema " + name + " (" + namespace + ")");
            MetadataSchema schema = new MetadataSchema(namespace, name);
            schema.create(context);
        }
        else
        {
            // Schema exists - if it's the same namespace, allow the type imports to continue
            if (s.getNamespace().equals(namespace))
View Full Code Here

                {
                    // Create a new metadata schema
                    MetadataSchema schema = new MetadataSchema();
                    schema.setNamespace(request.getParameter("namespace"));
                    schema.setName(request.getParameter("short_name"));
                    schema.create(context);
                    showSchemas(context, request, response);
                    context.complete();
                }
                else
                {
View Full Code Here

            if (mdschema == null)
            {
                mdschema = new MetadataSchema(
                        SubmissionLookupService.SL_NAMESPACE_PREFIX + schema,
                        schema);
                mdschema.create(context);
                create = true;
            }
            else
            {
                mdfield = MetadataField.findByElement(context,
View Full Code Here

    if (result.getErrors() == null)
    {
      MetadataSchema schema = new MetadataSchema();
        schema.setNamespace(namespace);
        schema.setName(name);
        schema.create(context);

        context.commit();
       
        result.setContinue(true);
        result.setOutcome(true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.