use of com.amalto.workbench.webservices.WSItemPK in project tmdm-studio-se by Talend.
the class TestTriggerAction method test.
protected void test() {
try {
String dataCluster = dialog.getDataContainer();
String concept = dialog.getConcept();
String[] recordIds = dialog.getRecordIds();
if (recordIds == null || recordIds.length == 0) {
MessageDialog.openError(getShell(), Messages._Error, Messages.RoutingRuleMainPage2_NoRecordSelected);
return;
}
WSRoutingRulePKArray routeItemV2 = service.routeItemV2(new WSRouteItemV2(new WSItemPK(concept, Arrays.asList(recordIds), new WSDataClusterPK(dataCluster))));
if (routeItemV2 == null || routeItemV2.getWsRoutingRulePKs() == null || routeItemV2.getWsRoutingRulePKs().size() == 0) {
MessageDialog.openInformation(getShell(), Messages.RoutingRuleMainPage2_Success, Messages.RoutingRuleMainPage2_noTriggerExecuted);
return;
}
List<WSRoutingRulePK> wsRoutingRulePKs = routeItemV2.getWsRoutingRulePKs();
StringBuilder builder = new StringBuilder(wsRoutingRulePKs.get(0).getPk());
for (int i = 1; i < wsRoutingRulePKs.size(); i++) {
// $NON-NLS-1$
builder.append("," + wsRoutingRulePKs.get(i).getPk());
}
MessageDialog.openInformation(getShell(), Messages.RoutingRuleMainPage2_Success, Messages.bind(Messages.RoutingRuleMainPage2_ExecuteTriggerSuccess, builder.toString()));
} catch (Exception e) {
log.error(e.getMessage(), e);
MessageDialog.openError(getShell(), Messages._Error, Messages.RoutingRuleMainPage2_ErrorTestTrigger);
}
}
use of com.amalto.workbench.webservices.WSItemPK in project tmdm-studio-se by Talend.
the class DataClusterDialog method showInTextWidget.
private void showInTextWidget(LineItem lineItem) {
if (lineItem == null) {
// $NON-NLS-1$
textViewer.setText("");
// $NON-NLS-1$
recordContent = "";
return;
}
try {
final TMDMService service = Util.getMDMService(model);
final WSItem wsItem = service.getItem(new WSGetItem(new WSItemPK(lineItem.getConcept().trim(), Arrays.asList(lineItem.getIds()), (WSDataClusterPK) model.getWsKey())));
recordContent = Util.formatXsdSource(wsItem.getContent());
textViewer.setText(recordContent);
} catch (WebServiceException e) {
log.error(e.getMessage(), e);
} catch (XtentisException e) {
log.error(e.getMessage(), e);
MessageDialog.openError(getShell(), Messages._Error, Messages.bind(Messages.DataClusterBrowserMainPage_36, e.getLocalizedMessage()));
}
}
use of com.amalto.workbench.webservices.WSItemPK in project tmdm-studio-se by Talend.
the class ItemsTrashBrowserMainPage method getResults.
protected LineItem[] getResults(boolean showResultInfo) {
Cursor waitCursor = null;
try {
Display display = getEditor().getSite().getPage().getWorkbenchWindow().getWorkbench().getDisplay();
waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
this.getSite().getShell().setCursor(waitCursor);
TMDMService service = Util.getMDMService(getXObject());
String search = searchText.getText();
List<WSDroppedItemPK> results = null;
if (search != null && search.length() > 0) {
results = service.findAllDroppedItemsPKs(new WSFindAllDroppedItemsPKs(search)).getWsDroppedItemPK();
}
if ((results == null) || (results.isEmpty())) {
if (showResultInfo) {
MessageDialog.openInformation(this.getSite().getShell(), Messages.ItemsTrashBrowserMainPage_15, Messages.ItemsTrashBrowserMainPage_16);
return new LineItem[0];
}
} else {
LineItem[] res = new LineItem[results.size()];
for (int i = 0; i < results.size(); i++) {
WSDroppedItemPK wsDroppedItemPK = results.get(i);
WSItemPK refWSItemPK = wsDroppedItemPK.getWsItemPK();
// if(revison==null||revison.equals(""))revison="head";
res[i] = new LineItem(refWSItemPK.getWsDataClusterPK().getPk(), refWSItemPK.getConceptName(), refWSItemPK.getIds().toArray(new String[0]), null, wsDroppedItemPK.getPartPath());
}
return res;
}
return new LineItem[0];
} catch (Exception e) {
log.error(e.getMessage(), e);
if ((e.getLocalizedMessage() != null) && e.getLocalizedMessage().contains("10000")) {
MessageDialog.openError(this.getSite().getShell(), Messages.ItemsTrashBrowserMainPage_17, Messages.ItemsTrashBrowserMainPage_18);
} else {
if (!Util.handleConnectionException(this, e, null)) {
MessageDialog.openError(this.getSite().getShell(), Messages.ItemsTrashBrowserMainPage_19, e.getLocalizedMessage());
}
}
return null;
} finally {
try {
this.getSite().getShell().setCursor(null);
waitCursor.dispose();
} catch (Exception e) {
}
}
}
Aggregations