Search in sources :

Example 1 with WSCustomFormE

use of org.talend.mdm.repository.model.mdmserverobject.WSCustomFormE in project tmdm-studio-se by Talend.

the class WSCustomFormItemImpl method setCustomForm.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void setCustomForm(WSCustomFormE newCustomForm) {
    WSCustomFormE oldCustomForm = customForm;
    customForm = newCustomForm;
    if (eNotificationRequired()) {
        eNotify(new ENotificationImpl(this, Notification.SET, MdmpropertiesPackage.WS_CUSTOM_FORM_ITEM__CUSTOM_FORM, oldCustomForm, customForm));
    }
}
Also used : WSCustomFormE(org.talend.mdm.repository.model.mdmserverobject.WSCustomFormE) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 2 with WSCustomFormE

use of org.talend.mdm.repository.model.mdmserverobject.WSCustomFormE in project tmdm-studio-se by Talend.

the class WSCustomFormItemImpl method getCustomForm.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public WSCustomFormE getCustomForm() {
    if (customForm != null && customForm.eIsProxy()) {
        InternalEObject oldCustomForm = (InternalEObject) customForm;
        customForm = (WSCustomFormE) eResolveProxy(oldCustomForm);
        if (customForm.eResource() == null && eResource() != null) {
            URI uri = EcoreUtil.getURI(customForm);
            if (uri.hasFragment()) {
                uri = uri.trimFragment();
            }
            Resource resource = eResource().getResourceSet().getResource(uri, true);
            for (EObject object : resource.getContents()) {
                if (object instanceof WSCustomFormE) {
                    customForm = (WSCustomFormE) object;
                    break;
                }
            }
        }
        if (customForm != oldCustomForm) {
            if (eNotificationRequired()) {
                eNotify(new ENotificationImpl(this, Notification.RESOLVE, MdmpropertiesPackage.WS_CUSTOM_FORM_ITEM__CUSTOM_FORM, oldCustomForm, customForm));
            }
        }
    }
    return customForm;
}
Also used : WSCustomFormE(org.talend.mdm.repository.model.mdmserverobject.WSCustomFormE) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) Resource(org.eclipse.emf.ecore.resource.Resource) URI(org.eclipse.emf.common.util.URI) InternalEObject(org.eclipse.emf.ecore.InternalEObject)

Example 3 with WSCustomFormE

use of org.talend.mdm.repository.model.mdmserverobject.WSCustomFormE in project tmdm-studio-se by Talend.

the class RepositoryQueryService method findAllCustomFormPks.

public static List<String> findAllCustomFormPks() {
    List<IRepositoryViewObject> viewObjects = RepositoryResourceUtil.findAllViewObjects(IServerObjectRepositoryType.TYPE_CUSTOM_FORM);
    List<String> names = new LinkedList<String>();
    if (viewObjects != null) {
        for (IRepositoryViewObject viewObj : viewObjects) {
            Item item = viewObj.getProperty().getItem();
            if (item instanceof MDMServerObjectItem) {
                MDMServerObject sObject = ((MDMServerObjectItem) item).getMDMServerObject();
                if (sObject instanceof WSCustomFormE) {
                    WSCustomFormE sForm = (WSCustomFormE) sObject;
                    String name = sForm.getDatamodel() + IConstants.ITEM_PK_SPLIT + sForm.getEntity() + IConstants.ITEM_PK_SPLIT + sForm.getName();
                    if (name != null) {
                        names.add(name);
                    } else {
                        names.add(viewObj.getLabel());
                    }
                }
            }
        // names[i]=viewObj.getLabel();
        }
    }
    return names;
}
Also used : WSCustomFormE(org.talend.mdm.repository.model.mdmserverobject.WSCustomFormE) Item(org.talend.core.model.properties.Item) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) MDMServerObjectItem(org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) LinkedList(java.util.LinkedList) MDMServerObject(org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)

Aggregations

WSCustomFormE (org.talend.mdm.repository.model.mdmserverobject.WSCustomFormE)3 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)2 LinkedList (java.util.LinkedList)1 URI (org.eclipse.emf.common.util.URI)1 EObject (org.eclipse.emf.ecore.EObject)1 InternalEObject (org.eclipse.emf.ecore.InternalEObject)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 Item (org.talend.core.model.properties.Item)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 MDMServerObjectItem (org.talend.mdm.repository.model.mdmproperties.MDMServerObjectItem)1 MDMServerObject (org.talend.mdm.repository.model.mdmserverobject.MDMServerObject)1