On RSSCMS

On RSSCMS

“Alas, poor yoric, I knew him well” 1

I feel as though poor old rsscms never had a chance to really make its impact on the world, and now it is dead. Well, mostly dead – it is now version 2! Not that I ever released any of the code before – but the new code is coming.

First things first

Why the name change you may well ask?? 2 – if you do a quick google search (go on, I won’t be removing this post while you are away) you will notice that two things pop up – a domain name of rsscms.com which looks like it is a cash parking one, and turning RSS feeds into a CMS. (As a side note as I was editing this document a couple of days later 3– it seems I am back on top baby!!)

What THE!

turning rss feeds into a cms???

I wish i had thought of that – what a totally useless waste of time – it is obviously a lovely way of scraping content to make it look like you are actually doing something with your cms whilst not doing anything at all. Anyhow…

Whilst this is a project mainly for myself, it would be nice to be a little better Google-SEO wise.

One of the first CMS that I used was Jahia which I still do like and run up an instance on the odd occasion 4.

Bear with me and the renaming will all become clear…

Here is Jahia’s startup

                                 ____.
                     __/\ ______|    |__/\.     _______
          __   .____|    |       \   |    +----+       \
  _______|  /--|    |    |    -   \  _    |    :    -   \_________
 \\______: :---|    :    :           |    :    |         \________>
         |__\---\_____________:______:    :____|____:_____\
                                    /_____|

  . . . s t a r t i n g   j a h i a   b u i l d   2 5 2 0 3 . . .

Note: It used to say:

. . . i n   j a h i a   w e   t r u s t . . .

, rather than the current

. . . s t a r t i n g   j a h i a   b u i l d   2 5 2 0 3 . . .

It seems that now Jahia is too big and important a company with sales to the Fortune 500 group that the 80’s script kiddy ethos has been squeezed out of them – ’tis a shame really.

