Package com.ikanow.infinit.e.data_model.store.social.person

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


    try
    {
      // Find person record to update
      PersonPojo personQuery = new PersonPojo();
      personQuery.set_id(new ObjectId(personId));
      DBObject dbo = DbManager.getSocial().getPerson().findOne(personQuery.toDb());
     
      if (dbo != null)
      {
        // Get GsonBuilder object with MongoDb de/serializers registered
        PersonPojo person = PersonPojo.fromDb(dbo, PersonPojo.class);
View Full Code Here


        if (!alreadyMember)
        {
          //TODO (INF-1214): (not thread safe)         
          communities.add(community)
          person.setModified(new Date());         
          DbManager.getSocial().getPerson().update(personQuery.toDb(), person.toDb());
          rp.setData(person, new PersonPojoApiMap());
          rp.setResponse(new ResponseObject("Add community status",true,"Community added successfully."))
        }         
        else
        {
View Full Code Here

    try
    {
      // Find person record to update
      PersonPojo personQuery = new PersonPojo();
      personQuery.set_id(new ObjectId(personId));
      DBObject dbo = DbManager.getSocial().getPerson().findOne(personQuery.toDb());
     
      if (dbo != null)
      {
        PersonPojo person = PersonPojo.fromDb(dbo, PersonPojo.class);
       
View Full Code Here

        if (alreadyMember)
        {
          //TODO (INF-1214): (not thread safe)         
          communities.remove(communityIndex)
          person.setModified(new Date());         
          DbManager.getSocial().getPerson().update(personQuery.toDb(), person.toDb());
          rp.setData(person, new PersonPojoApiMap());
          rp.setResponse(new ResponseObject("Remove community status",true,"Community removed successfully."))
        }         
        else
        {
View Full Code Here

                /////////////////////////////////////////////////////////////////////////////////////////////////
                // 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, cp.toDb());
                DbManager.getSocial().getPerson().update(queryPerson, pp.toDb());
                rp.setResponse(new ResponseObject("Join Community",true,"Joined community successfully"));
                rp.setData(new CommunityApprovalPojo(true));
              }           
            }
            else
View Full Code Here

          /////////////////////////////////////////////////////////////////////////////////////////////////
          // 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, cp.toDb());
          DbManager.getSocial().getPerson().update(queryPerson, pp.toDb());
          rp.setResponse(new ResponseObject("Leave Community",true,"Left community successfully"));
        }
        else
        {
          rp.setResponse(new ResponseObject("Leave Community",false,"Cannot leave personal community"));
View Full Code Here

                  pp.addCommunity(cp);
                  /////////////////////////////////////////////////////////////////////////////////////////////////
                  // 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().getPerson().update(new BasicDBObject("_id", pp.get_id()), pp.toDb());
                 
                  rp.setResponse(new ResponseObject("Invite Community",true,"User added to community successfully."));
                }
                else
                {
View Full Code Here

                    pp.addCommunity(cp);
                    /////////////////////////////////////////////////////////////////////////////////////////////////
                    // 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().getPerson().update(queryPerson, pp.toDb());
                  }
                  else
                  {
                    rp.setResponse(new ResponseObject("Request Response",false,"The person does not exist."));
                  }
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.