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

Examples of com.ikanow.infinit.e.data_model.api.social.community.CommunityPojoApiMap


      if (null != parentid)
        createCommunityAddress += "/" + URLEncoder.encode(parentid,"UTF-8");
     
      String communityresult = sendRequest(createCommunityAddress, null);

      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(communityresult, ResponsePojo.class, CommunityPojo.class, new CommunityPojoApiMap());
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);
     
      return (CommunityPojo)internal_responsePojo.getData();
View Full Code Here


    {
      String addToCommunityAddress = apiRoot + "social/community/member/invite/" + URLEncoder.encode(communityId,"UTF-8") + "/" +
          URLEncoder.encode(personId,"UTF-8") + "/";
      String inviteresult = sendRequest(addToCommunityAddress, null);

      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(inviteresult, ResponsePojo.class, CommunityPojo.class, new CommunityPojoApiMap());
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);

      return responseObject.getMessage();
View Full Code Here

    try
    {
      String addToCommunityAddress = apiRoot + "social/community/member/join/" + URLEncoder.encode(communityId,"UTF-8");
      String inviteresult = sendRequest(addToCommunityAddress, null);

      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(inviteresult, ResponsePojo.class, CommunityPojo.class, new CommunityPojoApiMap());
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);

      return responseObject.getMessage();
View Full Code Here

    {
      String addToCommunityAddress = apiRoot + "social/community/member/invite/" + URLEncoder.encode(communityId,"UTF-8") + "/" +
          URLEncoder.encode(personId,"UTF-8") + "/?skipinvitation=true";
      String inviteresult = sendRequest(addToCommunityAddress, null);

      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(inviteresult, ResponsePojo.class, CommunityPojo.class, new CommunityPojoApiMap());
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);

      return responseObject.getMessage();
View Full Code Here

    try
    {
      String getCommunityAddress = apiRoot + "social/community/get/" + URLEncoder.encode(communityIdentifier,"UTF-8") + "";
      String getResult = sendRequest(getCommunityAddress, null);

      ResponsePojo internal_responsePojo = ResponsePojo.fromApi(getResult, ResponsePojo.class, CommunityPojo.class, new CommunityPojoApiMap());
      ResponseObject internal_ro = internal_responsePojo.getResponse();
      responseObject = shallowCopy(responseObject, internal_ro);

      return (CommunityPojo)internal_responsePojo.getData();
View Full Code Here

       
        if ( dbc.count() > 0 )
        {
          List<CommunityPojo> communities = CommunityPojo.listFromDb(dbc, CommunityPojo.listType());
          filterCommunityMembers(communities, isSysAdmin, userIdStr);
          rp.setData(communities, new CommunityPojoApiMap());
          rp.setResponse(new ResponseObject("Community Info", true, "Community info returned successfully"));       
        }
        else
        {
          rp.setResponse(new ResponseObject("Community Info", true, "No communities returned"))
        }
      }
      else // Get all public communities and all private communities to which the user belongs
      {
        // Set up the query
        BasicDBObject queryTerm1 = new BasicDBObject("communityAttributes.isPublic.value", "true");
        BasicDBObject queryTerm2 = new BasicDBObject("members._id", new ObjectId(userIdStr));
        BasicDBObject queryTerm3 = new BasicDBObject("ownerId", new ObjectId(userIdStr));
        BasicDBObject query = new BasicDBObject(MongoDbManager.or_, Arrays.asList(queryTerm1, queryTerm2, queryTerm3));

        DBCursor dbc = DbManager.getSocial().getCommunity().find(query);       
        if ( dbc.count() > 0 )
        {
          List<CommunityPojo> communities = CommunityPojo.listFromDb(dbc, CommunityPojo.listType());
          filterCommunityMembers(communities, isSysAdmin, userIdStr);
          //add personal community
          DBObject dbo = DbManager.getSocial().getCommunity().findOne(new BasicDBObject("_id",new ObjectId(userIdStr)));
          if ( dbo != null )
          {
            communities.add(CommunityPojo.fromDb(dbo, CommunityPojo.class));
          }
          rp.setData(communities, new CommunityPojoApiMap());
          rp.setResponse(new ResponseObject("Community Info", true, "Community info returned successfully"));       
        }
        else
        {
          rp.setResponse(new ResponseObject("Community Info", true, "No communities returned"))
View Full Code Here

      DBCursor dbc = DbManager.getSocial().getCommunity().find(query);
      if ( dbc.count() > 0 )
      {
        List<CommunityPojo> communities = CommunityPojo.listFromDb(dbc, CommunityPojo.listType());
        filterCommunityMembers(communities, isSysAdmin, userIdStr);
        rp.setData(communities, new CommunityPojoApiMap());
        rp.setResponse(new ResponseObject("Community Info", true, "Community info returned successfully"));       
      }
      else
      {
        rp.setResponse(new ResponseObject("Community Info", true, "No communities returned"))
View Full Code Here

            dc.set_id(null);
            community.setDocumentInfo(dc);
          }
        }
        community = filterCommunityMembers(community, RESTTools.adminLookup(userIdStr), userIdStr);
        rp.setData(community, new CommunityPojoApiMap());
        rp.setResponse(new ResponseObject("Community Info", true, "Community info returned successfully"));
      }
      else
      {
        rp.setResponse(new ResponseObject("Community Info", false, "Unable to return information for the community specified."));
View Full Code Here

    /////////////////////////////////////////////////////////////////////////////////////////////////
    // Attempt to parse the JSON passed in to a CommunityPojo
    CommunityPojo updateCommunity = null;
    try
    {
      updateCommunity = ApiManager.mapFromApi(json, CommunityPojo.class, new CommunityPojoApiMap());
    }
    catch (Exception ex)
    {
      rp.setResponse(new ResponseObject("Update Community",false,"Update json is badly formatted, could not deserialize."));
      return rp;
View Full Code Here

            DbManager.getSocial().getCommunity().update(query, community.toDb());

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

            rp.setData(community, new CommunityPojoApiMap());

            rp.setResponse(new ResponseObject("Add member to community", true, "Person has been added as member of community"))
          }         
          else
          {
View Full Code Here

TOP

Related Classes of com.ikanow.infinit.e.data_model.api.social.community.CommunityPojoApiMap

Copyright © 2018 www.massapicom. 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.