2016-11-21 32 views
0

我想寫一個Jenkins SCM插件。Jenkins單片機獲取驗證參數

Screenshot of SCM plugin

我需要驗證的參數(測試1,的Test2)。

Test1依賴於DIR字段。

Test2依賴於DIR和Test1字段。

包含Test1的類別& Test2是可重複的屬性。 Config.jelly是繼`

<f:entry title="DIR" field="Dir"> 
    <f:textbox /> 
</f:entry> 

<f:entry title="Variable" field="var"> 
    <f:textbox /> 
</f:entry> 

<f:entry> 
    <f:repeatableProperty field="directories" noAddButton="true" minimum="1"/> 
</f:entry> 

`

和Config.jelly的目錄是繼

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"> 
    <f:entry title="Test1" field="test1"> 
     <f:textbox /> 
    </f:entry> 

    <f:entry title="Test2" field="test2"> 
     <f:textbox /> 
    </f:entry> 

    <f:entry> 
     <div align="right"> 
     <input type="button" value="${%Add more workareas}..." class="repeatable-add show-if-last"/> 
     <input type="button" value="${%Delete}" class="repeatable-delete show-if-not-only" style="margin-left: 1em;"/> 
    </div> 

我怎樣才能DIR字段的取值爲驗證測試​​1?我用 public FormValidation doCheckTest1(@QueryParameter String value, @QueryParameter String Dir)

但我得到Dir爲空。

+0

我能夠使用@RelativePath獲得DIR的值(’..」) – david

回答

0

我能夠使用@RelativePath獲得DIR的值(「..‘)