use of com.amalto.workbench.webservices.WSBoolean in project tmdm-studio-se by Talend.
the class ViewMainPage method refreshData.
@Override
protected void refreshData() {
try {
if (this.comitting) {
return;
}
this.refreshing = true;
WSView wsObject = getWsViewObject();
// $NON-NLS-1$
desAntionComposite.setText(wsObject.getDescription() == null ? "" : wsObject.getDescription());
btnRunProcess.setSelection(wsObject.getIsTransformerActive().isTrue());
if (btnRunProcess.getSelection()) {
cboProcessList.setEnabled(true);
cboProcessList.setText(wsObject.getTransformerPK());
} else {
cboProcessList.setEnabled(false);
// $NON-NLS-1$
cboProcessList.setText("");
}
// /////////////////////
combox_sortdirection.add(SORTING_DIRECTION[0]);
combox_sortdirection.add(SORTING_DIRECTION[1]);
String sortField = wsObject.getSortField();
WSBoolean ascOrder = wsObject.getIsAsc();
if (sortField == null || sortField.trim().isEmpty()) {
sortField = SORT_FIELD[0];
}
lastSortField = sortField;
String[] policys = { SORT_FIELD[0], SORT_FIELD[1], selectXPath };
if (sortField.equals(SORT_FIELD[0]) || sortField.equals(SORT_FIELD[1])) {
combox_sortdirection.setVisible(false);
} else {
policys = new String[] { SORT_FIELD[0], SORT_FIELD[1], sortField, selectXPath };
combox_sortdirection.setVisible(true);
if (ascOrder == null || ascOrder.isTrue()) {
combox_sortdirection.setText(SORTING_DIRECTION[0]);
} else {
combox_sortdirection.setText(SORTING_DIRECTION[1]);
}
}
combox_policy.setItems(policys);
combox_policy.setText(sortField);
if (adapter != null) {
adapter.refreshData(wsObject);
}
// //////////////////
java.util.List<Line> vlines = new ArrayList<Line>();
java.util.List<String> vis = wsObject.getViewableBusinessElements();
if (vis != null) {
for (String vi : vis) {
String[] strings = new String[] { vi };
Line line = new Line(viewableElementColumns, strings);
vlines.add(line);
}
}
viewableViewer.getViewer().setInput(vlines);
java.util.List<Line> slines = new ArrayList<Line>();
java.util.List<String> ses = wsObject.getSearchableBusinessElements();
if (ses != null) {
for (String se : ses) {
String[] strings = new String[] { se };
Line line = new Line(searchableElementColumns, strings);
slines.add(line);
}
}
searchableViewer.getViewer().setInput(slines);
java.util.List<Line> lines = new ArrayList<Line>();
for (WSWhereCondition wc : wsObject.getWhereConditions()) {
Line line = new Line(conditionsColumns, Util.convertWhereCondition(wc));
lines.add(line);
}
conditionViewer.getViewer().setInput(lines);
this.refreshing = false;
} catch (Exception e) {
log.error(e.getMessage(), e);
MessageDialog.openError(this.getSite().getShell(), Messages.ViewMainPage_ErrorRefreshPage, Messages.bind(Messages.ViewMainPage_ErrorRefreshPageXX, e.getLocalizedMessage()));
}
}
use of com.amalto.workbench.webservices.WSBoolean in project tmdm-studio-se by Talend.
the class ViewMainPage method commit.
@Override
protected void commit() {
try {
if (this.refreshing) {
return;
}
this.comitting = true;
WSView wsObject = getWsViewObject();
wsObject.setDescription(desAntionComposite.getText());
wsObject.setIsTransformerActive(new WSBoolean(btnRunProcess.getSelection()));
wsObject.setTransformerPK(cboProcessList.getText());
String policy = combox_policy.getText();
if (policy.equals(SORT_FIELD[0])) {
policy = null;
}
wsObject.setSortField(policy);
boolean visible = combox_sortdirection.isVisible();
if (visible) {
boolean isAscOrder = combox_sortdirection.getText().equals(SORTING_DIRECTION[0]);
wsObject.setIsAsc(new WSBoolean(isAscOrder));
} else {
wsObject.setIsAsc(null);
}
if (adapter != null) {
adapter.saveData(wsObject);
}
java.util.List<Line> vlines = (java.util.List<Line>) viewableViewer.getViewer().getInput();
wsObject.getViewableBusinessElements().clear();
for (Line item : vlines) {
wsObject.getViewableBusinessElements().add(item.keyValues.get(0).value);
}
java.util.List<Line> slines = (java.util.List<Line>) searchableViewer.getViewer().getInput();
wsObject.getSearchableBusinessElements().clear();
for (Line item : slines) {
wsObject.getSearchableBusinessElements().add(item.keyValues.get(0).value);
}
java.util.List<Line> lines = (java.util.List<Line>) conditionViewer.getViewer().getInput();
java.util.List<WSWhereCondition> wclist = new ArrayList<WSWhereCondition>();
wsObject.getWhereConditions().clear();
for (Line item : lines) {
String[] values = new String[] { item.keyValues.get(0).value, item.keyValues.get(1).value, item.keyValues.get(2).value, item.keyValues.get(3).value };
WSWhereCondition wc = Util.convertLine(values);
wsObject.getWhereConditions().add(wc);
}
this.comitting = false;
} catch (Exception e) {
log.error(e.getMessage(), e);
MessageDialog.openError(this.getSite().getShell(), Messages.ViewMainPage_ErrorCommitPage, Messages.bind(Messages.ViewMainPage_ErrorCommitPageXX, e.getLocalizedMessage()));
}
}
use of com.amalto.workbench.webservices.WSBoolean in project tmdm-studio-se by Talend.
the class AddBrowseItemsWizard method createNewTreeObject.
private TreeObject createNewTreeObject(XSDElementDeclaration decl, String browseItem) {
WSView view = new WSView();
view.setIsTransformerActive(new WSBoolean(false));
// $NON-NLS-1$
view.setTransformerPK("");
view.setName(browseItem);
EList<XSDIdentityConstraintDefinition> idtylist = decl.getIdentityConstraintDefinitions();
List<String> keys = new ArrayList<String>();
for (XSDIdentityConstraintDefinition idty : idtylist) {
EList<XSDXPathDefinition> xpathList = idty.getFields();
for (XSDXPathDefinition path : xpathList) {
String key = decl.getName();
// remove
// $NON-NLS-1$//$NON-NLS-2$
key = key.replaceFirst("#.*", "");
// $NON-NLS-1$
key += "/" + path.getValue();
keys.add(key);
}
}
view.getSearchableBusinessElements().addAll(keys);
view.getViewableBusinessElements().addAll(keys);
StringBuffer desc = new StringBuffer();
LinkedHashMap<String, String> labels = new LinkedHashMap<String, String>();
if (decl.getAnnotation() != null) {
labels = new XSDAnnotationsStructure(decl.getAnnotation()).getLabels();
}
if (labels.size() == 0) {
// $NON-NLS-1$
labels.put("EN", decl.getName());
}
for (String lan : labels.keySet()) {
// $NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
desc.append("[" + lan.toUpperCase() + ":" + labels.get(lan) + "]");
}
view.setDescription(desc.toString());
WSPutView wrap = new WSPutView();
wrap.setWsView(view);
WSViewPK viewPk = new WSViewPK();
viewPk.setPk(browseItem);
WSDeleteView delView = new WSDeleteView();
delView.setWsViewPK(viewPk);
WSGetView getView = new WSGetView();
getView.setWsViewPK(viewPk);
service.putView(wrap);
// add node in the root
TreeParent root = page.getXObject().getServerRoot();
TreeObject obj = new // no storage to save
TreeObject(// no storage to save
browseItem, // no storage to save
root, // no storage to save
TreeObject.VIEW, // no storage to save
viewPk, // no storage to save
null);
return obj;
}
use of com.amalto.workbench.webservices.WSBoolean in project tmdm-studio-se by Talend.
the class DataClusterService method isExistDataCluster.
public boolean isExistDataCluster(TMDMService service, String dName) {
WSExistsDataCluster wsExistsDataCluster = new WSExistsDataCluster(new WSDataClusterPK(dName));
WSBoolean wsBoolean = service.existsDataCluster(wsExistsDataCluster);
return wsBoolean.isTrue();
}
Aggregations