Package org.brickred.socialauth

Examples of org.brickred.socialauth.Contact


          }
        }
        String id = XMLParseUtil.getElementData(contact, "id");

        if (address != null && address.length() > 0) {
          Contact p = new Contact();
          p.setFirstName(fname);
          p.setLastName(lname);
          p.setEmail(address);
          p.setDisplayName(dispName);
          p.setOtherEmails(emailArr);
          p.setId(id);
          plist.add(p);
        }
      }
    } else {
      LOG.debug("No contacts were obtained from the feed : "
View Full Code Here


              dispName = XMLParseUtil.getElementData(field,
                  "value");
            }
          }
          if (address != null && address.length() > 0) {
            Contact p = new Contact();
            p.setFirstName(fname);
            p.setLastName(lname);
            p.setEmail(address);
            p.setDisplayName(dispName);
            if (emailArr.size() > 0) {
              String arr[] = new String[emailArr.size()];
              int k = 0;
              for (String s : emailArr) {
                arr[k] = s;
                k++;
              }
              p.setOtherEmails(arr);
            }
            p.setId(contact.getAttribute("yahoo:uri"));
            plist.add(p);
          }
        }
      }
    } else {
View Full Code Here

    JSONObject resp = new JSONObject(respStr);
    JSONArray data = resp.optJSONArray("data");
    if (data != null) {
      for (int i = 0; i < data.length(); i++) {
        JSONObject obj = data.getJSONObject(i);
        Contact p = new Contact();
        String id = obj.optString("id");
        p.setId(id);
        String full_name = obj.optString("full_name");
        p.setDisplayName(full_name);
        if (full_name != null) {
          String[] names = full_name.split(" ");
          if (names.length > 1) {
            p.setFirstName(names[0]);
            p.setLastName(names[1]);
          } else {
            p.setFirstName(full_name);
          }
        }
        String username = obj.optString("username");
        p.setProfileUrl(VIEW_PROFILE_URL + username);
        p.setProfileImageURL(obj.optString("profile_picture"));
        plist.add(p);
      }
    }
    return plist;
  }
View Full Code Here

          "Failed to parse the user profile json : " + respStr);
    }
    LOG.debug("Contacts Found : " + items.length());
    for (int i = 0; i < items.length(); i++) {
      JSONObject obj = items.getJSONObject(i);
      Contact c = new Contact();
      if (obj.has("firstName")) {
        c.setFirstName(obj.getString("firstName"));
      }
      if (obj.has("lastName")) {
        c.setLastName(obj.getString("lastName"));
      }
      if (obj.has("id")) {
        c.setProfileUrl(VIEW_PROFILE_URL + obj.getString("id"));
        c.setId(obj.getString("id"));
      }
      if (obj.has("photo")) {
        String photo = obj.getString("photo");
        if (photo.length() > 1) {
          c.setProfileImageURL(photo);
        }
      }
      plist.add(c);
    }
View Full Code Here

          String profileUrl = XMLParseUtil.getElementData(p,
              "public-profile-url");
          String pictureUrl = XMLParseUtil.getElementData(p,
              "picture-url");
          if (id != null) {
            Contact cont = new Contact();
            if (fname != null) {
              cont.setFirstName(fname);
            }
            if (lname != null) {
              cont.setLastName(lname);
            }
            if (profileUrl != null) {
              cont.setProfileUrl(profileUrl);
            }
            if (pictureUrl != null) {
              cont.setProfileImageURL(pictureUrl);
            }
            cont.setId(id);
            contactList.add(cont);
          }
        }
      } else {
        LOG.debug("No connections were obtained from : "
View Full Code Here

            String buddyurl = "http://farm" + iconfarm
                + ".staticflickr.com/" + iconserver
                + "/buddyicons/" + id + ".jpg";

            if (id != null) {
              Contact contactObj = new Contact();
              if (realName != null) {
                contactObj.setFirstName(realName);
              }
              if (userName != null) {
                contactObj.setDisplayName(userName);
              }

              if (iconserver != null) {
                if (iconserver.equalsIgnoreCase("0")) {
                  contactObj
                      .setProfileImageURL("http://www.flickr.com/images/buddyicon.gif");
                } else {
                  contactObj.setProfileImageURL(buddyurl);
                }
              }
              contactObj.setId(id);
              contactList.add(contactObj);
            }
          }
        }
      } else {
View Full Code Here

          }
        }
        String id = XMLParseUtil.getElementData(contact, "id");

        if (address != null && address.length() > 0) {
          Contact p = new Contact();
          p.setFirstName(fname);
          p.setLastName(lname);
          p.setEmail(address);
          p.setDisplayName(dispName);
          p.setOtherEmails(emailArr);
          p.setId(id);
          plist.add(p);
        }
      }
    } else {
      LOG.debug("No contacts were obtained from the feed : "
View Full Code Here

      JSONObject resp = new JSONObject(respStr);
      JSONArray data = resp.getJSONArray("data");
      LOG.debug("Found contacts : " + data.length());
      for (int i = 0; i < data.length(); i++) {
        JSONObject obj = data.getJSONObject(i);
        Contact p = new Contact();
        String name = obj.getString("name");
        if (name != null) {
          String nameArr[] = name.split(" ");
          if (nameArr.length > 1) {
            p.setFirstName(nameArr[0]);
            p.setLastName(nameArr[1]);
          } else {
            p.setFirstName(obj.getString("name"));
          }
          p.setDisplayName(name);
        }
        p.setId(obj.getString("id"));
        p.setProfileUrl(PUBLIC_PROFILE_URL + obj.getString("id"));
        p.setProfileImageURL(String.format(PROFILE_IMAGE_URL,
            obj.getString("id")));
        plist.add(p);
      }
    } catch (Exception e) {
      throw new ServerDataException(
View Full Code Here

    LOG.debug("Users info : " + result);
    try {
      JSONArray jarr = new JSONArray(result);
      for (int i = 0; i < jarr.length(); i++) {
        JSONObject jobj = jarr.getJSONObject(i);
        Contact cont = new Contact();
        if (jobj.has("name")) {
          cont.setFirstName(jobj.getString("name"));
        }
        if (jobj.has("screen_name")) {
          cont.setDisplayName(jobj.getString("screen_name"));
          cont.setProfileUrl("https://" + PROPERTY_DOMAIN + "/"
              + jobj.getString("screen_name"));
        }
        cont.setProfileImageURL(jobj.optString("profile_image_url"));
        if (jobj.has("id_str")) {
          cont.setId(jobj.getString("id_str"));
        }
        plist.add(cont);
      }
    } catch (Exception e) {
      throw e;
View Full Code Here

          String profileUrl = XMLParseUtil.getElementData(p,
              "public-profile-url");
          String pictureUrl = XMLParseUtil.getElementData(p,
              "picture-url");
          if (id != null) {
            Contact cont = new Contact();
            if (fname != null) {
              cont.setFirstName(fname);
            }
            if (lname != null) {
              cont.setLastName(lname);
            }
            if (profileUrl != null) {
              cont.setProfileUrl(profileUrl);
            }
            if (pictureUrl != null) {
              cont.setProfileImageURL(pictureUrl);
            }
            cont.setId(id);
            contactList.add(cont);
          }
        }
      } else {
        LOG.debug("No connections were obtained from : "
View Full Code Here

TOP

Related Classes of org.brickred.socialauth.Contact

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.