But one of the TODO things we had for a long time is getting that
check out of the render method in the first place (as the comment
said, it should be done earlier. If you don't want your page to
render, use an appropriate IAuthorizationStrategy (allowRender)

On 11/30/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
> Don't know if i like that change.
> now just a call to Page.render() will render the page no matter what the
> page itself did say.
>
> Also the PageClassRequestTarget doesn't check the page that it has to
> render.

Oops. Forgot that.

> So if a homepage or bookmarkable page does this:
> setResponsePage(XXX.class) then XXX  will be rendered now no matter what
> checkaccess of XXX says!
> thats wrong.
>
> Also if checkAccess does one of the setResponsePages (class or instance)
> then those are also not checked anymore.
>

No, I don't think that is wrong, as it should be part of
IAuthorizationStrategy. The sole reason for checkAccess imo is that
you can redirect to another page (ie logon page) in certain cases.
This case is common enough to support seperately, though I'm not
entirely happy with it's seperate position.

So, say we would do it after even processing. That would mean you
could have a interface method called before check access is even
called.


> I refactored it a bit more so that all CHECK_ACCESS is not a real case in
> the step.
> And when another target is set i recheck that one with CHECK_ACCESS again.
> Only one problem now that we already had before the great refactor is that
> what happens if we bounch back and forward?
>
> Also IPageClassRequest now also extends icheckaccess and also
> isessionsynchronize (can also render a page with models!)

Then that target should better be diveded further. There is no need
for synchronization on the target when it is only redirecting.

The synchronization code could be done better anyway. It would be
cleaner to work with a token that holds the synchronization info or
something.

The main thing is was trying to solve by those refactorings on top of
your's is that any component shouldn't be just break out of the
processing cycle by calling render/ redirect directly. I was hoping to
avoid that. Unfortunately, it made the code messier.

Eelco


>
> johan
>
>
>
> On 11/30/05, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> >
> > I refactored them again to work nicely together with the request
> > target framework. Unfortunately, the RequestCycle internals got
> > messier again; hopefully when I have a bit more time I'll make it look
> > a bit better again. But for now, it's fixed pretty solid I think while
> > still being generic.
> >
> > Eelco
> >
> >
> > On 11/29/05, Johan Compagner <[EMAIL PROTECTED]> wrote:
> > > All redirect issues i can think of (in Page constructors or in
> > > checkAccess()) are fixed.
> > > They should all work fine again
> > >
> > > johan
> > >
> > >
> > > On 11/29/05, Maurice Marrink <[EMAIL PROTECTED]> wrote:
> > > > Hi Eelco,
> > > >
> > > > Before this refactoring it was possible to redirect to another page
> > > > from inside page.checkAccess(), however since the refactoring it is no
> > > > longer possible. The new page is put on the stack but ignored aftered
> > > > the response of the original page is done.
> > > > Is there a new place where we can intercept a page or is this still
> > > > work in progress?
> > > >
> > > > We are working on a customized version of wicket here (with integrated
> > > > jaas authorization) and i am trying to keep our version in sync with
> > > > head.
> > > >
> > > > Maurice
> > > >
> > > > 2005/11/28, Eelco Hillenius < [EMAIL PROTECTED]>:
> > > > > Hi all,
> > > > >
> > > > > I've been working on some heavy duty refactorings of RequestCycle
> the
> > > > > last few days. I'm far from done, but I just reached an important
> > > > > milestone in it and I thought it was time to explain a bit what I am
> > > > > doing for those that follow HEAD.
> > > > >
> > > > > There's a TODO document in the new niceurl example of
> wicket-examples.
> > > > > Juergen, if you're reading this, could you take a look at that?
> > > > > There's a question for you in it :).
> > > > >
> > > > > Here's the last commit log in which I try to explain the
> refactorings:
> > > > >
> > > > > ...
> > > > > work in progress: request cycle refactoring.
> > > > >
> > > > > Milestone: the major part of low-level refactoring is done now and
> > > > > there is new functionality
> > > > > for mounting request targets to paths.
> > > > >
> > > > > A short explanation how request processing works now:
> > > > >
> > > > > Request cycle processing is now mostly delegated to an instance of
> > > > > IRequestCycleProcessor which can
> > > > > be created by RequestCycles or - preferably - the default request
> > > > > cycle processor in Application.
> > > > >
> > > > > I defined the processing clear steps; they can be found as methods
> on
> > > > > IRequestCycleProcessor:
> > > > >
> > > > > 1. Destiling a strongly typed RequestParameters object from the
> > > > > Request. This is done by an instance
> > > > >        of IRequestEncoder. The request encoder is the strategy that
> > > takes
> > > > > care of creating urls (all urlFor
> > > > >        methods of Page are now dispatched to this strategy) and
> > > 'decoding'
> > > > > them into the strongly typed
> > > > >        parameters object. Furthermore, the encoder interface
> provides
> > > for
> > > > > mounting and unmounting
> > > > >        Wicket request targets (see 2). Using this interface has the
> > > > > advantage that all 'translations' are now
> > > > >        being done by one object and that the translations do not do
> any
> > > real
> > > > > processing yet. Hence the
> > > > >        actual processing can be implemented in a very different way
> that
> > > has
> > > > > nothing to do with url translations.
> > > > >
> > > > >
> > > > >
> > > > > 2. Solving an incomming request to a request target using the
> strongly
> > > > > typed RequestParameters of step 1.
> > > > >        Request targets (IRequestTarget) are a central concept in the
> new
> > > > > refactorings.  A request cycle has
> > > > >        one current request target that can range from a bookmarkable
> > > page
> > > > > (or a redirect to it), a component
> > > > >        listener invocation to shared resources, external resources
> or
> > > > > something like a HTTP error message.
> > > > >        Request targets themselves are responsible for creating/
> > > delegating a
> > > > > response. For the rest they are
> > > > >        fairly shallow, and implementations of IRequestCycleProcessor
> do
> > > the
> > > > > heavy lifting.
> > > > >
> > > > >        Once the target is determined, it is set as 'the current'
> target
> > > in
> > > > > the RequestCycle. Actually, RequestCycle
> > > > >        holds a stack of all set targets. For instance, when you call
> > > > > setResponsePage, what happens is that
> > > > >        actually a request target implementation (in this case
> > > > > (PageRequestTarget) is put on top of the stack.
> > > > >        after the request cycle is done executing, all request
> targets
> > > will
> > > > > be iterated and their cleanUp methods
> > > > >        will be called to enable request target implementations to
> free
> > > > > resources, give notifications, etc.
> > > > >
> > > > > 3. The next step is event dispatching. During this step things like
> > > > > calling listener interface methods (such
> > > > >        as Link.onClick) may be done.
> > > > >
> > > > > 4. The last step is to respond using the current request target. A
> > > > > target may directly call render on e.g.
> > > > >        a component, delegate the actual response creation (like with
> > > > > resources) or create a redirect to
> > > > >        defer the actual handling. A target implementation is free to
> do
> > > > > whatever it wants, as long as a response
> > > > >        is created.
> > > > >
> > > > > 4.a. when something during handling of 3 or 4 goes wrong, an
> exception
> > > > > response is created. It is now much
> > > > >        easier (I hope) for users to implement completely custom
> > > exception
> > > > > handling/ page rendering.
> > > > >
> > > > > NOTE: most of the refactorings are interface based (due to popular
> > > > > demand?) so that it is much easier than
> > > > > before to create proxies, interleave them, etc. This can now be done
> > > > > better than before as the contract
> > > > > is better externalized now (and enforced in the final method
> > > > > RequestCycle.request()) and devided in seperate
> > > > > steps instead of being implementation details.
> > > > >
> > > > > NOTE: there is a lot of cleaning up to do still. I'd like to take a
> > > > > good look at all the special cases we put in
> > > > > Application/Settings/Pages
> > > > >  the last few months, and get rid of the things we don't need to
> support
> > > anymore
> > > > > when they can be done using this interface, such as exception page
> > > handling.
> > > > >
> > > > >
> > > > > NOTE: there is a default, handy implementation of
> > > > > IRequestCycleProcessor called CompoundRequestCycleProcessor
> > > > > which delegates it's behaviour into seperate interface calls so that
> > > > > it is easier to mix-'n-match implementations.
> > > > >
> > > > > NOTE: there are some API breaks:
> > > > >
> > > > > - Page class alias functionality is not supported anymore. It was
> > > > > 'miss-used' for shortening resource keys
> > > > >        more than it was for having page aliases, and while the
> > > shortening of
> > > > > resource keys might be a nice thing
> > > > >        to have again in the near future, the page aliases are not
> needed
> > > > > anymore as it is replaced by the new
> > > > >        path mounting functionality. We need to rethink the
> shortening of
> > > > > resource keys in a more generalized
> > > > >        fashion in the next few days.
> > > > >
> > > > > - The home page render strategy is removed. There are now two
> options:
> > > > >        1. The home page class is mounted to a path. When that is the
> > > case, a
> > > > > redirect to this bookmarkable page
> > > > >                path will be issued and the mounted url is thus
> shown.
> > > > >        2. Nothing was mounted. The home page is rendered directly
> and
> > > the
> > > > > url will be 'clean'
> > > > >                (like
> > > http://localhost:8080/wicket-examples/navomatic )
> > > > >
> > > > >        I know there was a third option, but it was not clear to me
> what
> > > the
> > > > > advantage for that one was. If someone
> > > > >        needs it, please complain :)
> > > > >
> > > > > ...
> > > > >
> > > > > Hope you have fun with it. Tomorrow, I'll (finally, sorry Evan)
> > > > > implement browser detection, which should be fairly simple now.
> > > > >
> > > > > Eelco
> > > > >
> > > > >
> > > > >
> -------------------------------------------------------
> > > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through
> log
> > > files
> > > > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> SPLUNK!
> > > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > > _______________________________________________
> > > > > Wicket-develop mailing list
> > > > > [email protected]
> > > > >
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > > >
> > > >
> > > >
> > > >
> -------------------------------------------------------
> > > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> > > files
> > > > for problems?  Stop!  Download the new AJAX search engine that makes
> > > > searching your log files as easy as surfing the  web.  DOWNLOAD
> SPLUNK!
> > > > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > > > _______________________________________________
> > > > Wicket-develop mailing list
> > > > [email protected]
> > > >
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> > > >
> > >
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> > for problems?  Stop!  Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> > http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
> > _______________________________________________
> > Wicket-develop mailing list
> > [email protected]
> >
> https://lists.sourceforge.net/lists/listinfo/wicket-develop
> >
>
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to