Integrating Grails with Weceem

16 / Apr / 2012 by Manoj Mohan 3 comments

Today, I’ll be talking on how to go about integrating the Weceem CMS into a grails-app. It is extremely simple and with a couple of steps you would have a CMS that can render traditional as well as custom content merged into your grails application.

Ok … First things first … What is Weceem ?

Weceem (as in ‘We seem’ to like it :D) is a Content Management System developed by Marc Palmer for JCatalog that is built on Grails. It is open source and easy to use.  Apart from being customizable, the other thing that I liked about it was the ability to create custom content, and that too using grails conventions!!.

While it supports traditional content like Blogs, Wiki articles etc, one had the flexibility and support of creating a custom content that might be more in line with the hosting grails app. Add to that the ease of a grails plugin that makes it’s integration with an existing grails app a breeze.

Getting back to Installation …..

To install weceem simply type

[shell]grails install-plugin weceem[/shell]

While installing, it will pull a whole lotta stuff as it’s dependencies (searchable, blueprint , ckeditor etc).

Next to see the plugin’s CMS page, one needs to configure a couple of properties.

1)   In your Config.groovy change the follwing line to false ….

[groovy]grails.mime.file.extensions = false //set to true by default[/groovy]

2)  Next if you need content to be served from the root URI (‘/’) of your application, simply remove the default grails URL mapping for ‘/’ URLMappings.groovy.i.e doing this will cause the app home page to change to the CMS home page.

Thats all you need to have Weceem up and running.

Simply hit ‘grails run-app’ and depending on your implementation of Step 2 above either hit ‘/’ or ‘wcmContent/show’ and VOILA!!!, you end up on the landing page of the CMS. Click on the ‘edit content repository’ link to go to the Content Repository that looks something like the image below…

Weceem CMS landing page

You have a grails powered CMS integrated into your app in matter of minutes. Click on the new content link button, and you are presented with a range of content options … from HTML to Blogs to Wiki pages and so on.

Great … Lets create some content …

First select existing Blog folder in the CMS dashboard  and then click on  the ‘New Content’ -> Blog Entry ..

Add some content …

Thats it … All you gotta do now is hit save.

Now to view our content … Go to the blogs page of your app (URI for page is defined in ‘Alias uri’ section of Blogs folder-edit page.. Default is ‘blog’) or “http://<serverURL>/blog”

Tip : To serve all content through a specific URI prefix .. just add[groovy]weceem.content.prefix = ‘content’ // replace ‘content’ with anything you prefer … [/groovy]
to make your blogs page and all other repository content be served from  http://<serverURL>/content/<blog_or_anything_else>

In the next blog, I’ll talk how to go about creating your own custom content ..

Till then … peace out .. 🙂

Manoj Mohan
manoj(at)intelligrape(dot)com
FOUND THIS USEFUL? SHARE IT

comments (3)

  1. Ni'ma Rayan

    I have a very strange error, I finished my project, made the .war file, but when I put it in the Tomcat_HOME/webapps folder, and it also deploys, but it’s not showing up in the browser, instead it gives me the 404 error: The requested resource is not available.

    Reply
  2. krishna

    i always get the below error in STS spring tool suite.

    log4j:ERROR Error initializing log4j: jline/Terminal
    java.lang.NoClassDefFoundError: jline/Terminal
    at org.codehaus.groovy.grails.plugins.log4j.appenders.GrailsConsoleAppender.(GrailsConsoleAppender.java:45)

    Reply
  3. Philippe

    Great ! I’ve been looking into it for a while but was always bumping into issues I had no time to look into at that time. I’ll give it a new try.

    Thanks !

    Philippe

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *