Search in sources :

Example 1 with TreeObject

use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.

the class MDMEventManagerAction method doRun.

@Override
protected void doRun() {
    boolean checkMissingJar = MissingJarService.getInstance().checkMissingJar(true);
    if (!checkMissingJar) {
        return;
    }
    MDMServerDef serverDef = getServerDef();
    if (serverDef != null) {
        try {
            ServerDefService.checkMDMConnection(serverDef);
        } catch (Exception e) {
            MessageDialog.openError(getShell(), Messages.MDMEventManagerAction_CheckConnection, Messages.MDMEventManagerAction_connectFailed);
            return;
        }
        IRepositoryViewObject eventViewObj = getEventMangerViewObject();
        TreeObject treeObj = createModel();
        XObjectBrowserInput2 input = new XObjectBrowserInput2(eventViewObj, treeObj, Messages.EventManager_text);
        input.setServerDef(serverDef);
        if (page == null) {
            this.page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        }
        try {
            this.page.openEditor(input, XObjectBrowser2.EDITOR_ID);
        } catch (PartInitException e) {
            log.error(e.getMessage(), e);
        }
        setServerDef(null);
    }
}
Also used : XObjectBrowserInput2(org.talend.mdm.repository.ui.editors.XObjectBrowserInput2) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) TreeObject(com.amalto.workbench.models.TreeObject) PartInitException(org.eclipse.ui.PartInitException) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef) PartInitException(org.eclipse.ui.PartInitException)

Example 2 with TreeObject

use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.

the class TestTriggerAction method doRun.

@Override
protected void doRun() {
    com.amalto.workbench.utils.MDMServerDef serverDef = getServerDef();
    if (serverDef == null) {
        return;
    }
    boolean canConnect = checkConnection(serverDef.getUrl(), serverDef.getUser(), serverDef.getPasswd());
    if (!canConnect) {
        MessageDialog.openError(getShell(), Messages.RoutingRuleMainPage2_CheckConnection, Messages.RoutingRuleMainPage2_UnableToConnect);
        return;
    }
    try {
        service = Util.getMDMService(new URL(serverDef.getUrl()), serverDef.getUser(), serverDef.getPasswd());
        IWorkbenchPartSite site = commonViewer.getCommonNavigator().getSite();
        dialog = new DataClusterDialog(getShell(), new TreeObject(), site);
        dialog.setDefaultServerDef(serverDef);
        dialog.setOkLabel(Messages.TestTriggerAction_Test);
        dialog.setCancelLabel(Messages.TestTriggerAction_Close);
        dialog.setSelectionListener(this);
        dialog.open();
    } catch (Exception e) {
        log.error(e.getMessage(), e);
    }
}
Also used : IWorkbenchPartSite(org.eclipse.ui.IWorkbenchPartSite) TreeObject(com.amalto.workbench.models.TreeObject) URL(java.net.URL) DataClusterDialog(com.amalto.workbench.editors.DataClusterDialog)

Example 3 with TreeObject

use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.

the class ResourceRepositoryFileEditorInput method init.

@Override
protected void init(Item item) {
    MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
    String name = null;
    if (serverObject instanceof WSResourceE) {
        // $NON-NLS-1$
        name = serverObject.getName() + "." + ((WSResourceE) serverObject).getFileExtension();
    }
    Object treeObject = new TreeObject(name, null, TreeObject.RESOURCES, null, null, null);
    setModel(treeObject);
    setName(name);
}
Also used : MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) TreeObject(com.amalto.workbench.models.TreeObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) TreeObject(com.amalto.workbench.models.TreeObject) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject) WSResourceE(org.talend.mdm.repository.model.mdmserverobject.WSResourceE) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)

Example 4 with TreeObject

use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.

the class TransformerMainPage2 method initTransformer.

@Override
protected void initTransformer() throws XtentisException {
    TreeObject xObject = getXObject();
    transformer = (WSTransformerV2) xObject.getWsObject();
}
Also used : TreeObject(com.amalto.workbench.models.TreeObject)

Example 5 with TreeObject

use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.

the class LockedObjectDialog method getUnlockedTreeObject.

public Object[] getUnlockedTreeObject(Object[] inputTreeObjs, Map<IRepositoryViewObject, TreeObject> objMap) {
    if (inputTreeObjs == null || objMap == null) {
        return null;
    }
    Set<Object> lockedTreeObjs = new HashSet<Object>();
    // collect
    for (IRepositoryViewObject lockedObj : lockedObjs) {
        TreeObject lockedTreeObj = objMap.get(lockedObj);
        if (lockedTreeObj != null) {
            lockedTreeObjs.add(lockedTreeObj);
        }
    }
    // 
    List<Object> newUnlockedTreeObjs = new LinkedList<Object>();
    for (Object oldObj : inputTreeObjs) {
        if (!lockedTreeObjs.contains(oldObj)) {
            newUnlockedTreeObjs.add(oldObj);
        }
    }
    return newUnlockedTreeObjs.toArray();
}
Also used : IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) TreeObject(com.amalto.workbench.models.TreeObject) TreeObject(com.amalto.workbench.models.TreeObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) LinkedList(java.util.LinkedList) HashSet(java.util.HashSet)

Aggregations

TreeObject (com.amalto.workbench.models.TreeObject)66 TreeParent (com.amalto.workbench.models.TreeParent)21 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)14 ArrayList (java.util.ArrayList)12 MDMServerObject (org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)12 TMDMService (com.amalto.workbench.webservices.TMDMService)6 WSDataModel (com.amalto.workbench.webservices.WSDataModel)5 WSDataModelPK (com.amalto.workbench.webservices.WSDataModelPK)5 WSGetDataModel (com.amalto.workbench.webservices.WSGetDataModel)5 Document (org.dom4j.Document)5 Element (org.dom4j.Element)5 EObject (org.eclipse.emf.ecore.EObject)5 MDMServerObjectItem (org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem)5 WSDataClusterPK (com.amalto.workbench.webservices.WSDataClusterPK)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)4 IAvailableModel (com.amalto.workbench.availablemodel.IAvailableModel)3 UserInfo (com.amalto.workbench.utils.UserInfo)3 WSDataCluster (com.amalto.workbench.webservices.WSDataCluster)3 WSDigest (com.amalto.workbench.webservices.WSDigest)3 WSDigestKey (com.amalto.workbench.webservices.WSDigestKey)3