Package com.liferay.portal.model

Examples of com.liferay.portal.model.User


      WebKeys.THEME_DISPLAY);

    Group group = GroupLocalServiceUtil.getGroup(
      themeDisplay.getScopeGroupId());

    User user = UserLocalServiceUtil.getUserById(group.getClassPK());

    SocialRequestLocalServiceUtil.addRequest(
      themeDisplay.getUserId(), 0, User.class.getName(),
      themeDisplay.getUserId(), FriendsRequestKeys.ADD_FRIEND,
      StringPool.BLANK, user.getUserId());
  }
View Full Code Here


      WebKeys.THEME_DISPLAY);

    Group group = GroupLocalServiceUtil.getGroup(
      themeDisplay.getScopeGroupId());

    User user = UserLocalServiceUtil.getUserById(group.getClassPK());

    SocialRelationLocalServiceUtil.deleteRelation(
      themeDisplay.getUserId(), user.getUserId(),
      SocialRelationConstants.TYPE_BI_FRIEND);
  }
View Full Code Here

    }

    Group group = GroupLocalServiceUtil.getGroup(
      themeDisplay.getScopeGroupId());

    User user = null;

    if (group.isUser()) {
      user = UserLocalServiceUtil.getUserById(group.getClassPK());
    }
    else {
      return;
    }

    if (!UserPermissionUtil.contains(
        themeDisplay.getPermissionChecker(), user.getUserId(),
        ActionKeys.UPDATE)) {

      return;
    }

    String jobTitle = ParamUtil.getString(actionRequest, "jobTitle");
    String aboutMe = ParamUtil.getString(actionRequest, "aboutMe");

    try {
      ExpandoValueLocalServiceUtil.addValue(
        themeDisplay.getCompanyId(), User.class.getName(), "SN",
        "aboutMe", user.getUserId(), aboutMe);

      Contact contact = user.getContact();

      contact.setJobTitle(jobTitle);

      ContactLocalServiceUtil.updateContact(contact);
    }
