-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPLP CheatSheet.txt
47 lines (37 loc) · 1.47 KB
/
PLP CheatSheet.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Import necessary packages
import com.scitegic.proxy.*;
// Server Connection & Configuration
PipelinePilotServer pp = new PipelinePilotServer(server, user, password);
PipelinePilotServerConfig conf = pp.getServerConfig();
// Remote File Manager
pp.getRemoteFileManager();
// Work with Component Database
ComponentDatabase compdb;
XmldbItem rootFolder = compdb.getXmldbContentsRecursive(WEB_PORT_EXAMPLE_PROTOCOLS);
// Protocol Creation & Info Retrieval
Job protocol = pp.createJob(PROTOCOL);
ComponentInfo cmptInfo = protocol.getComponentInfo();
ParameterInfo[] params = cmptInfo.getParameters();
// Print each parameter object details
for (ParameterInfo para : params) {
System.out.println("Name=" + para.getName() + "; Type=" + para.getType() + "; isRequired=" + para.isRequired());
}
// Set protocol parameters
File localFile = new File("./data/imports-85.txt");
protocol.setInputFileOnClient("Source", localFile);
protocol.setInputValue("X Property", "Highwaympg");
// Validate the protocol
protocol.validate();
// Submit job and check its status
JobResult prr = protocol.runAndPoll();
JobStatus status = protocol.getStatus();
// Check for job results and download if available
if (JobStatus.Finished.equals(status)) {
String[] results = prr.getResultFiles();
if (results.length > 0) {
File localResultFile = new File("chart.sdf");
pp.getRemoteFileManager().downloadFile(results[0], localResultFile);
}
}
// Release the job resources
protocol.releaseJob();