Damien Metzler's posterous

Damien Metzler's posterous

Damien Metzler  //  

Oct 24 / 5:12am

A few notes after Nuxeo World 2011

Last week, I was at Paris for Nuxeo World 2011, the yearly meeting for all Nuxeo customers and developpers. Before that, I attended the Nuxeo Sprint for two days, developping on stuffs with the Nuxeo team. Here are some notes about both events

 

Nuxeo Sprint

There were two subjects i had to develop on for this two days. The first on was to share ideas about a basic WCM framework on top of Nuxeo. Two guys of PCSol showed us what they did for site they made and I presented what we call "Labs" a site factory for people who don't know what is the web.

For this part, we wanted to be able to compose webengine apps instead of using inheritance. Think of a module that know how to handle comments, another one ratings etc... The problem was that we had to drop the support of webobject because they're the cause of the inheritance limitation. 

We decided to externalize the templates resolution in an external service (made by Anahide) and Bogdan made a JAX-RS app that make use of this service. The main problem is that webengine already have a lot of cool feature, and "front-porting" them to the new model seems to be quite long. 

 

The second subject was about to integrate our work on rating into Nuxeo. I did this job with Laurent Doguin, and since our modules were plenty of tests, it took us merely one day to do it. The code is already available here : 

http://hg.nuxeo.org/sandbox/nuxeo-platform-rating/

There still should be some better JSF integration to be able to play with the jquery rating plugin. We use it extensively in our webengine apps, so it should be quite stable.

 

Nuxeo World DAY 1

As last year, the event took place at "Théâtre des variétés" in Paris. After a cup of coffee, I rejoin my Leroy Merlin team and attended the opening talk of Eric Barocca. To summarize, Nuxeo is gaining more and more customer in a wider and wider functionnal area : Leroy Merlin intranet was one of the three samples Eric choosed. When looking at the growth of Nuxeo Studio active projects, the Configuration as a Service seems to be very successful. Studio was used a lot during these two days to demonstrate the fact that creating a new document type, a new operation is a very easy task.

Next talk was Sword (Platinum sponsor) explaining their experience in document oriented application.

Then Benjamin Jalon, Nuxeo DM product manager, showed us the evolution of the leading application of Nuxeo. This was a real social oriented presentation ! It was the first someone other than me made a talk about the opensocial stuffs a Nuxeo. I really loved what they made with our container. This is for me a complete new way for adressing ECM. You now don't think on folders, hierarchy etc... but you think of Social Collaboration folder with simple security rules. There are some things that are public, and other which are only visible by the workspace members. This is powerfull, since you can expose some public stuffs to people outside of the workspace and let other be private.

Documents are visible via content widgets that you can drop on a fully customizable layout. 

There is also a new activity feature that records all users interactions with document. Mini-message use this features to give the user to "tweet" some messages the the workspace's members. 

After that, I choosed to hear Stefane Fermigier and Oliver Grisel talk about semantic stuffs. After a brief introduction to semantic web by Stefane, Olivier made a demo of the semantic integration in Nuxeo. Imagine that when you upload some documents in Nuxeo, they're analyzed to extract entities from the corpus : person, organization, countries. Compared to last year's demo, the integration is better done in nuxeo DM, it can use french corpus and there is a connector to the Temis semantic engine. There is also a cache on DBPedia database that make the searches a lot faster. 

One other thing is that after extracting entities, the engine can suggest you some topics on the document. Imagine you have extracted the French country and that a lot of economic organization are extracted two, it can suggest that the document is about french economy. 

 

After the lunch, there was the Nuxeo roadmap talk by Thierry Delprat. A I didn't took any note, I can't enumerate all the stuffs but the global feeling is that there will be a lot of infrastructure enhancements : 

  •  Nuxeo for the cloud
  •  Apricot integration to make it possible to run Nuxeo on pure OSGi. 
  •  Various libs for the mobile platforms (Android and iOS)

For the functionnal features, you'll see the fusion of Nuxeo-DM and DAM and  version alignement. At deploy time, you choose what feature to activate. CMF will also be integrated in Nuxeo DM.

