Thoughts Electrique

Posts Tagged ‘OpenCms’

Overview of OpenCms Resourcetype IDs

Saturday, February 13th, 2010

I constantly forget the resource type IDs of the OpenCms resource types and then have to dig into the configuration to find them. So here is a list of all resource type IDs of the OpenCms core. Maybe it is useful to someone else.

(more…)

Decentralized categories in OpenCms 7.5

Friday, November 6th, 2009

This feature was presented by Michael Emmerich during the OpenCms Days 2009 and caused a lot of people to grab their pen.

A short background on categories

Categories are a built-in content relation in OpenCms and allow files in the VFS to be assigned one or more topics/keywords/whatever. They can often be used as a replacement feature for siblings which are mostly misunderstood by users without a technical background. For example consider the typical example of a news site. You have a folder structure for your articles which could be the following way:

/articles/2008/12-24-merry-christmas.html
/articles/2009/09-01-new-site.html
/articles/2009/10-02-a-great-article.html

You now want to categorize the articles into topics so you would create another folder structure:

/topic/must-read
/topic/technical

The sibling-way would be to create a sibling (put simply: an automatically updating copy) of the articles in the desired topic folder. While this is a working solution it’s counterintuitive to most users. OpenCms 7 introduced the long awaited Content Relation Engine (CRE) including a default relation called categories. Similar to the sibling solution a category is effectively a folder but instead of creating it anywhere in the filesystem it’s created in the root site (“/”) under /system/categories/. Users can now assign categories to VFS files using the context-menu entry Relations -> Assign Categories. This is a much easier approach although it has one caveat: Categories are globally defined in the /system/ folder and can therefore only be created by users with access to the root site and can not be specified on a per site or even per folder basis. This can cause problems in multisite environments.

Decentralization to the rescue

With OpenCms 7.5 this limitation is finally gone. You can now define categories on a per-site and even per-folder basis. Simply create a folder named _categories in the folder where you want the categories to be available. Then create new folders inside this folder to define categories. The categories are available in the parent folder of the _categories-folder and all subfolders. They also cascade down. Example:

/de/_categories/
/de/_categories/hot-topic
/de/_categories/support
/de/news/_categories/
/de/news/_categories/marketing
/de/news/_categories/development

Inside the /de/ folder the categories hot-topic and support are available. Inside /de/news/ the categories hot-topic, support, marketing and development are available.

This feature should easily help you to get your content structured more nicely. Speaking from experience it is crucial to create an evolveable content structure upfront so your editors as well as visitors and search engines get the most out of your site.

See also:

How to log in a user of a specified OpenCms OU

Monday, October 12th, 2009

I recently had to login a user of a specified OU (Organizational Unit) through a JSP. This is done by simply prepending the username with the path to the OU.

Example: I want to login the user “foo” of the OU “/germany/marketing“. Simple specify the String “/germany/marketing/foo” as a username and you’re all set.

OpenCms Days 2009 (part 2)

Saturday, June 27th, 2009

OpenCms Days Logo

This is the continued report from the OpenCms Days 2009. If you haven’t read the first part you might as well read it first.

The second day started with the keynote of Joel Tosi and I think this was one of the best talks of the conference (although his question totally took me by surprise since I had had no coffee yet).
Joel took a very critical view on enterprise software and support claims and explained some of the benefits they get from OpenCms at the CME.
I especially liked that he presented very concrete information of implementation and business (numbers & figures)  and also think taking the seriousness out of some enterprise label was really good.I saw many people smiling knowingly throughout the whole presentation. You rarely have a talk which is informative and also entertaining.

(more…)

JSP to download OpenCms resources as a ZIP

Thursday, June 25th, 2009

What often bugged me is that I can upload a set of files into OpenCms as a ZIP file but can not download a tree of files as such (without the use of the database export feature). I had hacked together this little JSP some time ago. It allows you to dynamically download a set of OpenCms resources as a ZIP file.

The JSP has no interface since I mainly use it for development. Simply create a JSP somewhere in the OpenCms VFS and then open the file via the browser. E.g.:

“http://workplace.com/system/createzip?source=/system/modules/foo&filename=foo-module.zip

The source parameter specifies which directory to zip up and the filename parameter which filename to use for the generated file. You can only zip up resources with a total size of 10 megabytes. This is mainly to prevent OutOfMemory errors to happen. You can easily increase the size by altering the variable maxSourceSize to any value you need.

If you find any bugs or want to give feedback simply leave a comment or send me an email.

(more…)

OpenCms and Google App Engine

Wednesday, June 24th, 2009

Especially with the new JPA driver for OpenCms by Georgi Naplatanov the question of running OpenCms on Google App Engine came up quite often at the OpenCms Days 2009. I had the same Idea when I first heard of the Java support for App Engine and did some quick research on how to do this. The research showed that running OpenCms on Google App Engine would require a huge rewrite of some OpenCms core functionalities.

(more…)

OpenCms Days 2009 (part 1)

Thursday, June 18th, 2009

OpenCms Days Logo

After two days of information overflow the OpenCms days 2009 are finally over. I think they were a success and personally got a lot value out of them.

We had a small get together on Sunday evening with a nice diner and some Kölsch. I think it’s always nice to meet some people before the conference so you can already connect to some people. We stayed out rather long and I was back at the hotel around 3:00 AM, but it was a lot of fun. I had many interesting talks and met a lot of very nice people. If you’re thinking of attending the OpenCms Days 2010, I would really recommend to come on sunday evening so you don’t miss this event.

(more…)

Restrict visibility of OpenCms templates to certain folders

Wednesday, June 3rd, 2009

Since I’m currently working on an OpenCms mutli site solution I was looking for a possibility to restrict the available templates of a site. I know this can be done via permissions but the manual implementation of this is rather painful. I’m currently in the process of extending the OpenCms security manager to take care of this but while doing this I found an (to me) unknown feature.

By usage of the property folders.available (you might have to define it first) on a template you can specify a list of comma seperated folders in which the template is available (in the dropdown).

Unfortunately this property works only on file level and can not be inherited via the folder hierarchy. Also it does not provide a secure solution since the template can always be set via the advanced property dialog.

But you never know when a feature could come in handy.

My OpenCms Days 2009 program: Day 1

Friday, April 3rd, 2009

From June 15 to 16 the OpenCms Days 2009 are happening in Cologne. I really had a great time last year so for me the decision to go was a no-brainer. Unfortunately I had no time to prepare a session this year but having a quick look at the program tells me it may be better because I can enjoy even more great sessions (doing a session by myself was very exhausting and I only survived it because of Arash Kaffamanesh’s constant water devlivery ;) ) Here are my must-see sessions:

(more…)

OpenCms Apache integration: The simplest solution

Wednesday, March 11th, 2009

My OpenCms Apache Integration Howto for OpenCms 6 still get’s a lot of visitors. Many things have changed since I first wrote this howto and certainly things are a lot easier now. I always wanted to rewrite the howto but till then I will just publish a short update on how to integrate OpenCms 7 with Apache and to remove the /opencms prefix with the most recent software.

(more…)