Re: plugin development: add global environment settings

2018-03-10 Thread Stephen Connolly
On Sat 10 Mar 2018 at 15:04, Daniel Beck  wrote:

>
> > On 9. Mar 2018, at 09:43, Johann  wrote:
> >
> > guys nobody can help me? Should I show some more of my code


Global.jelly is to configure the descriptor rather than the instance

To use global.jelly you need to expose the getters and setters on your
descriptor. Then you need to override the configure method on your
descriptor to parse the submitted json (typically you can just say
something like req.bind(this,json) if you keep your descriptor “simple” and
then call save()... you’ll need to override the descriptor’s constructor to
call load() too)

The more modern alternative is to use the GlobalConfiguration stuff... that
will have you using a regular config.jelly but iirc you still need some
sort of configure(req,json) method to pull the top level in


>
> I think this would be useful.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/720A9221-83C1-4D26-8481-DD55FBC1A0FA%40beckweb.net
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Sent from my phone

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CA%2BnPnMz1MXsvn8ap7wm54A%3D%2BVx6pxQFzeZk3UWh%2BZxB1QG5EeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-10 Thread Daniel Beck

> On 9. Mar 2018, at 09:43, Johann  wrote:
> 
> guys nobody can help me? Should I show some more of my code?

I think this would be useful.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/720A9221-83C1-4D26-8481-DD55FBC1A0FA%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-10 Thread martinda
Johann,

I cannot help much, but 2 years ago I wrote some code in an attempt to 
understand how to create global configuration entries. I don't remember 
much about it.
You can find this code here 
https://github.com/martinda/jenkins-plugin-globalconfig-demo1

Hope this helps,
Martin

On Friday, March 9, 2018 at 3:43:11 AM UTC-5, Johann wrote:
>
> guys nobody can help me? Should I show some more of my code?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/98d4f160-7208-4e9d-967d-5aafb6b1ef66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-09 Thread Johann
guys nobody can help me? Should I show some more of my code?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/c27aeb1d-dd70-4df1-bdfb-9a5ca6cc96a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-07 Thread Johann
I deleted it, but still the path value is null. Also if I go to *Manage 
Jenkins -> Configure *and change the value of the textbox and click on 
*Save*, its not saving the new value, after refreshing the page the old 
value is there again.

Am Mittwoch, 7. März 2018 14:16:07 UTC+1 schrieb Daniel Beck:
>
>
> Why do you have two nested f:entries? Try with just the inner one. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/50504a6d-04d2-4fb6-aada-4bae601c6afa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-07 Thread Daniel Beck

> On 7. Mar 2018, at 14:01, Johann  wrote:
> 
> 
> 
> 
> 
> 

Why do you have two nested f:entries? Try with just the inner one.


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/BB680624-72B7-4DC7-8B3A-E5DE4984594B%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-07 Thread Johann
My Code:

private String path;

public MyClass(String path) {
this.path = path;
}

public String getPath() {
return this.path;
}

and in my global.jelly file:










Not working
Am Mittwoch, 7. März 2018 13:27:45 UTC+1 schrieb Daniel Beck:
>
>
> Make sure you have a public getter for the field. 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/cc7d1da3-f8d5-4e61-b53f-a19036106f25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-07 Thread Daniel Beck

> On 7. Mar 2018, at 12:49, Johann  wrote:
> 
> by specify the field="myVar" I was able to parse the value of the textbox and 
> use it in my code. But when I try to get the value of the field entry in my 
> global.jelly, its always null.

Make sure you have a public getter for the field.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/9F017384-DEC3-4C6D-AB59-37C4F70A8C2F%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-07 Thread Johann
You are right, I am sorry. But I already fixed my problem with the extra 
tab which I did ask for by creating a *global.jelly *file. But I have 
another problem, until now I just had  a config.jelly file which gave me an 
extra entry in the Build Environment area, and by specify the *field="myVar" 
*I was able to parse the value of the textbox and use it in my code. But 
when I try to get the value of the *field* entry in my global.jelly, its 
always null. 

Sry I am new to plugin development and just trying to understand how 
everything works together

Am Mittwoch, 7. März 2018 11:43:29 UTC+1 schrieb Daniel Beck:
>
>
> > On 7. Mar 2018, at 10:03, Johann > 
> wrote: 
> > 
> > hopefully someone can help me. I am developing a plugin right now, for 
> test purposes and I am wondering how I can make an extra tab for my plugin 
> in Manage Jenkins -> Configure that I am able to make global variables 
> working for every job? 
>
> Hi Johann, 
>
> Could you clarify what you're asking for? This seems to be two separate 
> questions. 
>
> Daniel 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/7888308d-e3c1-4fde-a317-1549d4488b9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: plugin development: add global environment settings

2018-03-07 Thread Daniel Beck

> On 7. Mar 2018, at 10:03, Johann  wrote:
> 
> hopefully someone can help me. I am developing a plugin right now, for test 
> purposes and I am wondering how I can make an extra tab for my plugin in 
> Manage Jenkins -> Configure that I am able to make global variables working 
> for every job? 

Hi Johann,

Could you clarify what you're asking for? This seems to be two separate 
questions.

Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/BEDA4612-07C4-435A-BA58-A7664CECD114%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.