r7073 - in dumbhippo/trunk/server/src/com/dumbhippo/server: blocks impl
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7073 - in dumbhippo/trunk/server/src/com/dumbhippo/server: blocks impl
- Date: Mon, 17 Dec 2007 19:29:20 -0600 (CST)
Author: marinaz
Date: 2007-12-17 19:29:18 -0600 (Mon, 17 Dec 2007)
New Revision: 7073
Modified:
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AbstractFeedEntryBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AbstractPersonBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AccountQuestionBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/BlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/DeliciousBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/DiggBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/FlickrPersonBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/FlickrPhotosetBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupChatBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupMemberBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupRevisionBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/MusicChatBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/MySpacePersonBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/PostBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/RedditBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/TwitterPersonBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/YouTubePersonBlockView.java
dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java
Log:
Make all summary headings more consistent.
Have a spechial case for when the block was chatted about,
display corresponding heading and link to the page where one
can see the chat.
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AbstractFeedEntryBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AbstractFeedEntryBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AbstractFeedEntryBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -98,7 +98,7 @@
}
@Override
- public String getSummaryLink() {
+ public String getBlockSummaryLink() {
return entry.getLink().getUrl();
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AbstractPersonBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AbstractPersonBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AbstractPersonBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -46,4 +46,9 @@
throw new IllegalStateException("BlockView not populated yet, can't get source");
return userView;
}
+
+ @Override
+ public String getHomeUrl() {
+ return getEntitySource().getHomeUrl();
+ }
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AccountQuestionBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AccountQuestionBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/AccountQuestionBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -40,12 +40,12 @@
}
@Override
- public String getSummaryHeading() {
+ public String getBlockSummaryHeading() {
return "New feature";
}
@Override
- public String getSummaryLink() {
+ public String getBlockSummaryLink() {
return getQuestion().getMoreLink();
}
@@ -79,4 +79,9 @@
builder.closeElement();
}
+
+ @Override
+ public String getHomeUrl() {
+ return "/person?who=" + getUserBlockData().getUser().getId();
+ }
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/BlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/BlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/BlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -312,17 +312,6 @@
return DateUtils.formatTimeAgo(block.getTimestamp());
}
- /** See writeSummaryToXmlBuilder(), this provides a short heading shown in the
- * flash badge which has short summary versions of blocks. The style is like
- * "Dugg", "Posted", etc. see other existing examples.
- */
- public abstract String getSummaryHeading();
-
- /** See writeSummaryToXmlBuilder(), this provides the href for the link shown in the
- * flash badge which has short summary versions of blocks.
- */
- public abstract String getSummaryLink();
-
/** See writeSummaryToXmlBuilder(), this provides the text for the link shown in the flash
* badge which has short summary versions of blocks.
*/
@@ -410,4 +399,44 @@
else
return 0;
}
+
+ public String getSummaryHeading() {
+ if (getUserBlockData() != null && getUserBlockData().getParticipatedReason().equals(StackReason.CHAT_MESSAGE))
+ return "Chatted about";
+ else if (getStackReason().equals(StackReason.CHAT_MESSAGE))
+ return "Chat about";
+
+ return getBlockSummaryHeading();
+ }
+
+ /** See writeSummaryToXmlBuilder(), this provides a short heading shown in the
+ * flash badge which has short summary versions of blocks. The style is like
+ * "Dugg", "Posted", etc. see other existing examples.
+ */
+ public abstract String getBlockSummaryHeading();
+
+ // If a block was chatted about, we are better off linking to a
+ // page where the viewer can see both the chat messages and the link
+ // to the source of the block content, rather than link directly to the
+ // source of the block content.
+ // If we are displaying information about someone who participated in
+ // a chat, we should link to that person's page, since if we are including
+ // it in some sort of a badge, the block is likely going to be on the
+ // first page there. Otherwise, we provide a link to the person who was
+ // the source of the original block.
+ public String getSummaryLink() {
+ if (getUserBlockData() != null && getUserBlockData().getParticipatedReason().equals(StackReason.CHAT_MESSAGE))
+ return "/person?who=" + getUserBlockData().getUser().getId();
+ else if (getStackReason().equals(StackReason.CHAT_MESSAGE))
+ return getHomeUrl();
+
+ return getBlockSummaryLink();
+ }
+
+ /** See writeSummaryToXmlBuilder(), this provides the href for the link shown in the
+ * flash badge which has short summary versions of blocks.
+ */
+ public abstract String getBlockSummaryLink();
+
+ public abstract String getHomeUrl();
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/DeliciousBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/DeliciousBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/DeliciousBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -32,8 +32,8 @@
return "del.icio.us bookmark";
}
- public @Override String getSummaryHeading() {
- return "Shared";
+ public @Override String getBlockSummaryHeading() {
+ return "Bookmarked";
}
public ExternalAccountType getAccountType() {
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/DiggBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/DiggBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/DiggBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -29,10 +29,10 @@
@Override
public String getTypeTitle() {
- return "Dugg story";
+ return "Digg story";
}
- public @Override String getSummaryHeading() {
+ public @Override String getBlockSummaryHeading() {
return "Dugg";
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/FlickrPersonBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/FlickrPersonBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/FlickrPersonBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -36,11 +36,11 @@
return "flickrPerson";
}
- public @Override String getSummaryHeading() {
- return getTitle();
+ public @Override String getBlockSummaryHeading() {
+ return "Posted photos";
}
- public @Override String getSummaryLink() {
+ public @Override String getBlockSummaryLink() {
return getMoreThumbnailsLink();
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/FlickrPhotosetBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/FlickrPhotosetBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/FlickrPhotosetBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -90,15 +90,15 @@
return getTitle();
}
- public @Override String getSummaryHeading() {
- return "Posted Flickr photoset";
+ public @Override String getBlockSummaryHeading() {
+ return "Posted photoset";
}
- public @Override String getSummaryLink() {
+ public @Override String getBlockSummaryLink() {
return getMoreThumbnailsLink();
}
public @Override String getSummaryLinkText() {
- return getMoreThumbnailsTitle();
+ return "'" + photosetView.getTitle() + "'";
}
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupChatBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupChatBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupChatBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -108,4 +108,9 @@
public String getChatKind() {
return "group";
}
+
+ @Override
+ public String getHomeUrl() {
+ return group.getHomeUrl();
+ }
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupMemberBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupMemberBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupMemberBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -102,15 +102,35 @@
return "Group update";
}
- public @Override String getSummaryHeading() {
- return "Group membership changed";
+ public @Override String getBlockSummaryHeading() {
+ // same as in GroupMemberBlock.tag
+ switch (getStatus()) {
+ case INVITED_TO_FOLLOW:
+ return "Invited to follow";
+ case FOLLOWER:
+ return "Started following";
+ case INVITED:
+ return "Invited";
+ case ACTIVE:
+ return "Joined";
+ }
+
+ if (isStoppedFollowing())
+ return "Stopped following";
+
+ return "Left";
}
- public @Override String getSummaryLink() {
+ public @Override String getBlockSummaryLink() {
return group.getHomeUrl();
}
public @Override String getSummaryLinkText() {
return group.getName();
}
+
+ @Override
+ public String getHomeUrl() {
+ return group.getHomeUrl();
+ }
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupRevisionBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupRevisionBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/GroupRevisionBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -88,16 +88,16 @@
@Override
public String getTypeTitle() {
// we don't display a type title for this kind of block, but if we did...
- return "Group changed";
+ return "Group change";
}
@Override
- public String getSummaryHeading() {
- return "Group changed";
+ public String getBlockSummaryHeading() {
+ return "Changed group";
}
@Override
- public String getSummaryLink() {
+ public String getBlockSummaryLink() {
return group.getHomeUrl();
}
@@ -199,4 +199,9 @@
else
return null;
}
+
+ @Override
+ public String getHomeUrl() {
+ return group.getHomeUrl();
+ }
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/MusicChatBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/MusicChatBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/MusicChatBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -3,6 +3,9 @@
import java.util.Collections;
import java.util.List;
+import org.slf4j.Logger;
+
+import com.dumbhippo.GlobalSetup;
import com.dumbhippo.XmlBuilder;
import com.dumbhippo.persistence.Block;
import com.dumbhippo.persistence.GroupBlockData;
@@ -13,6 +16,9 @@
import com.dumbhippo.server.views.Viewpoint;
public class MusicChatBlockView extends AbstractPersonBlockView implements MusicBlockView {
+
+ static private final Logger logger = GlobalSetup.getLogger(MusicChatBlockView.class);
+
private TrackView trackView;
public MusicChatBlockView(Viewpoint viewpoint, Block block, UserBlockData ubd, boolean participated) {
@@ -54,11 +60,16 @@
return "Music Radar";
}
- public @Override String getSummaryHeading() {
- return "Quip";
+ // Since the stack reason for this type of block should alwayd be CHAT_MESSAGE,
+ // the following two methods should not end up being called, but rather the
+ // corresponding methods in AbstractPersonBlockView should return the same values.
+ public @Override String getBlockSummaryHeading() {
+ logger.warn("in MusicChatBlockView::getBlockSummaryHeading() which is not expected, stack reason is {}", getStackReason());
+ return "Chat about";
}
- public @Override String getSummaryLink() {
+ public @Override String getBlockSummaryLink() {
+ logger.warn("in MusicChatBlockView::getBlockSummaryLink() which is not expected, stack reason is {}", getStackReason());
return getPersonSource().getHomeUrl();
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/MySpacePersonBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/MySpacePersonBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/MySpacePersonBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -34,11 +34,11 @@
@Override
public String getTypeTitle() {
- return "MySpace Blog";
+ return "MySpace blog post";
}
- public @Override String getSummaryHeading() {
- return "MySpace";
+ public @Override String getBlockSummaryHeading() {
+ return "Blogged";
}
public ExternalAccountType getAccountType() {
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/PostBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/PostBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/PostBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -107,11 +107,11 @@
return "/visit?post=" + postView.getPost().getId();
}
- public @Override String getSummaryHeading() {
- return "Posted";
+ public @Override String getBlockSummaryHeading() {
+ return "Shared";
}
- public @Override String getSummaryLink() {
+ public @Override String getBlockSummaryLink() {
return getLink();
}
@@ -136,4 +136,9 @@
public String getDescriptionAsHtml() {
return postView.getTextAsHtml();
}
+
+ @Override
+ public String getHomeUrl() {
+ return getEntitySource().getHomeUrl();
+ }
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/RedditBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/RedditBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/RedditBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -9,7 +9,7 @@
public class RedditBlockView extends AbstractFeedEntryBlockView {
- public static String DEFAULT_TYPE_TITLE = "Reddit comment or post";
+ public static String DEFAULT_TYPE_TITLE = "Reddit post or comment";
private String typeTitle;
@@ -45,8 +45,13 @@
this.typeTitle = typeTitle;
}
- public @Override String getSummaryHeading() {
- return "Reddit";
+ public @Override String getBlockSummaryHeading() {
+ if (getTypeTitle().contains("Disliked"))
+ return "Disliked";
+ else if (getTypeTitle().contains("Liked"))
+ return "Liked";
+ else
+ return "Posted or commented";
}
public ExternalAccountType getAccountType() {
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/TwitterPersonBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/TwitterPersonBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/TwitterPersonBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -38,8 +38,8 @@
}
@Override
- public String getSummaryHeading() {
- return "Twitter";
+ public String getBlockSummaryHeading() {
+ return "Updated status";
}
public ExternalAccountType getAccountType() {
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/YouTubePersonBlockView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/YouTubePersonBlockView.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/blocks/YouTubePersonBlockView.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -36,11 +36,11 @@
return "youTubePerson";
}
- public @Override String getSummaryHeading() {
+ public @Override String getBlockSummaryHeading() {
return "Posted videos";
}
- public @Override String getSummaryLink() {
+ public @Override String getBlockSummaryLink() {
return getMoreThumbnailsLink();
}
Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java 2007-12-17 22:11:58 UTC (rev 7072)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/FacebookTrackerBean.java 2007-12-18 01:29:18 UTC (rev 7073)
@@ -623,7 +623,6 @@
}
});
- fbmlSb.append("<div>My accounts: ");
for (ExternalAccountView a : lovedAccounts) {
String imageTitle = a.getExternalAccount().getSiteName();
if (a.getExternalAccount().getLinkText().length() >0 )
@@ -633,7 +632,6 @@
"<img src='http://mugshot.org/images3/" + a.getIconName() + "' title='" + imageTitle + "' style='width: 16; height: 16; border: none; margin-right: 3px;'/>" +
"</a>");
}
- fbmlSb.append("</div>");
fbmlSb.append("<div style='margin-top:5px;margin-bottom:5px;'>Latest activity:</div>");
@@ -666,7 +664,7 @@
String visitMugshotText = "Visit my Mugshot Page";
if (resultsCount == INITIAL_BLOCKS_PER_PAGE);
visitMugshotText = visitMugshotText + " To See More";
- fbmlSb.append("<a target='_blank' style='font-size:12px;font-weight:bold;margin-top:20px;' href='" + getAbsoluteUrl("/person?who=" + user.getId().toString()) + "'>" +
+ fbmlSb.append("<a target='_blank' style='font-size:12px;font-weight:bold;padding-top:15px;' href='" + getAbsoluteUrl("/person?who=" + user.getId().toString()) + "'>" +
visitMugshotText + "</a>");
}
return fbmlSb.toString();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]