Thursday, December 9, 2010

Alfresco @MVC part 2 - views

As explained in my previous post, the idea behind Alfresco @MVC is to provide spring annotations through an Alfresco webscript. Why a webscript? Well, simply because it avoids changing the web.xml file and to use AMPs (alfresco module packages).

A part from that, all this would allow to use spring views and all the features spring @MVC has to offer, like annotated parameters, return methods types and so on. I do not have to preach for spring @MVC but I like using it on my projects and know I can use it with Alfresco ... cool.

Many of you know about the framework I developed for Alfresco (Jibe) but what Jibe does is imitating Spring in a lot of features and one thing that is helpful is having conditions to evaluate a role or group for instance. Meaning that a specific view is shown to that group of people.

What about JSPs? At the end that is the solution I appreciate as it is standard and many developers know it, opposed to learning a new framework. Using a tag library is the solution. I have many tag libraries defining different needs like roles, groups, permissions and it is easily extendable in a standard way.

One more thing to note is the usage of JSON. Again a simple spring annotation @ResponseBody allows to return a JSON representation of your model.

Soon I will show some examples but for now Alfresco @MVC has some previews and a starting documentation, what is good is that there is no need for a lot of documentation as Spring has it:)

More info can be found here.

Cheers.

Thursday, November 18, 2010

Alfresco @MVC

I was never happy with webscripts and I always preferred using Java to Javascript server-side programming ... but that is just a personal opinion and preferences.

Alfresco 3.4 came with Springframework 3, I have to say that Alfresco has been really slow in adapting newer versions of different technologies and probably they will remain, but this move is a good one and I was waiting for that for a long time. A lot of people are using Springframewok and especially the @MVC annotations and now we can do the same with Alfresco, of course not out of the box.

To achieve that I wrote a webscript which enables the usage of Spring @MVC inside of any Alfresco modules (AMP). Sure, I must admit that Alfresco Share is using it but I am a partisan of using Alfresco as a platform and not only as a repository, therefore I prefer writing java code integrated with the Alfresco Java API. This way of working opens huge possibilities and you can be much faster in developing new controllers than new webscripts. This approach is a standalone webscript design and let Spring @MVC do the rest for you.

I did not yet published the code but will be done soon at Google code. However here is a preview of what you can do ...

Firstly you need to initialize the webscript as you would do with any other webscript

<bean id="webscript.com.gradecak.spring.dispatch.post" class="com.gradecak.spring.webscript.DispatcherWebScript" parent="webscript" scope="prototype">

<property name="contextConfigLocation" value="/WEB-INF/classes/alfresco/module/com.gradecak.spring/context/dispatcher/servlet-context.xml">

</property>

</bean>


than in the servlet-context.xml you simply enable Spring annotations and use all the Spring config you want ...

...
<context:annotation-config />

<context:component-scan base-package="com.gradecak.spring.controller" />

...


and than in the controller you are free to use Alfresco's Java API or any library that you want

@Controller
@RequestMapping("/user/*")
public class UserController {

@RequestMapping(value = "get", method = RequestMethod.GET)

public String getUser(@RequestParam String userId) {
....

}

}


Sure, some minor problems appear if you want to use Freemarker as the view but that is just a matter of having Alfresco include a newer Freemarker JAR file and if you want to use a JSON view, Spring is coming with Jackson, but for a higher integration we need a later version of Spring than 3.0.0 provided by Alfresco ... so let's the show go on ;)

Wednesday, September 1, 2010

Content repositories and their user interface

After a long time I decided to write my thoughts about enterprise content management systems (CMS) like Alfresco and the user interface that is distributed with it.

In an effort to simplify their IT architectures and optimize systems company-wide, many businesses are standardizing on a single content- management platform for document management, Web-content management, imaging and intranet publishing. To do so there are plenty of solutions and technologies on the market allowing users to save, update and find their content but many of them lack of a suitable user interface nor a fluid accessibility.

Traditional solutions offer a strong central content repository and an enterprise database without satisfying user's actual needs like effectiveness or simple usability. On the other hand, the user interface is rarely given such attention and I do think there is a huge gap between repositories and the way they interact with the user.

As I am in that business I might sound subjective and probably that I am, but for a couple of years my company (Jibe Source also used to be named iCodix) is targeting especially that market.

Friday, September 4, 2009

Review : Alfresco 3 Enterprise Content Management Implementation


When I started reading this book (Alfresco 3 Enterprise Content Management Implementation) I had the sentiment it will be a comparison between the JSF UI client and Share. However, the authors guide the reader through the complete deployment lifecycle, from the installation of Alfresco and MySql to the usage of the exposed interfaces or protocols like CIFS, CMIS and the new Sharepoint protocol.

If you are new to Alfresco you can learn how to customize Alfresco UI or how to configure a SMTP server to work with Alfresco. Users, groups, permissions, roles, authentication and security are well explained, and there are enterprise use cases that can help the reader to put his hands in practice. Integration with LDAP (OpenLDAP and AD, chaining), JAAS, Kerberos, NTLM is completely described and SSO with CAS will help you to round the picture.

