diff -r 3f837429dac5 rwiki/rwiki-impl/impl/src/bundle/uk/ac/cam/caret/sakai/rwiki/component/bundle/Messages.properties --- a/rwiki/rwiki-impl/impl/src/bundle/uk/ac/cam/caret/sakai/rwiki/component/bundle/Messages.properties Thu Aug 30 16:57:13 2012 +0800 +++ b/rwiki/rwiki-impl/impl/src/bundle/uk/ac/cam/caret/sakai/rwiki/component/bundle/Messages.properties Fri Aug 31 16:14:44 2012 +0800 @@ -118,6 +118,7 @@ SiteEmailNotificationRWiki.13=\tLocation: site " SiteEmailNotificationRWiki.16=\ Modified at: SiteEmailNotificationRWiki.18=\ Modified by User: +SiteEmailNotificationRWiki.19=\ Page: SiteEmailNotificationRWiki.4=\ Content: \n SiteEmailNotificationRWiki.27=Subject: The wiki page SiteEmailNotificationRWiki.28=\ has been modified diff -r 3f837429dac5 rwiki/rwiki-impl/impl/src/bundle/uk/ac/cam/caret/sakai/rwiki/component/bundle/Messages_zh_CN.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rwiki/rwiki-impl/impl/src/bundle/uk/ac/cam/caret/sakai/rwiki/component/bundle/Messages_zh_CN.properties Fri Aug 31 16:14:44 2012 +0800 @@ -0,0 +1,132 @@ +RWikiCurrentObjectDaoImpl.30=\u6ca1\u6709\u76f8\u5173\u7684\u5185\u5bb9\u7528\u6765\u663e\u793a\u9875\u9762 +RWikiCurrentObjectDaoImpl.31=\uff0c\u8bf7\u521b\u5efa +SakaiLinkMacro.0=1,text: \u8d85\u94fe\u63a5\u7684\u663e\u793a\u6587\u5b57 +SakaiLinkMacro.1=2,url: \u94fe\u63a5\u7684\u5730\u5740\uff0c\u5982\u679c\u94fe\u63a5\u662f\u5916\u90e8\u7684\uff0c\u5e76\u4e14\u6ca1\u6709\u8bbe\u5b9atarget\u53c2\u6570\uff0c\u90a3\u4e48\u5c06\u5728\u65b0\u7a97\u53e3\u4e2d\u6253\u5f00\u94fe\u63a5 +SakaiLinkMacro.2=3,img: \uff08\u53ef\u9009\uff09\u5982\u679c\u8bbe\u5b9a\u4e3a\u201cnone\u201d \uff0c\u90a3\u4e48\u5c06\u4e0d\u4f1a\u4f7f\u7528URL\u56fe\u6807 +SakaiLinkMacro.3=4,target: \uff08\u53ef\u9009\uff09\uff0c\u76ee\u6807\u7a97\u53e3\uff0c\u5982\u679c\u8bbe\u5b9a\u4e3a\u201cnone\u201d\uff0c\u90a3\u4e48\u5c06\u5728\u5f53\u524d\u7a97\u53e3\u6253\u5f00\u94fe\u63a5 +SakaiLinkMacro.4=\u5982\u679c\u8981\u8bbe\u5b9atarget\u53c2\u6570\uff0c\u5374\u4e0d\u9700\u8981\u8bbe\u7f6eimg\u53c2\u6570\uff0c\u90a3\u4e48\u5fc5\u987b\u4e3aimg\u8bbe\u5b9a\u4e00\u4e2a\u5360\u4f4d\u53c2\u6570 +SakaiLinkMacro.5=\u751f\u6210\u8d85\u94fe\u63a5 +SakaiLinkMacro.28=\u94fe\u63a5\u9700\u8981\u8bbe\u5b9a\u663e\u793a\u7684\u6587\u5b57\u548c\u94fe\u63a5\u7684\u5730\u5740 +ImageMacro.0=1,img: \u56fe\u50cf\u7684\u5730\u5740\uff0c\u5730\u5740\u53ea\u80fd\u662f\u76f8\u5bf9\u8def\u5f84\u6216\u8005\u5185\u90e8\u7684\u7edd\u5bf9\u5730\u5740\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7worksite:/ \u6216 sakai:/\u5f00\u59cb\u7684\u5730\u5740\u6765\u5f15\u7528\u7ad9\u70b9\u6216Sakai\u7684\u76f8\u5173\u5185\u5bb9\u3002\u5f53\u5f15\u7528\u7684\u5185\u5bb9\u5728\u5176\u4ed6\u7684\u7ad9\u70b9\u4e2d\uff08\u5982sakai:/\uff09\uff0c\u60a8\u5fc5\u987b\u5c06\u7ad9\u70b9id\u5305\u542b\u5176\u4e2d + mageMacro.1=2,alt: \uff08\u53ef\u9009\uff09\u56fe\u50cf\u7684\u66ff\u4ee3\u6587\u5b57 +ImageMacro.2=3,ext: \uff08\u53ef\u9009\uff09\u76ee\u524d\u6b64\u53c2\u6570\u88ab\u76f4\u63a5\u5ffd\u7565 +ImageMacro.3=4,class: \uff08\u53ef\u9009\uff09\u56fe\u50cf\u4f7f\u7528\u7684CSS\u7c7b +ImageMacro.4=5,target: \uff08\u53ef\u9009\uff09\u76ee\u6807\u7a97\u53e3 +ImageMacro.5=6,title: \uff08\u53ef\u9009\uff09\u56fe\u50cf\u7684\u6807\u9898\uff08\u9ed8\u8ba4\u4e0ealt\u53c2\u6570\u4e00\u81f4\uff09 +ImageMacro.6=\u5982\u679c\u8981\u8bbe\u5b9a\u4f4d\u7f6e\u8f83\u540e\u7684\u53c2\u6570\uff0c\u90a3\u4e48\u5fc5\u987b\u4e3a\u6b64\u524d\u7684\u53ef\u9009\u53c2\u6570\u8bbe\u5b9a\u4e00\u4e2a\u5360\u4f4d\u53c2\u6570 +ImageMacro.7=\u5728\u9875\u9762\u4e2d\u653e\u7f6e\u56fe\u50cf +ImageMacro.23=\u4e0d\u5141\u8bb8\u5916\u90e8\u5730\u5740\uff0c\u53ea\u5141\u8bb8\u76f8\u5bf9\u5730\u5740\u548c\u7edd\u5bf9\u5730\u5740 +ImageMacro.34=\u53c2\u6570\u7684\u6570\u91cf\u4e0d\u5339\u914d +BlockMacro.0=1,class: \u8d4b\u4e88div\u6807\u7b7e\u7684class +BlockMacro.01=style: \u4f7f\u7528\u7684CSS\u7c7b +BlockMacro.1=id: \u8bbe\u5b9adiv\u6807\u7b7e\u7684id\u5c5e\u6027 +BlockMacro.2=anchor: \u4e3adiv\u6807\u7b7e\u8bbe\u5b9a\u7684\u951a\u70b9 +BlockMacro.3=\u5728\u4e00\u7ec4rwiki\u751f\u6210\u7684\u5185\u5bb9\u5468\u8fb9\u52a0\u4e0adiv\u53c2\u6570 +StyleMacro.0=1,href: \uff08\u53ef\u9009\uff09\u6837\u5f0f\u8868\u5730\u5740 +StyleMacro.1=2,media: \uff08\u53ef\u9009\uff09\u5a92\u4f53\u7c7b\u578b\uff0c\u9ed8\u8ba4\u4e3a\u6240\u6709\u7c7b\u578b\u3002 +StyleMacro.2=\u6dfb\u52a0\u4e00\u4e2a\u6837\u5f0f\u5143\u7d20\uff0c\u5982\u679chref\u53c2\u6570\u6ca1\u6709\u8bbe\u7f6e\uff0c\u90a3\u4e48\u5c06\u4f7f\u7528\u5185\u90e8\u5185\u5bb9\uff1b\u5426\u5219\u4f7f\u7528\u6307\u5b9a\u5730\u5740\u7684\u6837\u5f0f\u3002 +AnchorMacro.0=1: \u951a\u70b9\u7684\u540d\u79f0 +AnchorMacro.1=\u5728rwiki\u751f\u6210\u7684\u5185\u5bb9\u5904\u521b\u5efa\u951a\u70b9 +BackgroundColorMacro.1=0,color: \u4fee\u6539\u90e8\u5206\u6587\u5b57\u7684\u80cc\u666f\u8272 +BackgroundColorMacro.2=\u4fee\u6539\u90e8\u5206\u6587\u5b57\u7684\u80cc\u666f\u8272 +BackgroundColorMacro.0=\u989c\u8272: +BackgroundColorMacro.10=\ \u4e0d\u662f\u6709\u6548\u7684CSS\u989c\u8272\! +SectionsMacro.0=1,useids: \uff08\u53ef\u9009\uff09\u5982\u679c\u4e3atrue\uff0c\u5c06\u751f\u6210ID\uff0c\u5426\u5219\u5c06\u4f7f\u7528\u540d\u79f0\uff0c\u9ed8\u8ba4\u4f7f\u7528\u540d\u79f0 +SectionsMacro.1=\u5982\u679c\u8981\u8bbe\u5b9a\u4f4d\u7f6e\u8f83\u540e\u7684\u53c2\u6570\uff0c\u90a3\u4e48\u5fc5\u987b\u4e3a\u6b64\u524d\u7684\u53ef\u9009\u53c2\u6570\u8bbe\u5b9a\u4e00\u4e2a\u5360\u4f4d\u53c2\u6570 +SectionsMacro.2=\u751f\u6210\u4e00\u4e2a\u94fe\u63a5\u5217\u8868\uff0c\u53ea\u60f3\u5e73\u884c\u73ed\u5b50\u7ad9\u70b9 +SectionsMacro.5=\u65e0\u6548\u7684\u7ad9\u70b9id +IndexMacro.1=1:space, \u751f\u6210\u7d22\u5f15\u7684\u9875\u9762\uff0c\u9ed8\u8ba4\u4e3a\u5f53\u524d\u9875\u3002 +IndexMacro.2=2:nohead, \u5982\u679c\u8bbe\u7f6enohead\uff0c\u5c06\u4e0d\u751f\u6210\u7d22\u5f15\u5934 +IndexMacro.0=\ \