Next, I attended a talk about mobile usage of content apps. They made a small demo of what can be done with an Android tablet. The main thing is that Nuxeo will provide a library that will take care of the communication with the nuxeo server even if the network is done. In offline mode you're still able to create documents : they will be taken back to the server when the network goes back. I'm really waiting for the same lib for iOS. 

 

Nuxeo World DAY 2

For this morning, I had to prepare some slide for my pres so I unforutnately couldn't attend the first keynote. I hope there will be a cool video since it seems to be a cool talk from Whashington Consulting's Laurence Hart.

Next was a tech talk by Thomas Roger on the opensocial integration. There are plenty of stuff that make it easier to play with gadgets in Nuxeo. I then showed some of the usage we have of the opensocial container at Leroy Merlin. 

After the lunch break, I came to see a talk on Nuxeo DAM. First of all, it will be merged back into Nuxeo DM to give a "Media Sharing" tab in the main interface. Then the video extraction has well evolved : 

  • Use of HTML5 video player with fallback on flash
  • Storyboard extraction in video

Despite it can't be used as a Youtube backend for performance reasons, it allows one to store their video in a way it can be viewed in a web browser. The performance issues regarding streaming will perhaps be adressed during this year.

After that I came to see a use case on media publishing with the integration of a Flex app + Nuxeo + Quark XPress server. This was a really cool demo with live preview of documents and a very fluent interface thanks to Flex. 

Then I came back to the main room to see Bogdan demo of the Nuxeo IDE. You can think of Nuxeo IDE as the prolongation of Nuxeo Studio into your IDE. There is a real integration of your Nuxeo Studio project into Eclipse so that you can deal with your own Java developpement. It also support hot reload for your project just by pushing a simple button. 

 

 

That's all for me, I had to leave to take my train and come back to Lille. I had a really pleasant time during this four days with really kind and bright people. I come back to my work with a lot of ideas and perhaps future project leveraging the Nuxeo platform !

 

 

 

Filed under  //  nuxeo   opensocial  
Jan 18 / 4:24am

GWT integration with Nuxeo Tutorial

Last week-end, I followed the indication of Bogdan Ste fanescu to make Nuxeo and GWT work well together. In fact we already use GWT and Nuxeo for our OpenSocial container but we were unable to take advantage of the hosted mode. Bogdan succeded in integrating all this by mixing nuxeo-distribution-tools and a new project  called nuxeo-webengine-gwt. The idea behind that is to start the Nuxeo Runtime by a filter in the hosted mode web app. The dependencies are handled by nuxeo-distribution-tools that embeds a Maven to resolve all needed artifacts. It took me some time to make all that stuff work, and I want to share here a step by step t utorial for this. The original post of Bogdan can be found here : http://doc.nuxeo.org/xwiki/bin/view/FAQ/GWT+Integration+for+Nuxeo

 
Install GWT Eclipse plugin
 
