- activities for blog comments

- correct date encoding in rss blog/discussions feeds

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9983 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Michael Ru
2008-07-23 08:57:30 +00:00
parent 2150e618d4
commit e2d8f76d4b
6 changed files with 91 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
<#assign username=userId>
<#if firstName?exists>
<#assign username = firstName + " " + lastName>
</#if>
<entry xmlns='http://www.w3.org/2005/Atom'>
<title>New comment for ${(itemTitle!'')?html}</title>
<link rel="alternate" type="text/html" href="${(browsePostUrl!'')?replace("&", "&amp;")}" />
<id>${id}</id>
<updated>${xmldate(date)}</updated>
<summary type="html">
<![CDATA[${username} added a comment to <a href="${(browseItemUrl!'')}">${itemTitle!'unknown'}</a>]]>
</summary>
<author>
<name>${userId!""}</name>
</author>
</entry>

View File

@@ -0,0 +1,17 @@
<#assign username=userId>
<#if firstName?exists>
<#assign username = firstName + " " + lastName>
</#if>
<entry xmlns='http://www.w3.org/2005/Atom'>
<title>Comment deleted</title>
<link rel="alternate" type="text/html" href="${(browsePostListUrl!'')?replace("&", "&amp;")}" />
<id>${id}</id>
<updated>${xmldate(date)}</updated>
<summary type="html">
<![CDATA[${username} deleted comment on <a href="${(browseItemUrl!'')}">${itemTitle!'unknown'}</a>]]>
</summary>
<author>
<name>${userId!""}</name>
</author>
</entry>

View File

@@ -0,0 +1,17 @@
<#assign username=userId>
<#if firstName?exists>
<#assign username = firstName + " " + lastName>
</#if>
<entry xmlns='http://www.w3.org/2005/Atom'>
<title>Comment updated</title>
<link rel="alternate" type="text/html" href="${(browsePostUrl!'')?replace("&", "&amp;")}" />
<id>${id}</id>
<updated>${xmldate(date)}</updated>
<summary type="html">
<![CDATA[${username} updated comment on <a href="${(browseItemUrl!'')}">${itemTitle!'unknown'}</a>]]>
</summary>
<author>
<name>${userId!""}</name>
</author>
</entry>

View File

@@ -28,6 +28,19 @@ function main()
}
deleteComment(node);
// post an activitiy item, but only if we got a site
if ((args["site"] != undefined) &&
(args["container"] != undefined) &&
(args["itemTitle"] != undefined) &&
(args["browseItemUrl"] != undefined))
{
var data = {
itemTitle: decodeURIComponent(args["itemTitle"]),
browseItemUrl: decodeURIComponent(args["browseItemUrl"])
}
activities.postActivity("org.alfresco.comments.comment-deleted", args["site"], args["container"], jsonUtils.toJSONString(data));
}
}
main();

View File

@@ -30,9 +30,21 @@ function main()
}
// update comment
updateComment(node);
updateComment(node);
model.item = getCommentData(node);
// post an activitiy item, but only if we got a site
if (json.has("site") &&
json.has("container") &&
json.has("itemTitle") &&
json.has("browseItemUrl"))
{
var data = {
itemTitle: json.get("itemTitle"),
browseItemUrl: json.get("browseItemUrl")
}
activities.postActivity("org.alfresco.comments.comment-updated", json.get("site"), json.get("container"), jsonUtils.toJSONString(data));
}
}
main();

View File

@@ -42,6 +42,19 @@ function main()
var comment = addComment(node);
model.item = getCommentData(comment);
// post an activitiy item, but only if we got a site
if (json.has("site") &&
json.has("container") &&
json.has("itemTitle") &&
json.has("browseItemUrl"))
{
var data = {
itemTitle: json.get("itemTitle"),
browseItemUrl: json.get("browseItemUrl")
}
activities.postActivity("org.alfresco.comments.comment-created", json.get("site"), json.get("container"), jsonUtils.toJSONString(data));
}
}
main();