URL routing at runtime

Splash Forums PrettyFaces Users URL routing at runtime

This topic contains 8 replies, has 2 voices, and was last updated by  dodi 5 years, 2 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #17842

    dodi
    Participant

    Hi guys, I’m new to all of this, PrettyFaces, JSF. Is it possible to configure PrettyFaces at runtime, each of my users, could have a diferent configuration, based on the rights they have on the application. Is it possible?

    I made this possible using a PHP application I’ve developed with Zend Framework.

    Tnks!

    #20552

    Hi dodi,

    Yes, this is possible, but currently not very convenient. PrettyFaces does not have a native API to support this, but more and more people are asking for it, so it sounds like we should probably start trying to address it.

    Right now, you’ll have to set a new configuration into the PrettyContext manually. PrettyContext.setConfig(), but this will be global for all users. There is only one central configuration. Separate users will be tricky, but not impossible… could I ask you to describe your use-case a little bit more? I might be able to give you a better answer.

    For example, why are you doing this? How do your URLs look, in which situations?

    –Lincoln

    #20553

    dodi
    Participant

    Lincoln,

    First of all, tnks for your reply.

    Let’s imagine my approot url is http://myportal.com , ok? So, this portal, has many “modules” inside it, let’s imagine that one of this modules is, the user access tracking report, that I would activate by the following URL: http://myportal.com/userTracking . So, the router will wask, okay, the current user have access to which version of this module?

    Then in my database, I give access of the modules version by user role, so, if the current user is a developer or a tester (that wants to check, how the new version will work in the production enviroment) the router will redirect to the version 2.0 of the module. But if the user is a manager (that would like to see the stable version) then it will redirect to the version 1.0 .

    Am I clear enough?

    Tnks!

    #20554

    A few comments questions –

    1) the access control sounds like something more appropriately solved with a Security framework.

    2) When you say ‘redirect to the version of the module’, do you mean 301 redirect or an internal servlet forward? E.g. Will the URL be changing when you redirect them to the module?

    #20555

    dodi
    Participant

    Internal servlet forward. The URL stays the same…

    #20556

    Are you using JSF?

    #20557

    dodi
    Participant

    Hello guys! Restarting this thread!

    So! Let’s start from the beginning. My portal has many modules, and some users could have diferent versions of each model.

    Lets imagine:

    -the user A, have access do the non-stabble version of the module, just deployed on the server;

    – the user B, has access to the stable version

    The database already supports all this, I want to know, how can I route the user to the desired module, as i said before, I’ve it working in PHP with Zend Framework.

    I could give some code snippet if necessary.

    Tnks in advance!

    #20558

    I’d start by checking out http://ocpsoft.org/rewrite/, which is going to give you the ability to use this kind of fine grained control. Check out the ‘Join’ class.

    #20560

    dodi
    Participant

    Hi Lincoln, is it possible to talk to you in skype, gTalk, MSN?

    Tnks!

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

You must be logged in to reply to this topic.

Comments are closed.