コード例 #1
0
  protected String getGroupURL(
      Group group, PortletRequest portletRequest, boolean includeStagingGroup) {

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

    String groupDisplayURL = group.getDisplayURL(themeDisplay, false);

    if (Validator.isNotNull(groupDisplayURL)) {
      return HttpUtil.removeParameter(groupDisplayURL, "p_p_id");
    }

    groupDisplayURL = group.getDisplayURL(themeDisplay, true);

    if (Validator.isNotNull(groupDisplayURL)) {
      return HttpUtil.removeParameter(groupDisplayURL, "p_p_id");
    }

    if (includeStagingGroup && group.hasStagingGroup()) {
      try {
        if (GroupPermissionUtil.contains(
            themeDisplay.getPermissionChecker(), group, ActionKeys.VIEW_STAGING)) {

          return getGroupURL(group.getStagingGroup(), portletRequest);
        }
      } catch (PortalException pe) {
        _log.error("Unable to check permission on group " + group.getGroupId(), pe);
      }
    }

    return getGroupAdministrationURL(group, portletRequest);
  }
コード例 #2
0
    @Override
    public Void call() throws PortalException {
      Group group = _groupLocalService.getGroup(_groupId);

      Date endDate = null;

      if (_dateRange != null) {
        endDate = _dateRange.getEndDate();
      }

      if (group.hasStagingGroup()) {
        Group stagingGroup = group.getStagingGroup();

        ExportImportDateUtil.updateLastPublishDate(
            stagingGroup.getGroupId(), _privateLayout, _dateRange, endDate);
      } else {
        ExportImportDateUtil.updateLastPublishDate(_groupId, _privateLayout, _dateRange, endDate);
      }

      return null;
    }