Tags:
create new tag
view all tags

Question

Following a suggestion from SvenDowideit in my question: HowToUseTWikiFuncGetCgiQuery I have attempted to write a REST handler.

Specifically what I did you can see here: http://bram.van-oosterhout.org/twiki/bin/view/Sandbox/TestTopic1

I got it to work and feel quite pleased with myself. but I had to use undocumented features like:

  1. using TWiki::UI::run instead of a TWiki::Func interface
  2. using $session->{cgiQuery}; instead of TWiki::Func::getCgiQuery();

Is there a better way?

Separately, I found the rest interface works fine, but the &topic=myTopic parameter in a http invocation creates an odd result. Change &thetopic to &topic in the following url:

http://bram.van-oosterhout.org/twiki402/bin/rest/TestPlugin/example?theweb=myWeb&thetopic=myTopic&method=topic&major=test&minor=test&debug=1

It appears to be taken as a special value. Is that intended?

regards....

Update 20 November

I found subsequently that other calls to TWiki::Func don't work either.

I solved that with:

sub restExample {
   my ($session) = @_;
   $TWiki::Plugins::SESSION = $session;
  ...

That helps, but some calls still don't work. In particular: TWiki::Func::getSkin(); returns pattern, although the skin for the web is set as Rollout.

Clearly there is no way for the code (SESSION??) to know what web I want. The web is defined in a cgi param named theweb. How can I tell getSkin which web I want the skin for. How can I tell getSkin which web I am referring to? Or should I get the SKIN variable myself using getPreferencesValue( $key, $web )?

regards...

Environment

TWiki version: TWikiRelease04x00x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Debian Linux
Web server: Apache 2.0
Perl version: 5.8
Client OS: Debian Linux
Web Browser: Firefox
Categories: Missing functionality, Contributing code

-- BramVanOosterhout - 19 Nov 2006

Answer

ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

you may well have uncovered a real bug - although last time i made a restHandler, I did not have these issues. The TWiki::Func API should work for you, and certainly used to.

-- SvenDowideit - 21 Nov 2006

Sorry, closing this question after more than 30 days. Feel free to file a bug report...

-- PeterThoeny - 29 Dec 2006

Change status to:
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2006-12-29 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.