use of org.talend.mdm.repository.model.mdmserverobject.WSDataModelE in project tmdm-studio-se by Talend.
the class WSDataModelItemImpl method getWsDataModel.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public WSDataModelE getWsDataModel() {
if (wsDataModel != null && wsDataModel.eIsProxy()) {
InternalEObject oldWsDataModel = (InternalEObject) wsDataModel;
wsDataModel = (WSDataModelE) eResolveProxy(oldWsDataModel);
if (wsDataModel.eResource() == null && eResource() != null) {
URI uri = EcoreUtil.getURI(wsDataModel);
if (uri.hasFragment()) {
uri = uri.trimFragment();
}
Resource resource = eResource().getResourceSet().getResource(uri, true);
for (EObject object : resource.getContents()) {
if (object instanceof WSDataModelE) {
wsDataModel = (WSDataModelE) object;
break;
}
}
}
if (wsDataModel != oldWsDataModel) {
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.RESOLVE, MdmpropertiesPackage.WS_DATA_MODEL_ITEM__WS_DATA_MODEL, oldWsDataModel, wsDataModel));
}
}
}
return wsDataModel;
}
use of org.talend.mdm.repository.model.mdmserverobject.WSDataModelE in project tmdm-studio-se by Talend.
the class NewDataModelAction method createServerObject.
@Override
protected Item createServerObject(String key) {
WSDataModelItem item = MdmpropertiesFactory.eINSTANCE.createWSDataModelItem();
ItemState itemState = PropertiesFactory.eINSTANCE.createItemState();
item.setState(itemState);
//
WSDataModelE dataModel = newBlankDataModel(key);
item.setWsDataModel(dataModel);
if (parentItem != null) {
item.getState().setPath(parentItem.getState().getPath());
RepositoryResourceUtil.createItem(item, key);
createERDocument(item);
createMatchRuleMapInfo(item);
}
if (needCreateDataContainer) {
createDataContainerObject(key);
}
return item;
}
use of org.talend.mdm.repository.model.mdmserverobject.WSDataModelE in project tmdm-studio-se by Talend.
the class MDMRepositoryViewServiceExt method getDataModelXsd.
public XSDSchema getDataModelXsd(TreeObject pObject, String filter, String dataModelName) {
WSDataModelE wsDataModel = RepositoryQueryService.findDataModelByName(dataModelName);
XSDSchema xsd = null;
if (wsDataModel != null) {
try {
String schema = wsDataModel.getXsdSchema();
xsd = Util.createXsdSchema(schema, pObject);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
return xsd;
}
use of org.talend.mdm.repository.model.mdmserverobject.WSDataModelE in project tmdm-studio-se by Talend.
the class RepositoryResourceUtil method getBusinessConceptKey.
public static WSConceptKey getBusinessConceptKey(WSGetBusinessConceptKey businessConcepKey) throws XtentisException {
String pk = businessConcepKey.getWsDataModelPK().getPk();
String concept = businessConcepKey.getConcept();
WSDataModelE dataModel = RepositoryQueryService.findDataModelByName(pk);
if (dataModel != null) {
try {
XSDSchema xsdSchema = Util.getXSDSchema(dataModel.getXsdSchema());
for (XSDIdentityConstraintDefinition idDef : xsdSchema.getIdentityConstraintDefinitions()) {
if (idDef.getName().equals(concept)) {
WSConceptKey key = new WSConceptKey();
//
XSDXPathDefinition selector = idDef.getSelector();
key.setSelector(selector.getValue());
//
EList<XSDXPathDefinition> fields = idDef.getFields();
List<String> keyFields = new ArrayList<String>();
for (XSDXPathDefinition pathDef : fields) {
keyFields.add(pathDef.getValue());
}
key.getFields().clear();
key.getFields().addAll(keyFields);
return key;
}
}
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
return null;
}
use of org.talend.mdm.repository.model.mdmserverobject.WSDataModelE in project tmdm-studio-se by Talend.
the class UserSecurityComboBoxDialogCellEditor method getSchemaFromRepository.
private String getSchemaFromRepository() {
String schema = null;
WSDataModelE wsDataModel = RepositoryQueryService.findDataModelByName(dataModelName);
if (wsDataModel != null) {
schema = wsDataModel.getXsdSchema();
}
return schema;
}
Aggregations