use of org.talend.repository.services.ui.scriptmanager.ServiceExportManager in project tesb-studio-se by Talend.
the class ExportServiceAction method init.
private void init(String targetPath) throws InvocationTargetException {
serviceName = serviceItem.getProperty().getLabel();
serviceVersion = serviceItem.getProperty().getVersion();
serviceWsdl = WSDLUtils.getWsdlFile(serviceItem);
ServiceConnection serviceConnection = (ServiceConnection) serviceItem.getConnection();
additionalInfo = serviceConnection.getAdditionalInfo().map();
EList<ServicePort> listPort = serviceConnection.getServicePort();
List<IRepositoryViewObject> jobs;
try {
jobs = ProxyRepositoryFactory.getInstance().getAll(ERepositoryObjectType.PROCESS);
} catch (PersistenceException e) {
throw new InvocationTargetException(e);
}
for (ServicePort port : listPort) {
List<ServiceOperation> listOperation = port.getServiceOperation();
Map<String, String> operations = new HashMap<String, String>(listOperation.size());
for (ServiceOperation operation : listOperation) {
String jobId = operation.getReferenceJobId();
if (jobId != null && !jobId.equals("")) {
String operationName = operation.getName();
IRepositoryViewObject jobNode = null;
for (IRepositoryViewObject job : jobs) {
if (job.getId().equals(jobId)) {
jobNode = job;
break;
}
}
if (jobNode == null) {
continue;
}
String jobName = jobNode.getLabel();
operations.put(operationName, jobName);
nodes.add(jobNode);
contextValues.putAll(JobContextUtils.getContextsMap((ProcessItem) jobNode.getProperty().getItem()));
}
}
ports.put(port, operations);
}
if (this.serviceManager == null) {
this.serviceManager = new ServiceExportManager(exportChoiceMap);
}
serviceManager.setDestinationPath(targetPath);
tempFolder = getTmpFolderPath();
}
Aggregations