Archive for the ‘experiments’ Category

RichFaces on eXo

Wednesday, July 23rd, 2008

Once again, standards compliance pays off. As you know, at eXo we have a long story with standards compliance. Having a portlet API compliant portlet container, saved my day recently.

I was wondering how difficult it would be to run a RichFaces application in eXo. I was able to easily grab and build the source code of the JBoss RichFaces Demo Portlet.

A couple of xml changes later, I had it running quite nicely under eXo Portal. Take a peek at this video :

OK, that’s no more than what you can see elsewhere. But it is always good to know that our technology plays well with others.

The demo runs with the help of JBoss Portlet Bridge which is an early implementation of the JSR 301 : Portlet Bridge for JSF.
Even if only in 1.0.0 beta3, it looks very promising. Congratulations to the team!
At eXo, we will closely follow your progress and make sure that the bridge keeps playing well in eXo Portal.

[video] Introduction to the incoming eXo Chat

Saturday, July 5th, 2008

Great eXo Screenshot in an article about Open Source BI solutions

Thursday, June 19th, 2008

A nice article in French about SpagoBI deployed into the WebOS, the picture that shows reports and map analysis is really nice!

ovs_biopensourcepart1

New skin for eXo Chat

Wednesday, May 28th, 2008

The eXo Chat module - part of eXo LiveRoom (eXo LR) is on its way to be released on time

Here is the screenshot with the new skin.

Conversation

Another eXo Chat screenshot

Thursday, May 1st, 2008

As we said, eXo Chat will use XMPP. That means compatibility with many chat clients. Look at this screenshot, the browser communicates with Pidgin!

eXo Chat / Pidgin session

Christian Fauré questions for 18th April round table

Saturday, April 12th, 2008

No, We will not disclose the questions list yet… but just to say that the first draft of questions from Christian , who is moderating the table, are really high level. Expect a great show!

We will try to record the entire event for those who will not be able to attend.

eXo Portal 2.0 RC2 and eXo ECM 2.0 RC2 have been released

Friday, March 21st, 2008

We are getting closer to the final launch of our flagship products:

  •  eXo Portal 2.0
  • eXo Enterprise Content Management (ECM) 2.0

Both products will be the basis of the subscription versions we will launch in the incoming month. They are the result of dedicated packaging and an extensive QA applied on the community version that is available at OW2.

The product in its Release Candidate 2 state is favailable for test purposes to our partners and customers of the previous version that want to test it so do not hesitate to contact us to get the URLs to download them

Thanks again for your support!

eXo in Thailand

Friday, February 1st, 2008

I will be in Thailand for 2 weeks from the 3 to 18th of February. I will probably be the week-end in Bangkok. If you want to meet to talk about eXo or anything related, contact me on my mobile:  +33 6 71 25 15 49

eXo REST framework use case

Wednesday, January 23rd, 2008

The new version of eXo comes with a powerful REST framework following the guidelines defined in the JSR 311 specification (JAX-RS)

The idea of the REST framework is to provide a simple way to create server side APIs that allows to expose to third party systems most of the platform functionalities.

Note that that trend is extremely popular in the consumer web where corp like Yahoo or Google expose many services using the REST paradigm. Even the server side part of the new OpenSocial specification is REST based… and could be implemented using eXo REST framework!

1) Some samples

We have exposed several services using the framework from the low level layers like WebDAV to the higher one like providing a Facebook application using the REST framework to browse eXo Document Management repository.

Another sample is a REST service that expose all the contact of an eXo Collaboration Suite user. We also have a Flex based client that read the exposed XML and displays the contacts. The flex can be embedded inside a portlet, a widget or any other web application:

Flex client that talks to the REST service

 

 

 

[Update]  I also paste a screenshot of the iGoogle gadget that allows to browse the document repository on eXo. It leverages the WebDAV protocol that itself is implemented over the REST framework

eXo JCR Google Gadget

2) Technical aspects of the framework

So any eXo Java service can be exposed via REST, it just has to use Java annotations inside services to dynamically map an URL and Java entities.

One of the most important type of annotation is @URITemplate, applicable for TYPE and METHOD scope which define relative URL to expose given service via HTTP.

In simple cases, a RESTable method is uniquely addressed as a concatenation of a base URL, a TYPE scoped URITemplate annotation (if any) and a METHOD scoped URITemplate annotation. Parameters of the service can also be mapped to some elements of the URL as shown in the next code fragment. There an HTTP call to the URL “server.com/level1/toto/titi/tata” would directly invoke the method3 method with “toto”, “titi” and “tata” as the value of the 3 method arguments.

@URITemplate("/level1/{id1}/")
public class ResourceContainer_TEST implements ResourceContainer {

  @HTTPMethod("GET")
  @URITemplate("/{id2}/{id3}/")
  public Response method3(@URIParam("id1") String param1,
                                     @URIParam("id2") String param2,
                                     @URIParam("id3") String param3) {
    System.out.println("=== method3 called: id1 = " + param1);
    System.out.println("=== method3 called: id2 = " + param2);
    System.out.println("=== method3 called: id3 = " + param3);
    Response resp = Response.Builder.noContent().build();
    return resp;
  }
}

