roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r433328 - /incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/MaintenanceAction.java
Date Mon, 21 Aug 2006 19:05:09 GMT
Author: agilliland
Date: Mon Aug 21 12:05:08 2006
New Revision: 433328

URL: http://svn.apache.org/viewvc?rev=433328&view=rev
Log:
code reformatting.


Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/MaintenanceAction.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/MaintenanceAction.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/MaintenanceAction.java?rev=433328&r1=433327&r2=433328&view=diff
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/MaintenanceAction.java
(original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/ui/authoring/struts/actions/MaintenanceAction.java
Mon Aug 21 12:05:08 2006
@@ -1,34 +1,27 @@
 /*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-*  contributor license agreements.  The ASF licenses this file to You
-* under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-*     http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.  For additional information regarding
-* copyright in this work, please see the NOTICE file in the top level
-* directory of this distribution.
-*/
-/*
- * Created on May 25, 2004
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.  For additional information regarding
+ * copyright in this work, please see the NOTICE file in the top level
+ * directory of this distribution.
  */
+
 package org.apache.roller.ui.authoring.struts.actions;
 
 import java.io.IOException;
-
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.struts.action.ActionForm;
@@ -46,115 +39,114 @@
 import org.apache.roller.ui.core.RollerSession;
 import org.apache.roller.util.cache.CacheManager;
 
+
 /**
  * Allows user to perform Website maintenence operations such as flushing
  * the website page cache or re-indexing the website search index.
- * 
- * @struts.action path="/roller-ui/authoring/maintenance" name="maintenanceForm" 
+ *
+ * @struts.action path="/roller-ui/authoring/maintenance" name="maintenanceForm"
  *     scope="request" parameter="method"
- * 
+ *
  * @struts.action-forward name="maintenance.page" path=".Maintenance"
  */
-public class MaintenanceAction extends DispatchAction 
-{
-    private static Log mLogger = 
-        LogFactory.getFactory().getInstance(MaintenanceAction.class);
-
-
-	/* (non-Javadoc)
-	 * @see org.apache.struts.actions.DispatchAction#unspecified(
-	 * 	org.apache.struts.action.ActionMapping, 
-	 *  org.apache.struts.action.ActionForm, 
-	 *  javax.servlet.http.HttpServletRequest, 
-	 *  javax.servlet.http.HttpServletResponse)
-	 */
-	protected ActionForward unspecified(
-			ActionMapping       mapping,
-			ActionForm          actionForm,
-			HttpServletRequest  request,
-			HttpServletResponse response)
-			throws ServletException
-	{
+public class MaintenanceAction extends DispatchAction {
+    
+    private static Log mLogger = LogFactory.getLog(MaintenanceAction.class);
+    
+    
+    /* (non-Javadoc)
+     * @see org.apache.struts.actions.DispatchAction#unspecified(
+     * 	org.apache.struts.action.ActionMapping,
+     *  org.apache.struts.action.ActionForm,
+     *  javax.servlet.http.HttpServletRequest,
+     *  javax.servlet.http.HttpServletResponse)
+     */
+    protected ActionForward unspecified(
+            ActionMapping   mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws ServletException {
+        
         request.setAttribute("model", new BasePageModel(
-           "maintenance.title", request, response, mapping));
-		return mapping.findForward("maintenance.page");
-	}
-
-	//-----------------------------------------------------------------------
+                "maintenance.title", request, response, mapping));
+        return mapping.findForward("maintenance.page");
+    }
+    
+    
     /**
      * Respond to user's request to rebuild search index.
      */
-	public ActionForward index(
-		ActionMapping       mapping,
-		ActionForm          actionForm,
-		HttpServletRequest  request,
-		HttpServletResponse response)
-		throws IOException, ServletException
-	{
-		try
-		{
+    public ActionForward index(
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException {
+        
+        try {
             RollerRequest rreq  = RollerRequest.getRollerRequest(request);
-            WebsiteData website = rreq.getWebsite();            
+            WebsiteData website = rreq.getWebsite();
             RollerSession rses = RollerSession.getRollerSession(request);
-			if (rses.isUserAuthorizedToAdmin(website) )
-			{
-				IndexManager manager = 
+            
+            if (rses.isUserAuthorizedToAdmin(website) ) {
+                IndexManager manager =
                         RollerFactory.getRoller().getIndexManager();
-				manager.rebuildWebsiteIndex(website);
-				
+                manager.rebuildWebsiteIndex(website);
+                
                 ActionMessages messages = new ActionMessages();
                 messages.add(null, new ActionMessage("maintenance.message.indexed"));
                 saveMessages(request, messages);
-			}
+            }
+            
             request.setAttribute("model", new BasePageModel(
-                "maintenance.title", request, response, mapping));
+                    "maintenance.title", request, response, mapping));
+            
+        } catch (RollerException re) {
+            mLogger.error("Unexpected exception",re.getRootCause());
+            throw new ServletException(re);
+        } catch (Exception e) {
+            mLogger.error("Unexpected exception",e);
+            throw new ServletException(e);
         }
-		catch (RollerException re)
-		{
-			mLogger.error("Unexpected exception",re.getRootCause());
-			throw new ServletException(re);
-		}
-		catch (Exception e)
-		{
-			mLogger.error("Unexpected exception",e);
-			throw new ServletException(e);
-		}
-		return mapping.findForward("maintenance.page");
-	}
-
-    //-----------------------------------------------------------------------
+        
+        return mapping.findForward("maintenance.page");
+    }
+    
+    
     /**
      * Respond to request to flush a user's page cache.
      */
     public ActionForward flushCache(
-        ActionMapping       mapping,
-        ActionForm          actionForm,
-        HttpServletRequest  request,
-        HttpServletResponse response)
-        throws IOException, ServletException
-    {
-        try
-        {
+            ActionMapping       mapping,
+            ActionForm          actionForm,
+            HttpServletRequest  request,
+            HttpServletResponse response)
+            throws IOException, ServletException {
+        
+        try {
             RollerRequest rreq  = RollerRequest.getRollerRequest(request);
-            WebsiteData website = rreq.getWebsite();            
+            WebsiteData website = rreq.getWebsite();
             RollerSession rses = RollerSession.getRollerSession(request);
-			if ( rses.isUserAuthorizedToAdmin(website) )
-			{
-	            //PageCacheFilter.removeFromCache(request, website);
+            
+            if ( rses.isUserAuthorizedToAdmin(website) ) {
+                //PageCacheFilter.removeFromCache(request, website);
                 CacheManager.invalidate(website);
-
-                 ActionMessages messages = new ActionMessages();
-                 messages.add(null, new ActionMessage("maintenance.message.flushed"));
-                 saveMessages(request, messages);
-
+                
+                ActionMessages messages = new ActionMessages();
+                messages.add(null, new ActionMessage("maintenance.message.flushed"));
+                saveMessages(request, messages);
+                
             }
+            
             request.setAttribute("model", new BasePageModel(
-                "maintenance.title", request, response, mapping));
-        }
-        catch (Exception e)
-        {
+                    "maintenance.title", request, response, mapping));
+            
+        } catch (Exception e) {
             throw new ServletException(e);
         }
-		return mapping.findForward("maintenance.page");
+        
+        return mapping.findForward("maintenance.page");
     }
+    
 }



Mime
View raw message