use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class ConfigExternalLibPage method finish.
/**
* Subclasses should implement this for its own business.
*
* @return
*/
public boolean finish() {
// maybe need process the pig udf and bean also. not only for routine.
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
ITalendProcessJavaProject talendProcessJavaProject = service.getTalendProcessJavaProject();
if (talendProcessJavaProject != null) {
talendProcessJavaProject.updateRoutinesPom(true, true);
}
}
return true;
}
use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class GenerateGrammarController method addReferenceJavaFile.
/**
* Store file to file system. Actually, it locates src/routines/xx DOC ytao Comment method "addReferenceJavaFile".
*
* @param routineItem
* @param copyToTemp
* @return
* @throws SystemException
*/
private IFile addReferenceJavaFile(RoutineItem routineItem, boolean copyToTemp) throws SystemException {
FileOutputStream fos = null;
try {
IRunProcessService service = DesignerPlugin.getDefault().getRunProcessService();
ITalendProcessJavaProject talendProcessJavaProject = service.getTalendProcessJavaProject();
if (talendProcessJavaProject == null) {
return null;
}
String label = routineItem.getProperty().getLabel();
IFile file = talendProcessJavaProject.getSrcFolder().getFile(JavaUtils.JAVA_ROUTINES_DIRECTORY + '/' + label + JavaUtils.JAVA_EXTENSION);
if (copyToTemp) {
String routineContent = new String(routineItem.getContent().getInnerContent());
if (!label.equals(ITalendSynchronizer.TEMPLATE)) {
routineContent = routineContent.replaceAll(ITalendSynchronizer.TEMPLATE, label);
File f = file.getLocation().toFile();
fos = new FileOutputStream(f);
fos.write(routineContent.getBytes());
fos.close();
}
}
if (!file.exists()) {
file.refreshLocal(1, null);
}
return file;
} catch (Exception e) {
throw new SystemException(e);
} finally {
try {
fos.close();
} catch (Exception e) {
// ignore me even if i'm null
ExceptionHandler.process(e);
}
}
}
use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class GenerateGrammarController method refreshProject.
/**
* refresh the project
*
* DOC ytao Comment method "refreshProject".
*/
private void refreshProject() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
processService.buildJavaProject();
}
}
use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class AbstractPublishJobAction method exportJobForPOJO.
private void exportJobForPOJO(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
File tmpJob = null;
try {
tmpJob = File.createTempFile("item", ".zip", null);
// jobScriptsManager.setDestinationPath(tmpJob.getAbsolutePath());
// JobExportAction action = new JobExportAction(Collections.singletonList(node), jobVersion,
// jobScriptsManager, null,
// "job");
// action.run(monitor);
// if (!action.isBuildSuccessful()) {
// return;
// }
// TDI-32861, because for publish job, so means, must be binaries
exportChoiceMap.put(ExportChoice.binaries, true);
exportChoiceMap.put(ExportChoice.includeLibs, true);
exportChoiceMap.put(ExportChoice.addStatistics, true);
ProcessItem processItem = (ProcessItem) node.getObject().getProperty().getItem();
String contextName = (String) exportChoiceMap.get(ExportChoice.contextName);
if (contextName == null) {
contextName = processItem.getProcess().getDefaultContext();
}
BuildJobManager.getInstance().buildJob(tmpJob.getAbsolutePath(), processItem, jobVersion, contextName, exportChoiceMap, exportType, monitor);
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
boolean hasError = service.checkExportProcess(new StructuredSelection(node), true);
if (hasError) {
return;
}
}
monitor.beginTask("Deploy to Artifact Repository....", IProgressMonitor.UNKNOWN);
FeaturesModel featuresModel = getFeatureModel(tmpJob);
process(processItem, featuresModel, monitor);
} catch (InterruptedException e) {
throw e;
} catch (Exception e) {
throw new InvocationTargetException(e);
} finally {
if (tmpJob != null && tmpJob.exists()) {
tmpJob.delete();
}
}
}
use of org.talend.designer.runprocess.IRunProcessService in project tdi-studio-se by Talend.
the class WSDL2JAVAController method refreshProject.
private void refreshProject() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IRunProcessService.class)) {
IRunProcessService processService = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
processService.buildJavaProject();
}
}
Aggregations