Quantcast

Jelly to Groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Jelly to Groovy

Paul Allen
Hi Guys, 

I was looking to update some of my jelly code to groovy and not sure how to do the following:

<st:include page="id-and-description" class="${descriptor.clazz}"/>

This imports the ID and Description for credentials, see original jelly.


and set a checked boolean ('isSsl()'):

<f:optionalBlock name="ssl" title="${%SSL connection}" checked="${instance.isSsl()}">
<f:entry title="${%Trust}" field="trust">
<f:textbox/>
</f:entry>
</f:optionalBlock>


f.optionalBlock(name:_("ssl"), title:_("SSL connection")) {
f.entry(title:_("Trust"), field:"trust") {
f.textbox()
}
}

Kind regards,
Paul

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d946d214-f593-450f-8b86-c782da430858%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jelly to Groovy

Robert Sandell-2
//Untested but should be like this:
def st = namespace("jelly:stapler")
st.include(page: "id-and-description", class: descriptor.clazz)

f.optionalBlock(name:_("ssl"), title:_("SSL connection"), checked: instance.isSsl()) {
f.entry(title:_("Trust"), field:"trust") {
f.textbox()
}
}


On Fri, Apr 21, 2017 at 3:49 PM, pallen <[hidden email]> wrote:
Hi Guys, 

I was looking to update some of my jelly code to groovy and not sure how to do the following:

<st:include page="id-and-description" class="${descriptor.clazz}"/>

This imports the ID and Description for credentials, see original jelly.


and set a checked boolean ('isSsl()'):

<f:optionalBlock name="ssl" title="${%SSL connection}" checked="${instance.isSsl()}">
<f:entry title="${%Trust}" field="trust">
<f:textbox/>
</f:entry>
</f:optionalBlock>


f.optionalBlock(name:_("ssl"), title:_("SSL connection")) {
f.entry(title:_("Trust"), field:"trust") {
f.textbox()
}
}

Kind regards,
Paul

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d946d214-f593-450f-8b86-c782da430858%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS3pjCoKNfLF2Nf-jrchDeSvBACCb1uM%3D6whu6ATE5387w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jelly to Groovy

Paul Allen
Hi Robert,

Thanks for the include details for the credentials, that worked.

Unfortunately the checked instance.isSsl() failed with:

   Caused by: java.lang.NullPointerException: Cannot invoke method isSsl() on null object

Kind regards,
Paul


> On 21 Apr 2017, at 15:19, Robert Sandell <[hidden email]> wrote:
>
> //Untested but should be like this:
> def st = namespace("jelly:stapler")
> st.include(page: "id-and-description", class: descriptor.clazz)
>
>
> f.optionalBlock(name:_("ssl"), title:_("SSL connection"), checked: instance.isSsl()) {
>    f.entry(title:_("Trust"), field:"trust") {
>       f.textbox()
>    }
> }
>
>
> On Fri, Apr 21, 2017 at 3:49 PM, pallen <[hidden email]> wrote:
> Hi Guys,
>
> I was looking to update some of my jelly code to groovy and not sure how to do the following:
>
> <st:include page="id-and-description" class="${descriptor.clazz}"/>
>
> This imports the ID and Description for credentials, see original jelly.
>
>
> and set a checked boolean ('isSsl()'):
>
> <f:optionalBlock name="ssl" title="${%SSL connection}" checked="${instance.isSsl()}">
>    <f:entry title="${%Trust}" field="trust">
>       <f:textbox/>
>    </f:entry>
> </f:optionalBlock>
>
>
> f.optionalBlock(name:_("ssl"), title:_("SSL connection")) {
>    f.entry(title:_("Trust"), field:"trust") {
>       f.textbox()
>    }
> }
>
> Kind regards,
> Paul
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d946d214-f593-450f-8b86-c782da430858%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Robert Sandell
> Software Engineer
> CloudBees Inc.
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS3pjCoKNfLF2Nf-jrchDeSvBACCb1uM%3D6whu6ATE5387w%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

--------------------------------------------------------------------------------
Perforce Software UK Ltd is registered in England and Wales as company no.
3816019 at the following address: West Forest Gate,
Wellington Road, Wokingham,
RG40 2AT, UK
--------------------------------------------------------------------------------

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E3D58517-BD06-40C5-B69E-58ECB7B553C3%40perforce.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jelly to Groovy

Robert Sandell-2
Yes, instance is not always available, so the simplest thing to do would be: instance?.isSsl()

/B

On Fri, Apr 21, 2017 at 5:25 PM, Paul Allen <[hidden email]> wrote:
Hi Robert,

Thanks for the include details for the credentials, that worked.

Unfortunately the checked instance.isSsl() failed with:

   Caused by: java.lang.NullPointerException: Cannot invoke method isSsl() on null object

Kind regards,
Paul


