Author: ruwan
Date: Sat Jan 26 13:54:00 2008
New Revision: 12962

Log:

Fixing the issue with the Property mediator UI


Modified:
   
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/property_mediator.js
   
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/property_edit.xsl
   
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/property_view.xsl

Modified: 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/property_mediator.js
==============================================================================
--- 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/property_mediator.js
  (original)
+++ 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/property_mediator.js
  Sat Jan 26 13:54:00 2008
@@ -53,19 +53,21 @@
                 esbwarning("The value or expression must be specified for the 
property mediator", TYPE_INFO);
                 return false;
             }
-
-            var scope_element = document.getElementById("scope");
-            if(scope_element != undefined && scope_element != null) {
-                var scope_index = scope_element.selectedIndex;
-                var scope = scope_element.options[scope_index].value;
-                if (scope != "synapse") {
-                    mediator.setAttribute("scope", scope);
-                }
-            }
             
         } else {
             mediator.setAttribute("action", "remove");
         }
+
+        var scope_element = document.getElementById("scope");
+        if(scope_element != undefined && scope_element != null) {
+            var scope_index = scope_element.selectedIndex;
+            var scope = scope_element.options[scope_index].value;
+            if (scope != "synapse") {
+                mediator.setAttribute("scope", scope);
+            } else {
+                mediator.removeAttribute("scope");
+            }
+        }
         
     } else if(!validate) {
         esbwarning("Property name must be specified", TYPE_INFO);

Modified: 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/property_edit.xsl
==============================================================================
--- 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/property_edit.xsl
   (original)
+++ 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/property_edit.xsl
   Sat Jan 26 13:54:00 2008
@@ -22,60 +22,58 @@
         <label class="content-header">
             <img src="extensions/core/images/property-mediator.gif"/>
             <xsl:call-template name="capitalize-first"/>
-            <xsl:text>Mediator</xsl:text>
+            <xsl:text> Mediator</xsl:text>
         </label>
         <br/>
         <br/>
 
-        <!--For existing mediators-->
-        <!--<xsl:if test="@name">-->
-            <table border="0" style="margin-left: 3em; width: 650px;">
-                <tbody>
-                    <tr>
-                        <td colspan="2">Name
-                            <font style='color: red;font-size: 
8pt;'>&#160;*</font>
-                        </td>
-                        <td colspan="2">
-                            <input type="text" class="esb-edit" width="80px" 
id="name">
-                                <xsl:attribute name="value">
-                                    <xsl:value-of select="@name"/>
-                                </xsl:attribute>
-                            </input>
-                        </td>
-                    </tr>
-                    <tr>
-                        <td colspan="2">
-                            <xsl:text>Action</xsl:text>
-                        </td>
-                        <td style="width: 100px;">
-                            <input id="set" name="action" type="radio">
-                                <xsl:attribute name="onClick">
-                                    javascript: setPropertyAction('set'); 
return false;
+        <table border="0" style="margin-left: 3em; width: 650px;">
+            <tbody>
+                <tr>
+                    <td colspan="2">Name
+                        <font style='color: red;font-size: 8pt;'>&#160;*</font>
+                    </td>
+                    <td colspan="2">
+                        <input type="text" class="esb-edit" width="80px" 
id="name">
+                            <xsl:attribute name="value">
+                                <xsl:value-of select="@name"/>
+                            </xsl:attribute>
+                        </input>
+                    </td>
+                </tr>
+                <tr>
+                    <td colspan="2">
+                        <xsl:text>Action</xsl:text>
+                    </td>
+                    <td style="width: 100px;">
+                        <input id="set" name="action" type="radio">
+                            <xsl:attribute name="onClick">
+                                javascript: setPropertyAction('set'); return 
false;
+                            </xsl:attribute>
+                            <xsl:if test="not(@action) or @action != 'remove'">
+                                <xsl:attribute name="checked">
+                                    true
                                 </xsl:attribute>
-                                <xsl:if test="not(@action) or @action != 
'remove'">
-                                    <xsl:attribute name="checked">
-                                        true
-                                    </xsl:attribute>
-                                </xsl:if>
-                            </input>
-                            Set
-                        </td>
-                        <td>
-                            <input id="remove" name="action" type="radio">
-                                <xsl:attribute name="onClick">
-                                    javascript: setPropertyAction('remove'); 
return false;
+                            </xsl:if>
+                        </input>
+                        Set
+                    </td>
+                    <td>
+                        <input id="remove" name="action" type="radio">
+                            <xsl:attribute name="onClick">
+                                javascript: setPropertyAction('remove'); 
return false;
+                            </xsl:attribute>
+                            <xsl:if test="@action = 'remove'">
+                                <xsl:attribute name="checked">
+                                    true
                                 </xsl:attribute>
-                                <xsl:if test="@action = 'remove'">
-                                    <xsl:attribute name="checked">
-                                        true
-                                    </xsl:attribute>
-                                </xsl:if>
-                            </input>
-                            Remove
-                        </td>
-                        <td></td>
-                    </tr>
-                    <xsl:if test="not(@action) or @action != 'remove'">
+                            </xsl:if>
+                        </input>
+                        Remove
+                    </td>
+                    <td></td>
+                </tr>
+                <xsl:if test="not(@action) or @action != 'remove'">
                     <tr>
                         <td>
                             <input id="value" name="type" type="radio">
@@ -129,146 +127,31 @@
                         </td>
 
                     </tr>
-                    <tr>
-                        <td colspan="2">
-                            <xsl:text>Scope</xsl:text>
-                        </td>
-                        <td colspan="2">
-                            <select class="esb-edit" width="100px" id="scope">
-                                <option value="synapse">Synapse</option>
-                                <option value="transport">
-                                    <xsl:if test="@scope='transport'">
-                                        <xsl:attribute 
name="selected">true</xsl:attribute>
-                                    </xsl:if>
-                                    Transport
-                                </option>
-                                <option value="axis2">
-                                    <xsl:if test="@scope='axis2'">
-                                        <xsl:attribute 
name="selected">true</xsl:attribute>
-                                    </xsl:if>
-                                    Axis2
-                                </option>
-                            </select>
-                        </td>
-                    </tr>
-                    </xsl:if>
-                </tbody>
-            </table>
-        <!--</xsl:if>-->
-
-        <!--For new additions-->
-        <!--<xsl:if test="not(@name)">-->
-            <!--<table border="0" style="margin-left: 3em; width: 650px;">-->
-                <!--<tbody>-->
-
-                    <!--<tr>-->
-                        <!--<td colspan="2">Name-->
-                            <!--<font style='color: red;font-size: 
8pt;'>&#160;*</font>-->
-                        <!--</td>-->
-                        <!--<td colspan="2">-->
-                            <!--<input id="name" type="text" class="esb-edit" 
width="80px"/>-->
-                        <!--</td>-->
-                    <!--</tr>-->
-                    <!--<tr>-->
-                        <!--<td colspan="2">-->
-                            <!--<xsl:text>Action</xsl:text>-->
-                        <!--</td>-->
-                        <!--<td colspan="2">-->
-                            <!--<table cellpadding="0" cellspacing="0" 
border="0">-->
-                                <!--<tr>                            -->
-                            <!--<td>-->
-                                <!--<input id="set" name="action" 
type="radio">-->
-                                    <!--<xsl:if test="@action = 'set' or 
not(@action = 'remove')">-->
-                                        <!--<xsl:attribute name="checked">-->
-                                            <!--true-->
-                                        <!--</xsl:attribute>-->
-                                    <!--</xsl:if>-->
-                                <!--</input>-->
-                                <!--Set-->
-                            <!--</td>-->
-                            <!--<td>-->
-                                <!--<input id="remove" name="action" 
type="radio">-->
-                                    <!--<xsl:if test="@action = 'remove'">-->
-                                        <!--<xsl:attribute name="checked">-->
-                                            <!--true-->
-                                        <!--</xsl:attribute>-->
-                                    <!--</xsl:if>-->
-                                <!--</input>-->
-                                <!--Remove-->
-                            <!--</td>-->
-                             <!--</tr>-->
-                            <!--</table>-->
-                        <!--</td>-->
-                    <!--</tr>-->
-                    <!--<tr>-->
-                        <!--<td>-->
-                            <!--<input id="value" name="type" type="radio">-->
-                                <!--<xsl:attribute name="onClick">-->
-                                    
<!--javascript:showNamespaceButton('<xsl:value-of 
select="@esb_med_pos"/>','','','namespaceButtonCell','false');-->
-                                <!--</xsl:attribute>-->
-                                <!--<xsl:if test="@value or 
not(@expression)">-->
-                                    <!--<xsl:attribute name="checked">-->
-                                        <!--true-->
-                                    <!--</xsl:attribute>-->
-                                <!--</xsl:if>-->
-                            <!--</input>-->
-                            <!--Value-->
-                        <!--</td>-->
-                        <!--<td>-->
-                            <!--<input id="expression" name="type" 
type="radio" value="expression">-->
-                                <!--<xsl:attribute name="onClick">-->
-                                    
<!--javascript:showNamespaceButton('<xsl:value-of 
select="@esb_med_pos"/>','','','namespaceButtonCell','true');-->
-                                <!--</xsl:attribute>-->
-                                <!--<xsl:if test="@expression">-->
-                                    <!--<xsl:attribute name="checked">-->
-                                        <!--true-->
-                                    <!--</xsl:attribute>-->
-                                <!--</xsl:if>-->
-                            <!--</input>-->
-                            <!--Expression-->
-                        <!--</td>-->
-                        <!--<td  style="width:200px;">-->
-                            <!--<input id="val_ex" type="text" 
class="esb-edit" width="80px"/>-->
-                        <!--</td>-->
-                        <!--<td id="namespaceButtonCell" align="left">-->
-                            <!--<xsl:if test="@expression">-->
-                                <!--<a title="Namespace Editor" 
class="ns_editor">-->
-                                    <!--<xsl:attribute name="onclick">-->
-                                        
<!--javascript:showNameSpaceEditor('<xsl:value-of select="@esb_med_pos"/>');-->
-                                    <!--</xsl:attribute>-->
-                                    
<!--<xsl:text>&#160;&#160;&#160;&#160;</xsl:text>-->
-                                <!--</a>-->
-                            <!--</xsl:if>-->
-                        <!--</td>-->
-
-                    <!--</tr>-->
-                    <!--<tr>-->
-                        <!--<td colspan="2">-->
-                            <!--<xsl:text>Scope</xsl:text>-->
-                        <!--</td>-->
-                        <!--<td colspan="2">-->
-                            <!--<select class="esb-edit" width="100px" 
id="scope">-->
-                                <!--<option value="synapse">Synapse</option>-->
-                                <!--<option value="transport">-->
-                                    <!--<xsl:if test="@scope='transport'">-->
-                                        <!--<xsl:attribute 
name="selected">true</xsl:attribute>-->
-                                    <!--</xsl:if>-->
-                                    <!--Transport-->
-                                <!--</option>-->
-                                <!--<option value="axis2">-->
-                                    <!--<xsl:if test="@scope='axis2'">-->
-                                        <!--<xsl:attribute 
name="selected">true</xsl:attribute>-->
-                                    <!--</xsl:if>-->
-                                    <!--Axis2-->
-                                <!--</option>-->
-                            <!--</select>-->
-                        <!--</td>-->
-                    <!--</tr>-->
-
-
-                <!--</tbody>-->
-            <!--</table>-->
-        <!--</xsl:if>-->
+                </xsl:if>
+                <tr>
+                    <td colspan="2">
+                        <xsl:text>Scope</xsl:text>
+                    </td>
+                    <td colspan="2">
+                        <select class="esb-edit" width="100px" id="scope">
+                            <option value="synapse">Synapse</option>
+                            <option value="transport">
+                                <xsl:if test="@scope='transport'">
+                                    <xsl:attribute 
name="selected">true</xsl:attribute>
+                                </xsl:if>
+                                Transport
+                            </option>
+                            <option value="axis2">
+                                <xsl:if test="@scope='axis2'">
+                                    <xsl:attribute 
name="selected">true</xsl:attribute>
+                                </xsl:if>
+                                Axis2
+                            </option>
+                        </select>
+                    </td>
+                </tr>
+            </tbody>
+        </table>
 
     </xsl:template>
 </xsl:stylesheet>

Modified: 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/property_view.xsl
==============================================================================
--- 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/property_view.xsl
   (original)
+++ 
branches/esb/java/1.6/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/property_view.xsl
   Sat Jan 26 13:54:00 2008
@@ -27,75 +27,71 @@
         <br></br>
 
         <xsl:if test="@name">
-             <div id="common_table_content">
-            <table border="0" cellpadding="0" cellspacing="0">
-                <tbody>
-                    <tr>
-                        <th>Property</th>
-                        <th>Value</th>
-                    </tr>
-
-                    <tr>
-                        <td>Name</td>
-                        <td>
-                            <xsl:value-of select="@name"/>
-                        </td>
-                    </tr>
-
-                    <tr>
-                        <td>
-                            <xsl:text>Action</xsl:text>
-                        </td>
-                        <td>
-                               <xsl:if test="@action = 'set' or not(@action = 
'remove')">
-                                        <xsl:text>set</xsl:text>
+            <div id="common_table_content">
+                <table border="0" cellpadding="0" cellspacing="0">
+                    <tbody>
+                        <tr>
+                            <th>Property</th>
+                            <th>Value</th>
+                        </tr>
+
+                        <tr>
+                            <td>Name</td>
+                            <td><xsl:value-of select="@name"/></td>
+                        </tr>
+
+                        <tr>
+                            <td>
+                                <xsl:text>Action</xsl:text>
+                            </td>
+                            <td>
+                                <xsl:if test="@action = 'set' or not(@action = 
'remove')">
+                                    <xsl:text>set</xsl:text>
                                 </xsl:if>
                                 <xsl:if test="@action = 'remove'">
-                                        <xsl:text>remove</xsl:text>
+                                    <xsl:text>remove</xsl:text>
                                 </xsl:if>
+                            </td>
+                        </tr>
 
-                        </td>
-                    </tr>
+                        <xsl:if test="not(@action) or @action!='remove'">
+                            <xsl:if test="@value">
+                                <tr>
+                                    <td>
+                                        <xsl:text>Value</xsl:text>
+                                    </td>
+                                    <td>
+                                        <xsl:value-of select="@value"/>
+                                    </td>
+                                </tr>
+                            </xsl:if>
+
+                            <xsl:if test="@expression">
+                                <tr>
+                                    <td>
+                                        <xsl:text>Expression</xsl:text>
+                                    </td>
+                                    <td>
+                                        <xsl:value-of select="@expression"/>
+                                    </td>
+                                </tr>
+                            </xsl:if>
+                        </xsl:if>
+
+                        <xsl:if test="@scope">
+                            <tr>
+                                <td>
+                                    <xsl:text>Scope</xsl:text>
+                                </td>
+                                <td>
+                                    <xsl:value-of select="@scope"/>
+                                </td>
+                            </tr>
+                        </xsl:if>
 
-                    <xsl:if test="not(@action) or @action!='remove'">
-
-                    <xsl:if test="@value">
-                    <tr>
-                        <td>
-                            <xsl:text>Value</xsl:text>
-                        </td>
-                        <td>
-                            <xsl:value-of select="@value"/>
-                        </td>
-                    </tr>
-                    </xsl:if>
-
-                    <xsl:if test="@expression">
-                    <tr>
-                        <td>
-                            <xsl:text>Expression</xsl:text>
-                        </td>
-                        <td>
-                            <xsl:value-of select="@expression"/>
-                        </td>
-                    </tr>
-                    </xsl:if>
-
-                    <xsl:if test="@scope">
-                    <tr>
-                        <td>
-                            <xsl:text>Scope</xsl:text>
-                        </td>
-                        <td>
-                            <xsl:value-of select="@scope"/>
-                        </td>
-                    </tr>
-                    </xsl:if>
-                    </xsl:if>
-
-                </tbody>
-            </table>
+                    </tbody>
+                </table>
             </div>
         </xsl:if>
-</xsl:template>
+    </xsl:template>
 </xsl:stylesheet>

_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to