Tuesday, June 19, 2007

Problems exporting content

The export process seemed to work fine, until I took a close look at the actual exported XML.

It appears that the actual content is stored in a binary format, which prevents adjustments within the actual HTML itself, like references to content stored in the same repository.

To try to circumvent this, I changed the cm:content property of the cm:content type, as defined in alfresco's contentModel.xml, to d:text instead of d:content, but this gave the following error:

11:11:58,926 ERROR [Utils] A system error happened during the operation: The node property must be of type content:
  node: workspace://SpacesStore/221a7c69-1e45-11dc-a1bf-4985acca4591
  property name: {http://www.alfresco.org/model/content/1.0}content
  property type: {http://www.alfresco.org/model/dictionary/1.0}text

So its time to create our own model for alfresco.

Monday, June 11, 2007

Exporting content from Alfresco

The JCR defines a standard format for importing/exporting content: the system view mapping. So how can I export a particular node from alfresco as final part of a work flow?

First I need to create a simple work flow in alfresco that allows me to edit content and then mark that content for publication. In alfresco I created a space to contain draft content and a space to contain to be published content. I added a rule to the draft content space that allows the author to submit content for publication, this rule copies the selected content item to the publish space.

I added another rule, this time to the publish space, that activates the publication process. For this a custom alfresco 'action' is developed that exports the selected node to an XML stream that complies to the JCR system view.

The resulting XML stream must be converted because it contains e.g. node types that are not supported on the serving repository. So these node types must be converted into supported node types.

The conversion is implemented using the Java rules engine API (JSR-94). This API defines how rules engines can be acquired and used, it does not describe how rules are defined.

Using the Java rule engine API allows changing the rules engine without the need to change the code. For starters I chose JBossRules as rule engine.

Publishing content

The company I am currently working for wants its new website implemented using a JBoss Portal system.
The current website uses Apache Lenya as CMS but with a nightly export to static HTML pages. This prevents instant publishing of single items.
Some of the entry pages contain lists showing recently changed items, news items etc. These lists are handcrafted while based on certain criteria, these lists could be generated automagically.

Other area's of the companies presence on the internet provided web applications like my.epoline and esp@cenet, these applications, and others, need to be part of the main website, hence a portal solution is chosen.
Based on some demo content, portlets have been developed that shows the content and provides means of navigating through the content.

In the architecture it has been chosen that each portal server instance will have its own dedicated read only JCR compliant repository (A.K.A. the rendering repository), physically separated from the CMS's repository (A.K.A. the authoring repository).

Since content written by authors in the end will have to enter the rendering repositopry, we need a process that takes care of that, the publication process. Currently I am working on that publication process.

As CMS system we have chosen alfresco. So my first task is to get alfresco up and running on JBoss on my dev box.

Since I don't like prepackaged downloads, I downloaded the war file package of alfresco 2.0, the alfresco sdk and the alfresco WCM package.
I wanted to create a dedicated JBoss server instance for alfresco so I copied the default server configuration and named it alfresco. I dumped the war file in JBoss's deploy directory, changed the database configuration following the database configuration topic at alfresco wiki.

The app server started up fine, so far so good...

Next thing, exporting content, is the subject of a future posting.

CU then