[jboss-cvs] JBossBlog SVN: r317 - in trunk: src/model/org/jboss/blog/model/feed and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 27 05:52:02 EDT 2008


Author: adamw
Date: 2008-05-27 05:52:02 -0400 (Tue, 27 May 2008)
New Revision: 317

Modified:
   trunk/src/action/org/jboss/blog/session/tools/PostToToolsBean.java
   trunk/src/model/org/jboss/blog/model/feed/Feed.java
   trunk/view/common/post.xhtml
   trunk/view/manage/feed_mod.xhtml
Log:
Guest download

Modified: trunk/src/action/org/jboss/blog/session/tools/PostToToolsBean.java
===================================================================
--- trunk/src/action/org/jboss/blog/session/tools/PostToToolsBean.java	2008-05-19 12:54:45 UTC (rev 316)
+++ trunk/src/action/org/jboss/blog/session/tools/PostToToolsBean.java	2008-05-27 09:52:02 UTC (rev 317)
@@ -16,20 +16,6 @@
 @Scope(ScopeType.APPLICATION)
 @AutoCreate
 public class PostToToolsBean {
-    public String encodeLinkForDelicious(Post post) {
-        String link = post.getLink();
-        int hashPos;
-        if ((hashPos = link.indexOf('#')) != -1) {
-            link = link.substring(0, hashPos);
-        }
-
-        try {
-            return URLEncoder.encode(link, "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            return link;
-        }
-    }
-
     public String encodeTitleForDelicious(Post post) {
         try {
             return URLEncoder.encode(post.getTitle(), "UTF-8");
@@ -38,7 +24,7 @@
         }
     }
 
-    public String encodeLinkForDigg(Post post) {
+    public String encodeLink(Post post) {
         String link = post.getLink();
         int hashPos;
         if ((hashPos = link.indexOf('#')) != -1) {
@@ -48,7 +34,7 @@
         try {
             return URLEncoder.encode(link, "UTF-8");
         } catch (UnsupportedEncodingException e) {
-            return "";
+            return link;
         }
     }
 

Modified: trunk/src/model/org/jboss/blog/model/feed/Feed.java
===================================================================
--- trunk/src/model/org/jboss/blog/model/feed/Feed.java	2008-05-19 12:54:45 UTC (rev 316)
+++ trunk/src/model/org/jboss/blog/model/feed/Feed.java	2008-05-27 09:52:02 UTC (rev 317)
@@ -82,6 +82,9 @@
     private Boolean showDelicious;
 
     @Column
+    private Boolean showStumble;
+
+    @Column
     private Boolean restricted;
 
     public Integer getId() {
@@ -212,6 +215,14 @@
         this.showDelicious = showDelicious;
     }
 
+    public Boolean getShowStumble() {
+        return showStumble;
+    }
+
+    public void setShowStumble(Boolean showStumble) {
+        this.showStumble = showStumble;
+    }
+
     public Boolean getRestricted() {
         return restricted;
     }

Modified: trunk/view/common/post.xhtml
===================================================================
--- trunk/view/common/post.xhtml	2008-05-19 12:54:45 UTC (rev 316)
+++ trunk/view/common/post.xhtml	2008-05-27 09:52:02 UTC (rev 317)
@@ -38,19 +38,24 @@
 
     <s:fragment rendered="#{showPostTo and post.feed.showDzone}">
         <img src="http://www.dzone.com/links/themes/reader/images/actions/icon-vote.gif" alt="" />
-        <a href="http://www.dzone.com/links/add.html?url=#{postToTools.encodeLinkForDelicious(post)}&amp;title=#{postToTools.encodeTitleForDelicious(post)}">
+        <a href="http://www.dzone.com/links/add.html?url=#{postToTools.encodeLink(post)}&amp;title=#{postToTools.encodeTitleForDelicious(post)}">
             Post to DZone</a> &#160;
     </s:fragment>
     <s:fragment rendered="#{showPostTo and post.feed.showDelicious}">
         <img src="http://images.del.icio.us/static/img/delicious.small.gif" alt="" />
-        <a href="http://del.icio.us/post?v=4&amp;url=#{postToTools.encodeLinkForDelicious(post)}&amp;title=#{postToTools.encodeTitleForDelicious(post)}">
+        <a href="http://del.icio.us/post?v=4&amp;url=#{postToTools.encodeLink(post)}&amp;title=#{postToTools.encodeTitleForDelicious(post)}">
             Post to del.icio.us</a> &#160;
     </s:fragment>
     <s:fragment rendered="#{showPostTo and post.feed.showDigg}">
         <img src="http://digg.com/img/badges/10x10-digg-thumb.png" alt="" />
-        <a href="http://digg.com/submit?url=#{postToTools.encodeLinkForDigg(post)}&amp;title=#{postToTools.encodeTitleForDigg(post)}&amp;bodytext=#{postToTools.encodeBodyForDigg(post)}&amp;media=news&amp;topic=programming">
-            Digg this!</a>
+        <a href="http://digg.com/submit?url=#{postToTools.encodeLink(post)}&amp;title=#{postToTools.encodeTitleForDigg(post)}&amp;bodytext=#{postToTools.encodeBodyForDigg(post)}&amp;media=news&amp;topic=programming">
+            Digg this!</a> &#160;
     </s:fragment>
+    <s:fragment rendered="#{showPostTo and post.feed.showStumble}">
+        <img border="0" src="http://cdn.stumble-upon.com/images/16x16_su_3d.gif" width="10" height="10" alt="" />
+        <a href="http://www.stumbleupon.com/submit?url=#{postToTools.encodeLink(post)}&amp;title=#{postToTools.encodeTitleForDelicious(post)}">
+            Stumble It!</a>
+    </s:fragment>
 
     <hr />
 </ui:composition>
\ No newline at end of file

Modified: trunk/view/manage/feed_mod.xhtml
===================================================================
--- trunk/view/manage/feed_mod.xhtml	2008-05-19 12:54:45 UTC (rev 316)
+++ trunk/view/manage/feed_mod.xhtml	2008-05-27 09:52:02 UTC (rev 317)
@@ -142,6 +142,13 @@
     <h:selectBooleanCheckbox id="showDzone" value="#{feedMod.feed.showDzone}" />
 </h:panelGroup>
 
+<h:outputLabel for="showStumble">
+    Add a "Stumble It!" link to every post:
+</h:outputLabel>
+<h:panelGroup>
+    <h:selectBooleanCheckbox id="showStumble" value="#{feedMod.feed.showStumble}" />
+</h:panelGroup>
+
 <h:outputLabel for="restricted" rendered="#{advanced}">
     This is a restricted feed, viewable only by authorized users:
 </h:outputLabel>




More information about the jboss-cvs-commits mailing list