Author: tyrell
Date: Fri Jan 18 00:31:54 2008
New Revision: 12465

Log:

Adding parameter recognition to taskbar.jsp include.

Modified:
   trunk/mashup/java/modules/www/mashup.jsp
   trunk/mashup/java/modules/www/taskbar.jsp

Modified: trunk/mashup/java/modules/www/mashup.jsp
==============================================================================
--- trunk/mashup/java/modules/www/mashup.jsp    (original)
+++ trunk/mashup/java/modules/www/mashup.jsp    Fri Jan 18 00:31:54 2008
@@ -231,7 +231,12 @@
 <%@ include file="searchbox.jsp" %>
 
 <div id="taskbar">
-    <%@ include file="taskbar.jsp" %>
+    <jsp:include page="taskbar.jsp">
+        <jsp:param name="author" value="<%=author%>"/>
+        <jsp:param name="currentUser" value="<%=currentUser%>"/>
+        <jsp:param name="mashupServiceName" value="<%=mashupServiceName%>"/>
+        <jsp:param name="path" value="<%=path%>"/>
+    </jsp:include>
 </div>
 
 <div id="content">

Modified: trunk/mashup/java/modules/www/taskbar.jsp
==============================================================================
--- trunk/mashup/java/modules/www/taskbar.jsp   (original)
+++ trunk/mashup/java/modules/www/taskbar.jsp   Fri Jan 18 00:31:54 2008
@@ -13,7 +13,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 --%>
-
+<%
+    //Setting variables required for the taskbar.jsp
+    String paramAuthor = request.getParameter("paramAuthor");
+    String paramCurrentUser = request.getParameter("paramCurrentUser");
+    String paramMashupServiceName = 
request.getParameter("paramMashupServiceName");
+    String paramPath = request.getParameter("paramPath");
+%>
 <table width="100%" border="0" class="box" cellspacing="0" cellpadding="3">
 <tr>
     <th>Tasks</th>
@@ -26,7 +32,7 @@
 <ul>
 <!--Will be available only to users with Admin priviledges OR who are Authors 
of the current Mashup, if there is a Mashup service set by the parent page.-->
 <% if (((RegistryUtils.isAdminRole(registry)) ||
-        (author.equalsIgnoreCase(currentUser))) && 
(!mashupServiceName.equalsIgnoreCase(""))) { %>
+        (paramAuthor.equalsIgnoreCase(paramCurrentUser))) && 
(paramMashupServiceName != null)) { %>
 <li id="service-status">
     Service status not available
 </li>
@@ -42,13 +48,13 @@
 
         if (serviceState) {
             document.getElementById("service-status").innerHTML =
-            "Service started. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashupServiceName%>\", 
false, handleServiceStartStopCallback)'>Stop</a>]";
+            "Service started. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=paramMashupServiceName%>\",
 false, handleServiceStartStopCallback)'>Stop</a>]";
                                 //Enabling service editing
             document.getElementById("edit-service").innerHTML =
-            '<a href="editor.jsp?action=edit&mashup=<%=path%>">Edit this 
service</a>';
+            '<a href="editor.jsp?action=edit&mashup=<%=paramPath%>">Edit this 
service</a>';
                                 //Enabling service sharing
             document.getElementById("share-mashup").innerHTML =
-            ' <a href="#" 
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=mashupServiceName%>\');">Share
 this service</a>';
+            ' <a href="#" 
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=paramMashupServiceName%>\');">Share
 this service</a>';
                         //Enabling service deletion
             var delElem = document.getElementById("delete-service");
             if (!(delElem == "undefined")) {
@@ -57,7 +63,7 @@
             }
         } else {
             document.getElementById("service-status").innerHTML =
-            "Service stopped. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashupServiceName%>\", 
true, handleServiceStartStopCallback)'>Start</a>]";
+            "Service stopped. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=paramMashupServiceName%>\",
 true, handleServiceStartStopCallback)'>Start</a>]";
                                 //Disabling service editing
             document.getElementById("edit-service").innerHTML =
             "Service editing is not available";
