[jbosstools-commits] JBoss Tools SVN: r41844 - in branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core: resources/meta and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Jun 8 17:47:46 EDT 2012


Author: scabanovich
Date: 2012-06-08 17:47:46 -0400 (Fri, 08 Jun 2012)
New Revision: 41844

Added:
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/MessageFlowPriorityConverter.java
Modified:
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb-attrs.properties
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb131.meta
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBCustomizedObjectImpl.java
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBLoaderUtil.java
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java
   branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java
Log:
JBIDE-11868
https://issues.jboss.org/browse/JBIDE-11868
Field editor 'Message Flow Priority' added to forms for service/bus/provider/listener elements.
Merge to 3.3.x

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb-attrs.properties
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb-attrs.properties	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/help/keys-esb-attrs.properties	2012-06-08 21:47:46 UTC (rev 41844)
@@ -98,6 +98,7 @@
 ESB.jndi_context_factory=Jndi Context Factory
 ESB.jndi_pkg_prefix=Jndi Pkg Prefix
 ESB.jndi_url=Jndi URL
+ESB.message_flow_priority=Message Flow Priority
 ESB.channel_id_ref=Channel ID Ref
 ESB.max_threads=Max Threads
 ESB.is_gateway=Is Gateway

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta	2012-06-08 21:47:46 UTC (rev 41844)
@@ -293,6 +293,23 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="id" xmlname="busid"/>
+   <XModelAttribute PROPERTIES="category=advanced;pre=true"
+    name="message flow priority" xmlname="messageFlowPriority">
+    <Constraint loader="List">
+     <value/>
+     <value name="0"/>
+     <value name="1"/>
+     <value name="2"/>
+     <value name="3"/>
+     <value name="4"/>
+     <value name="5"/>
+     <value name="6"/>
+     <value name="7"/>
+     <value name="8"/>
+     <value name="9"/>
+    </Constraint>
+    <Editor name="List"/>
+   </XModelAttribute>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -352,6 +369,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="name" xmlname="name"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -430,6 +449,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="id" xmlname="busid"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -470,6 +491,8 @@
    <XModelAttributeReference
     attributes="poll frequency seconds,schedule frequency,schedule id ref"
     entity="ESBScheduledListener101" name="scheduled listener"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -597,6 +620,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="name" xmlname="name"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -639,6 +664,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="id" xmlname="busid"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -794,6 +821,8 @@
     name="name" xmlname="name"/>
    <XModelAttribute PROPERTIES="category=general;save=always"
     name="hostname" xmlname="hostname"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -838,6 +867,8 @@
     entity="ESBListener101" name="listener"/>
    <XModelAttribute PROPERTIES="category=general;save=always"
     name="script" xmlname="script"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -994,6 +1025,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="id" xmlname="busid"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -1039,6 +1072,8 @@
    <XModelAttributeReference
     attributes="name,channel id ref,max threads,is gateway"
     entity="ESBListener101" name="listener"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -1124,6 +1159,8 @@
     name="name" xmlname="name"/>
    <XModelAttribute PROPERTIES="category=general;save=always"
     name="hibernate cfg file" xmlname="hibernate-cfg-file"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -1378,6 +1415,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=advanced"
     name="provider adapter JNDI" xmlname="providerAdapterJNDI"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -1414,6 +1453,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="id" xmlname="busid"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -1577,6 +1618,8 @@
    <XModelAttribute PROPERTIES="category=advanced"
     name="jndi pkg prefix" xmlname="jndi-pkg-prefix"/>
    <XModelAttribute PROPERTIES="category=advanced" name="jndi url" xmlname="jndi-URL"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -2169,6 +2212,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="id" xmlname="busid"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -2299,6 +2344,8 @@
    <XModelAttribute PROPERTIES="category=advanced" name="password" xmlname="password"/>
    <XModelAttributeReference attributes="transacted"
     entity="ESBScheduledListener101" name="transacted"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -2371,6 +2418,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="name" xmlname="name"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -2452,6 +2501,8 @@
     </Constraint>
     <Editor name="ListString"/>
    </XModelAttribute>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -2784,6 +2835,8 @@
    <XModelAttribute PROPERTIES="category=advanced" name="handler class" xmlname="handlerClass">
     <Constraint loader="%IntEL%"/>
    </XModelAttribute>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta	2012-06-08 21:47:46 UTC (rev 41844)
@@ -349,6 +349,8 @@
    <XModelAttributeReference
     attributes="poll frequency seconds,schedule frequency,schedule id ref"
     entity="ESBScheduledListener101" name="scheduled listener"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -487,6 +489,8 @@
     </Constraint>
     <Editor name="ListString"/>
    </XModelAttribute>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -533,6 +537,8 @@
     </Constraint>
     <Editor name="ListString"/>
    </XModelAttribute>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -570,6 +576,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="name" xmlname="name"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -616,6 +624,8 @@
     name="port" xmlname="port">
     <Constraint loader="%IntEL%"/>
    </XModelAttribute>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -695,6 +705,8 @@
    <XModelAttributeReference
     attributes="name,channel id ref,max threads,is gateway"
     entity="ESBListener101" name="listener"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -743,6 +755,8 @@
     <Editor name="List"/>
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general" name="host" xmlname="host"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -803,6 +817,8 @@
     </Constraint>
     <Editor name="ListString"/>
    </XModelAttribute>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -838,6 +854,8 @@
    <XModelAttributeReference
     attributes="name,channel id ref,max threads,is gateway"
     entity="ESBListener101" name="listener"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -1130,6 +1148,8 @@
     entity="ESBListener101" name="listener"/>
    <XModelAttributeReference attributes="poll frequency seconds"
     entity="ESBScheduledListener101" name="scheduled listener"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb13.meta	2012-06-08 21:47:46 UTC (rev 41844)
@@ -105,6 +105,8 @@
     <Editor name="ListString"/>
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=advanced" name="timeout" xmlname="timeout"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -158,6 +160,8 @@
     <Editor name="ListString"/>
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=advanced" name="timeout" xmlname="timeout"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -201,6 +205,8 @@
    </XModelAttribute>
    <XModelAttribute PROPERTIES="category=general;id=true;save=always"
     name="name" xmlname="name"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
@@ -289,11 +295,13 @@
     attributes="name,channel id ref,max threads,is gateway"
     entity="ESBListener101" name="listener"/>
    <XModelAttribute PROPERTIES="category=advanced" name="client id" xmlname="clientId"/>
+   <XModelAttribute PROPERTIES="category=advanced"
+    name="durable subscription name" xmlname="durableSubscriptionName"/>
+   <XModelAttributeReference attributes="message flow priority"
+    entity="ESBBus" name="message flow priority"/>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>
-   <XModelAttribute PROPERTIES="category=advanced"
-    name="durable subscription name" xmlname="durableSubscriptionName"/>
   </XModelAttributes>
   <XActionItem kind="list">
    <XActionItem kind="list" name="CreateActions">

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb131.meta
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb131.meta	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb131.meta	2012-06-08 21:47:46 UTC (rev 41844)
@@ -47,6 +47,23 @@
     </Constraint>
     <Editor name="ListString"/>
    </XModelAttribute>
+   <XModelAttribute PROPERTIES="category=advanced;pre=true"
+    name="message flow priority" xmlname="messageFlowPriority">
+    <Constraint loader="List">
+     <value name=""/>
+     <value name="0"/>
+     <value name="1"/>
+     <value name="2"/>
+     <value name="3"/>
+     <value name="4"/>
+     <value name="5"/>
+     <value name="6"/>
+     <value name="7"/>
+     <value name="8"/>
+     <value name="9"/>
+    </Constraint>
+    <Editor name="List"/>
+   </XModelAttribute>
    <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
     <Editor name="Note"/>
    </XModelAttribute>

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBConstants.java	2012-06-08 21:47:46 UTC (rev 41844)
@@ -195,5 +195,7 @@
 	public String ATTR_SCHEDULE_ID = "schedule id"; //$NON-NLS-1$
 	public String ATTR_SCHEDULE_ID_REF = "schedule id ref"; //$NON-NLS-1$
 
+	public String ATTR_MESSAGE_FLOW_PRIORITY = "message flow priority"; //$NON-NLS-1$
+
 	public String XML_ATTR_PROTECTED_METHODS = "protected-methods"; //$NON-NLS-1$
 }

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBCustomizedObjectImpl.java
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBCustomizedObjectImpl.java	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBCustomizedObjectImpl.java	2012-06-08 21:47:46 UTC (rev 41844)
@@ -10,6 +10,8 @@
  ******************************************************************************/ 
 package org.jboss.tools.esb.core.model;
 
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
 import org.jboss.tools.common.model.impl.CustomizedObjectImpl;
 import org.jboss.tools.common.model.impl.OrderedByEntityChildren;
 import org.jboss.tools.common.model.impl.RegularChildren;
@@ -33,4 +35,33 @@
     	return super.createChildren();    	
     }
 
