use of org.talend.commons.exception.PersistenceException in project tdi-studio-se by Talend.
the class NewSqlpatternWizard method performFinish.
/**
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
public boolean performFinish() {
IProxyRepositoryFactory repositoryFactory = ProxyRepositoryFactory.getInstance();
try {
property.setId(repositoryFactory.getNextId());
repositoryFactory.create(sqlpatternItem, mainPage.getDestinationPath());
} catch (PersistenceException e) {
//$NON-NLS-1$//$NON-NLS-2$
MessageDialog.openError(getShell(), Messages.getString(Messages.getString("NewSqlpatternWizard.failureTitle")), "");
ExceptionHandler.process(e);
}
return sqlpatternItem != null;
}
use of org.talend.commons.exception.PersistenceException in project tdi-studio-se by Talend.
the class AutoConvertTypesUtils method getTypeFile.
public static File getTypeFile() {
try {
IProject project = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
IPath settingPath = new ProjectScope(project).getLocation();
//$NON-NLS-1$//$NON-NLS-2$;
return new File(settingPath + "\\" + AUTO_CONVERSION_TYPES_RESOURCES + ".xml");
} catch (PersistenceException e) {
e.printStackTrace();
}
return null;
}
use of org.talend.commons.exception.PersistenceException in project tdi-studio-se by Talend.
the class TalendWizardProjectsImportPage method createProjects.
@SuppressWarnings("restriction")
@Override
public boolean createProjects() {
// TDI-19269
final boolean created = super.createProjects();
//
final Object[] selected = getProjectsList().getCheckedElements();
XmiResourceManager xmiManager = new XmiResourceManager();
try {
for (Object element : selected) {
final ProjectRecord record = (ProjectRecord) element;
String projectName = record.getProjectName();
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IProject project = workspace.getRoot().getProject(projectName);
try {
final Project loadProject = xmiManager.loadProject(project);
loadProject.setLocal(true);
loadProject.setId(0);
loadProject.setUrl(null);
loadProject.setCreationDate(null);
//loadProject.setDescription(""); //$NON-NLS-1$
loadProject.setType(null);
xmiManager.saveResource(loadProject.eResource());
// FIXME TDI-22786, migrate the project name.
if (ProjectManager.enableSpecialTechnicalProjectName()) {
ChangeProjectTechinicalNameMigrationTask migrationTask = new ChangeProjectTechinicalNameMigrationTask();
migrationTask.migrateTalendProject(project, loadProject, xmiManager);
}
} catch (PersistenceException e) {
//
}
}
} finally {
xmiManager.unloadResources();
}
return created;
//
}
use of org.talend.commons.exception.PersistenceException in project tdi-studio-se by Talend.
the class NewRoutineWizard method performFinish.
/**
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
@Override
public boolean performFinish() {
IProxyRepositoryFactory repositoryFactory = ProxyRepositoryFactory.getInstance();
try {
updateRoutineContent();
property.setId(repositoryFactory.getNextId());
//changed by hqzhang for TDI-19527, label=displayName
property.setLabel(property.getDisplayName());
repositoryFactory.create(routineItem, mainPage.getDestinationPath());
} catch (PersistenceException e) {
//$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.openError(getShell(), Messages.getString("NewProcessWizard.failureTitle"), "");
ExceptionHandler.process(e);
}
return routineItem != null;
}
use of org.talend.commons.exception.PersistenceException in project tdi-studio-se by Talend.
the class JavaJobScriptsExportWSWizardPage method restoreWidgetValuesForWS.
protected void restoreWidgetValuesForWS() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
if (directoryNames != null && directoryNames.length > 0) {
String fileName = getDefaultFileNameWithType();
// destination
for (int i = 0; i < directoryNames.length; i++) {
if (directoryNames[i].toLowerCase().endsWith(FileConstants.WAR_FILE_SUFFIX) || directoryNames[i].toLowerCase().endsWith(FileConstants.ZIP_FILE_SUFFIX)) {
//$NON-NLS-1$
directoryNames[i] = (directoryNames[i].charAt(0) + "").toUpperCase() + directoryNames[i].substring(1);
addDestinationItem(directoryNames[i]);
}
}
File dest = new File(new File(directoryNames[0]).getParentFile(), fileName);
setDestinationValue(dest.getAbsolutePath());
} else {
setDefaultDestination();
}
webXMLButton.setSelection(settings.getBoolean(STORE_WEBXML_ID));
configFileButton.setSelection(settings.getBoolean(STORE_CONFIGFILE_ID));
axisLibButton.setSelection(settings.getBoolean(STORE_AXISLIB_ID));
wsddButton.setSelection(settings.getBoolean(STORE_WSDD_ID));
wsdlButton.setSelection(settings.getBoolean(STORE_WSDL_ID));
jobScriptButton.setSelection(settings.getBoolean(STORE_SOURCE_ID));
contextButton.setSelection(settings.getBoolean(STORE_CONTEXT_ID));
applyToChildrenButton.setSelection(settings.getBoolean(APPLY_TO_CHILDREN_ID));
chkButton.setSelection(settings.getBoolean(EXTRACT_ZIP_FILE));
// TDI-26294:should use getVisible here since the isVisible need the parent's isVisible()
if (chkButton.getVisible()) {
zipOption = String.valueOf(chkButton.getSelection());
} else {
//$NON-NLS-1$
zipOption = "false";
}
}
if (getProcessItem() != null && contextCombo != null) {
try {
setProcessItem((ProcessItem) ProxyRepositoryFactory.getInstance().getUptodateProperty(getProcessItem().getProperty()).getItem());
} catch (PersistenceException e) {
e.printStackTrace();
}
List<String> contextNames = ExportJobUtil.getJobContexts(getProcessItem());
contextCombo.setItems(contextNames.toArray(new String[contextNames.size()]));
if (contextNames.size() > 0) {
contextCombo.select(0);
}
}
if (log4jLevelCombo != null) {
log4jLevelCombo.setItems(Log4jPrefsSettingManager.getLevel());
if (Log4jPrefsSettingManager.getLevel().length > 0) {
log4jLevelCombo.select(2);
}
}
}
Aggregations