roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r280552 - in /incubator/roller/branches/roller_2.0: src/org/roller/business/ src/org/roller/business/hibernate/ src/org/roller/config/ src/org/roller/config/runtime/ src/org/roller/pojos/ src/org/roller/util/ tests/org/roller/util/ web/WEB-...
Date Tue, 13 Sep 2005 13:28:22 GMT
Author: snoopdave
Date: Tue Sep 13 06:28:00 2005
New Revision: 280552

URL: http://svn.apache.org/viewcvs?rev=280552&view=rev
Log:
Merged rev range 225819:280410 from trunk to roller_2.0 branch

Added:
    incubator/roller/branches/roller_2.0/src/org/roller/util/PropertyExpander.java
      - copied unchanged from r280410, incubator/roller/trunk/src/org/roller/util/PropertyExpander.java
    incubator/roller/branches/roller_2.0/tests/org/roller/util/PropertyExpanderTest.java
      - copied unchanged from r280410, incubator/roller/trunk/tests/org/roller/util/PropertyExpanderTest.java
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/ApplicationResources_de.properties
      - copied unchanged from r280410, incubator/roller/trunk/web/WEB-INF/classes/ApplicationResources_de.properties
Modified:
    incubator/roller/branches/roller_2.0/src/org/roller/business/FileManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/IndexManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/config/RollerConfig.java
    incubator/roller/branches/roller_2.0/src/org/roller/config/RollerRuntimeConfig.java
    incubator/roller/branches/roller_2.0/src/org/roller/config/runtime/RuntimeConfigDefsParser.java
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/PingTargetData.java   (props
changed)
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/log4j.properties
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/roller.properties
    incubator/roller/branches/roller_2.0/web/WEB-INF/classes/weblog.vm
    incubator/roller/branches/roller_2.0/web/website/edit-page.jsp

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/FileManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/FileManagerImpl.java?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/FileManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/FileManagerImpl.java Tue
Sep 13 06:28:00 2005
@@ -37,20 +37,17 @@
     
     /**
      * Create file manager.
-     * @param roller   Roller instance.
-     * @param realPath Path to Servlet context directory
      */
     public FileManagerImpl()
     {
         String uploaddir = RollerConfig.getProperty("uploads.dir");
         String uploadurl = RollerConfig.getProperty("uploads.url");
-        
+
+        // Note: System property expansion is now handled by RollerConfig.
+
         if(uploaddir == null || uploaddir.trim().length() < 1)
-            uploaddir = "${user.home}"+File.separator+"roller_data"+File.separator+"uploads";
-        
-        if(uploaddir.startsWith("${user.home}"))
-            uploaddir = System.getProperty("user.home") + uploaddir.substring(12);
-        
+            uploaddir = System.getProperty("user.home") + File.separator+"roller_data"+File.separator+"uploads";
+
         if( ! uploaddir.endsWith(File.separator))
             uploaddir += File.separator;
         

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/IndexManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/IndexManagerImpl.java?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/IndexManagerImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/IndexManagerImpl.java Tue
Sep 13 06:28:00 2005
@@ -88,13 +88,8 @@
             this.searchEnabled = false;
         
         // we also need to know what our index directory is
+        // Note: system property expansion is now handled by RollerConfig
         String indexDir = RollerConfig.getProperty("search.index.dir");
-        if (indexDir.indexOf("${user.home}") != -1) 
-        {
-            indexDir = StringUtils.replace(
-                    indexDir, "${user.home}",
-                    System.getProperty("user.home"));
-        }
 
         this.indexDir = indexDir.replace('/', File.separatorChar);
         

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/PropertiesManagerImpl.java
Tue Sep 13 06:28:00 2005
@@ -215,6 +215,10 @@
         RuntimeConfigDefs runtimeConfigDefs = 
                 RollerRuntimeConfig.getRuntimeConfigDefs();
         
+        // can't do initialization without our config defs
+        if(runtimeConfigDefs == null)
+            return props;
+        
         // iterator through all the definitions and add properties
         // that are not already in our props map
         ConfigDef configDef = null;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/business/hibernate/HibernatePlanetManagerImpl.java
Tue Sep 13 06:28:00 2005
@@ -52,6 +52,7 @@
 {
     protected Map lastUpdatedByGroup = new HashMap();
     protected static final String NO_GROUP = "zzz_nogroup_zzz";     
+
     private static Log logger = 
         LogFactory.getFactory().getInstance(HibernatePlanetManagerImpl.class);
 
@@ -366,7 +367,7 @@
         }
         return ret;
     }
