pretty:urlbuffer, proposal for improvement

Splash Forums PrettyFaces Users pretty:urlbuffer, proposal for improvement

This topic contains 9 replies, has 3 voices, and was last updated by  Christian Kaltepoth 5 years, 6 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #18219

    0swald
    Participant

    Hi all.

    When declaring URLMapping we’re using paths, which are relative to context root, whereas urlbuffer produces absolute url, relative to server root. In some cases this may be inconvenient and lead to extra coding/rewriting. Simple example is primefaces <p:menuitem value="Menu Item 1" url="pretty_urbuffer_var"/> which produces doubled context path – one from urlbuffer, another from primefaces.

    I’d suggest to add “relative” attribute to urlbuffer component which’d define the relativeness of generated url.

    Best regards,

    osw

    #22261

    I like this idea. Could you open a ticket for this?

    https://github.com/ocpsoft/prettyfaces/issues

    Or are you perhaps interested in implementing this feature yourself? This should be very easy. See:

    https://github.com/ocpsoft/prettyfaces/blob/3.x/core/src/main/java/com/ocpsoft/pretty/faces/component/renderer/UrlBufferRenderer.java

    We are always happy to receive any kind of help and contributions. :)

    #22262

    0swald
    Participant

    Christian, thanks.

    Sure I can do it, how do I become a contributor? Besides, there are at least three other files that should be changed when I’m done: ocpsoft-pretty-faces.taglib.xml, ocpsoft-pretty-faces.tld and documentation.

    #22263

    The source code of PrettyFaces is available on GitHub:

    https://github.com/ocpsoft/prettyfaces

    If you want to contribute, just clone the PrettyFaces repository on GitHub and then start to develop your patch. Just commit the changes into your own clone of the repository. After you are finished, open up a pull requests. If everything is fine with your patch, we will integrate it into the code immediately.

    For a more detailed description look here:

    https://github.com/ocpsoft/prettyfaces/wiki/DeveloperGuide

    But please check that you are on the correct branch. The PrettyFaces 3.3.x code base is in a branch called 3.x. The master branch is currently empty as we are currently discussing the structure of PrettyFaces 4.0.

    Feel free to contact us if you have any questions. I’m looking forward to your patch! :)

    #22264

    0swald
    Participant

    Christian, I’m absolutely new to git/maven but still managed to get the code and commit changes, please have a look at https://github.com/0swald/prettyfaces/tree/urlbuffer_relative_url_output. I’m afraid my IDEA config files have been also sent to repository. Btw this is my first contribution commit in my life))

    #22265

    In that case congratulations are in order!

    #22266

    @Oswald:

    Awesome! Thank you so much. I’ll have a look at you changes ASAP and come back to you then.

    Christian

    #22267

    Hey 0swald,

    I reviewed your patch. It looks fine. I just merged it into the 3.x branch and pushed it upstream:

    https://github.com/ocpsoft/prettyfaces/commit/2d27cfba7b0616177f67d98e950f5ca7fc63e060

    Unfortunately I was not able to preserve your username as the commit author because I had to modify the commit to remove the IDEA files. Sorry about that.

    BTW: It is really nice that you also updated the documentation. That’s something even Lincoln and I sometimes forget! :)

    Our CI server should publish a new version of the 3.3.4-SNAPSHOTS in a few minutes. So this feature will be in the official snapshots really soon.

    Thank you again for your contribution. Let us know if you have any other ideas or things that you would like to work on.

    Christian

    #22268

    0swald
    Participant

    @Christian, @lincoln, I was glad to contribute to your excellent project.

    Btw I cant find full snapshot jar, do I get it right that snapshot versions are now split into several jars – core, common, etc?

    #22269

    No, actually you need only one JAR file depending on your JSF version. The other modules (core, etc.) are automatically included in the JAR file for your specific JSF version:

    JSF 2.0:

    http://ocpsoft.org/repository/com/ocpsoft/prettyfaces-jsf2/3.3.4-SNAPSHOT/

    JSF 1.2:

    http://ocpsoft.org/repository/com/ocpsoft/prettyfaces-jsf12/3.3.4-SNAPSHOT/

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

Comments are closed.