/**
   * Constructor
   *
   * @param ureq
   * @param component
   */
  public NotificationsPortletRunController(
      WindowControl wControl,
      UserRequest ureq,
      Translator trans,
      String portletName,
      int defaultMaxEntries) {
    super(wControl, ureq, trans, portletName, defaultMaxEntries);

    sortingTermsList.add(SortingCriteria.TYPE_SORTING);
    sortingTermsList.add(SortingCriteria.ALPHABETICAL_SORTING);
    sortingTermsList.add(SortingCriteria.DATE_SORTING);

    this.notificationsVC = this.createVelocityContainer("notificationsPortlet");
    showAllLink = LinkFactory.createLink("notificationsPortlet.showAll", notificationsVC, this);
    showAllLink.setIconRightCSS("o_icon o_icon_start");

    TableGuiConfiguration tableConfig = new TableGuiConfiguration();
    tableConfig.setTableEmptyMessage(trans.translate("notificationsPortlet.nonotifications"));
    tableConfig.setDisplayTableHeader(false);
    tableConfig.setCustomCssClass("o_portlet_table");
    tableConfig.setDisplayRowCount(false);
    tableConfig.setPageingEnabled(false);
    tableConfig.setDownloadOffered(false);
    // disable the default sorting for this table
    tableConfig.setSortingEnabled(false);
    tableCtr = new TableController(tableConfig, ureq, getWindowControl(), trans);
    listenTo(tableCtr);

    // dummy header key, won't be used since setDisplayTableHeader is set to false
    tableCtr.addColumnDescriptor(
        new DefaultColumnDescriptor(
            "notificationsPortlet.bgname", 0, CMD_LAUNCH, trans.getLocale()));
    tableCtr.addColumnDescriptor(
        new DefaultColumnDescriptor(
            "notificationsPortlet.type",
            1,
            null,
            trans.getLocale(),
            ColumnDescriptor.ALIGNMENT_RIGHT));

    this.sortingCriteria = getPersistentSortingConfiguration(ureq);
    man = NotificationsManager.getInstance();
    // default use the interval
    compareDate = man.getCompareDateFromInterval(man.getUserIntervalOrDefault(ureq.getIdentity()));
    reloadModel(sortingCriteria);

    this.notificationsVC.put("table", tableCtr.getInitialComponent());
    // notify us whenever we will be shown on screen shortly, so that we can reload the model if we
    // received a subscription changed event in the meantime
    ComponentUtil.registerForValidateEvents(notificationsVC, this);

    putInitialPanel(notificationsVC);

    man.registerAsListener(this, ureq.getIdentity());
  }