Onswipe – un thème wordpress spécifique iPad

Vous avez envie que votre blog WordPress ressemble à Flipboard ?

Alors essayer le plugin Onswipe pour WordPress.

Celui-ci transforme la lecture de votre blog sur iPad. Les lecteurs découvrent alors une autre manière de parcourir le blog.

L’image du dernier post vient agrémenter une page de couverture. Les posts sont présentés comme une succession de dalles (“à la Flipboard).

Le seul point auquel il faut faire attention, c’est d’illustrer chacun des posts d’une image, sans quoi les pages paraissent un peu vides.

WordPress Migration

It’s done !!

I finally decided to move from Apache Roller to WordPress.

As a Java aficionados, I usually prefer Java solutions to PHP ones, but in this case I should admit the superiority of WordPress.

The WordPress community is by far larger than the apache roller community and the number of WordPress plugins is not comparable to the Roller’s one. And the dashboard feature is really more complete.

Of course, I could have spend some time to implement such features in Apache Roller but why reinvent the wheel when WordPress seems a perfect fit.

To migrate the content of my previous blog, I followed from here and everything went properly.

SSO integration with simpleSAMLphp and openSSO

The integration of simpleSAMLphp and openSSO in an application like sugarCRM is clearly explained in the article Single Sign-On for SugarCRM Through a SAML-Based Integration of OpenSSO and simpleSAMLphp.

When integrating SSO in a public web-site with a login box like the one on the upper right corner of Le Figaro.fr. How could we test that the user is already logged on the SSO in order to display his name in place of the login, sign-on links ?

If the user is not already authenticated on the domain, the usual way to check the SSO login is by making a redirect to the SSO domain with a RelayState to the target page. However, in this case, two problems occurs. First the usual 302 redirect towards the SSO domain is not really SEO friendly. Secondly, if the user is not logged on the SSO, the redirection will bring him to the login page which is not really what we want.

My solution to this issue is the following.

Next to the login box, add a 1×1 iframe having the following php page as source.

<?php
require_once ('/opt/simpleSAML/simplesamlphp_1_4/www/_include.php'); require_once('SimpleSAML/Utilities.php');
require_once('SimpleSAML/Session.php');
require_once('SimpleSAML/XHTML/Template.php'); 

/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getInstance(); 

/* Check if valid local session exists.. */
if (!isset($session) || !$session-&gt;isValid('saml2') ) {
  SimpleSAML_Utilities::redirect( '/' . $config->getBaseURL() . 'saml2/sp/initSSO.php', array('RelayState' => 'http://www.aragorn2.cool/testsso/authenticated.html') );
}
SimpleSAML_Utilities::redirect('/testsso/authenticated.html');

This assumes that openSSO and simpleSAML have been correctly configured.

When the user is not already connected to the SSO, the little php snipped will return the HTML code for the SSO login to the iframe. Since the iframe has a 1×1 size, this will not be visible.

If the user is already connected, this authenticated.html page will be returned and this will create a cookie for the local domain. In order to display the user information, we have to redirect the parent page either to a specific home page or to the original page where we will test the cookie existence.

The code for the authenticated.html page is given below.

 <html> <body> <script type="text/javascript"> parent.location.href='home.html' </script> </body> </html> 

This is more or less what Google does on Blogger.

In a next post, I will explained how to retrieve profile attributes from the SAML assertion.

How to integrate groovy and Talend

Talend proposes 2 components to use Groovy in jobs, tGroovy and tGroovyFile.

tGroovy allows to execute groovy code and tGroovyFile allows to launch an external groovy script.

However, those 2 components have both a severe drawback. They run at the beginning of the job and they do not give the possibility to process the rows in the middle of a job.

Recently, I wanted to implement a quite complicate logic to process a row. Moreover, I wanted to be able to apply the logic on rows with different schema.  

I could have used the tJavaFlex but then I would have been obliged to recode the logic for every job because of the schema difference.

I could have used a custom Java method but the logic was really simpler to code in groovy. I needed dynamic expression like row.${attribute} and this is far more easier to do in Groovy than with the Java reflection API.

I started thinking about a way to integrate Groovy and Talend and I finally end up with the following.

The main idea is to put in the globalMap, an groovy objet that will perform the requested logic. Then at the appropriate step in the job, one will call the right method on the groovy object to do the work.

Putting the groovy object in the global map is done using the tGroovyFile. The component could be place anywhere in the job since it is process during the BEGIN phase. The content of the groovy script will be as follow:

globalMap.put("GroovyObject", new MyGroovyObject())
class MyGroovyObject {
def myMethod(row) {
// Do anything you want with the row
// update the row directly like
row.counter++
row.name = row.firstName + row.name
}
}

the globalMap is bind to the groovy context.

At the point where one want to process the row with the groovy method, just use a tJavaFlex component with the following code:

groovy.lang.GroovyObject groovyObj = (groovy.lang.GroovyObject)globalMap.get("GroovyObject");
groovyObj.invokeMethod("myMethod", rowInput);

where myMethod& is the name of the method to call and rowInput the name of the input row.

The output row of the tJavaFlex will be the row passed to the groovy method.

Digital media market evolution

With internet, the publishing market is facing a major challenge by trying to combine print and digital delivery.
 
How to coordinate both is a major question for them.

Today, some of the players has already made their choice and are moving to a 100% digital media delivery. The others want to take advantage of both media but they have to face organizational issues. Should they merge print and digital editorial teams?

The Belgian Rossel press group has made his choice by creating a true bi-media editorial teams.

Next week, it’s the 2009 ez conference and award event. One of the keynote is presented by James Hewes, Head International Development at BBC Magazines. he will explain how the organizational aspects at BBC have influenced their digital publishing projects.

I’m wondering what has been the choice of BBC and if the weekly or daily characteristic of the print edition may have an impact on the origagizational decision.

How to revert a merge with Bazaar

With Bazaar, merges become easy but sometimes that leads to some issue.

Suppose you have a branch. You merge changes coming from another branch and you commit the changes. You test it and you decide that what you merge is not stable enough and you revert to the version previous to the merge.

Later on, you decide to try a new merge and that’s where the issue occurs.

Because Bazaar knows you have already merge the branch, the second merge will only be partial. It will not include the changes made before the first merge.

To do that, when you revert a merge, you neet to tell Bazaar to forget about the merge. The information below comes from https://answers.launchpad.net/bzr/+question/45980.

First tou need the sources you want to work with. Usually you will do that with a command like:

bzr revert -r X

X being the revision before the merge.

Then you need to uncommit the merge.

bzr uncommit -r X

X being the revision before the merge.

This does not change your working tree but will delete revisions older than X from the repository

If you do then:

bzr status

You will see the pending merge and you need to tell Bazaar to forget about the merge. To do that, just type:

bzr revert --forget-merge

This will not change your working tree but will remove any pending merge.

You can know commit your latest change and retry the merge later.

I think this was worth a post in the blog.

Java Swing application on Mac OSX

I spent a few hours trying to make a Java Swing application to work on a Mac Book .

The issues were that some swing components had an odd behavior, menu labels disappeared, content of JComboBox was not rendered correctly, …

Looking in the Java console, I found the following exception:

Exception in thread 

Roller 4.0

I just migrated my blog to roller 4.0.

Updated

After the migration, I couldn’t login anymore.

In fact, Roller 3.x does not use password encryption by default althought Roller 4.

I updated my roller-custom.properties with the following rule and everything went back in order.

passwds.encryption.enabled=false 

Using Dojo 0.4.x over HTTPS and IE security warning

Getting dojo to work with SSL should not be a problem. However, when I migrated my application over HTTPS, I couldn’t find why the Security Warning pops up when using IE.

After a few hours googling around, I found the following post.

The issue was indeed due to the testAccessible function within a11y.js.

I patched a11y.js as follow:

dojo.a11y = {	// imgPath: String path to the test image for determining if images are displayed or not	// doAccessibleCheck: Boolean if true will perform check for need to create accessible widgets	// accessible: Boolean uninitialized when null (accessible check has not been performed)	//   if true generate accessible widgets	imgPath:dojo.uri.dojoUri("src/widget/templates/images"),	doAccessibleCheck: false,	accessible: null,		

and this solved my issue.

Packaging Java Webstart application with maven 2

There is a plugin for maven to package Java Webstart application. It’s the webstart maven plugin.

To create the jnlp file, the documentation suggests to launch:

mvn webstart:jnlp

However, sometimes I got the following error message:

<jnlp> configuration element missing.

To workaround this, just launch the same command with the explicit plugin name:

 mvn org.codehaus.mojo.webstart:webstart-maven-plugin:jnlp

This solves the error.

I guess, this is due to a mismatch between webstart plugin. I should reset my plugin repository and make a try.