roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r414311 - in /incubator/roller/branches/roller_3.0/src/org/apache/roller/ui: core/RollerContext.java rendering/search/SearchServlet.java rendering/velocity/RSDServlet.java
Date Wed, 14 Jun 2006 16:28:00 GMT
Author: agilliland
Date: Wed Jun 14 09:27:58 2006
New Revision: 414311

URL: http://svn.apache.org/viewvc?rev=414311&view=rev
Log:
move Velocity initialization outside of servlet init and into RollerContext.


Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/search/SearchServlet.java
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/RSDServlet.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java?rev=414311&r1=414310&r2=414311&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/core/RollerContext.java
Wed Jun 14 09:27:58 2006
@@ -35,16 +35,11 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSessionEvent;
 import javax.sql.DataSource;
-
-import org.acegisecurity.ConfigAttributeDefinition;
-import org.acegisecurity.SecurityConfig;
-import org.acegisecurity.intercept.web.PathBasedFilterInvocationDefinitionMap;
 import org.acegisecurity.providers.ProviderManager;
 import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
 import org.acegisecurity.providers.encoding.Md5PasswordEncoder;
 import org.acegisecurity.providers.encoding.PasswordEncoder;
 import org.acegisecurity.providers.encoding.ShaPasswordEncoder;
-import org.acegisecurity.securechannel.ChannelProcessingFilter;
 import org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -57,7 +52,6 @@
 import org.apache.roller.model.Roller;
 import org.apache.roller.model.RollerFactory;
 import org.apache.roller.model.ScheduledTask;
-import org.apache.roller.pojos.UserData;
 import org.apache.roller.pojos.WeblogEntryData;
 import org.apache.roller.pojos.WebsiteData;
 import org.apache.roller.ui.core.pings.PingQueueTask;
@@ -69,6 +63,7 @@
 
 import EDU.oswego.cs.dl.util.concurrent.SynchronizedInt;
 import org.apache.roller.util.cache.CacheManager;
+import org.apache.velocity.runtime.RuntimeSingleton;
 
 
 /**
@@ -189,6 +184,7 @@
             
             initializeSecurityFeatures(mContext);
             
+            setupVelocity();
             roller.getThemeManager();
             setupIndexManager(roller);
             initializePingFeatures(roller);
@@ -203,6 +199,30 @@
         }
         
         mLogger.debug("RollerContext initialization complete");
+    }
+    
+    
+    private void setupVelocity() throws RollerException {
+        
+        mLogger.info("Initializing Velocity");
+        
+        // initialize the Velocity engine
+        Properties velocityProps = new Properties();
+        
+        try {
+            InputStream instream = this.mContext.getResourceAsStream("/WEB-INF/velocity.properties");
+            
+            velocityProps.load(instream);
+            
+            mLogger.debug("Velocity props = "+velocityProps);
+            
+            // init velocity
+            RuntimeSingleton.init(velocityProps);
+            
+        } catch (Exception e) {
+            throw new RollerException(e);
+        }
+        
     }
     
     

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/search/SearchServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/search/SearchServlet.java?rev=414311&r1=414310&r2=414311&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/search/SearchServlet.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/search/SearchServlet.java
Wed Jun 14 09:27:58 2006
@@ -36,7 +36,6 @@
  * This servlet retrieves (and displays) search results.
  *
  * @web.servlet name="SearchServlet" load-on-startup="5"
- * @web.servlet-init-param name="properties" value="/WEB-INF/velocity.properties"
  * @web.servlet-mapping url-pattern="/search/*"
  */
 public class SearchServlet extends PageServlet {

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/RSDServlet.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/RSDServlet.java?rev=414311&r1=414310&r2=414311&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/RSDServlet.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/rendering/velocity/RSDServlet.java
Wed Jun 14 09:27:58 2006
@@ -41,10 +41,6 @@
  *
  *
  * @web.servlet name="RSDServlet" load-on-startup="0"
- *
- * @web.servlet-init-param name="org.apache.velocity.properties" 
- * 		                  value="/WEB-INF/velocity.properties"
- *  
  * @web.servlet-mapping url-pattern="/rsd/*"
  *
  * @author Allen Gilliland



Mime
View raw message