Author: tyrell
Date: Thu Jan 17 04:49:26 2008
New Revision: 12409
Log:
Adding basic faulty services handling to the ui
Modified:
trunk/mashup/java/modules/www/index.jsp
trunk/mashup/java/modules/www/js/common.js
trunk/mashup/java/modules/www/search.jsp
Modified: trunk/mashup/java/modules/www/index.jsp
==============================================================================
--- trunk/mashup/java/modules/www/index.jsp (original)
+++ trunk/mashup/java/modules/www/index.jsp Thu Jan 17 04:49:26 2008
@@ -340,7 +340,24 @@
</a> (<%=result.getAuthor()%>)
</td>
<td colspan="2">
- <%=result.getDescription() %>
+ <div id="<%=result.getAuthor() + "_" + result.getName()%>">
+ <%
+ if (RegistryUtils.isFaultyMashup(registry, result.getPath())) {
+ %>
+ <div style="color: red;" >This mashup is faulty <a href="#"
+
onclick="showFaultDetails('<%=result.getAuthor() + "_" +
result.getName()%>');">details</a>
+ </div>
+ <textarea id="txt_<%=result.getAuthor() + "_" + result.getName()%>"
+ style="height: 50px; width: 100%; display:
none;"><%=result.getDescription()%>
+ </textarea>
+ <%
+ } else {
+ %>
+ <%=result.getDescription() %>
+ <%
+ }
+ %>
+ </div>
</td>
<td nowrap>
<%@ include file="rating.jsp" %>
Modified: trunk/mashup/java/modules/www/js/common.js
==============================================================================
--- trunk/mashup/java/modules/www/js/common.js (original)
+++ trunk/mashup/java/modules/www/js/common.js Thu Jan 17 04:49:26 2008
@@ -35,9 +35,9 @@
}
}
-function setRating(ratingDivId, mashupid, value) {
+function setRating(ratingDivId, mashupid, value) {
if (userLoggedOn) {
- new Ajax.Request("ajax_rating.jsp?path=" + mashupid + "&ratingDivId="
+ ratingDivId, {
+ new Ajax.Request("ajax_rating.jsp?path=" + mashupid + "&ratingDivId="
+ ratingDivId, {
method: "post",
parameters: {
"rating" : value
@@ -45,7 +45,7 @@
onFailure: function (transport) {
alert("error");
},
- onSuccess: function (transport){
+ onSuccess: function (transport) {
$(ratingDivId).replace(transport.responseText);
},
onComplete: function (transport) {
@@ -58,23 +58,31 @@
}
});
}
- });
+ });
}
}
function getInitialRating(ratingDivId, mashupid) {
- new Ajax.Request("ajax_rating.jsp?path=" + mashupid + "&ratingDivId=" +
ratingDivId, {
- method: "post",
- parameters: {
- "rating" : 0
- },
- onSuccess: function (transport){
- $(ratingDivId).replace(transport.responseText);
- },
- onFailure: function (transport) {
- alert("error");
- }
- });
+ new Ajax.Request("ajax_rating.jsp?path=" + mashupid + "&ratingDivId=" +
ratingDivId, {
+ method: "post",
+ parameters: {
+ "rating" : 0
+ },
+ onSuccess: function (transport) {
+ $(ratingDivId).replace(transport.responseText);
+ },
+ onFailure: function (transport) {
+ alert("error");
+ }
+ });
+}
+
+
+function showFaultDetails(elementIdSuffix) {
+ var textArea = document.getElementById("txt_" + elementIdSuffix);
+ var contentDiv = document.getElementById(elementIdSuffix);
+ contentDiv.innerHTML =
+ "<pre>" + textArea.value + "</pre>";
}
Modified: trunk/mashup/java/modules/www/search.jsp
==============================================================================
--- trunk/mashup/java/modules/www/search.jsp (original)
+++ trunk/mashup/java/modules/www/search.jsp Thu Jan 17 04:49:26 2008
@@ -351,6 +351,7 @@
<link href="css/styles.css" rel="stylesheet" type="text/css"/>
<script language="javascript" src="js/common.js"
type="text/javascript"></script>
<script language="javascript" src="js/prototype.js"
type="text/javascript"></script>
+ <script language="javascript" src="js/utils.js"
type="text/javascript"></script>
<script type="text/javascript">
userLoggedOn = <%=RegistryUtils.isLoggedIn(registry) %>;
@@ -420,14 +421,7 @@
$('activity-tab-right').className = "this-tab-right";
}
$(kind).show();
- }
-
- function showFaultDetails(elementIdSuffix) {
- var textArea = document.getElementById("txt_" + elementIdSuffix);
- var contentDiv = document.getElementById(elementIdSuffix);
- contentDiv.innerHTML =
- "<pre>" + textArea.value + "</pre>";
- }
+ }
</script>
</head>
@@ -893,8 +887,9 @@
<%
if (RegistryUtils.isFaultyMashup(registry, result.getPath())) {
%>
- This mashup is faulty <a href="#"
+ <div style="color: red;" >This mashup is faulty <a href="#"
onclick="showFaultDetails('<%=result.getAuthor() + "_" +
result.getName()%>');">details</a>
+ </div>
<textarea id="txt_<%=result.getAuthor() + "_" + result.getName()%>"
style="height: 50px; width: 100%; display:
none;"><%=result.getDescription()%>
</textarea>
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev