Examples of toApi()


Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()

    BasicDBObject db01 = new BasicDBObject("index", 1);
    BasicDBObject db02 = new BasicDBObject("index", 2);
    BasicDBObject db03 = new BasicDBObject("index", 3);
    dbl.addAll(Arrays.asList(db01, db02, db03));
    ResponsePojo rp2 = new ResponsePojo(null, dbl, (BasePojoApiMap<BasicDBList>)null);
    System.out.println("DBO=" + rp2.toApi());
   
    //API: test the V0 DocumentPojo, which has a few differences (including a static version for raw modification)
    BasicDBObject docApiDbo = (BasicDBObject) DbManager.getDocument().getMetadata().findOne();
    // (remove a few things to tidy up display)
    docApiDbo.remove("entities");
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()

    // (display results of API mappings)
    DocumentPojo docApi = DocumentPojo.fromDb(docApiDbo, DocumentPojo.class);
    ResponsePojo rp3 = new ResponsePojo(null, docApi, new DocumentPojoApiMap());

    System.out.println("TIME_DOC_API1_CREATED="+docApi.getCreated());
    System.out.println("DOC_API1=" + rp3.toApi());
    DocumentPojoApiMap.mapToApi(docApiDbo);
    System.out.println("DOC_API2=" + BaseApiPojo.getDefaultBuilder().setPrettyPrinting().create().toJson(docApiDbo));
    DocumentPojo docFromApi = ApiManager.mapFromApi(ApiManager.mapToApi(docApi, null), DocumentPojo.class, null);
    System.out.println("TIME_DOC_API1_CREATED_INV="+docFromApi.getCreated());
   
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()

    return new StringRepresentation(data, mediaType);
  }   
 
  protected StringRepresentation returnError(String queryType, String errorString) {
    ResponsePojo rp = returnErrorPojo(queryType, errorString);
    return new StringRepresentation(rp.toApi(), MediaType.APPLICATION_JSON);
  }
  protected ResponsePojo returnErrorPojo(String queryType, String errorString) {
    ResponsePojo rp = new ResponsePojo();
    rp.setResponse(new ResponseObject(queryType, false, errorString));
    return rp;
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.ResponsePojo.toApi()

     }
     else
     {
       //there are no actions that shouldn't require cookies
     }
     return new StringRepresentation(rp.toApi(),MediaType.APPLICATION_JSON);
  }
 
}
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.authentication.WordPressAuthPojo.toApi()

           WordPressUserPojo user = new WordPressUserPojo();
           WordPressAuthPojo auth = new WordPressAuthPojo();
           user.setWPUserID(wpuser); // (this is ignored if a normal user is logged in)
           auth.setPassword(wpauth);
           wpuser = user.toApi();
           wpauth = auth.toApi();
         }
         else if (urlStr.contains("/person/update/email/")) { //special case: update email
           WordPressUserPojo user = new WordPressUserPojo();
           WordPressAuthPojo auth = new WordPressAuthPojo();
           user.setWPUserID(wpuser); // (this is ignored if a normal user is logged in)
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.authentication.WordPressAuthPojo.toApi()

           WordPressAuthPojo auth = new WordPressAuthPojo();
           user.setWPUserID(wpuser); // (this is ignored if a normal user is logged in)
           String[] emails = wpauth.split("\\s*,\\s*");
           user.setEmail(Arrays.asList(emails));
           wpuser = user.toApi();
           wpauth = auth.toApi();
         }
         action = "wpupdate";
       }
     }  
  }
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.authentication.WordPressUserPojo.toApi()

         if (urlStr.contains("/person/update/password/")) { //special case: update password
           WordPressUserPojo user = new WordPressUserPojo();
           WordPressAuthPojo auth = new WordPressAuthPojo();
           user.setWPUserID(wpuser); // (this is ignored if a normal user is logged in)
           auth.setPassword(wpauth);
           wpuser = user.toApi();
           wpauth = auth.toApi();
         }
         else if (urlStr.contains("/person/update/email/")) { //special case: update email
           WordPressUserPojo user = new WordPressUserPojo();
           WordPressAuthPojo auth = new WordPressAuthPojo();
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.api.authentication.WordPressUserPojo.toApi()

           WordPressUserPojo user = new WordPressUserPojo();
           WordPressAuthPojo auth = new WordPressAuthPojo();
           user.setWPUserID(wpuser); // (this is ignored if a normal user is logged in)
           String[] emails = wpauth.split("\\s*,\\s*");
           user.setEmail(Arrays.asList(emails));
           wpuser = user.toApi();
           wpauth = auth.toApi();
         }
         action = "wpupdate";
       }
     }  
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.control.DocumentQueueControlPojo.toApi()

         
          // Update share info:
          toModify.setLastDocIdInserted(maxDocId);
         
          // We've modified the share so update it:
          savedQueryShare.setShare(toModify.toApi());
          savedQueryShare.setModified(new Date());
          DbManager.getSocial().getShare().save(savedQueryShare.toDb());
         
        }//(end found some docs)
       
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.control.DocumentQueueControlPojo.toApi()

                DbManager.getCustom().getSavedQueryCache().insert(savedQueryShare.toDb());
                CommandResult cr = DbManager.getCustom().getSavedQueryCache().getDB().getLastError();
               
                if (null == cr.get("err")) { // if we've actually done something, update the main share table also
                  savedQuery.getQueryInfo().setLastRun(now);
                  savedQueryShare.setShare(savedQuery.toApi());
                  // (this will overwrite the existing version)
                  DbManager.getSocial().getShare().save(savedQueryShare.toDb());               
                }//TESTED (by hand with prints)
               
              }//TESTED (test3-5)
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.