Author: jonathan
Date: Mon Sep 22 14:38:19 2008
New Revision: 22018
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=22018

Log:
MASHUP-1116:  Improved reporting of comment deletions.
Reported mashup name instead of mashup path on comments and in the feed title.
Added missing space on feeds.
Changes feed entries - titles were too generic - the activity report now is the 
entry title.  When the activity is a new comment the comment text is in the 
entry description.


Modified:
   trunk/mashup/java/modules/www/activity.jsp
   trunk/mashup/java/modules/www/index.jsp
   trunk/mashup/java/modules/www/search.jsp

Modified: trunk/mashup/java/modules/www/activity.jsp
URL: 
http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/activity.jsp?rev=22018&r1=22017&r2=22018&view=diff
==============================================================================
--- trunk/mashup/java/modules/www/activity.jsp  (original)
+++ trunk/mashup/java/modules/www/activity.jsp  Mon Sep 22 14:38:19 2008
@@ -97,16 +97,14 @@
                     if (action.equals("deleted")) { %>
                     <%=result.getName()%>
                     <% } else { %>
-                    <a 
href="mashup.jsp?author=<%=result.getAuthor()%>&mashup=<%=result.getName()%>"><%=result.getName()%>
-                    </a>
+                    <a 
href="mashup.jsp?author=<%=result.getAuthor()%>&mashup=<%=result.getName()%>"><%=result.getName()%></a>
                     <% }
                         if (action.equals("rated")) { %>
                     <%=result.getContentString() %> stars
                     <% } else if (action.equals("tagged")) { %>
                     with <a
                         
href="search.jsp?query=mashups&for=<%=result.getContentString()%>&tags=true"><%=result
-                        .getContentString()%>
-                </a>
+                        .getContentString()%></a>
                     <% } else if (action.equals("commented")) { %>
                     <span class="inline-comment">"<%= 
MashupUtils.makeWrappable(result.getContentString(), 60) %>"</span>
                     <% } %>

Modified: trunk/mashup/java/modules/www/index.jsp
URL: 
http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/index.jsp?rev=22018&r1=22017&r2=22018&view=diff
==============================================================================
--- trunk/mashup/java/modules/www/index.jsp     (original)
+++ trunk/mashup/java/modules/www/index.jsp     Mon Sep 22 14:38:19 2008
@@ -293,9 +293,18 @@
         <% } %>
         <%= action %>
         <% if (action.equals("commented")) { %>on<% }
-           if (action.equals("deleted")) { %>
-            <%=result.getName()%>
-        <% } else { %>
+           if (action.equals("deleted")) {
+              String activityTarget = result.getName();
+              if (activityTarget.indexOf(";comments") >= 0) {
+                  activityTarget = activityTarget.substring(0, 
activityTarget.indexOf(";comments"));
+                  %>
+                  a comment on <a 
href="mashup.jsp?author=<%=result.getAuthor()%>&mashup=<%=activityTarget%>"><%=activityTarget%></a>
+                  <%
+              } else {
+                  %>
+              <%=result.getName()%>
+        <%    }
+           } else { %>
             <a 
href="mashup.jsp?author=<%=result.getAuthor()%>&mashup=<%=result.getName()%>"><%=result.getName()%></a>
         <% }
            if (action.equals("rated")) { %>

Modified: trunk/mashup/java/modules/www/search.jsp
URL: 
http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/search.jsp?rev=22018&r1=22017&r2=22018&view=diff
==============================================================================
--- trunk/mashup/java/modules/www/search.jsp    (original)
+++ trunk/mashup/java/modules/www/search.jsp    Mon Sep 22 14:38:19 2008
@@ -336,34 +336,38 @@
                 QueryResult result = (QueryResult) iter.next();
 
                 String mashupAuthor = RegistryUtils.getFullName(request, 
result.getPath().split("\\/")[2]);
+                String mashupName = result.getName();
+                if (mashupName.indexOf(";comments") >= 0) {
+                    mashupName = mashupName.substring(0, 
mashupName.indexOf(";comments"));
+                }
                 if (results.getResultsType().equals("activity")) {
                     String action = result.getAction();
-                    entryTitle = "Activity on " + mashupAuthor + "'s " + 
result.getName() + " service";
-                    entryDescription =
-                            RegistryUtils.getFullName(request, 
result.getAuthor()) +
-                            action +
-                            (action.equals("commented") ? " on " : " ") +
-                            mashupAuthor + "'s <strong>" + result.getName() + 
"</strong> service";
+                    entryDescription = "";
+                    entryTitle =
+                            RegistryUtils.getFullName(request, 
result.getAuthor()) + " " +
+                            action + " " +
+                            (action.equals("commented") ? "on " : "") +
+                            (action.equals("deleted") && 
result.getName().indexOf(";comments") >=0 ? "a comment on " : "") +
+                            mashupAuthor + "'s \"" + mashupName + "\" service";
                     if (action.equals("rated")) {
-                        entryDescription += " <strong>" + 
result.getContentString() + "</strong> stars.";
+                        entryTitle += " " + result.getContentString() + " 
stars.";
                     } else if (action.equals("tagged")) {
-                        entryDescription += " with <strong>" + 
result.getContentString() + "</strong>";
+                        entryTitle += " with " + result.getContentString();
                     } else if (action.equals("commented")) {
-                        entryDescription += ": <strong>" + 
result.getContentString() + "</strong>";
+                        entryDescription = "\"" + result.getContentString() + 
"\"";
                     }
                 } else if (results.getResultsType().equals("comment")) {
-                    String serviceName = result.getName().substring(0, 
result.getName().indexOf(";"));
                     entryTitle = RegistryUtils.getFullName(request, 
result.getAuthor()) + " commented on " +
-                            mashupAuthor + "'s " + serviceName + " service.";
+                            mashupAuthor + "'s " + mashupName + " service.";
                     entryDescription = result.getContentString();
                 } else {
-                    entryTitle = result.getName() + " by " + 
RegistryUtils.getFullName(request, result.getAuthor());
+                    entryTitle = mashupName + " by " + 
RegistryUtils.getFullName(request, result.getAuthor());
                     entryDescription = result.getDescription();
                 }
                 URL mashupLink = new URL(request.getScheme(),
                                          request.getServerName(),
                                          request.getServerPort(),
-                                         "/mashup.jsp?author=" + 
result.getAuthor() + "&mashup=" + result.getName());
+                                         "/mashup.jsp?author=" + 
result.getAuthor() + "&mashup=" + mashupName);
                 entryLink = mashupLink.toString();
                 entryDate = today;
                 entryAuthor = bundle.getString("main.title");
@@ -1003,9 +1007,18 @@
         <% } %>
         <%= action %>
         <% if (action.equals("commented")) { %>on<% } %>
-        <% if (action.equals("deleted")) { %>
+        <% if (action.equals("deleted")) {
+            String activityTarget = result.getName();
+            if (activityTarget.indexOf(";comments") >= 0) {
+                activityTarget = activityTarget.substring(0, 
activityTarget.indexOf(";comments"));
+                %>
+                a comment on <a 
href="mashup.jsp?author=<%=result.getAuthor()%>&mashup=<%=activityTarget%>"><%=activityTarget%></a>
+                <%
+            } else {
+                %>
             <%=result.getName()%>
-        <% } else { %>
+        <%  }
+            } else { %>
             <a 
href="mashup.jsp?author=<%=result.getAuthor()%>&mashup=<%=result.getName()%>"><%=result.getName()%></a>
         <% }
            if (action.equals("rated")) { %>

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

Reply via email to