use of com.amalto.workbench.webservices.WSGetItem 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.WSGetItem in project tmdm-studio-se by Talend.
the class ExportItemsWizard method exportCluster.
protected TreeObject exportCluster(List<TreeObject> exports, WSDataClusterPK pk, TMDMService service) {
String encodedID = null;
try {
List<String> items1 = new ArrayList<String>();
List<WSItemPKsByCriteriaResponseResults> results = service.getItemPKsByCriteria(new WSGetItemPKsByCriteria(null, encodedID, (long) -1, encodedID, encodedID, Integer.MAX_VALUE, 0, (long) -1, pk)).getResults();
if (results == null) {
return null;
}
for (WSItemPKsByCriteriaResponseResults item : results) {
if (item.getWsItemPK().getIds() == null) {
continue;
}
WSItem wsitem = service.getItem(new WSGetItem(item.getWsItemPK()));
// Marshal
StringWriter sw1 = new StringWriter();
Marshaller.marshal(wsitem, sw1);
// $NON-NLS-1$
String uniqueId = pk.getPk() + "." + wsitem.getConceptName();
for (String id : wsitem.getIds()) {
// $NON-NLS-1$
uniqueId = uniqueId + "." + id;
}
// $NON-NLS-1$
encodedID = URLEncoder.encode(uniqueId, "UTF-8");
// $NON-NLS-1$//$NON-NLS-2$
writeString(sw1.toString(), TreeObject.DATACONTAINER_COTENTS + "/" + pk.getPk() + "/" + encodedID);
// $NON-NLS-1$//$NON-NLS-2$
items1.add(TreeObject.DATACONTAINER_COTENTS + "/" + pk.getPk() + "/" + encodedID);
}
TreeObject obj1 = new TreeObject(pk.getPk(), null, TreeObject.DATA_CLUSTER_CONTENTS, null, null);
obj1.setItems(items1.toArray(new String[items1.size()]));
exports.add(obj1);
return obj1;
} catch (Exception e) {
}
return null;
}
Aggregations