Author: chanaka
Date: Thu May 15 05:45:38 2008
New Revision: 17048
Log:
Added startup UI for the smooks mediator.
Some UI changes made to the filter mediator.
Added:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/smooks_mediator.js
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/smooks_edit.xsl
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/smooks_view.xsl
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js.html
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/filter_mediator.js
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/mediators.js
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/custom_mediator_includes.xsl
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/filter_edit.xsl
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/filter_view.xsl
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js.html
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/www/extensions/core/js.html
(original)
+++ trunk/esb/java/modules/distribution/src/main/www/extensions/core/js.html
Thu May 15 05:45:38 2008
@@ -39,6 +39,7 @@
<script language="javascript"
src="extensions/core/js/mediators/target.js"></script>
<script language="javascript"
src="extensions/core/js/mediators/iterate_mediator.js"></script>
<script language="javascript"
src="extensions/core/js/mediators/cache_mediator.js"></script>
+<script language="javascript"
src="extensions/core/js/mediators/smooks_mediator.js"></script>
<script language="javascript"
src="extensions/core/js/mediators/aggregate_mediator.js"></script>
<script language="javascript"
src="extensions/core/js/mediators/callout_mediator.js"></script>
<script language="javascript"
src="extensions/core/js/mediators/property.js"></script>
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/filter_mediator.js
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/filter_mediator.js
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/filter_mediator.js
Thu May 15 05:45:38 2008
@@ -78,3 +78,7 @@
}
}
+
+mediatorelementstring["filter"] = function logstring() {
+ return "<syn:filter
xmlns:syn='http://ws.apache.org/ns/synapse'><syn:then/><syn:else/></syn:filter>";
+};
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/mediators.js
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/mediators.js
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/mediators.js
Thu May 15 05:45:38 2008
@@ -21,7 +21,7 @@
var MEDIATOR_ADMIN = "MediatorAdmin"
var mediatorcategories = [{text: "Core", id: "core", submenu: {id: "coremenu",
itemdata: [{text: "Drop", id: "drop"}, {text: "Log", id: "log"}, {text:
"Property", id: "property"}, {text: "Send", id: "send"}, {text: "Sequence", id:
"sequence"}, {text: "DBreport", id: "dbreport"}, {text: "Callout", id:
"callout"}, {text: "DBlookup", id: "dblookup"}, {text: "Clone", id: "clone"},
{text: "Iterate", id: "iterate"}, {text: "Aggregate", id: "aggregate"}, {text:
"Cache", id: "cache"}]}},
- {text: "Transform", id: "transform", submenu: {id: "transformmenu",
itemdata: [{text: "Fault", id: "makefault"}, {text: "Header", id: "header"},
{text: "XSLT", id: "xslt"},{text: "XQuery", id: "xquery"}]}},
+ {text: "Transform", id: "transform", submenu: {id: "transformmenu",
itemdata: [{text: "Fault", id: "makefault"}, {text: "Header", id: "header"},
{text: "XSLT", id: "xslt"},{text: "XQuery", id: "xquery"},{text: "Smooks", id:
"smooks"}]}},
{text: "Filters", id: "filters", submenu: {id: "filtersmenu", itemdata:
[{text: "Filter", id: "filter"}, {text: "In", id: "in"}, {text: "Out", id:
"out"}, {text: "Switch", id: "switch"}, {text: "Validate", id: "validate"},
{text: "Throttle", id: "throttle"}]}},
{text: "Extension", id: "extension", submenu: {id: "extensionmenu",
itemdata: [{text: "Class", id: "class"}, {text: "Command", id: "pojoCommand"},
{text: "Script", id: "script"}, {text: "Spring", id: "spring"}, {text:
"RMSequence", id: "RMSequence"}]}}];
Added:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/smooks_mediator.js
==============================================================================
--- (empty file)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/js/mediators/smooks_mediator.js
Thu May 15 05:45:38 2008
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+collectdata["sequence"] = function collectlogdata(mediator) {
+
+ var seqref = document.getElementById("seq_ref");
+ if (seqref != undefined && seqref != null && seqref.value != "") {
+ mediator.setAttribute("key", seqref.value);
+ return true;
+ } else {
+ esbwarning("Give Error message", TYPE_INFO);
+ return false;
+ }
+};
+
+function sequencefromregistry(index) {
+
+ var panelId = ("mypanel" + index).toString();
+ registrybrowser("savesequencefromregistry", "dicardregistrybrowser",
index, 1, panelId);
+}
+
+function savesequencefromregistry(position) {
+ var mediator = getnestedmediator(internalmodel.sequence, position);
+ var regKey = getRegistryKey();
+ var divcontrol = document.getElementById("registryPanel");
+ divcontrol.innerHTML = "";
+ if (regKey != null && regKey != undefined) {
+ mediator.setAttribute("key", regKey);
+ }
+ var epdiv = document.getElementById("ep");
+ if (epdiv != null && mediator != null) {
+ processXML(mediator, "mediators/smooks_edit.xsl", epdiv);
+ }
+}
+mediatorelementstring["smooks"] = function logstring() {
+ return "<syn:smooks key='' xmlns:syn='http://ws.apache.org/ns/synapse'/>";
+};
\ No newline at end of file
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/custom_mediator_includes.xsl
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/custom_mediator_includes.xsl
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/custom_mediator_includes.xsl
Thu May 15 05:45:38 2008
@@ -26,6 +26,7 @@
<xsl:include href="cache_view.xsl"/>
<xsl:include href="aggregate_view.xsl"/>
<xsl:include href="callout_view.xsl"/>
+ <xsl:include href="smooks_view.xsl"/>
<!-- Your custom mediator view xslt references goes here -->
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/filter_edit.xsl
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/filter_edit.xsl
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/filter_edit.xsl
Thu May 15 05:45:38 2008
@@ -18,6 +18,10 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="mediator_view.xsl"/>
+ <xsl:template match="syn:then" xmlns:syn="http://ws.apache.org/ns/synapse">
+ </xsl:template>
+ <xsl:template match="syn:else" xmlns:syn="http://ws.apache.org/ns/synapse">
+ </xsl:template>
<xsl:template match="syn:filter"
xmlns:syn="http://ws.apache.org/ns/synapse">
<div id="filter_edit_div">
<label class="content-header">
@@ -60,7 +64,7 @@
</table>
<xsl:if test="@xpath or @set_xpath">
<xsl:if test="not(@set_src) or @set_src=0">
- <table border="0" style="margin-left: 3em; width:
150px;">
+ <table border="0" style="width: 150px;">
<tbody>
<tr>
<td>
@@ -89,7 +93,7 @@
</xsl:if>
<xsl:if test="not(@xpath) or @set_src">
<xsl:if test="not(@set_xpath) or @set_xpath=0">
- <table border="0" style="margin-left: 3em; width:
150px;">
+ <table border="0" style="width: 150px;">
<tbody>
<tr>
<td>
@@ -129,12 +133,28 @@
</table>
</xsl:if>
</xsl:if>
+ <div style="margin-left:15px">Then</div>
+ <div>
+ <xsl:for-each select="syn:then">
+ <xsl:if test="count(child::*)=0">
+ <xsl:call-template name="add_mediator_control">
+ <xsl:with-param name="head_pos"
+ select="concat(concat(@esb_med_pos,
'.'), count(child::*))"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </div>
+ <div style="margin-left:15px">else</div>
+ <div>
+ <xsl:for-each select="syn:else">
<xsl:if test="count(child::*)=0">
<xsl:call-template name="add_mediator_control">
<xsl:with-param name="head_pos"
select="concat(concat(@esb_med_pos,
'.'), count(child::*))"/>
</xsl:call-template>
</xsl:if>
+ </xsl:for-each>
+ </div>
<div class='indent'>
<xsl:apply-templates/>
</div>
Modified:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/filter_view.xsl
==============================================================================
---
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/filter_view.xsl
(original)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/filter_view.xsl
Thu May 15 05:45:38 2008
@@ -15,7 +15,10 @@
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
+<xsl:template match="syn:then" xmlns:syn="http://ws.apache.org/ns/synapse">
+ </xsl:template>
+ <xsl:template match="syn:else" xmlns:syn="http://ws.apache.org/ns/synapse">
+ </xsl:template>
<xsl:template match="syn:filter" mode="custom" priority="2"
xmlns:syn="http://ws.apache.org/ns/synapse">
<label class="content-header">
@@ -74,12 +77,24 @@
</tbody>
</table>
</div>
+ <div style="margin-left:15px">Then</div>
+ <div>
<xsl:if test="count(child::*)=0">
<xsl:call-template name="add_mediator_control">
<xsl:with-param name="head_pos"
select="concat(concat(@esb_med_pos, '.'),
count(child::*))"/>
</xsl:call-template>
</xsl:if>
+ </div>
+ <div style="margin-left:15px">else</div>
+ <div>
+ <xsl:if test="count(child::*)=0">
+ <xsl:call-template name="add_mediator_control">
+ <xsl:with-param name="head_pos"
+ select="concat(concat(@esb_med_pos, '.'),
count(child::*))"/>
+ </xsl:call-template>
+ </xsl:if>
+ </div>
<div class='indent'><xsl:apply-templates/></div>
</xsl:template>
</xsl:stylesheet>
\ No newline at end of file
Added:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/smooks_edit.xsl
==============================================================================
--- (empty file)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/smooks_edit.xsl
Thu May 15 05:45:38 2008
@@ -0,0 +1,56 @@
+<!--
+ ~ Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:include href="../commons.xsl"/>
+
+ <xsl:template match="syn:smooks"
xmlns:syn="http://ws.apache.org/ns/synapse">
+ <div id="ep">
+ <label class="content-header">
+ <img align="top"
src="extensions/core/images/sequence_mediator.gif"/>
+ <xsl:text>Smooks Mediator</xsl:text>
+ </label>
+ <br/>
+ <br/>
+ <div class="mediator-inside">
+ <label style="padding-left:10px;">Referring sequence<font
style='color: red;font-size: 8pt;'> *</font></label>
+ <xsl:element name="input">
+ <xsl:attribute name="id">seq_ref</xsl:attribute>
+ <xsl:attribute name="style">margin-left:
3em;</xsl:attribute>
+ <xsl:attribute name="type">text</xsl:attribute>
+ <xsl:attribute name="size">20</xsl:attribute>
+ <xsl:attribute
name="class">esb-edit_disabled</xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="@key"/>
+ </xsl:attribute>
+ <xsl:attribute name="DISABLED"/>
+ </xsl:element>
+ <xsl:element name="img">
+ <xsl:attribute name="style">margin-left:
3em;</xsl:attribute>
+ <xsl:attribute name="src">
+
extensions/core/images/registry_picker.gif</xsl:attribute>
+ <xsl:attribute name="title">Registry Browser</xsl:attribute>
+ <xsl:attribute name="onClick">
+ javascript:sequencefromregistry('<xsl:value-of
select="@esb_med_pos"/>');return false;
+ </xsl:attribute>
+ </xsl:element>
+ </div>
+ </div>
+ </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
Added:
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/smooks_view.xsl
==============================================================================
--- (empty file)
+++
trunk/esb/java/modules/distribution/src/main/www/extensions/core/xslt/mediators/smooks_view.xsl
Thu May 15 05:45:38 2008
@@ -0,0 +1,36 @@
+<!--
+ ~ Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:template match="syn:sequence" mode="custom" priority="2"
xmlns:syn="http://ws.apache.org/ns/synapse">
+
+ <label class="content-header">
+ <img align="top"
src="extensions/core/images/sequence_mediator.gif"/>
+ <xsl:text> Smooks Mediator</xsl:text>
+ </label>
+ <br/>
+ <br/>
+ <div class="mediator-inside">
+ <label style="padding-left:10px;">Referring sequence </label>
+ <label style="margin-left: 8em;">
+ <xsl:if test="@key!=''"><xsl:value-of
select="@key"/></xsl:if>
+ <xsl:if test="@key=''">Not specified</xsl:if>
+ </label>
+ </div>
+ </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev