Either use a direct http link, or define an interwiki link for http:, which allows you to use a http: shortcut (which I think has been done below).

That is,

jspwiki.interWikiRef.http = http://%s

/Janne

On 28 Sep 2008, at 18:57, Benedikt Mohrmann wrote:

Hi,

I am still trying to call a plugin via a link!
I already created a page called "WIDRequestDetailsHeadLess".
Now I created a link "http://localhost:8080/JSPWiki/Wiki.jsp? page=WIDRequestDetailsHeadLess?wid=123". As you can see, this is a link to the created page with a http parameter!

But JSPWiki always tries to create a new page called "WIDRequestDetailsHeadLessWid=123".

Any hints about that?

Have a nice weekend
Benedikt


[EMAIL PROTECTED] schrieb:
Sorry for the slow response.

If you could, send me your wiki pages from steps 1 and 2. I'll plug them into my site and see what happens.

-Lou


Benedikt Mohrmann <[EMAIL PROTECTED]> wrote on 09/24/2008 08:52:01 AM:


Hi,

hmmm, seems a little more clear, but so far I couldn`t make it.

Here is what I have done:
1. Created a new page called "WIDRequestDetailsHeadLess" with the only content "[{'MyTest'}]" (where MyTest is my Plugin).

2. Created a link with the target "[http:WIDRequestDetailsHeadLess?wid=123]" on another page.

3. My Plugin Code:
public class MyTest implements WikiPlugin {

    public String execute(WikiContext context, Map params)
            throws PluginException {

        String wid = context.getHttpParameter("wid");
        if("123"==wid){
            return "Runs";
        }
        else return "Runs not";
    }
}

The problem is that when I click on the link, the Wiki wants to create a


new page called "WIDRequestDetailsHeadLess?wid=123".

Regards


[EMAIL PROTECTED] schrieb:

Yes, now that I look at my previous post, it would be nice of me to explain it.

OK, so I had the same question you had - I created a plugin and put it
on
a page, but I needed to pass in a variable before it ran. The trouble
is,
once you invoke the page, the plugin runs immediately and does not
give
you a chance to pass anything in. So I posted to this group and was tipped to use a HTTP parm and then read it from the plugin when the
page
opens.  So, to clarify, here is what happens...

1.  The link is clicked with a HTTP parm in the URL:

[http:WIDRequestDetailsHeadLess?wid=40803]

2. The "WIDRequestDetailsHeadLess" is simply a page that invokes the plugin:

[{'WallyWIDDetailsPlugin'}]
(This is the entire page!)

3.  Here is the "trick"... At the beginning of the plugin is the
following
code:

                wid = c.getHttpParameter("wid");

                if(wid == null)
                {
                        value = params.get("wid");
if (value == null||((String)value).equals (""))
{

                                gotError = true;
                        }
                        else
                        {
                                wid = (String)value;
                        }
                }

This block of code makes it available to be used from a link and from
a
form. The getHttpParameter call uses the parm from the URL while the params.get looks for a "wid" parm from the form.

A little more clear?

-Lou


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the
content,
the information contained herein is privileged and confidential information/work product. The communication is intended for the use of
the
individual or entity named above. If the reader of this transmission
is
not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is
strictly
prohibited. If you have received this communication in error, please notify the sender immediately by telephone (732-758-6800) or by
electronic
mail ([EMAIL PROTECTED]), and destroy any copies, electronic,
paper
or otherwise, which you may have of this communication.  Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Benedikt Mohrmann <[EMAIL PROTECTED]> 09/23/2008 10:59 AM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Re: Call Plugin via Link






Hi,

first of all, thanks for the snip (it was the post I meant).
But to be honest, I do not get the trick behind this.
It would be very helpful, if you would send me a larger snip or some explainations (if possible).

Thanks a lot


[EMAIL PROTECTED] schrieb:


I posted the solution to this back in june, but here is a snip:


OK, I may have worked out how to do this.  I created another page
that

invokes the plugin without the form (basically when the page is

rendered).


I added some code to the beginning of the plugin (thanks to a FAQ
tip)
that
looks for a HTTP parm like so:

wid = c.getHttpParameter("wid");

When I am linking to the page and I need to pass the wid, I use a
link
like
so:

[http:WIDRequestDetailsHeadLess?wid=40803]

Or

<a href=WIDRequestDetailsHeadLess?wid=39701>39701</a>

And it works great.


Let me know if this is unclear.

-Lou


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOG-NET, Inc.
The Logistics Network Management System
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 Half Mile Road
Third Floor
Red Bank, NJ 07701
PH: 732-758-6800
FAX: 732-747-7497
http://www.LOG-NET.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CONFIDENTIAL & PRIVILEGED
Unless otherwise indicated or if obvious from the nature of the
content,

the information contained herein is privileged and confidential information/work product. The communication is intended for the use
of
the

individual or entity named above. If the reader of this transmission
is

not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is
strictly

prohibited. If you have received this communication in error, please


notify the sender immediately by telephone (732-758-6800) or by

electronic

mail ([EMAIL PROTECTED]), and destroy any copies, electronic,
paper

or otherwise, which you may have of this communication. Thank you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Benedikt Mohrmann <[EMAIL PROTECTED]> 09/23/2008 10:25 AM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Call Plugin via Link






Hi,

is it possible to call a self-written plugin via a link?
So when you click on the link, the plugin is started and returns its output.
I thought I already found an option on the homepage, but today I
wasn't
able to get it again.

Best regards
Benedikt











Reply via email to