All HTTP methods like standard PUT, POST, DELETE ones can be used and referenced using the HTTPMethod annotation. A Response object is returned to the container, in our sample the Response does not contain anything; the ok method returns a 200 HTTP status code.

More complex URL template are also supported especially the one of type ?param1=value1&param2=value2 as shown in the next code fragment where the parameters are directly mapped to the method signature arguments:

@HTTPMethod("GET")
@URITemplate("/test/queryfilter/")
@QueryTemplate("method=method1&param1=param1")
@OutputTransformer(StringOutputTransformer.class)
public Response method1(@QueryParam("method") String method,
                                   @QueryParam("param1") String param1) {
  System.out.println(".. method=" + method);
  System.out.println(".. param1=" + param1);
  return Response.Builder.ok("method1", "text/plain").build();
}

Another important feature of that REST framework is the use of Transformer objects that can be easily plugged at the Response generation time.

In the previous example, the transformer class is a simple StringOutputTransformer that will convert the incoming object into a String output of type “text/plain”.

The framework contains several transformers that are ready to use such as XSLT4DOMOutputTransformer which takes a DOM element and will transofrm it using an XSL template file as shown in the next code fragment:

  @HTTPMethod("GET")
  @URITemplate("/test/xslt/{schema-name}/")
  @OutputTransformer(XSLT4DOMOutputTransformer.class)
  public Response method1(@URIParam("schema-name") String schemaName)
              throws Exception {
    Map p = new HashMap();
    p.put(XSLTConstants.XSLT_TEMPLATE, schemaName);
    Document d = DocumentBuilderFactory.newInstance().newDocumentBuilder()
        .parse(Thread.currentThread().getContextClassLoader()
        .getResourceAsStream(”book-in.xml”));
    return Response.Builder.ok(d, “text/html”).setTransformerParameters(p).build();
  }

3) The Contact REST Service

The ContactRESTService is a simple sample of an eXo service method that is exposed through a REST API.

Any URL of type “server.com/contact/getContactList/benjamin” will return an XML fragment within the HTTP response that will contain the list of all benjamin’s contacts that are located in the Contact Manager application of eXo CS.

As you can see in the next fragment, the code is simple, we simply get the ContactService and call the getAllContact method on the current user

@URITemplate("/contact/")
public class ContactRestService implements ResourceContainer {

  private ContactService contactService;
  private ThreadLocalSessionProviderService sessionProviderService;

  public ContactRestService(ContactService contactService,
                                      ThreadLocalSessionProviderService sessionProviderService) {
    this.contactService = contactService;
    this.sessionProviderService = sessionProviderService;
  }

  @URITemplate("getContactsList/{username}/")
  @HTTPMethod(HTTPMethods.GET)
  @OutputTransformer(XMLOutputTransformer.class)
  public Response getContact(
      @URIParam("username") String username)
      throws Exception {
	  System.out.println("Entering getContact Rest Method");
	  System.out.println("Get Contact list for username :"+username);
	  SessionProvider sp = sessionProviderService.getSessionProvider(null);
	  java.util.List listcontact = contactService.getAllContact(sp, username);
	  Iterator listiterator = listcontact.iterator();
	  org.w3c.dom.Document d= DocumentBuilderFactory.newInstance().
                   newDocumentBuilder().newDocument();
	  Element contactlist = d.createElement(”contactlist”);

	  while (listiterator.hasNext())
	  {
		  Contact contactobj = listiterator.next();

		  Element contact = d.createElement(”contact”);
		  Element exoid = d.createElement(”exoid”);
		  Element fullname = d.createElement(”fullname”);
		  Element firstname = d.createElement(”firstname”);
		  Element job = d.createElement(”job”);
		  Element nickname = d.createElement(”nickname”);
		  Element mail = d.createElement(”mail”);
		  Element birthday = d.createElement(”birthday”);

		  exoid.setTextContent( contactobj.getId());
		  fullname.setTextContent( contactobj.getFullName());
		  firstname.setTextContent( contactobj.getFirstName());
		  job.setTextContent( contactobj.getJobTitle());
		  nickname.setTextContent( contactobj.getNickName());
		  mail.setTextContent( contactobj.getEmailAddress());
		  if (contactobj.getBirthday()!=null)
                    birthday.setTextContent(contactobj.getBirthday().toString());

		  contact.appendChild(exoid);
		  contact.appendChild(fullname);
		  contact.appendChild(firstname);
		  contact.appendChild(job);
		  contact.appendChild(nickname);
		  contact.appendChild(mail);
		  contact.appendChild(birthday);
		  contactlist.appendChild(contact);
	  }
	  d.appendChild(contactlist);

	  return Response.Builder.ok(d,”text/xml”).build();

  }
}

Market Intelligence Survey on Enterprise 2.0

Saturday, January 12th, 2008

Dan Keldsen is organizing a survey about Enterprise 2.0 for AIIM. Participate!

Participants of this survey will be given an early, free copy of the findings and an invitation to a live web briefing on the results, both of which will be available in late March 2008. We are also looking for best and worst practices, and will be writing up case studies, so there is a chance for exposure if we use your examples in the research or training courses on Enterprise 2.0 we are launching in Q1 and Q2 of 2008.