Package org.olat.core.util.notifications.items

Examples of org.olat.core.util.notifications.items.SubscriptionListItem


        DialogPropertyElements elements = mgr.findDialogElements(p.getResId(), p.getSubidentifier());
        final List<DialogElement> dialogElements = elements.getDialogPropertyElements();
        final Translator translator = Util.createPackageTranslator(FileUploadNotificationHandler.class, locale);

        si = new SubscriptionInfo(new TitleItem(translator.translate("notifications.header", new String[]{displayname}), CSSS_CLASS_UPLOAD_ICON), null);
        SubscriptionListItem subListItem;
        for (DialogElement element : dialogElements) {
          // do only show entries newer then the ones already seen
          if (element.getDate().after(compareDate)) {
            String filename = element.getFilename();
            String creator = element.getAuthor();
            Identity ident = ManagerFactory.getManager().findIdentityByName(creator);
            Date modDate = element.getDate();

            String desc = translator.translate("notifications.entry", new String[] { filename, NotificationHelper.getFormatedName(ident) });
            String urlToSend = NotificationHelper.getURLFromBusinessPathString(p, p.getBusinessPath());
            String cssClass = CSSHelper.createFiletypeIconCssClassFor(filename);

            subListItem = new SubscriptionListItem(desc, urlToSend, modDate, cssClass);
            si.addSubscriptionListItem(subListItem);
          }
        }
      } else {
        si = NotificationsManager.getInstance().getNoSubscriptionInfo();
View Full Code Here


          String urlToSend = null;
          if(p.getBusinessPath() != null) {
            urlToSend = NotificationHelper.getURLFromBusinessPathString(p, businessControlString + mInfo.getKey().toString() + "]");
          }
         
          SubscriptionListItem subListItem = new SubscriptionListItem(desc, urlToSend, modDate, ForumHelper.CSS_ICON_CLASS_MESSAGE);
          si.addSubscriptionListItem(subListItem);
        }
      } else {
        si = NotificationsManager.getInstance().getNoSubscriptionInfo();
      }
View Full Code Here

        final List<WikiPage> pages = wiki.getPagesByDate();
        Translator translator = Util.createPackageTranslator(WikiPageChangeOrCreateNotificationHandler.class, locale);
       
        TitleItem title = getTitleItem(p, translator);
        si = new SubscriptionInfo(title, null);
          SubscriptionListItem subListItem;
            for (Iterator<WikiPage> it = pages.listIterator(); it.hasNext();) {           
              WikiPage element = it.next();
             
              // do only show entries newer then the ones already seen
              Date modDate = new Date(element.getModificationTime());
              logDebug("modDate=" + modDate + " ; compareDate=" + compareDate, null);
              if (modDate.after(compareDate)) {
                if((element.getPageName().startsWith("O_") || element.getPageName().startsWith(WikiPage.WIKI_MENU_PAGE)) &&
                    (element.getModifyAuthor() <= 0)) {
                    //theses pages are created sometimes automatically. Check if this is the case
                    continue;
                }

                //build Businesscontrol-Path           
                String bControlString = businessControlString + element.getPageName() + "]";           
                String urlToSend = null;
                if(p.getBusinessPath() != null) {
                  urlToSend = NotificationHelper.getURLFromBusinessPathString(p, bControlString);
                }
               
                // string[] gets filled into translation key by adding {0...n} to
                // the string
                Identity ident = ManagerFactory.getManager().loadIdentityByKey(Long.valueOf(element.getModifyAuthor()));
                String desc = translator.translate("notifications.entry", new String[] { element.getPageName(), NotificationHelper.getFormatedName(ident)});             
                subListItem = new SubscriptionListItem(desc, urlToSend, modDate, CSS_CLASS_WIKI_PAGE_CHANGED_ICON);
                si.addSubscriptionListItem(subListItem);
              } else {
                //there are no more new pages so we stop here
                break;
              }
View Full Code Here

                String urlToSend = null;
                if(p.getBusinessPath() != null) {
                  String businessPath = p.getBusinessPath() + "[assessmentTool:0][Identity:" + qrs.getIdentity().getKey() + "][CourseNode:" + test.getIdent() + "]";
                  urlToSend = NotificationHelper.getURLFromBusinessPathString(p, businessPath);
                }
                SubscriptionListItem subListItem = new SubscriptionListItem(desc, urlToSend, modDate, CSS_CLASS_USER_ICON);
                si.addSubscriptionListItem(subListItem);
              }
            }
          }
        }
