Search in sources :

Example 11 with TMDMService

use of com.amalto.workbench.webservices.TMDMService in project tmdm-studio-se by Talend.

the class RepositoryWebServiceAdapter method getMDMService.

public static TMDMService getMDMService(Shell shell, MDMServerDef lastserverDef) {
    if (lastserverDef == null) {
        MessageDialog.openWarning(null, Messages.Warning_text, Messages.RepositoryWebServiceAdapter_DeployFirst);
        return null;
    }
    SelectServerDefDialog dialog = new SelectServerDefDialog(shell);
    dialog.create();
    dialog.setSelectServer(lastserverDef);
    try {
        if (dialog.open() == IDialogConstants.OK_ID) {
            MDMServerDef serverDef = dialog.getSelectedServerDef();
            TMDMService port = RepositoryWebServiceAdapter.getMDMService(serverDef);
            return port;
        }
    } catch (XtentisException e) {
        log.error(e.getMessage(), e);
    }
    return null;
}
Also used : TMDMService(com.amalto.workbench.webservices.TMDMService) SelectServerDefDialog(org.talend.mdm.workbench.serverexplorer.ui.dialogs.SelectServerDefDialog) MDMServerDef(org.talend.mdm.repository.model.mdmmetadata.MDMServerDef) XtentisException(com.amalto.workbench.utils.XtentisException)

Example 12 with TMDMService

use of com.amalto.workbench.webservices.TMDMService 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 13 with TMDMService

use of com.amalto.workbench.webservices.TMDMService 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 14 with TMDMService

use of com.amalto.workbench.webservices.TMDMService in project tmdm-studio-se by Talend.

the class ConsistencyService method queryServerDigestValue.

public <T> Map<T, WSDigest> queryServerDigestValue(MDMServerDef serverDef, Collection<T> objs) throws XtentisException {
    Map<T, WSDigest> result = new LinkedHashMap<T, WSDigest>();
    TMDMService service = RepositoryWebServiceAdapter.getMDMService(serverDef);
    if (isSupportConsistency(service)) {
        for (T obj : objs) {
            String type = null;
            String objectName = null;
            if (obj instanceof IRepositoryViewObject) {
                IRepositoryViewObject viewObj = (IRepositoryViewObject) obj;
                type = viewObj.getRepositoryObjectType().getKey();
                objectName = viewObj.getLabel();
            } else if (obj instanceof TreeObject) {
                TreeObject treeObj = (TreeObject) obj;
                ERepositoryObjectType repositoryObjectType = RepositoryQueryService.getRepositoryObjectType(treeObj.getType());
                if (repositoryObjectType != null) {
                    type = repositoryObjectType.getKey();
                    objectName = getObjectName(treeObj);
                }
            }
            if (type != null && objectName != null) {
                WSDigest digest = service.getDigest(new WSDigestKey(objectName, type));
                result.put(obj, digest);
            }
        }
    }
    return result;
}
Also used : TMDMService(com.amalto.workbench.webservices.TMDMService) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) WSDigestKey(com.amalto.workbench.webservices.WSDigestKey) TreeObject(com.amalto.workbench.models.TreeObject) WSDigest(com.amalto.workbench.webservices.WSDigest) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType) LinkedHashMap(java.util.LinkedHashMap)

Example 15 with TMDMService

use of com.amalto.workbench.webservices.TMDMService in project tmdm-studio-se by Talend.

the class XSDDeleteConceptAction method checkContainFK.

protected boolean checkContainFK(String fkName) throws Exception {
    // add by ymli. fix buy 0010029
    Set<String> list = Util.getForeignKeys();
    if (list == null) {
        TMDMService service = null;
        try {
            service = Util.getMDMService(page.getXObject());
        } catch (XtentisException e) {
            log.error(e.getMessage(), e);
        }
        list = new HashSet<String>();
        Util.getForeingKeyInDataModel(list, page.getXObject().getParent(), service);
        Util.setForeignKeys(list);
    }
    return list.contains(fkName);
}
Also used : TMDMService(com.amalto.workbench.webservices.TMDMService) XtentisException(com.amalto.workbench.utils.XtentisException)

Aggregations

TMDMService (com.amalto.workbench.webservices.TMDMService)41 XtentisException (com.amalto.workbench.utils.XtentisException)18 WSDataClusterPK (com.amalto.workbench.webservices.WSDataClusterPK)10 URL (java.net.URL)10 WebServiceException (javax.xml.ws.WebServiceException)9 WSDataModelPK (com.amalto.workbench.webservices.WSDataModelPK)8 TreeObject (com.amalto.workbench.models.TreeObject)7 MalformedURLException (java.net.MalformedURLException)7 WSDataModel (com.amalto.workbench.webservices.WSDataModel)6 WSGetDataModel (com.amalto.workbench.webservices.WSGetDataModel)6 WSView (com.amalto.workbench.webservices.WSView)6 ParseException (java.text.ParseException)6 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)6 WSDataCluster (com.amalto.workbench.webservices.WSDataCluster)5 WSGetDataCluster (com.amalto.workbench.webservices.WSGetDataCluster)5 WSGetView (com.amalto.workbench.webservices.WSGetView)5 WSPing (com.amalto.workbench.webservices.WSPing)5 Matcher (java.util.regex.Matcher)5 WSDigest (com.amalto.workbench.webservices.WSDigest)4 WSRoutingEngineV2Action (com.amalto.workbench.webservices.WSRoutingEngineV2Action)4