Tapestry 5
  1. Tapestry 5
  2. TAP5-418

Control over creation of page render and component event requests should be encapsulated into an overridable service

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.1
    • Fix Version/s: 5.1.0.1
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      I would like to propose an extension of the Link interface with a setAbsoluteURI(String absoluteURI) method, or something alike. This will give more flexibility when handling the link in the LinkCreationListener.

      In my usecase, where I need the locale of the browser displayed as the first part of the URI (eg http://domain.com/en_US/myPage), I use a dispatcher to detect the locale (or change to it), and have to completely copy the LinkFactoryImpl into my own LocaleAwareLinkFactory (which gets contributed as an alias) to be able to set the URI to what I want on Link instantiation. If I can change the URI at a later stage I only need to add my own LinkCreationListener.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Note that your use-case is now the default for Tapestry 5.1.

        There's now a LinkCreationHub to which you can register listeners (LinkFactory is split into LinkSource and LinkFactory, both private).

        Show
        Howard M. Lewis Ship added a comment - Note that your use-case is now the default for Tapestry 5.1. There's now a LinkCreationHub to which you can register listeners (LinkFactory is split into LinkSource and LinkFactory, both private).
        Hide
        Joost Schouten added a comment -

        But there doesn't seem to be a way to alter the actual URI on the Link instance passed to the Listner. The API only allows for adding Anchors or parameters. I would love to see a method on the Link interface that allows me full control over the URI.

        Show
        Joost Schouten added a comment - But there doesn't seem to be a way to alter the actual URI on the Link instance passed to the Listner. The API only allows for adding Anchors or parameters. I would love to see a method on the Link interface that allows me full control over the URI.
        Hide
        Howard M. Lewis Ship added a comment -

        Good luck for you ... the new behavior for persisting the user's locale between requests is exactly your format (locale before page name).

        Show
        Howard M. Lewis Ship added a comment - Good luck for you ... the new behavior for persisting the user's locale between requests is exactly your format (locale before page name).
        Hide
        Howard M. Lewis Ship added a comment -

        A new public service that encapsulates building the component event request path and the page render request path and parsing an incoming request path to extract the necessary details.

        Show
        Howard M. Lewis Ship added a comment - A new public service that encapsulates building the component event request path and the page render request path and parsing an incoming request path to extract the necessary details.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Joost Schouten
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development