use of com.amalto.workbench.webservices.WSFindAllDroppedItemsPKs 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