Forum OpenACS Q&A: Re: Question about linking to EXTERNAL urls.

Collapse
Posted by Richard Hamilton on
In my previous post I mentioned creating a redirector class as per Gustaf's earlier instructions that links to a /redirect.tcl file that calls ad_returnredirect with the -allow_complete_url flag.

Whilst I think this will work ok I wonder if there is a better way than a double redirect.

Whilst thinking about the possibilities it ocurred to me that I could create a simple, standard xowiki::page that has an adp include as its only content. The tcl file associated with that adp include could contain simply the ad_returnredirect call, so the template would never actually be returned, and control would never pass back to the calling xowiki object.

Can I do this safely? Can I be sure that all the processes will end, or will I end up with processes waiting indefinitely for return values?

R.

Collapse
Posted by Gustaf Neumann on
Richard, nobody hinders you to use on your site e.g.
  redirect instproc pretty_value {v} {
    ad_returnredirect -allow_complete_url $v
    ad_script_abort
  }
instead of the version based on the returnredirect method sketched earlier. However, i am not in favor of adding this variant to CVS because of the abuse potential. A good solution (see above) would require more effort than i can spend right now.

In case someone wonders, why my first version was using the returnredirect method rather than the ad_returnredirect function: The xo*-method be used outside of a connection thread while ad_returnredirect requires to be executed in a connection thread. Therefore, the method can be used safely e.g. in a regression test or in a scheduled procedure, etc. Allowing the title-field to contain HTML markup (which is rendered without escaping) must have been a bug in some earlier xowiki versions.

Collapse
Posted by Richard Hamilton on
Gustaf,

Thank you for taking the time to explain. I am working through the xotcl documentation and examples so hopefully I will be less clueless in the future! 😊

Regards
Richard