I am working on a web script that will all the content xml in a web project to a web form.
1. How do I get the noderef for a particular web form? 2. How do I return all the content files (xml) in a web project? 3. How do I associate the content files to the web form?
I am trying the following ways to get the content: var contentFiles = avmstore.luceneSearch("wca\\arentformname:superform"); var contentFiles = avmstore.luceneSearch("TYPE:"+"{http://www.alfresco.org/model/content/1.0}content"); var contentFiles = avmstore.luceneSearch("@cm\:abstract.mimetype:" + "text/xml"); var contentFiles = avmstore.luceneSearch("PATH:"+"/*"); var contentFiles = avmstore.luceneSearch("PATH:"+"/*");
but when i do var numOfContentFiles = contentFiles.length; the value returned is always 0. I created several files, but none of them are picked up by the luceneSearch. How can I tell if luceneSearch is working?
There is already code that does this on the Forge (albeit not as a Web Script) - it can be found at http://forge.alfresco.com/projects/wcm-tools/. Note that this code was developed for 2.0 and 2.1, but I believe Roger is in the process of porting it to 2.2.
The port is finished and functional in our environment, and uploaded to the forge. I'd be happy to see it tested in other environments aswell, so please go ahead and download/build the latest svn version