use of org.talend.mdm.repository.ui.navigator.MDMRepositoryView 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 org.talend.mdm.repository.ui.navigator.MDMRepositoryView in project tmdm-studio-se by Talend.
the class AbstractShowViewAction method showRepositoryView.
protected MDMRepositoryView showRepositoryView() throws PartInitException {
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
MDMRepositoryView findView = (MDMRepositoryView) activePage.findView(MDMRepositoryView.VIEW_ID);
if (findView == null)
findView = (MDMRepositoryView) activePage.showView(MDMRepositoryView.VIEW_ID);
activePage.activate(findView);
findView.setFocus();
return findView;
}
use of org.talend.mdm.repository.ui.navigator.MDMRepositoryView in project tmdm-studio-se by Talend.
the class DeployAllLinkAction method doRun.
protected void doRun(IIntroSite site, Properties params) {
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
MDMRepositoryView findView = (MDMRepositoryView) activePage.findView(MDMRepositoryView.VIEW_ID);
try {
if (findView == null)
findView = (MDMRepositoryView) activePage.showView(MDMRepositoryView.VIEW_ID);
findView.setFocus();
DeployAllAction deployAllAction = findView.getDeployAllAction();
deployAllAction.runWithType(null);
} catch (PartInitException e) {
log.error(e.getMessage(), e);
}
}
use of org.talend.mdm.repository.ui.navigator.MDMRepositoryView in project tmdm-studio-se by Talend.
the class ViewMainPage2 method deployAndRefresh.
private void deployAndRefresh() {
DeployService deployService = DeployService.getInstance();
if (!deployService.isAutoDeploy()) {
autoDeployProcess(deployService);
// refresh after deploy
MDMRepositoryView view = MDMRepositoryView.show();
if (view != null) {
view.refreshRootNode(IServerObjectRepositoryType.TYPE_TRANSFORMERV2);
}
}
}
use of org.talend.mdm.repository.ui.navigator.MDMRepositoryView in project tmdm-studio-se by Talend.
the class TransformerMainPage2 method deployAndRefresh.
private void deployAndRefresh() {
DeployService deployService = DeployService.getInstance();
if (!deployService.isAutoDeploy()) {
editor2.autoDeployProcess(deployService);
// refresh after deploy
MDMRepositoryView view = MDMRepositoryView.show();
if (view != null) {
view.refreshRootNode(IServerObjectRepositoryType.TYPE_TRANSFORMERV2);
}
}
}
Aggregations