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

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


        {
          rp.setResponse(new ResponseObject("Update Community",false,"Use community/update/status to change ownership"));
          return rp;
        }//TESTED
               
        DbManager.getSocial().getCommunity().update(query, cp.toDb());
               
        // Community name has changed, member records need to be updated to reflect the name change
        if (originalName != null)
        {
          DBObject query_person = new BasicDBObject("communities.name", originalName);
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, community.toDb());

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

            rp.setData(community, new CommunityPojoApiMap());
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, community.toDb());

            PersonHandler person = new PersonHandler();
            person.removeCommunity(personIdStr, communityIdStr);

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

        //TESTED
      }
      catch (Exception e) {} // Do nothing, will have to update the user to stop bad things from happening on query though
     
      //write community to db
      DbManager.getSocial().getCommunity().insert(selfCommunity.toDb());
      //update user to be in this community
      PersonCommunityPojo pcpSelf = new PersonCommunityPojo(person.get_id(), selfCommunity.getName());
      person.getCommunities().add(pcpSelf);
      /////////////////////////////////////////////////////////////////////////////////////////////////
      // TODO (INF-1214): Make this code more robust to handle changes to the community that need to
View Full Code Here

   
    //DB: read/write community object
    ////////////////////////////////////////////////
    //CANONICAL EXAMPLE:
    CommunityPojo cp = CommunityPojo.fromDb(communityDb.findOne(), CommunityPojo.class);
    System.out.println("CP1=" + cp.toDb()); // (converts DBObject to string ie BSON->JSON - should have { $oid } and { $date } objectid/date formats)
    ////////////////////////////////////////////////
    System.out.println("CP2=" + new Gson().toJson(cp)); // (will have complex object id format and string dates)
    //DB: read/write list of community objects
    ////////////////////////////////////////////////
    //CANONICAL EXAMPLE:
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.