// server selected.
public ListBoxModel doFillDepotItems(@QueryParameter String serverName, @QueryParameter String depot) {
final AccurevServer server = getServerAndPath(serverName);
if (server == null) {
return new ListBoxModel();
}
ListBoxModel d = null;
Option temp = null;
List<String> depots = new ArrayList<String>();
// Execute the login command first & upon success of that run show depots
// command. If any of the command's exitvalue is 1 proper error message is
// logged
try {
if (Login.accurevLoginfromGlobalConfig(server, accurevPath, descriptorlogger)) {
depots = ShowDepots.getDepots(server, accurevPath, descriptorlogger);
}
} catch (IOException e) {
} catch (InterruptedException e) {
}
d = new ListBoxModel();
for (String dname : depots) {
d.add(dname, dname);
}
// Below while loop is for to retain the selected item when you open the
// Job to reconfigure
Iterator<Option> depotsIter = d.iterator();
while (depotsIter.hasNext()) {
temp = depotsIter.next();
if (depot.equals(temp.name)) {
temp.selected = true;
}