Author: tyrell
Date: Sun Jan 13 10:57:42 2008
New Revision: 12172

Log:

Adding the new Mashup Editor to the mashup tasks.

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

Modified: trunk/mashup/java/modules/www/mashup.jsp
==============================================================================
--- trunk/mashup/java/modules/www/mashup.jsp    (original)
+++ trunk/mashup/java/modules/www/mashup.jsp    Sun Jan 13 10:57:42 2008
@@ -121,106 +121,105 @@
 <script type="text/javascript" src="js/make-editable.js"></script>
 
 <script language="javascript" type="text/javascript">
-userLoggedOn = <%=RegistryUtils.isLoggedIn(registry) %>;
+    userLoggedOn = <%=RegistryUtils.isLoggedIn(registry) %>;
 
-function makeEditable(field) {
-    $(field + "_input_text").update($(field + "_value").innerHTML);
-    $(field).hide();
-    $(field + "_input").show();
-}
-
-function cancelEditable(field) {
-    $(field).show();
-    $(field + "_input").hide();
-}
-
-function editServiceDocumentationCallback() {
-    var response;
-
-    var browser = WSRequest.util._getBrowser();
-    if (browser == "ie" || browser == "ie7") {
-        response =
-        
this.req.responseXML.getElementsByTagName("ns:return")[0].firstChild.nodeValue;
-    } else {
-        response = 
this.req.responseXML.getElementsByTagName("return")[0].firstChild.nodeValue;
-    }
-
-    if (response == "true") {
-        document.getElementById(this.params[1] + "_value").innerHTML = 
this.params[0];
-        document.getElementById(this.params[1]).show();
-        document.getElementById(this.params[1] + "_input").hide();
-    } else {
-        wso2.wsf.Util.alertMessage("Sorry!! The updation failed. Please try 
again.");
-    }
-}
-
-// todo: make this work for saving mashup descriptions
-function saveEditable(field, fieldtype, user) {
-    var newValue = $(field + "_input_text").value;
-    var safeNewValue = "<![CDATA[" + newValue + "]]>";
+    function makeEditable(field) {
+        $(field + "_input_text").update($(field + "_value").innerHTML);
+        $(field).hide();
+        $(field + "_input").show();
+    }
+
+    function cancelEditable(field) {
+        $(field).show();
+        $(field + "_input").hide();
+    }
+
+    function editServiceDocumentationCallback() {
+        var response;
+
+        var browser = WSRequest.util._getBrowser();
+        if (browser == "ie" || browser == "ie7") {
+            response =
+            
this.req.responseXML.getElementsByTagName("ns:return")[0].firstChild.nodeValue;
+        } else {
+            response = 
this.req.responseXML.getElementsByTagName("return")[0].firstChild.nodeValue;
+        }
+
+        if (response == "true") {
+            document.getElementById(this.params[1] + "_value").innerHTML = 
this.params[0];
+            document.getElementById(this.params[1]).show();
+            document.getElementById(this.params[1] + "_input").hide();
+        } else {
+            wso2.wsf.Util.alertMessage("Sorry!! The updation failed. Please 
try again.");
+        }
+    }
+
+    function saveEditable(field, fieldtype, user) {
+        var newValue = $(field + "_input_text").value;
+        var safeNewValue = "<![CDATA[" + newValue + "]]>";
         
         //Calling the backend service to save the updated documentation
-    var params = new Array();
-    params[0] = newValue;
-    params[1] = field;
-    wso2.mashup.services.editServiceDocumentation('<%=mashupServiceName%>', 
safeNewValue, editServiceDocumentationCallback, params);
-
-    new Ajax.Request("ajax_profile.jsp?name=" + user + "&field=" + fieldtype, {
-        method: "post",
-        contentType: "text/html",
-        postBody: newValue,
-        onFailure: function (transport) {
-            alert("error");
-        },
-        onSuccess: function (transport) {
-            if (fieldtype == "fullName") {
-                $$('.updatableName').each(function(item) {
-                    item.update(newValue);
-                });
+        var params = new Array();
+        params[0] = newValue;
+        params[1] = field;
+        
wso2.mashup.services.editServiceDocumentation('<%=mashupServiceName%>', 
safeNewValue, editServiceDocumentationCallback, params);
+
+        new Ajax.Request("ajax_profile.jsp?name=" + user + "&field=" + 
fieldtype, {
+            method: "post",
+            contentType: "text/html",
+            postBody: newValue,
+            onFailure: function (transport) {
+                alert("error");
+            },
+            onSuccess: function (transport) {
+                if (fieldtype == "fullName") {
+                    $$('.updatableName').each(function(item) {
+                        item.update(newValue);
+                    });
+                }
             }
-        }
-    });
-}
+        });
+    }
 
-function addTag() {
-    var newValue = $("addtag_tag").value;
-    if (newValue == "") return;
-    var path = $('addtag_path').value;
-    var author = $('addtag_author').value;
-
-    new Ajax.Request("ajax_tag.jsp?path=" + path + "&author=" + author, {
-        method: "post",
-        contentType: "text/html",
-        postBody: newValue,
-        onSuccess: function (transport) {
-            $('taglist').replace(transport.responseText);
-        },
-        onFailure: function (transport) {
-            alert("error");
-        }
-    });
-    $("addtag_tag").value = "";
-}
-
-function removeTag(tag) {
-    var path = $('addtag_path').value;
-    var author = $('addtag_author').value;
-
-    new Ajax.Request("ajax_tag.jsp", {
-        method: "delete",
-        parameters: {
-            "path" : path,
-            "author" : author,
-            "tag" : tag
-        },
-        onSuccess: function (transport) {
-            $('taglist').replace(transport.responseText);
-        },
-        onFailure: function (transport) {
-            alert("error");
-        }
-    });
-}
+    function addTag() {
+        var newValue = $("addtag_tag").value;
+        if (newValue == "") return;
+        var path = $('addtag_path').value;
+        var author = $('addtag_author').value;
+
+        new Ajax.Request("ajax_tag.jsp?path=" + path + "&author=" + author, {
+            method: "post",
+            contentType: "text/html",
+            postBody: newValue,
+            onSuccess: function (transport) {
+                $('taglist').replace(transport.responseText);
+            },
+            onFailure: function (transport) {
+                alert("error");
+            }
+        });
+        $("addtag_tag").value = "";
+    }
+
+    function removeTag(tag) {
+        var path = $('addtag_path').value;
+        var author = $('addtag_author').value;
+
+        new Ajax.Request("ajax_tag.jsp", {
+            method: "delete",
+            parameters: {
+                "path" : path,
+                "author" : author,
+                "tag" : tag
+            },
+            onSuccess: function (transport) {
+                $('taglist').replace(transport.responseText);
+            },
+            onFailure: function (transport) {
+                alert("error");
+            }
+        });
+    }
 </script>
 
 </head>
@@ -264,7 +263,7 @@
             "Service started. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashupServiceName%>\", 
false, handleServiceStartStopCallback)'>Stop</a>]";
                                 //Enabling service editing
             document.getElementById("edit-service").innerHTML =
-            '<a href="#" 
onclick="wso2.mashup.services.getServiceDataForEditor(\'<%=mashupServiceName%>\',
 wso2.mashup.populateServiceEditor);">Edit this service</a>';
+            '<a href="editor.jsp?action=edit&mashup=<%=path%>">Edit this 
service</a>';
                                 //Enabling service sharing
             document.getElementById("share-mashup").innerHTML =
             ' <a href="#" 
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=mashupServiceName%>\');">Share
 this service</a>';
@@ -300,7 +299,7 @@
             "Service started. [<a href='#' 
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashupServiceName%>\", 
false, handleServiceStartStopCallback)'>Stop</a>]";
                                 //Enabling service editing
             document.getElementById("edit-service").innerHTML =
-            '<a href="#" 
onclick="wso2.mashup.services.getServiceDataForEditor(\'<%=mashupServiceName%>\',
 wso2.mashup.populateServiceEditor);">Edit this service</a>';
+            '<a href="editor.jsp?action=edit&mashup=<%=path%>">Edit this 
service</a>';
                                 //Enabling service sharing
             document.getElementById("share-mashup").innerHTML =
             ' <a href="#" 
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=mashupServiceName%>\');">Share
 this service</a>';

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

Reply via email to