\u7d22\u5f15\uff1a +WorksiteInfoMacro.3=1,info: \u63d0\u4f9b\u7684\u4fe1\u606f\u7c7b\u578b\uff0cworksiteinfo:title \u6807\u9898\uff08\u9ed8\u8ba4\uff09\uff0c +WorksiteInfoMacro.4=\ worksiteinfo:description, +WorksiteInfoMacro.5=\ worksiteinfo:shortdescription, +WorksiteInfoMacro.6=\ worksiteinfo:wikispace +WorksiteInfoMacro.7=\u5982\u679c\u8981\u8bbe\u5b9a\u4f4d\u7f6e\u8f83\u540e\u7684\u53c2\u6570\uff0c\u90a3\u4e48\u5fc5\u987b\u4e3a\u6b64\u524d\u7684\u53ef\u9009\u53c2\u6570\u8bbe\u5b9a\u4e00\u4e2a\u5360\u4f4d\u53c2\u6570 +WorksiteInfoMacro.8=\u751f\u6210\u7ad9\u70b9\u4fe1\u606f +WorksiteInfoMacro.11=\u6ca1\u627e\u5230\u76f8\u5173\u7ad9\u70b9 +ColorMacro.2=0,color: \u4fee\u6539\u5185\u5bb9\u7684\u524d\u666f\u8272 +ColorMacro.3=1,bgcolor: \u4fee\u6539\u5185\u5bb9\u7684\u80cc\u666f\u8272 +ColorMacro.4=\u4fee\u6539\u67d0\u4e9b\u6587\u5b57\u7684\u989c\u8272 +ColorMacro.1=\u989c\u8272: +ColorMacro.13=\ \u4e0d\u662f\u6709\u6548\u7684CSS\u989c\u8272\! +RecentChangesMacro.0=1: \u53ef\u9009\uff0c\u5982\u679c\u683c\u5f0f\u662fyyyy-MM-dd\uff0c\u663e\u793a\u6b64\u65e5\u671f\u4ee5\u6765\u7684\u53d8\u66f4\uff1b\u5982\u679c\u683c\u5f0f\u662f30d\uff0c\u90a3\u4e48\u663e\u793a\u76f8\u5e94\u5929\u6570\u5185\u7684\u53d8\u5316\uff1b\u5982\u679c\u683c\u5f0f\u4e3a12h\uff0c\u90a3\u4e48\u663e\u793a\u76f8\u5e94\u5c0f\u65f6\u5185\u7684\u53d8\u5316\u3002\u9ed8\u8ba4\u4e3a\u6700\u8fd130\u5929\u5185\u7684\u53d8\u5316\uff0c +RecentChangesMacro.1=\u663e\u793a\u6700\u8fd1\u53d8\u5316\u9875\u9762\u7684\u5217\u8868 +RecentChangesMacro.6=yyyy-MM-dd +RecentChangesMacro.7= \u4e0d\u80fd\u89e3\u6790\uff1a +RecentChangesMacro.8=\ \u5fc5\u987b\u4e3a yyyy-MM-dd \u6216 30d \u6216 12h\u3002\u9ed8\u8ba4\u4e3a\u6700\u8fd130\u5929 +RecentChangesMacro.9= \u81ea\u4ece +RecentChangesMacro.13=\ \u88ab\u4fee\u6539 +RecentChangesMacro.14=\ \u4fee\u6539\u8005 +RecentChangesMacro.16=\u60a8\u65e0\u6743\u8fdb\u884c\u641c\u7d22\u3002 +SpanMacro.0=1,class: span\u6807\u7b7e\u7684\u7c7b(class)\u3002 +SpanMacro.1=id: span\u6807\u7b7e\u7684id\u3002 +SpanMacro.2=anchor: \u4e3a\u6b64\u6807\u7b7e\u8bbe\u5b9a\u7684\u951a\u70b9 +SpanMacro.3=\u5728rwiki\u751f\u6210\u7684\u5185\u5bb9\u5468\u56f4\u6dfb\u52a0span\u6807\u7b7e +MathMacro.0=\u8fd9\u4e2a\u5b8f\u662f\u4e3a\u4e86\u5728\u6570\u5b66\u6587\u5b57\u5468\u56f4\u653e\u7f6e\u76f8\u5e94\u7684span/div\u6807\u7b7e\u3002\u8fd9\u4e2a\u5b8f\u7684\u5185\u5bb9\u662f\u9884\u5148\u5904\u7406\u7684\uff0c\u6240\u4ee5\u60a8\u4e0d\u80fd\u5c06 {math} \u653e\u7f6e\u5728\u8fd9\u4e2a\u5b8f\u7684\u5185\u5bb9\u91cc\uff0c\u8bf7\u4f7f\u7528 {{}math} \u3002 +MathMacro.1=1: \u5728\u6b64\u8bbe\u7f6e\u4e3a\u201cdisplay\u201d\uff0c\u4ee5\u4f7f\u6570\u5b66\u5185\u5bb9\u9632\u6b62\u5728div\u6807\u7b7e\u4e2d +SpecializedRenderContext.7=\u94fe\u63a5\u4e0d\u80fd\u88ab\u89e3\u6790 +SpecializedRenderContext.20=\u94fe\u63a5\u4e0d\u80fd\u88ab\u89e3\u6790 +RWikiObjectServiceImpl.32=\u5b58\u6863wiki\u9875\u9762\uff0c\u4f4d\u4e8e +RWikiObjectServiceImpl.31=\u4ece\u7ad9\u70b9\u5b58\u6863\u9875\u9762\u65f6\u51fa\u9519\uff1a +RWikiObjectServiceImpl.30=\u5b58\u6863: \u5b8c\u6210 +RWikiObjectServiceImpl.43=\ \u9875\u9762\u4ee5\u53ca +RWikiObjectServiceImpl.44=\ \u7248\u672c\n +RWikiObjectServiceImpl.29=\u9875\u9762 +RWikiObjectServiceImpl.28=\ \u5df2\u5b58\u5728\uff0c\u7248\u672c\u53f7\u4e3a +RWikiObjectServiceImpl.54=\ \uff0c\u6b64\u7248\u672c\u65e9\u4e8e\u5b58\u6863\u7684\u7248\u672c +RWikiObjectServiceImpl.55=\ \u56e0\u6b64\uff0c\u6211\u62d2\u7edd\u4ece\u5b58\u6863\u4e2d\u8fdb\u884c\u5408\u5e76\uff0c +RWikiObjectServiceImpl.56=\ \u5982\u679c\u60a8\u89c9\u5f97\u8fd9\u529f\u80fd\u662f\u5fc5\u987b\u7684\uff0c +RWikiObjectServiceImpl.57=\ \u8bf7\u5728JIRA\u4e0a\u62a5\u544a\u6b64\u9519\u8bef \n +RWikiObjectServiceImpl.58=\u9875\u9762 +RWikiObjectServiceImpl.59=\ \u5df2\u5b58\u5728\uff0c\u7248\u672c\u53f7\u4e3a +RWikiObjectServiceImpl.60=\ \u56e0\u6b64\u6211\u62d2\u7edd\u4ece\u5b58\u6863\u4e2d +RWikiObjectServiceImpl.61=\ \u56de\u590d\u76f8\u5173\u7248\u672c +RWikiObjectServiceImpl.62=\ \u5982\u679c\u60a8\u89c9\u5f97\u8fd9\u529f\u80fd\u662f\u5fc5\u987b\u7684\uff0c +RWikiObjectServiceImpl.63=\ \u8bf7\u5728JIRA\u4e0a\u62a5\u544a\u6b64\u9519\u8bef \n +RWikiObjectServiceImpl.64=\u88ab\u521b\u5efa +RWikiObjectServiceImpl.65=\ \u7248\u672c +RWikiObjectServiceImpl.66=\ \u7248\u672c\u53f7 +RWikiObjectServiceImpl.67=\ \u65e5\u671f +RWikiObjectServiceImpl.69=\ \u8b66\u544a\uff1a\u6821\u9a8c\u548c\u4e0e\u5b58\u6863\u7248\u672c\u4e0d\u4e00\u81f4\uff1a +RWikiObjectServiceImpl.70=\ \u5408\u5e76\u7248\u672c\uff1a +RWikiObjectServiceImpl.71=\n\u5b58\u6863\u7684\u5185\u5bb9\uff1a\n +RWikiObjectServiceImpl.72=\n\u4fdd\u5b58\u7684\u5185\u5bb9\uff1a\n +RWikiObjectServiceImpl.75=\u6dfb\u52a0\u5931\u8d25 +RWikiObjectServiceImpl.76=\u9875\u9762\u540d\u79f0 +RWikiObjectServiceImpl.77=\ \u7248\u672c +RWikiObjectServiceImpl.78=\u7248\u672c +RWikiObjectServiceImpl.79=\ \u7531\u4e8e +RWikiObjectServiceImpl.81=\ \u5b9a\u4f4d\u7ad9\u70b9\u5185\u5bb9\u65f6\u53d1\u751f\u9519\u8bef +RWikiObjectServiceImpl.84=\ Wiki\u5408\u5e76\u5b8c\u6210 +RWikiObjectServiceImpl.85=\ \u5df2\u6dfb\u52a0 +RWikiObjectServiceImpl.86=\ \u9875\u9762\uff0c +RWikiObjectServiceImpl.87=\ \u7248\u672c \n\u88ab\u53d1\u73b0 +RWikiObjectServiceImpl.88=\ \u62d2\u7edd\uff0c +RWikiObjectServiceImpl.89=\ \u5931\u8d25\uff0c +RWikiObjectServiceImpl.90=\ \u9519\u8bef\n +RWikiSecurityServiceImpl.2=\u60a8\u5fc5\u987b\u901a\u8fc7\u9002\u5f53\u7684\u7ad9\u70b9\u8bbf\u95eeRWiki +XSLTEntityHandler.68=\u5e8f\u5217\u5316\u65f6\u53d1\u751f\u9519\u8bef +XSLTEntityHandler.32=\u751f\u6210\u5185\u5bb9\u662f\u53d1\u751f\u5f02\u5e38 +XSLTEntityHandler.33=\n \u5f02\u5e38\uff1a +XSLTEntityHandler.34=\ \u4fe1\u606f:\n +XSLTEntityHandler.35=\u9875\u9762\u65e0\u5185\u5bb9 +XSLTEntityHandler.36=\u9875\u9762\u65e0\u5185\u5bb9 +XSLTEntityHandler.46=\u8981\u663e\u793a\u7684\u5185\u5bb9\u4e0d\u80fd\u6b63\u5e38\u89e3\u6790 +SiteEmailNotificationRWiki.5=\u7ad9\u70b9" +SiteEmailNotificationRWiki.6=" \u7684\u4e00\u4e2aWiki\u9875\u9762\u88ab\u4fee\u6539\uff0c\u7ad9\u70b9\u4f4d\u4e8e +SiteEmailNotificationRWiki.13=\t\u4f4d\u7f6e\uff1a\u7ad9\u70b9 " +SiteEmailNotificationRWiki.16=\ \u4fee\u6539\u65f6\u95f4\uff1a +SiteEmailNotificationRWiki.18=\ \u8fdb\u884c\u4fee\u6539\u7684\u7528\u6237\uff1a +SiteEmailNotificationRWiki.19=\ \u9875\u9762\uff1a +SiteEmailNotificationRWiki.4=\ \u5185\u5bb9\uff1a \n +SiteEmailNotificationRWiki.27=Subject: wiki\u9875\u9762 +SiteEmailNotificationRWiki.28=\ \u88ab\u4fee\u6539 +SiteEmailNotificationRWiki.30=\u6b64\u81ea\u52a8\u901a\u77e5\u90ae\u4ef6\u7531 +SiteEmailNotificationRWiki.3=)\u53d1\u9001\uff0c +SiteEmailNotificationRWiki.35=\ \u7ad9\u70b9\u3002\n +SiteEmailNotificationRWiki.36=\u60a8\u53ef\u4ee5\u901a\u8fc7 \u6211\u7684\u5de5\u4f5c\u7a7a\u95f4 > \u7528\u6237\u504f\u597d \u4e2d\u4fee\u6539\u63a5\u6536\u901a\u77e5\u90ae\u4ef6\u7684\u9009\u9879\u3002 +XLSTChangesHandler.19=\u4fee\u6539\u5386\u53f2\uff1a +XLSTChangesHandler.21=\u6700\u8fd1\u4fee\u6539\uff1a +XLSTChangesHandler.23=\u6700\u8fd1\u4fee\u6539\uff1a +PreMacro.1=\u6309\u5185\u5bb9\u7684\u6837\u5b50\u8fdb\u884c\u663e\u793a diff -r 3f837429dac5 rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/SiteEmailNotificationRWiki.java --- a/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/SiteEmailNotificationRWiki.java Thu Aug 30 16:57:13 2012 +0800 +++ b/rwiki/rwiki-impl/impl/src/java/uk/ac/cam/caret/sakai/rwiki/component/service/impl/SiteEmailNotificationRWiki.java Fri Aug 31 16:14:44 2012 +0800 @@ -21,7 +21,7 @@ package uk.ac.cam.caret.sakai.rwiki.component.service.impl; -import java.util.ArrayList; +import java.text.DateFormat; import java.util.Date; import java.util.List; import java.util.Vector; @@ -35,7 +35,6 @@ import org.sakaiproject.entity.api.Reference; import org.sakaiproject.entity.api.ResourceProperties; import org.sakaiproject.event.api.Event; -import org.sakaiproject.event.api.Notification; import org.sakaiproject.event.api.NotificationAction; import org.sakaiproject.event.api.NotificationService; import org.sakaiproject.exception.IdUnusedException; @@ -46,10 +45,10 @@ import org.sakaiproject.user.api.User; import org.sakaiproject.user.api.UserDirectoryService; import org.sakaiproject.user.api.UserNotDefinedException; +import org.sakaiproject.util.ResourceLoader; import org.sakaiproject.util.SiteEmailNotification; import org.sakaiproject.util.Web; -import uk.ac.cam.caret.sakai.rwiki.component.Messages; import uk.ac.cam.caret.sakai.rwiki.service.api.RWikiObjectService; import uk.ac.cam.caret.sakai.rwiki.service.api.RenderService; import uk.ac.cam.caret.sakai.rwiki.service.api.model.RWikiEntity; @@ -82,6 +81,8 @@ private static Log log = LogFactory .getLog(SiteEmailNotificationRWiki.class); + + private static ResourceLoader rl = new ResourceLoader("uk.ac.cam.caret.sakai.rwiki.component.bundle.Messages"); private RenderService renderService = null; @@ -175,33 +176,32 @@ * @inheritDoc */ protected String getPlainMessage(Event event) { - - MessageContent mc = getMessageContent(event); - - String message = Messages.getString("SiteEmailNotificationRWiki.5") + mc.title + Messages.getString("SiteEmailNotificationRWiki.6") //$NON-NLS-1$ //$NON-NLS-2$ - + ServerConfigurationService.getString("ui.service", "Sakai") + " (" + ServerConfigurationService.getPortalUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + ") " + " \n" + " \n" + Messages.getString("SiteEmailNotificationRWiki.13") + mc.title + "\" > Wiki > " + mc.localName + "\n" + Messages.getString("SiteEmailNotificationRWiki.16") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ - + mc.moddate - + "\n" + Messages.getString("SiteEmailNotificationRWiki.18") + mc.user + "\n" + " \n" + " Page: " + mc.localName + " " + mc.url + " \n" + " \n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ - + Messages.getString("SiteEmailNotificationRWiki.4") + mc.content + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ + MessageContent mc = getMessageContent(event); + StringBuilder message = new StringBuilder(); + message.append(rl.getString("SiteEmailNotificationRWiki.5")).append(mc.title).append(rl.getString("SiteEmailNotificationRWiki.6")) + .append(ServerConfigurationService.getString("ui.service", "Sakai")).append(" (").append(ServerConfigurationService.getPortalUrl()) + .append(") \n\n").append(rl.getString("SiteEmailNotificationRWiki.13")).append(mc.title).append("\" > Wiki > ").append(mc.localName).append("\n").append(rl.getString("SiteEmailNotificationRWiki.16")) + .append(mc.moddate) + .append("\n").append(rl.getString("SiteEmailNotificationRWiki.18")).append(mc.user).append("\n \n").append(rl.getString("SiteEmailNotificationRWiki.19")).append(mc.localName).append(" ").append(mc.url).append(" \n \n") + .append(rl.getString("SiteEmailNotificationRWiki.4")).append(mc.content).append("\n"); log.debug("Message is " + message); - return message; + return message.toString(); } protected String getHtmlMessage(Event event) { + MessageContent mc = getMessageContent(event); + StringBuilder sb = new StringBuilder(); + sb.append(rl.getString("SiteEmailNotificationRWiki.5")).append(mc.title).append(rl.getString("SiteEmailNotificationRWiki.6")) + .append(ServerConfigurationService.getString("ui.service", "Sakai")).append(" (").append(ServerConfigurationService.getPortalUrl()) + .append(") \n\n").append(rl.getString("SiteEmailNotificationRWiki.13")).append(mc.title).append("\" > Wiki > ").append(mc.localName).append("\n").append(rl.getString("SiteEmailNotificationRWiki.16")) + .append(mc.moddate) + .append("\n").append(rl.getString("SiteEmailNotificationRWiki.18")).append(mc.user).append("\n \n").append(rl.getString("SiteEmailNotificationRWiki.19")).append(mc.localName).append(" ").append(mc.url).append(" \n \n") + .append(rl.getString("SiteEmailNotificationRWiki.4")).append(mc.content).append("\n"); - MessageContent mc = getMessageContent(event); - String message = - Messages.getString("SiteEmailNotificationRWiki.5") + mc.title + Messages.getString("SiteEmailNotificationRWiki.6") //$NON-NLS-1$ //$NON-NLS-2$ - + ServerConfigurationService.getString("ui.service", "Sakai") + " (" + ServerConfigurationService.getPortalUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + ") " + " \n" + " \n" + Messages.getString("SiteEmailNotificationRWiki.13") + mc.title + "\" > Wiki > " + mc.localName + "\n" + Messages.getString("SiteEmailNotificationRWiki.16") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ - + mc.moddate - + "\n" + Messages.getString("SiteEmailNotificationRWiki.18") + mc.user + "\n" + " \n" + " Page: " + mc.localName + " " + mc.url + " \n" + " \n" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ - + Messages.getString("SiteEmailNotificationRWiki.4"); - message = Web.escapeHtml(message, true) + mc.contentHTML; + String message = Web.escapeHtml(sb.toString(), true) + mc.contentHTML; log.debug("Message is " + message); return message; } @@ -240,8 +240,8 @@ } catch (UserNotDefinedException e) { messageContent.user = userId; } - messageContent.moddate = new Date(Long.parseLong(props - .getProperty(RWikiEntity.RP_VERSION))).toString(); + Date date = new Date(Long.parseLong(props.getProperty(RWikiEntity.RP_VERSION))); + messageContent.moddate = DateFormat.getDateInstance(DateFormat.FULL, rl.getLocale()).format(date); try { RWikiEntity rwe = (RWikiEntity) rwikiObjectService.getEntity(ref); RWikiObject rwikiObject = rwe.getRWikiObject(); @@ -280,8 +280,7 @@ String realm = props.getProperty(RWikiEntity.RP_REALM); String localName = NameHelper.localizeName(pageName, realm); - String subjectHeader = Messages - .getString("SiteEmailNotificationRWiki.27") + localName + Messages.getString("SiteEmailNotificationRWiki.28"); //$NON-NLS-1$ //$NON-NLS-2$ + String subjectHeader = rl.getString("SiteEmailNotificationRWiki.27") + localName + rl.getString("SiteEmailNotificationRWiki.28"); // the Subject rv.add(subjectHeader); @@ -297,20 +296,22 @@ /** * @inheritDoc */ - protected String getTag(String newline, String title) { + protected String getTag(String title, boolean shouldUseHtml) { // tag the message - String rv = "----------------------\n" + Messages.getString("SiteEmailNotificationRWiki.30") //$NON-NLS-1$ //$NON-NLS-2$ - + ServerConfigurationService.getString("ui.service", "Sakai") + " (" + ServerConfigurationService.getPortalUrl() //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + Messages.getString("SiteEmailNotificationRWiki.3") + title + Messages.getString("SiteEmailNotificationRWiki.35") //$NON-NLS-1$ //$NON-NLS-2$ - + Messages.getString("SiteEmailNotificationRWiki.36"); //$NON-NLS-1$ - /* - * String rv = newline + "------" + newline + rb.getString("this") + " " + - * ServerConfigurationService.getString("ui.service", "Sakai") + " (" + - * ServerConfigurationService.getPortalUrl() + ") " + - * rb.getString("forthe") + " " + title + " " + rb.getString("site") + - * newline + rb.getString("youcan") + newline; - */ - return rv; + StringBuilder rv = new StringBuilder(); + if (shouldUseHtml) { + rv.append("



").append(rl.getString("SiteEmailNotificationRWiki.30")) + .append(ServerConfigurationService.getString("ui.service", "Sakai")).append(" (") + .append(ServerConfigurationService.getPortalUrl()).append("") + .append(rl.getString("SiteEmailNotificationRWiki.3")).append(rl.getString("SiteEmailNotificationRWiki.35")) + .append(rl.getString("SiteEmailNotificationRWiki.36")).append("
"); + } else { + rv.append("----------------------\n").append(rl.getString("SiteEmailNotificationRWiki.30")) + .append(ServerConfigurationService.getString("ui.service", "Sakai")).append(" (").append(ServerConfigurationService.getPortalUrl()) + .append(rl.getString("SiteEmailNotificationRWiki.3")).append(rl.getString("SiteEmailNotificationRWiki.35")) + .append(rl.getString("SiteEmailNotificationRWiki.36")); + } + return rv.toString(); } protected int getOption(User user, String notificationId, String resourceFilter, int eventPriority, Event event) {