The Hippo Rijkshuisstijl Archetype

20 10 2009

logo-sose

hippo logo rijkslogo

In the last 6 months we at Sourcesense had intense activities related to Hippo 7; we found this new version pretty cool and we’ve used it to build a website for a customer and sell around some consultancy.

In the same context, we’ve been working a lot with the Rijkshuisstijl – which is the official Dutch Governmental Web Stylesheet; tired of copy-pasting, we decided to wrap up a nice package to use, reuse and share with the rest of the community.

The main goal of this package is to provide a standard way to deliver a working Hippo CMS environment (and reusable examples of customization) for a small/medium Rijkshuisstijl-compliant website; there is also a special focus on the development environment and application lifecycle management, which are topics that can be easily de-prioritized at the beginning of a project, but can make the difference on the long run.

We’re proud to share with you the Hippo Rijkshuisstijl Archetype! Many thanks to the whole sourcesense NL team for the great support, but a special one goes to Paul Bakker, who was my teammate on all these activities and contributed a lot to this archetype.

Read the rest of this entry »





Private Repositories with Nexus

7 08 2009

Nexus Logo
Creating Private repositories with Nexus can be an hard task, especially if you’re not accustomed with its internal roles/privileges mechanism; let’s first introduce some bits of it:

Nexus authorization model is composed by

- privileges, which are aggregated in
- roles, which are assigned to
- users, having username/password used for the HTTP-based authentication while accessing a specific repository/group/artifact

Everytime you access a Nexus content, the anonymous credentials are used by default; if the access is denied, an HTTP authentication is requested.

The default Nexus configuration provides an anonymous user with read access to all repositories; this means that when you create a new repository it will be automatically accessible, regardless it’s Browseable and/or Indexable.

What I wanted to achieve was to have an anonymous access AND one (or more) private repository; these are the steps that I performed in order to achieve it

1. Create a new Hosted repository, say Private Sourcesense

2. Create Privileges for Private Sourcesense repository and for each Nexus Repository Group that must be publicly and anonymously accessed; in my case it was Public Repositories and Public Snapshot Repositories; for each entry Nexus will automatically create separated read, create, update, delete privileges.

3. Create a sourcesense-private role that has create,read,update,delete privileges on the Private Repository previously created; feel free to aggregate any other available Nexus role

4. Create a sourcesense-anonymous role that aggregates the Nexus Repository Group read privileges previously created.

5. Create a sourcesense-private and sourcesense-anonymous user associating their related role.

6. Set sourcesense-anonymous as the Nexus anonymous user (via Administration > Server dialog)

Now, if I create a new repository (proxied or hosted) this won’t be anonymously accessible either via HTTP or UI by default; you first have to associate it with one of the Nexus Public Groups.





What is a Maven POM

12 07 2009

The Build Doctor has started to publish a set of short articles regarding Apache Maven; I’ve contributed some thoughts about the POM, the main concept behind the convention over configuration approach introduced by Maven.

Apache Maven provides a great support for most of the common application lifecycle challenges; as any other framework or technology, it can be used and it can be abused, that’s why best practices are important; these easy guidelines can lower drastically the learning curve and contrast the frequent skepticism of people saying that Maven is just overcomplicated for its purpose.





Migrating Hippo ECM from 7.0 to 7.1

26 06 2009

It was easier than expected, but I went through some small tricks on the pom.xml and the content model that might be helpful for those that are planning to move towards 7.1; well, a good chance to share some knowledge, I hope I can save you some time ;-)

Feel free to

  • Brutally copy/paste these instruction on a more structured Hippo-hosted documentation page
  • Add additional steps to take in consideration (just comment on the blog)

 
- Added the following dependency in cms/pom.xml

<dependency>
 <groupId>org.onehippo.ecm.hst.toolkit-resources.addon.toolkit-cnd</groupId>
 <artifactId>hst-addon-cnd_7_1</artifactId>
 <version>${hst.version}</version>
</dependency>

- HINT! Be sure that all your addons have been released for the major ecm/hst versions (2.06.06/2.03.09); in my case, I had to modify the following dependency from

<dependency>
 <groupId>org.hippoecm</groupId>
 <artifactId>hippo-ecm-addon-reviewed-action-common</artifactId>
 <version>${hst.version}</version>
</dependency>

to

<dependency>
 <groupId>org.hippoecm</groupId>
 <artifactId>hippo-ecm-addon-reviewed-action-common</artifactId>
 <version>${reviewed-action-addon.version}</version>
</dependency>

where reviewed-action-addon.version = 2.03.04; I strongly advise you to keep a clear separation between dependencyManagement (on your project parent pom) and dependencies in your cms/pom.xml and site/pom.xml

- Added /content/documents folder in the JCR Node structure: your content/src/main/resources/myproject-root.xml should look like

<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="documents">
 <sv:property sv:name="jcr:primaryType" sv:type="Name">
   <sv:value>hippostd:folder</sv:value>
 </sv:property>
 <sv:property sv:name="jcr:mixinTypes" sv:type="Name">
   <sv:value>hippo:harddocument</sv:value>
 </sv:property>
 <sv:property sv:name="hippostd:foldertype" sv:type="String">
   <sv:value>New Folder</sv:value>
   <sv:value>New Document</sv:value>
 </sv:property>
 <sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="myproject">
   <sv:property sv:name="jcr:primaryType" sv:type="Name">
     <sv:value>hippostd:folder</sv:value>
   </sv:property>
   <sv:property sv:name="jcr:mixinTypes" sv:type="Name">
     <sv:value>hippo:harddocument</sv:value>
   </sv:property>
   <sv:property sv:name="hippostd:foldertype" sv:type="String">
     <sv:value>New Folder</sv:value>
     <sv:value>New Document</sv:value>
   </sv:property>
 </sv:node>
</sv:node>

- Upgraded namespaces in myproject-types.cnd

from

<'hippostd'='http://www.hippoecm.org/hippostd/nt/1.2'>
<'hippo'='http://www.hippoecm.org/nt/1.2'>

to

<'hippostd'='http://www.hippoecm.org/hippostd/nt/1.3'>
<'hippo'='http://www.hippoecm.org/nt/1.3'>

- Update any contentRoot reference in hippoecm-extension.xml from

<sv:property sv:name="hippo:contentroot" sv:type="String">
 <sv:value>/content/myproject</sv:value>
</sv:property>

to

<sv:property sv:name="hippo:contentroot" sv:type="String">
 <sv:value>/content/documents/myproject</sv:value>
</sv:property>

- Removed any instance of sv:property[@sv:name="frontend:overrides"] from mytypes-templates.xml

from

<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="hippo:template">
 <sv:property sv:name="jcr:primaryType" sv:type="Name">
   <sv:value>frontend:plugincluster</sv:value>
 </sv:property>
 <sv:property sv:name="frontend:overrides" sv:type="String">
   <sv:value>wicket.id</sv:value>
   <sv:value>wicket.dialog</sv:value>
   <sv:value>engine</sv:value>
   <sv:value>mode</sv:value>
 </sv:property>
 <sv:property sv:name="mode" sv:type="String">
   <sv:value>edit</sv:value>
 </sv:property>
 <sv:property sv:name="wicket.model" sv:type="String">
   <sv:value>${cluster.id}.model</sv:value>
 </sv:property>
</sv:node>

to

<sv:node xmlns:sv="http://www.jcp.org/jcr/sv/1.0" sv:name="hippo:template">
 <sv:property sv:name="jcr:primaryType" sv:type="Name">
   <sv:value>frontend:plugincluster</sv:value>
 </sv:property>
 <sv:property sv:name="frontend:properties" sv:type="String">
   <sv:value>mode</sv:value>
 </sv:property>
 <sv:property sv:name="frontend:references" sv:type="String">
   <sv:value>engine</sv:value>
   <sv:value>wicket.model</sv:value>
 </sv:property>
 <sv:property sv:name="frontend:services" sv:type="String">
   <sv:value>wicket.id</sv:value>
 </sv:property>
 <sv:property sv:name="mode" sv:type="String">
   <sv:value>edit</sv:value>
 </sv:property>
</sv:node>

- Changed hippostd:fixeddirectory to hippostd:directory

from
<sv:property sv:name="jcr:primaryType" sv:type="Name">
 <sv:value>hippostd:fixeddirectory</sv:value>
</sv:property>
to
<sv:property sv:name="jcr:primaryType" sv:type="Name">
 <sv:value>hippostd:directory</sv:value>
</sv:property>

- Changed hippostd:foldertype syntax

from

<sv:property sv:name="hippostd:foldertype" sv:type="String">
 <sv:value>New File Folder</sv:value>
 ....
</sv:property>

to
<sv:property sv:name="hippostd:foldertype" sv:type="String">
 <sv:value>new-document</sv:value>
 ....
</sv:property>




Maven Calm

26 06 2009

Calm stands for…

Seascape Calm Weather

Seascape Calm Weather


Calm Application Lifecycle Management, which stands for Calm Application Lifecycle Management Application Lifecycle Management … ehm just kidding ;)
Calm is an early implementation of main ALM use cases on an Open Source and collaborative framework based on Apache Maven.
 

What exactly is Maven Calm

