Package org.fao.oaipmh.responses

Examples of org.fao.oaipmh.responses.ListMetadataFormatsResponse


  //---------------------------------------------------------------------------

  public AbstractResponse execute(AbstractRequest request, ServiceContext context) throws Exception
  {
    ListMetadataFormatsRequest  req = (ListMetadataFormatsRequest) request;
    ListMetadataFormatsResponse res = new ListMetadataFormatsResponse();

    GeonetContext gc = (GeonetContext) context.getHandlerContext(Geonet.CONTEXT_NAME);
    SchemaManager   sm = gc.getBean(SchemaManager.class);

    String uuid = req.getIdentifier();
    if (uuid != null)
    {
            String schema = context.getBean(MetadataRepository.class).findOneByUuid(uuid).getDataInfo().getSchemaId();
      res.addFormat(getSchemaInfo(context, sm, schema));
    }
    else
    {
      for (String schema : sm.getSchemas())
        res.addFormat(getSchemaInfo(context, sm, schema));
    }

    for (MetadataFormat mdf : getConvertFormats(context)) {
      res.addFormat(mdf);
    }

    return res;
  }
View Full Code Here


    req.setSchemaPath(oaiSchema);

        XmlRequest t = req.getTransport();
    t.setUrl(new URL(url));
    Lib.net.setupProxy(context, t);
    ListMetadataFormatsResponse res = req.execute();

    //--- build response

    Element root = new Element("formats");

    for (MetadataFormat mf : res.getFormats())
      root.addContent(new Element("format").setText(mf.prefix));

    return root;
  }
View Full Code Here

    Map<String, String> params = new HashMap<String, String>();

    if (identifier != null)
      params.put("identifier", identifier);

    return new ListMetadataFormatsResponse(sendRequest(params));
  }
View Full Code Here

TOP

Related Classes of org.fao.oaipmh.responses.ListMetadataFormatsResponse

Copyright © 2018 www.massapicom. 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.