contentNotification = new CmsContentNotification(responsible, m_cms); result.put(responsible, contentNotification); List<CmsExtendedNotificationCause> resourcesForResponsible = contentNotification.getNotificationCauses(); if (resourcesForResponsible == null) { resourcesForResponsible = new ArrayList<CmsExtendedNotificationCause>(); contentNotification.setNotificationCauses(resourcesForResponsible);
m_messages = Messages.get().getBundle(getLocale()); Collections.sort(resourcesNextWeek); Collections.sort(outdatedResources); appendResourceList(htmlMsg, resourcesNextDay, m_messages.key(Messages.GUI_WITHIN_NEXT_DAY_0)); appendResourceList(htmlMsg, resourcesNextWeek, m_messages.key(Messages.GUI_WITHIN_NEXT_WEEK_0)); appendResourceList(htmlMsg, outdatedResources, m_messages.key( Messages.GUI_FILES_NOT_UPDATED_1, String.valueOf(OpenCms.getSystemInfo().getNotificationTime())));
/** * Appends a table showing a set of resources, and the cause of the notification.<p> * * @param htmlMsg html the StringBuffer to append the html code to * @param notificationCauseList the list of notification causes * @param header the title of the resource list */ private void appendResourceList( StringBuffer htmlMsg, List<CmsExtendedNotificationCause> notificationCauseList, String header) { if (!notificationCauseList.isEmpty()) { htmlMsg.append("<tr><td colspan=\"5\"><br/><p style=\"margin-top:20px;margin-bottom:10px;\"><b>"); htmlMsg.append(header); htmlMsg.append( "</b></p></td></tr><tr class=\"trow1\"><td><div style=\"padding-top:2px;padding-bottom:2px;\">"); htmlMsg.append(m_messages.key(Messages.GUI_RESOURCE_0)); htmlMsg.append("</div></td><td><div style=\"padding-top:2px;padding-bottom:2px;padding-left:10px;\">"); htmlMsg.append(m_messages.key(Messages.GUI_SITE_0)); htmlMsg.append("</div></td><td><div style=\"padding-top:2px;padding-bottom:2px;padding-left:10px;\">"); htmlMsg.append(m_messages.key(Messages.GUI_ISSUE_0)); htmlMsg.append("</div></td><td colspan=\"2\"/></tr>"); Iterator<CmsExtendedNotificationCause> notificationCauses = notificationCauseList.iterator(); for (int i = 0; notificationCauses.hasNext(); i++) { CmsExtendedNotificationCause notificationCause = notificationCauses.next(); htmlMsg.append(buildNotificationListItem(notificationCause, (i % 2) + 2)); } } }
while (notifications.hasNext()) { CmsContentNotification contentNotification = (CmsContentNotification)notifications.next(); CmsUser responsible = contentNotification.getResponsible(); List notificationCandidates = contentNotification.getNotificationCauses(); contentNotification.setNotificationCauses(notificationResources);
result.append(m_messages.key(Messages.GUI_EXPIRES_AT_1, new Object[] {notificationCause.getDate()})); result.append("</div></td>"); appendConfirmLink(result, notificationCause); appendModifyLink(result, notificationCause); } else if (notificationCause.getCause() == CmsExtendedNotificationCause.RESOURCE_RELEASE) { result.append(m_messages.key(Messages.GUI_RELEASE_AT_1, new Object[] {notificationCause.getDate()})); result.append("</div></td>"); appendConfirmLink(result, notificationCause); appendModifyLink(result, notificationCause); } else if (notificationCause.getCause() == CmsExtendedNotificationCause.RESOURCE_UPDATE_REQUIRED) { result.append(m_messages.key(Messages.GUI_UPDATE_REQUIRED_1, new Object[] {notificationCause.getDate()})); result.append("</div></td>"); appendConfirmLink(result, notificationCause); appendEditLink(result, notificationCause); } else { result.append(m_messages.key(Messages.GUI_UNCHANGED_SINCE_1, new Object[] {new Integer( CmsDateUtil.getDaysPassedSince(notificationCause.getDate()))})); result.append("</div></td>"); appendConfirmLink(result, notificationCause); appendEditLink(result, notificationCause);
if (existsEditor(notificationCause.getResource())) { try { String resourcePath = notificationCause.getResource().getRootPath(); resourcePath = resourcePath.substring(siteRoot.length()); Map<String, String[]> params = new HashMap<String, String[]>(); CmsUUID projectId = getCmsObject().readProject( OpenCms.getSystemInfo().getNotificationProject()).getUuid(); params.put(CmsWorkplace.PARAM_WP_PROJECT, new String[] {String.valueOf(projectId)});
params.put(CmsFrameset.PARAM_WP_START, wpStartUri.toString()); params.put(CmsWorkplace.PARAM_WP_SITE, siteRoot); CmsUUID projectId = getCmsObject().readProject(OpenCms.getSystemInfo().getNotificationProject()).getUuid(); params.put(CmsWorkplace.PARAM_WP_PROJECT, String.valueOf(projectId)); buf.append(CmsRequestUtil.appendParameters(m_uriWorkplaceJsp, params, true));
while (notifications.hasNext()) { CmsContentNotification contentNotification = notifications.next(); CmsUser responsible = contentNotification.getResponsible(); List<CmsExtendedNotificationCause> notificationCandidates = contentNotification.getNotificationCauses(); contentNotification.setNotificationCauses(notificationResources);
result.append(m_messages.key(Messages.GUI_EXPIRES_AT_1, new Object[] {notificationCause.getDate()})); result.append("</div></td>"); appendConfirmLink(result, notificationCause); appendModifyLink(result, notificationCause); } else if (notificationCause.getCause() == CmsExtendedNotificationCause.RESOURCE_RELEASE) { result.append(m_messages.key(Messages.GUI_RELEASE_AT_1, new Object[] {notificationCause.getDate()})); result.append("</div></td>"); appendConfirmLink(result, notificationCause); appendModifyLink(result, notificationCause); } else if (notificationCause.getCause() == CmsExtendedNotificationCause.RESOURCE_UPDATE_REQUIRED) { result.append(m_messages.key(Messages.GUI_UPDATE_REQUIRED_1, new Object[] {notificationCause.getDate()})); result.append("</div></td>"); appendConfirmLink(result, notificationCause); appendEditLink(result, notificationCause); } else { result.append(m_messages.key( new Object[] {new Integer(CmsDateUtil.getDaysPassedSince(notificationCause.getDate()))})); result.append("</div></td>"); appendConfirmLink(result, notificationCause); appendEditLink(result, notificationCause);
if (existsEditor(notificationCause.getResource())) { try { String resourcePath = notificationCause.getResource().getRootPath(); resourcePath = resourcePath.substring(siteRoot.length()); Map params = new HashMap(); CmsUUID projectId = getCmsObject().readProject(OpenCms.getSystemInfo().getNotificationProject()).getUuid(); params.put(CmsWorkplace.PARAM_WP_PROJECT, String.valueOf(projectId)); params.put(CmsWorkplace.PARAM_WP_EXPLORER_RESOURCE, CmsResource.getParentFolder(resourcePath));
params.put(CmsWorkplace.PARAM_WP_START, new String[] {wpStartUri.toString()}); params.put(CmsWorkplace.PARAM_WP_SITE, new String[] {siteRoot}); CmsUUID projectId = getCmsObject().readProject(OpenCms.getSystemInfo().getNotificationProject()).getUuid(); params.put(CmsWorkplace.PARAM_WP_PROJECT, new String[] {String.valueOf(projectId)}); buf.append(CmsRequestUtil.appendParameters(m_uriWorkplaceJsp, params, true));
contentNotification = new CmsContentNotification(responsible, m_cms); result.put(responsible, contentNotification); List resourcesForResponsible = contentNotification.getNotificationCauses(); if (resourcesForResponsible == null) { resourcesForResponsible = new ArrayList(); contentNotification.setNotificationCauses(resourcesForResponsible);
m_messages = Messages.get().getBundle(getLocale()); Collections.sort(resourcesNextWeek); Collections.sort(outdatedResources); appendResourceList(htmlMsg, resourcesNextDay, m_messages.key(Messages.GUI_WITHIN_NEXT_DAY_0)); appendResourceList(htmlMsg, resourcesNextWeek, m_messages.key(Messages.GUI_WITHIN_NEXT_WEEK_0)); appendResourceList( htmlMsg, outdatedResources,
params.put(CmsWorkplace.PARAM_WP_EXPLORER_RESOURCE, CmsResource.getParentFolder(resourcePath)); params.put(CmsWorkplace.PARAM_WP_SITE, siteRoot); CmsUUID projectId = getCmsObject().readProject(OpenCms.getSystemInfo().getNotificationProject()).getUuid(); params.put(CmsWorkplace.PARAM_WP_PROJECT, String.valueOf(projectId)); buf.append(CmsRequestUtil.appendParameters(m_uriWorkplaceJsp, params, true));
/** * Appends a table showing a set of resources, and the cause of the notification.<p> * * @param htmlMsg html the StringBuffer to append the html code to * @param notificationCauseList the list of notification causes * @param header the title of the resource list */ private void appendResourceList(StringBuffer htmlMsg, List notificationCauseList, String header) { if (!notificationCauseList.isEmpty()) { htmlMsg.append("<tr><td colspan=\"5\"><br/><p style=\"margin-top:20px;margin-bottom:10px;\"><b>"); htmlMsg.append(header); htmlMsg.append("</b></p></td></tr><tr class=\"trow1\"><td><div style=\"padding-top:2px;padding-bottom:2px;\">"); htmlMsg.append(m_messages.key(Messages.GUI_RESOURCE_0)); htmlMsg.append("</div></td><td><div style=\"padding-top:2px;padding-bottom:2px;padding-left:10px;\">"); htmlMsg.append(m_messages.key(Messages.GUI_SITE_0)); htmlMsg.append("</div></td><td><div style=\"padding-top:2px;padding-bottom:2px;padding-left:10px;\">"); htmlMsg.append(m_messages.key(Messages.GUI_ISSUE_0)); htmlMsg.append("</div></td><td colspan=\"2\"/></tr>"); Iterator notificationCauses = notificationCauseList.iterator(); for (int i = 0; notificationCauses.hasNext(); i++) { CmsExtendedNotificationCause notificationCause = (CmsExtendedNotificationCause)notificationCauses.next(); htmlMsg.append(buildNotificationListItem(notificationCause, (i % 2) + 2)); } } }
new String[] {CmsResource.getParentFolder(resourcePath)}); params.put(CmsWorkplace.PARAM_WP_SITE, new String[] {siteRoot}); CmsUUID projectId = getCmsObject().readProject(OpenCms.getSystemInfo().getNotificationProject()).getUuid(); params.put(CmsWorkplace.PARAM_WP_PROJECT, new String[] {String.valueOf(projectId)}); buf.append(CmsRequestUtil.appendParameters(m_uriWorkplaceJsp, params, true));