Search in sources :

Example 1 with XObjectBrowserInput

use of com.amalto.workbench.providers.XObjectBrowserInput in project tmdm-studio-se by Talend.

the class OpenObjectAction method doSelectServer.

public boolean doSelectServer(Item item, IRepositoryViewEditorInput editorInput) {
    MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
    if (serverObject.getType() == TreeObject.DATA_CLUSTER) {
        // Data Cluster
        MDMServerDef lastServerDef = RepositoryResourceUtil.getLastServerDef(item);
        MDMServerDef serverDef = openServerDialog(lastServerDef);
        if (serverDef != null) {
            XObjectBrowserInput input = (XObjectBrowserInput) editorInput;
            TreeObject xobject = (TreeObject) input.getModel();
            if (xobject != null && xobject.getWsKey() != null) {
                TreeParent serverRoot = getServerRoot(serverDef);
                xobject.setWsKey(new WSDataClusterPK(xobject.getWsKey().toString()));
                xobject.setServerRoot(serverRoot);
                return true;
            }
        }
        return false;
    }
    return true;
}
Also used : WSDataClusterPK(com.amalto.workbench.webservices.WSDataClusterPK) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) TreeParent(com.amalto.workbench.models.TreeParent) XObjectBrowserInput(com.amalto.workbench.providers.XObjectBrowserInput) TreeObject(com.amalto.workbench.models.TreeObject) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)

Example 2 with XObjectBrowserInput

use of com.amalto.workbench.providers.XObjectBrowserInput in project tmdm-studio-se by Talend.

the class XObjectBrowser2 method addPageForXObject.

@Override
protected void addPageForXObject(TreeObject xobject) throws PartInitException {
    switch(xobject.getType()) {
        case TreeObject.VIEW:
            addPage(new ViewBrowserMainPage2(this));
            break;
        case TreeObject.DATA_CLUSTER:
            if (xobject.getDisplayName() != null && xobject.getDisplayName().equals(XSystemObjects.DC_MDMITEMSTRASH.getName())) {
                addPage(new ItemsTrashBrowserMainPage(this));
                break;
            }
            // page index 0
            addPage(new DataClusterBrowserMainPage(this));
            setPageImage(0, EclipseResourceManager.getImage(RepositoryPlugin.PLUGIN_ID, masterImgPath));
            setPageText(0, Messages.bind(Messages.DataClusterBrowserMainPage_masterDataContainer, ((XObjectBrowserInput) getEditorInput()).getName()));
            exAdapter = ExAdapterManager.getAdapter(this, IXObjectBrowser2ExAdapter.class);
            if (exAdapter != null) {
                boolean pageAdded = exAdapter.addPageForXObject(this, getEditorInput(), xobject);
                if (pageAdded) {
                    setPageText(1, exAdapter.getPageText());
                    setPageImage(1, exAdapter.getPageImage());
                    stagingDBExist = exAdapter.isStagingDBExist();
                }
            }
            break;
        case TreeObject.SUBSCRIPTION_ENGINE:
            try {
                addPage(new RoutingEngineV2BrowserMainPage2(this));
            } catch (PartInitException e) {
                log.error(e.getMessage(), e);
            }
            break;
    }
// switch
}
Also used : DataClusterBrowserMainPage(com.amalto.workbench.editors.DataClusterBrowserMainPage) XObjectBrowserInput(com.amalto.workbench.providers.XObjectBrowserInput) PartInitException(org.eclipse.ui.PartInitException) ItemsTrashBrowserMainPage(com.amalto.workbench.editors.ItemsTrashBrowserMainPage)

Aggregations

XObjectBrowserInput (com.amalto.workbench.providers.XObjectBrowserInput)2 DataClusterBrowserMainPage (com.amalto.workbench.editors.DataClusterBrowserMainPage)1 ItemsTrashBrowserMainPage (com.amalto.workbench.editors.ItemsTrashBrowserMainPage)1 TreeObject (com.amalto.workbench.models.TreeObject)1 TreeParent (com.amalto.workbench.models.TreeParent)1 WSDataClusterPK (com.amalto.workbench.webservices.WSDataClusterPK)1 PartInitException (org.eclipse.ui.PartInitException)1 MDMServerDef (org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)1 MDMServerObjectItem (org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem)1 MDMServerObject (org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)1