This book is not only about explaining what Alfresco is and can do, but it will help the reader to chose the best solution for his installation. Users migration is a big thing for a lot of companies and you will not regret to read this book in order to learn how to do that.

There are also advanced parts like creating custom models, categories, workflows with jBPM. In the chapter 9, the authors show how to integrate external applications with Alfresco. Integrations through webscripts with Droopal, Joomla, FLEX, emails, iPhone, Google, Facebook are very attractive and could be easily extended to a high level enterprise application.

In the next chapter (10), it is clearly explained how one can benefit from the MS Office integration with Alfresco and how to use the Sharepoint protocol, in order to be able to use several repositories with one user interface.

What I did like, simply because I do not have much experience with yet, is the OCR integration the chapter 13. So, scanning and optically recognizing text in documents could be one of the last steps in your document management integration and if you need video or audio transcoding than I can only recommend this book.

In my opinion this book could be useful for system administrators, new and advanced users, as well as managers willing to use a open source content management system in their company.

Saturday, July 18, 2009

Book : Alfresco 3 Enterprise Content Management Implementation

I received a new book for review and before I read it and publish my comments here is an extracted article titled "Implementing Alfresco 3.0 Documentation" that could be of interest for some of you.

Friday, January 2, 2009

Are Javaspaces recognized?

After some long discussions with my partner about the JavaSpaces topic I still have no clue why JavaSpaces or at least the Space Based Architecture (SBA) is not adopted by the developers and/or the "architects".

Personally, when it comes only to Java, I think that JavaSpaces could offer a complete stack from the event driven approach to rule engines, with including transactions (local and XA). My question is, am I under/over seeing something or the JavaSpaces and JINI are not being enough marketed by SUN, or the technology is too complicated for us the "developers". For the integration with other technologies or programming languages I for sure do opt for REST or for an ESB.

I see the JavaSpaces as an Object-oriented DataBase and also that some other technologies could almost perfectly fit in, like JMS and maybe even a workflow engine. What is surprising to me is that JavaSpaces are not a new technology and that today when most people are talking about grid or cloud computing, nobody is mentioning JavaSpaces. For sure it is much easier to distribute an existing application with Teracotta than writing a highly scalable application with a good architecture behind.

I also wrote about JAIN SLEE in a previous post and such a "soft real time" technology could also fit in JavaSpaces, at least in my opinion. JavaSpaces seem to be used only in highly scalable environments like Banks need, but what is the difference with Document Management, there we also do need a highly scalable environment.

There is an open source project Blitz and a commercial vendor GigaSpaces providing a community edition, personally I would chose GigaSpaces as it is a company with a big knowledge on the matter and their engine offers a lot of interfaces and features than the JavaSpaces specification describes.

Well, I just wanted to put my thoughts in this post and to make a relation between those kind of possibilities, maybe I am totally wrong but I would like to hear or find a good reason for that.

Tuesday, December 16, 2008

Book review : Alfresco Developer Guide

You think you are an Alfresco expert ... well, read this book and think again. This is actually my conclusion and I was thinking about only having that sentence in this review, because while reading this you are wasting your precious time as you could read the Alfresco Developer Guide.

For sure this is not a book for "Java enterprise" novice people and some knowledge and understanding of the Java enterprise stack is required to fully enjoy your reading time. Since I am working with Alfresco for more than 3 years now, I had some development habits that sometimes were not that good, which I realized after reading this book.

You know or you heard about JBPM, the workflow engine Alfresco is using, it is not a problem, a complete guide is explaining all you need to know to start writing your own flow and to get it deployed. Creating your application model, customizing actions, localizing your messages ... nothing is a secret any more.

If you want to learn how to get all the benefits out of your "electronical" content then check out the "chapter 4" and see how to add your own content extraction, create business specific content transformation or use Alfresco's Java behavior cut points. After all, an enterprise solution should be able to provide easy integrations with other systems, especially for SSO and LDAP - you want it, Alfresco's has it, Jeff Potts explains it.

If you are still fan of JSF than you could learn how to customize the default Alfresco User Interface, which is JSF based or learn how to write a custom UI using the webscript framework.

Jeff also helps you to bring some best practices in your Alfresco development and deployment lifecycle. However, I would prefer to see some more words about Alfresco Module Packages.

This book was published just before Alfresco 3.0 Enterprise edition was released and is based on Alfresco 2.2 and 3.0 Labs (or community version). Alfresco did some refactoring but nothing was changed that should bother you. Do not be afraid of getting the book as this is probably the best Alfresco book written for developers by a, more than professional, developer.

Alfresco's ECM capabilities are explained by example but you would like to see Alfesco's WCM possibilities, simply check the "chapter 8" and you will find anything you need to start using it.

Do you still think you are an expert ? :) I do not ...

Book details could be found at http://www.packtpub.com/alfresco-developer-guide/book