Re: ValidateButton to test all entries in a repeatable

2015-01-05 Thread twr


So turns out this isn't possible just using the the 'with' attribute of the 
f:validateButton 
https://jenkins-ci.org/maven-site/jenkins-core/jelly-taglib-ref.html#form:validateButton,
 
even when the repeated entry is bound to a field (either the repeatER or 
the repeatED component).

I was eventually able to implement this using the f:invisibleEntry 
https://jenkins-ci.org/maven-site/jenkins-core/jelly-taglib-ref.html#form:invisibleEntry
 and 
some javascript functions (called on the *onclick* of my repeated 
checkboxes) to update the contents of the invisible fields. One can then 
use the 'with' attribute of f:validateButton 
https://jenkins-ci.org/maven-site/jenkins-core/jelly-taglib-ref.html#form:validateButton
 to 
send the value of this hidden field.




On Wednesday, December 17, 2014 12:03:38 PM UTC, twr wrote:

 Hi, 


- I need to check validate a number of fields in one operation with a 
*validateButton*, 
- this has worked fine with multiple fields
- I've recently introduced a *repeatable *section, containing multiple 
checkboxes
- I'm easily able to address these by name in the save operation and 
get the true/false values
- when I try to pass the same to the validateButton with the '*with*' 
nothing changes in the formData that gets sent (despite referencing the 
 new 
repeatable stuff)
- I've tried adding a field declaration in the following places...
   - on the outer entry
   - on the repeatable itself
   - on the nested entry
   - on the checkbox itself


 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/436e3640-8d8a-429b-a80e-c3a6775bb82d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


InstantiationError when referencing the same library from multiple plugins

2014-09-04 Thread twr
Hi,

I had some neat logic to wrap various SVN plugins, and augment my builds 
with certain SCM info, call this PluginA (this has various SCM plugins as 
maven dependencies - e.g. *org.jenkins-ci.plugins:git:2.1.0*)

Recently I wanted to reuse that logic in another plugin (which gets 
deployed on the same master(s)), call this PluginB...

   1. I first tried to reference PluginA from PluginB (using Maven 
   dependencies), this kind of worked in the sense I could use my nice SCM 
   classes, however it also bundled the entire plugin and duplicated all its 
   functionality.
   2. So I moved the re-usable logic into its own library, let's call it 
   SharedLib (which has the various SCM plugins as maven dependencies - 
   e.g. *org.jenkins-ci.plugins:git:2.1.0*), this SharedLib is *packed as 
   jar*
   3. PluginA and PluginB list SharedLib as a dependency, and get deployed 
   to the same master (but not in all cases - so the solution isn't just to 
   make one giant plugin.)
   4. PluginA can still nicely augment my builds with the right 
   information, and PluginB can use the logic how it wants.
   5. Following restart I get hundreds of *InstantiationError*, *the 
   plugins both work fine when standalone*, only when they come together 
   and only after restart do they run into issues!!

04-Sep-2014 17:32:24 hudson.util.RobustReflectionConverter doUnmarshal
WARNING: Failed to resolve a type
*java.lang.InstantiationError: com.company.jenkins.scm.SCM*
at 
sun.reflect.GeneratedSerializationConstructorAccessor33.newInstance(Unknown 
Source)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at 
com.thoughtworks.xstream.converters.reflection.Sun14ReflectionProvider.newInstance(Sun14ReflectionProvider.java:76)
at 
hudson.util.RobustReflectionConverter.instantiateNewInstance(RobustReflectionConverter.java:376)
at 
hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:221)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at 
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at 
hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:333)
at 
hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:275)
at 
hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:222)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at 
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at 
com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at 
hudson.util.RobustCollectionConverter.populateCollection(RobustCollectionConverter.java:85)
at 
com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61)
at 
hudson.util.RobustCollectionConverter.unmarshal(RobustCollectionConverter.java:76)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at 
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at 
hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:333)
at 
hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:275)
at 
hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:222)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at 
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at 
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at 
com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1061)
at hudson.util.XStream2.unmarshal(XStream2.java:109)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045)
at hudson.XmlFile.unmarshal(XmlFile.java:166)
at hudson.model.Run.reload(Run.java:307)
at hudson.model.Run.init(Run.java:296)
at hudson.model.AbstractBuild.init(AbstractBuild.java:182)
at hudson.model.Build.init(Build.java:103)
at hudson.model.FreeStyleBuild.init(FreeStyleBuild.java:41)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 

