Examples of MetadataSchema


Examples of com.linkedin.restli.restspec.MetadataSchema

      for(ParameterSchema parameterSchema : parameters)
      {
        findModelsParameter(parameterSchema, foundTypes, typeOrder);
      }
    }
    MetadataSchema metadata = finderSchema.getMetadata();
    if (metadata != null)
    {
      String type = metadata.getType();
      recordType(type, foundTypes, typeOrder);
    }
  }
View Full Code Here

Examples of org.dspace.content.MetadataSchema

        }

        System.out.print("Registering Schema: " + name + " - " + namespace + " ... ");
       
        // check to see if the schema already exists
        MetadataSchema s = MetadataSchema.find(context, name);
       
        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

Examples of org.dspace.content.MetadataSchema

        }

        System.out.print("Registering Metadata: " + schema + "." + element + "." + qualifier + " ... ");
       
        // Find the matching schema object
        MetadataSchema schemaObj = MetadataSchema.find(context, schema);
       
        if (schemaObj == null)
        {
            throw new RegistryImportException("Schema '" + schema + "' is not registered");
        }
       
        MetadataField mf = MetadataField.findByElement(context, schemaObj.getSchemaID(), element, qualifier);
        if (mf != null)
        {
            System.out.println("already exists, skipping");
            return;
        }
       
        MetadataField field = new MetadataField();
        field.setSchemaID(schemaObj.getSchemaID());
        field.setElement(element);
        field.setQualifier(qualifier);
        field.setScopeNote(scopeNote);
        field.create(context);
        System.out.println("created");
View Full Code Here

Examples of org.dspace.content.MetadataSchema

            i.addMetadata(schema, element, qualifier, language, value);
        }
        else
        {
            // If we're just test the import, let's check that the actual metadata field exists.
          MetadataSchema foundSchema = MetadataSchema.find(c,schema);
         
          if (foundSchema == null)
          {
            System.out.println("ERROR: schema '"+schema+"' was not found in the registry.");
            return;
          }
         
          int schemaID = foundSchema.getSchemaID();
          MetadataField foundField = MetadataField.findByElement(c, schemaID, element, qualifier);
         
          if (foundField == null)
          {
            System.out.println("ERROR: Metadata field: '"+schema+"."+element+"."+qualifier+"' was not found in the registry.");
View Full Code Here

Examples of org.dspace.content.MetadataSchema

            String lang = request.getParameter("lang_" + i);

            if ((dcTypeID != -1) && (value != null) && !value.equals(""))
            {
                MetadataField field = MetadataField.find(context,dcTypeID);
                MetadataSchema schema = MetadataSchema.find(context,field.getSchemaID());
                item.addMetadata(schema.getName(),field.getElement(), field.getQualifier(), lang, value);
            }
        }

        item.update();
View Full Code Here

Examples of org.fao.geonet.kernel.schema.MetadataSchema

    String xmlData = metadata.getData();
    Element metadataXml = Xml.loadString(xmlData, false);

    if (!isIndexingTask) {
            ServiceContext context = ServiceContext.get();
            MetadataSchema mds = _dataManager.getSchema(metadata.getDataInfo().getSchemaId());

            // Check if a filter is defined for this schema
            // for the editing operation ie. user who can not edit
            // will not see those elements.
            Pair<String, Element> editXpathFilter = mds.getOperationFilter(ReservedOperation.editing);
            boolean filterEditOperationElements = editXpathFilter != null;
            List<Namespace> namespaces = mds.getNamespaces();
            if(context != null) {
                GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
                AccessManager am = gc.getBean(AccessManager.class);
                if (editXpathFilter != null) {
                    boolean canEdit = am.canEdit(context, id);
                    if(canEdit) {
                        filterEditOperationElements = false;
                    }
                }
                Pair<String, Element> downloadXpathFilter = mds.getOperationFilter(ReservedOperation.download);
                if (downloadXpathFilter != null) {
                    boolean canDownload = am.canDownload(context, id);
                    if(!canDownload) {
                        removeFilteredElement(metadataXml, downloadXpathFilter, namespaces);
                    }
                }
                Pair<String, Element> dynamicXpathFilter = mds.getOperationFilter(ReservedOperation.dynamic);
                if (dynamicXpathFilter != null) {
                    boolean canDynamic = am.canDynamic(context, id);
                    if(!canDynamic) {
                      removeFilteredElement(metadataXml, dynamicXpathFilter, namespaces);
                    }
View Full Code Here

Examples of org.fao.geonet.kernel.schema.MetadataSchema

      Schema schema = hmSchemas.get(name);

      if (schema == null)
        throw new IllegalArgumentException("Schema not registered : " + name);

      final MetadataSchema mds = schema.getMetadataSchema();
      return mds;
    } finally {
      afterRead();
    }
  }
View Full Code Here

Examples of org.fao.geonet.kernel.schema.MetadataSchema

      Schema schema = hmSchemas.get(name);

      if (schema == null)
        throw new IllegalArgumentException("Schema not registered : " + name);

      MetadataSchema mds = schema.getMetadataSchema();
      return mds.getNS(prefix);
    } finally {
      afterRead();
    }
  }
View Full Code Here

Examples of org.fao.geonet.kernel.schema.MetadataSchema

      Schema schema = hmSchemas.get(name);

      if (schema == null)
        throw new IllegalArgumentException("Schema not registered : " + name);

      MetadataSchema mds = schema.getMetadataSchema();
      StringBuilder sb = new StringBuilder();
      for (Namespace ns : mds.getSchemaNS()) {
        if (ns.getPrefix().length() != 0 && ns.getURI().length() != 0) {
          sb.append("xmlns:"+ns.getPrefix()+"=\""+ns.getURI()+"\" ");
        }
      }
      return sb.toString().trim();
View Full Code Here

Examples of org.fao.geonet.kernel.schema.MetadataSchema

   */
  private String checkNamespace(Element md, String schema) {
    String result = null;

    try {
      MetadataSchema mds = getSchema(schema);
      if (mds != null) {
        String primeNs = mds.getPrimeNS();
                if(Log.isDebugEnabled(Geonet.SCHEMA_MANAGER))
                    Log.debug(Geonet.SCHEMA_MANAGER,"  primeNs "+primeNs+" for schema "+schema);
        if (md.getNamespace().getURI().equals(primeNs)) {
          result = schema;
        } else {
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.