Author: tyrell
Date: Fri Dec 14 04:50:48 2007
New Revision: 11136
Log:
Fixing broken editor functionality due to user provisioning.
Modified:
trunk/mashup/java/modules/www/org/js/mashup-editor.js
trunk/mashup/java/modules/www/org/mashup.jsp
Modified: trunk/mashup/java/modules/www/org/js/mashup-editor.js
==============================================================================
--- trunk/mashup/java/modules/www/org/js/mashup-editor.js (original)
+++ trunk/mashup/java/modules/www/org/js/mashup-editor.js Fri Dec 14
04:50:48 2007
@@ -421,7 +421,7 @@
//Make sure the XMLHttpRequest object was instantiated
if (xmlHttpRequest)
{
- xmlHttpRequest.open("GET", serviceUrl + "/" + serviceName +
"?source", true);
+ xmlHttpRequest.open("GET", serviceUrl + "/" +
serviceName.replace("-","/") + "?source", true);
xmlHttpRequest.onreadystatechange = function (aEvt) {
if (xmlHttpRequest.readyState == 4) {
@@ -438,7 +438,7 @@
//Make sure the XMLHttpRequest object was instantiated
if (xmlHttpRequestUi)
{
- xmlHttpRequestUi.open("GET", serviceUrl + "/" + serviceName +
+ xmlHttpRequestUi.open("GET", serviceUrl + "/" +
serviceName.replace("-","/") +
"/index.html", true);
xmlHttpRequestUi.onreadystatechange = function (aEvt) {
@@ -449,7 +449,7 @@
xmlHttpRequestUi.responseText;
} else {
//Check for index.htm
- xmlHttpRequestUi.open("GET", SERVICE_PATH + "/" +
serviceName +
+ xmlHttpRequestUi.open("GET", SERVICE_PATH + "/" +
serviceName.replace("-","/") +
"/index.htm", true);
xmlHttpRequestUi.onreadystatechange = function
(aEvt) {
Modified: trunk/mashup/java/modules/www/org/mashup.jsp
==============================================================================
--- trunk/mashup/java/modules/www/org/mashup.jsp (original)
+++ trunk/mashup/java/modules/www/org/mashup.jsp Fri Dec 14 04:50:48 2007
@@ -70,6 +70,9 @@
String author = resource.getAuthorUserName();
String authorFullName = RegistryUtils.getFullName(request, author);
String description = resource.getDescription();
+
+ String mashupServiceName = author + "-" + mashup;
+
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
@@ -259,13 +262,13 @@
if (serviceState) {
document.getElementById("service-status").innerHTML =
- "Service started. [<a href='#'
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashup%>\", false,
handleServiceStartStopCallback)'>Stop</a>]";
+ "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(\'<%=mashup%>\',
wso2.mashup.populateServiceEditor);">Edit this service</a>';
+ '<a href="#"
onclick="wso2.mashup.services.getServiceDataForEditor(\'<%=mashupServiceName%>\',
wso2.mashup.populateServiceEditor);">Edit this service</a>';
//Enabling service sharing
document.getElementById("share-mashup").innerHTML =
- ' <a href="#"
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=mashup%>\');">Share this
service</a>';
+ ' <a href="#"
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=mashupServiceName%>\');">Share
this service</a>';
//Enabling service deletion
var delElem = document.getElementById("delete-service");
if (!(delElem == "undefined")) {
@@ -274,7 +277,7 @@
}
} else {
document.getElementById("service-status").innerHTML =
- "Service stopped. [<a href='#'
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashup%>\", true,
handleServiceStartStopCallback)'>Start</a>]";
+ "Service stopped. [<a href='#'
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashupServiceName%>\",
true, handleServiceStartStopCallback)'>Start</a>]";
//Disabling service editing
document.getElementById("edit-service").innerHTML =
"Service editing is not available";
@@ -295,13 +298,13 @@
if (serviceMashupObject.getServiceStatus() == "true") {
document.getElementById("service-status").innerHTML =
- "Service started. [<a href='#'
onclick='WSO2.MashupUtils.handleServiceStartStop(\"<%=mashup%>\", false,
handleServiceStartStopCallback)'>Stop</a>]";
+ "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(\'<%=mashup%>\',
wso2.mashup.populateServiceEditor);">Edit this service</a>';
+ '<a href="#"
onclick="wso2.mashup.services.getServiceDataForEditor(\'<%=mashupServiceName%>\',
wso2.mashup.populateServiceEditor);">Edit this service</a>';
//Enabling service sharing
document.getElementById("share-mashup").innerHTML =
- ' <a href="#"
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=mashup%>\');">Share this
service</a>';
+ ' <a href="#"
onclick="WSO2.MashupUtils.showMashupSharingDialog(\'<%=mashupServiceName%>\');">Share
this service</a>';
//Enabling service deletion
var delElem = document.getElementById("delete-service");
if (!(delElem == "undefined")) {
@@ -325,7 +328,7 @@
}
}
- wso2.mashup.services.listServiceData('<%=mashup%>',
listServiceDataCallback);
+ wso2.mashup.services.listServiceData('<%=mashupServiceName%>',
listServiceDataCallback);
</script>
<%}%>
<li>
@@ -344,7 +347,7 @@
}
function deleteService() {
- var confirmation = confirm("You are about to permanently delete the
'<%=mashup%>' service. Are you sure?")
+ var confirmation = confirm("You are about to permanently delete the
'<%=mashupServiceName%>' service. Are you sure?")
if (confirmation) {
wso2.mashup.services.deleteService('<%=mashup%>',
deleteServiceCallback);
@@ -418,7 +421,7 @@
</td>
<td>
<div class="mashup_details">
- <% String id = "rating" ; %>
+ <% String id = "rating"; %>
<%@ include file="rating.jsp" %>
</div>
</td>
@@ -444,11 +447,15 @@
isCustomUiAvailable('/services/<%=author%>/<%= mashup %>',
customUiCallback);
</script>
- <li><a href="/services/<%=author%>/<%= mashup %>?tryit"
title="?tryit">Try</a> the service</li>
- <li>Read <a href="/services/<%=author%>/<%= mashup %>?doc"
title="?doc">API documentation</a>
+ <li><a href="/services/<%=author%>/<%= mashup %>?tryit"
title="?tryit">Try</a> the
+ service
</li>
- <li>View the <a href="/services/<%=author%>/<%= mashup
%>?source&content-type=text/plain"
- title="?source">source code</a></li>
+ <li>Read <a href="/services/<%=author%>/<%= mashup %>?doc"
title="?doc">API
+ documentation</a>
+ </li>
+ <li>View the <a
+ href="/services/<%=author%>/<%= mashup
%>?source&content-type=text/plain"
+ title="?source">source code</a></li>
</ul>
</div>
@@ -461,17 +468,22 @@
<td>
<div class="mashup_details">
<ul>
- <li><a href="/services/<%=author%>/<%= mashup
%>?wsdl2&annotation=true">WSDL 2.0</a> (<a
+ <li><a href="/services/<%=author%>/<%= mashup
%>?wsdl2&annotation=true">WSDL 2.0</a>
+ (<a
href="/services/<%=author%>/<%= mashup
%>?wsdl2">raw</a>)
</li>
- <li><a href="/services/<%=author%>/<%= mashup
%>?wsdl&annotation=true">WSDL 1.1</a> (<a
+ <li><a href="/services/<%=author%>/<%= mashup
%>?wsdl&annotation=true">WSDL 1.1</a>
+ (<a
href="/services/<%=author%>/<%= mashup
%>?wsdl">raw</a>)
</li>
- <li><a href="/services/<%=author%>/<%= mashup
%>?xsd&annotation=true">XML Schema</a> (<a
+ <li><a href="/services/<%=author%>/<%= mashup
%>?xsd&annotation=true">XML Schema</a>
+ (<a
href="/services/<%=author%>/<%= mashup %>?xsd">raw</a>)
</li>
- <li><a href="/services/<%=author%>/<%= mashup
%>?stub">Javascript (DOM) stub</a></li>
- <li><a href="/services/<%=author%>/<%= mashup
%>?stub&lang=e4x">Javascript (E4X) stub</a></li>
+ <li><a href="/services/<%=author%>/<%= mashup
%>?stub">Javascript (DOM) stub</a>
+ </li>
+ <li><a href="/services/<%=author%>/<%= mashup
%>?stub&lang=e4x">Javascript (E4X)
+ stub</a></li>
</ul>
</div>
</td>
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev