use of com.amalto.workbench.dialogs.ImportExchangeOptionsDialog in project tmdm-studio-se by Talend.
the class ImportItemsWizard method getExchangeOptionsDialog.
protected ImportExchangeOptionsDialog getExchangeOptionsDialog() {
FormToolkit toolkit = WidgetFactory.getWidgetFactory();
ImportExchangeOptionsDialog dlg = new ImportExchangeOptionsDialog(zipBtn.getShell(), toolkit, true, zipFileRepository);
dlg.create();
dlg.fillInTable();
return dlg;
}
use of com.amalto.workbench.dialogs.ImportExchangeOptionsDialog in project tmdm-studio-se by Talend.
the class MDMImportItemsWizardPage method exchangeImport.
protected void exchangeImport() {
ImportExchangeOptionsDialog dlg = getExchangeOptionsDialog();
dlg.setBlockOnOpen(true);
if (dlg.open() == Window.OK) {
File directory = new File(zipFileRepository.toString());
File[] files = directory.listFiles(new FileFilter() {
public boolean accept(File pathname) {
// $NON-NLS-1$
return pathname.getName().endsWith(".xsd");
}
});
if (null != files && files.length > 0) {
try {
MDMRepositoryView view = MDMRepositoryView.show();
for (File file : files) {
final String label = file.getName().substring(0, file.getName().lastIndexOf('.'));
final WSDataModelItem item = MdmpropertiesFactory.eINSTANCE.createWSDataModelItem();
ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
item.setState(itemState);
WSDataModelE dataModel = MdmserverobjectFactory.eINSTANCE.createWSDataModelE();
dataModel.setName(label);
InputStream stream = null;
try {
stream = new FileInputStream(file);
dataModel.setXsdSchema(IOUtils.toString(stream));
item.setWsDataModel(dataModel);
} catch (Exception e) {
log.error(e.getMessage());
}
IOUtils.closeQuietly(stream);
// $NON-NLS-1$
item.getState().setPath("");
RepositoryResourceUtil.createItem(item, label);
view.refreshRootNode(IServerObjectRepositoryType.TYPE_DATAMODEL);
}
} catch (Exception ex) {
log.error(ex.getMessage());
}
WizardDialog dialog = (WizardDialog) getWizard().getContainer();
dialog.close();
} else {
MessageDialog.openWarning(getShell(), null, Messages.NO_XSD_RESOURCE);
}
}
}
use of com.amalto.workbench.dialogs.ImportExchangeOptionsDialog in project tmdm-studio-se by Talend.
the class ImportItemsWizard method exchangeImport.
protected void exchangeImport() {
ImportExchangeOptionsDialog dlg = getExchangeOptionsDialog();
dlg.setBlockOnOpen(true);
if (dlg.open() == Window.OK) {
zip.getText().setText(zipFileRepository.toString());
parse();
checkUpExchangeImport(false);
}
}
use of com.amalto.workbench.dialogs.ImportExchangeOptionsDialog in project tmdm-studio-se by Talend.
the class MDMImportItemsWizardPage method getExchangeOptionsDialog.
protected ImportExchangeOptionsDialog getExchangeOptionsDialog() {
FormToolkit toolkit = WidgetFactory.getWidgetFactory();
ImportExchangeOptionsDialog dlg = new ImportExchangeOptionsDialogR(getShell(), toolkit, true, zipFileRepository);
dlg.setRadioEnable(true);
dlg.create();
return dlg;
}
Aggregations