use of org.talend.commons.exception.SystemException in project tdi-studio-se by Talend.
the class ProblemsView method restoreProblem.
/**
*
* ggu Comment method "restoreProblem".
*
* when restore the item, check the problem.
*/
private void restoreProblem(RoutineItem item) {
ICodeGeneratorService service = (ICodeGeneratorService) GlobalServiceRegister.getDefault().getService(ICodeGeneratorService.class);
ITalendSynchronizer routineSynchronizer = null;
switch(LanguageManager.getCurrentLanguage()) {
case JAVA:
routineSynchronizer = service.createJavaRoutineSynchronizer();
break;
case PERL:
routineSynchronizer = service.createPerlRoutineSynchronizer();
break;
default:
}
if (routineSynchronizer != null) {
try {
routineSynchronizer.syncRoutine(item, true);
IFile file = routineSynchronizer.getFile(item);
if (file == null) {
return;
}
file.refreshLocal(IResource.DEPTH_ONE, null);
Problems.addRoutineFile(file, item.getProperty());
} catch (SystemException e) {
ExceptionHandler.process(e);
} catch (CoreException e) {
ExceptionHandler.process(e);
}
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
Problems.refreshProblemTreeView();
}
});
}
}
use of org.talend.commons.exception.SystemException in project tdi-studio-se by Talend.
the class Processor method updateContextCode.
protected void updateContextCode(ICodeGenerator codeGen) throws ProcessorException {
if (codeGen == null) {
return;
}
try {
//$NON-NLS-1$
String processContext = "false";
try {
processContext = codeGen.generateContextCode(context);
} catch (SystemException e) {
//$NON-NLS-1$
throw new ProcessorException(Messages.getString("Processor.generationFailed"), e);
}
IFile contextFile = this.getCodeProject().getFile(contextPath);
InputStream contextStream = new ByteArrayInputStream(processContext.getBytes());
if (!contextFile.exists()) {
// see bug 0003592, detele file with different case in windows
deleteFileIfExisted(contextFile);
contextFile.create(contextStream, true, null);
} else {
contextFile.setContents(contextStream, true, false, null);
}
} catch (CoreException e1) {
//$NON-NLS-1$
throw new ProcessorException(Messages.getString("Processor.tempFailed"), e1);
}
}
use of org.talend.commons.exception.SystemException in project tdi-studio-se by Talend.
the class JavaCompilationParticipant method updateProblems.
/**
* yzhang Comment method "updateProblems".
*/
private void updateProblems(List<IRepositoryViewObject> routineObjectList, String filePath) {
IRunProcessService runProcessService = CorePlugin.getDefault().getRunProcessService();
try {
ITalendProcessJavaProject talendProcessJavaProject = runProcessService.getTalendProcessJavaProject();
if (talendProcessJavaProject == null) {
return;
}
final ITalendSynchronizer synchronizer = CorePlugin.getDefault().getCodeGeneratorService().createRoutineSynchronizer();
IProject javaProject = talendProcessJavaProject.getProject();
IFile file = javaProject.getFile(filePath);
String fileName = file.getName();
for (IRepositoryViewObject repositoryObject : routineObjectList) {
Property property = repositoryObject.getProperty();
Item item = property.getItem();
IFile currentFile = synchronizer.getFile(item);
if (currentFile != null && fileName.equals(currentFile.getName()) && currentFile.exists()) {
Problems.addRoutineFile(currentFile, property);
break;
}
}
} catch (SystemException e) {
ExceptionHandler.process(e);
}
}
use of org.talend.commons.exception.SystemException in project tdi-studio-se by Talend.
the class LoginProjectPage method validateUpdate.
protected void validateUpdate() throws JSONException {
final ConnectionBean currentBean = getConnection();
String repositoryId = null;
// at 1st time open the studio there are no bean at all,so need avoid NPE
if (currentBean != null) {
repositoryId = currentBean.getRepositoryId();
}
try {
if (currentBean != null && isSVNProviderPluginLoadedRemote() && isWorkSpaceSame()) {
if (afterUpdate) {
refreshProjectOperationAreaEnable(false);
//$NON-NLS-1$
errorManager.setErrMessage(Messages.getString("LoginProjectPage.archivaFinish"));
changeFinishButtonAction(FINISH_ACTION_RESTART);
} else {
OverTimePopupDialogTask<Boolean> overTimePopupDialogTask = new OverTimePopupDialogTask<Boolean>() {
@Override
public Boolean run() throws Throwable {
return LoginHelper.isStudioNeedUpdate(currentBean);
}
};
overTimePopupDialogTask.setNeedWaitingProgressJob(false);
boolean needUpdate = overTimePopupDialogTask.runTask();
if (needUpdate && isWorkSpaceSame()) {
refreshProjectOperationAreaEnable(false);
//$NON-NLS-1$
errorManager.setErrMessage(Messages.getString("LoginProjectPage.updateArchiva"));
changeFinishButtonAction(FINISH_ACTION_UPDATE);
}
}
}
} catch (PersistenceException e) {
CommonExceptionHandler.process(e);
} catch (SystemException e) {
updateArchivaErrorButton();
} catch (Throwable e) {
CommonExceptionHandler.process(e);
}
}
use of org.talend.commons.exception.SystemException in project tdi-studio-se by Talend.
the class RepositoryService method getRulesProviderPath.
@Override
public String getRulesProviderPath(RulesItem currentRepositoryItem) {
IRulesProviderService rulesService = null;
if (PluginChecker.isRulesPluginLoaded()) {
rulesService = (IRulesProviderService) GlobalServiceRegister.getDefault().getService(IRulesProviderService.class);
try {
rulesService.syncRule(currentRepositoryItem);
IFile ruleFile = rulesService.getRuleFile(currentRepositoryItem, FileConstants.XLS_FILE_SUFFIX);
if (ruleFile == null) {
return null;
}
String path = ruleFile.getLocation().toOSString();
return path;
} catch (SystemException e) {
// added by SeB, log it at least butthe devlopper should have a look at this
//$NON-NLS-1$
log.error("failed to get the Rules provider path", e);
}
}
//$NON-NLS-1$
return "";
}
Aggregations