Maven Calm is not just a Corporate POM. It’s a cross-corporate POM which provides lifecycle-oriented configuration for your Maven Plugins; the best way to start is having a look at the presentation! In short, your Project or Corporate POM should look like this to inherit all the ALM oriented behaviors.
 

How can you Customize it

Have a look at the README to see which properties are used and their default values; you can (re)define them in your pom.xml or profiles.xml.
 

How can you Contribute

  • Contribute your ideas, maven profiles and best practices in this google group (maven-calm at googlegroups dot com)
  • Request for joining the project at Maven Calm Google Code

 

How can you Run it

Property filtering and multiple environments

Every property of your POM is dumped into a project.properties file which is bundled with your classpath; you are free to choose how to define your properties.
You can setup your IOC container to parse this file from the classpath in order to externalize the environment-related configurations; you can easily define different environments in your profiles.xml, triggered either by a command-line property called env (-Denv=yourEnv) or by a direct profile invocation (-PyourCustomProfile); have a look at this sample.

Run Tests

mvn integration-test

Run Selenium Tests

NOTE! You need to have firefox installed
mvn integration-test -Pselenium

Generate and Deploy documentation

NOTE! Check this settings.xml template to see how to configure credentials
mvn site-deploy

Deploy POM/JAR/WAR packages on a (remote) Maven repository

NOTE! Check this settings.xml template to see how to configure credentials
mvn deploy

Deploy WAR packages on a J2EE Container

mvn cargo:deployer-redeploy

Release

This might include several other processes aforementioned, as configurable with a whole set of pom.xml or profiles.xmlproperties. For example the default maven.release.goals property is by default configured to perform:

  • Interactive project modules version update
  • Site generation and Deployment
  • SCM tagging and version control
  • Deploy on a remote Maven repository

If you use SVN, the credentials stored in your USER_HOME/.subversion will be used
mvn release:prepare release:perform

Create production-ready Tomcat Bundles

Check the Tomcat configuration of your webapp in features/tomcat:


|- features
  |- tomcat
    |- conf
      |- setenv.sh
      |- server.xml
      |- context.xml
      |- catalina.policy
    |- web.xml
    |- any.other.appl.file.xml

Then run the following command

mvn clean install -Ptomcat
 

Troubleshooting

Dependency problems or duplications?

mvn dependency:tree > dep-tree.log
mvn dependency:list > dep-list.log

Problems with your plugin executions? Checkout the effective POM and profiles

mvn help:effective-pom -P my_optional_profiles > eff-pom.log
mvn help:active-profiles -P my_optional_profiles > eff-profiles.log





Maven and Calm

17 06 2009

Back to blogging!

Last weekend I’ve spent a wonderful time in London with my girlfriend and a very interesting Maven training led by Jason Van Zyl, its founder; even using/coaching/spreading Maven technology and best practices since couple of years now, I found this training terribly interesting; Jason is an easy guy, always smiley and available for any question; this made all the training very chill and relaxing.

I found particularly interesting the chapter on Nexus and its advanced features, such as Staging Repositories; I’m planning to upgrade the Sourcesense Repository this weekend adding all these cool features plus a CI node powered by Hudson; looking forward to test the Procurement platform and the OSGI support :P

Talking about Jason and Maven, last Friday Sourcesense has organized an event that has drawn an significant attention, considering that invitations have been sent out only 3 days in advance; Rene (from Atlassian), Gianugo, Jason and myself had a 30-minutes long speech on different topics, all aimed at improving the software development process using the right tools, rather than designing huge infrastructures and complex processes.

More in details, maven-calm is just a Corporate POM, but with an Open Source approach; struggling since years with Maven I realized that we were starting yet again to do copy/paste of POM files, either from other project or rather from other Corporate POM (i.e. the Codehaus Parent POM, one of my preferred ones ;-) and that this process was potentially leading to some of the problems we were facing while copy/pasting our old Ant build.xml files.

If you use Maven for your project development processes (test, package, release, deploy, …) you’d probably write the very same configuration of maven-calm, so why not just use maven-calm as parent pom?
If you rather are scared of Maven because you think the learning curve is too steep or for any other reason, you can just give maven-calm a try; with the README you’re up and running in 5 minutes, with all the project’s infrastructure in place.

As you see, a lot of interesting Maven work has approached at Sourcesense lately and more will come soon!

Stay tuned ;-)





Valencia 2k7

12 11 2007

 


Informations
Originally uploaded by Maurizio Pillitu.