@@ -78,13 +84,13 @@
 
         if (serviceMashupObject.getServiceStatus() == "true") {
             document.getElementById("service-status").innerHTML =
-            "Service started. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashupServiceName%>\", 
false, handleServiceStartStopCallback)'>Stop</a>]";
+            "Service started. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=paramMashupServiceName%>\",
 false, handleServiceStartStopCallback)'>Stop</a>]";
                                 //Enabling service editing
             document.getElementById("edit-service").innerHTML =
-            '<a href="editor.jsp?action=edit&mashup=<%=path%>">Edit this 
service</a>';
+            '<a href="editor.jsp?action=edit&mashup=<%=paramPath%>">Edit this 
service</a>';
                                 //Enabling service sharing
             document.getElementById("share-mashup").innerHTML =
-            ' <a href="#" 
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=mashupServiceName%>\');">Share
 this service</a>';
+            ' <a href="#" 
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=paramMashupServiceName%>\');">Share
 this service</a>';
                         //Enabling service deletion
             var delElem = document.getElementById("delete-service");
             if (!(delElem == "undefined")) {
@@ -93,7 +99,7 @@
             }
         } else {
             document.getElementById("service-status").innerHTML =
-            "Service stopped. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashupServiceName%>\", 
true, handleServiceStartStopCallback)'>Start</a>]";
+            "Service stopped. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=paramMashupServiceName%>\",
 true, handleServiceStartStopCallback)'>Start</a>]";
                                 //Disabling service editing
             document.getElementById("edit-service").innerHTML =
             "Service editing is not available";
@@ -108,7 +114,7 @@
         }
     }
 
-    wso2.mashup.services.listServiceData('<%=mashupServiceName%>', 
listServiceDataCallback);
+    wso2.mashup.services.listServiceData('<%=paramMashupServiceName%>', 
listServiceDataCallback);
 </script>
 <li id="share-mashup">
     Service sharing is not available
@@ -119,10 +125,10 @@
     }
 
     function deleteService() {
-        var confirmation = confirm("You are about to permanently delete the 
'<%=mashupServiceName%>' service. Are you sure?")
+        var confirmation = confirm("You are about to permanently delete the 
'<%=paramMashupServiceName%>' service. Are you sure?")
 
         if (confirmation) {
-            wso2.mashup.services.deleteService('<%=mashupServiceName%>', 
deleteServiceCallback);
+            wso2.mashup.services.deleteService('<%=paramMashupServiceName%>', 
deleteServiceCallback);
         }
     }
 
@@ -146,10 +152,10 @@
     }
 
     function redeployService() {
-        var confirmation = confirm("You are about to re-deploy the 
'<%=mashupServiceName%>' service. Are you sure?")
+        var confirmation = confirm("You are about to re-deploy the 
'<%=paramMashupServiceName%>' service. Are you sure?")
 
         if (confirmation) {
-            wso2.mashup.services.reDeployService('<%=mashupServiceName%>', 
redeployServiceCallback);
+            
wso2.mashup.services.reDeployService('<%=paramMashupServiceName%>', 
redeployServiceCallback);
         }
     }
 </script>
@@ -165,7 +171,7 @@
 
 <li>
     <a href="#"
-       
onclick="WSO2.MashupUtils.showMashupDownloadingDialog('<%=mashupServiceName%>');">Download
+       
onclick="WSO2.MashupUtils.showMashupDownloadingDialog('<%=paramMashupServiceName%>');">Download
         this mashup</a>
 </li>
 <%
@@ -173,7 +179,7 @@
 %>
 
 <li>
-    <a href="#" 
onclick="WSO2.MashupUtils.showCreateMashupDialog('<%=currentUser%>');">Create a
+    <a href="#" 
onclick="WSO2.MashupUtils.showCreateMashupDialog('<%=paramCurrentUser%>');">Create
 a
         new service</a>
 </li>
 

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to