Package com.ikanow.infinit.e.data_model.store.social.sharing.SharePojo

Examples of com.ikanow.infinit.e.data_model.store.social.sharing.SharePojo.ShareCommunityPojo


        return null;
      }//TESTED
     
      // Remove share from personal community
      try {
        ShareCommunityPojo currCommunity =  shareForNewAliases.getCommunities().iterator().next();
        String removeCommunityIdStr = currCommunity.get_id().toString();
        if (!communityIdStr.equals(removeCommunityIdStr)) { // (obv not if this is my community somehow, don't think that's possible)
          this.removeShareFromCommunity(shareForNewAliases.get_id().toString(), removeCommunityIdStr, response);
          if (!response.isSuccess()) {
            return null;       
          }
View Full Code Here


    person.set_id(new ObjectId("4e3706c48d26852237078005")); // (admin)
    person.setEmail("infinite_default@ikanow.com");
    person.setDisplayName("infinite_default@ikanow.com");
    share.setOwner(person);
    share.setCommunities(new ArrayList<ShareCommunityPojo>(2));
    ShareCommunityPojo community = new ShareCommunityPojo();
    community.set_id(new ObjectId("4c927585d591d31d7b37097a"));
    community.setName("System");
    share.getCommunities().add(community);
    community = new ShareCommunityPojo();
    community.set_id(new ObjectId("4e3706c48d26852237078005"));
    community.setName("Personal");   
    share.getCommunities().add(community);       
  }
View Full Code Here

    {
      String[] splits = communityIds.split("\\s*,\\s*");
      List<ShareCommunityPojo> comms = new ArrayList<SharePojo.ShareCommunityPojo>();
      for ( String s : splits )
      {
        ShareCommunityPojo scp = new ShareCommunityPojo();
        scp.set_id(new ObjectId(s));
        comms.add(scp);
      }
      share.setCommunities(comms);
    }
   
View Full Code Here

       
        // Add new community to communities (or change its read/write permissions)
        if (addCommunity || changedReadWriteAccess)
        {         
          if (addCommunity) {
            ShareCommunityPojo cp = new ShareCommunityPojo();
            cp.set_id(new ObjectId(communityIdStr));
            cp.setName(getCommunity(new ObjectId(communityIdStr)).getName());
            cp.setComment(comment);
            communities.add(cp);
 
            // Endorse if applicable...
            if (null == share.getEndorsed()) { // legacy case
              share.setEndorsed(new HashSet<ObjectId>());
              share.getEndorsed().add(share.getOwner().get_id()); // user's personal community always endorsed
            }//TESTED
            boolean bAdmin = RESTTools.adminLookup(ownerIdStr, false); // (can be admin-on-request and not enabled, the bar for endorsing is pretty low)
            if (bAdmin || SocialUtils.isOwnerOrModeratorOrContentPublisher(communityIdStr, ownerIdStr))  {
              share.getEndorsed().add(cp.get_id());
            }
            //TESTED - adding as admin/community owner, not adding if not
          }         
          share.setModified(new Date());
View Full Code Here

   * @param owner
   * @return
   */
  private List<ShareCommunityPojo> getPersonalCommunity(PersonPojo owner)
  {
    ShareCommunityPojo cp = new ShareCommunityPojo();
    for (PersonCommunityPojo pc : owner.getCommunities())
    {
      if (pc.get_id().equals(owner.get_id()))
      {
        cp.set_id(pc.get_id());
        cp.setComment(null);
        cp.setName(pc.getName());
      }
    }

    // Add the owner's personal community
    List<ShareCommunityPojo> communities = new ArrayList<ShareCommunityPojo>();
View Full Code Here

   
    //test update comms
    updated_pojo = new SharePojo();
    updated_pojo.set_id(share_json.get_id());
    List<ShareCommunityPojo> communities = new ArrayList<SharePojo.ShareCommunityPojo>();
    ShareCommunityPojo scp = new ShareCommunityPojo();
    scp.set_id(new ObjectId("53ff3851e4b0db2c2b27c82e")); //test api community
    communities.add(scp);
    updated_pojo.setCommunities(communities);
    returned_pojo = updateShare(updated_pojo);
    assertTrue(returned_pojo.getCommunities().get(0).get_id().equals(new ObjectId("53ff3851e4b0db2c2b27c82e")));
   
View Full Code Here

    SharePojo share_ref = new SharePojo();
    share_ref.setTitle("test_ref");
    share_ref.setDescription("123");
    share_ref.setType("test1");
    List<ShareCommunityPojo> communities = new ArrayList<SharePojo.ShareCommunityPojo>();
    ShareCommunityPojo scp = new ShareCommunityPojo();
    scp.set_id(new ObjectId("4c927585d591d31d7b37097a")); //this is inf system i think
    communities.add(scp);
    share_ref.setCommunities(communities);
    DocumentLocationPojo dlp = new DocumentLocationPojo();
    dlp.setDatabase("doc_metadata");
    dlp.setCollection("metadata");
View Full Code Here

    SharePojo share_bin = new SharePojo();
    share_bin.setTitle("test_bin");
    share_bin.setDescription("123");
    share_bin.setType("test1");
    List<ShareCommunityPojo> communities = new ArrayList<SharePojo.ShareCommunityPojo>();
    ShareCommunityPojo scp = new ShareCommunityPojo();
    scp.set_id(new ObjectId("4c927585d591d31d7b37097a")); //this is inf system i think
    communities.add(scp);
    share_bin.setCommunities(communities);
    String binary_data = "secret binary data";
    share_bin.setBinaryData(binary_data.getBytes());
    String share_string = share_bin.toDb().toString();
View Full Code Here

TOP

Related Classes of com.ikanow.infinit.e.data_model.store.social.sharing.SharePojo.ShareCommunityPojo

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.