2 Replies Latest reply on Jun 24, 2013 11:47 PM by VPranav

    Publishing .shtml files to web server




      I am evaluating CQ5 to manage my web application having .html and .shtml pages (pages with SSIs, server side includes). I want to manage the web content - htmls, .shtmls, images etc using CQ5.


      I have following questions -


      1. Does CQ5 have any restrictions in publishing pages with extension .shtml?

      2. What are the best ways to manage these .shtml in CQ5?

      3. How do I publish these .shtmls to web server?




        • 1. Re: Publishing .shtml files to web server
          orotas Level 4

          As a general rule anything you manage in CQ gets published to the web server via the Dispatcher plugin. Dispatcher functions as a reverse proxy sending request back to the publish servers and caching the result.


          As far as managing the .shtml items I am assuming that you want them to be generated and managed as pages in CQ with traditional component authoring interfaces. You will have two big challenges in this scenario:

          • Sling request handling - Sling uses the extension to map a request to script. By default sling would consider .shtml to be different than .html and you'd need to name your JSPs appropariately. This could be problematic if you are reusing components across both page types. I have never tried this, but you could consider using the Sling Default Get servlet's alias configuration to map .shtml to .html which might work, but I have never actually done that.
          • Link rewriting - you are going to have to write a layer of code that you use in your components to properly set the right extensions on the URLs when linking to these .shtml pages. By default CQ is just going to add .html. You will need to make sure you have some sort of way to tell in the page's meta-data whether or not it's an .shtml - perhaps based on template and then make sure you take that into account when writing out links. The rich text editor will be a challenge because adds the .html in JavaScript and stores it in the repository. You will have to override this in someway if you want to link to these .shtml pages in a rich text editor.


          In the past when I have needed to leverage SSIs through CQ I have just configured Apache to do do the SSI processing on .html to avoid these challenges. It means a heavier load on the web tier and it has some potential issues but generally is a better option than trying to get CQ to handle the .shtml extension.


          Also the other thing to consider is whether or not you really need .shtml files since CQ is pretty dynamic - usually you can figure out how to handle the dynamic assembly in CQ and not at the web tier (or using AJAX).


          Or did I misunderstand your plan - are you managing these as files in the DAM. If you are managing them as files in the DAM then you just have to make sure that you have a rendering servlet that will set the right mimetype.

          1 person found this helpful
          • 2. Re: Publishing .shtml files to web server
            VPranav Level 1

            Thanks for your reply Orotas.This helps.


            I do not want Apache to do SSI processing on all HTML as this would impact performance and the load time of page (as also mentioned by you).