Michael Neumann
2/23/2005 2:14:00 PM
Joao Pedrosa wrote:
> Hi,
>
>
>>Well, you call @tread in Topics. If you do this, then of course the
>>Topics component will not render itself and will not react on actions
>>(until you answer from @tread).
>>You should not use call in this situation, use #render and if statements.
>
>
> Done, thanks. :-) Pretty easy once we have decided about it. hehe. 6
> lines have been changed for this.
>
> About turning off the Session and creating and interpreting custom
> URLs, could you give me some direction beforehand? It would be great
> to try this out as soon as possible, because URL is a pending issue to
> me. :-)
I'm not sure what the best way of doing this. Seaside has an updateUrl
method, which is called for each component (similar to
process_callbacks), and which can be used to modify the URL after an
action has occured and processed, but before the redirect to the render
phase is done.
For example, if you have the following component tree:
Topics (topic_id)
|
|-- Thread (thread_id)
the Topics component update_url method, could append "/#{ topic_id }" to
the current url, then the Thread component could add "/#{ thread_id }",
so at the end we have:
/app/1/2/=/session_id/...
where 1 is the topic_id and 2 is the thread_id.
Of course this is only one part of the story. The other is to
reconstruct the component tree from the URL (only neccessary if the
session has timed-out).
That should be simple to implement, but I've not yet done this (there's
no update_url method yet). If you like, take a look at
wee/core/session.rb (this file needs refactoring ;-), method
handle_new_page_view, the line which starts with "redirect_url". If you
use there a different redirect_url, this will show up in your browser.
Additionally, you'd need to modify wee/request.rb, methods build_url and
parse_path, to remember the extra URL information that you have
specified (@app_path is used in build_url, whereas you'd need to use
full_app_path of method parse_path).
I've currently (the next weeks) not the time to try this out on my own.
But I'd like to add this to Wee in the future. Patches are welcome ;-)
To turn off displaying the session inside the URL, use Pageless mode.
But be aware that this also disabled backtracking. See the ChangeLog for
informations on how to use pageless mode.
Regards,
Michael