ECMAScript for XML (e4x) in Alfresco

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2007 08:24 AM
I was thinking it'd be quite handy to manipulate XML in an alfresco script. After a quick google moment I discovered E4X.
That looked pretty cool and it turns out it's supported by Rhino 1.6! But not the 1.6 in Alfresco 2.1, unfortunately - that's R4. What you need is R7. All you need to do is download the R7 jar and stick in your lib directory, restart Alfresco (not sure if that's necessary, but i did it anyway) and hey presto, you're in xml country!
Here's my easy step-by-step guide:
1. Download rhino1_6R7.zip from here.
2. Unpack it and rename js.jar to rhino-js-1.6R7.jar so it's easier to see what it is.
3. Copy it into alfresco/tomcat/webapps/alfresco/WEB-INF/lib or whatever your equivalent directory is.
4. Restart Alfresco.
There's some documentation here and a quick tutorial on W3 Schools. There's also examples in that Zip you download from Mozilla.org.
It seems quite neat. Is there any plan to include this newer release in future Alfresco builds (if it's not already)?
That looked pretty cool and it turns out it's supported by Rhino 1.6! But not the 1.6 in Alfresco 2.1, unfortunately - that's R4. What you need is R7. All you need to do is download the R7 jar and stick in your lib directory, restart Alfresco (not sure if that's necessary, but i did it anyway) and hey presto, you're in xml country!
Here's my easy step-by-step guide:
1. Download rhino1_6R7.zip from here.
2. Unpack it and rename js.jar to rhino-js-1.6R7.jar so it's easier to see what it is.
3. Copy it into alfresco/tomcat/webapps/alfresco/WEB-INF/lib or whatever your equivalent directory is.
4. Restart Alfresco.
There's some documentation here and a quick tutorial on W3 Schools. There's also examples in that Zip you download from Mozilla.org.
It seems quite neat. Is there any plan to include this newer release in future Alfresco builds (if it's not already)?
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2007 12:51 PM
Indeed. We have already upgraded Rhino on the HEAD SVN codeline for exactly this reason.
Thanks,
Kevin
Thanks,
Kevin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2008 01:11 PM
Related:
http://issues.alfresco.com/browse/AR-1720
Looks like it works in alfresco version 2.2 enterprise onwards.
http://issues.alfresco.com/browse/AR-1720
Looks like it works in alfresco version 2.2 enterprise onwards.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2008 01:43 PM
It also works in Alfresco 2.1, but the workaround listed in http://issues.alfresco.com/browse/AR-1720 needs to be manually applied.
