checkUrl action from plugin global.jelly?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

checkUrl action from plugin global.jelly?

todd lee

Hi there,

I'm new to plugin dev for hudson, and I'm trying to get check a url (valid
directory) in on a text entry on the configure screen.
I've got the load/save working with the descriptor (my class extends
Builder) but the validation just won't work!? Any ideas??

snip from my global.jelly file located at:
src\main\resources\com\amis\IvyPlugin

<snip>
      <input class="setting-input validated" name="repository"
              type="text" value="${descriptor.path}"

checkUrl="'${rootURL}/plugin/IvyPlugin/checkPath?value='+this.value"/>

</snip>

Then the corresponding method in my Class Descriptor  (class is
com.amis.IvyPlugin)

<snip>
        public void doCheckPath( StaplerRequest req, StaplerResponse rsp )
throws IOException, ServletException {
            // this can be used to check the existence of a file on the
server, so needs to be protected
            new FormFieldValidator(req,rsp,true) {
                public void check() throws IOException, ServletException {
                    File f = getFileParameter("value");
                    if(!f.isDirectory()) {
                        error(f+" is not a directory");
                        return;
                    }
                    ok();
                }
            }.process();
        }
</snip>

I'm basically copying what Ant/Maven installations do, only for a simple
directory. Only thing that seems different is the path on checkUrl -
they're rooted at 'builder/'. Can I do this from 'plugin'?

Any insight is greatly appreciated!

Todd Lee
Software Tools
AMI Semiconductor
Tel:  +1.519.884.9696 ext 2242
Fax: +1.519.884.0228
E-mail: [hidden email]

AMI Semiconductor - "Silicon Solutions for the Real World"
NOTICE:
This electronic message contains information that may be confidential or privileged. The information is intended for the use of the individual or entity named above. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you received this electronic message in error, please notify the sender and delete the copy you received.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: checkUrl action from plugin global.jelly?

Kohsuke Kawaguchi-2
[hidden email] wrote:

> Hi there,
>
> I'm new to plugin dev for hudson, and I'm trying to get check a url (valid
> directory) in on a text entry on the configure screen.
> I've got the load/save working with the descriptor (my class extends
> Builder) but the validation just won't work!? Any ideas??
>
> snip from my global.jelly file located at:
> src\main\resources\com\amis\IvyPlugin
>
> <snip>
>       <input class="setting-input validated" name="repository"
>               type="text" value="${descriptor.path}"
>
> checkUrl="'${rootURL}/plugin/IvyPlugin/checkPath?value='+this.value"/>

I suspect that 'IvyPlugin' portion of the URL is wrong. If your plugin
is "foobar.hpi", then it should be "foobar".


And I see that you are developing an Ivy plugin! Any chance you can
bring that to hudson.dev.java.net?


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: checkUrl action from plugin global.jelly?

Eric Crahen-3
Hey Todd,

  I'm also interested in the Ivy plugin. I've been making something similar myself. What does your do? The things I had planned for mine were Ivy enabling ant ant build, and running a Ivy publish step after a build succeeds.

On 2/9/07, Kohsuke Kawaguchi <[hidden email]> wrote:
[hidden email] wrote:

> Hi there,
>
> I'm new to plugin dev for hudson, and I'm trying to get check a url (valid
> directory) in on a text entry on the configure screen.
> I've got the load/save working with the descriptor (my class extends
> Builder) but the validation just won't work!? Any ideas??
>
> snip from my global.jelly file located at:
> src\main\resources\com\amis\IvyPlugin
>
> <snip>
>       <input class="setting-input validated" name="repository"
>               type="text" value="${descriptor.path}"
>
> checkUrl="'${rootURL}/plugin/IvyPlugin/checkPath?value='+this.value"/>


I suspect that 'IvyPlugin' portion of the URL is wrong. If your plugin
is "foobar.hpi", then it should be "foobar".


And I see that you are developing an Ivy plugin! Any chance you can
bring that to hudson.dev.java.net?


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]




--

- Eric
Reply | Threaded
Open this post in threaded view
|

Re: checkUrl action from plugin global.jelly?

Eric Crahen-3
Another thing I thought would make an interesting report would be to render a graph of the transitive dependencies for a package, but that's just so there is something pretty to look at, its not all that practical.

On 2/10/07, Eric Crahen <[hidden email]> wrote:
Hey Todd,

  I'm also interested in the Ivy plugin. I've been making something similar myself. What does your do? The things I had planned for mine were Ivy enabling ant ant build, and running a Ivy publish step after a build succeeds.


On 2/9/07, Kohsuke Kawaguchi <[hidden email]> wrote:
[hidden email] wrote:

> Hi there,
>
> I'm new to plugin dev for hudson, and I'm trying to get check a url (valid
> directory) in on a text entry on the configure screen.
> I've got the load/save working with the descriptor (my class extends
> Builder) but the validation just won't work!? Any ideas??
>
> snip from my global.jelly file located at:
> src\main\resources\com\amis\IvyPlugin
>
> <snip>
>       <input class="setting-input validated" name="repository"
>               type="text" value="${descriptor.path}"
>
> checkUrl="'${rootURL}/plugin/IvyPlugin/checkPath?value='+this.value"/>


I suspect that 'IvyPlugin' portion of the URL is wrong. If your plugin
is "foobar.hpi", then it should be "foobar".


And I see that you are developing an Ivy plugin! Any chance you can
bring that to <a href="http://hudson.dev.java.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">hudson.dev.java.net?


--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]




--

- Eric



--

- Eric