From: <fa...@vh...> - 2005-09-12 15:00:03
|
Author: fabrice Date: 2005-09-12 16:51:00 +0200 (Mon, 12 Sep 2005) New Revision: 769 Modified: ccm-cms/trunk/src/com/arsdigita/cms/lifecycle/NotifyLifecycleListener.java Log: Notification email to link to correct id Modified: ccm-cms/trunk/src/com/arsdigita/cms/lifecycle/NotifyLifecycleListener.java =================================================================== --- ccm-cms/trunk/src/com/arsdigita/cms/lifecycle/NotifyLifecycleListener.java 2005-09-12 13:44:07 UTC (rev 768) +++ ccm-cms/trunk/src/com/arsdigita/cms/lifecycle/NotifyLifecycleListener.java 2005-09-12 14:51:00 UTC (rev 769) @@ -222,28 +222,35 @@ Party sender = UserTask.getAlertsSender(); if (sender == null) { s_log.error("Failed to get 'from' party from UserTask "); - } else { - + + } else { ContentSection section = item.getContentSection(); - DateFormat df = DateFormat.getDateInstance(DateFormat.LONG); String name = null; if (item instanceof ContentPage) { name = ((ContentPage)item).getTitle(); - } - else { + } else { name = item.getName(); } + String subject = "Content Item " + name + " is about to expire"; - String publicURL = URL.there(section.getSiteNode() - .getURL(DispatcherHelper.getWebappContext()) + + String publicURL = URL.there(section.getSiteNode().getURL(DispatcherHelper.getWebappContext()) + item.getPath(), null).getURL(); - String adminURL = URL.there(ContentItemPage - .getItemURL(item,ContentItemPage.AUTHORING_TAB), - null).getURL(); - + + // link to the trunk version of the item, which can be edited. + // the live item cannot! + //String adminURL = URL.there(ContentItemPage.getItemURL(item,ContentItemPage.AUTHORING_TAB), null).getURL(); + ContentItem adminItem = item.getDraftVersion(); + if (adminItem == null) { + adminItem = item; + } + String adminURL = URL.there(ContentItemPage.getItemURL(adminItem, + ContentItemPage.AUTHORING_TAB) + , null).getURL(); + StringBuffer body = new StringBuffer(300); body.append("Content Item "); body.append(name); |