Search in sources :

Example 1 with MDMServerObject

use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject 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 2 with MDMServerObject

use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject in project tmdm-studio-se by Talend.

the class AbstractInteractiveHandler method deploy.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.mdm.repository.core.service.IInteractiveHandler#deploy(com.amalto.workbench.webservices.XtentisPort,
     * org.talend.core.model.properties.Item, org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)
     */
@Override
public boolean deploy(AbstractDeployCommand cmd) throws XtentisException {
    IRepositoryViewObject viewObj = cmd.getViewObject();
    Item item = viewObj.getProperty().getItem();
    MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
    Object wsObj = convert(item, serverObject);
    TMDMService service = getService(cmd.getServerDef());
    return doDeployWSObject(service, wsObj);
}
Also used : Item(org.talend.core.model.properties.Item) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) TMDMService(com.amalto.workbench.webservices.TMDMService) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)

Example 3 with MDMServerObject

use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject in project tmdm-studio-se by Talend.

the class DataModelInteractiveHandler method deploy.

@Override
public boolean deploy(AbstractDeployCommand cmd) throws XtentisException {
    IRepositoryViewObject viewObj = cmd.getViewObject();
    Item item = viewObj.getProperty().getItem();
    MDMServerObject serverObject = ((MDMServerObjectItem) item).getMDMServerObject();
    Object wsObj = convert(item, serverObject);
    // 
    ICommandParameter parameter = cmd.getParameter();
    if (parameter != null) {
        callModelService(cmd);
        return true;
    } else {
        TMDMService service = getService(cmd.getServerDef());
        return doDeployWSObject(service, wsObj);
    }
}
Also used : WSDataModelItem(org.talend.mdm.repository.model.mdmproperties.WSDataModelItem) Item(org.talend.core.model.properties.Item) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) TMDMService(com.amalto.workbench.webservices.TMDMService) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ICommandParameter(org.talend.mdm.repository.core.command.param.ICommandParameter) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)

Example 4 with MDMServerObject

use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject 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 5 with MDMServerObject

use of org.talend.mdm.repository.model.mdmserverobject.MDMServerObject in project tmdm-studio-se by Talend.

the class RemoveFromRepositoryAction method removeServerObject.

private void removeServerObject(IRepositoryViewObject viewObj) {
    if (removed.contains(viewObj.getId())) {
        return;
    }
    removed.add(viewObj.getId());
    try {
        Item item = viewObj.getProperty().getItem();
        IEditorReference ref = RepositoryResourceUtil.isOpenedInEditor(viewObj);
        if (ref != null) {
            RepositoryResourceUtil.closeEditor(ref, true);
        }
        factory.deleteObjectLogical(viewObj);
        if (item instanceof MDMServerObjectItem) {
            MDMServerObject serverObj = ((MDMServerObjectItem) item).getMDMServerObject();
            CommandManager.getInstance().pushCommand(ICommand.CMD_DELETE, viewObj.getId(), serverObj.getName());
        }
    } catch (BusinessException e) {
        MessageDialog.openError(getShell(), Messages.Common_Error, e.getMessage());
    } catch (Exception e) {
        log.error(e.getMessage(), e);
    }
}
Also used : TDQItem(org.talend.core.model.properties.TDQItem) Item(org.talend.core.model.properties.Item) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) FolderItem(org.talend.core.model.properties.FolderItem) ContainerItem(org.talend.mdm.repository.model.mdmproperties.ContainerItem) BusinessException(org.talend.commons.exception.BusinessException) IEditorReference(org.eclipse.ui.IEditorReference) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject) BusinessException(org.talend.commons.exception.BusinessException) PersistenceException(org.talend.commons.exception.PersistenceException)

Aggregations

MDMServerObject (org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)37 MDMServerObjectItem (org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem)33 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)19 Item (org.talend.core.model.properties.Item)13 TreeObject (com.amalto.workbench.models.TreeObject)11 Property (org.talend.core.model.properties.Property)11 PersistenceException (org.talend.commons.exception.PersistenceException)9 Test (org.junit.Test)7 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)7 MDMServerDef (org.talend.mdm.repository.model.mdmmetadata.MDMServerDef)7 ContainerItem (org.talend.mdm.repository.model.mdmproperties.ContainerItem)7 IProxyRepositoryFactory (org.talend.repository.model.IProxyRepositoryFactory)7 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)6 LoginException (org.talend.commons.exception.LoginException)6 EObject (org.eclipse.emf.ecore.EObject)5 ArrayList (java.util.ArrayList)4 FolderItem (org.talend.core.model.properties.FolderItem)4 TMDMService (com.amalto.workbench.webservices.TMDMService)3 LinkedList (java.util.LinkedList)3 ItemState (org.talend.core.model.properties.ItemState)3