05-27-2012 06:40 PM
{
"nodes" : {"0":"workspace://SpacesStore/dc9d18c0-9c69-4256-8203-f246a760b6e9","1":"workspace://SpacesStore/d2afcbad-de5a-4eec-b421-b7b223b3fc5a"}
}
var json = remote.call("/someCo/blog/public?maxPosts=" + maxPosts);
if (json.status == 200)
{
//obj = eval('(' + json + ')'); - issue with missing ']'
obj = json.nodes;
}
logger.warn(obj);
nodes=obj;
logger.warn("Obj received of length " + nodes.length);
var results = [], result;
// Turn nodes into result objects
for (var i = 0, j = nodes.length; i < j; i++)
{
// Create core object
node = getNodeFromString(nodes[i]);
// Cut the site name out of displaypath
blogSite = node.displayPath.slice(20,node.displayPath.lastIndexOf("/"));
// Get the Person node for the blog creator
blogUser = people.getPerson(node.properties["cm:creator"]);
blogContent = node.content.slice(0,350) + "…";
result =
{
blogContent: blogContent,
name: node.name,
title: node.properties["cm:title"],
createdByUser: blogUser.properties["cm:firstName"] + " " + blogUser.properties["cm:lastName"],
createdByUserName: node.properties["cm:creator"],
blogSite: blogSite,
dateCreated: node.properties["cm:published"]
};
if (result.blogContent && result.name && result.title && result.createdByUser && result.createdByUserName && result.blogSite && result.dateCreated)
{
if (node.qnamePath.indexOf("cm:post") != -1 )
{
results.push(result);
}
else
{
logger.warn("Public Blog Post Dashlet - An item, nodeRef:" + node.nodeRef + ", has been assigned the public tag but is not a blog post (lacks cm:post in qnamePath). It has been ignored.");
}
}
else
{
logger.warn("Public Blog Post Dashlet - An item, nodeRef:" + node.nodeRef + ", has been assigned the public tag but lacks one or more required properties. It is likely not a blog post and has been ignored.");
}
}
model.resultset = results;
model.title = title;
}
{
"nodes" :
[
{
"blogContent" : "<p>Work Today<\/p>\n<p>Changed strategy with landing page - David Draper's blog, which John put me onto for the configuration to override Share's landing page after login, has instructions for defining an HTML page for landing. Unfortunately I have found that this does not work for the share dashboard-style pages as a rendering error occurs. An issue…",
"name" : "post-1335855405519",
"title" : "01\/05\/2012 - Chris",
"createdByUser" : "Chris O'Kelly",
"createdByUserName" : "ChrisO",
"dateCreated" : "01/May/2012",
"blogSite" : "it-intranet"
},
{
"blogContent" : "<p><strong>Work Today<\/strong><\/p>\n<p>compiled Postgresql client 9.0 on docs<\/p>\n<p>Tested backup script - working fine now<\/p>\n<p>Modified backup script to output a gzipped tar rather than a folder<\/p>\n<p> <\/p>\n<p>Finished MTP Train the Trainer course, added positioning slant to login page, made minor styling changes as of last weeks meeting …",
"name" : "post-1335218980072",
"title" : "23\/04\/2012 - Chris",
"createdByUser" : "Chris O'Kelly",
"createdByUserName" : "ChrisO",
"dateCreated" : "24/Apr/2012",
"blogSite" : "it-intranet"
}]
}
var json = remote.call("/someCo/blog/public?maxPosts=" + maxPosts);
if (json.status == 200)
{
obj = eval('(' + json + ')');
}
var nodes=obj.nodes;
logger.warn("Obj received of length " + nodes.length);
model.userIsSiteManager = userIsSiteManager;
model.resultset = nodes;
model.title = title;
05-29-2012 11:51 AM
05-29-2012 09:43 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.