01-09-2014 04:52 AM
// ensure a TYPE is specified - if no add one to remove system objects from result sets
if (ftsQuery.indexOf("TYPE:\"") === -1 && ftsQuery.indexOf("TYPE:'") === -1)
{
//ftsQuery += ' AND (+TYPE:"cm:content" +TYPE:"cm:folder")';
ftsQuery += ' AND (+TYPE:"cm:content" +TYPE:"cm:folder" +TYPE:"cm:link" +TYPE:"app:filelink")';
}
var nodes = search.luceneSearch("@name:texas");
for each(var node in nodes) {
logger.log(node.name + " (" + node.typeShort + "): " + node.nodeRef);
}
01-09-2014 05:36 AM
if (node.isContainer || node.isDocument)
/**
* Returns an item of the document library component.
*/
function getDocumentItem(siteId, containerId, pathParts, node)
{
// PENDING: how to handle comments? the document should
// be returned instead
// check whether we already processed this document
if (checkProcessedCache("" + node.nodeRef.toString()))
{
return null;
}
// check whether this is a valid folder or a file
var item = t = null;
if (node.qnamePath.indexOf(COMMENT_QNAMEPATH) == -1 &&
!(node.qnamePath.match(DISCUSSION_QNAMEPATH+"$") == DISCUSSION_QNAMEPATH))
{
if (true || node.isContainer || node.isDocument)
{
item =
{
site: getSiteData(siteId),
container: containerId,
nodeRef: node.nodeRef.toString(),
tags: ((t = node.tags) !== null) ? t : [],
name: node.name,
displayName: node.name,
title: node.properties["cm:title"],
description: node.properties["cm:description"],
modifiedOn: node.properties["cm:modified"],
modifiedByUser: node.properties["cm:modifier"],
createdOn: node.properties["cm:created"],
createdByUser: node.properties["cm:creator"],
path: pathParts.join("/")
};
item.modifiedBy = getPersonDisplayName(item.modifiedByUser);
item.createdBy = getPersonDisplayName(item.createdByUser);
}
if (node.isContainer)
{
item.type = "folder";
item.size = -1;
}
else if (node.isDocument)
{
item.type = "document";
item.size = node.size;
} else {
// added MLN
item.type = "document";
item.size = 1;
}
}
return item;
}
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.