Re: Summary Action on Project page

2014-05-16 Thread twr
I got it to produce only one by having getProjectAction return the same 
instance whenever it is called.

On Thursday, May 15, 2014 6:30:04 PM UTC+1, twr wrote:

 That works perfectly. Thanks.

 *However, *the only way I've managed to get it to actually add to the 
 page is by overriding getProjectAction on my Notifier (Publisher) and 
 returning a new instance of my action, but for some reason it *gets added 
 twice*? (currently stuck on version 1.509.2 of Jenkins - if that makes a 
 difference)

 On Thursday, May 15, 2014 6:16:40 PM UTC+1, ogondza wrote:

 On Thu, 15 May 2014 19:06:28 +0200, twr thomas.w...@gmail.com   
 wrote: 

  I make extensive use of summary actions on builds, but I would like to 
 do 
  something similar on the project page (for a summary of all builds)? 
  
  Where would I start with this? (best I've managed is links to alternate 
  page via ProminentProjectAction and associated index.jelly - but I 
 would 
  much prefer a summary that appears in the project page itself). 
  
  Thanks 

 Project actions optionally includes jobMain.jelly[1]. Quite similar to   
 build's summary.jelly. 

 [1]   

 https://github.com/jenkinsci/jenkins/blob/0f7b144fd32544a872075d58300a53b9abcca5f4/core/src/main/resources/hudson/model/AbstractProject/main.jelly#L77-80
  

 HTH 
 -- 
 oliver 



-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: ValidateButton without descriptor

2014-05-16 Thread twr
I'm trying to do a similar thing but with a hudson.model.ManagementLink. 

Problem is that I can't extend ManagementLink AND AbstractDescribableImpl
(as in the example of ProxyConfiguration). 

If I implement DescribableMyManagementLink and create the inline
DescriptorMyManagementLink, I can't do the normal getDescriptor()
override, which should be... 

@Override 
public DescriptorMyManagementLink getDescriptor() { 
return (MyManagementLinkDescriptor) super.getDescriptor(); 
} 

...since ManagementLink doesnt have a getDescriptor() since it isn't itself
describable. 

Note also, the contents of the index.jelly for MyManagementLink is a series
of components within a f:form tag.



--
View this message in context: 
http://jenkins-ci.361315.n4.nabble.com/ValidateButton-without-descriptor-tp4409633p4701169.html
Sent from the Jenkins dev mailing list archive at Nabble.com.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Summary Action on Project page

2014-05-15 Thread twr
I make extensive use of summary actions on builds, but I would like to do 
something similar on the project page (for a summary of all builds)?

Where would I start with this? (best I've managed is links to alternate 
page via ProminentProjectAction and associated index.jelly - but I would 
much prefer a summary that appears in the project page itself).

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.
For more options, visit https://groups.google.com/d/optout.


Re: Summary Action on Project page

2014-05-15 Thread twr
That works perfectly. Thanks.

*However, *the only way I've managed to get it to actually add to the page 
is by overriding getProjectAction on my Notifier (Publisher) and returning 
a new instance of my action, but for some reason it *gets added twice*? 
(currently stuck on version 1.509.2 of Jenkins - if that makes a difference)

On Thursday, May 15, 2014 6:16:40 PM UTC+1, ogondza wrote:

 On Thu, 15 May 2014 19:06:28 +0200, twr thomas.w...@gmail.comjavascript: 
   
 wrote: 

  I make extensive use of summary actions on builds, but I would like to 
 do 
  something similar on the project page (for a summary of all builds)? 
  
  Where would I start with this? (best I've managed is links to alternate 
  page via ProminentProjectAction and associated index.jelly - but I would 
  much prefer a summary that appears in the project page itself). 
  
  Thanks 

 Project actions optionally includes jobMain.jelly[1]. Quite similar to   
 build's summary.jelly. 

 [1]   

 https://github.com/jenkinsci/jenkins/blob/0f7b144fd32544a872075d58300a53b9abcca5f4/core/src/main/resources/hudson/model/AbstractProject/main.jelly#L77-80
  

 HTH 
 -- 
 oliver 


-- 
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.
For more options, visit https://groups.google.com/d/optout.