Author: keith Date: Thu Feb 12 05:01:32 2009 New Revision: 30727 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=30727
Log: Fix for 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: branches/mashup/java/1.5/java/modules/www/activity.jsp branches/mashup/java/1.5/java/modules/www/index.jsp branches/mashup/java/1.5/java/modules/www/search.jsp Modified: branches/mashup/java/1.5/java/modules/www/activity.jsp URL: http://wso2.org/svn/browse/wso2/branches/mashup/java/1.5/java/modules/www/activity.jsp?rev=30727&r1=30726&r2=30727&view=diff ============================================================================== --- branches/mashup/java/1.5/java/modules/www/activity.jsp (original) +++ branches/mashup/java/1.5/java/modules/www/activity.jsp Thu Feb 12 05:01:32 2009 @@ -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: branches/mashup/java/1.5/java/modules/www/index.jsp URL: http://wso2.org/svn/browse/wso2/branches/mashup/java/1.5/java/modules/www/index.jsp?rev=30727&r1=30726&r2=30727&view=diff ============================================================================== --- branches/mashup/java/1.5/java/modules/www/index.jsp (original) +++ branches/mashup/java/1.5/java/modules/www/index.jsp Thu Feb 12 05:01:32 2009 @@ -291,9 +291,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: branches/mashup/java/1.5/java/modules/www/search.jsp URL: http://wso2.org/svn/browse/wso2/branches/mashup/java/1.5/java/modules/www/search.jsp?rev=30727&r1=30726&r2=30727&view=diff ============================================================================== --- branches/mashup/java/1.5/java/modules/www/search.jsp (original) +++ branches/mashup/java/1.5/java/modules/www/search.jsp Thu Feb 12 05:01:32 2009 @@ -336,34 +336,36 @@ 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."; } 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 +1005,17 @@ <% } %> <%= 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 { + %> + <% } + } else { %> <a href="mashup.jsp?author=<%=result.getAuthor()%>&mashup=<%=result.getName()%>"><%=result.getName()%></a> <% } if (action.equals("rated")) { %> _______________________________________________ Mashup-dev mailing list [email protected] https://wso2.org/cgi-bin/mailman/listinfo/mashup-dev
