I’m working on an intranet website based on OpenCMS and I’d like to include a tag cloud to the site. I’ve found some opensource tagcloud java libraries (like OpenCloud). Do you have any experience with wiring those two (or other tagcloud libraries+OpenCMS) together?
Share
OK so I solved this partly myself in the end. I also used some code from Richard Friedman’s tag cloud.
The way I do it is the following: At specified intervals, OpenCMS runs a scheduled job that reads the Lucene index, extracts all the terms from the “keyword” fields (which can be filled in for every file in VFS), generates the tag cloud and stores the result in a file that is part of my OpenCMS template. There are two Java files: Cloud.java and BuildTagCloud.java. “Cloud” reads the index and returns a List of the most common terms. “BuildTagCloud” implements I_CmsScheduledJob interface and is registered as a scheduled job.
BuildTagCloud.java:
Cloud.java:
Hope this can help someone as I spent an awful lot of time figuring it out!