Package org.fao.oaipmh.responses

Examples of org.fao.oaipmh.responses.ListSetsResponse


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

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

    //--- we don't provide streaming for sets

    if (req.getResumptionToken() != null)
      throw new BadResumptionTokenException(req.getResumptionToken());

        final List<MetadataCategory> metadataCategories = context.getBean(MetadataCategoryRepository.class).findAll();

    for (MetadataCategory rec : metadataCategories)
    {
      String name  = rec.getName();
      String label = rec.getLabel(context.getLanguage());

      res.addSet(new SetInfo(name, label));
    }

    return res;
  }
View Full Code Here


      ListSetsRequest req = new ListSetsRequest(context.getBean(GeonetHttpRequestFactory.class));
      req.setSchemaPath(oaiSchema);
            XmlRequest t = req.getTransport();
      t.setUrl(new URL(url));
      Lib.net.setupProxy(context, t);
      ListSetsResponse res = req.execute();

      //--- build response

      while (res.hasNext())
      {
        SetInfo si = res.next();

        Element el = new Element("set");

        el.addContent(new Element("name") .setText(si.getSpec()));
        el.addContent(new Element("label").setText(si.getName()));
View Full Code Here

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

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

    return new ListSetsResponse(this, sendRequest(params));
  }
View Full Code Here

TOP

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

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.