A Maven based CMIS Tck to contribute in Apache Chemistry

My first real involvement in Chemistry definitely deserves a first post on the subject 😉

Lately I’ve been involved into refactoring the Alfresco CMIS Test Harness into an external Tck (Test Compatibility Kit) module to contribute to the Apache Chemistry. At the moment it’s mostly focused on the AtomPub part (including an Apache Adbera extension), but being based on Apache Maven standards should be fairly easy to scale out to WebServices binding testing.

This would be this first real contribution from Alfresco to the Chemistry project, where me and David Caruana have the luck of being involved as committers. At the moment the code for the will-be-called chemistry-atompub-tck is still hosted under the Alfresco contrib SVN space as still to be completed, but already offering quite some nice functionalities to test the compatibility of your server to the CMIS 0.6.2 standard.

The code (which was already in Alfresco and kept up to date to the CMIS standard directly by David) is now almost ready for contribution as it’s completely decoupled from Alfresco and uses a standard Maven build process (Junit + Surefire) to run compatibility tests against an existing (and running) CMIS server.

So, running a plain :

mvn test

will run all Junit tests against the specified serviceUrl with specified the username and password, using Maven POM properties as configuration mechanism. Additional configuration can be done in the POM to trace HTTP request/response conversation (useful for debugging purposes), and to configure some behaviors of the HTTP client.

In addition to that, due to the mighty Maven power a small addition to the previous command:

mvn test site:run

will allow you to point to anembedded Jetty server which publishes the test reports and shows errors and exceptions (amongst all the other nice Maven site features).

The idea at the base of this contribution is that this TCK can be used to test virtually any CMIS implementation and Maven profiles provide us a nice way to aggregate the full test fixture and publish the result in a nicely aggregated fashion. In fact, I started defining a profile called ‘alfresco’ which once run with:

mvn test -Palfresco

will configure the TCK to run against an Alfresco provided CMIS reference URL (or to do any Alfresco specific pre-requisite steps, like downloading it, installing a custom model and run it in Jetty for self contained testing).

In the same way I’d like all the other open source vendors involved in Chemistry to maintain their own profile which will serve as community reference for the CMIS readiness of a specific platform. Likewise we could setup ‘sharepoint’ or ‘documentum’ profiles to test existing public instances of those CMIS implementors, to always be up to date with their state of the art.

This will, of course, make much more sense once integrated in Chemistry but it’s already fully functional against the CMIS 0.6.2 standard and might be worth a try already. And if you feel to participate to the testing game, why don’t you make a CMIS server instance available and contribute the few lines of POM configuration to the project, filing a nice and easy JIRA issue?

Too much of a salesguy ? 🙂

Introduccion a Alfresco SHARE y SURF en Castellano

(Sorry to my few fellow English speaking readers, but I just took the decision that Spanish language is widespread enough to make my blog multilingual, effective as of now 😉 )

Esto tiene que ser mi primer post en Castellano, pero vale la pena intentarlo para compartir con la comunidad hispanofona la disponibilidad (en la Alfresco Content Community) de unas ponencias (PDF) que introducen conceptos teoricos y practicos de Alfresco SHARE y SURF, en Castellano!  Ademas aqui’ hay una introduccion a los projectos basados en Alfresco en contextos institucionales, en Castellano tambien.Presente’ esta ponencias durante los eventos de la semana pasada, hospedados en Valencia por los partners Alfresco Tissat y Indra.Cualquier comentario y consejo seria interesante para mejorar los temas y las practicas (voy a postar el codigo de los labs y ejercicios ASAP, especialmente lo para anadir una Dashlet que se conecta a Twitter).A ver si puede ser util para suportar la ya vibrante comunidad hispanofona!

First Maven Alfresco baby wails

Some random note, mostly to myself, to remember, in some dark Maven time, how cool this technology is and that sometimes, at a certain point sure, you CAN have success stories with it.

For now, as I anticipated I’m just playing around with Alfresco core modules, to see how they fit with Maven and how tough can it be to port the full suite.
And you know what guys, on Friday, in just 4 hours I was able to have the core AND webscript framework completely building and tested with Maven (98% success rate).

I mean, it’s just a beginning, but considering that Webscripts are meant/designed to be deployed and integrated also outside of Alfresco, well, you understand the power of having only to add few dependency lines.

I’ll just drop the raw log of my operations, to give you a raw idea what can take for the m10n of an Ant project and how easy it can be if the source project is well maintained and tested.

Alfresco core mavenization (m10n):

  1. Checkout the core
  2. Refactor source tree (source/java –> src/main/java) and test tree (search with Eclipse for *Test.java AND Test*.java and refactor them to src/test/java)
  3. Refactor resources (find them in source –> src/main/resources) and test resources  (find them in source –> src/test/resources)
  4. Create pom via m2eclipse by adding Maven nature
  5. Add dependencies (analyze .classpath file as first step, then cycles of  ‘mvn compile’ and fix)
  6. TIP: Use mvnrepository.com  or even better if you m2eclipse is configured with a proper Nexus/Maven classes index you can directly search deps clicking on the red underline of the compilation error from Eclipse
  7. Install missing/uncertain dependencies on local repo:
    cd alfresco/workspace/alfresco-head/projects/3rd-party/lib/
    mvn install:install-file -Dfile=jta.jar -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1b -Dpackaging=jar
    mvn install:install-file -Dfile=jug-lgpl-2.0.0.jar -DgroupId=jug -DartifactId=jug-lgpl -Dversion=2.0.0 -Dpackaging=jar
    mvn install:install-file -Dfile=ibatis-2.3.4.726-patched -DgroupId=com.ibatis -DartifactId=ibatis  -Dversion=2.3.4.726-patched -Dpackaging=jar
  8. Add target Java 1.5 in Eclipse project and in Maven:
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
    <source>1.5</source>
    <target>1.5</target>
    </configuration>
    </plugin>   
  9. Change line 47 in BaseTest.java
    // FIXME: Refactor this to take resource from classpath
    this.resourcesDir = System.getProperty("user.dir") + File.separator + "target" +
    File.separator + "test-classes" + File.separator;

Results:

Failed tests:
testJarSource(org.alfresco.config.xml.XMLConfigServiceTest)
Tests run: 54, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 2    6 seconds
[INFO] Finished at: Fri May 22 20:32:39 CEST 2009
[INFO] Final Memory: 8M/22M
[INFO] ------------------------------------------------------------------------

Well pretty cool if you consider only a couple of hours of work, 54 tests out of 55 working again 😉
That’s refactoring yeah!

Webscript Framework mavenization (m10n):

Pretty much the same steps, some dependency to deploy but basically the same trick.

Nice to note, under modules coupling POV, that the only intra-Alfresco dependency of the Webscript Framework is the Core, so that in another couple of hours I was able to run a

mvn clean install

on the Webscript frameowork project, with the following result:
Failed tests:
testRemoteStore(org.alfresco.web.scripts.TestRemoteStore)
testRemoteClient(org.alfresco.connector.TestRemoteClient)
Tests run: 16, Failures: 2, Errors: 0, Skipped: 0
[ERROR] There are test failures.
Please refer to /Users/mindthegab/Dev/alfresco/workspace/WebScript Framework/target/surefire-reports for the individual test results.
[INFO] [jar:jar]
[INFO] Building jar: /Users/mindthegab/Dev/alfresco/workspace/WebScript Framework/target/alfresco-webscript-framework-3.2.0-SNAPSHOT.jar
[INFO] [install:install]
[INFO] Installing /Users/mindthegab/Dev/alfresco/workspace/WebScript Framework/target/alfresco-webscript-framework-3.2.0-SNAPSHOT.jar to /Users/mindthegab/.m2/repository/org/alfresco/alfresco-webscript-framework/3.2.0-SNAPSHOT/alfresco-webscript-framework-3.2.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14 seconds

Ok needs refinement, and a proof of concept of integration in some webapp, but I feel already like all the “glue” power of Maven can be an additional enabler to such a feature-ful platform like Alfresco.
Suggest to stay tunes as I’ll definitely post more on this 🙂

The infinite tail of TODO

How come writing is always the last thing?
Before it was blogging, now fashion says we must micro-blog, and we even don’t have time to spend a few words on what we do. Effective as business, but blogging gave us a bit of writers pride, isn’t it? But it goes much earlier than that…the vast majority of software projects is developed almost until the end without any piece of seriously meaningful documentation.

Ok, ok, stop!

I was just finding lame philosophical excuses for not having blogged anything in this period of my life, such dense of changes in many aspects of my life and career. And this blog post keep staying in the infinite backlog of my TODOs.

May you live in interesting times

seems to run a famous Chinese or supposed to be Chinese curse, which I actually heard for the first at the Alfresco Rome’s meetup during my new CTO – John Newton – presentation, but that reflects the current status of my life, career and more in general world there days. Read more The infinite tail of TODO

Geek and Vain

It’s probably my first real recognition in open source matters. More soon will come, as I’m really putting my heart in the cause.
It was a nice surprise in fact to get to see my big face on Alfresco’s wiki home page, having been nominated January’s contributor of the month for the work on Alfresco and the Maven Archetypes.

Even if, I guess, the photo I sent the Alfresco guys reflects my vain nature 😉

Good stuff, especially as I’m trying to release the 3.0 version of the archetypes in a matter of days.  Stay posted on 3.0.0 branch and on Sourcesense‘s repo. And why not contribute? 🙂

God bless Open Source

Yes, it’s just yet another success story.

But still worth mentioning isn’t it? Especially when it happens right to you and right in one of the toughest period of my entire career.

So to keep it short: I’m working together with Marijn on some fully fledged complex Alfresco workflow, working on 3.0 but still on the “old” Alfresco web client (now renamed to Repository Explorer ).
Apart from Alfresco a bit odd JBPM Javascript implementation, we could get quite close to the fully working solution, but now that users are a bit struggling with the usability of the web client (and some lack of training) we are a bit delayed and trying to prioritize some issues.

One big requirement that has been left out was the possibility of displaying the task history of a workflow on the document details page. To be clear, Alfresco allows showing documents associated to a workflow, but the reverse association is not displayed and a document has no means of showing the task history that a specific document has undergone to.

About to drop this requirement, while googling around I came across this genius post, in which Marc de Kwant describes and shares the code of exactly this feature. Ok, I understand it’s a quite obvious requirement, especially in enterprise controlled documents contexts, but I mean, look at the picture, it’s exactly what I needed 😉Alfresco Task History Panel

That is extremely cool, and will allow to implement the feature in a matter of minutes.

Makes me wanna contribute to the project, just to give all my kudos to his great work (still have to try it actually, but appreciate the effort 😉 ).

The code is hosted here and if I look better at some comments on the blog post , seems that the gap of poor packaging of this feature (just a bunch of files dropped there) can be easily bridged with another success story, a one shot execution of my Maven AMP archetype. Guess it can make a really nice Forge contribution as such. Anyone interested to try it out?

I especially love when open source achievements come together in a product, which is typically more than double valued than the original addendums. That’s why I probably will always like, enjoy, be interested in being an open source integration pioneer.

SURF-ing Alfresco on the snow

I guess the title may sound a little odd, but actually leaving the coldest Dutch winter in ages (peaks around -20° degrees and nice snowy lanscapes especially in the Southern Holland) I was kinda hopeful that Munich could bring some joy to this Italian emigrant. But no joy for the foolish: already during landing I was announced a -12° not-so-warm welcome by the city where the Alfresco SURF Code Camp (held by Optaros) was held today.Luckily today, also thanks to the nice venue in a snowy park, but especially due to the presence of his Alfresco majesty Jeff Potts as main speaker, I could really get a feeling of what Alfresco SURF & SHARE are built upon, how they can be used and exploited to create rich user experiences based on emerging(ed) technologies like JSON, Atom and CMIS.

Exciting new perspectives in terms of architectural distribution and ease of UI development can open using SURF and the ReST approach as opposed to the old monolithic JSF Web client (now called Repository Explorer) customization.

And that was basically all what this very interesting Munich SURF Bootcamp was about.
Jeff Potts and the Optaros guys, which have supported Alfresco in the development of certain components of SHARE, organized this free one day workshop (same as in Chicago) covering both architectural and pretty technical aspects around this new way of developing frontends against an Alfresco repo with interesting walktroughs down to the code (nice idea here and fast working to deliver with pre-built VirtualBox/VMWare virtual machines).
What follows is a high level skecth of discussions and findings of the workshop while find my personal considerations at the bottom of the post (many thanks and all credits to Optaros and Jeff Potts for the pictures you find below):

Read more SURF-ing Alfresco on the snow

Maven for Alfresco on Google Code

Maybe it’s more social 2.0, maybe it’s more open source but on the other hand we the “big brother” threat is still there.
Anyways, for the record I moved the m2alfresco Alfresco Forge project to a better and safer place on Google Code, under the new fancy name of maven-alfresco-archetypes.

We’ve a Subversion repository, a Sourcesense hosted Maven2 repository, a mailing list (maven-alfresco nospam at nospam googlegroups.com) and a partner maintaned page on the Alfresco wiki.

Let’s assist and take part to the community miracle 😉

I’ll see you there…

Not Just yet another Maven success story

After struggling a bit too much with the maven-release-plugin under Apache Maven 2.0.9 and hierachical projects, I was finally able to release full support for Maven based Alfresco ECM lifecycle.

As I was mentioning in previous post, despite being one of the best piece of software I’ve worked on, Alfresco still lacks a lot in Enterprise ready delivery of its customizations, providing solutions based on Ant and custom tools like the Alfresco Module Management Tool which does not really fit in environments where control over versions, complex interdependent grids of applications are deployed on top of Alfresco, or simply when you not willing to perfom the (typically open source related) web googling-crawling to make that damn thing work.

In this sense I developed, based on successful internal Sourcesense and end customers implementations, a full support for Maven based Alfresco customizations. It’s documented in the Alfresco wiki, but basically comprise:

  • A maven-alfresco-extension-archetype which allows creation of a custom build of Alfresco community/enterprise,  basically producing a WAR as main build artifact, storing all customization in the alfresco/extension folder (Convention Over Configuration). All dependent AMPs (yes, we support AMP dependencies 😉 ) are included in the WAR. Typical usage scenario is the main Enterprise Alfresco build which includes base configuration settings (e.g. db, alf_data, custom model) then can include many satellite modules (AMPs produced by the maven-alfresco-amp-archetype)
  • A maven-alfresco-amp-archetype which allows creation of an Alfresco compatible custom AMP (Alfresco Module Package) .  basically producing a .amp  as main build artifact. The produced AMP is configured in the alfresco/modules/{pom.groupId}.{pom.artifactId} without requiring manual developer synchronization between module name and POM properties.
  • A maven-amp-plugin providing support for .amp files lifecycle, handling archiving, unarchiving, dependencies, install and deployment on enteprise repos

Cool features which you may find handy as a developer are

  • One commad creation of archetype from remote Sourcesense repositories (only maven 2.0.9 installed is required)
  • maven-jetty-plugin embedded run for integration testing,
  • environment dependent and single sourcing of application properties,
  • jboss/tomcat local/remote deployment with Cargo
  • Easy integration with other opensource frameworks due to wide Maven support

while as an enterprise release manager you could appreciate

Hopefully it can really gear contributions on Alfresco and grow it to the open source mature development process we try to deliver every day: and be careful, this is not only a Sourcesense marketing ad, but an approach already proof to be a development booster  on my project on a day by day basis since almost a year. And considering Alfresco 3.0 will be fairly modular, I think Maven has a point.

Give it a spin and let me know…

Issues are always welcome 😉

Alfresco and the sustainable open source
(aka Maven is your friend :)

Since almost one year I’m involved in Alfresco ECM huge architectures design, and considering my expertise in open source communities, I’m now at the level of being able to give a clear statement on which are the aspects (not in the Alfresco meaning 😉 in which this GREAT product still lacks, especially in terms of open source maturity and scalable community / enterprise application lifecycle support.

My past experiences with open source communities and frameworks like Apache Cocoon , recently released 2.2 version with features like complete springification but most important (to me) the full m10n (mavenization, from Apache Maven), taught me that even the most genius idea, the best architectural pattern or the killer app, will NOT have the desired penetration and adoption (and expected ROI, if you think about enterprise backed open source) if not properly backed by a solid foundation which can (at least) provide the following high level features (among many others which I consider as derivatives):

  • Easy inter-component and intra-component reuse gearing best practices
  • Centralized and standardized component management and definition
  • Fast project startup and (fast if not “hot”) develop-test-commit cycle

Read more Alfresco and the sustainable open source
(aka Maven is your friend 🙂