Skip to content

Commit

Permalink
Fix dropdown descriptor
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed May 19, 2019
1 parent 93af67c commit 063e53f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ public FormValidation doCheckPort(@QueryParameter("value") String value) {
* @param value the database name to check.
* @return {@link hudson.util.FormValidation#ok()} if everything is well.
*/
public FormValidation doCheckDBName(@QueryParameter("value") String value) {
public FormValidation doCheckDbName(@QueryParameter("value") String value) {
if (value == null || value.isEmpty()) {
return FormValidation.error("Please provide a database name!");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,11 @@
description="${%If no problems are identified, this text will be shown on the build page}">
<f:textbox field="noCausesMessage" />
</f:entry>
<f:dropdownList name="knowledgeBase" title="${%Storage type}" help="${descriptor.getHelpFile('knowledgeBase')}">
<j:set var="current" value="${descriptor.getKnowledgeBase()}"/>
<j:set var="defaultDescriptor" value="com.sonyericsson.jenkins.plugins.bfa.db.LocalFileKnowledgeBase.LocalFileKnowledgeBaseDescriptor"/>
<j:forEach var="descriptor" items="${descriptor.getKnowledgeBaseDescriptors()}" varStatus="loop">
<f:dropdownListBlock value="${loop.index}" title="${descriptor.displayName}"
selected="${current.descriptor==descriptor || (current==null and descriptor==defaultDescriptor)}"
staplerClass="${descriptor.clazz.name}"
lazy="descriptor">
<l:ajax>
<j:set var="instance" value="${current.descriptor==descriptor ? current : null}"/>
<st:include from="${descriptor}" page="${descriptor.configPage}" />
</l:ajax>
</f:dropdownListBlock>
</j:forEach>
</f:dropdownList>
<f:dropdownDescriptorSelector
field="knowledgeBase" title="${%Storage type}"
descriptors="${descriptor.getKnowledgeBaseDescriptors()}"
default="com.sonyericsson.jenkins.plugins.bfa.db.LocalFileKnowledgeBase.LocalFileKnowledgeBaseDescriptor"
/>
<f:entry title="${%Convert knowledge base}" description="${%Add the data from the old knowledge base to the new if changed}">
<!-- Should the user make this decision each time? -->
<f:checkbox name="convertOldKb" checked="true"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,25 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:entry title="${%Host}">
<f:textbox name="host" value="${instance.host}"
checkUrl="'${rootURL}/plugin/build-failure-analyzer/knowledgeBaseDescriptor/MongoDBKnowledgeBaseDescriptor/checkHost?value='+escape(this.value)"/>
<f:textbox field="host" />
</f:entry>
<f:entry title="${%Port}">
<f:textbox name="port" value="${instance.port}" default="${descriptor.defaultPort}"
checkUrl="'${rootURL}/plugin/build-failure-analyzer/knowledgeBaseDescriptor/MongoDBKnowledgeBaseDescriptor/checkPort?value='+escape(this.value)"/>
<f:textbox field="port" default="${descriptor.defaultPort}" />
</f:entry>
<f:entry title="${%Database name}">
<f:textbox name="dbName" value="${instance.dbName}"
checkUrl="'${rootURL}/plugin/build-failure-analyzer/knowledgeBaseDescriptor/MongoDBKnowledgeBaseDescriptor/checkDBName?value='+escape(this.value)"/>
<f:textbox field="dbName" />
</f:entry>
<f:entry title="${%Username}" description="${%MongoDBKnowledgeBase_UserNameDesc}">
<f:textbox name="userName" value="${instance.userName}"/>
<f:textbox field="userName" />
</f:entry>
<f:entry title="${%Password}" description="${%MongoDBKnowledgeBase_PasswordDesc}">
<f:password name="password" value="${instance.password}"/>
<f:password field="password" />
</f:entry>
<f:entry title="${%Enable statistics logging}">
<f:checkbox name="enableStatistics" default="true" checked="${instance.isStatisticsEnabled()}"/>
<f:checkbox field="enableStatistics" default="true" />
</f:entry>
<f:entry title="${%Enable statistics logging of successful builds}">
<f:checkbox name="successfulLogging" default="false" checked="${instance.isSuccessfulLoggingEnabled()}"/>
<f:checkbox field="successfulLogging" default="false" />
</f:entry>
<f:validateButton title="Test Connection" progress="Testing..." method="testConnection" with="host,port,dbName,userName,password"/>
</j:jelly>

0 comments on commit 063e53f

Please sign in to comment.