use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.
the class Util method getForeingKeyInDataModel.
/**
* set the list with all the foreign concepty name in the parent
*
* @author ymli
* @param list
* @param parent
* @throws Exception
*/
public static void getForeingKeyInDataModel(Set<String> list, TreeParent parent, TMDMService service) throws Exception {
TreeObject[] children = parent.getChildren();
for (TreeObject object : children) {
if (object instanceof TreeParent) {
getForeingKeyInDataModel(list, (TreeParent) object, service);
continue;
}
WSDataModel wsDataModel = service.getDataModel(new WSGetDataModel(new WSDataModelPK(object.getDisplayName())));
XSDSchema xsd = Util.createXsdSchema(wsDataModel.getXsdSchema(), object);
getForeingKeyInSchema(list, xsd);
}
}
use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.
the class Util method getXSDSchema.
public static XSDSchema getXSDSchema(TreeObject treeObj, String dataModelName) {
TreeObject dataModelFolder = treeObj.findServerFolder(TreeObject.DATA_MODEL);
TMDMService port = null;
try {
port = Util.getMDMService(dataModelFolder);
} catch (XtentisException e3) {
log.error(e3.getMessage(), e3);
} catch (Exception e3) {
log.error(e3.getMessage(), e3);
}
WSDataModel wsDataModel = null;
try {
wsDataModel = port.getDataModel(new WSGetDataModel(new WSDataModelPK(dataModelName)));
String schema = wsDataModel.getXsdSchema();
return Util.createXsdSchema(schema, dataModelFolder);
} catch (Exception e1) {
log.error(e1.getMessage(), e1);
}
return null;
}
use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.
the class ComplexTableViewerR method creatTextPortion.
@Override
protected void creatTextPortion(Composite textParent, ComplexTableViewerColumn column) {
Composite righComposite = toolkit.createComposite(textParent, SWT.NONE);
righComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
GridLayout layout = new GridLayout(1, false);
layout.marginHeight = 0;
righComposite.setLayout(layout);
Button readRecordButton = toolkit.createButton(righComposite, Messages.ComplexTableViewerR_PickRecordFromContainer, SWT.PUSH | SWT.CENTER);
readRecordButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
DataClusterDialog dialog = new DataClusterDialog(site.getShell(), new TreeObject(), site);
dialog.create();
Point size = dialog.getShell().getSize();
Rectangle clientArea = Display.getCurrent().getClientArea();
int locx = clientArea.x + (clientArea.width - size.x) / 2;
int locy = clientArea.y + (clientArea.height - size.y) / 2;
dialog.getShell().setLocation(locx, locy);
if (dialog.open() == Dialog.OK) {
String recordContent = dialog.getRecordContent();
if (recordContent != null && recordContent.trim().length() > 0)
text.setText(recordContent);
}
}
public void widgetDefaultSelected(SelectionEvent e) {
//
}
});
readRecordButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1));
super.creatTextPortion(righComposite, column);
}
use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.
the class Util method getCachedXObjectsNameSet.
/**
* @deprecated using getChildren(TreeParent xObject,int objectType)
* @param xObject
* @param objectType
* @return
*/
@Deprecated
public static List<String> getCachedXObjectsNameSet(TreeObject xObject, int objectType) {
List<String> xObjectsNameSet = new ArrayList<String>();
if (xObject != null) {
TreeParent treeNode = xObject.findServerFolder(objectType);
TreeObject[] xObjectsSet = treeNode.getChildren();
for (TreeObject element : xObjectsSet) {
xObject = element;
String xObjectName = xObject.getDisplayName();
xObjectsNameSet.add(xObjectName);
}
}
return xObjectsNameSet;
}
use of com.amalto.workbench.models.TreeObject in project tmdm-studio-se by Talend.
the class Util method getChildren.
public static List<String> getChildren(TreeParent xObject, int objectType) {
List<String> objs = new ArrayList<String>();
for (TreeObject obj : xObject.getChildren()) {
if (obj instanceof TreeParent) {
TreeParent parent = (TreeParent) obj;
objs.addAll(getChildren(parent, objectType));
} else {
if (obj.getType() == objectType) {
objs.add(obj.getDisplayName());
}
}
}
return objs;
}
Aggregations