Hi,
I'm having some troubles trying to integrate the hipchat-plugin with the credentials-plugin, and I'm quite confused about how to use the credentials API properly.
Any help with any of these questions would be much appreciated:
1) The JavaDoc on AbstractIdCredentialsListBoxModel contains a few non-compiling examples, but other than that it appears to suggest that it is best practice to display the current value. What is problematic though is that the only way I can obtain the current value of the credentialId is that I add it to my doFill method as a @QueryParameter. However this results in a bug: if you have a non-default value selected when you load the page, the first time you try to change it to -none- it will display the original selection again. From what I can tell this was related to some fillDependsOn related AJAX calls which meant that doFill was called twice, once with credentialId "" and once with "originalValue".
// I think this bug also means that if you have the QueryParameter defined, right after successfully selecting the new value, it will display -current- instead of the freshly selected value.
Now this clearly sounds like a bug, but I don't know what other thing I can do about it than just remove the credentialId parameter from my doFill method. But then that leads to my second problem..
2) If you have the credential as a jelly field both at job level and at global level, then for some reason the doFill method in the static Descriptor impl will be called for both cases. Whilst that works nicely in the global config case (since I can access DescriptorImpl fields just fine), I can't access the configured value at the job level no matter what I do. Adding the credentialId as a QueryParameter would resolve this problem, but then I'm back to the strange update bug at 1).
Is there a possibility to define the doFill method at the Publisher level for my job level credential setting?
3) Although the doFill methods give you great control over what credentials to display, I didn't really find anything about how to control the Add button in terms of how to only allow the addition of a particular credential type only (e.g if I only want to use Secret text type of credential, Add shouldn't suggest creating an SSH key credential). Is this even possible?
Thanks in advance,
Peter