08-10-2011 04:16 AM
var displayPaths = document.displayPath.split("/");
var CurrentSiteName = displayPaths[3];
var query = "+PATH:\"/app:company_home"
+"/st:"+search.ISO9075Encode("sites")
+"/cm:"+search.ISO9075Encode(CurrentSiteName)
+"/cm:"+search.ISO9075Encode("documentLibrary")
+"/cm:"+search.ISO9075Encode("03 Packages")
+"/cm:"+search.ISO9075Encode("03 PIP")
+"/cm:"+search.ISO9075Encode("PP002")
+"/cm:"+search.ISO9075Encode("DO")+"//*\"";
var docs = search.luceneSearch(query);
for (var i=0; i<docs.length; i++)
{
if (docs[i].isContainer == false)
{
var documentPath = docs[i].displayPath.split("/");
var documentLocation = "";
var associations = docs[i].nodeRef;
for (var j=0; j<documentPath.length; j++)
{
documentLocation += documentPath[j] +"/";
}
documentLocation += docs[i].name;
var props = new Array(3);
props["docl:docNo"] = docs[i].name;
props["docl:version"] = docs[i].properties["cm:versionLabel"];
props["docl:document"] = docs[i].createAssociation( associations,"docl:document");
var docName = "DocList_" + i;
var doclist = space.createNode(docName, "docl:documentList",props);
//doclist.createAssociation( associations,"docl:document");
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="docl:doclDatalist" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>Custom Bhukka datalist</description>
<author>Eugene vRvOudtshoorn</author>
<version>1.0</version>
<!– Imports are required to allow references to definitions in other models –>
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<!– Import Alfresco Data List Model Definitions –>
<import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl"/>
</imports>
<!– Introduction of new namespaces defined by this model –>
<namespaces>
<namespace uri="docl.customlists.com" prefix="docl"/>
</namespaces>
<!– T Y P E D E F I N I T I O N S –>
<types>
<!– Data list defintions For this model go here –>
<type name="docl:documentList">
<title>Document List</title>
<description>Document List</description>
<parent>dl:dataListItem</parent>
<properties>
<property name="docl:docNo">
<title>Document no</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
<property name="docl:version">
<title>Version</title>
<type>d:text</type>
<mandatory>false</mandatory>
</property>
</properties>
<associations>
<association name="docl:document">
<title>Document</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:content</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
</types>
</model>
08-22-2011 04:05 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.