mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
- Moved creation of activities urls for blog/discussions from the REST api to the client side
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9992 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -3,12 +3,12 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<title>New blog post: ${title!'unknown'}</title>
|
<title>New blog post: ${postTitle!'unknown'}</title>
|
||||||
<link rel="alternate" type="text/html" href="${(browsePostUrl!'')?replace("&", "&")}" />
|
<link rel="alternate" type="text/html" href="${(browsePostUrl!'')?replace("&", "&")}" />
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<summary type="html">
|
<summary type="html">
|
||||||
<![CDATA[${username} added blog post <a href="${(browsePostUrl!'')}">${title!'unknown'}</a>.]]>
|
<![CDATA[${username} added blog post <a href="${(browsePostUrl!'')}">${postTitle!'unknown'}</a>.]]>
|
||||||
</summary>
|
</summary>
|
||||||
<author>
|
<author>
|
||||||
<name>${userId!""}</name>
|
<name>${userId!""}</name>
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<item>
|
<item>
|
||||||
<title>New blog post: ${title!"unknown"}</title>
|
<title>New blog post: ${postTitle!"unknown"}</title>
|
||||||
<link>${(browsePostUrl!'')?replace("&", "&")}</link>
|
<link>${(browsePostUrl!'')?replace("&", "&")}</link>
|
||||||
<guid>${id}</guid>
|
<guid>${id}</guid>
|
||||||
<description>${username} added blog post ${title!'unknown'}.</description>
|
<description>${username} added blog post ${postTitle!'unknown'}.</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@@ -3,12 +3,12 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<title>Blog post deleted: ${title!'unknown'}</title>
|
<title>Blog post deleted: ${postTitle!'unknown'}</title>
|
||||||
<link rel="alternate" type="text/html" href="${(browsePostListUrl!'')?replace("&", "&")}" />
|
<link rel="alternate" type="text/html" href="${(browsePostListUrl!'')?replace("&", "&")}" />
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<summary type="html">
|
<summary type="html">
|
||||||
<![CDATA[${username} deleted blog post ${title}.]]>
|
<![CDATA[${username} deleted blog post ${postTitle}.]]>
|
||||||
</summary>
|
</summary>
|
||||||
<author>
|
<author>
|
||||||
<name>${userId!""}</name>
|
<name>${userId!""}</name>
|
||||||
|
@@ -3,9 +3,8 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<item>
|
<item>
|
||||||
<title>Blog post deleted: ${title!"unknown"}</title>
|
<title>Blog post deleted: ${postTitle!"unknown"}</title>
|
||||||
<link>${(browsePostListURL!'')?replace("&", "&")}</link>
|
|
||||||
<guid>${id}</guid>
|
<guid>${id}</guid>
|
||||||
<description>${username} deleted blog post ${title}.</description>
|
<description>${username} deleted blog post ${postTitle}.</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@@ -3,12 +3,12 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<title>Blog post updated: ${title!'unknown'}</title>
|
<title>Blog post updated: ${postTitle!'unknown'}</title>
|
||||||
<link rel="alternate" type="text/html" href="${(browsePostUrl!'')?replace("&", "&")}" />
|
<link rel="alternate" type="text/html" href="${(browsePostUrl!'')?replace("&", "&")}" />
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<summary type="html">
|
<summary type="html">
|
||||||
<![CDATA[${username} updated blog post <a href="${(browsePostUrl!'')}">${title}</a>.]]>
|
<![CDATA[${username} updated blog post <a href="${(browsePostUrl!'')}">${postTitle}</a>.]]>
|
||||||
</summary>
|
</summary>
|
||||||
<author>
|
<author>
|
||||||
<name>${userId!""}</name>
|
<name>${userId!""}</name>
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<item>
|
<item>
|
||||||
<title>Blog post updated: ${title!"unknown"}</title>
|
<title>Blog post updated: ${postTitle!"unknown"}</title>
|
||||||
<link>${(browsePostUrl!'')?replace("&", "&")}</link>
|
<link>${(browsePostUrl!'')?replace("&", "&")}</link>
|
||||||
<guid>${id}</guid>
|
<guid>${id}</guid>
|
||||||
<description>${username} updated blog post ${title}.</description>
|
<description>${username} updated blog post ${postTitle}.</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@@ -3,12 +3,12 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<title>New discussion: ${title!'unknown'}</title>
|
<title>New discussion: ${topicTitle!'unknown'}</title>
|
||||||
<link rel="alternate" type="text/html" href="${(browseTopicUrl!'')?replace("&", "&")}" />
|
<link rel="alternate" type="text/html" href="${(browseTopicUrl!'')?replace("&", "&")}" />
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<summary type="html">
|
<summary type="html">
|
||||||
<![CDATA[${username} added topic <a href="${(browseTopicUrl!'')}">${title!'unknown'}</a>.]]>
|
<![CDATA[${username} added topic <a href="${(browseTopicUrl!'')}">${topicTitle!'unknown'}</a>.]]>
|
||||||
</summary>
|
</summary>
|
||||||
<author>
|
<author>
|
||||||
<name>${userId!""}</name>
|
<name>${userId!""}</name>
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<item>
|
<item>
|
||||||
<title>New discussion: ${title!"unknown"}</title>
|
<title>New discussion: ${topicTitle!"unknown"}</title>
|
||||||
<link>${(browseTopicUrl!'')?replace("&", "&")}</link>
|
<link>${(browseTopicUrl!'')?replace("&", "&")}</link>
|
||||||
<guid>${id}</guid>
|
<guid>${id}</guid>
|
||||||
<description>${username} added topic ${title!'unknown'}.</description>
|
<description>${username} added topic ${topicTitle!'unknown'}.</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@@ -3,12 +3,11 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<title>Discussion topic deleted: ${title!'unknown'}</title>
|
<title>Discussion topic deleted: ${topicTitle!'unknown'}</title>
|
||||||
<link rel="alternate" type="text/html" href="${(browseTopicListUrl!'')?replace("&", "&")}" />
|
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<summary type="html">
|
<summary type="html">
|
||||||
<![CDATA[${username} deleted topic ${title!'unknown'}.]]>
|
<![CDATA[${username} deleted topic ${topicTitle!'unknown'}.]]>
|
||||||
</summary>
|
</summary>
|
||||||
<author>
|
<author>
|
||||||
<name>${userId!""}</name>
|
<name>${userId!""}</name>
|
||||||
|
@@ -3,9 +3,8 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<item>
|
<item>
|
||||||
<title>Discussion topic deleted: ${title!"unknown"}</title>
|
<title>Discussion topic deleted: ${topicTitle!"unknown"}</title>
|
||||||
<link>${(browseTopicListURL!'')?replace("&", "&")}</link>
|
|
||||||
<guid>${id}</guid>
|
<guid>${id}</guid>
|
||||||
<description>${username} deleted topic ${title!'unknown'}.</description>
|
<description>${username} deleted topic ${topicTitle!'unknown'}.</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@@ -3,12 +3,12 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<title>Discussion topic updated: ${title!'unknown'}</title>
|
<title>Discussion topic updated: ${topicTitle!'unknown'}</title>
|
||||||
<link rel="alternate" type="text/html" href="${(browseTopicUrl!'')?replace("&", "&")}" />
|
<link rel="alternate" type="text/html" href="${(browseTopicUrl!'')?replace("&", "&")}" />
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<summary type="html">
|
<summary type="html">
|
||||||
<![CDATA[${username} updated topic <a href="${(browseTopicUrl!'')}">${title!'unknown'}</a>.]]>
|
<![CDATA[${username} updated topic <a href="${(browseTopicUrl!'')}">${topicTitle!'unknown'}</a>.]]>
|
||||||
</summary>
|
</summary>
|
||||||
<author>
|
<author>
|
||||||
<name>${userId!""}</name>
|
<name>${userId!""}</name>
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<item>
|
<item>
|
||||||
<title>Discussion topic updated: ${title!"unknown"}</title>
|
<title>Discussion topic updated: ${topicTitle!"unknown"}</title>
|
||||||
<link>${(browseTopicUrl!'')?replace("&", "&")}</link>
|
<link>${(browseTopicUrl!'')?replace("&", "&")}</link>
|
||||||
<guid>${id}</guid>
|
<guid>${id}</guid>
|
||||||
<description>${username} updated topic '${title!'unknown'}'.</description>
|
<description>${username} updated topic '${topicTitle!'unknown'}'.</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@@ -3,12 +3,12 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<title>Reply added: ${title!'unknown'}</title>
|
<title>Reply added: ${topicTitle!'unknown'}</title>
|
||||||
<link rel="alternate" type="text/html" href="${(browseTopicUrl!'')?replace("&", "&")}" />
|
<link rel="alternate" type="text/html" href="${(browseTopicUrl!'')?replace("&", "&")}" />
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<summary type="html">
|
<summary type="html">
|
||||||
<![CDATA[${username} added a reply to topic <a href="${(browseTopicUrl!'')}">${title!'unknown'}</a>.]]>
|
<![CDATA[${username} added a reply to topic <a href="${(browseTopicUrl!'')}">${topicTitle!'unknown'}</a>.]]>
|
||||||
</summary>
|
</summary>
|
||||||
<author>
|
<author>
|
||||||
<name>${userId!""}</name>
|
<name>${userId!""}</name>
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<item>
|
<item>
|
||||||
<title>Reply added: ${title!"unknown"}</title>
|
<title>Reply added: ${topicTitle!"unknown"}</title>
|
||||||
<link>${(browseTopicUrl!'')?replace("&", "&")}</link>
|
<link>${(browseTopicUrl!'')?replace("&", "&")}</link>
|
||||||
<guid>${id}</guid>
|
<guid>${id}</guid>
|
||||||
<description>${username} added a reply to topic '${title!'unknown'}'.</description>
|
<description>${username} added a reply to topic '${topicTitle!'unknown'}'.</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@@ -3,12 +3,12 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<entry xmlns='http://www.w3.org/2005/Atom'>
|
<entry xmlns='http://www.w3.org/2005/Atom'>
|
||||||
<title>Reply updated: ${title!'unknown'}</title>
|
<title>Reply updated: ${topicTitle!'unknown'}</title>
|
||||||
<link rel="alternate" type="text/html" href="${(browseTopicUrl!'')?replace("&", "&")}" />
|
<link rel="alternate" type="text/html" href="${(browseTopicUrl!'')?replace("&", "&")}" />
|
||||||
<id>${id}</id>
|
<id>${id}</id>
|
||||||
<updated>${xmldate(date)}</updated>
|
<updated>${xmldate(date)}</updated>
|
||||||
<summary type="html">
|
<summary type="html">
|
||||||
<![CDATA[${username} updated a reply of topic <a href="${(browseTopicUrl!'')}">${title!'unknown'}</a>.]]>
|
<![CDATA[${username} updated a reply of topic <a href="${(browseTopicUrl!'')}">${topicTitle!'unknown'}</a>.]]>
|
||||||
</summary>
|
</summary>
|
||||||
<author>
|
<author>
|
||||||
<name>${userId!""}</name>
|
<name>${userId!""}</name>
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
<#assign username = firstName + " " + lastName>
|
<#assign username = firstName + " " + lastName>
|
||||||
</#if>
|
</#if>
|
||||||
<item>
|
<item>
|
||||||
<title>Reply updated: ${title!"unknown"}</title>
|
<title>Reply updated: ${topicTitle!"unknown"}</title>
|
||||||
<link>${(browseTopicUrl!'')?replace("&", "&")}</link>
|
<link>${(browseTopicUrl!'')?replace("&", "&")}</link>
|
||||||
<guid>${id}</guid>
|
<guid>${id}</guid>
|
||||||
<description>${username} updated a reply of topic '${title!'unknown'}'.</description>
|
<description>${username} updated a reply of topic '${topicTitle!'unknown'}'.</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
<import resource="classpath:alfresco/templates/webscripts/org/alfresco/repository/requestutils.lib.js">
|
<import resource="classpath:alfresco/templates/webscripts/org/alfresco/repository/requestutils.lib.js">
|
||||||
|
<import resource="classpath:alfresco/templates/webscripts/org/alfresco/repository/blogs/blogpost.lib.js">
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes a blog post node.
|
* Deletes a blog post node.
|
||||||
@@ -25,20 +26,19 @@ function main()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var item = getBlogPostData(node);
|
||||||
|
|
||||||
var title = node.properties.title;
|
var title = node.properties.title;
|
||||||
var tags = node.properties.tags;
|
var tags = node.properties.tags;
|
||||||
|
|
||||||
deleteBlogPost(node);
|
deleteBlogPost(node);
|
||||||
|
|
||||||
// post an activitiy item, but only if we got a site
|
if (args["site"] != undefined && args["container"] != undefined && ! item.isDraft)
|
||||||
if (url.templateArgs.site != null)
|
|
||||||
{
|
{
|
||||||
var browsePostListUrl = '/share/page/site/' + url.templateArgs.site + '/blog-postlist?container=' + url.templateArgs.container;
|
|
||||||
var data = {
|
var data = {
|
||||||
title: title,
|
postTitle: title
|
||||||
browsePostListUrl: browsePostListUrl
|
|
||||||
}
|
}
|
||||||
activities.postActivity("org.alfresco.blog.post-deleted", url.templateArgs.site, url.templateArgs.container, jsonUtils.toJSONString(data));
|
activities.postActivity("org.alfresco.blog.post-deleted", args["site"], args["container"], jsonUtils.toJSONString(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -76,15 +76,15 @@ function main()
|
|||||||
|
|
||||||
model.item = getBlogPostData(node);
|
model.item = getBlogPostData(node);
|
||||||
|
|
||||||
// post an activitiy item, but only if we got a site
|
if (json.has("site") && json.has("container") && json.has("browsePostUrl") && ! model.item.isDraft)
|
||||||
if (url.templateArgs.site != null && ! model.item.isDraft)
|
|
||||||
{
|
{
|
||||||
var browsePostUrl = '/share/page/site/' + url.templateArgs.site + '/blog-topicview?container=' + url.templateArgs.container + '&postId=' + node.name;
|
var browsePostUrl = "" + json.get("browsePostUrl");
|
||||||
|
browsePostUrl = browsePostUrl.replace("{post.name}", model.item.node.properties.name);
|
||||||
var data = {
|
var data = {
|
||||||
title: node.properties.title,
|
postTitle: model.item.node.properties.title,
|
||||||
browsePostUrl: browsePostUrl
|
browsePostUrl: browsePostUrl
|
||||||
}
|
}
|
||||||
activities.postActivity("org.alfresco.blog.post-updated", url.templateArgs.site, url.templateArgs.container, jsonUtils.toJSONString(data));
|
activities.postActivity("org.alfresco.blog.post-updated", json.get("site"), json.get("container"), jsonUtils.toJSONString(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -74,27 +74,27 @@ function createBlogPost(blogNode)
|
|||||||
|
|
||||||
function main()
|
function main()
|
||||||
{
|
{
|
||||||
// get requested node
|
// get requested node
|
||||||
var node = getRequestNode();
|
var node = getRequestNode();
|
||||||
if (status.getCode() != status.STATUS_OK)
|
if (status.getCode() != status.STATUS_OK)
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ensureTagScope(node);
|
|
||||||
|
|
||||||
var post = createBlogPost(node);
|
|
||||||
model.item = getBlogPostData(post);
|
|
||||||
|
|
||||||
// post an activitiy item, but only if we got a site
|
|
||||||
if (url.templateArgs.site != null && ! model.item.isDraft)
|
|
||||||
{
|
{
|
||||||
var browsePostUrl = '/share/page/site/' + url.templateArgs.site + '/blog-postview?container=' + url.templateArgs.container + '&postId=' + post.name;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ensureTagScope(node);
|
||||||
|
|
||||||
|
var post = createBlogPost(node);
|
||||||
|
model.item = getBlogPostData(post);
|
||||||
|
|
||||||
|
if (json.has("site") && json.has("container") && json.has("browsePostUrl") && ! model.item.isDraft)
|
||||||
|
{
|
||||||
|
var browsePostUrl = "" + json.get("browsePostUrl");
|
||||||
|
browsePostUrl = browsePostUrl.replace("{post.name}", model.item.node.properties.name);
|
||||||
var data = {
|
var data = {
|
||||||
title: post.properties.title,
|
postTitle: model.item.node.properties.title,
|
||||||
browsePostUrl: browsePostUrl
|
browsePostUrl: browsePostUrl
|
||||||
}
|
}
|
||||||
activities.postActivity("org.alfresco.blog.post-created", url.templateArgs.site, url.templateArgs.container, jsonUtils.toJSONString(data));
|
activities.postActivity("org.alfresco.blog.post-created", json.get("site"), json.get("container"), jsonUtils.toJSONString(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,18 +78,17 @@ function main()
|
|||||||
|
|
||||||
model.postData = getTopicPostData(topicPost);
|
model.postData = getTopicPostData(topicPost);
|
||||||
|
|
||||||
// post an activitiy item, but only if we got a site
|
// create an activity entry
|
||||||
if (url.templateArgs.site != null)
|
if (json.has("site") && json.has("container") && json.has("browseTopicUrl"))
|
||||||
{
|
{
|
||||||
var browseTopicUrl = '/share/page/site/' + url.templateArgs.site + '/discussions-postview?container=' + url.templateArgs.container +
|
var browseTopicUrl = "" + json.get("browseTopicUrl");
|
||||||
+ '&path=' + url.templateArgs.path + '&postId=' + topicPost.name;
|
browseTopicUrl = browseTopicUrl.replace("{post.name}", model.postData.topic.name);
|
||||||
var data = {
|
var data = {
|
||||||
title: model.postData.post.properties.title,
|
topicTitle: model.postData.post.properties.title,
|
||||||
browseTopicUrl: browseTopicUrl
|
browseTopicUrl: browseTopicUrl
|
||||||
}
|
}
|
||||||
activities.postActivity("org.alfresco.discussions.post-created", url.templateArgs.site, url.templateArgs.container, jsonUtils.toJSONString(data));
|
activities.postActivity("org.alfresco.discussions.post-created", json.get("site"), json.get("container"), jsonUtils.toJSONString(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
@@ -75,20 +75,17 @@ function main()
|
|||||||
model.postData = createPostReply(node);
|
model.postData = createPostReply(node);
|
||||||
|
|
||||||
// add an activity item
|
// add an activity item
|
||||||
if (json.has("site"))
|
if (json.has("site") && json.has("container") && json.has("browseTopicUrl"))
|
||||||
{
|
{
|
||||||
// fetch the topic (and with it the root post
|
// fetch the topic (and with it the root post
|
||||||
var topicData = getTopicPostData(model.postData.post.parent);
|
var topicData = getTopicPostData(model.postData.post.parent);
|
||||||
var site = json.get("site");
|
var browseTopicUrl = json.get("browseTopicUrl");
|
||||||
var container = json.get("container");
|
browseTopicUrl = browseTopicUrl.replace("{post.name}", topicData.topic.name);
|
||||||
var path = json.has("path") ? json.get("path") : '';
|
|
||||||
var browseTopicUrl = '/share/page/site/' + site + '/discussions-topicview?container=' + container +
|
|
||||||
+ '&path=' + path + '&postId=' + topicData.topic.name;
|
|
||||||
var data = {
|
var data = {
|
||||||
title: topicData.post.properties.title,
|
topicTitle: topicData.post.properties.title,
|
||||||
browseTopicUrl: browseTopicUrl
|
browseTopicUrl: browseTopicUrl
|
||||||
}
|
}
|
||||||
activities.postActivity("org.alfresco.discussions.reply-created", site, container, jsonUtils.toJSONString(data));
|
activities.postActivity("org.alfresco.discussions.reply-created", json.get("site"), json.get("container"), jsonUtils.toJSONString(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ function deleteTopicPost(topicNode)
|
|||||||
{
|
{
|
||||||
// fetch the topic info as we need to get the title for the post for the activity
|
// fetch the topic info as we need to get the title for the post for the activity
|
||||||
var data = getTopicPostData(topicNode);
|
var data = getTopicPostData(topicNode);
|
||||||
var title = data.post.properties.title;
|
var topicTitle = data.post.properties.title;
|
||||||
|
|
||||||
// we simply delete the complete topic
|
// we simply delete the complete topic
|
||||||
var nodeRef = topicNode.nodeRef;
|
var nodeRef = topicNode.nodeRef;
|
||||||
@@ -23,15 +23,12 @@ function deleteTopicPost(topicNode)
|
|||||||
model.message = "Node " + nodeRef + " deleted";
|
model.message = "Node " + nodeRef + " deleted";
|
||||||
|
|
||||||
// post an activitiy item, but only if we got a site
|
// post an activitiy item, but only if we got a site
|
||||||
if (url.templateArgs.site != null)
|
if (args["site"] != undefined && args["container"] != undefined)
|
||||||
{
|
{
|
||||||
var browseTopicListUrl = '/share/page/site/' + url.templateArgs.site + '/discussions-topiclist?container=' + url.templateArgs.container +
|
|
||||||
+ '&path=' + url.templateArgs.path;
|
|
||||||
var data = {
|
var data = {
|
||||||
browseTopicListUrl: browseTopicListUrl,
|
topicTitle: topicTitle
|
||||||
title: title
|
|
||||||
}
|
}
|
||||||
activities.postActivity("org.alfresco.discussions.post-deleted", url.templateArgs.site, url.templateArgs.container, jsonUtils.toJSONString(data));
|
activities.postActivity("org.alfresco.discussions.post-deleted", args["site"], args["container"], jsonUtils.toJSONString(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -97,20 +97,16 @@ function main()
|
|||||||
model.postData = getReplyPostData(postNode);
|
model.postData = getReplyPostData(postNode);
|
||||||
|
|
||||||
// add an activity item
|
// add an activity item
|
||||||
if (json.has("site"))
|
if (json.has("site") && json.has("container") && json.has("browseTopicUrl"))
|
||||||
{
|
{
|
||||||
// fetch the topic (and with it the root post
|
var topicData = getTopicPostData(model.postData.post.parent);
|
||||||
var topicData = getTopicPostData(model.postData.post.parent);
|
var browseTopicUrl = "" + json.get("browseTopicUrl");
|
||||||
var site = json.get("site");
|
browseTopicUrl = browseTopicUrl.replace("{post.name}", topicData.topic.name);
|
||||||
var container = json.get("container");
|
|
||||||
var path = json.has("path") ? json.get("path") : '';
|
|
||||||
var browseTopicUrl = '/share/page/site/' + site + '/discussions-topicview?container=' + container +
|
|
||||||
+ '&path=' + path + '&postId=' + topicData.topic.name;
|
|
||||||
var data = {
|
var data = {
|
||||||
title: topicData.post.properties.title,
|
topicTitle: topicData.post.properties.title,
|
||||||
browseTopicUrl: browseTopicUrl
|
browseTopicUrl: browseTopicUrl
|
||||||
}
|
}
|
||||||
activities.postActivity("org.alfresco.discussions.reply-updated", site, container, jsonUtils.toJSONString(data));
|
activities.postActivity("org.alfresco.discussions.reply-updated", json.get("site"), json.get("container"), jsonUtils.toJSONString(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -120,16 +116,17 @@ function main()
|
|||||||
//model.topicpost = getTopicPostData(node);
|
//model.topicpost = getTopicPostData(node);
|
||||||
model.postData = getTopicPostDataFromTopicAndPosts(topicNode, nodes);
|
model.postData = getTopicPostDataFromTopicAndPosts(topicNode, nodes);
|
||||||
|
|
||||||
// post an activitiy item, but only if we got a site
|
// add an activity item
|
||||||
if (url.templateArgs.site != null)
|
if (json.has("site") && json.has("container") && json.has("browseTopicUrl"))
|
||||||
{
|
{
|
||||||
var browseTopicUrl = '/share/page/site/' + url.templateArgs.site + '/discussions-topicview?container=' + url.templateArgs.container +
|
var topicData = getTopicPostData(model.postData.post.parent);
|
||||||
+ '&path=' + url.templateArgs.path + '&postId=' + model.postData.topic.name;
|
var browseTopicUrl = "" + json.get("browseTopicUrl");
|
||||||
|
browseTopicUrl = browseTopicUrl.replace("{post.name}", topicData.topic.name);
|
||||||
var data = {
|
var data = {
|
||||||
title: model.postData.post.properties.title,
|
topicTitle: topicData.post.properties.title,
|
||||||
browseTopicUrl: browseTopicUrl
|
browseTopicUrl: browseTopicUrl
|
||||||
}
|
}
|
||||||
activities.postActivity("org.alfresco.discussions.post-updated", url.templateArgs.site, url.templateArgs.container, jsonUtils.toJSONString(data));
|
activities.postActivity("org.alfresco.discussions.post-updated", json.get("site"), json.get("container"), jsonUtils.toJSONString(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user