Not sure if this is what you are looking for as I am not a Java developer but we had someone write a program to place objects into the transport case.
private void doTransport() {
if (deploymentList != null && !deploymentList.isEmpty()) {
try {
if (con == null) {
createConnection(client.getText(), user.getText(), pass.getText(), dept.getText());
}
} catch (IOException e) {
return;
}
try {
con.sendRequestAndWait(new ClearTransportCase());
con.sendRequestAndWait(new TransportObject(deploymentList.iterator()));
print("Transport complete");
} catch (Exception e) {
error(e.getMessage());
throw new RuntimeException(e);
} finally {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
} else {
print("Nothing to transport");
}
}
private void doMove() {
try {
if (con == null) {
createConnection(client.getText(), user.getText(), pass.getText(), dept.getText());
}
} catch (IOException e) {
return;
}
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
if (moveResultList == null) {
moveResultList = new ArrayList<ITransportable>();
}
try {
BufferedReader reader = new BufferedReader(new StringReader(topText.getText()));
String line = null;
while ((line = reader.readLine()) != null) {
line = line.trim();
if (line.equals("")) {
continue;
}
SearchObject so = new SearchObject();
so.setName(line);
so.setTypeCALE(true);
so.setTypeCALL(true);
so.setTypeCODE(true);
so.setTypeCONN(true);
so.setTypeCPIT(true);
so.setTypeDOCU(true);
so.setTypeEVNT(true);
so.setTypeFILTER(true);
so.setTypeHOSTG(true);
so.setTypeJOBF(true);
so.setTypeJOBG(true);
so.setTypeJOBI(true);
so.setTypeJOBP(true);
so.setTypeJOBQ(true);
so.setTypeJOBS(true);
so.setTypeJSCH(true);
so.setTypeLOGIN(true);
so.setTypePRPT(true);
so.setTypeQUEUE(true);
so.setTypeSCRI(true);
so.setTypeSYNC(true);
so.setTypeVARA(true);
so.setTypeXSL(true);
so.setTypePERIOD(true); // Include "PERIOD" Object
con.sendRequestAndWait(so);
if (so.size() == 0) {
error("No match found for: " + line);
} else if (so.size() == 1) {
print("Found: " + line);
Iterator<SearchResultItem> it = so.resultIterator();
while (it.hasNext()) {
moveResultList.add(it.next());
}
} else {
error("Too many matches found for: " + line);
}
}
updateDeploymentList();
} catch (Exception e) {
error(e.getMessage());
throw new RuntimeException(e);
} finally {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
private void doTransport() {
if (deploymentList != null && !deploymentList.isEmpty()) {
try {
if (con == null) {
createConnection(client.getText(), user.getText(), pass.getText(), dept.getText());
}
} catch (IOException e) {
return;
}
try {
con.sendRequestAndWait(new ClearTransportCase());
con.sendRequestAndWait(new TransportObject(deploymentList.iterator()));
print("Transport complete");
} catch (Exception e) {
error(e.getMessage());
throw new RuntimeException(e);
} finally {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
} else {
print("Nothing to transport");
}
}
private boolean isTransportableInList(List<ITransportable> list, ITransportable transportable) {
for (ITransportable it : list) {
if (it.getName().equals(transportable.getName())) {
return true;
}
}
return false;
}
Original Message:
Sent: Mar 17, 2023 01:58 PM
From: Michael Lowry
Subject: How to use ITransportable to add a list of objects to the transport case
Can anyone provide an example of how to use the ITransportable interface to add a list of objects to the transport case?