JavaScript error

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2007 09:12 AM
Hi.
in the first place I must excuse me for my very bad english…but I'm an italian boy
I'm studing from the "Alfresco Enterprise Content Management Implementation" book and I want to create a business rule with the follow custom script :
but don't work…probably becouse the Alfresco version of book is 1.4 and I use the 2.1 version.
Any suggestions?
Best regards and thanks for attention,
Matteo
in the first place I must excuse me for my very bad english…but I'm an italian boy

I'm studing from the "Alfresco Enterprise Content Management Implementation" book and I want to create a business rule with the follow custom script :
var stagingFolder = companyhome.childByNamePath("Intranet/Marketing Communications/Website Documents/Staging");var productionFolder = companyhome.childByNamePath("Intranet/Marketing Communications/Website Documents/Production");if(stagingFolder != null){ var i=0; var today = new Date(); stagingChildren = stagingFolder.children; stagingTotal = stagingChildren.length; for(i=0; i<stagingTotal;i++) { child = stagingChildren[i]; if(child.properties["cm:from"] <= today) { child.move(productionFolder); } }}
but don't work…probably becouse the Alfresco version of book is 1.4 and I use the 2.1 version.
Any suggestions?
Best regards and thanks for attention,
Matteo
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2007 09:36 AM
Do you get an error?
p.s. try to replace the blanks in your childbynamepath with "_x0020_"
e.g.:var stagingFolder = companyhome.childByNamePath("Intranet/Marketing_x0020_Communications/Website_x0020_Documents/Staging");
p.s. try to replace the blanks in your childbynamepath with "_x0020_"
e.g.:var stagingFolder = companyhome.childByNamePath("Intranet/Marketing_x0020_Communications/Website_x0020_Documents/Staging");

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2007 10:33 AM
I'm just do it…but don't work.
There's not an error…simply don't do anything
I've try an example script of Wiki Guide for Alfresco 2.0 and is all ok.
There's a log that I can see for information? In the dos shell don't gimme nobody information or error.
Thanks
Matteo
There's not an error…simply don't do anything

I've try an example script of Wiki Guide for Alfresco 2.0 and is all ok.
There's a log that I can see for information? In the dos shell don't gimme nobody information or error.
Thanks
Matteo

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2007 07:06 AM
p.s. try to replace the blanks in your childbynamepath with "_x0020_"
e.g.:var stagingFolder = companyhome.childByNamePath("Intranet/Marketing_x0020_Communications/Website_x0020_Documents/Staging");
The childByNamePath() method does not require encoding of characters - it uses the 'cm:name' matches directly.
mattew80:
You say it just doesn't work - but do those folders exist on your system? If not make sure they are created exactly as typed.
Kevin