View Full Code Here

            return NotificationsManager.getInstance().getNoSubscriptionInfo();
          }
        }
       
        si = new SubscriptionInfo(new TitleItem(translator.translate(getNotificationHeaderKey(), new String[]{displayName}), getCssClassIcon() ), null);
        SubscriptionListItem subListItem;
        for (Iterator<FileInfo> it_infos = fInfos.iterator(); it_infos.hasNext();) {
              FileInfo fi = it_infos.next();
              MetaInfo metaInfo = fi.getMetaInfo();
              String filePath = fi.getRelPath();
              if(isLogDebugEnabled()) logDebug("filePath=", filePath);
              String fullUserName = getUserNameFromFilePath(filePath);
             
              Date modDate = fi.getLastModified();
              String desc = translator.translate(getNotificationEntryKey(), new String[] { filePath, fullUserName });
              String urlToSend = NotificationHelper.getURLFromBusinessPathString(p, p.getBusinessPath());
             
              String iconCssClass =  null;
              if (metaInfo != null) {
                iconCssClass = metaInfo.getIconCssClass();
              }
              subListItem = new SubscriptionListItem(desc, urlToSend, modDate, iconCssClass);
              si.addSubscriptionListItem(subListItem);           
            }
      } else {
        si = NotificationsManager.getInstance().getNoSubscriptionInfo();
      }
View Full Code Here

        if (identities.isEmpty()) {
          si = NotificationsManager.getInstance().getNoSubscriptionInfo();
        } else {
          translator = Util.createPackageTranslator(this.getClass(), locale);
          si = new SubscriptionInfo(new TitleItem(getItemTitle(translator), CSSHelper.CSS_CLASS_GROUP), null);
          SubscriptionListItem subListItem;
          for (Identity newUser : identities) {
            String desc = translator.translate("notifications.entry", new String[] { NotificationHelper.getFormatedName(newUser) });
            String businessPath = "[Identity:" + newUser.getKey() + "]";
            String urlToSend = NotificationHelper.getURLFromBusinessPathString(p, businessPath);
            Date modDate = newUser.getCreationDate();
            subListItem = new SubscriptionListItem(desc, urlToSend, modDate, CSSHelper.CSS_CLASS_USER);
            si.addSubscriptionListItem(subListItem);
          }
        }
      } else {
        si = NotificationsManager.getInstance().getNoSubscriptionInfo();
View Full Code Here

          final List<DENCourseNode> denNodes = getCourseDENNodes(course);
          final Translator trans = Util.createPackageTranslator(DENCourseNodeNotificationHandler.class, locale);

          String cssClass = new DENCourseNodeConfiguration().getIconCSSClass();
          si = new SubscriptionInfo(new TitleItem(trans.translate("notifications.header", new String[]{course.getCourseTitle()}), cssClass), null);
          SubscriptionListItem subListItem;

          for (DENCourseNode denNode : denNodes) {
            String changer = "";
            String desc = trans.translate("notifications.entry", new String[] { denNode.getLongTitle(), changer });

            Date modDate = new Date();
            subListItem = new SubscriptionListItem(desc, null, modDate, cssClass);
            si.addSubscriptionListItem(subListItem);
          }
        }
      } else {
        si = NotificationsManager.getInstance().getNoSubscriptionInfo();
View Full Code Here

        String folderRoot = p.getData();
        final List<FileInfo> fInfos = FolderManager.getFileInfos(folderRoot, compareDate);
        final Translator translator = Util.createPackageTranslator(FolderNotificationsHandler.class, locale);

        si = new SubscriptionInfo(getTitleItem(p, translator), null);
        SubscriptionListItem subListItem;
        for (Iterator<FileInfo> it_infos = fInfos.iterator(); it_infos.hasNext();) {
          FileInfo fi = it_infos.next();
          String title = fi.getRelPath();
          MetaInfo metaInfo = fi.getMetaInfo();
          String iconCssClass =  null;
          if (metaInfo != null) {
            if (metaInfo.getTitle() != null) {
              title += " (" + metaInfo.getTitle() + ")";
            }
            iconCssClass = metaInfo.getIconCssClass();
          }
          Identity ident = fi.getAuthor();
          Date modDate = fi.getLastModified();

          String desc = translator.translate("notifications.entry", new String[] { title, NotificationHelper.getFormatedName(ident) });
          String urlToSend = null;
          if(p.getBusinessPath() != null) {
            urlToSend = NotificationHelper.getURLFromBusinessPathString(p, businessPath + fi.getRelPath() + "]");
          }
          subListItem = new SubscriptionListItem(desc, urlToSend, modDate, iconCssClass);
          si.addSubscriptionListItem(subListItem);
        }
      } else {
        si = NotificationsManager.getInstance().getNoSubscriptionInfo();
      }
View Full Code Here

                dateStr = form.formatDate(kalendarEvent.getBegin()) + " - " + form.formatDate(kalendarEvent.getEnd());
              }
              String desc = translator.translate("cal.notifications.entry", new String[] { subject, dateStr, location });
              String businessPath = bPath + "[path=" + kalendarEvent.getID() + ":0]";
              String urlToSend = NotificationHelper.getURLFromBusinessPathString(p, businessPath);
              SubscriptionListItem subListItem = new SubscriptionListItem(desc, urlToSend, modDate, CSS_CLASS_CALENDAR_ICON);
              si.addSubscriptionListItem(subListItem);
            }
          }
        }
      } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.olat.core.util.notifications.items.SubscriptionListItem

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.