Reputation: 3581
I have jelly.config with the following:
<f:block>
<f:optionalBlock inline="true" name="dynamic" title="Mandatory parameter for rpm artifacts only" checked="false"
help="/plugin/artifactory/help/common/help-artifactType.html">
<f:entry title="Operating System">
<select class="setting-input" name="operatingSystem">
<option value="rhel5">rhel5</option>
<option value="linux">linux</option>
</select>
</f:entry>
<f:entry title="Architecture">
<select class="setting-input" name="architecture">
<option value="64">64</option>
<option value="32">32</option>
</select>
</f:entry>
</f:optionalBlock>
</f:block>
In my serverDetails.js I have :
public class ServerDetails {
public final String operatingSystem;
/**
* This the type of operating system that your rpm builds on. If not specified, this passes null.
*/
public final String architecture;
/**
* This the type of architecture your rpm runs on. If not specified, this passes null.
*/
}
public ServerDetails(String artifactoryName, String artifactoryUrl, String repositoryKey, String snapshotsRepositoryKey,
String downloadReleaseRepositoryKey, String downloadSnapshotRepositoryKey,
String downloadReleaseRepositoryDisplayName, String downloadSnapshotRepositoryDisplayName,
String userPluginKey, String userPluginParams,String artifactKey,String productKey, String operatingSystem, String architecture, String buildType) {
this.operatingSystem = operatingSystem;
this.architecture = architecture;
this.buildType = buildType;
createStagingPlugin();
}
public ServerDetails(String artifactoryName, String artifactoryUrl, String repositoryKey, String snapshotsRepositoryKey,
String downloadReleaseRepositoryKey, String downloadSnapshotRepositoryKey,
String downloadReleaseRepositoryDisplayName, String downloadSnapshotRepositoryDisplayName) {
this(artifactoryName, artifactoryUrl, repositoryKey, snapshotsRepositoryKey, downloadReleaseRepositoryKey,
downloadSnapshotRepositoryKey, downloadReleaseRepositoryDisplayName, downloadSnapshotRepositoryDisplayName, null, null,null,null, null, null, null);
}
In my backend java I use this as :
public String getOperatingSystem() {
return details != null ? details.operatingSystem : null;
}
public String getArchitecture() {
return details != null ? details.architecture : null;
}
Now when I access operating system and architecture after selecting them in fronted I still get null values for both of them when I print it out.
Am I missing something here ? Why am I not getting the values.
Upvotes: 1
Views: 703
Reputation: 9075
In your created job, what does the XML have? You can get this from the URL localhost:8080/job//config.xml
I would guess that you need a doFillOperatingSystemItems
call like here
untested
public ListBoxModel doFillOperatingSystemItems(
@QueryParameter String operatingSystem
) {
return new ListBoxModel(
new Option("rhel", "rhel", operatingSystem.matches("rhel") ),
new Option("linux", "linux", operatingSystem.matches("linux") )
);
}
Upvotes: 1