Examples of toDb()


Examples of com.ikanow.infinit.e.data_model.store.social.authentication.AuthenticationPojo.toDb()

public class AuthUtils {
  public static boolean isAdmin(ObjectId userId) {
    try {
      AuthenticationPojo authQuery = new AuthenticationPojo();
      authQuery.setProfileId(userId);
      BasicDBObject dbo = (BasicDBObject) DbManager.getSocial().getAuthentication().findOne(authQuery.toDb());
      if (null != dbo) {
        AuthenticationPojo ap = AuthenticationPojo.fromDb(dbo, AuthenticationPojo.class);
        if (null != ap.getAccountType()) {
          if (ap.getAccountType().equalsIgnoreCase("admin")) {
            return true;
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.authentication.AuthenticationPojo.toDb()

      }
      ap.setApiKey(wpa.getApiKey());
     
      //Step 5 Save all of these objects to the DB
      DbManager.getSocial().getPerson().insert(pp.toDb());
      DbManager.getSocial().getAuthentication().insert(ap.toDb());
     
      CommunityHandler cc = new CommunityHandler();
      cc.createSelfCommunity(pp); //add user to own community
     
      //try to get system
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.authentication.AuthenticationPojo.toDb()

      }
      else {
        rp.setResponse(new ResponseObject("WP Update User",false,"Internal authentication error 1"));
        return rp;       
      }
      DBObject dboauth = DbManager.getSocial().getAuthentication().findOne(authQuery.toDb());
      if (null == dboauth) {
        rp.setResponse(new ResponseObject("WP Update User",false,"Internal authentication error 2"));
        return rp;       
      }     
      AuthenticationPojo ap = AuthenticationPojo.fromDb(dboauth, AuthenticationPojo.class);
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.authentication.AuthenticationPojo.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());
      DbManager.getSocial().getAuthentication().update(authQuery.toDb(), ap.toDb());     
      rp.setResponse(new ResponseObject("WP Update User",true,"User Updated Successfully"));
      rp.setData(ap, new AuthenticationPojoApiMap());
     
      //update communities if necessary
      if (bNeedToUpdateCommunities)
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.authentication.AuthenticationPojo.toDb()

    //TESTED
   
    AuthenticationPojo authQuery = new AuthenticationPojo();
    if (null != authQuery.getWPUserID()) { // (Some older records have this and of course it deletes the entire auth DB...)
      authQuery.setWPUserID(pp.getWPUserID());
      DbManager.getSocial().getAuthentication().remove(authQuery.toDb());
    }
    else if (null != pp.getEmail()) {
      authQuery.setUsername(pp.getEmail());
      DbManager.getSocial().getAuthentication().remove(authQuery.toDb());
    }
View Full Code Here

Examples of com.ikanow.infinit.e.data_model.store.social.authentication.AuthenticationPojo.toDb()

      authQuery.setWPUserID(pp.getWPUserID());
      DbManager.getSocial().getAuthentication().remove(authQuery.toDb());
    }
    else if (null != pp.getEmail()) {
      authQuery.setUsername(pp.getEmail());
      DbManager.getSocial().getAuthentication().remove(authQuery.toDb());
    }
    // (else we'll just have to leave that object in there unfortunately)
    //TESTED
   
    // Delete any cookies the user might have
View Full Code Here

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

      cap.setIssueDate(new Date());
      cap.setPersonId(owner.get_id().toString());
      cap.setRequesterId(p.get_id().toString());
      cap.setType("source");
      cap.setSourceId(source.getId().toString());
      DbManager.getSocial().getCommunityApprove().insert(cap.toDb());   
     
      // Message Body
      String body = "<p>" + p.getDisplayName() + " has requested that the following source be " +
        "added to the " + c.getName() + " community:</p>" +
        "<p>" +
View Full Code Here

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

                /////////////////////////////////////////////////////////////////////////////////////////////////
                DbManager.getSocial().getCommunity().update(query, cp.toDb());
                             
                //send email out to owner for approval
                CommunityApprovePojo cap = cp.createCommunityApprove(personIdStr,communityIdStr,"join",personIdStr);
                DbManager.getSocial().getCommunityApprove().insert(cap.toDb());
               
                // Get to addresses for Owner and Moderators
                String toAddresses = getToAddressesFromCommunity(cp);
               
                PropertiesManager propManager = new PropertiesManager();
View Full Code Here

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

                  /////////////////////////////////////////////////////////////////////////////////////////////////
                  DbManager.getSocial().getCommunity().update(query, cp.toDb());
                 
                  //send email out inviting user
                  CommunityApprovePojo cap = cp.createCommunityApprove(personIdStr,communityIdStr,"invite",userIdStr);
                  DbManager.getSocial().getCommunityApprove().insert(cap.toDb());
                 
                  PropertiesManager propManager = new PropertiesManager();
                  String rootUrl = propManager.getUrlRoot();
                 
                  if (null == rootUrl) {
View Full Code Here

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

        c.setNumberOfMembers(0);
        c.setCommunityAttributes(getDefaultCommunityAttributes());
        c.setCommunityUserAttribute(getDefaultCommunityUserAttributes());
       
        // Insert new community document in the community collection
        DBObject commObj = c.toDb();

        // Create the index form of the community:
        try {
          GenericProcessingController.createCommunityDocIndex(c.getId().toString(), c.getParentId(), c.getIsPersonalCommunity(), c.getIsSystemCommunity(), false);
        }
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.