Following the docs at Google code, (http://code.google.com/intl/fr-FR/eclipse/docs/download.html) you'll be able to get the GWT eclipse plugin up an running. After that, make a first sample project by creating a new Google Web Application project. Give it a name and uncheck "Use Google App Engine".
 
Image_4

 

The GWT wizard will create a project structure like this:

src    org/my/app/client    org/my/app/server    your_module.gwt.xmlwar   WEB-INF/web.xml   your_module.css   your_module.html

As you can see, this is not a Maven project nor an OSGi bundle, but i runs in hosted mode ! Try it by running the project as a "Web application". You copy the adress of the running app in the "Development Mode" tab and paste it in your browser. 

 

You will surely have to install a GWT extension if it's the first time you run hosted mode for GWT2. Based on your platform, you can't test on every browser (for instance on MacOS X I can test on FireFox and Safari), this is the new Out Of Process Hosted Mode (OOPHM).

 

 

Transforming in a working Maven Project

 

To transform the eclipse project into a Maven project, it will have to follow the maven project hierarchy. First move the src directory into a new src/main/java/ one. Then you will have to edit a pom.xml file containing the following :

 

<?xml version="1.0" encoding="UTF-8"?>

<project>

  <modelVersion>4.0.0</modelVersion>

    <groupId>org.nuxeo.ecm.gwt</groupId>

    <artifactId>nuxeo-gwt</artifactId>

    <version>1.0-SNAPSHOT</version>


  <name>Nuxeo GWT integration test</name>

  <description>Test integration between GWT 2.0 and Nuxeo</description>


  <properties>

    <gwtVersion>2.0</gwtVersion>

    <gwt.module>org.nuxeo.gwt.test.Nuxeo_gwt</gwt.module>

  </properties>

<repositories>
    <repository>
      <id>public</id>
      <url>http://maven.nuxeo.org/public</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>public-snapshot</id>
      <url>http://maven.nuxeo.org/public-snapshot</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <updatePolicy>always</updatePolicy>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>


  <dependencies>

    <dependency>

      <groupId>org.osgi</groupId>

      <artifactId>osgi-core</artifactId>

      <version>4.1</version>

    </dependency>

    <dependency>

      <groupId>org.nuxeo.runtime</groupId>

      <artifactId>nuxeo-runtime</artifactId>

      <version>1.6.2-SNAPSHOT</version>

    </dependency>

    <dependency>

      <groupId>org.nuxeo.common</groupId>

      <artifactId>nuxeo-common</artifactId>

      <version>1.6.2-SNAPSHOT</version>

    </dependency>


    <dependency>

      <groupId>org.nuxeo.ecm.webengine</groupId>

      <artifactId>nuxeo-webengine-gwt</artifactId>

      <version>5.3.2-SNAPSHOT</version>

    </dependency>

    <dependency>

      <groupId>org.nuxeo.build</groupId>

      <artifactId>nuxeo-distribution-tools</artifactId>

      <classifier>all</classifier>

      <version>1.2-SNAPSHOT</version>

      <scope>test</scope>

    </dependency>


    <dependency>

      <groupId>javax.servlet</groupId>

      <artifactId>servlet-api</artifactId>

      <version>2.4</version>

    </dependency>


    <dependency>

      <groupId>log4j</groupId>

      <artifactId>log4j</artifactId>

      <version>1.2.13</version>

    </dependency>


    <dependency>

      <groupId>com.google.gwt</groupId>

      <artifactId>gwt-servlet</artifactId>

      <version>${gwtVersion}</version>

      <scope>compile</scope>

    </dependency>

    <dependency>

      <groupId>com.google.gwt</groupId>

      <artifactId>gwt-user</artifactId>

      <version>${gwtVersion}</version>

      <scope>provided</scope>

    </dependency>

    <dependency>

      <groupId>com.google.gwt</groupId>

      <artifactId>gwt-dev</artifactId>

      <version>${gwtVersion}</version>

      <scope>compile</scope>

    </dependency>


   </dependencies>



   <build>

    <!-- gwt compiler needs the java sources to correctly work -->

    <resources>

      <resource>

        <directory>src/main/java</directory>

      </resource>

      <resource>

        <directory>src/main/resources</directory>

      </resource>

    </resources>


    <plugins>

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-compiler-plugin</artifactId>

        <configuration>

          <source>1.5</source>

          <target>1.5</target>

        </configuration>

      </plugin>


      <!-- correctly generate eclipse files with GWT nature -->

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-eclipse-plugin</artifactId>

        <configuration>

          <downloadSources>false</downloadSources>

          <additionalProjectnatures>

            <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>

            <projectnature>com.google.gdt.eclipse.core.webAppNature</projectnature>

          </additionalProjectnatures>

          <additionalBuildcommands>

            <buildCommand>

              <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>

              <arguments>

              </arguments>

              <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>

              <arguments>

              </arguments>

            </buildCommand>

          </additionalBuildcommands>

          <classpathContainers>

            <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>

            <classpathContainer>com.google.gwt.eclipse.core.GWT_CONTAINER</classpathContainer>

          </classpathContainers>

          <buildOutputDirectory>war/WEB-INF/classes</buildOutputDirectory>

        </configuration>

      </plugin>

      <!--

        After compiling java sources compile java to JS using GWT compiler. This

        must be done process-classes after compile step finished to be sure we

        have all the needed files in classes directory. I am using ant for this

        since the maven exec plugin is not able to run correctly this

      -->

      <plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-antrun-plugin</artifactId>

        <executions>

          <execution>

            <id>compile-js</id>

            <phase>process-classes</phase>

            <configuration>

              <tasks>

                <property name="compile_classpath" refid="maven.compile.classpath" />

                <java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">

                  <classpath>

                    <pathelement location="${project.build.outputDirectory}" />

                    <pathelement path="${compile_classpath}" />

                    <pathelement path="${runtime_classpath}" />

                  </classpath>

                  <jvmarg value="-Xmx256M" />

                  <!--   jvmarg value="${gwt.arg}" / -->

                  <!--arg value="-style" />

                  <arg value="DETAILED" /-->

                  <!-- to speed up compiler

                  <arg value="-draftCompile" /-->

                  <arg value="-war" />

                  <arg value="${project.build.outputDirectory}/gwt-war" />

                  <arg value="${gwt.module}" />

                </java>

              </tasks>

            </configuration>

            <goals>

              <goal>run</goal>

            </goals>

          </execution>

        </executions>

      </plugin>

    </plugins>

  </build>

</project>

Now we can refresh the Eclipse project, by running this command in the project directory :

mvn eclipse:clean eclipse:eclipse

And refresh the project in Eclipse. 

 

Starting Nuxeo  Runtime

Now to start the Nuxeo Runtime before the hosted mode, we'll have to modify the web.xml file located in the war/WEB-INF directory and add a filter like this just after the web-app tag:

 

<filter>

  <filter-name>NuxeoAuthenticationFilter</filter-name>

  <display-name>WebEngine Authentication Filter</display-name>

  <filter-class>

  org.nuxeo.ecm.webengine.gwt.dev.NuxeoLauncher

  </filter-class>

  <init-param>

    <param-name>byPassAuthenticationLog</param-name>

    <param-value>true</param-value>

  </init-param>

  <init-param>

    <param-name>securityDomain</param-name>

    <param-value>nuxeo-webengine</param-value>

  </init-param>

    <init-param>
      <param-name>profile</param-name>
      <param-value>core-5.3.2-SNAPSHOT</param-value>
    </init-param>

</filter>

<filter-mapping>

  <filter-name>NuxeoAuthenticationFilter</filter-name>

  <url-pattern>/*</url-pattern>

</filter-mapping>

 

You now can restart the hosted mode (don't forget to stop the first instance of hosted mode we lauched before). In the log console, you'll that the Nuxeo framework is starting and you can browse to you GWT app. The difference is that your project is packaged as Maven project and that Nuxeo Framework is started in hosted mode.

 

Make it an OSGi bundle

Now we have to make this porject an OSGi bundle. In fact, it's quite easy. Just add the following files in your src/main/resources directory :

META-INF/MANIFEST.MF

Manifest-Version: 1.0

Bundle-ManifestVersion: 1

Bundle-Name: test-nuxeo

Bundle-SymbolicName: com.leroymerlin.corp.nuxeo.gwt.test;singleton:=true

Bundle-Activator: org.nuxeo.ecm.webengine.gwt.GwtBundleActivator

 

OSGI-INF/deployment-fragment.xml

<?xml version="1.0"?>

<fragment>

  <extension target="application#MODULE">

    <module>

      <java>${bundle.fileName}</java>

    </module>

  </extension>

</fragment>

Now running

mvn clean install

Should give you a running OSGi bundle, containing a GWT app that is deployable into a nuxeo server just as any other plugin. 

 

Of course, this app doesn't take advantage of embedding Nuxeo Runtime in it. In a following post, I will explain how to deploy custom plugin into hosted mode and how to interact with Nuxeo services via GWT RPC

 

Update on 06/10/2010 :

pom.xml and web.xml updated to reflect 5.3.2-SNAPSHOT

 

Oct 28 / 6:24am

OpenSource @ Work : opensocial integration in Nuxeo

When I saw that my blog was mentionned in the What's New release note of Nuxeo 5.3, I thought about writing something newer thant September 9th... So, this is it, when the RC1 was announced, Erid said : "OpenSource @ Work" about the opensocial integration in Nuxeo. So this post will be all about our collaboration with them and how all this took place. 

First of all, this has not been very easy... Since OpenSource software is often a meritocraty, we had to proove our merit on what we were doing. It all began in July 2008 when we choosed the Nuxeo platform to hold our iGoogle like intranet. In August, we were able to make a tiny demo, integrating WebEngine (first version a that time) with Shindig. We were able to add gadget and drag'n'drop them on collaborative space. I made a small screencast and sent it to Eric. He anwsered : we should find some ways to work together.

I was then invited to make a talk on WebEngine in september : video can be found here (sorry first the moves, this was my very first talk...). After this talk I met Thierry Delprat (CTO) and Florent Guillaume (Head of R&D) to show them what we built. First problem for us, we were using the first version of WebEngine that didn't include the JAX-RS API yet. Then the product was not integrated into DM and was only a WebEngine app. At that time, Nuxeo had lots of work on the 5.2 branch and did not have sufficient time to work on OpenSocial.

After that, I came back to my office and continued our work on the portal... still with WebEngine v1 (this has been a real pain). At Nuxeo Developper Day, in december 2008, i made another talk (video here) with a better demo. The day after, we worked with Jean-Marc Orliaguet (Nuxeo Theme Developper) about the different approaches we had :

  • For Jean Marc : a Gadget is a piece of interface (a fragment) that can be stateful
  • For me : a Gadget is a Document inside a collaborative space (I will surely write a post about all the possibilty of this model)

The two approaches are complementary since, the first one is from a UI point of view : i want to decorate the page with gadgets and the second one is from a collaborative view : users can share gadgets as other documents. I think that at some point we will find how to yield those different approaches.

In February 2009, Eric Barocca came to us to see we exactly what we were doing, and what were our plans. After that, Nuxeo created a Nuxeo-dev mailing list that we could use to ask questions. Leroy Merlin was then designated as a possible future contributor.

After that, Nuxeo created for us an Opensocial Mercurial repository so that we could commit our dev and that Nuxeo could study our code. We really began commiting in May 2009. At this period, we were completely refactoring the platform : use of GWT-ext for the D'n'Drop interface, use of WebEngine JAX-RS (at last !), real integration of Shindig as a Nuxeo Runtime Service. As a result of that, I've been able to integrate the GWT container into the JSF Nuxeo-DM interface and made a small screencast of a collaborative space into Nuxeo-DM giving the ability to put as many dashboards you want in all workspaces.

Shortly after that, Ian Smith began to work on our code. He and Thierry Delprat came to us to understand what were our plans and how it could be integrated in the future 5.3 release. Then the OpenSocial repository has been merged with the nuxeo-features one, well integrated and used to replace the old JSF based dashboard. In mid-october, the RC1 came out, and now the GA.

The main problem for working together is that the release timelines are not aligned. When Nuxeo freezes some code, we want to add some functions. Mercurial hels us a lot but it's not easy. I think that for resolving this, we'll had to learn how to work together with time and perhaps share some realease dates.

From the licensing point of view, Nuxeo and Leroy Merlin are both owner of the contributed code that is LGPL licensed.

As a conclusion, it's not very easy to join such a big project but all the team is very proud of it. I'm sure there will be real benefits from that :

  • Our code is reviewed by Nuxeo Architects and well integrated in the core distribution.
  • We had to make the generic code generic, and make the specific parts plugin of it.  I really think its a proof a quality and that i made us ask for the good questions.
  • Apart from making the code generic, it did cost us nothing
  • I think that the value of a portal is the number of app you can integrate into it. Theorically we have all iGoogle gadgets that are integrable (and it make a lot ;-) ). I other people contribute by making "Enterprise ready gadgets" on top of the Nuxeo Platform, we will gain benefit from it (if you want some ideas, call me ;-) )
  • As funny as it could be, as we have a Nuxeo Connect Support, we could post JIRA tickets about our own bugs (really funny :-p)

Dicussing with other IT friends, they said : "I'm not sure my company would agree to contribute to OpenSource software !".

We did it so :"Yes we can !", "Yes YOU can !"

FYI a gadget can be as small as a hundred lines of JS code (postit gadget)

 

Filed under  //  nuxeo   opensocial   opensource  
Sep 9 / 8:48am

Playing with jUnit4.5, Guice and Nuxeo

In order to help our developpers to setup integrations test on our Nuxeo platform, i played with JUnit 4.5 and Guice. The goals were :

  • Don't have to build huge @BeforeClass method
  • Convention over configuration
  • Common services (Repository, CoreSession) easy usable
  • Reusability
  • Be able to run test on several repo types sequentially
  • Be able to deploy its own bundle
We already used Guice to make injection of some components in our test suite, and I decided to generalize this approach by binding core Nuxeo components to Guice providers. 

Here is the result as a simple test :

package com.leroymerlin.corp.fr.nuxeo.portal.testing;


@RunWith(NuxeoRunner.class)
@Session(user="Administrator")
@Repository(RepoType.H2 )
@RepositoryFactory(SimpleTestRepoFactory.class)
public class InjectSessionTest {

    @Inject
    public CoreSession session;

    @Test
    public void theSessionIsUsable() throws Exception {
        assertNotNull(session);
        assertNotNull(session.getDocument(new PathRef("/test")));
    }

    @Test
    public void sessionPrincipalIsAdministrator() throws Exception {
        assertEquals("Administrator", session.getPrincipal().getName());
    }
}

I built a NuxeoRunner class that knows how to interpret the test class annotations
  • @Session to configure with which user we want to connect the session
  • @Repository to configure the repository type (can be either JCR, H2 or Postgres)
  • @RepositoryFactory : to give the developper the ability to feed the repository before the test runs (the SimpleTestRepoFactory.class just creates a /test workspace document)

Thanks to Guice, we are now able to inject a CoreSession ready to work. Of course, you can just use the @RunWith method, there are default values for all the annotations. For instance :



@RunWith(NuxeoRunner.class)
public class UserManagerHarnessTest {

    @Inject
    private UserManager service;

    @Test
    public void serviceIsInjected() throws Exception {
        assertNotNull(service);
    }

    @Test
    public void canRetrieveTheAdminAccount() throws Exception {
        DocumentModel admin = service.getUserModel("Administrator");
        assertNotNull(admin);
    }
}

We also built another runner that can run NuxerRunner tests sequentially on different repository types :


@RunWith(MultiRepoNuxeoRunner.class)
@SuiteClasses ( {SimpleSessionIT.class } )
@Repos({RepoType.H2,RepoType.JCR, RepoType.POSTGRES})
public class NuxeoSuiteTest
{
}

This test suite execute the SimpleSessionIT test sequentially on the three repository type implementations.

What needs to be done next  would be :
  • the ability to deploy bundles and contribs with annotations of factories
  • include as much Nuxeo Services bindings as we need in our Modules. 
  • Find a way to reintialize repo either at method or type level. 

BTW I know that Ian Smith from Nuxeo is building a Nuxeo abstraction layer that also uses Guice to retrieve services, it's called Seattle (available in the nuxeo SVN sandbox). Our approaches are not the same (his code is better than mine ;-) ) but there are a few things common. 

The conclusion, is that jUnit offers us a cool way to build our own runners on POJO classes. Guice enables us to hide all the internal mechanism of Nuxeo services and statically code dependencies between nuxeo services. This way developpers focus on their tests and don't suffer of the time they need for their setup methods. The cons of this is that we must be very careful with the @BeforeClass and @AfterClass annotation since the injection mecanism does occur only on the class creation. 

This code will be soon available on http://hg.nuxeo.org/opensocial/ (nuxeo-test-util project)

Filed under  //  guice   junit   nuxeo  
Aug 20 / 12:39pm

Recette du Punch d'Alex

Afin de mettre un petit peut autre chose que de la technique dans ce blog....

Voici la recette d'un punch facile à faire et très rafraichissant. Il faut faire attention à bien respecter les marques (si si... le multivitaminé de LIDL est bon !) et l'ordre d'incorporation. Bonne dégustation

Ingrédients :
6L de jus multivitaminé de la marque LIDL
1L de sucre de canne (CANADOU)
1L de Rhum Charette
1 bonne cuillère à café de Gingembre
1 pincée Bicarbonate de soude
Canelle Muscade

Ordre :
Mélanger le jus avec le sucre de canne.
Ajouter le gingembre et le bicarbonate. Le mélange ne dois pas être trop acide (le bicarbonate enlève l'acidité du jus)
Ajouter le rhum
Ajouter les épices

Il est de préférence meilleur de le consommer après l'avoir mis une nuit au frigo. Il peut se conserver assez longtemps.

Merci à Alex pour la recette ;)

 

Filed under  //  life  
Aug 20 / 9:28am

Nuxeo & OpenSocial : a few teasing is good....

Well, it makes now one year that i work on the integration of Nuxeo, Opensocial (Shindig) and WebEngine. We are about to finish a WebEngine application that will act as an iGoogle container. But as it is not yet ended, I took some time time to integrate our GWT container in the JSF application of Nuxeo.

Surprisingly, it doesn't took very much time and I think the result is good enough to show some part of it, cause we are quite proud of it ! So here is a simple screencast of what it is about :

 

I hope to be able to commit our changes to nuxeo HG repository ASAP, but i have to build a distribution project so that everyone can build it (there are some needed changes in the lib versions of the Nuxeo original packaging), so stay tuned !

 

Filed under  //  nuxeo   opensocial  
Jul 29 / 6:02am

A "Real Life" OSGi Sample with Nuxeo

In an inhouse project here, using Nuxeo, I needed to explain some developper what OSGi and extension points were. They did'nt have any component based software experiment an it was hard for them to understand why :

  • it could not be done with a factory
  • it is not just a singleton
I then tried to explain them OSGi with a project that mimics the real life. Here is the project. It is based on our Nuxeo Runtime experience, that is a light OSGi container with extension points (XP) like in Eclipse.

In a enterprise new employees have to get cell (i)Phones. I am a new employee and I'm looking for how to get a cell phone :
  • First, I have to know which service i need : let's say it's the CellPhoneLineManager service
  • Then I ask the enterprise to tell me who is in charge of this service
  • Then I ask the person to buy a new phone line whatever provider they use.
Now here is the way you would do in Java :

CellPhoneLineManager manager =  Framework.getService(CellPhoneLineManager.class)
CellLine = manager.openLineFor(principal)

In this piece of code, Framework is the enterpise, that plugs onto the OSGI container. CellPhoneLineManager is to be the service I want to use. It returns me with a manager that is an instance of an object that knows how to answer to the CellPhoneLineManager contract : in real life this is John from the telephone department who is in charge of cell phone line openings.

How does it fit together  now ? here is the big picture :

D0df4cc9fc9b2e9617c3e6f39806f4

Well, now what is this strange supplier XP ? This is one of my favorite in Nuxeo Runtime. XP stands for eXtension Point. A component (John) exposes one or several XP that one can contrib to. Let's take our sample. How does John choose the right phone supplier ? Simple, it take the one that has the lower price. So, John exposes an XP that supplier can use to give the tarifications. In the picture the "Orange" supplier contribs a "TarificationDescriptor" to John. Now John can choose the best supplier amongst the one that have made a contribution to his XP. 

You can use XP's for all sorts of things :
  • Configuration (like the list of all phone suppliers)
  • Registration to event listener
  • Extending functionnalities
  • Stub/Mock components
OSGi also has a lot of other functionnalities, for instance it manages the lifecycle of bundles/components. Nuxeo implements a light OSGi container that can be run on top of JBoss or embed in app server such as Jetty or Glassfish 3. It doesn't implements the full OSGi scope like other framework (Felix or Equinox for instance). I am now impatiently waiting for Nuxeo Runtime 2, that would fully implement OSGi (perhaps by embedding a ohter framework) and provide services dependency injection....

Filed under  //  nuxeo   osgi   tutorial  
Jul 24 / 5:22am

Fighting with all those Rhino forks

Today i tried to run a webdriver HtmlUnit test on a simple Nuxeo project that makes use of nuxeo-theme-html. I did not think it would be so hard. The problem is all about the Rhino javascript library that people loves to fork....

  • First one : WebDriver, Marc Guillemot explains here that for htmlUnit project they had to fork Rhino and make the HtmlUnit-core-js.
  • Second One : DojoToolkit, they made a javascript compressor (ShrinkSafe)  that depdends on a custom rhino and that is use by nuxeo-theme-html to serve JS resources.

The problem is that they share the same package namespace and don't work together.... So I in order to make Nuxeo-theme-html work, i have to  deactivate JS in WebDriver. But if I do that, my JS resources are useless in a test environment : the snakes bites himself. 

There are two solutions for now :
- Find a JS minifier library that doesn't make use Rhino (even YUI Compressor uses it.... :-( ) and convince Nuxeo-theme-html developper to use it...
- Run my WebDriver tests with another driver (as the FF one).

If someone has other ideas....
Filed under  //  javascript   nuxeo