Package com.gadglet.data

Examples of com.gadglet.data.UserProfile


        record.setGadgetPermissions(isEditor, isOwner, isOwner);

        if (!isOwner) {
          // send info about the owner
          UserProfile owner = UserProfilesUtils.getProfileById(item
              .getOwnerId());

          if (owner != null && !owner.isPrivate()) {
            if (owner.getNickName() != null)
              record.addItemField(ProfileFields.PROFILE_NICKNAME
                  .getParamName(), owner.getNickName());
            if (owner.getPhotoUrl() != null
                && owner.getPhotoUrl().length() > 0)
              record.addItemField(
                  ProfileFields.PROFILE_THUMBNAILURL
                      .getParamName(), owner
                      .getPhotoUrl());

          }

        }
View Full Code Here


      HttpServletResponse httpServletResponse) {
    GadgletResponse gadgetServerResponse = new GadgletResponse();
    GadgletRequestWrapper platformRequestWrapper = new GadgletRequestWrapper(
        httpServletRequest);
    boolean userIsValid = true;
    UserProfile userProfile = null;

    if (!(platformRequestWrapper.getParameter("ignoreJson") != null && UrlUtils
        .isOnDevPort8888(platformRequestWrapper)))
      setResponseHeaders(httpServletResponse);

    try {
      if (platformRequestWrapper.getOpenSocialConsumerKey() == null) {
        log.warning("oauth_consumer_key is null");
        throw new RequestException(ReqErrorTypes.UNSUPPORETED_PLATFORM);
      }
      if (platformRequestWrapper.getOpenSocialViewerId() == null) {
        log.warning("opensocial_viewer_id is null");
        throw new RequestException(ReqErrorTypes.USER_NOT_LOGGEDIN);
      }

      if (!UrlUtils.isOnDevPort8888(platformRequestWrapper)
          && !validateSignedRequestWithContainer(platformRequestWrapper)) {
        throw new RequestException(ReqErrorTypes.USER_NOT_LOGGEDIN);
      }

      if (platformRequestWrapper.getCurrentUserProfile() != null){
        // check if user changed in session the middle ?
        userProfile = platformRequestWrapper.getCurrentUserProfile();
       
        if(!userProfile.getOpenSocialViewerId().equals(platformRequestWrapper.getOpenSocialViewerId()))
          platformRequestWrapper.getSession().setAttribute(
              "userProfile", null);
      }
     
      if (platformRequestWrapper.getCurrentUserProfile() == null) {
View Full Code Here

   */
  @Override
  public void getProfile(GadgletRequestWrapper request, GadgletResponse res)
      throws Exception {

    UserProfile profile = null;
    try {

      profile = UserProfilesUtils.getMyProfile(request);

      ContentRecord profileRecord = res.newItem();

      profileRecord.addItemField(
          ProfileFields.PROFILE_NICKNAME.getParamName(),
          profile.getNickName());
      profileRecord.addItemField(
          ProfileFields.PROFILE_PRIVACY.getParamName(),
          profile.getVisibilityStatus().getPrivacyStatus());
      profileRecord.addItemField(
          ProfileFields.PROFILE_THUMBNAILURL.getParamName(),
          profile.getPhotoUrl());

    } catch (Exception e) {

      throw e;
    }
View Full Code Here

        ContentRecord record  = res.newItem();
       
        record.addItemKeyField(friends.getFriendId(request.getCurrentUserProfileId()));
       
       
        UserProfile profile = UserProfilesUtils.getProfileById(friends.getFriendId(request.getCurrentUserProfileId()));
       
        if(profile!=null && !profile.isPrivate()){
          record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(), profile.getNickName());
          if( profile.getPhotoUrl()!=null &&  profile.getPhotoUrl().length()>0)
            record.addItemField(ProfileFields.PROFILE_THUMBNAILURL.getParamName(), profile.getPhotoUrl());
        }
             
        record.setContentName("myFriends");
       
        record.setGadgetPermissions(false, false, false);
View Full Code Here

       
        ContentRecord record  = res.newItem();
       
        record.addItemKeyField(invitation.getInvitationId());
        record.addItemField(ProfileFields.PROFILE_INVITED_BY.getParamName(), invitation.getInvitedBy());
        UserProfile profile = UserProfilesUtils.getProfileById(invitation.getInvitedBy());
       
        if(profile!=null && !profile.isPrivate()){
          record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(), profile.getNickName());
          if( profile.getPhotoUrl()!=null &&  profile.getPhotoUrl().length()>0)
            record.addItemField(ProfileFields.PROFILE_THUMBNAILURL.getParamName(), profile.getPhotoUrl());

        }
        else
          record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(),ProfPrivacyStatus.PRIVATE.getPrivacyStatus());
       
        record.setContentName("myPendingInvitatos");
       
        record.setGadgetPermissions(false, false, false);
      }
     
      for(FriendsInvitation invitation: platformInvitations){
       
        ContentRecord record  = res.newItem();
       
        record.addItemKeyField(invitation.getInvitationId());
        record.addItemField(ProfileFields.PROFILE_INVITED_BY.getParamName(), invitation.getInvitedBy());
        UserProfile profile = UserProfilesUtils.getProfileById(invitation.getInvitedBy());
       
        if(profile!=null && !profile.isPrivate()){
          record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(), profile.getNickName());
          if( profile.getPhotoUrl()!=null &&  profile.getPhotoUrl().length()>0)
            record.addItemField(ProfileFields.PROFILE_THUMBNAILURL.getParamName(), profile.getPhotoUrl());
        }
        else
          record.addItemField(ProfileFields.PROFILE_NICKNAME.getParamName(),ProfPrivacyStatus.PRIVATE.getPrivacyStatus());
               
        record.setContentName("myPendingInvitatos");
View Full Code Here

TOP

Related Classes of com.gadglet.data.UserProfile

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.