Package com.liferay.portal.model

Examples of com.liferay.portal.model.Group


    throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
      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


    throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
      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

    throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
      WebKeys.THEME_DISPLAY);

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

    if (group.getType() == GroupConstants.TYPE_COMMUNITY_OPEN) {
      UserLocalServiceUtil.addGroupUsers(
        group.getGroupId(), new long[] {themeDisplay.getUserId()});
    }
    else {
      Role role = RoleLocalServiceUtil.getRole(
        themeDisplay.getCompanyId(), "Community Administrator");

      LinkedHashMap<String, Object> userParams =
        new LinkedHashMap<String, Object>();

      userParams.put(
        "userGroupRole",
        new Long[] {new Long(group.getGroupId()),
        new Long(role.getRoleId())});

      List<User> users = UserLocalServiceUtil.search(
        themeDisplay.getCompanyId(), null, Boolean.TRUE, userParams,
        QueryUtil.ALL_POS, QueryUtil.ALL_POS, (OrderByComparator) null);

      for (User user : users) {
        SocialRequestLocalServiceUtil.addRequest(
          themeDisplay.getUserId(), 0, Group.class.getName(),
          group.getGroupId(), MembersRequestKeys.ADD_MEMBER,
          StringPool.BLANK, user.getUserId());
      }
    }
  }
View Full Code Here

    throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
      WebKeys.THEME_DISPLAY);

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

    Organization organization =
      OrganizationLocalServiceUtil.getOrganization(group.getClassPK());

    Role role = RoleLocalServiceUtil.getRole(
      themeDisplay.getCompanyId(), "Organization Administrator");

    LinkedHashMap<String, Object> userParams =
      new LinkedHashMap<String, Object>();

    userParams.put(
      "userGroupRole",
      new Long[] {new Long(group.getGroupId()),
      new Long(role.getRoleId())});

    List<User> users = UserLocalServiceUtil.search(
      themeDisplay.getCompanyId(), null, Boolean.TRUE, userParams,
      QueryUtil.ALL_POS, QueryUtil.ALL_POS, (OrderByComparator) null);
View Full Code Here

    throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
      WebKeys.THEME_DISPLAY);

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

    UserLocalServiceUtil.unsetOrganizationUsers(
      group.getClassPK(), new long[] {themeDisplay.getUserId()});
  }
View Full Code Here

    if (!themeDisplay.isSignedIn()) {
      return;
    }

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

    User user = null;

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

      ThemeDisplay themeDisplay)
    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");

    wallEntryPersistence.update(wallEntry, false);

    // Email

    try {
      sendEmail(wallEntry, themeDisplay);
    }
    catch (Exception e) {
      throw new SystemException(e);
    }

    // Social

    if (userId != group.getClassPK()) {
      SocialActivityLocalServiceUtil.addActivity(
        userId, groupId, WallEntry.class.getName(), wallEntryId,
        WallActivityKeys.ADD_ENTRY, StringPool.BLANK,
        group.getClassPK());
    }

    return wallEntry;
  }
View Full Code Here

    String portalURL = PortalUtil.getPortalURL(themeDisplay);
    String layoutURL = PortalUtil.getLayoutURL(themeDisplay);

    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");
View Full Code Here

    if (!themeDisplay.isSignedIn()) {
      return;
    }

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

    User user = null;

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

    if (wallEntry.getGroupId() != themeDisplay.getScopeGroupId()) {
      return;
    }

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

    User user = null;

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

TOP

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

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.