Does Jenkins has session control for web Actions?

2016-10-06 Thread Cheng Bao
Hi, I need develop web application run on Jenkins as plugin.
So, does Jenkins has some build-in session controls like what 
asp.net/jsp/php have?

-- 
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/e43e5169-8dd8-4a28-b22a-71fe9309ab88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Does jenkins has global error handler?

2016-09-22 Thread Cheng Bao
Hi, 

What should I do if I want to display a customized error page to users if 
un-handled exception thrown during web request action?
What should I do if I want to file bug, send exception report to admin when 
unhandled exception occurred, during web request action or on background 
process?

Thanks, 
Cheng Bao

-- 
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/fe8c6297-3c6a-4b8e-8fb0-3e06215764fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to properly handle request //foo/bar?

2016-09-21 Thread Cheng Bao
Hi, Thanks,

Is there a way to make getFoo() method use POST method? Even in form I 
specifiy 
Stapler.currentRequest().getMethod() will still return "GET".
and @RequirePOST annotation will always fail

On Friday, September 9, 2016 at 4:13:05 PM UTC-7, Daniel Beck wrote:
>
>
> > On 09.09.2016, at 15:59, Cheng Bao <cb...@vmware.com > 
> wrote: 
> > 
> > However, what to do next? without StaplerRequest and StaplerResponse 
> parameters, after processing, how can display certain jelly file? how can I 
> make redirection to another url? 
> > How can I get query parameters as /foo/bar?query=xx? 
> > How can I get more part of url as /foo/bar1/bar2? 
>
> The object you return can have a doIndex method, or an index.jelly view. 
> Or, in the /foo/bar1/bar2 example, a bar2.jelly view. 
>
> I actually gave a presentation on this just a few days ago, and the 
> recording is at https://www.youtube.com/watch?v=iAJBKFe8mMo 
>
> You can access the current request object without changing your method 
> signature using the static Stapler.currentRequest() method. 
>
> Likewise with the response -- you should also be able to return and/or 
> throw a HttpResponse (there are predefined ones in HttpResponses) to 
> redirect. 
>
> 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/960c06e9-a539-4604-ba29-4d3e8b270940%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins plugin load completed event.

2016-09-16 Thread Cheng Bao
Update:
subclassing Plugin class is deprecated, this is the one:

http://javadoc.jenkins-ci.org/hudson/init/Initializer.html 
or 
http://javadoc.jenkins-ci.org/hudson/model/listeners/ItemListener.html#onLoaded--

On Friday, September 16, 2016 at 10:20:33 AM UTC-7, Cheng Bao wrote:
>
> Did some research, it is correct extension point:
> http://javadoc.jenkins-ci.org/hudson/Plugin.html#postInitialize--
>
> On Friday, September 16, 2016 at 9:37:25 AM UTC-7, Cheng Bao wrote:
>>
>> Hi, I have some plugin initial code need to be run each time my plugin is 
>> loaded and ready.
>>
>> What kind of listener class I need to extend to get this job done?
>>
>> Thanks
>>
>

-- 
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/ee42a60f-8b1d-406f-af44-c53cbd6ba180%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins plugin load completed event.

2016-09-16 Thread Cheng Bao
Did some research, it is correct extension point:
http://javadoc.jenkins-ci.org/hudson/Plugin.html#postInitialize--

On Friday, September 16, 2016 at 9:37:25 AM UTC-7, Cheng Bao wrote:
>
> Hi, I have some plugin initial code need to be run each time my plugin is 
> loaded and ready.
>
> What kind of listener class I need to extend to get this job done?
>
> Thanks
>

-- 
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/05a96e75-293a-4966-a67a-c1688c45e6b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins plugin load completed event.

2016-09-16 Thread Cheng Bao
Hi, I have some plugin initial code need to be run each time my plugin is 
loaded and ready.

What kind of listener class I need to extend to get this job done?

Thanks

-- 
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/472bfac8-9d9d-4fa4-9a38-513c0530cac6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I reference full qualified class name in Jenkins Jelly file?

2016-09-09 Thread Cheng Bao
Hi, thanks, 
writing helper methods is my current workaround. I am looking into groovy.

On Thursday, September 8, 2016 at 8:05:24 PM UTC-7, Jesse Glick wrote:
>
> On Thu, Sep 8, 2016 at 4:36 PM, Cheng Bao <cb...@vmware.com > 
> wrote: 
> > How I can use class object from jelly? 
>
> Not easily if at all. 
>
> Either switch to a Groovy view; or (my general preference) extract any 
> logic that is not absolutely trivial into helper methods in Java code 
> which can be called as instance methods with simply-typed parameters 
> from something the Jelly view already has available (`it`, 
> `descriptor`, etc.). 
>

-- 
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/ddb610f1-3fb8-4ca0-bdca-9bb5342e80b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can I reference full qualified class name in Jenkins Jelly file?

2016-09-08 Thread Cheng Bao


down votefavorite 


In Jenkins jelly file, I have need to use java class object from class name.



MyProperty is my custom JobProperty class, which is applied to job However, 
the above line will not work properly, even I tried



or



myClass object will always been null.

How I can use class object from jelly?

-- 
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/29a9c751-ed6f-4125-b2d7-3963ed85ab22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to makes custom form that bind to my JobProperty class automatically?

2016-08-19 Thread Cheng Bao
Hi,

I created a MyJobPropery class which extends JobProperty.
I know I can use config.jelly to make my fields of MyJobProperty shown 
under /job//configure page.
However, I want create a dedicate form for users to input fields of 
MyJobProperty besides default  /job//configure,
i.e from an action that bind to url: /MyPlugin/configMyJobProperty/.
say I have a method
public class MyPlugin implementsRootAction {
public final void doConfigMyJobProperty(StaplerRequest req, 
StaplerResponse rsp) {
//... theory code
MyJobProperty myProp = AbstractProject.findNearest(jobName);
req.bindObject(myProp).getView(this, "../MyJobProperty/config.jelly"
).forward(req, rsp);
//...

}
}


I wonder what code I need that can make config.jelly bind to a 
MyJobProperty instance?

I know I can manually populate all values from MyProperty to config.jelly 
controls, and doing manual reverse population from form data to 
MyJobProperty.
I wonder if Jenksin provide a way that I can take advantage of Jenkins 
internal databind.

Thanks.

-- 
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/818dae5e-f9f5-4a02-9652-48893ae12ab3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.