View Full Code Here

    throws PortalException, SystemException {

    // Wall entry

    Group group = GroupLocalServiceUtil.getGroup(groupId);
    User user = userLocalService.getUserById(userId);
    Date now = new Date();

    long wallEntryId = counterLocalService.increment();

    WallEntry wallEntry = wallEntryPersistence.create(wallEntryId);

    wallEntry.setGroupId(groupId);
    wallEntry.setCompanyId(user.getCompanyId());
    wallEntry.setUserId(user.getUserId());
    wallEntry.setUserName(user.getFullName());
    wallEntry.setCreateDate(now);
    wallEntry.setModifiedDate(now);
    wallEntry.setComments(comments);
    wallEntry.setPostFromIpAddress("127.0.0.1");
View Full Code Here

    String wallEntryURL = portalURL + layoutURL;

    Group group = GroupLocalServiceUtil.getGroup(wallEntry.getGroupId());

    User user = userLocalService.getUserById(group.getClassPK());
    User wallEntryUser = userLocalService.getUserById(
      wallEntry.getUserId());

    String fromName = PrefsPropsUtil.getString(
      companyId, "admin.email.from.name");
    String fromAddress = PrefsPropsUtil.getString(
      companyId, "admin.email.from.address");

    String toName = user.getFullName();
    String toAddress = user.getEmailAddress();

    ClassLoader classLoader = getClass().getClassLoader();

    String subject = StringUtil.read(
      classLoader,
      "com/liferay/socialnetworking/wall/dependencies/" +
        "wall_entry_added_subject.tmpl");
    String body = StringUtil.read(
      classLoader,
      "com/liferay/socialnetworking/wall/dependencies/" +
        "wall_entry_added_body.tmpl");

    subject = StringUtil.replace(
      subject,
      new String[] {
        "[$FROM_ADDRESS$]",
        "[$FROM_NAME$]",
        "[$TO_ADDRESS$]",
        "[$TO_NAME$]",
        "[$WALL_ENTRY_URL$]",
        "[$WALL_ENTRY_USER_ADDRESS$]",
        "[$WALL_ENTRY_USER_NAME$]"
      },
      new String[] {
        fromAddress,
        fromName,
        toAddress,
        toName,
        wallEntryURL,
        wallEntryUser.getEmailAddress(),
        wallEntryUser.getFullName()
      });

    body = StringUtil.replace(
      body,
      new String[] {
        "[$FROM_ADDRESS$]",
        "[$FROM_NAME$]",
        "[$TO_ADDRESS$]",
        "[$TO_NAME$]",
        "[$WALL_ENTRY_URL$]",
        "[$WALL_ENTRY_USER_ADDRESS$]",
        "[$WALL_ENTRY_USER_NAME$]"
      },
      new String[] {
        fromAddress,
        fromName,
        toAddress,
        toName,
        wallEntryURL,
        wallEntryUser.getEmailAddress(),
        wallEntryUser.getFullName()
      });

    InternetAddress from = new InternetAddress(fromAddress, fromName);

    InternetAddress to = new InternetAddress(toAddress, toName);
View Full Code Here

      int endDateYear, int endDateHour, int endDateMinute,
      int totalAttendees, int maxAttendees, double price,
      byte[] thumbnail)
    throws PortalException, SystemException {

    User user = userLocalService.getUserById(userId);

    Date startDate = PortalUtil.getDate(
      startDateMonth, startDateDay, startDateYear, startDateHour,
      startDateMinute, user.getTimeZone(),
      new MeetupsEntryStartDateException());

    Date endDate = PortalUtil.getDate(
      endDateMonth, endDateDay, endDateYear, endDateHour,
      endDateMinute, user.getTimeZone(),
      new MeetupsEntryEndDateException());

    Date now = new Date();

    long meetupsEntryId = counterLocalService.increment();

    MeetupsEntry meetupsEntry = meetupsEntryPersistence.create(
      meetupsEntryId);

    meetupsEntry.setCompanyId(user.getCompanyId());
    meetupsEntry.setUserId(user.getUserId());
    meetupsEntry.setUserName(user.getFullName());
    meetupsEntry.setCreateDate(now);
    meetupsEntry.setModifiedDate(now);
    meetupsEntry.setTitle(title);
    meetupsEntry.setDescription(description);
    meetupsEntry.setStartDate(startDate);
View Full Code Here

      int endDateDay, int endDateYear, int endDateHour, int endDateMinute,
      int totalAttendees, int maxAttendees, double price,
      byte[] thumbnail)
    throws PortalException, SystemException {

    User user = userLocalService.getUserById(userId);

    Date startDate = PortalUtil.getDate(
      startDateMonth, startDateDay, startDateYear, startDateHour,
      startDateMinute, user.getTimeZone(),
      new MeetupsEntryStartDateException());

    Date endDate = PortalUtil.getDate(
      endDateMonth, endDateDay, endDateYear, endDateHour,
      endDateMinute, user.getTimeZone(),
      new MeetupsEntryEndDateException());

    MeetupsEntry meetupsEntry = meetupsEntryPersistence.findByPrimaryKey(
      meetupsEntryId);
View Full Code Here

  public MeetupsRegistration updateMeetupsRegistration(
      long userId, long meetupsEntryId, int status, String comments)
    throws PortalException, SystemException {

    User user = userLocalService.getUserById(userId);
    Date now = new Date();

    MeetupsRegistration meetupsRegistration =
      meetupsRegistrationPersistence.fetchByU_ME(
        userId, meetupsEntryId);

    if (meetupsRegistration == null) {
      long meetupsRegistrationId = counterLocalService.increment();

      meetupsRegistration = meetupsRegistrationPersistence.create(
        meetupsRegistrationId);

      meetupsRegistration.setCompanyId(user.getCompanyId());
      meetupsRegistration.setUserId(user.getUserId());
      meetupsRegistration.setUserName(user.getFullName());
      meetupsRegistration.setCreateDate(now);
      meetupsRegistration.setMeetupsEntryId(meetupsEntryId);
    }

    meetupsRegistration.setModifiedDate(now);
View Full Code Here

    }

    Group group = GroupLocalServiceUtil.getGroup(
      themeDisplay.getScopeGroupId());

    User user = null;

    if (group.isUser()) {
      user = UserLocalServiceUtil.getUserById(group.getClassPK());
    }
    else {
      return;
    }

    if ((themeDisplay.getUserId() != user.getUserId()) &&
      (!SocialRelationLocalServiceUtil.hasRelation(
        themeDisplay.getUserId(), user.getUserId(),
        SocialRelationConstants.TYPE_BI_FRIEND))) {

      return;
    }
View Full Code Here

    }

    Group group = GroupLocalServiceUtil.getGroup(
      themeDisplay.getScopeGroupId());

    User user = null;

    if (group.isUser()) {
      user = UserLocalServiceUtil.getUserById(group.getClassPK());
    }
    else {
      return;
    }

    if (!UserPermissionUtil.contains(
        themeDisplay.getPermissionChecker(), user.getUserId(),
        ActionKeys.UPDATE)) {

      return;
    }
View Full Code Here

TOP

Related Classes of com.liferay.portal.model.User

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.