cancel
Showing results for 
Search instead for 
Did you mean: 

Web script to reassociate content with web form

aadhikari
Champ on-the-rise
Champ on-the-rise
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\\Smiley Tonguearentformname: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?
3 REPLIES 3

pmonks
Star Contributor
Star Contributor
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.

Cheers,
Peter

rogier_oudshoor
Champ in-the-making
Champ in-the-making
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 Smiley Wink

Cheers,

Rogier

pmonks
Star Contributor
Star Contributor
For the record, a Javascript based version of this code was developed and described at http://blogs.alfresco.com/wp/wabson/2008/08/04/web-script-repair-web-project/.

Cheers,
Peter