Examples of toDb()


Examples of com.ikanow.infinit.e.data_model.store.social.community.CommunityPojo.toDb()

            /////////////////////////////////////////////////////////////////////////////////////////////////
            // TODO (INF-1214): Make this code more robust to handle changes to the community that need to
            // Caleb: this means change update to $set
            /////////////////////////////////////////////////////////////////////////////////////////////////
            DbManager.getSocial().getCommunity().update(query, community.toDb());

            PersonHandler person = new PersonHandler();
            person.addCommunity(personIdStr, communityIdStr, communityName);

            rp.setData(community, new CommunityPojoApiMap());
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.cookies.CookiePojo.toDb()

        cp.set_id(profileId);
        cp.setCookieId(cp.get_id());
        cp.setApiKey(wpa.getApiKey());
        cp.setStartDate(ap.getCreated());
        cp.setProfileId(profileId);
        DbManager.getSocial().getCookies().save(cp.toDb());
      }//TOTEST
    }
    catch (Exception ex )
    {
      logger.error("Exception Message: " + ex.getMessage(), ex);
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.cookies.CookiePojo.toDb()

        // Delete existing API key
        // (We'll allow a user to update their own API key - just not create it, see below)
        CookiePojo removeMe = new CookiePojo();
        removeMe.setApiKey(ap.getApiKey());
        ap.setApiKey(null);       
        DbManager.getSocial().getCookies().remove(removeMe.toDb());
      }
      else if (null != wpa.getApiKey()) {
        // Change or create API key
        // Only admins can do this:
        if (null != personIdStr) { // (this is != null iff user isn't admin)
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.cookies.CookiePojo.toDb()

        cp.set_id(ap.getProfileId());
        cp.setCookieId(cp.get_id());
        cp.setApiKey(wpa.getApiKey());
        cp.setStartDate(ap.getCreated());
        cp.setProfileId(ap.getProfileId());
        DbManager.getSocial().getCookies().save(cp.toDb());               
      }//TESTED
      //else if api key is null then leave alone, assume hasn't changed
     
      //update old entries
      DbManager.getSocial().getPerson().update(new BasicDBObject("_id", pp.get_id()), pp.toDb());
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.cookies.CookiePojo.toDb()

   
    // Delete any cookies the user might have
    CookiePojo cookieQuery = new CookiePojo();
    if (null != pp.get_id()) {
      cookieQuery.setProfileId(pp.get_id());
      DbManager.getSocial().getCookies().remove(cookieQuery.toDb());
    }
    //TOTEST
   
    rp.setResponse(new ResponseObject("WP Delete User",true,"User Deleted Successfully"));
    return rp;
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.gui.FavoriteUIModulePojo.toDb()

    {
      boolean bAdmin = RESTTools.adminLookup(userIdStr);
     
      FavoriteUIModulePojo moduleQuery = new FavoriteUIModulePojo();
      moduleQuery.setProfileId(new ObjectId(userIdStr));
      DBObject dbo = DbManager.getSocial().getUIFavoriteModules().findOne(moduleQuery.toDb());     
      HashSet<ObjectId> memberOf = SocialUtils.getUserCommunities(userIdStr);
      List<UIModulePojo> mods = getFullModule(FavoriteUIModulePojo.fromDb(dbo,FavoriteUIModulePojo.class).getQuickModules(), memberOf, bAdmin);
      rp.setData(mods, new UIModulePojoApiMap(bAdmin?null:memberOf));
      rp.setResponse(new ResponseObject("Get User Modules",true,"users modules returned successfully"));
    }
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.gui.UIModulePojo.toDb()

    {
      for ( int i = 0; i < moduleids.size(); i++ //loop through all the ids sent in, and grab the module   
      {
        UIModulePojo moduleQuery = new UIModulePojo();
        moduleQuery.set_id(moduleids.get(i));
        DBObject dbo = DbManager.getSocial().getUIModules().findOne(moduleQuery.toDb());
        if ( dbo != null) {
          UIModulePojo module = UIModulePojo.fromDb(dbo,UIModulePojo.class);
          if (null != module.getCommunityIds()) {
            if (bAdmin) {
              mods.add(module);
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.gui.UISetupPojo.toDb()

    ResponsePojo rp = new ResponsePojo();
    try
    {
      UISetupPojo querySetup = new UISetupPojo();
      querySetup.setProfileID(new ObjectId(profileID));
      DBObject dbo = DbManager.getSocial().getUISetup().findOne(querySetup.toDb())
      if ( dbo != null )
      {
        UISetupPojo up = UISetupPojo.fromDb(dbo, UISetupPojo.class);
        rp.setResponse(new ResponseObject("UISetup",true,"ui returned successfully"));
        rp.setData(up, new UISetupPojoApiMap());
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.person.PersonPojo.toDb()

  public static List<ObjectId> getUserCommunities(ObjectId submitterId) {
    // Set up the query
    PersonPojo personQuery = new PersonPojo();
    personQuery.set_id(submitterId);
   
    BasicDBObject dbo = (BasicDBObject) DbManager.getSocial().getPerson().findOne(personQuery.toDb());
    PersonPojo person = PersonPojo.fromDb(dbo, PersonPojo.class);
   
    if (null == person) {
      throw new RuntimeException("User no longer exists?");
    }
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.person.PersonPojo.toDb()

    {
      // Set up the query
      PersonPojo personQuery = new PersonPojo();
      personQuery.set_id(new ObjectId(id));
     
      BasicDBObject dbo = (BasicDBObject) DbManager.getSocial().getPerson().findOne(personQuery.toDb());
      person = PersonPojo.fromDb(dbo, PersonPojo.class);
    }
    catch (Exception e)
    {
      logger.error("Exception Message: " + e.getMessage(), e);
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.