So as an homage to Jahia I have my own ascii art related startup:

         (          (        (                      *     (     
         )\ )       )\ )     )\ )    )       (    (  `    )\ )  
        ( )/(   (  ( )/( (  ( )/( ( /(       )\   )\))(  ( )/(  
         /(_)) ))\  /(_)))\  /(_)))\())___ ( (_)  (_)()\  /(_)) 
        (_))  / (_)(_))  (_)(_)) (_))/|___|)\___ (_()( _)(_))   
        | _ \(_))  / __| (_)/ __|| |_     ( / __||  \/  |/ __|  
        |   // -_) \__ \ | |\__ \|  _|     | (__ | |\/| |\__ \  
        |_|_\\___| |___/ |_||___/ \__|      \___||_|  |_||___/  

                              --== ++ ==-- 
 --== (Re)ally (Si)mple (St)atic - (C)ontent (M)anagement (S)ystem ==-- 
   --== Resistance is not _futile_, it is actually quite useful! ==-- 
                              --== ++ ==-- 

I still have kept the RSS CMS thing – as you can see above Really Simple Static – Content Management System, rather than the Really Simple Static Content Management System.

Next up – re-platforming

I needed to re-platform rsscms for a couple of reasons:

  • There was a disconnect between developing the project in eclipse, and running the project.
  • Every time you redeploy the war you have to copy back over the content – which is annoying
  • You have to download tomcat (easy enough – but yet another step)
  • You must configure it to run on a different port if you want to run multiple instances.
  • It creates a lot of directories which get in the way of pure content editing.

And here is the list of reasons why I chose tomcat:

  • I know tomcat and I can easily get something set up that quickly and easily runs. It is relatively straightforward to configure and get it all working.
  • Well supported
  • Well documented

Current rsscms

So, to get the current rsscms up and running, this is what you would need to do:

  1. Download tomcat
  2. Download rsscms.war
  3. Unzip tomcat
  4. Drop the rsscms.war into the correct directory (and rename to ROOT.war)
  5. Delete all of the other directories in the webapps directory (including examples, admin etc)
  6. Start up tomcat (making sure that the port is configured correctly – i.e. doesn’t clash with any other running tomcats)
  7. Start editing

Upgrading rsscms

  1. Start up tomcat/rsscms
  2. Go to the /rsscms-backup/ URL
  3. Copy the contents of the ‘backup’ directory (which resides in the parent folder) to somewhere safe.
  4. Delete the webapps/ROOT directory
  5. Copy over the ROOT.war with the newly downloaded rsscms.jar
  6. Delete all of the content
  7. COpy back your backup of the content into the correct directory (you did make a backup – did you not?)

All of this seemed a little too much for a Really Simple content management system. Sure, it is simple for me who developed it and for anyone that knows what they were doing.

Introducing ReSiSt-cms

All you do is…

  1. Download the resist-cms.jar file
  2. Double-click
  3. edit

(Although you do need to have a JDK installed, not a jre – which may be a problem)

Upgrading ReSiSt-cms

  1. Download the resist-cms.jar file
  2. copy over the old resist-cms.jar
  3. Double-click
  4. edit

Now that seems a little more simple, doesn’t it.

Now all I need to do is to actually translate all of the content over.

Jetty

So I finally get to the topic of the post.

On the Jetty wiki, you will find the Jetty slogan

Don’t deploy your application in Jetty, deploy Jetty in your application

followed by:

What this means is that as an alternative to bundling your application as a standard WAR to be deployed in Jetty, Jetty is designed to be a software component that can be instantiated and used in a Java program just like any POJO.

And this is exactly what I was looking for, however most of the examples are not actually based on embedding Jetty, but using it as a tomcat replacement.

After many sleepless nights coding – I finally came up with a way of programmatically registering servlets, filters, handlers and the like. And this is the code:

  this.server = new Server(port);

  ServletContextHandler context = new ServletContextHandler();
  context.setContextPath("/");
  context.setResourceBase(getRootContentDirectory());

  context.setSessionHandler(new SessionHandler());
  context.setErrorHandler(new CmsErrorHandler());

  context.setClassLoader(Thread.currentThread().getContextClassLoader());

  context.addFilter(CmsFilter.class, "/", FilterMapping.REQUEST);
  context.addFilter(CmsFilter.class, "*", FilterMapping.REQUEST);

  // JSP Servlet mappings
  context.addServlet(JspServlet.class, "*.jsp");

  // for some unknown reason, the servlet has to be added for the filter to work
  context.addServlet(CmsServlet.class, "/");
  context.addServlet(CmsServlet.class, "/*/");

  context.addServlet(PublishServlet.class, PublishServlet.BINDING_URL + "*");

  context.addServlet(StaticAssetServingServlet.class, StaticAssetServingServlet.BINDING_URL + "*");

  server.setHandler(context);

  server.setStopAtShutdown(true);
  server.start();

So there you have it – there are so many false starts that I had to go through in order to figure this out – perhaps I will write a tutorial on Jetty.

Also, I had to use an older version of Jetty because the documentation is just horrific for the latest version.

So where is this all going?

Well, you may ask, the reason why there has been such a long absence is simply because I have been busy.

The ultimate goal is to finish of solr-panl (and the related tutorials). However to do this, I wanted to update the tutorial – which required me to have the cms ready – and rsscms just wasn’t cutting it any more.

So, step one was to update the cms into something useful. However to do this, I wanted to be able to have professional documentation with it. Since ReSiSt-cms is a tag based system, I wanted to finish of the tag library descriptor documentation generator – which is now one-third done 5.

I wanted to have this done so that it was easy to understand how the cms worked. However, in order to do this, I needed to get my build environment up to scratch, which is now done.

So the steps are:

  1. Update build environment (DONE!)
  2. Update TLD documentation generator (1/3 complete)
  3. Re-write rssmcs (DONE!)
  4. create content (in progress)
  5. Finish solr tutorial (waiting)
  6. Finish solr-panl

And there you have it.

Finally

Well, my three current readers… :)

Do I explain things in a nice way?

Should I do it more, or is it just me that understands the explanations that I give?

(Oh, and by the way, thanks for registering to make a comment – I do appreciate it, and at this point I really can read (and reply) to every single comment made on this blog).

Footnotes:

  1. It is Shakespeare dude!
  2. Which is highly doubtful as you probably don’t know about it!
  3. Who am I kidding – I have been sitting on this post from the 22nd of December!
  4. the most recent was about 30 minutes ago!
  5. The three thirds are 1. PDF output (complete), 2. HTML local output (in progress), 3. HTML server output (in progress)

Like my footnotes?
Want to add footnotes to your blog?
They can be added easily to your WordPress installation


One Response to “On RSSCMS”

  • Moebius Says:

    I, for one, like your explanations. And especially your footnotes :).

    Oh and ASCII art rocks! Maybe ReSiSt will convince me to run a CMS, too :P

Leave a Reply

You must be logged in to post a comment.