-
+    
     public synchronized void clearCachedAggregations() 
     {
         aggregationsByGroup.purge();

Modified: incubator/roller/branches/roller_2.0/src/org/roller/config/RollerConfig.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/config/RollerConfig.java?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/config/RollerConfig.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/config/RollerConfig.java Tue Sep 13
06:28:00 2005
@@ -12,9 +12,11 @@
 import java.io.StringWriter;
 import java.util.Enumeration;
 import java.util.Properties;
+import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.roller.util.PropertyExpander;
 
 
 /**
@@ -24,35 +26,35 @@
  * @author Allen Gilliland
  */
 public class RollerConfig {
-    
+
     private static String default_config = "/roller.properties";
     private static String custom_config = "/roller-custom.properties";
     private static String custom_jvm_param = "roller.custom.config";
     private static File custom_config_file = null;
-    
+
     private static Properties mConfig;
-    
+
     private static Log mLogger =
             LogFactory.getFactory().getInstance(RollerConfig.class);
-    
-    
+
+
     /*
-     * Static block run once at class loading
-     *
-     * We load the default properties and any custom properties we find
-     */
+    * Static block run once at class loading
+    *
+    * We load the default properties and any custom properties we find
+    */
     static {
         mConfig = new Properties();
-        
+
         try {
             // we'll need this to get at our properties files in the classpath
             Class config_class = Class.forName("org.roller.config.RollerConfig");
-            
+
             // first, lets load our default properties
             InputStream is = config_class.getResourceAsStream(default_config);
             mConfig.load(is);
             mLogger.info("successfully loaded default properties.");
-            
+
             // now, see if we can find our custom config
             is = config_class.getResourceAsStream(custom_config);
             if(is != null) {
@@ -61,12 +63,12 @@
             } else {
                 mLogger.info("no custom properties file found in classpath");
             }
-            
+
             // finally, check for an external config file
             String env_file = System.getProperty(custom_jvm_param);
             if(env_file != null && env_file.length() > 0) {
                 custom_config_file = new File(env_file);
-                
+
                 // make sure the file exists, then try and load it
                 if(custom_config_file != null && custom_config_file.exists()) {
                     is = new FileInputStream(custom_config_file);
@@ -77,15 +79,34 @@
                     mLogger.warn("failed to load custom properties from "+
                             custom_config_file.getAbsolutePath());
                 }
-                
+
             } else {
                 mLogger.info("no custom properties file specified via jvm option");
             }
-            
+
+            // Now expand system properties for properties in the config.expandedProperties
list,
+            // replacing them by their expanded values.
+            String expandedPropertiesDef = (String) mConfig.get("config.expandedProperties");
+            if (expandedPropertiesDef != null) {
+                String[] expandedProperties = expandedPropertiesDef.split(",");
+                for (int i = 0; i < expandedProperties.length; i++) {
+                    String propName = expandedProperties[i].trim();
+                    String initialValue = (String) mConfig.get(propName);
+                    if (initialValue != null) {
+                        String expandedValue = PropertyExpander.expandSystemProperties(initialValue);
+                        mConfig.put(propName,expandedValue);
+                        if (mLogger.isDebugEnabled()) {
+                            mLogger.info("Expanded value of " + propName + " from '" +
+                                initialValue + "' to '" + expandedValue + "'");
+                        }
+                    }
+                }
+            }
+
             // some debugging for those that want it
             if(mLogger.isDebugEnabled()) {
                 mLogger.debug("RollerConfig looks like this ...");
-                
+
                 String key = null;
                 Enumeration keys = mConfig.keys();
                 while(keys.hasMoreElements()) {
@@ -93,18 +114,18 @@
                     mLogger.debug(key+"="+mConfig.getProperty(key));
                 }
             }
-            
+
         } catch (Exception e) {
             e.printStackTrace();
         }
-        
+
     }
-    
-    
+
+
     // no, you may not instantiate this class :p
     private RollerConfig() {}
-    
-    
+
+
     /**
      * Retrieve a property value
      *
@@ -115,23 +136,23 @@
         mLogger.debug("Fetching property ["+key+"="+mConfig.getProperty(key)+"]");
         return mConfig.getProperty(key);
     }
-    
-    
+
+
     /**
      * Retrieve a property as a boolean ... defaults to false if there is an error
      **/
     public static boolean getBooleanProperty(String name) {
-        
+
         // get the value first, then convert
         String value = RollerConfig.getProperty(name);
-        
+
         if(value == null)
             return false;
-        
+
         return (new Boolean(value)).booleanValue();
     }
-    
-    
+
+
     /**
      * Retrieve all property keys
      *
@@ -140,8 +161,8 @@
     public static Enumeration keys() {
         return mConfig.keys();
     }
-    
-    
+
+
     /**
      * Set the "uploads.dir" property at runtime.
      *
@@ -150,13 +171,13 @@
      * uploads to the webapp context and we can only get that path at runtime.
      */
     public static void setUploadsDir(String path) {
-        
+
         // only do this if the user wants to use the webapp context
         if("${webapp.context}".equals(mConfig.getProperty("uploads.dir")))
             mConfig.setProperty("uploads.dir", path);
     }
-    
-    
+
+
     /**
      * Set the "context.realpath" property at runtime.
      *
@@ -167,8 +188,8 @@
      * This property is *not* persisted in any way.
      */
     public static void setContextPath(String path) {
-        
+
         mConfig.setProperty("context.realpath", path);
     }
-    
+
 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/config/RollerRuntimeConfig.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/config/RollerRuntimeConfig.java?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/config/RollerRuntimeConfig.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/config/RollerRuntimeConfig.java Tue
Sep 13 06:28:00 2005
@@ -103,7 +103,7 @@
             // unmarshall the config defs file
             try {
                 InputStream is = 
-                        RollerConfig.class.getResourceAsStream(runtime_config);
+                        RollerRuntimeConfig.class.getResourceAsStream(runtime_config);
                 
                 RuntimeConfigDefsParser parser = new RuntimeConfigDefsParser();
                 configDefs = parser.unmarshall(is);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/config/runtime/RuntimeConfigDefsParser.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/config/runtime/RuntimeConfigDefsParser.java?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/config/runtime/RuntimeConfigDefsParser.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/config/runtime/RuntimeConfigDefsParser.java
Tue Sep 13 06:28:00 2005
@@ -35,6 +35,9 @@
     public RuntimeConfigDefs unmarshall(InputStream instream) 
         throws IOException, JDOMException {
         
+        if(instream == null)
+            throw new IOException("InputStream is null!");
+        
         RuntimeConfigDefs configs = new RuntimeConfigDefs();
         
         SAXBuilder builder = new SAXBuilder();

Propchange: incubator/roller/branches/roller_2.0/src/org/roller/pojos/PingTargetData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/flavors/atom.vm Tue Sep 13 06:28:00
2005
@@ -2,10 +2,17 @@
 <feed xmlns="http://www.w3.org/2005/Atom">
     <title>$utilities.textToHTML($website.name,true)</title>
     <subtitle>$utilities.textToHTML($website.description,true)</subtitle>
+    #if( $userName != "zzz_none_zzz" )    
     <id>$absBaseURL/flavor/${website.handle}?flavor=atom</id>
     <link rel="alternate" type="text/html" href="$websiteURL" />
     <link rel="self" type="application/atom+xml" 
        href="$absBaseURL/flavor/${website.handle}?flavor=atom" />
+    #else
+    <id>$absBaseURL/flavor?flavor=atom</id>
+    <link rel="alternate" type="text/html" href="$websiteURL" />
+    <link rel="self" type="application/atom+xml" 
+        href="$absBaseURL/flavor?flavor=atom" />
+    #end
     <updated>$utilities.formatIso8601Date($updateTime)</updated>
     <generator uri="http://www.rollerweblogger.org" version="#showVersion() ($rollerBuildTime:$rollerBuildUser)">
        Roller Weblogger

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/log4j.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/log4j.properties?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/log4j.properties (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/log4j.properties Tue Sep 13 06:28:00
2005
@@ -1,44 +1,20 @@
 # Properties for configuring Log4j for this application
 # This is the configuring for logging displayed in the Application Server
-# log4j.rootCategory=INFO, stdout, R, mail
-log4j.rootCategory=INFO, stdout, R
+log4j.rootCategory=INFO, roller
 
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-
-# Pattern to output the caller's file name and line number.
-#log4j.appender.stdout.layout.ConversionPattern=%p [%t] [%c] %C{1}.%M(%L) | %m%n
-log4j.appender.stdout.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} | %C{1}:%M
| %m%n
-
-log4j.appender.R=org.apache.log4j.RollingFileAppender
-#log4j.appender.R.File=${catalina.base}/logs/roller.log
-log4j.appender.R.File=roller.log
-
-# Keep two 1MB log backup files
-log4j.appender.R.MaxFileSize=1MB
-log4j.appender.R.MaxBackupIndex=2
-
-log4j.appender.R.layout=org.apache.log4j.PatternLayout
-#log4j.appender.R.layout.ConversionPattern=%5p %t %c - %m%n
-log4j.appender.R.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %C{1}:%M - %m%n
-
-# If programmed properly the most messages would be at DEBUG
-# and the least at FATAL.
+log4j.appender.roller=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.roller.File=${catalina.base}/logs/roller.log
+log4j.appender.roller.layout=org.apache.log4j.PatternLayout
+log4j.appender.roller.layout.ConversionPattern=%-5p %d{yyyy-MM-dd HH:mm:ss,SSS} %C{1}:%M
- %m%n
 
 # Options are: DEBUG, INFO, WARN, ERROR, FATAL
 log4j.category.org.roller=INFO
 log4j.category.com.ecyrd.jspwiki=ERROR
 log4j.category.com.opensymphony.oscache=ERROR
 log4j.category.org.hibernate=ERROR
-log4j.category.org.roller.business.utils=INFO
 log4j.category.org.apache.struts=ERROR
 log4j.category.org.tuckey.web.filters.urlrewrite=DEBUG
 
-#log4j.category.org.roller.presentation.MainPageAction=DEBUG
-#log4j.category.org.roller.presentation.pagecache.rollercache.LRUCacheHandler=DEBUG
-#log4j.category.org.roller.presentation.filters.IfModifiedFilter=DEBUG
-#log4j.category.org.roller.persistence.hibernate.HibernateStrategy=DEBUG
-
 # Tomcat's ClientAbortExceptions cause Velocity to talk way
 # too much so by default Velocity is set to STFU mode.
 log4j.category.org.apache.velocity=FATAL
@@ -54,5 +30,3 @@
 
 #log4j.appender.mail.layout=org.apache.log4j.PatternLayout
 #log4j.appender.mail.layout.ConversionPattern=%p [%d{yyyy-MM-dd HH:mm:ss,SSS}] %C{1}.%M(%L)
| %m%n
-
-

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/roller.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/roller.properties?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/roller.properties (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/roller.properties Tue Sep 13
06:28:00 2005
@@ -24,6 +24,7 @@
 # properties in this file are accessed like this ...
 #    RollerConfig.getProperty("propname");
 
+<<<<<<< .working
 # User management settings
 
 # True to allow users to register themselves via a "register" link on the main
@@ -35,6 +36,13 @@
 # than one weblog and from joining other weblogs.
 groupblogging.enabled=true
 
+#---------------------------------
+# Property expansion settings
+
+# Values of the properties in this list get system property expansion 
+# applied to them when loaded.
+config.expandedProperties=uploads.dir,search.index.dir
+
 #----------------------------------
 # Upload settings
 
@@ -54,7 +62,7 @@
 search.index.dir=${user.home}/roller_data/search-index
 
 #----------------------------------
-# Cache settings, remember ... times are in milliseconds
+# Cache settings, remember ... times are in seconds
 # Default settings suitable for 100 user system
 
 # Number of RSS feeds to cache (and timeout)
@@ -97,7 +105,8 @@
 
 # Weblog entry editor plugins (all are off by default).
 plugins.page=\
-org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin \
+org.roller.presentation.velocity.plugins.convertbreaks.ConvertLineBreaksPlugin \
+,org.roller.presentation.velocity.plugins.topictag.TopicTagPlugin \
 ,org.roller.presentation.velocity.plugins.textile.TextilePlugin \
 ,org.roller.presentation.velocity.plugins.acronyms.AcronymsPlugin \
 ,org.roller.presentation.velocity.plugins.bookmarks.BookmarkPlugin \

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/classes/weblog.vm
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/classes/weblog.vm?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/classes/weblog.vm (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/classes/weblog.vm Tue Sep 13 06:28:00
2005
@@ -240,38 +240,6 @@
 #end
 
 #**
- * Display link to chronologically previous entry in the
- * same category (if specified).
-**#
-#macro( showPreviousEntryLink $category)
-    <span id="previousEntry">
-    #if( $pageModel.previousEntry )
-        #if ( $category != 'nil' )#set( $catPath = $category )#end  ## was a category supplied?
-        #set( $previousEntry = $pageModel.previousEntry )
-        <a href="$ctxPath$previousEntry.getPermaLink($catPath)"
-            title="Previous Entries"
-            >&laquo; $utilities.truncateNicely($previousEntry.title, 30, 30, "...")</a>
-    #end
-    </span>
-#end
-
-#**
- * Display link to chronologically next entry in the
- * same category (if specified).
-**#
-#macro( showNextEntryLink $category)
-    <span id="nextEntry">
-    #if( $pageModel.nextEntry )
-        #if ( $category != 'nil' )#set( $catPath = $category )#end  ## was a category supplied?
-        #set( $nextEntry = $pageModel.nextEntry )
-        <a href="$ctxPath$nextEntry.getPermaLink($catPath)"
-            title="Next Entries"
-            >$utilities.truncateNicely($nextEntry.title, 30, 30, "...") &raquo;</a>
-    #end
-    </span>
-#end
-
-#**
  * Shows weblog entries from specified category 
  * using specified page as a "day template" for the display of each day.
  * If a specific weblog entry is specified by the current request (using
@@ -318,11 +286,6 @@
         #if( $searchResults )
             #showSearchPager()
         #end
-
-        <div class="next-previous">
-        #showPreviousEntryLink($category)
-        #showNextEntryLink($category)
-        </div>
     #end
 #end
 
@@ -431,32 +394,81 @@
  * display link to "main" page if either is present.
 **#
 #macro( showNextPreviousLinks )
+    #set( $npcat = 'nil' )
     #set( $catLink = "" )
-    #if ( $catPath ) #set( $catLink = "?catname=$catPath" ) #end
+    #if ( $catPath && $catPath != "") 
+        #set( $npcat = $catPath )
+        #set( $catLink = "?catname=$catPath" ) 
+    #end
     <div class="next-previous">
     #if ($pageModel.previousEntry)
-        #set( $previousEntry = $pageModel.previousEntry )
-        <a href="$ctxPath/page/$userName/$page.link/$utilities.encode($previousEntry.anchor)$catLink"
-            title="$previousEntry.title"
-            >&laquo; $utilities.truncateNicely($previousEntry.title, 30, 30, "...")</a>
|
+        #showPrevEntryLink($npcat) |
     #end
-
     #if ( $pageModel.previousEntry || $pageModel.nextEntry)
         <a href="$ctxPath/page/$userName/$page.link$catLink">$page.name</a>
     #end
-
     #if ($pageModel.nextEntry)
-        #set( $nextEntry = $pageModel.nextEntry )
-        | <a href="$ctxPath/page/$userName/$page.link/$utilities.encode($nextEntry.anchor)$catLink"
-            title="$nextEntry.title"
-            >$utilities.truncateNicely($nextEntry.title, 30, 30, "...") &raquo;</a>
+        | #showNextEntryLink($npcat)
     #end
     </div>
 #end
 
 #**
+ * Display link to chronologically previous entry in the
+ * same category (if specified).
+**#
+#macro( showPrevEntryLink $category)
+    <span id="previousEntry">
+    #if( $pageModel.previousEntry )
+        #set( $prev = $pageModel.previousEntry )
+        #set( $prevURL = "$baseURL/page/${prev.website.user.userName}/#formatDate($plainFormat
${prev.pubTime})" )
+        #if ( $category != 'nil' ) #set( $prevURL = "$prevURL?catname=$category" )#end
+        <a href="$prevURL" title="Previous Entries"
+            >&laquo; $utilities.truncateNicely($prev.title, 30, 30, "...")</a>
+    #end
+    </span>
+#end
+
+#**
+ * Display link to chronologically next entry in the
+ * same category (if specified).
+**#
+#macro( showNextEntryLink $category)
+    <span id="nextEntry">
+    #if( $pageModel.nextEntry )
+        #set( $next = $pageModel.nextEntry )
+        #set( $nextURL = "$baseURL/page/${next.website.user.userName}/#formatDate($plainFormat
${next.pubTime})" )
+        #if ( $category != 'nil' ) #set( $nextURL = "$nextURL?catname=$category" )#end 
+        <a href="$nextURL" title="Next Entries"
+            >$utilities.truncateNicely($next.title, 30, 30, "...") &raquo;</a>
+    #end
+    </span>
+#end
+
+#**
  * Method to retrieve a full encoded anchor tag for a WeblogEntry.
 **#
 #macro( showAnchorTag $entry )
     <a name="$utilities.encode($entry.anchor)" id="$utilities.encode($entry.anchor)"></a>
+#end
+
+#**
+ * Display a trackback auto-discovery comment for a WeblogEntry.
+ **#
+#macro( showTrackbackAutodiscovery $entry )
+<!--
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+         xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
+         xmlns:dc="http://purl.org/dc/elements/1.1/">
+<rdf:Description
+    rdf:about="$absBaseURL$entry.permaLink"
+    trackback:ping="#showTrackbackURL($entry)"
+    dc:title="$entry.title"
+    dc:identifier="$absBaseURL$entry.permaLink"
+    dc:subject="$entry.category.name"
+    dc:description="$entry.title"
+    dc:creator="$entry.website.user.userName"
+    dc:date="$entry.pubTime" />
+</rdf:RDF>
+-->
 #end

Modified: incubator/roller/branches/roller_2.0/web/website/edit-page.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/website/edit-page.jsp?rev=280552&r1=280551&r2=280552&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/website/edit-page.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/website/edit-page.jsp Tue Sep 13 06:28:00 2005
@@ -37,9 +37,11 @@
             <html:textarea property="description" rows="3" cols="50"/>
             </td>
         </tr>
-
     </table>
-
+    
+    <fmt:message key="pageForm.template" /><br />
+    <html:textarea property="contents" cols="80" rows="30" style="width: 100%" />
+            
     <fmt:message key="pageForm.template" /><br />
     <html:textarea property="contents" cols="80" rows="30" style="width: 100%" />
             



Mime
View raw message