Examples of CkanApiProxy


Examples of org.deri.orefine.ckan.CkanApiProxy

      ckanApiBase = ckanApiBase.trim();
      if(ckanApiBase.endsWith("/")){
        ckanApiBase = ckanApiBase.substring(0, ckanApiBase.length()-1);
      }
     
      CkanApiProxy ckanApiClient = new CkanApiProxy();
         
      Engine engine = getEngine(request, project);
      StringTokenizer tokenizer = new StringTokenizer(files, ",");
      Set<Exporter> exporters = new HashSet<Exporter>();
      while(tokenizer.hasMoreTokens()){
        String format = tokenizer.nextToken();
        Exporter exporter = ExporterRegistry.getExporter(format);
       
        if(exporter==null){
          //handle the specialcase of provenance
          if(format.equals("add_provenance_info")){
            addProvenanceInfo = true;
            continue;
          }
          //either JSON representation of the history or something went wrong
          if(format.equals("history-json")){
            exporter = new HistoryJsonExporter();
          }else{
            //fail
            respondException(response, new RuntimeException("Unknown exporter format"));
            return;
          }
        }
        exporters.add(exporter);
      }
     
      final String packageUrl = ckanApiClient.addGroupOfResources(ckanApiBase , packageId, exporters, project, engine,
          new ProvenanceFactory(), apikey, createNewIfNonExisitng, addProvenanceInfo);
      respondJSON(response, new Jsonizable() {
       
        @Override
        public void write(JSONWriter writer, Properties options)
View Full Code Here

Examples of org.deri.orefine.ckan.CkanApiProxy

        throw new RuntimeException("Some required parameters are missing: CKAN API base URL");
      }
      if(packageId==null || packageId.isEmpty()){
        throw new RuntimeException("Some required parameters are missing: package ID");
      }
      CkanApiProxy ckanApiClient = new CkanApiProxy();
      JSONObject o = ckanApiClient.getPackage(packageUrl);
      if(o==null){
        respond(response,"{\"packageId\":null}");
        return;
      }
      response.setCharacterEncoding("UTF-8");
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.