From 0839e777b7e05c81282ca038d499ecc67f1e3e70 Mon Sep 17 00:00:00 2001 From: sohaniwso2 Date: Thu, 8 Mar 2018 10:11:29 +0530 Subject: [PATCH 1/2] Add 'preservePolicy' attribute to publish WSDL This adds the missing attribute 'preservePolicy' to the publish WSDL of the proxy service Public issue - wso2/devstudio-tooling-ei#137 --- .../ProxyServiceDeserializer.java | 8 +++ .../plugin.properties | 1 + .../provider/ProxyServiceItemProvider.java | 31 ++++++++++- .../persistence/ProxyServiceTransformer.java | 30 +++++++++-- .../model/esb.ecore | 2 + .../eclipse/gmf/esb/EsbPackage.java | 42 ++++++++++++--- .../eclipse/gmf/esb/ProxyService.java | 28 ++++++++++ .../eclipse/gmf/esb/impl/EsbPackageImpl.java | 23 +++++--- .../gmf/esb/impl/ProxyServiceImpl.java | 54 +++++++++++++++++++ 9 files changed, 200 insertions(+), 19 deletions(-) diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ProxyServiceDeserializer.java b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ProxyServiceDeserializer.java index 4e3afb387..8b4e46617 100755 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ProxyServiceDeserializer.java +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ProxyServiceDeserializer.java @@ -100,6 +100,14 @@ public org.wso2.developerstudio.eclipse.gmf.esb.ProxyService createNode(IGraphic hasPublishWsdl=false; } + if (object.getPreservePolicy() != null) { + if (object.getPreservePolicy().equals("true")) { + executeSetValueCommand(PROXY_SERVICE__PRESERVE_POLICY, true); + } else { + executeSetValueCommand(PROXY_SERVICE__PRESERVE_POLICY, false); + } + } + Endpoint targetInLineEndpoint = object.getTargetInLineEndpoint(); if(targetInLineEndpoint!=null){ setHasInlineEndPoint(true); diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/plugin.properties b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/plugin.properties index d086165bc..c2c55ef57 100644 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/plugin.properties +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/plugin.properties @@ -2400,3 +2400,4 @@ _UI_APIVersionType_URL_literal = url _UI_InboundEndpoint_transportJMSRetriesBeforeSuspension_feature = Transport JMS Retries Before Suspension _UI_InboundEndpoint_transportJMSResetConnectionOnPollingSuspension_feature = Transport JMS Reset Connection On Polling Suspension _UI_InboundEndpoint_transportJMSPollingSuspensionPeriod_feature = Transport JMS Polling Suspension Period +_UI_ProxyService_preservePolicy_feature = Preserve Policy diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/ProxyServiceItemProvider.java b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/ProxyServiceItemProvider.java index fc1951f7f..11d8d3c39 100644 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/ProxyServiceItemProvider.java +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/ProxyServiceItemProvider.java @@ -98,9 +98,13 @@ public List getPropertyDescriptors(Object object) { break; } } - if (proxy.getWsdlType() != ProxyWsdlType.NONE && proxy.getWsdlType() != ProxyWsdlType.ENDPOINT) { - addWsdlResourcesPropertyDescriptor(object); + if (proxy.getWsdlType() != ProxyWsdlType.NONE) { + addPreservePolicyPropertyDescriptor(object); + if (proxy.getWsdlType() != ProxyWsdlType.ENDPOINT) { + addWsdlResourcesPropertyDescriptor(object); + } } + addInSequenceTypePropertyDescriptor(object); switch (proxy.getInSequenceType()) { case REGISTRY_REFERENCE: { @@ -451,6 +455,28 @@ protected void addWsdlTypePropertyDescriptor(Object object) { null)); } + /** + * This adds a property descriptor for the Preserve Policy feature. + * + * + * @generated NOT + */ + protected void addPreservePolicyPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ProxyService_preservePolicy_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ProxyService_preservePolicy_feature", "_UI_ProxyService_type"), + EsbPackage.Literals.PROXY_SERVICE__PRESERVE_POLICY, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + "WSDL", + null)); + } + /** * This adds a property descriptor for the Wsdl XML feature. * @@ -1037,6 +1063,7 @@ public void notifyChanged(Notification notification) { case EsbPackage.PROXY_SERVICE__ENDPOINT_NAME: case EsbPackage.PROXY_SERVICE__MAIN_SEQUENCE: case EsbPackage.PROXY_SERVICE__WSDL_TYPE: + case EsbPackage.PROXY_SERVICE__PRESERVE_POLICY: case EsbPackage.PROXY_SERVICE__WSDL_XML: case EsbPackage.PROXY_SERVICE__WSDL_URL: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.persistence/src/org/wso2/developerstudio/eclipse/gmf/esb/internal/persistence/ProxyServiceTransformer.java b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.persistence/src/org/wso2/developerstudio/eclipse/gmf/esb/internal/persistence/ProxyServiceTransformer.java index 994a845b4..3ce3d98c5 100644 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.persistence/src/org/wso2/developerstudio/eclipse/gmf/esb/internal/persistence/ProxyServiceTransformer.java +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.persistence/src/org/wso2/developerstudio/eclipse/gmf/esb/internal/persistence/ProxyServiceTransformer.java @@ -408,12 +408,17 @@ private void transformAsProxy(TransformationInfo info, EsbNode subject) throws T break; } - if (visualService.getWsdlType()!=ProxyWsdlType.NONE && visualService.getWsdlType() != ProxyWsdlType.ENDPOINT) { - proxyService.setResourceMap(new ResourceMap()); - for (ProxyWSDLResource wsdlResource : visualService.getWsdlResources()) { - proxyService.getResourceMap().addResource(wsdlResource.getLocation(),wsdlResource.getKey().getKeyValue()); + if (visualService.getWsdlType() != ProxyWsdlType.NONE) { + setPreservePolicyValue(visualService, proxyService); + if (visualService.getWsdlType() != ProxyWsdlType.ENDPOINT) { + proxyService.setResourceMap(new ResourceMap()); + for (ProxyWSDLResource wsdlResource : visualService.getWsdlResources()) { + proxyService.getResourceMap().addResource(wsdlResource.getLocation(), + wsdlResource.getKey().getKeyValue()); + } } } + String pinnedServerInfo = visualService.getPinnedServers(); if (pinnedServerInfo != null && !pinnedServerInfo.equals("")) { for (String a : pinnedServerInfo.split(",")) { @@ -556,6 +561,23 @@ private void transformAsProxy(TransformationInfo info, EsbNode subject) throws T } } + /** + * This sets the preserve policy value + * + * @param visualService + * gmf model proxy service object + * @param proxyService + * synapse proxy service object + */ + private void setPreservePolicyValue(org.wso2.developerstudio.eclipse.gmf.esb.ProxyService visualService, + ProxyService proxyService) { + if (visualService.isPreservePolicy()) { + proxyService.setPreservePolicy("true"); + } else { + proxyService.setPreservePolicy("false"); + } + } + private void transformAsMainSequence(TransformationInfo info, EsbNode subject) throws TransformerException{ // Check subject. Assert.isTrue( diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb/model/esb.ecore b/plugins/org.wso2.developerstudio.eclipse.gmf.esb/model/esb.ecore index 79a604f4f..5ebfc33e8 100644 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb/model/esb.ecore +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb/model/esb.ecore @@ -190,6 +190,8 @@ + Preserve Policy' attribute. + * + * + * @generated + * @ordered + */ + int PROXY_SERVICE__PRESERVE_POLICY = ESB_ELEMENT_FEATURE_COUNT + 34; + /** * The feature id for the 'Wsdl XML' attribute. * @@ -1120,7 +1129,7 @@ public interface EsbPackage extends EPackage { * @generated * @ordered */ - int PROXY_SERVICE__WSDL_XML = ESB_ELEMENT_FEATURE_COUNT + 34; + int PROXY_SERVICE__WSDL_XML = ESB_ELEMENT_FEATURE_COUNT + 35; /** * The feature id for the 'Wsdl URL' attribute. @@ -1129,7 +1138,7 @@ public interface EsbPackage extends EPackage { * @generated * @ordered */ - int PROXY_SERVICE__WSDL_URL = ESB_ELEMENT_FEATURE_COUNT + 35; + int PROXY_SERVICE__WSDL_URL = ESB_ELEMENT_FEATURE_COUNT + 36; /** * The feature id for the 'Wsdl Key' containment reference. @@ -1138,7 +1147,7 @@ public interface EsbPackage extends EPackage { * @generated * @ordered */ - int PROXY_SERVICE__WSDL_KEY = ESB_ELEMENT_FEATURE_COUNT + 36; + int PROXY_SERVICE__WSDL_KEY = ESB_ELEMENT_FEATURE_COUNT + 37; /** * The feature id for the 'Wsdl Endpoint' containment reference. @@ -1147,7 +1156,7 @@ public interface EsbPackage extends EPackage { * @generated * @ordered */ - int PROXY_SERVICE__WSDL_ENDPOINT = ESB_ELEMENT_FEATURE_COUNT + 37; + int PROXY_SERVICE__WSDL_ENDPOINT = ESB_ELEMENT_FEATURE_COUNT + 38; /** * The feature id for the 'Wsdl Resources' containment reference list. @@ -1156,7 +1165,7 @@ public interface EsbPackage extends EPackage { * @generated * @ordered */ - int PROXY_SERVICE__WSDL_RESOURCES = ESB_ELEMENT_FEATURE_COUNT + 38; + int PROXY_SERVICE__WSDL_RESOURCES = ESB_ELEMENT_FEATURE_COUNT + 39; /** * The feature id for the 'On Error' containment reference. @@ -1165,7 +1174,7 @@ public interface EsbPackage extends EPackage { * @generated * @ordered */ - int PROXY_SERVICE__ON_ERROR = ESB_ELEMENT_FEATURE_COUNT + 39; + int PROXY_SERVICE__ON_ERROR = ESB_ELEMENT_FEATURE_COUNT + 40; /** * The number of structural features of the 'Proxy Service' class. @@ -1174,7 +1183,7 @@ public interface EsbPackage extends EPackage { * @generated * @ordered */ - int PROXY_SERVICE_FEATURE_COUNT = ESB_ELEMENT_FEATURE_COUNT + 40; + int PROXY_SERVICE_FEATURE_COUNT = ESB_ELEMENT_FEATURE_COUNT + 41; /** * The meta object id for the '{@link org.wso2.developerstudio.eclipse.gmf.esb.impl.ProxyOutputConnectorImpl Proxy Output Connector}' class. @@ -27491,6 +27500,17 @@ public interface EsbPackage extends EPackage { */ EAttribute getProxyService_WsdlType(); + /** + * Returns the meta object for the attribute '{@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#isPreservePolicy Preserve Policy}'. + * + * + * @return the meta object for the attribute 'Preserve Policy'. + * @see org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#isPreservePolicy() + * @see #getProxyService() + * @generated + */ + EAttribute getProxyService_PreservePolicy(); + /** * Returns the meta object for the attribute '{@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#getWsdlXML Wsdl XML}'. * @@ -45079,6 +45099,14 @@ interface Literals { */ EAttribute PROXY_SERVICE__WSDL_TYPE = eINSTANCE.getProxyService_WsdlType(); + /** + * The meta object literal for the 'Preserve Policy' attribute feature. + * + * + * @generated + */ + EAttribute PROXY_SERVICE__PRESERVE_POLICY = eINSTANCE.getProxyService_PreservePolicy(); + /** * The meta object literal for the 'Wsdl XML' attribute feature. * diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/ProxyService.java b/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/ProxyService.java index c61be51b2..15c900293 100644 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/ProxyService.java +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/ProxyService.java @@ -52,6 +52,7 @@ *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#getEndpointName Endpoint Name}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#isMainSequence Main Sequence}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#getWsdlType Wsdl Type}
  • + *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#isPreservePolicy Preserve Policy}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#getWsdlXML Wsdl XML}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#getWsdlURL Wsdl URL}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#getWsdlKey Wsdl Key}
  • @@ -939,6 +940,33 @@ public interface ProxyService extends EsbElement { */ void setWsdlType(ProxyWsdlType value); + /** + * Returns the value of the 'Preserve Policy' attribute. + * The default value is "true". + * + *

    + * If the meaning of the 'Preserve Policy' attribute isn't clear, + * there really should be more of a description here... + *

    + * + * @return the value of the 'Preserve Policy' attribute. + * @see #setPreservePolicy(boolean) + * @see org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage#getProxyService_PreservePolicy() + * @model default="true" + * @generated + */ + boolean isPreservePolicy(); + + /** + * Sets the value of the '{@link org.wso2.developerstudio.eclipse.gmf.esb.ProxyService#isPreservePolicy Preserve Policy}' attribute. + * + * + * @param value the new value of the 'Preserve Policy' attribute. + * @see #isPreservePolicy() + * @generated + */ + void setPreservePolicy(boolean value); + /** * Returns the value of the 'Wsdl XML' attribute. * The default value is "". diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/EsbPackageImpl.java b/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/EsbPackageImpl.java index 00ace9626..b66e4d39a 100644 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/EsbPackageImpl.java +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/EsbPackageImpl.java @@ -4809,7 +4809,7 @@ public EAttribute getProxyService_WsdlType() { * * @generated */ - public EAttribute getProxyService_WsdlXML() { + public EAttribute getProxyService_PreservePolicy() { return (EAttribute)proxyServiceEClass.getEStructuralFeatures().get(34); } @@ -4818,17 +4818,26 @@ public EAttribute getProxyService_WsdlXML() { * * @generated */ - public EAttribute getProxyService_WsdlURL() { + public EAttribute getProxyService_WsdlXML() { return (EAttribute)proxyServiceEClass.getEStructuralFeatures().get(35); } + /** + * + * + * @generated + */ + public EAttribute getProxyService_WsdlURL() { + return (EAttribute)proxyServiceEClass.getEStructuralFeatures().get(36); + } + /** * * * @generated */ public EReference getProxyService_WsdlKey() { - return (EReference)proxyServiceEClass.getEStructuralFeatures().get(36); + return (EReference)proxyServiceEClass.getEStructuralFeatures().get(37); } /** @@ -4837,7 +4846,7 @@ public EReference getProxyService_WsdlKey() { * @generated */ public EReference getProxyService_WsdlEndpoint() { - return (EReference)proxyServiceEClass.getEStructuralFeatures().get(37); + return (EReference)proxyServiceEClass.getEStructuralFeatures().get(38); } /** @@ -4846,7 +4855,7 @@ public EReference getProxyService_WsdlEndpoint() { * @generated */ public EReference getProxyService_WsdlResources() { - return (EReference)proxyServiceEClass.getEStructuralFeatures().get(38); + return (EReference)proxyServiceEClass.getEStructuralFeatures().get(39); } /** @@ -4855,7 +4864,7 @@ public EReference getProxyService_WsdlResources() { * @generated */ public EReference getProxyService_OnError() { - return (EReference)proxyServiceEClass.getEStructuralFeatures().get(39); + return (EReference)proxyServiceEClass.getEStructuralFeatures().get(40); } /** @@ -19108,6 +19117,7 @@ public void createPackageContents() { createEAttribute(proxyServiceEClass, PROXY_SERVICE__ENDPOINT_NAME); createEAttribute(proxyServiceEClass, PROXY_SERVICE__MAIN_SEQUENCE); createEAttribute(proxyServiceEClass, PROXY_SERVICE__WSDL_TYPE); + createEAttribute(proxyServiceEClass, PROXY_SERVICE__PRESERVE_POLICY); createEAttribute(proxyServiceEClass, PROXY_SERVICE__WSDL_XML); createEAttribute(proxyServiceEClass, PROXY_SERVICE__WSDL_URL); createEReference(proxyServiceEClass, PROXY_SERVICE__WSDL_KEY); @@ -21511,6 +21521,7 @@ public void initializePackageContents() { initEAttribute(getProxyService_EndpointName(), ecorePackage.getEString(), "endpointName", null, 0, 1, ProxyService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getProxyService_MainSequence(), ecorePackage.getEBoolean(), "mainSequence", null, 0, 1, ProxyService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getProxyService_WsdlType(), this.getProxyWsdlType(), "wsdlType", "NONE", 0, 1, ProxyService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getProxyService_PreservePolicy(), ecorePackage.getEBoolean(), "preservePolicy", "true", 0, 1, ProxyService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getProxyService_WsdlXML(), ecorePackage.getEString(), "wsdlXML", "", 0, 1, ProxyService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getProxyService_WsdlURL(), ecorePackage.getEString(), "wsdlURL", "http://default/wsdl/url", 0, 1, ProxyService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getProxyService_WsdlKey(), this.getRegistryKeyProperty(), null, "wsdlKey", null, 0, 1, ProxyService.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/ProxyServiceImpl.java b/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/ProxyServiceImpl.java index 745befafe..fac8d63cf 100644 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/ProxyServiceImpl.java +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb/src/org/wso2/developerstudio/eclipse/gmf/esb/impl/ProxyServiceImpl.java @@ -90,6 +90,7 @@ *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.impl.ProxyServiceImpl#getEndpointName Endpoint Name}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.impl.ProxyServiceImpl#isMainSequence Main Sequence}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.impl.ProxyServiceImpl#getWsdlType Wsdl Type}
  • + *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.impl.ProxyServiceImpl#isPreservePolicy Preserve Policy}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.impl.ProxyServiceImpl#getWsdlXML Wsdl XML}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.impl.ProxyServiceImpl#getWsdlURL Wsdl URL}
  • *
  • {@link org.wso2.developerstudio.eclipse.gmf.esb.impl.ProxyServiceImpl#getWsdlKey Wsdl Key}
  • @@ -631,6 +632,26 @@ public class ProxyServiceImpl extends EsbElementImpl implements ProxyService { */ protected ProxyWsdlType wsdlType = WSDL_TYPE_EDEFAULT; + /** + * The default value of the '{@link #isPreservePolicy() Preserve Policy}' attribute. + * + * + * @see #isPreservePolicy() + * @generated + * @ordered + */ + protected static final boolean PRESERVE_POLICY_EDEFAULT = true; + + /** + * The cached value of the '{@link #isPreservePolicy() Preserve Policy}' attribute. + * + * + * @see #isPreservePolicy() + * @generated + * @ordered + */ + protected boolean preservePolicy = PRESERVE_POLICY_EDEFAULT; + /** * The default value of the '{@link #getWsdlXML() Wsdl XML}' attribute. * @@ -1757,6 +1778,27 @@ public void setWsdlType(ProxyWsdlType newWsdlType) { eNotify(new ENotificationImpl(this, Notification.SET, EsbPackage.PROXY_SERVICE__WSDL_TYPE, oldWsdlType, wsdlType)); } + /** + * + * + * @generated + */ + public boolean isPreservePolicy() { + return preservePolicy; + } + + /** + * + * + * @generated + */ + public void setPreservePolicy(boolean newPreservePolicy) { + boolean oldPreservePolicy = preservePolicy; + preservePolicy = newPreservePolicy; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EsbPackage.PROXY_SERVICE__PRESERVE_POLICY, oldPreservePolicy, preservePolicy)); + } + /** * * @@ -2068,6 +2110,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) { return isMainSequence(); case EsbPackage.PROXY_SERVICE__WSDL_TYPE: return getWsdlType(); + case EsbPackage.PROXY_SERVICE__PRESERVE_POLICY: + return isPreservePolicy(); case EsbPackage.PROXY_SERVICE__WSDL_XML: return getWsdlXML(); case EsbPackage.PROXY_SERVICE__WSDL_URL: @@ -2199,6 +2243,9 @@ public void eSet(int featureID, Object newValue) { case EsbPackage.PROXY_SERVICE__WSDL_TYPE: setWsdlType((ProxyWsdlType)newValue); return; + case EsbPackage.PROXY_SERVICE__PRESERVE_POLICY: + setPreservePolicy((Boolean)newValue); + return; case EsbPackage.PROXY_SERVICE__WSDL_XML: setWsdlXML((String)newValue); return; @@ -2333,6 +2380,9 @@ public void eUnset(int featureID) { case EsbPackage.PROXY_SERVICE__WSDL_TYPE: setWsdlType(WSDL_TYPE_EDEFAULT); return; + case EsbPackage.PROXY_SERVICE__PRESERVE_POLICY: + setPreservePolicy(PRESERVE_POLICY_EDEFAULT); + return; case EsbPackage.PROXY_SERVICE__WSDL_XML: setWsdlXML(WSDL_XML_EDEFAULT); return; @@ -2432,6 +2482,8 @@ public boolean eIsSet(int featureID) { return mainSequence != MAIN_SEQUENCE_EDEFAULT; case EsbPackage.PROXY_SERVICE__WSDL_TYPE: return wsdlType != WSDL_TYPE_EDEFAULT; + case EsbPackage.PROXY_SERVICE__PRESERVE_POLICY: + return preservePolicy != PRESERVE_POLICY_EDEFAULT; case EsbPackage.PROXY_SERVICE__WSDL_XML: return WSDL_XML_EDEFAULT == null ? wsdlXML != null : !WSDL_XML_EDEFAULT.equals(wsdlXML); case EsbPackage.PROXY_SERVICE__WSDL_URL: @@ -2497,6 +2549,8 @@ public String toString() { result.append(mainSequence); result.append(", wsdlType: "); result.append(wsdlType); + result.append(", preservePolicy: "); + result.append(preservePolicy); result.append(", wsdlXML: "); result.append(wsdlXML); result.append(", wsdlURL: "); From 53a573d80dd345e80cf4f054d916d6e0b4cc5efd Mon Sep 17 00:00:00 2001 From: sohaniwso2 Date: Thu, 8 Mar 2018 11:24:40 +0530 Subject: [PATCH 2/2] Handle deserializing the attribute --- .../custom/deserializer/ProxyServiceDeserializer.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ProxyServiceDeserializer.java b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ProxyServiceDeserializer.java index 8b4e46617..1dcffe6e4 100755 --- a/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ProxyServiceDeserializer.java +++ b/plugins/org.wso2.developerstudio.eclipse.gmf.esb.diagram/src/org/wso2/developerstudio/eclipse/gmf/esb/diagram/custom/deserializer/ProxyServiceDeserializer.java @@ -100,12 +100,10 @@ public org.wso2.developerstudio.eclipse.gmf.esb.ProxyService createNode(IGraphic hasPublishWsdl=false; } - if (object.getPreservePolicy() != null) { - if (object.getPreservePolicy().equals("true")) { - executeSetValueCommand(PROXY_SERVICE__PRESERVE_POLICY, true); - } else { - executeSetValueCommand(PROXY_SERVICE__PRESERVE_POLICY, false); - } + if("false".equals(object.getPreservePolicy())){ + executeSetValueCommand(PROXY_SERVICE__PRESERVE_POLICY, false); + } else { + executeSetValueCommand(PROXY_SERVICE__PRESERVE_POLICY, true); } Endpoint targetInLineEndpoint = object.getTargetInLineEndpoint();