Enable “remote” root object in Alfresco 3.4+

From the 3.3 version Alfresco is overriding the Spring Surf webscripts container bean removing the remote definition.

This modification also affects number of custom webscripts developed with previous releases. Let see, how to enable “remote” root object in current Alfresco installation;

1. Find your “web-scripts-application-context.xml” configuration file in alfresco webapp, or in shared classes.
2. Search for “webscripts.container”, and update “map” contents like this:




3. Restart Alfresco server
4. Check custom configuration with following code:

var serviceUrl = (args.service === null) ? "/api/repository" : args.service;
var conn = remote.connect("alfresco");
var result = conn.get(stringUtils.urlEncodeComponent(serviceUrl));

Just another, non-remote solution: Nathan McMinn: Calling Web Services from the Alfresco Javascript API

Alfresco 3.4 flash preview fix

Just a quick fix to WebPreview issue by Alfresco 3.4.c Community edition on Linux…

Missing flash preview of contents occured by an invalid symbolic link in “/opt/alfresco-3.4.c/common/lib/” folder. You can test it with manual start of “pdf2swf” command:

root@ubuntu:/opt/alfresco-3.4.c/common/bin# ./pdf2swf
/opt/alfresco-3.4.c/common/bin/.pdf2swf.bin: error while loading shared libraries: /opt/alfresco-3.4.c/common/lib/libstdc++.so.5: file too short

The fix is really simple, create a new symlink:

root@ubuntu:/opt/alfresco-3.4.c/common/lib# mv libstdc++.so.5 libstdc++.so.5.bad

root@ubuntu:/opt/alfresco-3.4.c/common/lib# ln -s libstdc++.so.5.0.3 libstdc++.so.5

root@ubuntu:/opt/alfresco-3.4.c/common/bin# ./pdf2swf
Usage: /opt/alfresco-3.4.c/common/bin/.pdf2swf.bin [-options] file.pdf -o file.swf

Alfresco WebPreview fix

Update: installer bug already exists on 3.4d release…