Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12016

Make CMS/Wicket urls page version independent

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Won't Do
    • None
    • None
    • None
    • None
    • Turing
    • Turing Sprint 216

    Description

      Our CMS (Wicket) page urls always have a prefix of /?0 (login) or /?1 (logged in).

      This is based on WIcket versioning a page (generically), to allow users to keep conversational state in their responses (or by going 'back', e.g. using the back button) with (state of) the page definition they interacting with.

      While that (generic) functionality and principle is sound, in practice we (the CMS) don't really need this, because effectively we only 'serve' two pages, one when not logged in, another when logged in, and we don't need (nor support) keeping conversational state on the page definition.

      So effectively, we don't need page versioning. But Wicket makes it hard (almost impossible) to disable this behavior.

      However, with some smart 'trickery' it actually is quite simple to work around this, using standard Wicket features, by intercepting the incoming and outgoing urls using a custom Wicket IRequestMapper.

      Which I already prototyped and got it working pretty easily.

      The trick is to strip the page version (/?0 or /?1) from the outgoing urls, and simply 'inject' them again on the incoming urls, based on the simply boolean condition being logged in, or not.

      There is a little bit more to it, of course, but not much.

      The big advantage of removing the page version of the url, is that it then allows us to build more 'natural' (common) path based url navigation, for example, mapping current path or uuid query parameters to a path:

      • /cms/?1&path=/<doc path> => /cms/path/<doc path>
      • /cms/?1&uuid=<doc uuid> => /cms/uuid/<doc uuid>

      Overall, this will allow using more stable (bookmarkable) links, which are not 'exposing' the Wicket specific peculiarities and are more aligned with common or natural stable web links. 

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              adouma Ate Douma
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: