use of org.talend.repository.ui.wizards.exportjob.action.JobExportAction in project tesb-studio-se by Talend.
the class ExportServiceAction method exportJobsBundle.
private void exportJobsBundle(IProgressMonitor monitor, FeaturesModel feature) throws InvocationTargetException, InterruptedException {
String directoryName = serviceManager.getRootFolderName(tempFolder);
for (IRepositoryViewObject node : nodes) {
JobScriptsManager manager = serviceManager.getJobManager(exportChoiceMap, tempFolder, node, getGroupId(), getServiceVersion());
JobExportAction job = new JobExportAction(Collections.singletonList(new RepositoryNode(node, null, ENodeType.REPOSITORY_ELEMENT)), node.getVersion(), getBundleVersion(), manager, directoryName, //$NON-NLS-1$
"Service");
job.run(monitor);
feature.addBundle(new BundleModel(getGroupId(), serviceManager.getNodeLabel(node), getServiceVersion(), new File(manager.getDestinationPath())));
}
}
use of org.talend.repository.ui.wizards.exportjob.action.JobExportAction in project tesb-studio-se by Talend.
the class KarafJavaScriptForESBWithMavenManager method addTalendJobsExportResources.
private void addTalendJobsExportResources(List<ExportFileResource> list) {
// for cTalendJob
Iterator<String> iterator = this.talendJobsMap.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next();
IRepositoryViewObject repObject = this.talendJobsMap.get(key);
if (repObject == null) {
continue;
}
final Item talendJobItem = repObject.getProperty().getItem();
if (talendJobItem == null) {
continue;
}
String contextgGroup = this.talendJobContextGroupsMap.get(key);
if (contextgGroup == null) {
contextgGroup = IContext.DEFAULT;
}
final String talendJobLabel = talendJobItem.getProperty().getLabel();
final String talendJobVersion = talendJobItem.getProperty().getVersion();
File talendJobDestFile = new File(getTmpFolder(), talendJobLabel + '_' + talendJobVersion + FileConstants.ZIP_FILE_SUFFIX);
String talendJobPath = talendJobDestFile.getAbsolutePath();
OSGIJavaScriptForESBWithMavenManager osgiWithMavenManager = getOsgiWithMavenManager(list, talendJobLabel, contextgGroup);
osgiWithMavenManager.setDestinationPath(talendJobPath);
osgiWithMavenManager.setJobVersion(talendJobVersion);
talendJobOsgiWithMavenManagersMap.put(key, osgiWithMavenManager);
//$NON-NLS-1$
ExportFileResource talendJobResource = new ExportFileResource(talendJobItem, "");
talendJobResource.setDirectoryName(talendJobPath);
try {
RepositoryNode node = new RepositoryNode(repObject, null, ENodeType.REPOSITORY_ELEMENT);
JobExportAction job = new JobExportAction(Collections.singletonList(node), talendJobVersion, osgiWithMavenManager, talendJobPath) {
@Override
protected void doArchiveExport(IProgressMonitor monitor, List<ExportFileResource> resourcesToExport) {
// TDI-23377, no need do archive, because will re-use the resources to export for route
// super.doArchiveExport(monitor, resourcesToExport);
}
@Override
protected void reBuildJobZipFile(List<ExportFileResource> processes) {
// TDI-23377, no need do archive, because will re-use the resources to export for route
// super.reBuildJobZipFile(processes);
}
@Override
protected void clean() {
// TDI-23377, will re-use the tmp. so don't clean
// super.clean();
}
};
job.run(this.progressMonitor != null ? this.progressMonitor : new NullProgressMonitor());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
use of org.talend.repository.ui.wizards.exportjob.action.JobExportAction in project tesb-studio-se by Talend.
the class JavaCamelJobScriptsExportWSAction method exportRouteBundle.
private void exportRouteBundle(IRepositoryNode node, File filePath, String version, String bundleName, String bundleSymbolicName, String bundleVersion, String idSuffix, Collection<String> routelets, String context) throws InvocationTargetException, InterruptedException {
final RouteJavaScriptOSGIForESBManager talendJobManager = new RouteJavaScriptOSGIForESBManager(getExportChoice(), context, routelets, statisticPort, tracePort);
talendJobManager.setBundleName(bundleName);
talendJobManager.setBundleSymbolicName(bundleSymbolicName);
talendJobManager.setBundleVersion(bundleVersion);
talendJobManager.setOsgiServiceIdSuffix(idSuffix);
talendJobManager.setMultiNodes(false);
talendJobManager.setDestinationPath(filePath.getAbsolutePath());
JobExportAction action = new JobExportAction(Collections.singletonList(node), version, bundleVersion, talendJobManager, getTempDir(), "Route");
action.run(monitor);
}
Aggregations