Skip navigation
All Places > Alfresco Content Services (ECM) > Blog > 2008 > February
2008
wabson

Deployment Testing

Posted by wabson Employee Feb 1, 2008
One of the things we've improved massively in the forthcoming 2.2 release of Alfresco is the configuration and management of deployment targets. I've been playing around with this the last couple of days, using VMware to provide a couple of target hosts for testing.

wcm_configure_deployment.png

The file system deployer is really easy to set up - if you have Java already installed on the system then it's just a matter of unzipping the deployer package, chmod'ing the shell script and firing it up. This starts a lightweight background Java process which listens via RMI for incoming connections from the authoring server.

I had a couple of issues myself, probably more related to my environment than anything else. Firstly I had to disable IPv6 on the target host, since it was causing the receiver to bind using only this and not using IPv4. Although I could telnet from my main OS and from other VMs onto port 44100, Alfresco was throwing back ConnectionRefusedExceptions, which I assume is some limitation of RMI.

To do this on the Debian VM, I updated the /etc/modprobe.d/aliases file, commenting out the following line:

alias net-pf-10 ipv6

and adding in the following replacement:

alias net-pf-10 off

This solved the first problem, but I then started getting errors indicating that Alfresco couldn't connect to the host 127.0.1.1, seemingly something to do with the RMI server not picking up the proper IP address for the host. Rather than spend ages fiddling with the network settings, I simply added a -Djava.rmi.server.hostname argument to the command in deploy_start.sh, i.e.

nohup java -server -cp alfresco-deployment.jar:spring-2.0.2.jar:commons-logging-1.0.4.jar:alfresco-core.jar:jug.jar:. -Djava.rmi.server.hostname=192.168.60.130 org.alfresco.deployment.Main application-context.xml >deployment.log 2>&1 &

If your network configuration is sane and you're not running under VMware you probably won't need this at all. Obviously if you do then make sure you change your IP address to match that of the host.

Five minutes and three thousand assets later and apparently I had a successful deployment. Not bad.

wcm_monitor_deployment_success.png
Our recently introduced Facebook integration platform is an interesting showcase of Alfresco's Web Script framework.

I've been meaning to provide a quick overview here, but an Alfresco developers life is always busy working towards Alfresco vNext.  However, I had to write something after reading the DZone article 'Apache Wicket Facebook Integration'.

The article provides full source code to the simplest of Facebook applications; List My Friends.  It's cool to see a framework that assists Java developers build Facebook apps (it's mostly a PHP world), but this simplest of Facebook application requires 100 lines of code in Wicket.  And I don't think that's all of it, as there must also be configuration to complement the code.

Here's the equivalent in Alfresco... create the following files in the Alfresco repository:

app.[insert api key here].js
app.id='[insert application id here]';
app.secret='[insert application secret here]';

listfriends.post.desc.xml
<webscript>
<shortname>List My Facebook Friends</shortname>
<url>/facebook/listfriends/</url>
</webscript>

listfriends.post.html.ftl
<#list facebook.friends as friend>
<fb:name uid='$friend'/></#if friend_has_next>, </#if>
</#list>

That's a total of 9 lines of code.  There's nothing else to it.  Not even a build step.  Just register the application with Facebook.

That's 1/10th the lines of Wicket, or 300 characters vs 4000.

Once the 9 lines of code have been developed, you'll want to go through a test, code, test cycle.  Web Scripts make this simple, just change the code and hit refresh in the browser.  Wicket's Java equivalent just doesn't allow this.

Facebook apps are mostly content oriented in the context of a social graph. This is where Alfresco really shines, as of course, it provides a full set of content management services all accessible in Web Scripts.

Facebook Integration is just one showcase of Web Scripts.  The same principles apply to developing an Alfresco application, dashlet, JSR-168 portlet, iGoogle gadget, Atom feed, JSON data service, RESTful API, ...

Filter Blog

By date: By tag: