Book Review: Alfresco 3 Web Services

I’ve just finished reading Alfresco 3 Web Services, by Ugo Cei and Piergiorgio Lucidi, which Packt sent me to read and comment on.

Alfresco 3 Web Services is meant for developers with a very specific focus: Remotely talking to Alfresco. That might mean communicating via SOAP-based Web Services, RESTful web services (Web Scripts), or either protocol through CMIS. Whichever you choose, Ugo and Piergiorgio have you covered. I really like that the authors set out to write such a focused piece and stuck to it–it allows them to go deep on their topic and keeps the chapter length and total book length digestable.

The book is written very clearly and follows a logical progression. It starts out with SOAP-based services (first 5 chapters), including a chapter on .NET, and then moves on to web scripts (3 chapters). After that, the authors discuss AtomPub, which is an interesting, but not critical, background for the remaining 5 chapters of the book which focus on CMIS.

The discussion on web scripts covers both Java and JavaScript controllers, but JavaScript definitely gets more attention. Something developers new to the platform will find helpful is the chapter on FreeMarker. Most of Alfresco’s documentation and the books that are out there (including mine) relegate the FreeMarker API to appendices or just show examples and assume you’ll look up details later when you need it. Because it is typically such a key component of web scripts and other aspects of Alfresco, it was a good call to include it in the book.

The book comes with several small examples and a couple of tie-it-together examples. None of it runs out-of-the-box without some tweaking which isn’t a surprise given how rapidly things are changing in this area, particularly with regard to CMIS. At the time the book was written, OpenCMIS, the Java API for CMIS available as part of Apache Chemistry, had not been officially released. As I write this, the Chemistry team is about to release their second tagged build. The differences aren’t significant enough to cause confusion–most readers will be able to fidget with the import statements and the other changes required to get the sample code running.

I thought there was a little too much time devoted to SOAP-based Web Services, but that’s just personal preference and the fact that nearly all of my clients over the last four years have gone the RESTful route. The authors note that others may have the same preference and they make it easy to skip over those chapters if the reader wants to.

Although the chapters logically progress and build on each other, the code samples don’t–for the most part, each chapter’s code samples are self-contained. For example, I thought it was kind of strange that the code built in Chapter 13 for the CMIS Web Services binding examples isn’t used in Chapter 14 to build the CMIS Wiki example.

Many Alfresco implementation teams are divided into at least back-end and front-end teams and when the project is large enough, you can definitely have people focused on the middle. This book is perfect for that middle-ware team or for anyone who’s got a handle on the back- and front-ends and just needs to learn how to stitch them together. Nice job, Ugo and Piergiorgio.

5 comments

  1. Nate says:

    People developing with tools such as Powerbuilder or Peoplesoft will most likely gravitate to web services instead of the REST approach because their current experience using web services and also because of the demand to meet deadlines. Many non-Java and non-opensource developers will most likely desire to interface with Alfresco with web services. Web Services is what is common in most non-Java shops. But many are learning about REST and maybe someday REST will be the default choice for developers.

  2. Nate says:

    Also, I do not think that the authors tested their .NET examples with Alfresco 3.3x. The web service provides the [RepositoryServiceSoapPortClient] class for accessing the repository now. It no longer provides the [RepositoryService] class that is used on page 140 of the book. But I do think that the book is a welcomed addition to the community and covers a lot of important and needed topics.

  3. NRR says:

    Hello jeff,

    i am reading the alfresco 3 web services, the first chapters are quite clear but i can’t find a way to update multivalued properties. Please have you a link or an example for updating multi valued properties.
    Thank you

  4. jpotts says:

    I did not write the Alfresco 3 Web Services book, but let’s see if I can help you out.

    In Java, Alfresco returns multi-value properties as ArrayList<T>. So if you had a multi-value field of booleans, you’d get back an ArrayList<Boolean>. Typically, when you are working with multi-value fields, you want to maintain the values currently in the field and then add something to the end of the list. If that’s what you are trying to do, you make a call on the nodeService’s getProperty method, casting the result to the proper type as mentioned above. Then, you’d just do a put to add your new value to the list. Then you can do a setProperty to write the values back to the multi-value property.

    If you are creating one from scratch then you don’t have to worry about doing the get before hand.

    If you are using JavaScript, I think the return value is an Array. So if you wanted to create one from scratch in JavaScript, you’d init a variable with new Array(). Then add items to the Array, then set it on the appropriate property on the node ref.

    Make sense?

    Jeff

  5. david says:

    hai Jeff, in capter 5 i couldnot found the AwsSamples.sln. and how i can get the AwsSamples.sln.
    i need that code. thanks

    david

Comments are closed.