roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r368947 - in /incubator/roller/trunk: sandbox/atomprotocol/src/org/roller/presentation/atomapi/ src/org/roller/presentation/ src/org/roller/presentation/filters/ src/org/roller/presentation/velocity/
Date Sat, 14 Jan 2006 01:37:31 GMT
Author: agilliland
Date: Fri Jan 13 17:37:26 2006
New Revision: 368947

URL: http://svn.apache.org/viewcvs?rev=368947&view=rev
Log:
EOLing the old RollerContext.getRoller() method.  The Roller instance is always available
via RollerFactory.getRoller().


Modified:
    incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
    incubator/roller/trunk/src/org/roller/presentation/RollerContext.java
    incubator/roller/trunk/src/org/roller/presentation/filters/PersistenceSessionFilter.java
    incubator/roller/trunk/src/org/roller/presentation/filters/RequestFilter.java
    incubator/roller/trunk/src/org/roller/presentation/velocity/FoafServlet.java
    incubator/roller/trunk/src/org/roller/presentation/velocity/RollerResourceLoader.java

Modified: incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java?rev=368947&r1=368946&r2=368947&view=diff
==============================================================================
--- incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
(original)
+++ incubator/roller/trunk/sandbox/atomprotocol/src/org/roller/presentation/atomapi/RollerAtomHandler.java
Fri Jan 13 17:37:26 2006
@@ -32,6 +32,7 @@
 import org.apache.struts.util.RequestUtils;
 import org.roller.model.FileManager;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.UserData;
 import org.roller.pojos.PermissionsData;
 import org.roller.pojos.WeblogCategoryData;
@@ -98,7 +99,7 @@
      */
     public RollerAtomHandler(HttpServletRequest request) {
         mRequest = request;
-        mRoller = RollerContext.getRoller(request);
+        mRoller = RollerFactory.getRoller();
         mRollerContext = RollerContext.getRollerContext(request);
         
         // TODO: decide what to do about authentication, is WSSE going to fly?

Modified: incubator/roller/trunk/src/org/roller/presentation/RollerContext.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/RollerContext.java?rev=368947&r1=368946&r2=368947&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/RollerContext.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/RollerContext.java Fri Jan 13 17:37:26
2006
@@ -64,35 +64,16 @@
  */
 public class RollerContext extends ContextLoaderListener implements ServletContextListener
 {
-    private static Log mLogger =
-        LogFactory.getFactory().getInstance(RollerContext.class);
+    private static Log mLogger = LogFactory.getLog(RollerContext.class);
 
     private String mVersion = null;
     private String mBuildTime = null;
     private String mBuildUser = null;
 
-    public static final String ROLLER_KEY = "session.roller";
     public static final String ROLLER_CONTEXT = "roller.context";
-    public static final String USER_RESOURCES = "/resources";
-    public static final String VERSION_KEY = "org.roller.version";
-    public static final String MEMDEBUG_KEY = "org.roller.memdebug";
-    public static final String INDEX_MGR_KEY = "org.roller.indexMgr";
-    public static final String HTTP_PORT = "http_port";
-    public static final String HTTPS_PORT = "https_port";
-    public static final String HTTPS_HEADER_NAME = "https_header_name";
-    public static final String HTTPS_HEADER_VALUE = "https_header_value";
-    private static final String HOURLY_TASK_KEY = "roller.hourly.tasks";
-    private static final String DAILY_TASK_KEY = "roller.daily.tasks";
-    
-    private static final String ROLLER_IMPL_KEY 
-        = "org.roller.persistence";
-    
-    private static final String ROLLER_COMMENT_AUTH_KEY 
-        = "org.roller.commentAuthenticatorClass";
 
     private static ServletContext mContext = null;
     private static Authenticator mAuthenticator = null;
-    private static CommentAuthenticator mCommentAuthenticator = null;
     private final SynchronizedInt mSessionCount = new SynchronizedInt(0);
     private boolean mMemDebug = false;
 
@@ -147,10 +128,7 @@
      */
     public void contextInitialized(ServletContextEvent sce)
     {
-        if (mLogger.isDebugEnabled())
-        {
-            mLogger.debug("RollerContext initializing");
-        }
+        mLogger.debug("RollerContext initializing");
 
         // Save context in self and self in context
         mContext = sce.getServletContext();
@@ -215,10 +193,7 @@
                 mMemDebug = true;
             }
 
-            if (mLogger.isDebugEnabled())
-            {
-                mLogger.debug("RollerContext initialization complete");
-            }
+            mLogger.debug("RollerContext initialization complete");
         }
         catch (Throwable t)
         {
@@ -437,16 +412,6 @@
         }
     }
 
-    //------------------------------------------------------------------------
-
-    /**
-     * Get an instance of Roller from the RollerFactory.
-     * If one does not exist, tell Factory to create new one.
-     */
-    public static Roller getRoller(HttpServletRequest req)
-    {
-        return RollerFactory.getRoller();
-    }
 
     //------------------------------------------------------------------------
 

Modified: incubator/roller/trunk/src/org/roller/presentation/filters/PersistenceSessionFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/filters/PersistenceSessionFilter.java?rev=368947&r1=368946&r2=368947&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/filters/PersistenceSessionFilter.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/filters/PersistenceSessionFilter.java
Fri Jan 13 17:37:26 2006
@@ -12,7 +12,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.model.Roller;
-import org.roller.presentation.RollerContext;
+import org.roller.model.RollerFactory;
 
 
 /**
@@ -38,7 +38,7 @@
         
         mLogger.debug("Entered PersistenceSessionFilter");
         
-        Roller roller = RollerContext.getRoller((HttpServletRequest)request);
+        Roller roller = RollerFactory.getRoller();
         try {
             chain.doFilter(request, response);
         } finally {

Modified: incubator/roller/trunk/src/org/roller/presentation/filters/RequestFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/filters/RequestFilter.java?rev=368947&r1=368946&r2=368947&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/filters/RequestFilter.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/filters/RequestFilter.java Fri Jan
13 17:37:26 2006
@@ -59,7 +59,7 @@
         HttpSession session = ((HttpServletRequest)req).getSession();
         HttpServletRequest request = (HttpServletRequest)req;
         HttpServletResponse response = (HttpServletResponse)res;
-        Roller roller = RollerContext.getRoller( request );
+        Roller roller = RollerFactory.getRoller();
         RollerRequest rreq = null;
         try {
             rreq = RollerRequest.getRollerRequest(

Modified: incubator/roller/trunk/src/org/roller/presentation/velocity/FoafServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/velocity/FoafServlet.java?rev=368947&r1=368946&r2=368947&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/velocity/FoafServlet.java (original)
+++ incubator/roller/trunk/src/org/roller/presentation/velocity/FoafServlet.java Fri Jan 13
17:37:26 2006
@@ -114,7 +114,7 @@
         
         // see if foaf:weblog is different Page
         WebsiteData website = rreq.getWebsite();
-        UserManager usrMgr = RollerContext.getRoller(request).getUserManager();
+        UserManager usrMgr = RollerFactory.getRoller().getUserManager();
         org.roller.pojos.Template weblog = website.getPageByName("Weblog");
         
         // if weblog != homepage, add to context

Modified: incubator/roller/trunk/src/org/roller/presentation/velocity/RollerResourceLoader.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/presentation/velocity/RollerResourceLoader.java?rev=368947&r1=368946&r2=368947&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/presentation/velocity/RollerResourceLoader.java
(original)
+++ incubator/roller/trunk/src/org/roller/presentation/velocity/RollerResourceLoader.java
Fri Jan 13 17:37:26 2006
@@ -10,9 +10,8 @@
 import org.apache.velocity.runtime.resource.Resource;
 import org.apache.velocity.runtime.resource.loader.ResourceLoader;
 import org.roller.RollerException;
-import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.WeblogTemplate;
-import org.roller.presentation.RollerContext;
 
 
 /**
@@ -28,23 +27,13 @@
     
     private static Log mLogger = LogFactory.getLog(RollerResourceLoader.class);
     
+    
     public void init(ExtendedProperties configuration) {
         if (mLogger.isDebugEnabled()) {
             mLogger.debug(configuration);
         }
     }
     
-    /**
-     * The web-app startup timing may be tricky.  In the case that roller is
-     * null (which means that RollerContext may not have had a chance to call
-     * RollerFactory yet) ask RollerContext for Roller because it has the
-     * information necessary for RollerFactory to do its job.
-     *
-     * @return Roller
-     */
-    private Roller getRoller() {
-        return RollerContext.getRoller( null );
-    }
     
     public boolean isSourceModified(Resource resource) {
         return (resource.getLastModified() !=
@@ -71,7 +60,9 @@
         }
         
         try {
-            WeblogTemplate page = getPage( name );
+            WeblogTemplate page = 
+                    RollerFactory.getRoller().getUserManager().retrievePage(name);
+            
             if (page == null) {
                 throw new ResourceNotFoundException(
                         "RollerResourceLoader: page \"" +
@@ -107,7 +98,8 @@
          */
         String name = resource.getName();
         try {
-            WeblogTemplate page = getPage( name );
+            WeblogTemplate page = 
+                    RollerFactory.getRoller().getUserManager().retrievePage(name);
             
             if (mLogger.isDebugEnabled()) {
                 mLogger.debug(name + ": resource=" + resource.getLastModified() +
@@ -118,13 +110,6 @@
             mLogger.error( "Error " + i_operation, re );
         }
         return 0;
-    }
-    
-    
-    public WeblogTemplate getPage(String id) throws RollerException {
-        if (getRoller() == null) throw new RollerException(
-                "RollerResourceLoader.getRoller() returned NULL");
-        return getRoller().getUserManager().retrievePage(id); //retrievePageReadOnly( id
);
     }
     
 }



Mime
View raw message