> On 21 Apr 2017, at 15:19, Robert Sandell <[hidden email]> wrote:
>
> //Untested but should be like this:
> def st = namespace("jelly:stapler")
> st.include(page: "id-and-description", class: descriptor.clazz)
>
>
> f.optionalBlock(name:_("ssl"), title:_("SSL connection"), checked: instance.isSsl()) {
>    f.entry(title:_("Trust"), field:"trust") {
>       f.textbox()
>    }
> }
>
>
> On Fri, Apr 21, 2017 at 3:49 PM, pallen <[hidden email]> wrote:
> Hi Guys,
>
> I was looking to update some of my jelly code to groovy and not sure how to do the following:
>
> <st:include page="id-and-description" class="${descriptor.clazz}"/>
>
> This imports the ID and Description for credentials, see original jelly.
>
>
> and set a checked boolean ('isSsl()'):
>
> <f:optionalBlock name="ssl" title="${%SSL connection}" checked="${instance.isSsl()}">
>    <f:entry title="${%Trust}" field="trust">
>       <f:textbox/>
>    </f:entry>
> </f:optionalBlock>
>
>
> f.optionalBlock(name:_("ssl"), title:_("SSL connection")) {
>    f.entry(title:_("Trust"), field:"trust") {
>       f.textbox()
>    }
> }
>
> Kind regards,
> Paul
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d946d214-f593-450f-8b86-c782da430858%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Robert Sandell
> Software Engineer
> CloudBees Inc.
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS3pjCoKNfLF2Nf-jrchDeSvBACCb1uM%3D6whu6ATE5387w%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

--------------------------------------------------------------------------------
Perforce Software UK Ltd is registered in England and Wales as company no.
3816019 at the following address: West Forest Gate,
Wellington Road, Wokingham,
RG40 2AT, UK
--------------------------------------------------------------------------------

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E3D58517-BD06-40C5-B69E-58ECB7B553C3%40perforce.com.
For more options, visit https://groups.google.com/d/optout.



--
Robert Sandell
Software Engineer
CloudBees Inc.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS2zcwum0LZonSnT%2BP_vKnwCYsH8PCgds%2B2N4QMafujBmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jelly to Groovy

Paul Allen
Perfect; that fixed it.

Thank you,
Paul

> On 21 Apr 2017, at 16:53, Robert Sandell <[hidden email]> wrote:
>
> Yes, instance is not always available, so the simplest thing to do would be: instance?.isSsl()
>
> /B
>
> On Fri, Apr 21, 2017 at 5:25 PM, Paul Allen <[hidden email]> wrote:
> Hi Robert,
>
> Thanks for the include details for the credentials, that worked.
>
> Unfortunately the checked instance.isSsl() failed with:
>
>    Caused by: java.lang.NullPointerException: Cannot invoke method isSsl() on null object
>
> Kind regards,
> Paul
>
>
> > On 21 Apr 2017, at 15:19, Robert Sandell <[hidden email]> wrote:
> >
> > //Untested but should be like this:
> > def st = namespace("jelly:stapler")
> > st.include(page: "id-and-description", class: descriptor.clazz)
> >
> >
> > f.optionalBlock(name:_("ssl"), title:_("SSL connection"), checked: instance.isSsl()) {
> >    f.entry(title:_("Trust"), field:"trust") {
> >       f.textbox()
> >    }
> > }
> >
> >
> > On Fri, Apr 21, 2017 at 3:49 PM, pallen <[hidden email]> wrote:
> > Hi Guys,
> >
> > I was looking to update some of my jelly code to groovy and not sure how to do the following:
> >
> > <st:include page="id-and-description" class="${descriptor.clazz}"/>
> >
> > This imports the ID and Description for credentials, see original jelly.
> >
> >
> > and set a checked boolean ('isSsl()'):
> >
> > <f:optionalBlock name="ssl" title="${%SSL connection}" checked="${instance.isSsl()}">
> >    <f:entry title="${%Trust}" field="trust">
> >       <f:textbox/>
> >    </f:entry>
> > </f:optionalBlock>
> >
> >
> > f.optionalBlock(name:_("ssl"), title:_("SSL connection")) {
> >    f.entry(title:_("Trust"), field:"trust") {
> >       f.textbox()
> >    }
> > }
> >
> > Kind regards,
> > Paul
> >
> > --
> > 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 [hidden email].
> > To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/d946d214-f593-450f-8b86-c782da430858%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> > Robert Sandell
> > Software Engineer
> > CloudBees Inc.
> >
> > --
> > 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 [hidden email].
> > To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS3pjCoKNfLF2Nf-jrchDeSvBACCb1uM%3D6whu6ATE5387w%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --------------------------------------------------------------------------------
> Perforce Software UK Ltd is registered in England and Wales as company no.
> 3816019 at the following address: West Forest Gate,
> Wellington Road, Wokingham,
> RG40 2AT, UK
> --------------------------------------------------------------------------------
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/E3D58517-BD06-40C5-B69E-58ECB7B553C3%40perforce.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Robert Sandell
> Software Engineer
> CloudBees Inc.
>
> --
> 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 [hidden email].
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CALzHZS2zcwum0LZonSnT%2BP_vKnwCYsH8PCgds%2B2N4QMafujBmw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

--------------------------------------------------------------------------------
Perforce Software UK Ltd is registered in England and Wales as company no.
3816019 at the following address: West Forest Gate,
Wellington Road, Wokingham,
RG40 2AT, UK
--------------------------------------------------------------------------------

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/D3180067-C067-4BDD-AFED-A18F1BDF5E78%40perforce.com.
For more options, visit https://groups.google.com/d/optout.
Loading...