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;
}
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);
}
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);
}
}
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;
}
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);
}
Aggregations