04-09-2013 03:40 AM
if (document.isContainer)
{
var level = document.partens.length;
if(level == 0)
{
document.addAspect("marker:folderLevel_0");
}
if(level == 1)
{
document.addAspect("marker:folderLevel_0");
}
if(level == 2)
{
document.addAspect("marker:folderLevel_0");
}
}
04-09-2013 04:09 AM
04-09-2013 07:52 AM
if (document.isContainer)
{
if(space.parent.parent.parent != null)
{
document.addAspect("marker:folderLevel_0");
}
if(space.parent.parent != null)
{
document.addAspect("marker:folderLevel_1");
}
if(space.parent != null)
{
document.addAspect("marker:folderLevel_2");
}
}
04-09-2013 09:59 AM
function getDepth(node, level) {
if (node == companyhome) return level;
return getDepth(node.parent, level +1);
}
document.addAspect('marker:folderLevel_' + getDepth(document, 0));
function getDepth(node, level, rootNode)
, then use this as a comparison: if (node == rootNode)…
then also you can call the script to find the depth relative to, in example, document library of a site, like this: document.addAspect('marker:folderLevel_' + getDepth(document, 0, site.getContainer('documentLibrary')));
04-09-2013 11:06 AM
if (document.isContainer)
{
var i = 0;
var fdepth = 0;
var totalDepth = 0;
totalDepth = lookForParent(document, i, fdepth);
//name folder with max depth
document.name = totalDepth;
}
function lookForParent(node, cnt, depth)
{
//max depth for recursion
if(cnt == 5)
{
return depth;
}
if(node.parent != userhome)
{
cnt++;
depth++;
node.addAspect("marker:folderLevel_1");
return lookForParent(node.parent, cnt, depth);
}
return depth;
}
04-11-2013 03:00 AM
04-12-2013 09:54 AM
if (node.properties.nodeRef == site.getNode().properties.nodeRef) {
// we've hit the site node
// or userhome.properties.nodeRef, or companyhome.properties.nodeRef
}
04-12-2013 09:56 AM
04-15-2013 03:48 AM
if (document.isContainer)
{
var cnt = 0;
if(checkSubFolderLevel(document, cnt) >= 3)
{
cnt = 0;
addAspToParentFolder(document, cnt);
}
}
else
{
document.addAspect("ccm:marker_Aspect");
}
function checkSubFolderLevel(node, cnt)
{
//max depth for recursion
if(cnt == 100)
{
return cnt;
}
//look for site folder
if(node.name == "documentLibrary")
{
return cnt;
}
cnt++;
return checkSubFolderLevel(node.parent, cnt);
}
04-15-2013 04:06 AM
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.