I’ve just come back from a week of holidays in Spain. Morella – in the province of Castellon – and Valencia were my main stops. The first lasted 4 days we spent most of the time eating and making excursions on the surrounding mountains; for me it was a good opportunity to experiment my brand new camera the very first time. This is my first reflex camera, so I still have to study/try lots of functionalities and settings. From my humble point of view, I find it a very good camera; using the automatic presets it shoots very good pictures without any further configuration; I also experimented some shoots using manual configurations when the daylight wasn’t enough and there’s probably a lot to improve ;-) The next 3 days I had really good time partying in Valencia with all my Valencian/Italian/Erasmus friends. This part of the holiday is far more blurred than the first one, guess why :-)





Happy Birthday Gab!

11 10 2007

 


Gab at the wheel
Originally uploaded by Jeremy.

I’ve a lot to things to write about … my new employment in Sourcesense BV NL, my definitive move to the cold Amsterdam, the last Cocoon GetTogether in Rome, that was brilliant, but, because of the short time I have today, I can just shout a big happy birthday to my friend and colleague Gabriele. We’ll spend the entire weekend to celebrate the 26th year of Gab. Everybody is invited of course ;-)





Journey to Brouges

29 09 2007

Last weekend I organized a journey with a Spanish mate, Javi, that I met in Spain in the far 2002, when I was living in Valencia. With a dozen of emails in total we organized a detailed journey from Amsterdam to Brouges crossing Zeeland, with some other stops on the way. The foreseen route doesn’t match a lot with the real one we did, as expected, but I was surprised that we never lost our position; we were equipped with a couple of maps, a road atlas of Benelux and a compass. The last was as much important as unexpected.After a couple of drawbacks – the removal of Nena – Javi’s van – by illegal park, some small issues with Nena’s battery that forced us to start it up with the support of another battery and a couple of threads – the journey started on Friday at midday, taking off from Hippo headquarters. We travelled 3 intense days with the following stops, all documented with pictures: Utrecht, Gouda, Rotterdam, Zierikzee, Goes and finally Brouges. You can take a look at the route on this Google Map.
As you can see from the map, we crossed some very futuristic bridges, tunnels and dams, among which the Maastunnel, the Grevelingen dam, the Zeelandbridge and finally the Westerscheldertunnel.

It was really funny to camp 3 days in the van; it is equipped with fridge, sofas and hifi, all you need to chill and drink some fresh beer.
Javi drove for all the trip, the entire three days, covering 297Km with a Westfalia Multivan Volkswagen; kudos. I was in charge of the route plan and that’s a curious point because I normally don’t shine for my sense of orientation; this time I did a pretty good job.

The weather blest and greeted our journey with an almost continuous sunny sky; sometimes cloudy, but never ever rain; being most of the travel in Netherlands I think it’s a remarkable aspect.

Hope to have time for another journey like this in the next incoming months and cover the north of the France.





5 days in Spain…

5 09 2007

… are simply not enough, but it’s a breath of fresh air, especially if you’re accostumed to a Mediterranean weather and you work in the North Europe. I went to Valencia, the same city that hosted me so warmly for one year and a half on 2002. I surprisingly stated that the city is doing very big steps forward in terms of organization, transports and services; obviously the America’s Cup gave them the opportunity to invest and improve a lot these aspects.

I slept in the apartment I was renting when I was there; after I went away, I left the apartment to a friend of mine, that still lives there; this means that I was feeling at my own home, especially because in the postal box there is still my surname printed on.

We spent most of the time walking throughout the center of the city, el carmen, visiting those few most touristic places, and, especially to have typical Valencian drinks

The rest of the time was invested on the beach. Valencia doesn’t shine for its beaches, but it’s not completely bad; last day we spent an entire day in Altea, that is a place that you should really visit. Look at these pictures. We spent all the day on the beach and we ate the *almost* typical paella valenciana, even though it was not the best I ate in my life; furthermore the recipe was not that typical as well, because it was dressed with fish and meat, while the typical paella Valenciana is normally with fish and vegs. At the end of the day we spent an hour going around for the village, that dominates the seaside with several terraces that bubble up behind some corner of these very small lanes. All shops, restaurants and bars are finely decorated to best fit in the panoramic context

Last day, the 4th of September, my birthday, was seemed terrible. You know what? Travelling back from an holiday in your birthday is highly unhealthy, especially when you have to wake up at 6 o’clock a.m. – sleeping 1hour and a half on a sofa – and you figure out that your vacantions have just finished. I came back home in A’dam exhausted, but I found I really nice surprise. Gab invited some friends of us at home and we had a great dinner with good food, pies and presents… translated… a birthday! :-) I really appreciated it.

I’m already planning my next holiday; as long as the sun is shining on the Spanish peninsula, I think that it’s one of the best choices to spend a relaxing week-end at and do not spend such a lot of money; checkout vueling and clickair for convenient flight offers.