+    public boolean isAttributeEditable(String name) {
+    	if(ESBConstants.ATTR_MESSAGE_FLOW_PRIORITY.equals(name)) {
+    		String entity = getModelEntity().getName();
+    		if(entity.startsWith(ESBConstants.ENT_ESB_SERVICE)) {
+    			XModelObject as = getChildByPath("Actions");
+    			if(as != null) {
+    				String inxsd = as.getAttributeValue("in xsd");
+    				if(inxsd == null || inxsd.length() == 0 || "false".equals(as.getAttributeValue("webservice"))) {
+    					return false;
+    				}
+    			}
+    		}
+    		if(getModelEntity().getAttribute("is gateway") != null && !"true".equals(getAttributeValue("is gateway"))) {
+    			return false;
+    		}
+    		XModelObject p = FileSystemsHelper.getFile(this);
+    		if(p != null) {
+    			String fileEntity = p.getModelEntity().getName();
+    			if(ESBConstants.ENT_ESB_FILE_101.equals(fileEntity)
+    				|| ESBConstants.ENT_ESB_FILE_110.equals(fileEntity)
+    				|| ESBConstants.ENT_ESB_FILE_120.equals(fileEntity)
+    				|| ESBConstants.ENT_ESB_FILE_130.equals(fileEntity)) {
+    				return false;
+    			}
+    		}
+    	}
+    	return super.isAttributeEditable(name);
+    }
+
 }

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBLoaderUtil.java
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBLoaderUtil.java	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBLoaderUtil.java	2012-06-08 21:47:46 UTC (rev 41844)
@@ -18,6 +18,7 @@
 import org.jboss.tools.common.model.XModelObject;
 import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
 import org.jboss.tools.common.xml.XMLUtilities;
+import org.jboss.tools.esb.core.model.converters.MessageFlowPriorityConverter;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -56,7 +57,8 @@
 		String entity = o.getModelEntity().getName();
 		if(SpecificActionLoader.instance.isActionsFolder(entity)) {
 			SpecificActionLoader.instance.convertChildrenToSpecific(o);
-		} else if("true".equals(o.getModelEntity().getProperty("hasConvertedProperties"))) {
+		} else if("true".equals(o.getModelEntity().getProperty("hasConvertedProperties"))
+			|| o.getModelEntity().getAttribute(ESBConstants.ATTR_MESSAGE_FLOW_PRIORITY) != null) {
 			SpecificPropertyConverter.instance.convertBasicToSpecific(o);
 		}
 	}
@@ -65,7 +67,8 @@
     	if(!needToSave(o)) return true;
     	if(SpecificActionLoader.instance.isPreActionEntity(o)) {
     		o = SpecificActionLoader.instance.convertSpecificActionToBasic(o);
-    	} else if("true".equals(o.getModelEntity().getProperty("hasConvertedProperties"))) {
+    	} else if("true".equals(o.getModelEntity().getProperty("hasConvertedProperties"))
+    			|| o.getModelEntity().getAttribute(ESBConstants.ATTR_MESSAGE_FLOW_PRIORITY) != null) {
     		o = SpecificPropertyConverter.instance.convertSpecificToBasic(o);
     	}
     	return super.save(parent, o);

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificActionLoader.java	2012-06-08 21:47:46 UTC (rev 41844)
@@ -198,19 +198,23 @@
 			String pre = as[i].getProperty("pre");
 			if(pre == null || pre.length() == 0) continue;
 			if("true".equals(pre)) {
-				String name = as[i].getXMLName();
-				XModelObject p = basic.getChildByPath(name);
-				if(p == null) continue;
-				String value = p.getAttributeValue("value");
-				specific.setAttributeValue(as[i].getName(), value);
-				specific.set(as[i].getXMLName() + ".#comment", p.getAttributeValue("comment"));
-				p.removeFromParent();
+				copyBasicPropertyToSpecificAttribute(basic, specific, as[i]);
 			} else {
 				//very specific cases
 			}
 		}
 	}
 
+	public static void copyBasicPropertyToSpecificAttribute(XModelObject basic, XModelObject specific, XAttribute a) {
+		String name = a.getXMLName();
+		XModelObject p = basic.getChildByPath(name);
+		if(p == null) return;
+		String value = p.getAttributeValue("value");
+		specific.setAttributeValue(a.getName(), value);
+		specific.set(a.getXMLName() + ".#comment", p.getAttributeValue("comment"));
+		p.removeFromParent();
+	}
+
 	public static void copySpecificAtttributesToBasicProperties(XModelObject specific, XModelObject basic) {
 		XModelEntity entity = specific.getModelEntity();
 		XAttribute[] as = entity.getAttributes();
@@ -218,18 +222,22 @@
 			String pre = as[i].getProperty("pre");
 			if(pre == null || pre.length() == 0) continue;
 			if("true".equals(pre)) {
-				String value = specific.getAttributeValue(as[i].getName());
-				if(value == null || value.length() == 0 || value.equals(as[i].getDefaultValue())) {
-					if(!"always".equals(as[i].getProperty("save"))) continue;
-				}
-				XModelObject p = specific.getModel().createModelObject(ESBConstants.ENT_ESB_PROPERTY, null);
-				p.setAttributeValue("name", as[i].getXMLName());
-				p.setAttributeValue("value", value);
-				p.setAttributeValue("comment", specific.get(as[i].getXMLName() + ".#comment"));
-				basic.addChild(p);
+				copySpecificAttributeToBasicProperty(specific, basic, as[i]);
 			} else {
 				//very specific cases
 			}
 		}
 	}
