roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r414963 - /incubator/roller/branches/roller_3.0/contrib/plugins/src/org/apache/roller/presentation/velocity/plugins/readmore/ReadMorePlugin.java
Date Sat, 17 Jun 2006 00:05:56 GMT
Author: agilliland
Date: Fri Jun 16 17:05:56 2006
New Revision: 414963

URL: http://svn.apache.org/viewvc?rev=414963&view=rev
Log:
deprecating old read more plugin.  it no longer does anything.


Modified:
    incubator/roller/branches/roller_3.0/contrib/plugins/src/org/apache/roller/presentation/velocity/plugins/readmore/ReadMorePlugin.java

Modified: incubator/roller/branches/roller_3.0/contrib/plugins/src/org/apache/roller/presentation/velocity/plugins/readmore/ReadMorePlugin.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/contrib/plugins/src/org/apache/roller/presentation/velocity/plugins/readmore/ReadMorePlugin.java?rev=414963&r1=414962&r2=414963&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/contrib/plugins/src/org/apache/roller/presentation/velocity/plugins/readmore/ReadMorePlugin.java
(original)
+++ incubator/roller/branches/roller_3.0/contrib/plugins/src/org/apache/roller/presentation/velocity/plugins/readmore/ReadMorePlugin.java
Fri Jun 16 17:05:56 2006
@@ -34,14 +34,17 @@
 
 /**
  * DEPRECATED. Truncates entry text and displays a link to read more.
+ *
+ * This plugin is no longer functional.  It now just returns the orginal
+ * text without performing any transformation.
  */
 public class ReadMorePlugin implements WeblogEntryPlugin {
     
     private static Log mLogger = LogFactory.getLog(ReadMorePlugin.class);
     
     protected String name = "Read More Summary";
-    protected String description = "Stops entry after 250 characters and creates " +
-            "a link to the full entry.";
+    protected String description = "This plugin is no longer functional.  "+
+            "Please use Roller's entry summary field instead.";
     
     private String baseURL = "";
     
@@ -61,38 +64,15 @@
     }
     
     
-    public void init(WebsiteData website, Map model) throws RollerException {
-        this.baseURL = RollerContext.getRollerContext().getAbsoluteContextUrl();
-    }
+    public void init(WebsiteData website, Map model) throws RollerException {}
     
     
     public String render(WeblogEntryData entry, String str) {
-        // in case it didn't initialize
-        String pageLink = "Weblog";
-        try {
-            pageLink = getPageLink(
-                    RollerFactory.getRoller().getUserManager(), entry.getWebsite());
-        } catch (RollerException e) {
-            mLogger.warn("Unable to get pageLink", e);
-        }
-        
-        String result = Utilities.removeHTML(str, true);
-        result = Utilities.truncateText(result, 240, 260, "...");
-        //String result = Utilities.truncateNicely(entry.getText(), 240, 260, "... ");
         
-        // if the result is shorter, we need to add "Read More" link
-        if (result.length() < str.length()) {
-            String link = "<div class=\"readMore\"><a href=\"" +
-                    baseURL + entry.getPermaLink() + "\">Read More</a></div>";
-            
-            result += link;
-        }
-        return result;
-    }
-    
-    
-    private String getPageLink(UserManager mgr, WebsiteData website) throws RollerException
{
-        return website.getDefaultPage().getLink();
+        // this plugin has been deprecated now that Roller supports multiple
+        // entry text fields (summary & content).  this plugin now just returns
+        // the text it is passed in.
+        return str;
     }
     
 }



Mime
View raw message