Showing posts with label content management system. Show all posts
Showing posts with label content management system. Show all posts

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 ;)

Tuesday, September 2, 2008

Startup company : iCodix and the Jibe framework

I was pretty busy these days with being involved in a startup openings and now as a co-founder I am glad to announce its name iCodix. Our aim is to provide Java consulting services and Enterprise Content Management (ECM) solutions, especially based on the Alfresco platform. At this stage, where iCodix is just starting, we have an ajax based UI framework for Alfresco called Jibe (former AlfExt).

Jibe is a complete UI framework based on the javascript ExtJS library. It is tight to the Alfresco configuration and each UI component is configured on the server side and thus is easily reusable.
A lot of components are already implemented and some of them can be seen in the demos available here. However, one could add very quickly new components or layouts as there are a lot of 'cut' points' on which it is possible to attach any behavior or interaction with other systems.

Jibe's architecture was thought the way to easy the developer's work and to allow the developer to concentrate on the real problem and not to play around with javascripts anymore. Although, if new components are needed than for sure you have to write some javascript, but at least the need is minimum as there are existing components which are used the most in the business world, like panels, tabs, grids, labels, combo boxes, date pickers, tree lists and a few others.

Jibe is an addon to the Alfresco platform and we consider it as a UI framework for Alfresco, which is not yet replacing the complete Alfresco feature set but it is not said it will not. Alfresco is also working on some new UIs but they do not target the same market and the same level of integration. Jibe's components are all linked by events and thus it is easy to catch an event on some node or properties and to show or to act in any other component.

An integration with Groovy is implemented in Jibe and from now on if you are using Jibe, it is not needed to restart the server as far as the UI components configuration is concerned as well as the Groovy services that are integrating third party codes with the Jibe UI.

The deployment is done as any other Alfresco modules and Jibe coexists with the exiting Alfresco JSF client as well as with any other Alfresco UI clients. The Jibe framework contains a core module and other modules which are enabling different parts of the system like repository browsing or workflow management.

As an example of how an application could reuse Jibe and its powerful integration aspect, we integrated the opensource VoIP Asterisk server as a module where Alfresco is turned into a call/contact center, where Alfresco users are becoming agents and where documents are linked to incoming or outgoing calls. With the power of jBPM it is not that hard to implement a predictive dialer within the same and user friendly UI.

Well, our opinion is that Jibe is the UI layer where you could integrate different applications and to allow it to look as one. It comes out of the box with a powerful content management system which is Alfresco and it can turn on your world and your business :)

More about Jibe architecture can be found here. Although it is an old description but it could give you some ideas.