+
+	public static void copySpecificAttributeToBasicProperty(XModelObject specific, XModelObject basic, XAttribute a) {
+		String value = specific.getAttributeValue(a.getName());
+		if(value == null || value.length() == 0 || value.equals(a.getDefaultValue())) {
+			if(!"always".equals(a.getProperty("save"))) return;
+		}
+		XModelObject p = specific.getModel().createModelObject(ESBConstants.ENT_ESB_PROPERTY, null);
+		p.setAttributeValue("name", a.getXMLName());
+		p.setAttributeValue("value", value);
+		p.setAttributeValue("comment", specific.get(a.getXMLName() + ".#comment"));
+		basic.addChild(p);
+	}
 }

Modified: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java	2012-06-08 21:29:17 UTC (rev 41843)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java	2012-06-08 21:47:46 UTC (rev 41844)
@@ -15,6 +15,7 @@
 import org.jboss.tools.esb.core.model.converters.FTPListenerConverter;
 import org.jboss.tools.esb.core.model.converters.IPropertyConverter;
 import org.jboss.tools.esb.core.model.converters.JBRListenerConverter;
+import org.jboss.tools.esb.core.model.converters.MessageFlowPriorityConverter;
 
 /**
  * When loading from xml, reads 'raw' list of esb property children of loaded object 
@@ -47,6 +48,10 @@
 		} else if(JBR_ENTITIES.indexOf("." + entity + ".") >= 0) {
 			JBRListenerConverter.instance.toSpecific(basic, basic);
 		}
+		
+		if(basic.getModelEntity().getAttribute(ATTR_MESSAGE_FLOW_PRIORITY) != null) {
+			MessageFlowPriorityConverter.instance.toSpecific(basic, basic);
+		}
 		return basic;
 	}
 
@@ -60,6 +65,15 @@
 			basic = basic.copy();
 			JBRListenerConverter.instance.toBasic(basic, specific);
 		}
+		
+		if(basic.getModelEntity().getAttribute(ATTR_MESSAGE_FLOW_PRIORITY) != null) {
+			String value = basic.getAttributeValue(ATTR_MESSAGE_FLOW_PRIORITY);
+			if(value != null && value.length() > 0) {
+				if(basic == specific) basic = basic.copy();
+				MessageFlowPriorityConverter.instance.toBasic(basic, specific);
+				basic.setAttributeValue(ATTR_MESSAGE_FLOW_PRIORITY, "");
+			}
+		}
 		return basic;
 	}
 

Added: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/MessageFlowPriorityConverter.java
===================================================================
--- branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/MessageFlowPriorityConverter.java	                        (rev 0)
+++ branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/MessageFlowPriorityConverter.java	2012-06-08 21:47:46 UTC (rev 41844)
@@ -0,0 +1,36 @@
+/******************************************************************************* 
+ * Copyright (c) 2007 Red Hat, Inc. 
+ * Distributed under license by Red Hat, Inc. All rights reserved. 
+ * This program is made available under the terms of the 
+ * Eclipse Public License v1.0 which accompanies this distribution, 
+ * and is available at http://www.eclipse.org/legal/epl-v10.html 
+ * 
+ * Contributors: 
+ * Red Hat, Inc. - initial API and implementation 
+ ******************************************************************************/ 
+package org.jboss.tools.esb.core.model.converters;
+
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.esb.core.model.ESBConstants;
+import org.jboss.tools.esb.core.model.SpecificActionLoader;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class MessageFlowPriorityConverter implements IPropertyConverter {
+	public static MessageFlowPriorityConverter instance = new MessageFlowPriorityConverter();
+	
+	public MessageFlowPriorityConverter() {}
+
+	public void toBasic(XModelObject basic, XModelObject specific) {
+		XAttribute a = specific.getModelEntity().getAttribute(ESBConstants.ATTR_MESSAGE_FLOW_PRIORITY);
+		if(a != null) SpecificActionLoader.copySpecificAttributeToBasicProperty(specific, basic, a);
+	}
+
+	public void toSpecific(XModelObject basic, XModelObject specific) {
+		XAttribute a = specific.getModelEntity().getAttribute(ESBConstants.ATTR_MESSAGE_FLOW_PRIORITY);
+		if(a != null) SpecificActionLoader.copyBasicPropertyToSpecificAttribute(basic, specific, a);
+	}
+
+}


Property changes on: branches/jbosstools-3.3.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/MessageFlowPriorityConverter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain



More information about the jbosstools-commits mailing list