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

Examples of com.ikanow.infinit.e.data_model.store.social.community.CommunityUserAttributePojo


            while (it.hasNext())
            {
              CommunityMemberUserAttributePojo c = new CommunityMemberUserAttributePojo();
              Map.Entry<String,CommunityUserAttributePojo> pair = it.next();
              c.setType(pair.getKey().toString());
              CommunityUserAttributePojo v = (CommunityUserAttributePojo)pair.getValue();
              c.setValue(v.getDefaultValue());
              cmua.add(c);
            }
            cmp.setUserAttributes(cmua);

            // Get Person data to added to member record
            BasicDBObject query2 = new BasicDBObject();
            query2.put("_id", new ObjectId(personIdStr));
            DBObject dbo2 = DbManager.getSocial().getPerson().findOne(query2);
            PersonPojo p = PersonPojo.fromDb(dbo2, PersonPojo.class);

            if (p.getContacts() != null)
            {
              // Set contacts from person record
              Set<CommunityMemberContactPojo> contacts = new HashSet<CommunityMemberContactPojo>();
              Map<String, PersonContactPojo> pcp = p.getContacts();
              Iterator<Map.Entry<String, PersonContactPojo>> it2 = pcp.entrySet().iterator();
              while (it2.hasNext())
              {
                CommunityMemberContactPojo c = new CommunityMemberContactPojo();
                Map.Entry<String, PersonContactPojo> pair = it2.next();
                c.setType(pair.getKey().toString());
                PersonContactPojo v = (PersonContactPojo)pair.getValue();
                c.setValue(v.getValue());
                contacts.add(c);
              }
              cmp.setContacts(contacts);
            }

            // Set links from person record
            if (p.getLinks() != null)
            {
              // Set contacts from person record
              Set<CommunityMemberLinkPojo> links = new HashSet<CommunityMemberLinkPojo>();
              Map<String, PersonLinkPojo> plp = p.getLinks();
              Iterator<Map.Entry<String, PersonLinkPojo>> it3 = plp.entrySet().iterator();
              while (it.hasNext())
              {
                CommunityMemberLinkPojo c = new CommunityMemberLinkPojo();
                Map.Entry<String, PersonLinkPojo> pair = it3.next();
                c.setTitle(pair.getKey().toString());
                PersonLinkPojo v = (PersonLinkPojo)pair.getValue();
                c.setUrl(v.getUrl());
                links.add(c);
              }
              cmp.setLinks(links);
            }
View Full Code Here


      commAttributes.put("usersCanSelfRegister", new CommunityAttributePojo("boolean","false") );
      commAttributes.put("registrationRequiresApproval", new CommunityAttributePojo("boolean","false") );
      commAttributes.put("usersCanCreateSubCommunities", new CommunityAttributePojo("boolean","false") );
      selfCommunity.setCommunityAttributes(commAttributes);
      Map<String,CommunityUserAttributePojo> commUserAttributes = new HashMap<String,CommunityUserAttributePojo>();
      commUserAttributes.put("publishLoginToActivityFeed", new CommunityUserAttributePojo("boolean","true",true));
      commUserAttributes.put("publishCommentsToActivityFeed", new CommunityUserAttributePojo("boolean","true",true));
      commUserAttributes.put("publishSharingToActivityFeed", new CommunityUserAttributePojo("boolean","true",true));
      commUserAttributes.put("publishQueriesToActivityFeed", new CommunityUserAttributePojo("boolean","true",true));
      commUserAttributes.put("publishCommentsPublicly", new CommunityUserAttributePojo("boolean","false",true));
      selfCommunity.setCommunityUserAttribute(commUserAttributes);
      selfCommunity.setNumberOfMembers(0);
     
      // Create the index form of the community:
      try {
View Full Code Here

   * @return Map<String, CommunityUserAttributePojo>
   */
  private Map<String, CommunityUserAttributePojo> getDefaultCommunityUserAttributes()
  {
    Map<String, CommunityUserAttributePojo> c = new HashMap<String, CommunityUserAttributePojo>();
    CommunityUserAttributePojo v = new CommunityUserAttributePojo();
    v.setType("Boolean");
    v.setDefaultValue("true");
    v.setAllowOverride(false);
    c.put("publishLoginToActivityFeed", v);
    v = new CommunityUserAttributePojo();
    v.setType("Boolean");
    v.setDefaultValue("true");
    v.setAllowOverride(false);
    c.put("publishCommentsToActivityFeed", v);
    v = new CommunityUserAttributePojo();
    v.setType("Boolean");
    v.setDefaultValue("true");
    v.setAllowOverride(false);
    c.put("publishSharingToActivityFeed", v);
    v = new CommunityUserAttributePojo();
    v.setType("Boolean");
    v.setDefaultValue("true");
    v.setAllowOverride(false);
    c.put("publishQueriesToActivityFeed", v);
    v = new CommunityUserAttributePojo();
    v.setType("Boolean");
    v.setDefaultValue("false");
    v.setAllowOverride(false);
    c.put("publishCommentsPublicly", v);
    return c;
  }
View Full Code Here

TOP

Related Classes of com.ikanow.infinit.e.data_model.store.social.community.CommunityUserAttributePojo

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.