roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r219437 [1/4] - in /incubator/roller/branches/roller_2.0: ./ src/org/roller/pojos/ src/org/roller/presentation/ src/org/roller/presentation/bookmarks/actions/ src/org/roller/presentation/filters/ src/org/roller/presentation/planet/ src/org/...
Date Mon, 18 Jul 2005 01:13:01 GMT
Author: snoopdave
Date: Sun Jul 17 18:12:36 2005
New Revision: 219437

URL: http://svn.apache.org/viewcvs?rev=219437&view=rev
Log:
Menu now respects website permissions

Plus: RollerRequest refactoring (removed getRoller() and auth. and auth. related methods)

Modified:
    incubator/roller/branches/roller_2.0/ant.properties
    incubator/roller/branches/roller_2.0/build.xml
    incubator/roller/branches/roller_2.0/properties.xmlf
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/PermissionsData.java
    incubator/roller/branches/roller_2.0/src/org/roller/pojos/PersistentObject.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/BasePageModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/MainPageAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerRequest.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkEditAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderEditAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/BreadCrumbFilter.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/ByteArrayResponseWrapper.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/CompressionFilter.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/IfPlanetModifiedFilter.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/LoginFilter.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/PersistenceSessionFilter.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RefererFilter.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RequestFilter.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetConfigAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetGroupsAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionFormEx.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionsAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/SyncWebsitesTask.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/EditorNavigationBarTag.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/Menu.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuItemImpl.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuTag.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/BasePageServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/CommentAuthenticator.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/CommentServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ContextLoader.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/DefaultCommentAuthenticator.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ExportRss.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FlavorServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FoafServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/MathCommentAuthenticator.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageHelper.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetFeedServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetPageModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewResourceLoader.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/RollerResourceLoader.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/SearchServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/VelocityPageInsert.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/WebappResourceLoader.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/TrackbackServlet.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/BasePingTargetsAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoriesAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryDeleteAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryEditAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategorySaveAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CustomPingTargetsAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ImportEntriesAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/PingSetupAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ReferersAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ToggleLinkbackDisplayAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CategoryDeleteForm.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CommentFormEx.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/ImportEntriesForm.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogEntryFormEx.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogQueryForm.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/ApplyPluginsTag.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/BigWeblogCalendarModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/EditWeblogCalendarModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/WeblogCalendarModel.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/CommonPingTargetsAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MaintenanceAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/PageFormAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerConfigAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerPropertiesAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UploadFileFormAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserEditAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileManagerTag.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileUploadTag.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BaseAPIHandler.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/RollerXMLRPCServlet.java
    incubator/roller/branches/roller_2.0/web/WEB-INF/editor-menu.xml
    incubator/roller/branches/roller_2.0/web/error.jsp
    incubator/roller/branches/roller_2.0/web/error403.jsp
    incubator/roller/branches/roller_2.0/web/error404.jsp
    incubator/roller/branches/roller_2.0/web/main.jsp

Modified: incubator/roller/branches/roller_2.0/ant.properties
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/ant.properties?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/ant.properties (original)
+++ incubator/roller/branches/roller_2.0/ant.properties Sun Jul 17 18:12:36 2005
@@ -10,7 +10,7 @@
 # are required if using the deploy-tomcat target.
 #staging=../build/roller
 #webapp.name=roller
-#catalina.home=C:/jakarta-tomcat-5.0.28
+catalina.home=/Users/dave/tomcat/
 
 # Path to Roller source, needed by our custom Netbeans actions
 project.dir=/Users/dave/Source/roller-svn/roller/branches/roller_2.0

Modified: incubator/roller/branches/roller_2.0/build.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/build.xml?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/build.xml (original)
+++ incubator/roller/branches/roller_2.0/build.xml Sun Jul 17 18:12:36 2005
@@ -900,31 +900,19 @@
 </target>
 
 <target name="compile-jsps" depends="stage-web">
-   <path id="jasper.path">
-     <path location="${build.stage_web}/WEB-INF/classes" />
-     <fileset dir="${build.stage_web}/WEB-INF/lib">
-       <include name="**/*.jar"/>
-     </fileset>
-     <fileset dir="${ro.tools}/tomcat-4.1.24">
-       <include name="*.jar"/>
-     </fileset>
-     <fileset dir="${ro.tools}/lib">
-       <include name="servlet-*.jar"/>
-       <include name="ant-*.jar"/>
-     </fileset>
-   </path>
-     <mkdir dir="${ro.build}/jspc"/>
-  <jspc srcdir="${build.stage_web}" destdir="${ro.build}/jspc"
-        package="test" verbose="9">
-      <include name="**/*.jsp" />
-        <classpath refid="jasper.path"/>
-  </jspc>
-     <mkdir dir="${ro.build}/jspc.classes"/>
-    <javac source="1.4" debug="true" srcdir="${ro.build}/jspc"
-        destdir="${ro.build}/jspc.classes" fork="true">
-        <classpath refid="jasper.path"/>
-  </javac>
-
+   <mkdir dir="${ro.build}/jspc"/>	
+    <taskdef classname="org.apache.jasper.JspC" name="jasper2" > 
+    	   <classpath refid="jasper.path"/> 
+    </taskdef> 
+    <jasper2 validateXml="false" 
+        uriroot="${build.stage_web}" 
+        webXmlFragment="${build.stage_web}/WEB-INF/generated_web.xml" 
+        outputDir="${ro.build}/jspc" /> 		
+    <mkdir dir="${ro.build}/jspc.classes"/>
+   From roller-commits-return-165-apmail-incubator-roller-commits-archive=incubator.apache.org@incubator.apache.org Mon Jul 18 01:13:44 2005
Return-Path: <roller-commits-return-165-apmail-incubator-roller-commits-archive=incubator.apache.org@incubator.apache.org>
Delivered-To: apmail-incubator-roller-commits-archive@www.apache.org
Received: (qmail 8759 invoked from network); 18 Jul 2005 01:13:43 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199)
  by minotaur.apache.org with SMTP; 18 Jul 2005 01:13:43 -0000
Received: (qmail 30729 invoked by uid 500); 18 Jul 2005 01:13:43 -0000
Delivered-To: apmail-incubator-roller-commits-archive@incubator.apache.org
Received: (qmail 30697 invoked by uid 500); 18 Jul 2005 01:13:42 -0000
Mailing-List: contact roller-commits-help@incubator.apache.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:roller-commits-help@incubator.apache.org>
List-Unsubscribe: <mailto:roller-commits-unsubscribe@incubator.apache.org>
List-Post: <mailto:roller-commits@incu <javac source="1.4" debug="true" srcdir="${ro.build}/jspc" excludes="**/header_jsp.*"
+       destdir="${ro.build}/jspc.classes" fork="true">
+       <classpath refid="jsp.compile.path"/>
+    </javac>
 </target>
 	    
 <!-- ********************************************************************* -->

Modified: incubator/roller/branches/roller_2.0/properties.xmlf
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/properties.xmlf?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/properties.xmlf (original)
+++ incubator/roller/branches/roller_2.0/properties.xmlf Sun Jul 17 18:12:36 2005
@@ -165,6 +165,34 @@
     <path location="${ro.tools}/lib/mm.mysql-2.0.14-bin.jar"/>
 </path>
 
+<path id="jasper.path">
+    <pathelement location="${java.home}/../lib/tools.jar"/> 
+    <fileset dir="${catalina.home}/bin"> 
+        <include name="*.jar"/> 
+    </fileset> 
+    <fileset dir="${catbator.apache.org>
List-Id: <roller-commits.incubator.apache.org>
Reply-To: roller-dev@incubator.apache.org
Delivered-To: mailing list roller-commits@incubator.apache.org
Received: (qmail 30684 invoked by uid 99); 18 Jul 2005 01:13:42 -0000
X-ASF-Spam-Status: No, hits=-9.8 required=10.0
	tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194)
    by apache.org (qpsmtpd/0.29) with SMTP; Sun, 17 Jul 2005 18:13:29 -0700
Received: (qmail 8638 invoked by uid 65534); 18 Jul 2005 01:13:27 -0000
Message-ID: <20050718011327.8636.qmail@minotaur.apache.org>
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r219437 [4/4] - in /incubator/roller/branches/roller_2.0: ./
 src/org/roller/pojos/ src/org/roller/presentation/
 src/org/roller/presentation/bookmarks/actions/
 src/org/roller/presentation/filters/ src/org/roller/presentation/planet/
 src/org/...
Date: Mon, 18 Jul 2005 01:13:0alina.home}/server/lib"> 
+        <include name="*.jar"/> 
+    </fileset> 
+    <fileset dir="${catalina.home}/common/lib"> 
+        <include name="*.jar"/> 
+    </fileset> 
+</path>
+<path id="jsp.compile.path">
+    <pathelement location="${java.home}/../lib/tools.jar"/> 
+    <fileset dir="${build.stage_web}/WEB-INF/lib"> 
+        <include name="*.jar"/> 
+    </fileset>     
+    <fileset dir="${catalina.home}/bin"> 
+        <include name="*.jar"/> 
+    </fileset> 
+    <fileset dir="${catalina.home}/server/lib"> 
+        <include name="*.jar"/> 
+    </fileset> 
+    <fileset dir="${catalina.home}/common/lib"> 
+        <include name="*.jar"/> 
+    </fileset> 
+</path>
+   
 <path id="findbugs.path">
     <path refid="presentation.path"/>
     <path refid="business.path"/>

Modified: incubator/roller/branches/roller_2.0/src/org/roller/pojos/PermissionsData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/PermissionsData.java?rev=219437&r1=219436&r1 -0000
To: roller-commits@incubator.apache.org
From: snoopdave@apache.org
X-Mailer: svnmailer-1.0.2
X-Virus-Checked: Checked by ClamAV on apache.org
X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/PageFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/PageFormAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/PageFormAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/PageFormAction.java Sun Jul 17 18:12:36 2005
@@ -20,11 +20,13 @@
 import org.apache.struts.actions.DispatchAction;
 import org.roller.RollerException;
 import org.roller.RollerPermissionsException;
+import org.roller.model.RollerFactory;
 import org.rolle2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/PermissionsData.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/PermissionsData.java Sun Jul 17 18:12:36 2005
@@ -42,6 +42,13 @@
     }
 
     /**
+     * Check for specific permission.
+     */
+    public boolean has(short priv)
+    {
+        return (getPermissionMask() & priv) == priv;
+    }
+    /**
      * @ejb:persistent-field
      * @hibernate.id column="id" type="string"
      *     generator-class="uuid.hex" unsaved-value="null"
@@ -106,12 +113,11 @@
     {
         this.pending = pending;
     }
-
-    /* (non-Javadoc)
-     * @see org.roller.pojos.PersistentObject#setData(org.roller.pojos.PersistentObject)
+    /**
+     * Set data from other object (no-op).
      */
     public void setData(PersistentObject vo)
     {
-        // TODO Auto-generated method stub     
+        // no-op
     }
 }

Modified: inr.model.UserManager;
 import org.roller.pojos.PageData;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.forms.PageForm;
 import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.util.StringUtils;
@@ -56,13 +58,13 @@
         ActionForward forward = mapping.findForward("editPages.page");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 PageForm form = (PageForm)actionForm;
                 PageData data = new PageData();
                 form.copyTo(data, request.getLocale());
-                WebsiteData hd = rreq.getCurrentWebsite();
+                WebsiteData hd = Rolcubator/roller/branches/roller_2.0/src/org/roller/pojos/PersistentObject.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/PersistentObject.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/PersistentObject.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/PersistentObject.java Sun Jul 17 18:12:36 2005
@@ -18,10 +18,6 @@
 {
 	private long mTimeStamp = 0L; // this was only for Castor, right? -Lance
 
-	public PersistentObject()
-	{
-	}
-
 	/** Setter needed by RollerImpl.storePersistentObject() */
 	public abstract void setData( PersistentObject vo );
 
@@ -31,37 +27,39 @@
     /** Set ID */
 	public abstract void setId( String id );
 
-	//---------------------------------------------------------- TimeStampable
-
+	//-------------------------------------------------------------- implementation
 
+    lerSession.getRollerSession(request).getCurrentWebsite();
 
                 data.setWebsite( hd );
                 data.setUpdateTime( new java.util.Date() );
@@ -70,9 +72,9 @@
                 data.setTemplate("");
                 validateLink( data );
 
-                UserManager mgr = rreq.getRoller().getUserManager();
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
                 mgr.storePage( data );
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
                 ActionMessages uiMessages = new ActionMessages();
                 uiMessages.add(ActionMessages.GLOBAL_MESSAGE, 
@@ -80,11 +82,11 @@
                                 data.getName()));
                 saveMessages(request, uiMessages);
                 
-                PageCacheFilter.removeFromCache( request, rreq.getCurrentWebsite() );
+                PageCacheFilter.removeFromCache( request, RollerSession.getRollerSession(request).getCurrentWebsite()public PersistentObject()
+    {
+    }
     public void save() throws RollerException 
     {
         PersistenceStrategy pstrategy =
             RollerFactory.getRoller().getPersistenceStrategy();
         pstrategy.store(this);
     }
-    
     public void remove() throws RollerException 
     {
         PersistenceStrategy pstrategy =
             RollerFactory.getRoller().getPersistenceStrategy();
         pstrategy.remove(this);
     }
-    
-    
     public String toString() {
         return ToStringBuilder.reflectionToString(this,
                 ToStringStyle.MULTI_LINE_STYLE);
     }
-
     public boolean equals(Object o) {
         return EqualsBuilder.reflectionEquals(this, o);
     }
-    
     /** Can user associated with persistence session save this object? */
     public boolean canSave() throws RollerException
     {
         return true;
+    }
+    /** Start editing this object */
+    public void startEditing() throws RollerException
+    {
+        if (!canSave()) throw new RollerE );
                     
                 actionForm.reset(mapping,request);                
                 
-                addModelObjects(rreq);
+                addModelObjects(request);
             }
             else
             {
@@ -111,15 +113,16 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 PageData pd = rreq.getPage();
                 PageForm pf = (PageForm)actionForm;
                 pf.copyFrom(pd, request.getLocale());
 
-                PageCacheFilter.removeFromCache( request, rreq.getCurrentWebsite() );
+                PageCacheFilter.removeFromCache( request, RollerSession.getRollerSession(request).getCurrentWebsite() );
                 
-                addModelObjects(rreq);
+                addModelObjxception("ERROR: edit permission denied");
     }
 }
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/BasePageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/BasePageModel.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/BasePageModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/BasePageModel.java Sun Jul 17 18:12:36 2005
@@ -3,16 +3,15 @@
  */
 package org.roller.presentation;
 
-import org.apache.struts.action.ActionMapping;
-import org.roller.RollerException;
-import org.roller.pojos.UserData;
-
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.struts.action.ActionMapping;
+import org.roller.RollerExcepects(request);
             }
             else
             {
@@ -145,10 +148,10 @@
         ActionForward forward = mapping.findForward("editPages.page");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
-                addModelObjects(rreq);
+                addModelObjects(request);
             }
             else
             {
@@ -174,20 +177,20 @@
         ActionForward forward = mapping.findForward("editPages");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 PageForm form = tion;
+
 /**
  * Re-usable base for page models.
  * @author David M Johnson
@@ -86,6 +85,6 @@
     
     public boolean getIsAdmin() throws RollerException
     {
-        return RollerRequest.getRollerRequest(request).isAdminUser(); 
+        return RollerSession.getRollerSession(request).isAdminUser(); 
     }
 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/MainPageAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/MainPageAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/MainPageAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/MainPageAction.java Sun Jul 17 18:12:36 2005
@@ -1,5 +1,11 @@
 package org.roller.presentation;
 
+import java.util.Date;
+import java.util.List;
+
+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.Action;
@@ -7,17 +13,11 @@
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.roller.RollerException;
+import org.roller.config.RollerRuntimeConfig;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 
-import java.util.Date;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.roller.config.RollerRuntimeConfig;
-
 
 /**
  * Main page action for Roller.
@@ -98,7 +98,7 @@
             if (list == null)
             {
                 mLogger.debug("Refreshing popular websites list");
-                Roller roller = RollerRequest.getRollerRequest(mRequest).getRoller();            
+                Roller roller = RollerFactory.getRoller();            
(PageForm)actionForm;
                 PageData data = new PageData();
                 form.copyTo(data, request.getLocale());
 
-                UserManager mgr = rreq.getRoller().getUserManager();
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
                 mgr.removePageSafely( data.getId() );
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
-                PageCacheFilter.removeFromCache( request, rreq.getCurrentWebsite() );
+                PageCacheFilter.removeFromCache( request, RollerSession.getRollerSession(request).getCurrentWebsite() );
                     
-                addModelObjects(rreq);
+                addModelObjects(request);
 
                 actionForm.reset(mapping,request);
             }
@@ -222,14 +225,15 @@
         ActionForward forward = mapping.findForward("removePage.page");
         try
         {
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
                      list = roller.getRefererManager().getDaysPopularWebsites(num);
                 mPopularWebsites.setObject(list);
             }
@@ -116,7 +116,7 @@
             if (list == null)
             {
                 mLogger.debug("Refreshing recent entries list");
-                Roller roller = RollerRequest.getRollerRequest(mRequest).getRoller();			                       
+                Roller roller = RollerFactory.getRoller();		                      
                 list = roller.getWeblogManager().getWeblogEntries(
                     null,                   // userName
                     null,                   // startDate
@@ -144,7 +144,7 @@
             if (list == null)
             {
                 mLogger.debug("Refreshing pinned entries list");
-                Roller roller = RollerRequest.getRollerRequest(mRequest).getRoller();
+                Roller roller = RollerFactory.getRoller();
                 list = roller.getWeblogManager()
                     .getWeblogEntrie        RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 PageData cd = rreq.getPage();
                 PageForm pf = (PageForm)actionForm;
                 pf.copyFrom(cd, request.getLocale());
 
-                UserData ud = rreq.getAuthenticatedUser();
+                UserData ud = RollerSession.getRollerSession(request).getAuthenticatedUser();
                 request.setAttribute("user",ud);
             }
             else
@@ -256,21 +260,21 @@
         ActionForward forward = mapping.findForward("editPage.page");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 PageForm form = (PsPinnedToMain(new Integer(num));  
                 mPinnedEntries.setObject(list);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerRequest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerRequest.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerRequest.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerRequest.java Sun Jul 17 18:12:36 2005
@@ -17,13 +17,12 @@
 import org.roller.RollerException;
 import org.roller.config.RollerRuntimeConfig;
 import org.roller.model.ParsedRequest;
-import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.BookmarkData;
 import org.roller.pojos.FolderData;
 import org.roller.pojosageForm)actionForm;
-                UserManager mgr = rreq.getRoller().getUserManager();
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
                 PageData data = mgr.retrievePage(form.getId());
                 data.save(); // should through exception if no save permission
                 form.copyTo(data, request.getLocale());
                 data.setUpdateTime( new java.util.Date() );
-                data.setWebsite( rreq.getCurrentWebsite() );
+                data.setWebsite( RollerSession.getRollerSession(request).getCurrentWebsite() );
 
                 validateLink( data );
 
                 mgr.storePage( data );
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
                 // set the (possibly) new link back into the Form bean
                 ((PageForm)actionForm).setLink( data.getLink() );
@@ -281,7 +285,7 @@
                                 data.getName()));
                 saveMessages(request, ui.PageData;
-import org.roller.pojos.PermissionsData;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WeblogEntryData;
@@ -38,16 +37,16 @@
  * getter methods.
  * <br/><br/> 
  * 
- * These forms of pathinfo get special support:
+ * These forms of pathinfo get special support (where 'handle' indicates website):
  * <br/><br/>
  * 
  * <pre>
- * [username] - get default page for user for today's date 
- * [username]/[date] - get default page for user for specified date 
- * [username]/[pagelink] - get specified page for today's date 
- * [username]/[pagelink]/[date] - get specified page for specified date
- * [username]/[pagelink]/[anchor] - get specified page & entry (by anchor)
- * [username]/[pagelink]/[date]/[anchor] - get specified page & entry (by anchor)
+ * [handle] - get default page for user for today's date 
+ * [handle]/[date] - get default page for user for specified date 
+ * [handle]/[pagelink] - get specified page for today's date 
+ * [haMessages);
 
-                PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
+                PageCacheFilter.removeFromCache(request, RollerSession.getRollerSession(request).getCurrentWebsite());
             }
             else
             {
@@ -348,17 +352,15 @@
     }
     
     //-----------------------------------------------------------------------
-    private void addModelObjects( RollerRequest rreq ) 
+    private void addModelObjects( HttpServletRequest request ) 
         throws RollerException {  
-            
-        HttpServletRequest request = rreq.getRequest();
-            
-        UserManager mgr = rreq.getRoller().getUserManager();
+                        
+        UserManager mgr = RollerFactory.getRoller().getUserManager();
 
-        UserData user = rreq.getAuthenticatedUser();
+        UserData user = RollerSession.getRollerSession(request).getAuthenticatedUser();
         request.setAttribute("user",user);
 
-        WebsiteData wd = rreq.getCurrentWebsite();ndle]/[pagelink]/[date] - get specified page for specified date
+ * [handle]/[pagelink]/[anchor] - get specified page & entry (by anchor)
+ * [handle]/[pagelink]/[date]/[anchor] - get specified page & entry (by anchor)
  * </pre>
  *  
  * @author David M Johnson
@@ -145,9 +144,9 @@
         String userName = auth.getAuthenticatedUserName(mRequest);
         if (userName != null)
         {
-            UserManager userMgr = getRoller().getUserManager();
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();
             UserData currentUser = userMgr.getUser(userName);
-            getRoller().setUser(currentUser);
+            RollerFactory.getRoller().setUser(currentUser);
         }
 
         // path info may be null, (e.g. on JSP error page)
@@ -203,7 +202,7 @@
             //   /username/pagelink/datestring
             //   /username/pagelink/anchor (specific entry)
             //   /username/pagelink/datestring/anchor (specific entry)
-            UserManager userMgr = getRol
+        WebsiteData wd = RollerSession.getRollerSession(request).getCurrentWebsite();
         request.setAttribute("website", wd);
 
         List pages = mgr.getPages(wd);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerConfigAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerConfigAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerConfigAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerConfigAction.java Sun Jul 17 18:12:36 2005
@@ -48,7 +48,8 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() && rreq.isAdminUser() )
+            RollerSession roler().getUserManager();
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();
             mWebsite = userMgr.getWebsiteByHandle(pathInfo[0]);
             if (mWebsite != null)
             {
@@ -244,7 +243,7 @@
                         // we have the /username/pagelink/anchor form of URL
                         try
                         {
-                            WeblogManager weblogMgr = getRoller().getWeblogManager();
+                            WeblogManager weblogMgr = RollerFactory.getRoller().getWeblogManager();
                             mWeblogEntry = weblogMgr.getWeblogEntryByAnchor(
                                 mWebsite, pathInfo[2]);
                             mDate = mWeblogEntry.getPubTime();
@@ -274,7 +273,7 @@
                     mIsDateSpecified = true;
 
                     // we have the /username/pagelink/date/anchor form of URL
-                    WeblogManager weblogMgr = getRoller().getWeblogManager();
+                    WeblogManager weblllerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() && rollerSession.isAdminUser() )
             {
                 RollerConfigData rollerConfig = RollerFactory.getRoller().getConfigManager().getRollerConfig();
                 RollerConfigFormEx rcForm = (RollerConfigFormEx)actionForm;
@@ -80,7 +81,8 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() && rreq.isAdminUser() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() && rollerSession.isAdminUser() )
             {
                 RollerConfigFormEx rcForm = (RollerConfigFormEx)actionForm;
                                     				
@@ -89,9 +91,9 @@
                 rcForm.copyTo(rollerConfig, request.getLocale());
                 
                 // persist
-                rreq.getRoller().getConfigManogMgr = RollerFactory.getRoller().getWeblogManager();
                     mWeblogEntry = weblogMgr.getWeblogEntryByAnchor(
                                     mWebsite, pathInfo[3]);
                 }                
@@ -302,7 +301,7 @@
             // No path info means that we need to parse request params
             
             // First, look for user in the request params
-            UserManager userMgr = getRoller().getUserManager();            
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();            
             String userName = mRequest.getParameter(USERNAME_KEY);
             if ( userName == null )
             {
@@ -448,13 +447,6 @@
     {
         return mContext;
     }
-
-    //------------------------------------------------------------------------
-    /** Get Roller instance from */
-    public Roller getRoller()
-    {
-        return RollerContext.getRoller( mRequest );
-    }
     
     //------------------------------------------------------------ager().storeRollerConfig(rollerConfig);
-                rreq.getRoller().getRefererManager().applyRefererFilters();
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().getConfigManager().storeRollerConfig(rollerConfig);
+                RollerFactory.getRoller().getRefererManager().applyRefererFilters();
+                RollerFactory.getRoller().commit();
                 
                 ActionMessages uiMessages = new ActionMessages();
                 uiMessages.add(null, new ActionMessage("weblogEdit.changesSaved"));
@@ -129,7 +131,7 @@
 		try {
 			// if admin requests an index be re-built, do it
              RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			IndexManager manager = rreq.getRoller().getIndexManager();
+			IndexManager manager = RollerFactory.getRoller().getIndexManager();
 										 
 			manager.rebuildWebsiteIndex();
 			request.getSession().setAttribute(

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/web-----------------
     
@@ -595,8 +587,8 @@
             {
                 try
                 {
-                    mBookmark = 
-                        getRoller().getBookmarkManager().retrieveBookmark(id);
+                    mBookmark = RollerFactory.getRoller()
+                        .getBookmarkManager().retrieveBookmark(id);
                 }
                 catch (RollerException e)
                 {
@@ -622,7 +614,8 @@
                 try
                 {
                     mWeblogCategory = 
-                        getRoller().getWeblogManager().retrieveWeblogCategory(id);
+                        RollerFactory.getRoller()
+                            .getWeblogManager().retrieveWeblogCategory(id);
                 }
                 catch (RollerException e)
                 {
@@ -634,8 +627,9 @@
                 try
                 {
                     mWeblogCategory = 
-                        getRoller().getWeblogManager().getWeblogCategoryByPath(
-                           site/actions/RollerPropertiesAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerPropertiesAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerPropertiesAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/RollerPropertiesAction.java Sun Jul 17 18:12:36 2005
@@ -9,9 +9,11 @@
 import java.io.IOException;
 import java.util.Iterator;
 import java.util.Map;
+
 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.ActionError;
@@ -29,6 +31,7 @@
 import org.roller.model.RollerFactory;
 import org.roller.pojos.Rolle getWebsite(), null, id);
+                        RollerFactory.getRoller()
+                            .getWeblogManager().getWeblogCategoryByPath(
+                                    getWebsite(), null, id);
                 }
                 catch (RollerException e)
                 {
@@ -661,8 +655,8 @@
             {
                 try
                 {
-                    folder = 
-                        getRoller().getBookmarkManager().retrieveFolder(id);
+                    folder = RollerFactory.getRoller()
+                        .getBookmarkManager().retrieveFolder(id);
                 }
                 catch (RollerException e)
                 {
@@ -687,7 +681,8 @@
             {
                 try
                 {
-                    mPage = getRoller().getUserManager().retrievePage(id);
+                    mPage = RollerFactory.getRoller()
+                        .getUserManager().retrievePage(id);
                 }
                 catch (RollerException e)
                 {
@@ -770,7 +765,7 @@
             {
                 if ( entryid != null )
                 {
-                    WeblogManager weblogMgr = getRoller().getWeblogManager();
+                    WeblogManager weblogMgr = RollerFactory.getRoller().getWeblogManager();
                     mWeblogEntry = weblogMgr.retrieveWeblogEntry(entryid);                
                 
                     // We can use entry to find the website, if we don't have one
@@ -781,7 +776,8 @@
                 } 
                 else if ( mWebsite != null && anchor != null )
                 {
-                    WeblogManager weblogMgr = getRoller().getWeblogManager();
+                    WeblogManager weblogMgr = 
+                        RollerFactory.getRoller().getWeblogManager();
                     mWeblogEntry = weblogMgr.getWeblogEntryByAnchor(
                         mWebsite,anchor);
                 }                             
@@ -841,53 +837,5 @@
         return RollerRuntimeConfig.getBooleanProperty("rPropertyData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 
 
 
@@ -73,7 +76,8 @@
         ActionForward forward = mapping.findForward("rollerProperties.page");
         try {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() && rreq.isAdminUser() ) {
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() && rollerSession.isAdminUser() ) {
                 
                 // just grab our properties map and put it in the request
                 Roller mRoller = RollerFactory.getRoller();
@@ -105,7 +109,8 @@
         ActionErrors errors = new ActionErrors();
         try {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() && rreq.isAdminUser() ) {
+            RollerSession rollerSession = RollerSession.getRollerSession(request);site.linkbacks.enabled");
     }
 
-    //-------------------------------------------- Authentication and authorization
-    
-    /**
-     * Get the current website from the Roller session, or null if none exists.
-     */
-    public WebsiteData getCurrentWebsite()
-    {
-        RollerSession rollerSession = RollerSession.getRollerSession(mRequest);
-        if (rollerSession != null) return rollerSession.getCurrentWebsite();
-        return null;
-    }
-
-    /**
-     * Gets the UserData specified by the request, or null if none exists.
-     * @return UserData
-     */
-    public UserData getAuthenticatedUser()
-    {
-        RollerSession rollerSession = RollerSession.getRollerSession(mRequest);
-        if (rollerSession != null) return rollerSession.getAuthenticatedUser();
-        return null;
-    }
-
-    /** 
-     * Does user have the admin role (aka global superuser)
-     */
-    public boolean isAdminUser() throws RollerException
-    {
-        UserData user = getAuthenticatedUser();
- 
+            if ( rollerSession.isUserAuthorizedToEdit() && rollerSession.isAdminUser() ) {
             
                 // just grab our properties map and put it in the request
                 Roller mRoller = RollerFactory.getRoller();

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/ThemeEditorAction.java Sun Jul 17 18:12:36 2005
@@ -1,5 +1,18 @@
 package org.roller.presentation.website.actions;
 
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOExceptio       if (user != null && user.hasRole("admin")) return true;
-        return false;
-    }
-
-    /** 
-     * Is user authorized to edit objects in the current website. 
-     */
-    public boolean isUserAuthorizedToEdit() throws RollerException
-    {
-        RollerSession rollerSession = RollerSession.getRollerSession(mRequest);
-        UserData user = rollerSession.getAuthenticatedUser();
-        WebsiteData website = rollerSession.getCurrentWebsite();
-        if (website != null) 
-        {
-            return website.hasUserPermissions(user, 
-                (short)(PermissionsData.AUTHOR | PermissionsData.ADMIN));
-        }
-        return false;
-    }
 }
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- inFrom roller-commits-return-167-apmail-incubator-roller-commits-archive=incubator.apache.org@incubator.apache.org Mon Jul 18 01:13:46 2005
Return-Path: <roller-commits-return-167-apmail-incubator-roller-commits-archive=incubator.apache.org@incubator.apache.org>
Delivered-To: apmail-incubator-roller-commits-archive@www.apache.org
Received: (qmail 8849 invoked from network); 18 Jul 2005 01:13:45 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199)
  by minotaur.apache.org with SMTP; 18 Jul 2005 01:13:45 -0000
Received: (qmail 30834 invoked by uid 500); 18 Jul 2005 01:13:44 -0000
Delivered-To: apmail-incubator-roller-commits-archive@incubator.apache.org
Received: (qmail 30806 invoked by uid 500); 18 Jul 2005 01:13:44 -0000
Mailing-List: contact roller-commits-help@incubator.apache.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:roller-commits-help@incubator.apache.org>
List-Unsubscribe: <mailto:roller-commits-unsubscribe@incubator.apache.org>
List-Post: <mailto:roller-commits@incun;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.struts.action.ActionError;
@@ -9,32 +22,19 @@
 import org.apache.struts.action.ActionMapping;
 import org.apache.struts.actions.DispatchAction;
 import org.roller.RollerException;
+import org.roller.config.RollerRuntimeConfig;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.pojos.PageData;
-import org.roller.pojos.UserData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.pagecache.PageCacheFilter;
 imporcubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerSession.java Sun Jul 17 18:12:36 2005
@@ -13,9 +13,9 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;
-import org.roller.model.Roller;
 import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
+import org.roller.pojos.PermissionsData;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WebsiteData;
 
@@ -41,6 +41,7 @@
     public static final String ERROR_MESSAGE   = "rollererror_message";
     public static final String STATUS_MESSAGE  = "rollerstatus_message";
 
+    //---------------------------------------------------------------- Construction
     /** 
      * Get RollerSession from request (and add user if not already present).
      */
@@ -68,8 +69,9 @@
         }
         return rollerSession;
     }
+
+    //------------------------bator.apache.org>
List-Id: <roller-commits.incubator.apache.org>
Reply-To: roller-dev@incubator.apache.org
Delivered-To: mailing list roller-commits@incubator.apache.org
Received: (qmail 30786 invoked by uid 99); 18 Jul 2005 01:13:44 -0000
X-ASF-Spam-Status: No, hits=-9.8 required=10.0
	tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194)
    by apache.org (qpsmtpd/0.29) with SMTP; Sun, 17 Jul 2005 18:13:29 -0700
Received: (qmail 8632 invoked by uid 65534); 18 Jul 2005 01:13:26 -0000
Message-ID: <20050718011326.8629.qmail@minotaur.apache.org>
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r219437 [2/4] - in /incubator/roller/branches/roller_2.0: ./
 src/org/roller/pojos/ src/org/roller/presentation/
 src/org/roller/presentation/bookmarks/actions/
 src/org/roller/presentation/filters/ src/org/roller/presentation/planet/
 src/org/...
Date: Mon, 18 Jul 2005 01:13:0-------------------------------------- Session events
     
-    //------------------------------------------------------------------------
     /** Create session's Roller instance */
     public void sessionCreated(HttpSessionEvent se)
     {
@@ -81,7 +83,6 @@
         rctx.sessionCreated(se);           
     }    
 
-    //------------------------------------------------------------------------
     public void sessionDestroyed(HttpSessionEvent se)
     {
         RollerContext rctx = RollerContext.getRollerContext(
@@ -91,13 +92,25 @@
         clearSession(se);        
     }
 
-    //------------------------------------------------------------------------
     /** Init session as if it was new */
     public void sessionDidActivate(HttpSessionEvent se)
     {
     }
 
-    //------------------------------------------------------------------------
+    /** Purge session before passivation. Because Roller currently does not
+     * support session recovery, failover, migration, or whatever you want
+     *t org.roller.presentation.velocity.PreviewResourceLoader;
 import org.roller.presentation.website.ThemeCache;
 import org.roller.presentation.website.formbeans.ThemeEditorForm;
 
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.roller.config.RollerRuntimeConfig;
-
 
 /////////////////////////////////////////////////////////////////////////////
 
@@ -79,8 +79,9 @@
 		ActionForward forward = mapping.findForward("editTheme.page");
 		try
 		{
+             RollerSession rollerSession = RollerSession.getRollerSession(request);
 			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rreq.isUserAuthorizedToEdit() )
+			if ( rollerSession.isUserAuthorizedTFrom roller-commits-return-166-apmail-incubator-roller-commits-archive=incubator.apache.org@incubator.apache.org Mon Jul 18 01:13:45 2005
Return-Path: <roller-commits-return-166-apmail-incubator-roller-commits-archive=incubator.apache.org@incubator.apache.org>
Delivered-To: apmail-incubator-roller-commits-archive@www.apache.org
Received: (qmail 8820 invoked from network); 18 Jul 2005 01:13:44 -0000
Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199)
  by minotaur.apache.org with SMTP; 18 Jul 2005 01:13:44 -0000
Received: (qmail 30785 invoked by uid 500); 18 Jul 2005 01:13:44 -0000
Delivered-To: apmail-incubator-roller-commits-archive@incubator.apache.org
Received: (qmail 30752 invoked by uid 500); 18 Jul 2005 01:13:43 -0000
Mailing-List: contact roller-commits-help@incubator.apache.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:roller-commits-help@incubator.apache.org>
List-Unsubscribe: <mailto:roller-commits-unsubscribe@incubator.apache.org>
List-Post: <mailto:roller-commits@incu1 -0000
To: roller-commits@incubator.apache.org
From: snoopdave@apache.org
X-Mailer: svnmailer-1.0.2
X-Virus-Checked: Checked by ClamAV on apache.org
X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuImpl.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuImpl.java Sun Jul 17 18:12:36 2005
@@ -1,9 +1,6 @@
 
 package org.roller.presentation.tags.menu;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
 import java.util.Vector;
 
 import javax.servlet.http.HttpServletRequest;
@@ -11,7 +8,6 @@
 import javax.servlet.j to call it when sessions are saved and then restored at some later
+     * point in time.
+     */
+   public void sessionWillPassivate(HttpSessionEvent se)
+   {
+       clearSession(se);
+   }
+
+    //----------------------------------------------------------------- Breadcrumbs
+    
+    // TODO: eliminate breadcrumb stuff?
+    
     /**
      * Clear bread crumb trail.
      * @param req the request
@@ -112,7 +125,6 @@
         }
     }
     
-    //------------------------------------------------------------------------
     /**
      * Store the url of the latest request stored in the session.
      * @param useReferer If true try to return the "referer" header.
@@ -140,7 +152,6 @@
         return crumb;
     }
     
-    //------------------------------------------------------------------------
     /**
      * Store the url of the latest request stored in the session.
      * Else try to return the "referer" header.
@@ -150,34 +161,7 @@
         return getBreadCrumb(req,true);
     }
 
-    //-----oEdit() )
 			{
 				loadThemes( rreq, errors, true);
 				ThemeEditorForm teForm = (ThemeEditorForm)form;
@@ -122,7 +123,7 @@
 					(String)request.getSession(true).getAttribute(LAST_THEME)); 
                                 
 			     // load the current default page
-                PageData page = getDefaultPage( rreq );
+                PageData page = getDefaultPage( request );
 					teForm.setThemeTemplate( page.getTemplate() );
 					
 					
@@ -165,8 +166,9 @@
 		ActionForward forward = mapping.findForward("editTheme.page");
 		try
 		{
+             RollerSession rollerSession = RollerSession.getRollerSession(request);
 			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rreq.isUserAuthorizedToEdit() )
+			if ( rollerSession.isUserAuthorizedToEdit() )
 			{
                 HttpSession session = request.getSession();
 				ThemeEditorForm teForm = (ThemeEditorForm)form;
@@ -187,7 +189,7 @@
 					clearThemePages(rreq, 
 						(String) session.getAttribute(LAST_THEME)); 
 						  bator.apache.org>
List-Id: <roller-commits.incubator.apache.org>
Reply-To: roller-dev@incubator.apache.org
Delivered-To: mailing list roller-commits@incubator.apache.org
Received: (qmail 30732 invoked by uid 99); 18 Jul 2005 01:13:43 -0000
X-ASF-Spam-Status: No, hits=-9.8 required=10.0
	tests=ALL_TRUSTED,NO_REAL_NAME
X-Spam-Check-By: apache.org
Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194)
    by apache.org (qpsmtpd/0.29) with SMTP; Sun, 17 Jul 2005 18:13:29 -0700
Received: (qmail 8635 invoked by uid 65534); 18 Jul 2005 01:13:27 -0000
Message-ID: <20050718011327.8633.qmail@minotaur.apache.org>
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r219437 [3/4] - in /incubator/roller/branches/roller_2.0: ./
 src/org/roller/pojos/ src/org/roller/presentation/
 src/org/roller/presentation/bookmarks/actions/
 src/org/roller/presentation/filters/ src/org/roller/presentation/planet/
 src/org/...
Date: Mon, 18 Jul 2005 01:13:0sp.PageContext;
 
 import org.roller.RollerException;
-import org.roller.util.Utilities;
 
 /////////////////////////////////////////////////////////////////////////
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuItemImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuItemImpl.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuItemImpl.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuItemImpl.java Sun Jul 17 18:12:36 2005
@@ -1,7 +1,6 @@
 
 package org.roller.presentation.tags.menu;
 
-import java.util.ArrayList;
 import java.util.Hashtable;
 
 import javax.servlet.ServletContext;
@@ -12,7 +11,6 @@
 import org.apache.struts.config.ForwardConfig;
 import org.apache.struts.config.ModuleConfig;-------------------------------------------------------------------
-    /** Purge session before passivation. Because Roller currently does not
-      * support session recovery, failover, migration, or whatever you want
-      * to call it when sessions are saved and then restored at some later
-      * point in time.
-      */
-    public void sessionWillPassivate(HttpSessionEvent se)
-    {
-        clearSession(se);
-    }
-
-    //------------------------------------------------------------------------    /*
-    private  void clearSession( HttpSessionEvent se )
-    {
-        HttpSession session = se.getSession();
-        try
-        {
-            session.removeAttribute( BREADCRUMB );
-        }
-        catch (Throwable e)
-        {
-            if (mLogger.isDebugEnabled())
-            {
-                // ignore purge exceptions
-                mLogger.debug("EXCEPTION PURGING session attributes",e);
-            }
-        }
-    }
+    //---------------------------------------------------                 
-                    setThemePages(rreq, theme);
+                    setThemePages(request, theme);
 					session.setAttribute(LAST_THEME, theme);
 				}
                 else
@@ -206,9 +208,9 @@
 
 				// put the template where PreviewServlet
 				// will be able to find it
-				PageData page = getDefaultPage( rreq );			
+				PageData page = getDefaultPage( request );			
 				PreviewResourceLoader.setTemplate(page.getId(), 
-					teForm.getThemeTemplate(), rreq.getCurrentWebsite().getHandle() );
+					teForm.getThemeTemplate(), RollerSession.getRollerSession(request).getCurrentWebsite().getHandle() );
 				
 				// save the template in session for later editing
 				session.setAttribute(SESSION_TEMPLATE,
@@ -250,8 +252,9 @@
 		ActionForward forward = mapping.findForward("editTheme.page");
 		try
 		{
+             RollerSession rollerSession = RollerSession.getRollerSession(request);
 			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rreq.isUserAuthorizedToEdit() )
1 -0000
To: roller-commits@incubator.apache.org
From: snoopdave@apache.org
X-Mailer: svnmailer-1.0.2
X-Virus-Checked: Checked by ClamAV on apache.org
X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/WebappResourceLoader.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/WebappResourceLoader.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/WebappResourceLoader.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/WebappResourceLoader.java Sun Jul 17 18:12:36 2005
@@ -1,5 +1,9 @@
 package org.roller.presentation.velocity;
 
+import java.io.InputStream;
+
+import javax.servlet.ServletContext;
+
 import org.apache.commons.collections.ExtendedProperties;
 import org.apache.comm
 import org.apache.struts.util.RequestUtils;
-import org.roller.RollerException;
 import org.roller.presentation.RollerContext;
 
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuTag.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuTag.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuTag.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/MenuTag.java Sun Jul 17 18:12:36 2005
@@ -1,7 +1,6 @@
 
 package org.roller.presentation.tags.menu;
 
-import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -9,7 +8,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.velocity.VelocityContext;
 import org.roller.Roller----- Authentication, etc.
     
     /**
      * Authenticated user associated with this session.
@@ -186,6 +170,7 @@
     {
         return authenticatedUser;
     }
+    
     /**
      * Authenticated user associated with this session.
      */
@@ -193,22 +178,24 @@
     {
         this.authenticatedUser = authenticatedUser;
     }
+    
     /**
      * Current website that user is working with.
      */
     public WebsiteData getCurrentWebsite()
     {       
-        // ROLLER_2.0: allow user to pick website
-        if (currentWebsite == null) try 
+        // ROLLER_2.0: allow user to pick current website instead of this...
+        /* if (currentWebsite == null) try 
         {
             Roller roller = RollerFactory.getRoller();
             UserManager umgr = roller.getUserManager();
             currentWebsite = (WebsiteData)
                 umgr.getWebsites(authenticatedUser, null).get(0);
         }
-        catch (RollerException ignored) {}
+        catch (RollerException ignored) {} */
+			if ( rollerSession.isUserAuthorizedToEdit() )
 			{
                  loadThemes( rreq, errors, true);
                  ThemeEditorForm teForm = (ThemeEditorForm)form;
@@ -260,7 +263,7 @@
                  RollerContext rollerContext = 
                                 RollerContext.getRollerContext( ctx );
                  
-                 WebsiteData website = rreq.getCurrentWebsite();
+                 WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
                 	
 				// load the template either from the Form
 				// or from the disk (if its a stock Theme).
@@ -282,8 +285,8 @@
                 request.getSession().removeAttribute(SESSION_TEMPLATE);
 
 				// store the template in the page
-				UserManager mgr = rreq.getRoller().getUserManager();
-				PageData page = getDefaultPage( rreq );
+				UserManager mgr = RollerFactory.getRoller().getUserManager();
+				PageData page = getDefaultPage( request );
 
 				page.setTemplate( template );
 				mgr.storePage( ons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -7,10 +11,6 @@
 import org.apache.velocity.runtime.resource.Resource;
 import org.apache.velocity.runtime.resource.loader.ResourceLoader;
 import org.roller.presentation.RollerContext;
-
-import java.io.InputStream;
-
-import javax.servlet.ServletContext;
 
 /**
  * Tries to load Velocity resources from the Webapp.

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/TrackbackServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/TrackbackServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/TrackbackServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/TrackbackServlet.java Sun Jul 17 18:12:36 2005
@@ -3,17 +3,18 @@
  */
 package org.roller.presentatioException;
-import org.roller.presentation.util.RequestUtil;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.tags.VelocityTag;
 import org.roller.presentation.velocity.ContextLoader;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/RollerMenuModel.java Sun Jul 17 18:12:36 2005
@@ -1,24 +1,22 @@
 
 package org.roller.presentation.tags.menu;
 
+import java.io.InputStream;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http         return currentWebsite;
     }
+
     /**
      * Current website that user is working with.
      */
@@ -216,5 +203,50 @@
     {
         this.currentWebsite = currentWebsite;
     }
+
+    /** 
+     * Does our authenticated user have the global admin role? 
+     */
+    public boolean isAdminUser() throws RollerException
+    {
+        UserData user = getAuthenticatedUser();
+        if (user != null && user.hasRole("admin")) return true;
+        return false;
+    }
+
+    /** 
+     * Is our authenticated user authorized to edit objects in the current website. 
+     */
+    public boolean isUserAuthorizedToEdit() 
+        throws RollerException
+    {
+        UserData user = getAuthenticatedUser();
+        WebsiteData website = getCurrentWebsite();
+        if (website != null && user != null) 
+        {
+            return website.hasUserPermissions(user, 
+                (short)(PermissionsData.AUTHOR | PermissionsData.ADMIN));
+        }
+        return false;
+    }
+
+    //--------page);
@@ -291,10 +294,10 @@
                 saveThemePages( rreq, theme);
                 
                 // put them into the PreviewResourceLoader also
-                setThemePages(rreq, theme);
+                setThemePages(request, theme);
 
 				// clear the page cache
-				PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
+				PageCacheFilter.removeFromCache(request, RollerSession.getRollerSession(request).getCurrentWebsite());
 				teForm.setThemeName("Custom");
 			}
 			else
@@ -332,11 +335,12 @@
 		ActionForward forward = mapping.findForward("editTheme");
 		try
 		{
+             RollerSession rollerSession = RollerSession.getRollerSession(request);
 			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rreq.isUserAuthorizedToEdit() )
+			if ( rollerSession.isUserAuthorizedToEdit() )
 			{
 				// clear the page cache
-				WebsiteData website = rreq.getCurrentWebsite();
+				WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsiten.weblog;
 
-import org.roller.pojos.WeblogEntryData;
-import org.roller.presentation.RollerRequest;
-
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.io.UnsupportedEncodingException;
+
+import org.roller.model.RollerFactory;
+import org.roller.pojos.WeblogEntryData;
+import org.roller.presentation.RollerRequest;
 
 
 /**
@@ -131,7 +132,7 @@
                 if (entry!=null && entry.getCommentsStillAllowed())
                 {
                     entry.addTrackback(url,title,excerpt,blogName);
-                    rreq.getRoller().commit();
+                    RollerFactory.getRoller().commit();
             
                     pw.println("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>");
                     pw.println("<response>");

Modified: incubator/roller.HttpServletRequest;
+
 import org.apache.commons.digester.Digester;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;
-import org.roller.config.RollerConfig;
 import org.roller.pojos.UserData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.xml.sax.SAXException;
 
-import java.io.InputStream;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
 //////////////////////////////////////////////////////////////////////////////
 
 /** 
@@ -165,7 +163,7 @@
 		RollerRequest rreq = RollerRequest.getRollerRequest(req);
 		try
 		{
-			UserData user = rreq.getAuthenticatedUser();
+			UserData user = RollerSession.getRollerSession(req).getAuthenticatedUser();
 			String fid = 
                 rreq.getFolder()==null ? null : rreq.getFolder().getId();------------------------------------------------------------- Innards
+    
+    private  void clearSession( HttpSessionEvent se )
+    {
+        HttpSession session = se.getSession();
+        try
+        {
+            session.removeAttribute( BREADCRUMB );
+        }
+        catch (Throwable e)
+        {
+            if (mLogger.isDebugEnabled())
+            {
+                // ignore purge exceptions
+                mLogger.debug("EXCEPTION PURGING session attributes",e);
+            }
+        }
+    }    
 }
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkEditAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkEditAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkEditAction.java (o();
 				PageCacheFilter.removeFromCache( request, website );
                  ThemeEditorForm teForm = (ThemeEditorForm)form;
 								
@@ -413,12 +417,12 @@
 	 * @param rreq
 	 * @return PageData
 	 */
-	private PageData getDefaultPage(RollerRequest rreq) throws RollerException
+	private PageData getDefaultPage(HttpServletRequest request) throws RollerException
 	{
 		try
 		{
-			UserManager mgr = rreq.getRoller().getUserManager();
-			WebsiteData wd = rreq.getCurrentWebsite();
+			UserManager mgr = RollerFactory.getRoller().getUserManager();
+			WebsiteData wd = RollerSession.getRollerSession(request).getCurrentWebsite();
 			String defaultPageId = wd.getDefaultPageId();
 			return mgr.retrievePage( defaultPageId );
 		}
@@ -436,11 +440,11 @@
      * @param theme
      * @throws RollerException
      */
-    private void setThemePages( RollerRequest rreq, String theme )
+    private void setThemePages( HttpServletRequest request, String theme )
        throws RollerException
     {
         RollerContext/branches/roller_2.0/src/org/roller/presentation/weblog/actions/BasePingTargetsAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/BasePingTargetsAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/BasePingTargetsAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/BasePingTargetsAction.java Sun Jul 17 18:12:36 2005
@@ -8,23 +8,25 @@
 
 package org.roller.presentation.weblog.actions;
 
-import org.apache.struts.actions.DispatchAction;
+import java.util.List;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForwa
 			if ( user != null ) 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/BasePageServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/BasePageServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/BasePageServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/BasePageServlet.java Sun Jul 17 18:12:36 2005
@@ -1 +1 @@
-package org.roller.presentation.velocity;

import java.io.IOException;
import java.io.StringWriter;
import java.util.Map;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspFactory;
import javax.servlet.jsp.PageContext;

import org.apache.commons.loriginal)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkEditAction.java Sun Jul 17 18:12:36 2005
@@ -3,22 +3,22 @@
  */
 package org.roller.presentation.bookmarks.actions;
 
+import java.util.LinkedList;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.struts.action.Action;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.roller.model.BookmarkManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.BookmarkData;
 import org.roller.pojos.FolderData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.bookmarks.formbeans.BookmarkFormEx;
-import org.roller.presentation.forms.BookmarkForm;
-
-import java.util.LinkedList;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse; rollerContext = 
-           RollerContext.getRollerContext(rreq.getRequest());
+           RollerContext.getRollerContext(request);
            
         try
         {        
@@ -450,10 +454,10 @@
             {
                 String pageName = (String) iter.next();
                 String sb = (String)pages.get( pageName );
-                UserManager umgr = rreq.getRoller().getUserManager();
-                WebsiteData website = rreq.getCurrentWebsite();
+                UserManager umgr = RollerFactory.getRoller().getUserManager();
+                WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
                 String handle = website.getHandle();
-                PageData page = umgr.getPageByName( rreq.getCurrentWebsite(), pageName );
+                PageData page = umgr.getPageByName( RollerSession.getRollerSession(request).getCurrentWebsite(), pageName );
                 if (page != null)
                 {
                     PreviewResourceLoader.setTemprd;
 import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionMessages;
 import org.apache.struts.action.ActionMessage;
-import org.apache.commons.logging.Log;
-import org.roller.presentation.RollerRequest;
-import org.roller.presentation.forms.PingTargetForm;
+import org.apache.struts.action.ActionMessages;
+import org.apache.struts.actions.DispatchAction;
+import org.roller.RollerException;
 import org.roller.model.PingTargetManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.PingTargetData;
-import org.roller.RollerException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletException;
-import java.util.List;
+import org.roller.presentation.RollerRequest;
+import org.roller.presentation.forms.PingTargetForm;
 
 /**
  * Base class for both common and custom ping target operations.  The methods here apply to
@@ -111,7 +113,7 @@
         thgging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.context.Context;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.servlet.VelocityServlet;
import org.roller.RollerException;
import org.roller.model.UserManager;
import org.roller.pojos.PageData;
import org.roller.pojos.UserData;
import org.roller.pojos.WebsiteData;
import org.roller.presentation.RollerRequest;

/**
 * Base Servlet for Servlets that render user page templates. Loads the
 * Velocity context using the ContextLoader and runs the page template
 * selected by the request.
 *
 * @author llavandowska
 * @author David M Johnson
 */
public abstract class BasePageServlet extends VelocityServlet
{
    private static Log mLogger =
        LogFactory.getFactory().getInstance(BasePageServlet.class);
	/**
	 *  <p>Sets servletContext for WebappRes
 
 /**
  * @struts.action path="/editor/bookmarkEdit" name="bookmarkFormEx" validate="false"
@@ -37,7 +37,7 @@
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
         WebsiteData wd = rreq.getWebsite();
-        BookmarkManager bmgr = rreq.getRoller().getBookmarkManager();
+        BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
         BookmarkFormEx form = (BookmarkFormEx)actionForm;
         
         FolderData parentFolder = null;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java (original)
+++ incubator/roller/branclate(page.getId(),sb, handle);
@@ -495,7 +499,7 @@
         try
         {
             //UserData ud = rreq.getUser();
-            UserManager mgr = rreq.getRoller().getUserManager();
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
             //String username = ud.getUserName();
         
             String themeDir = rollerContext.getThemePath(theme);        
@@ -509,7 +513,8 @@
                 String pageName = children[i].substring(
                     0,children[i].length()-3);
     
-                PageData page = mgr.getPageByName(rreq.getCurrentWebsite(), pageName);
+                PageData page = mgr.getPageByName(
+                        RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite(), pageName);
                 if (page != null)
                 {
                     PreviewResourceLoader.clearTemplate( page.getId() );
@@ -548,8 +553,8 @@
            
         try
         {
-            UserManager mgr = rreq.getRoller().getUserManager()rows Exception
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
-        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
         PingTargetForm pingTargetForm = (PingTargetForm) form;
         try
         {
@@ -143,7 +145,7 @@
 
             // Appears to be ok.  Save it, commit and return refreshed view of target list.
             pingTarget.save();
-            rreq.getRoller().commit();
+            RollerFactory.getRoller().commit();
             return view(mapping, form, req, res);
         }
         catch (Exception e)
@@ -252,7 +254,7 @@
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
         PingTargetForm pingTargetForm = (PingTargetForm) form;
-        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
        ourceLoader.</p>
	 *
	 * @param config servlet configuation
	 */
	public void init( ServletConfig config )
		throws ServletException
	{
		super.init( config );
		WebappResourceLoader.setServletContext( getServletContext() );
	}
    public Template handleRequest( HttpServletRequest request,
                                   HttpServletResponse response,
                                   Context ctx ) throws Exception
    {
        String pid = null;
        Template outty = null;
        Exception pageException = null;
        
        try
        {
            PageContext pageContext =
                JspFactory.getDefaultFactory().getPageContext(
                    this, request, response,"", true, 8192, true);
            // Needed to init request attributes, etc.
            RollerRequest rreq = RollerRequest.getRollerRequest(pageContext);
            UserManager userMgr = rreq.getRoller().getUserManager();
            
            WebsiteData wd = null;
            if (request.getAttribute(RollerRequeshes/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarkSaveAction.java Sun Jul 17 18:12:36 2005
@@ -14,6 +14,7 @@
 import org.apache.struts.action.ActionMapping;
 import org.roller.RollerPermissionsException;
 import org.roller.model.BookmarkManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.BookmarkData;
 import org.roller.pojos.FolderData;
 import org.roller.presentation.RollerRequest;
@@ -40,13 +41,13 @@
         {
             BookmarkFormEx form = (BookmarkFormEx)actionForm;
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            BookmarkManager bmgr = rreq.getRoller().getBookmarkManager();
+            BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
             
             BookmarkData bd = null;
             if (null != form.getId() && !form.getId().trim().equals("")) 
             {
                 bd = bmgr.retrieveBookmark(form.getId());
-                bd.save(); // should throw if save not permitted
+ ;
-            WebsiteData website = rreq.getCurrentWebsite();
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
+            WebsiteData website = RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite();
         
             HashMap pages = rollerContext.readThemeMacros(theme);
             Iterator iter = pages.keySet().iterator();
@@ -558,7 +563,8 @@
                 String pageName = (String) iter.next();
                 String pageContent = (String)pages.get( pageName );
     
-                PageData page = mgr.getPageByName( rreq.getCurrentWebsite(), pageName );
+                PageData page = mgr.getPageByName( 
+                        RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite(), pageName );
                 if (page != null)
                 {
                     // User already has page by that name, so overwrite it.
@@ -578,7 +584,7 @@
                     mgr.storePage( page );
                 }
             }
-            rr try
         {
             if (!hasRequiredRights(rreq))
@@ -265,7 +267,7 @@
                 throw new RollerException("Missing ping target id.");
             }
             pingTargetMgr.removePingTarget(pingTargetId);
-            rreq.getRoller().commit();
+            RollerFactory.getRoller().commit();
             return view(mapping, form, req, res);
         }
         catch (Exception e)
@@ -285,7 +287,7 @@
     private PingTargetData select(RollerRequest rreq) throws RollerException
     {
         String pingTargetId = rreq.getRequest().getParameter(RollerRequest.PINGTARGETID_KEY);
-        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
         if (pingTargetId == null || pingTargetId.length() == 0)
         {
             throw new RollerException("Missing ping target id: " + pingTargetId);
@@ -311,7 +313,7 @@
     {
         ActionMessages errors = new ActionMessages();
 
t.OWNING_WEBSITE) != null) {
                wd = (WebsiteData)
                    request.getAttribute(RollerRequest.OWNING_WEBSITE);
            }
            else
            {
                wd = rreq.getWebsite();
            }
            
            // If request specified the page, then go with that
            PageData pd = null;
            if (rreq.getPage() != null // RollerRequest does too much guess work
                    && request.getAttribute(RollerRequest.OWNING_WEBSITE) == null)
            {
                pd = rreq.getPage();
                pid = pd.getId();
            }
            // If page not available from request, then use website's default
            else if (wd != null)
            {
                pd = userMgr.retrievePage(wd.getDefaultPageId());
                pid = pd.getId();
                rreq.setPage(pd); 
            }
            // Still no page ID, then we have a problem
            if ( pid == null )
            {
                throw new ResourceNotFound               bd.startEditing(); // should throw if save not permitted
             }
             else 
             {
@@ -59,7 +60,7 @@
             }
             form.copyTo(bd, request.getLocale());
             bd.save();
-            rreq.getRoller().commit();
+            RollerFactory.getRoller().commit();
             
             request.setAttribute(
                 RollerRequest.FOLDERID_KEY,bd.getFolder().getId());  

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/BookmarksAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/Bookmaeq.getRoller().commit();
+            RollerFactory.getRoller().commit();
         }
         catch (Exception e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UploadFileFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UploadFileFormAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UploadFileFormAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UploadFileFormAction.java Sun Jul 17 18:12:36 2005
@@ -22,9 +22,10 @@
 import org.roller.RollerException;
 import org.roller.config.RollerRuntimeConfig;
 import org.roller.model.FileManager;
-import org.roller.pojos.UserData;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.WebsiteData;
 import -        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
         if (!pingTargetMgr.isNameUnique(pingTarget))
         {
             errors.add(ActionMessages.GLOBAL_MESSAGE,

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoriesAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoriesAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoriesAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoriesAction.java Sun Jul 17 18:12:36 2005
@@ -22,10 +22,12 @@
 import org.apache.struts.action.ActionMessages;
 import org.apache.struts.actions.DispatException("Page not found");
            }
            
            outty = prepareForPageExecution(ctx, rreq, response, pd);
        }
        catch( Exception e )
        {
	        pageException = e;
            response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
        if (pageException != null)
        {
            mLogger.error("EXCEPTION: in RollerServlet", pageException);
            request.setAttribute("DisplayException", pageException);
        }
        return outty;
    }

    //------------------------------------------------------------------------
    /**
     * Try to load user-specified Decorator (if specified).  Failing that
     * see if user has a _decorator Page, if not check for a _decorator
     * in the Preview resource loader.  Finally, if none of those can
     * be found fall back to the no-op decorator.
     * @param object
     * @return
     */
    private Template findDecorator(String decoratorName, UserManager userMgr, WebsiteData wd) 
        throwsrksAction.java Sun Jul 17 18:12:36 2005
@@ -23,6 +23,8 @@
 import org.apache.struts.actions.DispatchAction;
 import org.roller.RollerException;
 import org.roller.model.BookmarkManager;
+import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.BookmarkData;
 import org.roller.pojos.FolderData;
 import org.roller.pojos.WebsiteData;
@@ -60,7 +62,7 @@
         throws RollerException
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        if (rreq.isUserAuthorizedToEdit())
+        if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
         {
             addModelObjects(request, (BookmarksForm)actionForm);
             return mapping.findForward("BookmarksForm");
@@ -87,10 +89,10 @@
         HttpServletResponse response)
         throws RollerException
     {
-        RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        if (rreq.isUserAuthorizedToEdit())
+        Roller roller = RollerFactory.getRoller();
org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.website.formbeans.UploadFileForm;
 import org.roller.util.RollerMessages;
 
@@ -58,11 +59,12 @@
         try
         {
             rreq = RollerRequest.getRollerRequest(request);
-            if ( !rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( !rollerSession.isUserAuthorizedToEdit() )
             {
                 return mapping.findForward("access-denied");
             }
-            website = rreq.getCurrentWebsite();
+            website = RollerSession.getRollerSession(request).getCurrentWebsite();
         }
         catch (Exception e)
         {
@@ -117,7 +119,7 @@
                     fileSize = files[i].getFileSize();
                     
                     //retrieve the file data
-                    FileManager fmgr = rreq.getRoller().getFileManager();
+                    FileManager fmchAction;
 import org.roller.RollerException;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.weblog.formbeans.CategoriesForm;
 
 /**
@@ -58,7 +60,9 @@
         throws RollerException
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        if (rreq.isUserAuthorizedToEdit())
+        RollerSession rollerSession = RollerSession.getRollerSession(
+                rreq.getRequest());
+        if (rollerSession.isUserAuthorizedToEdit())
         {
             addModelObjects(request, (CategoriesForm)actionForm);
             return mapping.findForward("CategoriesForm");
@@ -88,11 +92,13 @@
         ActionMessages messages = new ActionMessages();
         ActionForward forward = mapping.findForward("CategoriesForm");
         RollerRequest rreq = +        if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
         {
-            BookmarkManager bmgr = rreq.getRoller().getBookmarkManager();
+            BookmarkManager bmgr = roller.getBookmarkManager();
             BookmarksForm form = (BookmarksForm)actionForm;
 
             mLogger.debug("Deleting folders and bookmarks.");
@@ -113,7 +115,7 @@
                     bmgr.removeBookmark(bookmarks[j]);
                 }
             }
-            rreq.getRoller().commit();
+            roller.commit();
 
             addModelObjects(request, (BookmarksForm)actionForm);
             return mapping.findForward("BookmarksForm");
@@ -142,12 +144,12 @@
     {
         ActionMessages messages = new ActionMessages();
         ActionForward forward = mapping.findForward("BookmarksForm");
-        RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        if (rreq.isUserAuthorizedToEdit())
+        Roller roller = RollerFactory.getRoller();
+        if (RollerSession.getRollerSe ResourceNotFoundException, ParseErrorException, RollerException, Exception
    {
        Template decorator = null;
        PageData decoratorPage = null;
        String decoratorId = null;
        
        // check for user-specified decorator
        if (decoratorName != null)
        {    
            decoratorPage = userMgr.getPageByName(wd, decoratorName);
            if (decoratorPage != null) 
            {
                decoratorId = decoratorPage.getId();
            }
        }
        
        // if no user-specified decorator try default page-name
        if (decoratorPage == null)
        {
            decoratorPage = userMgr.getPageByName(wd, "_decorator");
            if (decoratorPage != null) 
            {
                decoratorId = decoratorPage.getId();
            }
            else
            {
                // could be in PreviewResourceLoader
                decoratorId = "_decorator";
            }
        }

        // try loading Template
        if (decoratorId != null) 
 gr = RollerFactory.getRoller().getFileManager();
                     if (fmgr.canSave(website, fileName, fileSize, msgs))
                     {
                         InputStream stream = files[i].getInputStream();
@@ -162,8 +164,8 @@
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
         try
         {
-            FileManager fmgr = rreq.getRoller().getFileManager();
-            WebsiteData website = rreq.getCurrentWebsite();
+            FileManager fmgr = RollerFactory.getRoller().getFileManager();
+            WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
             String[] deleteFiles = theForm.getDeleteFiles();
             for (int i=0; i<deleteFiles.length; i++)
             {
@@ -202,7 +204,8 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( !rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+    RollerRequest.getRollerRequest(request);
-        if (rreq.isUserAuthorizedToEdit())
+        RollerSession rollerSession = RollerSession.getRollerSession(
+                rreq.getRequest());
+        if (rollerSession.isUserAuthorizedToEdit())
         {
             try 
             {
-                WeblogManager wmgr = rreq.getRoller().getWeblogManager();
+                WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
                 CategoriesForm form = (CategoriesForm)actionForm; 
     
                 mLogger.debug("Moving categories to category, id=" 
@@ -124,7 +130,7 @@
                     }
                 }
     
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
                 
                 addModelObjects(request, (CategoriesForm)actionForm);
                 saveMessages(request, messages);
@@ -152,8 +158,8 @@
         throws RollerException
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request)ssion(request).isUserAuthorizedToEdit())
         {
             try 
             {
-                BookmarkManager bmgr = rreq.getRoller().getBookmarkManager();
+                BookmarkManager bmgr = roller.getBookmarkManager();
                 BookmarksForm form = (BookmarksForm)actionForm;
     
                 mLogger.debug("Moving folders and bookmarks to folder, id="
@@ -188,7 +190,7 @@
                         bd.save();
                     }
                 }
-                rreq.getRoller().commit();
+                roller.commit();
     
                 addModelObjects(request, (BookmarksForm)actionForm);
                 saveMessages(request, messages);
@@ -219,7 +221,7 @@
         //WebsiteData wd = rreq.getWebsite();
         RollerSession rollerSession = RollerSession.getRollerSession(request);
         WebsiteData wd = rollerSession.getCurrentWebsite();
-        BookmarkManager bmgr = rreq.getRoller().getBookmarkManager();
+        BookmarkManager bmgr = RollerFactory.getRoller().getB       {
            try
            {
                decorator = getTemplate(decoratorId, "UTF-8");
            }
            catch (Exception e)
            {
                // it may not exist, so this is okay
            }
        }
        
        // couldn't find Template, load default "no-op" decorator
        if (decorator == null) 
        {
            decorator = getTemplate("/themes/noop_decorator.vm", "UTF-8");
        }
        return decorator;
    }

    /** 
     * Prepare for page execution be setting content type, populating context,
     * and processing the page decorator if needed.
     */
    protected Template prepareForPageExecution(Context ctx, RollerRequest rreq, 
        HttpServletResponse response, PageData pd) throws Exception
    {                    
        Template outty = null;
        UserManager userMgr = rreq.getRoller().getUserManager();
        WebsiteData wd = pd.getWebsite();
        
        // if page has an extension - use that to set the contentType
        St        if ( !rollerSession.isUserAuthorizedToEdit() )
             {
                 return mapping.findForward("access-denied");
             }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserAdminAction.java Sun Jul 17 18:12:36 2005
@@ -16,15 +16,13 @@
 import org.apache.struts.action.ActionMessage;
 import org.apache.struts.action.ActionMessages;
 import org.roller.RollerException;
-import org.roller.business.search.operations.RebuildWebsiteIndexOperation;
-import org.roller.business.se;
-        WebsiteData wd = rreq.getCurrentWebsite();
-        WeblogManager wmgr = rreq.getRoller().getWeblogManager();
+        WebsiteData wd = RollerSession.getRollerSession(request).getCurrentWebsite();
+        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
         
         TreeSet allCategories = new TreeSet(new CategoryPathComparator());
         

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryDeleteAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryDeleteAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryDeleteAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryDeleteAction.java Sun Jul 17 18:12:36 2005
@@ -3,23 +ookmarkManager();
 
         TreeSet allFolders = new TreeSet(new FolderPathComparator());
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderEditAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderEditAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderEditAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderEditAction.java Sun Jul 17 18:12:36 2005
@@ -3,20 +3,19 @@
  */
 package org.roller.presentation.bookmarks.actions;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.struts.action.Action;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForing pageLink = pd.getLink();
        String mimeType = getServletConfig().getServletContext().getMimeType(pageLink);
        if(mimeType != null) {
            // we found a match ... set the content type
            response.setContentType(mimeType);
        }
        
        /* old way ... not as flexible -- Allen G
        int period = pd.getLink().indexOf('.');
        if (period > -1) 
        {
            String extension = pd.getLink().substring(period+1);
            if ("js".equals(extension)) 
            {
                extension = "javascript";
            }
            response.setContentType("text/" + extension);
        }
        */
    
        // Made it this far, populate the Context
        ContextLoader.setupContext( ctx, rreq, response );

        // Get the page
        outty =  getTemplate( pd.getId(), "UTF-8" );

        /**
         * User can define a Decorator Template.
         */
        if (wd != null)
        {
            // parse/merge Page template
            StringWritarch.operations.RemoveWebsiteIndexOperation;
 import org.roller.model.IndexManager;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
-import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.presentation.website.formbeans.UserAdminForm;
 import org.roller.util.StringUtils;
 
@@ -60,10 +58,11 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() && rreq.isAdminUser() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() && rollerSession.isAdminUser() )
             {
                 UserAdminForm userForm = (UserAdminForm)actionForm;
-                UserManager mgr = rreq.getRoller().getUserManager();
+            3,25 @@
  */
 package org.roller.presentation.weblog.actions;
 
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.struts.action.Action;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.weblog.formbeans.CategoryDeleteForm;
 
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * @struts.action path="/editor/categoryDelete" name="categoryDeleteForm"
  * @strrward;
 import org.apache.struts.action.ActionMapping;
 import org.roller.model.BookmarkManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.FolderData;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.bookmarks.formbeans.FolderFormEx;
 
-import java.util.LinkedList;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * @struts.action path="/editor/folderEdit" name="folderFormEx" validate="false"
  * @struts.action-forward name="FolderForm" path="/bookmarks/FolderForm.jsp"
@@ -33,7 +32,7 @@
         throws Exception
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        BookmarkManager bmgr = rreq.getRoller().getBookmarkManager();
+        BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
         FolderFormEx form = (FolderFormEx)actionForm;
         
         FolderData parentFolder = null;

Modified: incubator/roller/branches/roller_2.0/src/org/rollerer sw = new StringWriter();
            outty.merge(ctx, sw);
            ctx.put("decorator_body", sw.toString());

            // replace outty with decorator Template
            outty = findDecorator((String)ctx.get("decorator"), userMgr, wd);                
        }
        return outty;
    }
    
    //------------------------------------------------------------------------
    /**
     * Handle error in Velocity processing.
     */
    protected void error( HttpServletRequest req, HttpServletResponse res,
        Exception e) throws ServletException, IOException
    {
        mLogger.warn("ERROR in VelocityServlet",e);
    }
   
    /** 
     * Override to prevent Velocity from putting "req" and "res" into the context.
     * Allowing users access to the underlying Servlet objects is a security risk.
     * If need access to request parameters, use $requestParameters.
     */
    protected Context createContext(
            HttpServletRequest req,
            HttpServletResponse res) {
        
        UserManager mgr = RollerFactory.getRoller().getUserManager();
                 
                 if (userForm != null && userForm.getUserName() != null)
                 {
@@ -122,13 +121,14 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() && rreq.isAdminUser() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() && rollerSession.isAdminUser() )
             {
                 UserAdminForm userForm = (UserAdminForm)actionForm;
-                UserManager mgr = rreq.getRoller().getUserManager();
+                UserManager mgr = RollerFactory.getRoller().getUserManager();
                 
                 // Need system user to update user
-                rreq.getRoller().setUser(UserData.SYSTEM_USER);
+                RollerFactory.getRoller().setUser(UserData.SYSTEM_USER);
 
 			   UserData user = mgr.retrieveUsuts.action-forward name="Categories" path="/editor/categories.do?method=selectCategory"
@@ -39,9 +41,10 @@
         ActionForward forward = null;
         CategoryDeleteForm form = (CategoryDeleteForm)actionForm;
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        WeblogManager wmgr = rreq.getRoller().getWeblogManager();
-        
-        if (rreq.isUserAuthorizedToEdit())
+        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+        RollerSession rollerSession = RollerSession.getRollerSession(
+                rreq.getRequest());
+        if (rollerSession.isUserAuthorizedToEdit())
         {
             String catid = request.getParameter("catid");
             WeblogCategoryData catToDelete = 
@@ -54,7 +57,7 @@
             if (form.isDelete() == null)
             {
                 // Present CategoryDeleteOK? page to user
-                WebsiteData website = rreq.getCurrentWebsite();
+                WebsiteData website = RollerSession.getRollerSess/presentation/bookmarks/actions/FolderSaveAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/FolderSaveAction.java Sun Jul 17 18:12:36 2005
@@ -15,6 +15,7 @@
 import org.roller.RollerException;
 import org.roller.RollerPermissionsException;
 import org.roller.model.BookmarkManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.FolderData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
@@ -40,7 +41,7 @@
         FolderFormEx form = (FolderFormEx)actionForm;
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
           VelocityContext context = new VelocityContext();
        context.put(REQUEST, new RequestWrapper(req.getParameterMap()));
        return context;
        
    }
    
    /** Provide access to request params only, not actual request */
    public static class RequestWrapper
    {
        Map params = null;
        public RequestWrapper(Map params) 
        {
            this.params = params;
        }
        public String getParameter(String key)
        {
            String ret = null;
            String[] array = (String[])params.get(key);
            if (array != null && array.length > 0)
            {
                ret = array[0];
            }
            return ret;
        }
    }
}
\ No newline at end of file
+package org.roller.presentation.velocity;

import java.io.IOException;
import java.io.StringWriter;
import java.util.Map;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponseer(userForm.getId());
                 userForm.copyTo(user, request.getLocale()); // doesn't copy password
@@ -150,7 +150,7 @@
                     {
                         try
                         {
-                            user.resetPassword(rreq.getRoller(), 
+                            user.resetPassword(RollerFactory.getRoller(), 
                                userForm.getPasswordText(), 
                                userForm.getPasswordConfirm());
                         }
@@ -163,7 +163,7 @@
                     
                     // Persist changes to user
                     mgr.storeUser( user );
-                    rreq.getRoller().commit(); 
+                    RollerFactory.getRoller().commit(); 
                     
                     msgs.add(ActionMessages.GLOBAL_MESSAGE,
                         new ActionMessage("userSettings.saved"));
@@ -198,13 +198,13 @@
             UserData ud) throws RollerException
     {
         // remove user's Entries from Lucene index
-ion(request).getCurrentWebsite();
                 WeblogCategoryData theCat = wmgr.retrieveWeblogCategory(catid);
                 Iterator allCats = 
                     wmgr.getWeblogCategories(website).iterator();
@@ -102,7 +105,7 @@
                 // move entries to destCat and remove catToDelete
                 catToDelete.remove(destCat);
                 
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
                 
                 if (null != returnId) 
                 {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryEditAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryEditAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryEditAction.jav  WebsiteData wd = rreq.getWebsite();
-        BookmarkManager bmgr = rreq.getRoller().getBookmarkManager();
+        BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
         
         FolderData fd = null;
         if (null != form.getId() && !form.getId().trim().equals("")) 
@@ -73,7 +74,7 @@
         {
             // Store object and commit
             fd.save();
-            rreq.getRoller().commit();
+            RollerFactory.getRoller().commit();
         }
         catch (RollerPermissionsException e)
         {
@@ -84,7 +85,7 @@
         }
         catch (RollerException re)
         {
-            rreq.getRoller().rollback();
+            RollerFactory.getRoller().rollback();
             ActionErrors errors = new ActionErrors();
             String msg = (null != re.getRootCause())
                 ? re.getRootCause().toString()

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java
URL: http://svn.apache;
import javax.servlet.jsp.JspFactory;
import javax.servlet.jsp.PageContext;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.context.Context;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.apache.velocity.servlet.VelocityServlet;
import org.roller.RollerException;
import org.roller.model.RollerFactory;
import org.roller.model.UserManager;
import org.roller.pojos.PageData;
import org.roller.pojos.WebsiteData;
import org.roller.presentation.RollerRequest;

/**
 * Base Servlet for Servlets that render user page templates. Loads the
 * Velocity context using the ContextLoader and runs the page template
 * selected by the request.
 *
 * @author llavandowska
 * @author David M Johnson
 */
public abstract class BasePageServlet extends VelocityServlet
{
    private static Log mLogger =
           IndexManager indexManager = rreq.getRoller().getIndexManager();
-        WebsiteData website = rreq.getCurrentWebsite();
+        IndexManager indexManager = RollerFactory.getRoller().getIndexManager();
+        WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
         indexManager.removeWebsiteIndex(website); 
         
         // delete user from database
         ud.remove();
-        rreq.getRoller().commit();
+        RollerFactory.getRoller().commit();
         ud = null;
 
         request.getSession().setAttribute(
@@ -232,12 +232,13 @@
 		try
 		{
 			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rreq.isUserAuthorizedToEdit() && rreq.isAdminUser() )
+             RollerSession rollerSession = RollerSession.getRollerSession(request);
+			if ( rollerSession.isUserAuthorizedToEdit() && rollerSession.isAdminUser() )
 			{
 				UserAdminForm uaf = (UserAdminForm)actionForm;
 				
 				// if admin requests an index be re-built, do it
-				a (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryEditAction.java Sun Jul 17 18:12:36 2005
@@ -3,21 +3,23 @@
  */
 package org.roller.presentation.weblog.actions;
 
+import java.util.LinkedList;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.struts.action.Action;
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.weblog.formbeans.WeblogCategoryFormEx;
 
-import java.util.LinkedList;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * @struts.action path="/edi.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/actions/ImportBookmarksFormAction.java Sun Jul 17 18:12:36 2005
@@ -1,6 +1,14 @@
 
 package org.roller.presentation.bookmarks.actions;
 
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+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.Action;
@@ -11,17 +19,10 @@
 import org.apache.struts.action.ActionMapping;
     LogFactory.getFactory().getInstance(BasePageServlet.class);
	/**
	 *  <p>Sets servletContext for WebappResourceLoader.</p>
	 *
	 * @param config servlet configuation
	 */
	public void init( ServletConfig config )
		throws ServletException
	{
		super.init( config );
		WebappResourceLoader.setServletContext( getServletContext() );
	}
    public Template handleRequest( HttpServletRequest request,
                                   HttpServletResponse response,
                                   Context ctx ) throws Exception
    {
        String pid = null;
        Template outty = null;
        Exception pageException = null;
        
        try
        {
            PageContext pageContext =
                JspFactory.getDefaultFactory().getPageContext(
                    this, request, response,"", true, 8192, true);
            // Needed to init request attributes, etc.
            RollerRequest rreq = RollerRequest.getRollerRequest(pageContext);
            UserManager userMgr = RollerFactory.getRollIndexManager manager = rreq.getRoller().getIndexManager();								 
+				IndexManager manager = RollerFactory.getRoller().getIndexManager();								 
 				manager.rebuildWebsiteIndex();
  				request.getSession().setAttribute(
 					RollerSession.STATUS_MESSAGE,

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserBaseAction.java Sun Jul 17 18:12:36 2005
@@ -1,6 +1,15 @@
 
 package org.roller.presentation.website.actions;
 
+import java.util.Collection;
+import java.util.Date;
+import java.util.Locator/categoryEdit" name="weblogCategoryFormEx" validate="false"
  * @struts.action-forward name="CategoryForm" path="/weblog/CategoryForm.jsp"
@@ -34,8 +36,8 @@
         throws Exception
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        WebsiteData wd = rreq.getCurrentWebsite();
-        WeblogManager wmgr = rreq.getRoller().getWeblogManager();
+        WebsiteData wd = RollerSession.getRollerSession(request).getCurrentWebsite();
+        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
         WeblogCategoryFormEx form = (WeblogCategoryFormEx)actionForm;
         
         WeblogCategoryData parentCat = null;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategorySaveAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategorySaveAction.java?rev=219437&r1=219436&r2=219437&view=diff
======================================================== import org.apache.struts.upload.FormFile;
 import org.roller.model.BookmarkManager;
+import org.roller.model.RollerFactory;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.bookmarks.formbeans.FolderFormEx;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 
 /////////////////////////////////////////////////////////////////////////////
 /**
@@ -98,10 +99,10 @@
                         RollerRequest rreq = 
                             RollerRequest.getRollerRequest(request);
                         BookmarkManager bm = 
-                            rreq.getRoller().getBookmarkManager();    
+                            RollerFactory.getRoller().getBookmarkManager();    
                         bm.importBookmarks(rreq.getWebsite(), "unfiled", data);
                         
-                 er().getUserManager();
            
            WebsiteData wd = null;
            if (request.getAttribute(RollerRequest.OWNING_WEBSITE) != null) {
                wd = (WebsiteData)
                    request.getAttribute(RollerRequest.OWNING_WEBSITE);
            }
            else
            {
                wd = rreq.getWebsite();
            }
            
            // If request specified the page, then go with that
            PageData pd = null;
            if (rreq.getPage() != null // RollerRequest does too much guess work
                    && request.getAttribute(RollerRequest.OWNING_WEBSITE) == null)
            {
                pd = rreq.getPage();
                pid = pd.getId();
            }
            // If page not available from request, then use website's default
            else if (wd != null)
            {
                pd = userMgr.retrievePage(wd.getDefaultPageId());
                pid = pd.getId();
                rreq.setPage(pd); 
            }
            // Still nole;
+import java.util.TimeZone;
+import java.util.TreeSet;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.struts.action.ActionError;
@@ -8,23 +17,14 @@
 import org.apache.struts.action.ActionMessages;
 import org.apache.struts.actions.DispatchAction;
 import org.roller.RollerException;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WebsiteData;
-import org.roller.presentation.MainPageAction;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
-import org.roller.presentation.website.formbeans.UserAdminForm;
 import org.roller.presentation.website.formbeans.UserFormEx;
 import org.roller.util.Utilities;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
-import java.util.TreeSet;======================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategorySaveAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategorySaveAction.java Sun Jul 17 18:12:36 2005
@@ -3,6 +3,9 @@
  */
 package org.roller.presentation.weblog.actions;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.struts.action.Action;
 import org.apache.struts.action.ActionError;
 import org.apache.struts.action.ActionErrors;
@@ -10,14 +13,13 @@
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.roller.RollerPermissionsException;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.weblog.formbeans.WeblogCategoryF       rreq.getRoller().commit();
+                        RollerFactory.getRoller().commit();
                     }
                     else 
                     {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/BreadCrumbFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/BreadCrumbFilter.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/BreadCrumbFilter.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/BreadCrumbFilter.java Sun Jul 17 18:12:36 2005
@@ -1,10 +1,5 @@
 package org.roller.presentation.filters;
 
-import org.apache.commons.collections.ArrayStack;
-import org.roller.presentation.RollerSession;
-import org.roller.util.StringUtils;
-import org.roller.util.Utilities;
-
 import java.io.IOException;
 
 i page ID, then we have a problem
            if ( pid == null )
            {
                throw new ResourceNotFoundException("Page not found");
            }
            
            outty = prepareForPageExecution(ctx, rreq, response, pd);
        }
        catch( Exception e )
        {
	        pageException = e;
            response.setStatus( HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        }
        if (pageException != null)
        {
            mLogger.error("EXCEPTION: in RollerServlet", pageException);
            request.setAttribute("DisplayException", pageException);
        }
        return outty;
    }

    //------------------------------------------------------------------------
    /**
     * Try to load user-specified Decorator (if specified).  Failing that
     * see if user has a _decorator Page, if not check for a _decorator
     * in the Preview resource loader.  Finally, if none of those can
     * be found fall back to the no-op decorator.
     * @param object
     * @retu
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
 
 
 
@@ -93,7 +93,7 @@
         // prepare locales & timezones
         if (ud != null)
         {
-            UserManager mgr = rreq.getRoller().getUserManager();
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
             WebsiteData website = (WebsiteData)mgr.getWebsites(ud, null).get(0);
             //form.setLocale( website.getLocale() );
             //form.setTimezone( website.getTimezone() );
@@ -211,7 +211,7 @@
 //    protected void refreshIndexCache(HttpServletRequest request,
 //            RollerRequest rreq, UserAdminForm uaf) throws RollerException
 //    {
-//        WebsiteData website = rreq.getRoller().getUserManager().getWebsite(
+//        WebsiteData website = RollerFactory.getRoller().getUserManager().getWebsite(
 //                uaf.getUserName(), false);
 //        boolean refreshIndexCache = false;
 //        if (request.getParameter("userEnabled") == null)

ModifieormEx;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * @struts.action path="/editor/categorySave" name="weblogCategoryFormEx"
  *    validate="true" input="/editor/categoryEdit.do"
@@ -40,7 +42,7 @@
         {
             WeblogCategoryFormEx form = (WeblogCategoryFormEx)actionForm;
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            WeblogManager wmgr = rreq.getRoller().getWeblogManager();
+            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
             
             WeblogCategoryData cd = null;
             if (null != form.getId() && !form.getId().trim().equals("")) 
@@ -51,14 +53,14 @@
             else 
             {
                 cd = wmgr.createWeblogCategory();
-                cd.setWebsite(rreq.getCurrentWebsite());
+                cd.setWebsite(RollerSession.getRollerSession(request).getCurrentWebsite());
                 
                 String parentId = form.getParemport javax.servlet.Filter;
@@ -17,9 +12,14 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
+
+import org.apache.commons.collections.ArrayStack;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.config.RollerConfig;
+import org.roller.presentation.RollerSession;
+import org.roller.util.StringUtils;
+import org.roller.util.Utilities;
 
 /**
  * Intercepts requests and places URL

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/ByteArrayResponseWrapper.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/ByteArrayResponseWrapper.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/ByteArrayResponseWrapper.java (original)
+++ incrn
     */
    private Template findDecorator(String decoratorName, UserManager userMgr, WebsiteData wd) 
        throws ResourceNotFoundException, ParseErrorException, RollerException, Exception
    {
        Template decorator = null;
        PageData decoratorPage = null;
        String decoratorId = null;
        
        // check for user-specified decorator
        if (decoratorName != null)
        {    
            decoratorPage = userMgr.getPageByName(wd, decoratorName);
            if (decoratorPage != null) 
            {
                decoratorId = decoratorPage.getId();
            }
        }
        
        // if no user-specified decorator try default page-name
        if (decoratorPage == null)
        {
            decoratorPage = userMgr.getPageByName(wd, "_decorator");
            if (decoratorPage != null) 
            {
                decoratorId = decoratorPage.getId();
            }
            else
            {
                // could be in PreviewResourceLoader
                d: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserEditAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserEditAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserEditAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserEditAction.java Sun Jul 17 18:12:36 2005
@@ -1,5 +1,11 @@
 package org.roller.presentation.website.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.ActionErrors;
@@ -9,19 +15,14 @@
 import org.apache.struts.acntId();
                 cd.setParent(wmgr.retrieveWeblogCategory(parentId));
             }
             form.copyTo(cd, request.getLocale());
             cd.save();
-            rreq.getRoller().commit();
+            RollerFactory.getRoller().commit();
             
             request.setAttribute(
                 RollerRequest.WEBLOGCATEGORYID_KEY, cd.getParent().getId());         

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CustomPingTargetsAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CustomPingTargetsAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CustomPingTargetsAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CustomPingTargetsAction.java Sun Jul 17ubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/ByteArrayResponseWrapper.java Sun Jul 17 18:12:36 2005
@@ -1,8 +1,8 @@
 package org.roller.presentation.filters;
 
-import java.io.PrintWriter;
-import java.io.OutputStreamWriter;
 import java.io.ByteArrayOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
 
 import javax.servlet.ServletOutputStream;
 import javax.servlet.ServletResponse;

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/CompressionFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/CompressionFilter.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/CompressionFilter.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/CompressionFilter.java Sun Jul 17 18:12:decoratorId = "_decorator";
            }
        }

        // try loading Template
        if (decoratorId != null) 
        {
            try
            {
                decorator = getTemplate(decoratorId, "UTF-8");
            }
            catch (Exception e)
            {
                // it may not exist, so this is okay
            }
        }
        
        // couldn't find Template, load default "no-op" decorator
        if (decorator == null) 
        {
            decorator = getTemplate("/themes/noop_decorator.vm", "UTF-8");
        }
        return decorator;
    }

    /** 
     * Prepare for page execution be setting content type, populating context,
     * and processing the page decorator if needed.
     */
    protected Template prepareForPageExecution(Context ctx, RollerRequest rreq, 
        HttpServletResponse response, PageData pd) throws Exception
    {                    
        Template outty = null;
        UserManager userMgr = RollerFactory.getRoller().getUserManager();
  tion.ActionMessage;
 import org.apache.struts.action.ActionMessages;
 import org.roller.RollerException;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.pojos.UserData;
-import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
-import org.roller.presentation.pagecache.PageCacheFilter;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.website.formbeans.UserFormEx;
 import org.roller.util.StringUtils;
 
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 
 /////////////////////////////////////////////////////////////////////////////
 /**
@@ -50,9 +51,10 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+          18:12:36 2005
@@ -8,19 +8,22 @@
 
 package org.roller.presentation.weblog.actions;
 
+import java.util.Collections;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;
+import org.roller.config.PingConfig;
 import org.roller.model.PingTargetManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.PingTargetData;
 import org.roller.presentation.RollerRequest;
-import org.roller.config.PingConfig;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.forms.PingTargetForm;
 
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Collections;
-
 /**
  * Administer custom ping targets.
  *
@@ -52,13 +55,13 @@
     protected List getPingTargets(RollerRequest rreq) throws RollerException
     {
         HttpServletRequest req = rreq.getRequest();
-        PingTargetManager pingTargetMgr = rreq.get36 2005
@@ -1,8 +1,5 @@
 package org.roller.presentation.filters;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.zip.GZIPOutputStream;
@@ -15,6 +12,9 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /** Filter that compresses output with gzip
  *  (assuming that browser supports gzip).

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/IfPlanetModifiedFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/IfPlanetModifiedFilter.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pre      WebsiteData wd = pd.getWebsite();
        
        // if page has an extension - use that to set the contentType
        String pageLink = pd.getLink();
        String mimeType = getServletConfig().getServletContext().getMimeType(pageLink);
        if(mimeType != null) {
            // we found a match ... set the content type
            response.setContentType(mimeType);
        }
        
        /* old way ... not as flexible -- Allen G
        int period = pd.getLink().indexOf('.');
        if (period > -1) 
        {
            String extension = pd.getLink().substring(period+1);
            if ("js".equals(extension)) 
            {
                extension = "javascript";
            }
            response.setContentType("text/" + extension);
        }
        */
    
        // Made it this far, populate the Context
        ContextLoader.setupContext( ctx, rreq, response );

        // Get the page
        outty =  getTemplate( pd.getId(), "UTF-8" );

        /**
         * User can define a    if ( rollerSession.isUserAuthorizedToEdit() )
             {
-                UserData ud = rreq.getAuthenticatedUser();
+                UserData ud = RollerSession.getRollerSession(request).getAuthenticatedUser();
                 request.setAttribute("user",ud);
 
                 UserFormEx form = (UserFormEx)actionForm;
@@ -109,16 +111,17 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if (rollerSession.isUserAuthorizedToEdit())
             {
                 ActionMessages errors = validate(form, new ActionErrors());
                 if (errors.size() == 0)
                 {
-                    UserManager mgr = rreq.getRoller().getUserManager();
+                    UserManager mgr = RollerFactory.getRoller().getUserManager();
                     UserData data = mgr.getUser( form.getUserName() );
   Roller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
 
         Boolean allowCustomTargets = new Boolean(!PingConfig.getDisallowCustomTargets());
         req.setAttribute("allowCustomTargets", allowCustomTargets);
 
         List customPingTargets = allowCustomTargets.booleanValue() ?
-            pingTargetMgr.getCustomPingTargets(rreq.getCurrentWebsite()) : Collections.EMPTY_LIST;
+            pingTargetMgr.getCustomPingTargets(RollerSession.getRollerSession(req).getCurrentWebsite()) : Collections.EMPTY_LIST;
 
         return customPingTargets;
     }
@@ -69,9 +72,10 @@
     protected PingTargetData createPingTarget(RollerRequest rreq, PingTargetForm pingTargetForm)
         throws RollerException
     {
-        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
         return pingTargetMgr.createCustomPingTarget(
- sentation/filters/IfPlanetModifiedFilter.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/IfPlanetModifiedFilter.java Sun Jul 17 18:12:36 2005
@@ -17,6 +17,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.presentation.RollerRequest;
 
 /**
@@ -118,7 +119,7 @@
 	    throws RollerException
 	{
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        Roller roller = rreq.getRoller();
+        Roller roller = RollerFactory.getRoller();
         Date lastUpdated = roller.getPlanetManager().getLastUpdated();
         if (lastUpdated == null)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/LoginFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/LoginFilter.java?rev=219437&r1=219436&r2=219437&view=diff
======Decorator Template.
         */
        if (wd != null)
        {
            // parse/merge Page template
            StringWriter sw = new StringWriter();
            outty.merge(ctx, sw);
            ctx.put("decorator_body", sw.toString());

            // replace outty with decorator Template
            outty = findDecorator((String)ctx.get("decorator"), userMgr, wd);                
        }
        return outty;
    }
    
    //------------------------------------------------------------------------
    /**
     * Handle error in Velocity processing.
     */
    protected void error( HttpServletRequest req, HttpServletResponse res,
        Exception e) throws ServletException, IOException
    {
        mLogger.warn("ERROR in VelocityServlet",e);
    }
   
    /** 
     * Override to prevent Velocity from putting "req" and "res" into the context.
     * Allowing users access to the underlying Servlet objects is a security risk.
     * If need access to request parameters, use $requestParameters.
                      
                     // Need system user to update new user
-                    rreq.getRoller().setUser(UserData.SYSTEM_USER);
+                    RollerFactory.getRoller().setUser(UserData.SYSTEM_USER);
                     
                     // Copy data from form to persistent object (won't copy over password)
                     form.copyTo(data, request.getLocale());
@@ -129,7 +132,7 @@
                     {
                         try
                         {
-                            data.resetPassword(rreq.getRoller(), 
+                            data.resetPassword(RollerFactory.getRoller(), 
                                form.getPasswordText(), 
                                form.getPasswordConfirm());
                         }
@@ -150,7 +153,7 @@
                     // Persist changes
                     mgr.storeUser( data );
                     //mgr.storeWebsite( website );
-                    rreq.getRoller().commit();
+                    RollerFactor           pingTargetForm.getName(), pingTargetForm.getPingUrl(), rreq.getCurrentWebsite());
+            pingTargetForm.getName(), pingTargetForm.getPingUrl(), 
+            RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite());
     }
 
 
@@ -80,6 +84,7 @@
      */
     protected boolean hasRequiredRights(RollerRequest rreq) throws RollerException
     {
-        return (rreq.isUserAuthorizedToEdit() && !PingConfig.getDisallowCustomTargets());
+        RollerSession rollerSession = RollerSession.getRollerSession(rreq.getRequest());
+        return (rollerSession.isUserAuthorizedToEdit() && !PingConfig.getDisallowCustomTargets());
     }
 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java?rev=219437&r1=219436&r2=219437&view=diff
====================================================================================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/LoginFilter.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/LoginFilter.java Sun Jul 17 18:12:36 2005
@@ -17,10 +17,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.config.RollerConfig;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.pojos.UserData;
-import org.roller.presentation.util.RequestUtil;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.util.RequestUtil;
 import org.roller.util.Utilities;
 
 
@@ -55,8 +56,7 @@
 
         try 
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            UserManager mgr = rreq.getRoller().getUserManager();
+            UserManager mgr = RollerFactory.getRoller().getUserManager();
                 
   */
    protected Context createContext(
            HttpServletRequest req,
            HttpServletResponse res) {
        
        VelocityContext context = new VelocityContext();
        context.put(REQUEST, new RequestWrapper(req.getParameterMap()));
        return context;
        
    }
    
    /** Provide access to request params only, not actual request */
    public static class RequestWrapper
    {
        Map params = null;
        public RequestWrapper(Map params) 
        {
            this.params = params;
        }
        public String getParameter(String key)
        {
            String ret = null;
            String[] array = (String[])params.get(key);
            if (array != null && array.length > 0)
            {
                ret = array[0];
            }
            return ret;
        }
    }
}
\ No newline at end of file

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/CommentAuthenticator.java
URL: http://svn.apache.org/viewcvs/incubator/rolley.getRoller().commit();
                     
                     // Changing user no longer requires cache flush
                     //PageCacheFilter.removeFromCache(request, data);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/UserNewAction.java Sun Jul 17 18:12:36 2005
@@ -1,6 +1,14 @@
 
 package org.roller.presentation.website.actions;
 
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet==================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ExportEntriesAction.java Sun Jul 17 18:12:36 2005
@@ -3,22 +3,6 @@
  */
 package org.roller.presentation.weblog.actions;
 
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionMessage;
-import org.apache.struts.action.ActionMessages;
-import org.apache.struts.actions.DispatchAction;
-import org.apache.struts.util.RequestUtils;
-import org.roller.RollerException;
-import org.roller.model.WeblogManager;
-import org.roller.pojos.WeblogEntryData;
-import org.roller.presentation.BasePageModel;
-import org.roller.presentation.RollerRequest;
-import org.roller.presentation.velocity.ExportRss;
-import org.roller.presentation.weblog.formbeans.WeblogQueryForm;
-import org.rol           // Check to see if the user is logging out, if so, remove all
             // login cookies
@@ -68,13 +68,13 @@
                 }
     
                 mgr.removeLoginCookies(request.getRemoteUser());
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
                 RequestUtil.deleteCookie(response, c, request.getContextPath());
             } 
             else if (c != null && enabled) 
             {
                 String loginCookie = mgr.checkLoginCookie(c.getValue());
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
                 if (loginCookie != null) 
                 {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/PersistenceSessionFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/PersistenceSessionFilter.java?rev=219437&r1=219436&r2=219437&view=diff
===========================r/branches/roller_2.0/src/org/roller/presentation/velocity/CommentAuthenticator.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/CommentAuthenticator.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/CommentAuthenticator.java Sun Jul 17 18:12:36 2005
@@ -2,6 +2,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.apache.velocity.context.Context;
 import org.roller.pojos.CommentData;
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/CommentServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/CommentServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.struts.action.ActionError;
@@ -11,25 +19,15 @@
 import org.apache.struts.action.ActionMessage;
 import org.apache.struts.action.ActionMessages;
 import org.roller.RollerException;
+import org.roller.config.RollerRuntimeConfig;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.pojos.UserData;
-import org.roller.presentation.MainPageAction;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
-import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.presentation.website.formbeans.UserFormEx;
 import org.roller.util.StringUtils;
 
-import java.io.IOException;
-import java.util.HashMap;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.serler.util.DateUtil;
-
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.text.DateFormat;
@@ -39,6 +23,24 @@
 import javax.servlet.jsp.JspFactory;
 import javax.servlet.jsp.PageContext;
 
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.apache.struts.actions.DispatchAction;
+import org.apache.struts.util.RequestUtils;
+import org.roller.RollerException;
+import org.roller.model.RollerFactory;
+import org.roller.model.WeblogManager;
+import org.roller.pojos.WeblogEntryData;
+import org.roller.presentation.BasePageModel;
+import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
+import org.roller.presentation.velocity.ExportRss;
+import org.roller.presentation.weblog.formbeans.WeblogQueryForm;
+import org.roller.util.DateUtil;
+
 /**
  * @struts.act===================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/PersistenceSessionFilter.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/PersistenceSessionFilter.java Sun Jul 17 18:12:36 2005
@@ -13,7 +13,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.roller.RollerException;
 import org.roller.model.Roller;
 import org.roller.presentation.RollerContext;
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RefererFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RefererFilter.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RefererFilter.java (original)
+++ incubator/roller/branches/roller_2.0branches/roller_2.0/src/org/roller/presentation/velocity/CommentServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/CommentServlet.java Sun Jul 17 18:12:36 2005
@@ -29,11 +29,11 @@
 import org.roller.config.RollerRuntimeConfig;
 import org.roller.model.IndexManager;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.CommentData;
 import org.roller.pojos.PageData;
-import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogEntryData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.LanguageUtil;
@@ -106,7 +106,7 @@
                 JspFactory.getDefaultFactory().getPageContext(
                     this, request, response,"", true, 8192, true);
             RollerRequest rreq= RollerRequest.getRollerRequest(pageContext);
-            UserManager userMgr = rreq.getRoller().getUserManager();
+            UserManagvlet.http.HttpServletResponse;
-
-import org.roller.config.RollerRuntimeConfig;
-
 /////////////////////////////////////////////////////////////////////////////
 /**
  * Actions for creating a new user.
@@ -121,10 +119,10 @@
         else try
         {
             // Add new user
-            UserManager mgr = rreq.getRoller().getUserManager(); 
+            UserManager mgr = RollerFactory.getRoller().getUserManager(); 
             
             // Need system user to add new user
-            rreq.getRoller().setUser(UserData.SYSTEM_USER);
+            RollerFactory.getRoller().setUser(UserData.SYSTEM_USER);
 
             UserData ud = new UserData();
             form.copyTo(ud, request.getLocale()); // doesn't copy password
@@ -136,7 +134,7 @@
             if (    !StringUtils.isEmpty(form.getPasswordText()) 
                  && !StringUtils.isEmpty(form.getPasswordConfirm()))
             {
-               ud.resetPassword(rreq.getRoller(), 
+               ud.resetPassword(RollerFactory.getRoller(),ion path="/editor/exportEntries" name="weblogQueryForm" 
  *    scope="request" parameter="method"
@@ -85,7 +87,8 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( !rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(rreq.getRequest());
+            if ( !rollerSession.isUserAuthorizedToEdit() )
             {
                 forward = mapping.findForward("access-denied");
             }
@@ -125,8 +128,9 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
+            RollerSession rollerSession = RollerSession.getRollerSession(rreq.getRequest());
             WeblogQueryForm form = (WeblogQueryForm)actionForm;
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {               
                 request.setAttribute("model",
                                      new Ba/src/org/roller/presentation/filters/RefererFilter.java Sun Jul 17 18:12:36 2005
@@ -1,11 +1,5 @@
 package org.roller.presentation.filters;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.roller.model.RefererManager;
-import org.roller.presentation.RollerContext;
-import org.roller.presentation.RollerRequest;
-
 import java.io.IOException;
 
 import javax.servlet.Filter;
@@ -17,6 +11,13 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.roller.model.RefererManager;
+import org.roller.model.RollerFactory;
+import org.roller.presentation.RollerContext;
+import org.roller.presentation.RollerRequest;
+
 
 
 /**
@@ -92,7 +93,7 @@
                    )
                 {
                     RefererManager refMgr = 
-                        rreq.getRoller().getRefererManager();
+                        RollerFactory.ger userMgr = RollerFactory.getRoller().getUserManager();
             WebsiteData website = rreq.getWebsite();
                 
             // Request specifies popup
@@ -179,7 +179,7 @@
             request.setAttribute(RollerRequest.OWNING_WEBSITE, website);
 
             // Save comment
-            WeblogManager mgr = rreq.getRoller().getWeblogManager();
+            WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
             CommentFormEx cf = new CommentFormEx();
             CommentData cd = new CommentData();
             RequestUtils.populate(cf, request);
@@ -193,8 +193,8 @@
                 if (RollerContext.getCommentAuthenticator().authenticate(cd, request))
                 {
                     cd.save();
-                    rreq.getRoller().commit();
-                    reindexEntry(rreq.getRoller(), entry);
+                    RollerFactory.getRoller().commit();
+                    reindexEntry(RollerFactory.getRoller(), entry);
 
                     // Refresh use 
                   form.getPasswordText(), form.getPasswordConfirm());
             }
             
@@ -144,7 +142,7 @@
             HashMap pages = rollerContext.readThemeMacros(theme);
             mgr.addUser(ud);
             mgr.createWebsite(ud, pages, theme, form.getLocale(), form.getTimezone());
-            rreq.getRoller().commit();
+            RollerFactory.getRoller().commit();
 
 			// Flush cache so user will immediately appear on index page
             //PageCacheFilter.removeFromCache( request, ud );

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java (original)
+++ isePageModel(request, response, mapping));
@@ -149,14 +153,14 @@
                 {
                     // this work should go into a Thread!
                     WeblogManager weblogMgr =
-                        rreq.getRoller().getWeblogManager();
+                        RollerFactory.getRoller().getWeblogManager();
                     
                     //List entries = weblogMgr.getWeblogEntriesInDateRange(
                         //rreq.getUser().getUserName(), null, startDate, endDate, false);
                     //System.out.println("Export: got " + entries.size() + " entries.");
                     
                     List entries = weblogMgr.getWeblogEntries(
-                                    rreq.getCurrentWebsite(), // userName
+                                    RollerSession.getRollerSession(request).getCurrentWebsite(), // userName
                                     startDate,         // startDate
                                     endDate,           // endDate
               etRoller().getRefererManager();
                     isRefSpammer = refMgr.processRequest(rreq);
                 }
                 else

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RequestFilter.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RequestFilter.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RequestFilter.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/filters/RequestFilter.java Sun Jul 17 18:12:36 2005
@@ -1,15 +1,5 @@
 package org.roller.presentation.filters;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts.Globals;
-import org.roller.RollerException;
-import org.roller.model.Roller;
-import org.roller.model.UserManager;
-import org.rollerr's entries in page cache
                     PageCacheFilter.removeFromCache(request, website);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ContextLoader.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ContextLoader.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ContextLoader.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ContextLoader.java Sun Jul 17 18:12:36 2005
@@ -30,7 +30,6 @@
 import org.roller.pojos.CommentData;
 import org.roller.pojos.PageData;
 import org.roller.pojos.RollerPropertyData;
-import org.roller.pojos.UserData;
 import org.roller.pojos.WeblogEntryData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.LanguageUtil;
@@ -157,7 +156,7 @@
     {
         // if therencubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java Sun Jul 17 18:12:36 2005
@@ -9,8 +9,8 @@
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.lang.StringUtils;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.struts.action.ActionError;
@@ -22,6 +22,7 @@
 import org.roller.RollerException;
 import org.roller.RollerPermissionsException;
 import org.roller.config.RollerRuntimeConfig;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.UserData;
@@ -29,8 +30,8 @@
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.RollerSession;
-import org.roller.presentation.pagecache.PageCacheFilter;
 import or                      null,              // catName
@@ -169,7 +173,7 @@
                     Map entryMap = seperateByPeriod(entries, form.getFileBy());
 
                     // now export each List in the entryMap
-                    ExportRss exporter = new ExportRss(rreq.getCurrentWebsite());
+                    ExportRss exporter = new ExportRss(RollerSession.getRollerSession(request).getCurrentWebsite());
                     String exportTo = form.getExportFormat().toLowerCase();
                     if ("atom".equals(exportTo))
                     {
@@ -271,7 +275,7 @@
             JspFactory.getDefaultFactory().getPageContext( 
                 this.getServlet(), request, response, "", true, 8192, true);
         Map params = new HashMap();
-        params.put( RollerRequest.WEBSITEHANDLE_KEY,  rreq.getCurrentWebsite().getHandle());
+        params.put( RollerRequest.WEBSITEHANDLE_KEY,  RollerSession.getRollerSession(request).getCurrentWebsite().getHandle());
         params.put("rmik", "Files");
 is an "_entry" page, only load it once
         WebsiteData website = 
-            rreq.getRoller().getUserManager().getWebsiteByHandle(handle);
+            RollerFactory.getRoller().getUserManager().getWebsiteByHandle(handle);
         PageModel pageModel = (PageModel)ctx.get("pageModel");
         if (website != null && pageModel != null) 
         {
@@ -210,7 +209,9 @@
     {
         try
         {
-            return mRollerReq.isUserAuthorizedToEdit();
+            RollerSession rollerSession = RollerSession.getRollerSession(
+                    mRollerReq.getRequest());
+            return rollerSession.isUserAuthorizedToEdit();
         }
         catch (Exception e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/DefaultCommentAuthenticator.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/DefaultCommentAuthenticator.java?rev=219437&r1=219436&r2=219437&view=diff
========================.presentation.util.RequestUtil;
-import org.roller.presentation.RollerContext;
-import org.roller.presentation.RollerRequest;
-
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.Date;
@@ -26,6 +16,17 @@
 import javax.servlet.http.HttpSession;
 import javax.servlet.jsp.jstl.core.Config;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts.Globals;
+import org.roller.RollerException;
+import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
+import org.roller.model.UserManager;
+import org.roller.presentation.RollerContext;
+import org.roller.presentation.RollerRequest;
+import org.roller.presentation.util.RequestUtil;
+
 
 /**
  * Entry point filter for Weblog page and Editor UI, this filter 
@@ -103,10 +104,10 @@
                 {
                     session.removeAttribute(RollerRequest.LOGIN_COOKIE);
 
-                    UserManager mgr = rreq.getRoller().getUserManager();
+           g.roller.presentation.forms.WebsiteForm;
+import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.presentation.website.formbeans.WebsiteFormEx;
 
 
@@ -70,24 +71,25 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
-                UserData ud = rreq.getAuthenticatedUser();
+                UserData ud = RollerSession.getRollerSession(request).getAuthenticatedUser();
                 request.setAttribute("user",ud);
 
-                WebsiteData hd = rreq.getCurrentWebsite();
+                WebsiteData hd = RollerSession.getRollerSession(request).getCurrentWebsite();
                 WebsiteForm wf = (WebsiteFormEx)actionForm;
                 wf.copyFrom(hd, request.getLocale());
 
-                List cd = rreq.getRoller().getW         String filesLink = RequestUtils.computeURL(
              pageContext, (String)null, (String)null, (String)null,

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ImportEntriesAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ImportEntriesAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ImportEntriesAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ImportEntriesAction.java Sun Jul 17 18:12:36 2005
@@ -24,6 +24,7 @@
 import org.roller.presentation.MainPageAction;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.pagecache.PageCacheFilter;
 impor======================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/DefaultCommentAuthenticator.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/DefaultCommentAuthenticator.java Sun Jul 17 18:12:36 2005
@@ -2,6 +2,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.apache.velocity.context.Context;
 import org.roller.pojos.CommentData;
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ExportRss.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ExportRss.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/ExportRss.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/present         UserManager mgr = RollerFactory.getRoller().getUserManager();
 
                     String loginCookie = mgr.createLoginCookie(username);
-                    rreq.getRoller().commit();
+                    RollerFactory.getRoller().commit();
                     RequestUtil.setCookie(response, RollerRequest.LOGIN_COOKIE,
                                           loginCookie, request.getContextPath());
                 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetAction.java Sun Jul 17 18:12:36 2005
@@ -15,6 +15,7 @@
eblogManager()
-                   .getWeblogCategories(rreq.getCurrentWebsite(), true);
+                List cd = RollerFactory.getRoller().getWeblogManager()
+                   .getWeblogCategories(RollerSession.getRollerSession(request).getCurrentWebsite(), true);
                 request.setAttribute("categories",cd);
 
-                List bcd = rreq.getRoller().getWeblogManager()
-                    .getWeblogCategories(rreq.getCurrentWebsite(), true);
+                List bcd = RollerFactory.getRoller().getWeblogManager()
+                    .getWeblogCategories(RollerSession.getRollerSession(request).getCurrentWebsite(), true);
                 request.setAttribute("bloggerCategories",bcd);
 
-                List pages = rreq.getRoller().getUserManager().getPages(rreq.getCurrentWebsite());
+                List pages = RollerFactory.getRoller().getUserManager().getPages(RollerSession.getRollerSession(request).getCurrentWebsite());
                 request.setAttribute("pages",pages);
 
        t org.roller.presentation.weblog.formbeans.ImportEntriesForm;
 import org.roller.util.StringUtils;
@@ -50,7 +51,8 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( !rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(rreq.getRequest());
+            if ( !rollerSession.isUserAuthorizedToEdit() )
             {
                 forward = mapping.findForward("access-denied");
             }
@@ -61,7 +63,7 @@
                 if (StringUtils.isNotEmpty(form.getImportFileName()))
                 {
                     // "default" values
-                    WebsiteData website = rreq.getCurrentWebsite();
+                    WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
 
                     // load selected file
                     ServletContext app = this.getServlet().getServletConfig().getServletContext();
@@ -70,7 +72,7 @@
                       ation/velocity/ExportRss.java Sun Jul 17 18:12:36 2005
@@ -1 +1 @@
-package org.roller.presentation.velocity;

import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.roller.RollerException;
import org.roller.model.RollerFactory;
import org.roller.pojos.UserData;
import org.roller.pojos.WebsiteData;
import org.roller.presentation.RollerContext;
import org.roller.util.RegexUtil;
import org.roller.util.StringUtils;
import org.roller.util.Utilities;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.Locale;
import java.util.Properties;
import java.util.TimeZone;

/**
 * Does a lot of the same work as ContextLoad import org.roller.RollerException;
 import org.roller.config.RollerRuntimeConfig;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.PlanetGroupData;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
@@ -78,8 +79,7 @@
          */
         public List getAggregation(int num) throws RollerException
         {
-            Roller roller = 
-                RollerRequest.getRollerRequest(mRequest).getRoller();            
+            Roller roller = RollerFactory.getRoller();           
             return roller.getPlanetManager().getAggregation(num);
         }
         /** 
@@ -90,8 +90,7 @@
             PlanetGroupData group = null;
             try 
             {
-                Roller roller = 
-                    RollerRequest.getRollerRequest(mRequest).getRoller();  
+                Roller roller = RollerFactory.getRoller();  
                 group = roller.getPlanetManager().getGroup(name);
             }
          ServletContext ctx = request.getSession().getServletContext();
@@ -122,9 +124,10 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            WeblogManager wmgr = rreq.getRoller().getWeblogManager();
-            UserManager umgr = rreq.getRoller().getUserManager();
-            if ( rreq.isUserAuthorizedToEdit() )
+            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
+            UserManager umgr = RollerFactory.getRoller().getUserManager();
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 WebsiteFormEx form = (WebsiteFormEx)actionForm;
                 
@@ -166,8 +169,8 @@
                     }
                     
                     wd.save();
-                    rreq.getRoller().getRefererManager().applyRefererFilters(wd);                    
-                    rreq.getRoller().commit();                "/" + form.getImportFileName());
 
                     //ArchiveParser archiveParser =
-                        //new ArchiveParser(rreq.getRoller(), rreq.getWebsite(), f);
+                        //new ArchiveParser(RollerFactory.getRoller(), rreq.getWebsite(), f);
                     String parseMessages = null; // archiveParser.parse();
 
                     // buf will be non-zero if Entries were imported
@@ -126,7 +128,9 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( !rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(
+                    rreq.getRequest());
+            if ( !rollerSession.isUserAuthorizedToEdit() )
             {
                 forward = mapping.findForward("access-denied");
             }
@@ -147,7 +151,7 @@
     {
 		ServletContext app = this.getServlet().getServletConfig().getServletContext();
 		String dir = RollerContext.getUploadDier in preparing
 * a VelocityContext for parsing.  However, it is ignorant of
 * any HttpServletRequest related features, and so has 
 * considerably trimmed down information.
 * 
 * Created on Mar 25, 2004
 * @author lance.lavandowska
 */
public class ExportRss
{
    private VelocityEngine ve = null;
    private VelocityContext ctx = null;
    private UserData user = null;
    private boolean exportAtom;
    
    private static final String RSS_TEMPLATE = "org/roller/presentation/velocity/export_rss.vm";
    private static final String ATOM_TEMPLATE = "org/roller/presentation/velocity/export_atom.vm";
    
    public ExportRss(WebsiteData website) throws Exception
    {
        Properties props = new Properties();
        props.load(RollerContext.getServletContext().
                   getResourceAsStream("/WEB-INF/velocity.properties"));
        ve = new VelocityEngine();
        ve.info("*******************************************");
        ve.info("Initializing VelocityEngine for ExportRss");
        ve.            catch (RollerException e) 
@@ -108,8 +107,7 @@
             List ret = new ArrayList();
             try 
             {
-                Roller roller = 
-                    RollerRequest.getRollerRequest(mRequest).getRoller();  
+                Roller roller = RollerFactory.getRoller();   
                 PlanetGroupData group= roller.getPlanetManager().getGroup(name);
                 ret = roller.getPlanetManager().getAggregation(group, num);
             }
@@ -127,8 +125,7 @@
             List ret = new ArrayList();
             try 
             {
-                Roller roller = 
-                    RollerRequest.getRollerRequest(mRequest).getRoller();  
+                Roller roller = RollerFactory.getRoller();  
                 ret = roller.getPlanetManager().getTopSubscriptions(num);
             }
             catch (RollerException e) 
@@ -146,8 +143,7 @@
             List ret = new ArrayList();
             try 
             {
-                Roller roller = 
-                 
+                    RollerFactory.getRoller().getRefererManager().applyRefererFilters(wd);                    
+                    RollerFactory.getRoller().commit();
 
                     request.getSession().setAttribute(
                         RollerSession.STATUS_MESSAGE,

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileManagerTag.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileManagerTag.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileManagerTag.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileManagerTag.java Sun Jul 17 18:12:36 2005
@@ -18,6 +18,7 @@
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.Rollr( app );
-		File d = new File(dir + rreq.getCurrentWebsite().getHandle());
+		File d = new File(dir + RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite().getHandle());
 		ArrayList xmlFiles = new ArrayList();
 		if (d.mkdirs() || d.exists())
 		{

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/PingSetupAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/PingSetupAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/PingSetupAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/PingSetupAction.java Sun Jul 17 18:12:36 2005
@@ -8,38 +8,40 @@
 
 package org.roller.presentation.weblog.actions;
 
-import org.apache.struts.actions.DispatchAction;
+import java.io.IOExcepinit( props );
        ve.info("Done initializing VelocityEngine for ExportRss");
        ve.info("************************************************");
        
        ctx = new VelocityContext();
        
        RollerContext rollerCtx = RollerContext.getRollerContext(
                                      RollerContext.getServletContext());
        loadPageHelper();
        
        loadDates(website);
        
        loadWebsiteInfo(rollerCtx, website);

        loadTheRest(rollerCtx);
    }
    
    public void setExportAtom(boolean atom)
    {
        exportAtom = atom;
    }
    
    /**
     * Export the given entries using export_rss.vm.
     * 
     * @param entries
     * @throws ResourceNotFoundException
     * @throws ParseErrorException
     * @throws Exception
     */
    public void exportEntries(Collection entries, String fileName) throws ResourceNotFoundException, ParseErrorException, Exception 
    {
        ctx.put("entries", entries);
        
        String templateFile = RSS_TEMPLATE;
   RollerRequest.getRollerRequest(mRequest).getRoller();  
+                Roller roller = RollerFactory.getRoller(); 
                 PlanetGroupData group= roller.getPlanetManager().getGroup(name);
                 ret = roller.getPlanetManager().getTopSubscriptions(group,num);
             }
@@ -162,8 +158,7 @@
          */
         public List getPopularWebsites(int num) throws RollerException
         {
-            Roller roller = 
-                RollerRequest.getRollerRequest(mRequest).getRoller();            
+            Roller roller = RollerFactory.getRoller();            
             return roller.getRefererManager().getDaysPopularWebsites(num);
         }
     }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetConfigAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetConfigAction.java?rev=219437&r1=219436&r2=219437&view=diff
========================================================erRequest;
+import org.roller.presentation.RollerSession;
 
 /**
  * @jsp.tag name="FileManager"
@@ -50,8 +51,8 @@
             HttpServletRequest request =
                 (HttpServletRequest)pageContext.getRequest();
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            //UserData user = rreq.getAuthenticatedUser();
-            WebsiteData website = rreq.getCurrentWebsite();
+            //UserData user = RollerSession.getRollerSession(request).getAuthenticatedUser();
+            WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
 
             // for formatting the file size
             DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
@@ -87,7 +88,7 @@
                     // to PRIMARY
                     java.text.Collator locCollator =
                         java.text.Collator.getInstance(
-                            rreq.getCurrentWebsite().getLocaleInstance());
+                            RollerSession.getRoltion;
+import java.net.SocketException;
+import java.net.UnknownHostException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+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;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionMessages;
 import org.apache.struts.action.ActionMessage;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.struts.action.ActionMessages;
+import org.apache.struts.actions.DispatchAction;
 import org.apache.xmlrpc.XmlRpcException;
-import org.roller.presentation.RollerRequest;
-import org.roller.presenta        if (exportAtom) templateFile = ATOM_TEMPLATE;
        Template template = ve.getTemplate( templateFile, "utf-8" );
        StringWriter sw = new StringWriter();
        template.merge(ctx, sw);
        
        writeResultsToFile((String)ctx.get("uploadPath"), sw, fileName);
    }

    /**
     * @param sw
     */
    private void writeResultsToFile(String filePath, StringWriter sw, String fileName) 
        throws RollerException, IOException
    {
        filePath += "/" + user.getUserName();
        new java.io.File( filePath ).mkdirs(); // create dir path on drive
        
        filePath += "/" + fileName;
        
        File outputFile = new java.io.File( filePath );
        FileOutputStream out = null;
        try
        {
            //outputFile.createNewFile();
            out = new FileOutputStream( outputFile );
            out.write( sw.toString().getBytes() );
            out.flush();
        }
        catch ( FileNotFoundException e )
        {
            throw new RollerException(======================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetConfigAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetConfigAction.java Sun Jul 17 18:12:36 2005
@@ -32,15 +32,15 @@
 import org.apache.struts.action.ActionMessage;
 import org.apache.struts.action.ActionMessages;
 import org.apache.struts.actions.DispatchAction;
-import org.roller.presentation.forms.PlanetConfigForm;
 import org.roller.config.RollerRuntimeConfig;
 import org.roller.model.PlanetManager;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.PlanetConfigData;
 import org.roller.pojos.PlanetGroupData;
 import org.roller.presentation.RollerRequest;
-import org.roller.presentation.planet.RefreshEntriesTask;
-import org.roller.presentation.planet.SyncWebsitesTask;
+import org.roller.presentation.RollerSession;
+import org.roller.presentation.forms.PlanetConfigForm;
 
 ////////////////////////////lerSession(request).getCurrentWebsite().getLocaleInstance());
                     locCollator.setStrength(Collator.PRIMARY);
                     java.util.Arrays.sort(files, locCollator);
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileUploadTag.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileUploadTag.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileUploadTag.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileUploadTag.java Sun Jul 17 18:12:36 2005
@@ -23,6 +23,7 @@
 import org.roller.model.RollerFactory;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 
 /**
  * @jsp.tag name="FileUpload"
@@ -58tion.RollerContext;
-import org.roller.presentation.pings.WeblogUpdatePinger;
+import org.roller.RollerException;
 import org.roller.config.PingConfig;
-import org.roller.model.PingTargetManager;
 import org.roller.model.AutoPingManager;
+import org.roller.model.PingTargetManager;
+import org.roller.model.RollerFactory;
+import org.roller.pojos.AutoPingData;
 import org.roller.pojos.PingTargetData;
 import org.roller.pojos.WebsiteData;
-import org.roller.pojos.AutoPingData;
-import org.roller.RollerException;
-import org.roller.config.PingConfig;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.ServletException;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Collections;
-import java.net.UnknownHostException;
-import java.net.SocketException;
-import java.io.IOException;
+import org.roller.presentation.RollerContext;
+import org.roller.presentation.RollerRequest;
+impo "Unable to write to: " + outputFile.getAbsolutePath(), e );
        }
        finally
        {
            try
            {
                if ( out != null )
                {
                    out.close();
                }
            }
            catch ( java.io.IOException ioe )
            {
                System.err.println( "ExportRss unable to close OutputStream" );
            }
        }
    }

    /**
     * Load miscellaneous values into the Context.
     * @param rollerCtx
     */
    private void loadTheRest(RollerContext rollerCtx)
    {
        ctx.put("utilities",       new Utilities() );
        ctx.put("stringUtils",     new StringUtils() );        
        ctx.put("entryLength",     new Integer(-1));
    }

    /**
     * Load information pertaining to the Website and
     * its associated User.
     * @param rollerCtx
     */
    private void loadWebsiteInfo(RollerContext rollerCtx, WebsiteData website)
    {
        ctx.put("website",       website);
        ctx.put("userName",  /////////////////////////////////////////////////
 /**
@@ -66,9 +66,9 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
                 PlanetManager planet = roller.getPlanetManager();
                 PlanetConfigData config = planet.getConfiguration();
                 PlanetConfigForm form = (PlanetConfigForm)actionForm;
@@ -106,9 +106,9 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
           ,7 +59,7 @@
             HttpServletRequest request =
                 (HttpServletRequest)pageContext.getRequest();
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            WebsiteData website = rreq.getCurrentWebsite();
+            WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
             
             String maxDir = RollerRuntimeConfig.getProperty("uploads.dir.maxsize");
             String maxFile = RollerRuntimeConfig.getProperty("uploads.file.maxsize");

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BaseAPIHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BaseAPIHandler.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BaseAPIHandler.java (original)
+++ incubator/roller/branches/rort org.roller.presentation.RollerSession;
+import org.roller.presentation.pings.WeblogUpdatePinger;
 
 
 /**
@@ -82,8 +84,8 @@
     {
         ActionForward forward = mapping.findForward(PING_SETUP_PAGE);
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
-        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
-        WebsiteData website = rreq.getCurrentWebsite();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
+        WebsiteData website = RollerSession.getRollerSession(req).getCurrentWebsite();
         try
         {
             if (!isAuthorized(rreq))
@@ -121,8 +123,8 @@
     private Map buildIsEnabledMap(RollerRequest rreq, List commonPingTargets, List customPingTargets)
         throws RollerException
     {
-        AutoPingManager autoPingMgr = rreq.getRoller().getAutopingManager();
-        WebsiteData website = rreq.getCurrentWebsite();
+        AutoPingManager autoPingMgr = RollerFactory.getRoller().getAut    user.getUserName() );
        ctx.put("fullName",      user.getFullName() );
        ctx.put("emailAddress",  user.getEmailAddress() );

        ctx.put("encodedEmail",  RegexUtil.encode(user.getEmailAddress()));
        ctx.put("obfuscatedEmail",  RegexUtil.obfuscateEmail(user.getEmailAddress()));

        
        // custom figureResourcePath() due to no "request" object
        StringBuffer sb = new StringBuffer();
        String uploadDir = null;
        try {
            uploadDir = RollerFactory.getRoller().getFileManager().getUploadDir();
        } catch(Exception e) {}

        ctx.put("uploadPath", uploadDir);
    }

    /**
     * Load time-related information.
     * @param website
     */
    private void loadDates(WebsiteData website)
    {
        try
        {
            // Add current time and last updated times to context
            Date updateTime = RollerFactory.getRoller().getWeblogManager()
                .getWeblogLastPublishTime(website, null);                        
                 PlanetManager planet = roller.getPlanetManager();
                 PlanetConfigData config = planet.getConfiguration();
                 if (config == null)
@@ -160,9 +160,9 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
                 RefreshEntriesTask task = new RefreshEntriesTask();
                 task.init(roller, "dummy");
                 roller.getThreadManager().executeInBackground(task);
@@ -194,9 +194,9 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = (Roller_2.0/src/org/roller/presentation/xmlrpc/BaseAPIHandler.java Sun Jul 17 18:12:36 2005
@@ -3,9 +3,13 @@
  */
 package org.roller.presentation.xmlrpc;
 
+import java.io.Serializable;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.xmlrpc.XmlRpcException;
+import org.roller.config.RollerConfig;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.pojos.UserData;
 import org.roller.pojos.WebsiteData;
@@ -15,9 +19,6 @@
 import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.util.Utilities;
 
-import java.io.Serializable;
-import org.roller.config.RollerConfig;
-
 /**
  * Base API handler does user validation, provides exception types, etc.
  * @author David M Johnson
@@ -88,7 +89,7 @@
             // Get Roller request object for current thread
             RollerRequest rreq = RollerRequest.getRollerRequest();
             
-            UserManager userMgr = rreq.getRoller().getUserManaopingManager();
+        WebsiteData website = RollerSession.getRollerSession(rreq.getRequest()).getCurrentWebsite();
 
         // Build isEnabled map (keyed by ping target id and values Boolean.TRUE/Boolean.FALSE)
         Map isEnabled = new HashMap();
@@ -163,7 +165,7 @@
         throws Exception
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
-        AutoPingManager autoPingMgr = rreq.getRoller().getAutopingManager();
+        AutoPingManager autoPingMgr = RollerFactory.getRoller().getAutopingManager();
         try
         {
             if (!isAuthorized(rreq))
@@ -171,9 +173,10 @@
                 return mapping.findForward("access-denied");
             }
             PingTargetData pingTarget = select(rreq);
-            AutoPingData autoPing = autoPingMgr.createAutoPing(pingTarget, rreq.getCurrentWebsite());
+            AutoPingData autoPing = autoPingMgr.createAutoPing(pingTarget, 
+                    RollerSession.getRollerSession(req).getCurrentWebsite());
          ctx.put("updateTime",   updateTime);
        }
        catch (RollerException e)
        {                       
            ctx.put("updateTime",   new Date());
        }
        ctx.put("now",              new Date());
        
        // setup Locale for future rendering
        Locale locale = website.getLocaleInstance();
        ctx.put("locale", locale);
        
        // setup Timezone for future rendering
        ctx.put("timezone", website.getTimeZoneInstance());

        // date formats need to be run through the Localized
        // SimpleDateFormat and pulled back out as localized patterns.
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd", locale);  
        sdf.setTimeZone( (TimeZone)ctx.get("timezone") );    
        ctx.put("plainFormat",     sdf.toLocalizedPattern());
        
        sdf.applyPattern("EEEE MMMM dd, yyyy");
        ctx.put("toStringFormat",  sdf.toLocalizedPattern());
        
        sdf.applyPattern("MMM dd yyyy, hh:mm:ss a z");
        ctx.put("timestampFoller)rreq.getRoller();
+                Roller roller = (Roller)RollerFactory.getRoller();
                 SyncWebsitesTask task = new SyncWebsitesTask();
                 task.init(roller, "dummy");
                 roller.getThreadManager().executeInBackground(task);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetGroupsAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetGroupsAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetGroupsAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetGroupsAction.java Sun Jul 17 18:12:36 2005
@@ -37,9 +37,11 @@
 import org.roller.RollerException;
 import org.roller.model.PlanetManager;
 import org.roller.model.Roller;
+import org.roller.model.Rollerger();
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();
             website = userMgr.getWebsiteByHandle(blogid);
             user = userMgr.getUser(username);
             
@@ -112,7 +113,7 @@
     			   authenticated= user.getPassword().equals(password);
                 if (authenticated)
                 {
-                    rreq.getRoller().setUser(user);
+                    RollerFactory.getRoller().setUser(user);
                 }
             }
         }
@@ -152,7 +153,7 @@
             // Get Roller request object for current thread
             RollerRequest rreq = RollerRequest.getRollerRequest();
             
-            UserManager userMgr = rreq.getRoller().getUserManager();
+            UserManager userMgr = RollerFactory.getRoller().getUserManager();
             user = userMgr.getUser(username);
             
             enabled = user.getIsEnabled().booleanValue();
@@ -173,7 +174,7 @@
                 authenticated = user.getPassword().equals(password)    autoPingMgr.storeAutoPing(autoPing);
-            rreq.getRoller().commit();
+            RollerFactory.getRoller().commit();
 
             return view(mapping, form, req, res);
         }
@@ -192,7 +195,7 @@
         throws Exception
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
-        AutoPingManager autoPingMgr = rreq.getRoller().getAutopingManager();
+        AutoPingManager autoPingMgr = RollerFactory.getRoller().getAutopingManager();
         try
         {
             if (!isAuthorized(rreq))
@@ -200,8 +203,9 @@
                 return mapping.findForward("access-denied");
             }
             PingTargetData pingTarget = select(rreq);
-            autoPingMgr.removeAutoPing(pingTarget, rreq.getCurrentWebsite());
-            rreq.getRoller().commit();
+            autoPingMgr.removeAutoPing(pingTarget, 
+                    RollerSession.getRollerSession(req).getCurrentWebsite());
+            RollerFactory.getRoller().commit();
 
             return view(mapprmat", sdf.toLocalizedPattern());
        
        ctx.put("dateFormatter", sdf );
    }
    /**
     * Create a PageHelper.  Note that will have no values
     * necessary in parsing a Web request (such as /page) -
     * it is only useful for the restricted export_rss.vm
     * and has no PagePlugins either.  We want the exported
     * Entry.text to be the raw values.
     */
    private void loadPageHelper()
    {
        // Add Velocity page helper to context
        PageHelper pageHelper = new PageHelper(null, null, ctx);
        // set no PagePlugins - we *do not* want to render them.
        ctx.put("pageHelper", pageHelper );
    }
}
\ No newline at end of file
+package org.roller.presentation.velocity;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.Locale;
import java.util.Properties;
import javFactory;
 import org.roller.pojos.PlanetGroupData;
 import org.roller.presentation.BasePageModel;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.forms.PlanetGroupForm;
 
 
@@ -67,9 +69,9 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
                 PlanetManager planet = roller.getPlanetManager();
                 PlanetGroupForm form = (PlanetGroupForm)actionForm;
                 if (request.getParameter("groupHandle") != null)
@@ -106,13 +108,9 @@
         ActionForward forward = mapping.findForward("planetGroups.page");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
- ;
                 if (authenticated)
                 {
-                    rreq.getRoller().setUser(user);
+                    RollerFactory.getRoller().setUser(user);
                 }
             }
         }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/BloggerAPIHandler.java Sun Jul 17 18:12:36 2005
@@ -19,6 +19,7 @@
 import org.apache.xmlrpc.XmlRpcException;
 import org.roller.RollerException;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import oing, form, req, res);
         }
@@ -224,7 +228,7 @@
             RollerRequest rreq = RollerRequest.getRollerRequest(req);
             String absoluteUrl = RollerContext.getRollerContext(req).getAbsoluteContextUrl(req);
             PingTargetData pingTarget = select(rreq);
-            WebsiteData website = rreq.getCurrentWebsite();
+            WebsiteData website = RollerSession.getRollerSession(req).getCurrentWebsite();
             try
             {
                 if (!isAuthorized(rreq))
@@ -287,7 +291,7 @@
     private PingTargetData select(RollerRequest rreq) throws RollerException
     {
         String pingTargetId = rreq.getRequest().getParameter(RollerRequest.PINGTARGETID_KEY);
-        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
         if (pingTargetId == null || pingTargetId.length() == 0)
         {
             throw new RollerException("Missing ping target id: " +a.util.TimeZone;

import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.exception.ParseErrorException;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.roller.RollerException;
import org.roller.model.RollerFactory;
import org.roller.pojos.UserData;
import org.roller.pojos.WebsiteData;
import org.roller.presentation.RollerContext;
import org.roller.util.RegexUtil;
import org.roller.util.StringUtils;
import org.roller.util.Utilities;

/**
 * Does a lot of the same work as ContextLoader in preparing
 * a VelocityContext for parsing.  However, it is ignorant of
 * any HttpServletRequest related features, and so has 
 * considerably trimmed down information.
 * 
 * Created on Mar 25, 2004
 * @author lance.lavandowska
 */
public class ExportRss
{
    private VelocityEngine ve = null;
    private VelocityContext ctx = null;
    private UserData user = null;
    private boolean exportAtom;
             if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = rreq.getRoller();
-                PlanetManager planet = roller.getPlanetManager();
-                PlanetGroupForm form = (PlanetGroupForm)actionForm;
-                
+                PlanetGroupForm form = (PlanetGroupForm)actionForm;              
                 form.doReset(mapping, request);
                 
                 request.setAttribute("model", 
@@ -140,9 +138,9 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
                 PlanetManager planet = roller.getPlanetManager();
                 PlanetGroupForm frg.roller.model.WeblogManager;
 import org.roller.pojos.PageData;
@@ -71,7 +72,7 @@
         mLogger.info("     PostId: " + postid);
         mLogger.info("     UserId: " + userid);
 
-        Roller roller = RollerRequest.getRollerRequest().getRoller();
+        Roller roller = RollerFactory.getRoller(); 
         WeblogManager weblogMgr = roller.getWeblogManager();
         WeblogEntryData entry = weblogMgr.retrieveWeblogEntry(postid);
 
@@ -129,7 +130,7 @@
 
         try
         {
-            Roller roller = RollerRequest.getRollerRequest().getRoller();
+            Roller roller = RollerFactory.getRoller(); 
             UserManager userMgr = roller.getUserManager();
 
             PageData page = userMgr.retrievePage(templateType);
@@ -174,7 +175,7 @@
 
         try
         {
-            Roller roller = RollerRequest.getRollerRequest().getRoller();
+            Roller roller = RollerFactory.getRoller(); 
             UserManager userMgr = roller.getUserManager();
             PageData page = userMgr.  
    private static final String RSS_TEMPLATE = "org/roller/presentation/velocity/export_rss.vm";
    private static final String ATOM_TEMPLATE = "org/roller/presentation/velocity/export_atom.vm";
    
    public ExportRss(WebsiteData website) throws Exception
    {
        Properties props = new Properties();
        props.load(RollerContext.getServletContext().
                   getResourceAsStream("/WEB-INF/velocity.properties"));
        ve = new VelocityEngine();
        ve.info("*******************************************");
        ve.info("Initializing VelocityEngine for ExportRss");
        ve.init( props );
        ve.info("Done initializing VelocityEngine for ExportRss");
        ve.info("************************************************");
        
        ctx = new VelocityContext();
        
        RollerContext rollerCtx = RollerContext.getRollerContext(
                                      RollerContext.getServletContext());
        loadPageHelper();
        
        loadDates(website);
   pingTargetId);
@@ -315,6 +319,7 @@
 
     private boolean isAuthorized(RollerRequest rreq) throws RollerException
     {
-        return rreq.isUserAuthorizedToEdit() && !PingConfig.getDisablePingUsage();
+        RollerSession rollerSession = RollerSession.getRollerSession(rreq.getRequest());
+        return rollerSession.isUserAuthorizedToEdit() && !PingConfig.getDisablePingUsage();
     }
 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ReferersAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ReferersAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ReferersAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ReferersAction.java Sun Jul 17 18:12:36 2005
@@ -1,6 +1,12 @orm = (PlanetGroupForm)actionForm;
                 if (form.getHandle() != null)
@@ -187,10 +185,10 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
                 PlanetGroupForm form = (PlanetGroupForm)actionForm;
-                Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
                 PlanetManager planet = roller.getPlanetManager();
                 ActionErrors errors = validate(planet, form);
                 if (errors.isEmpty())
@@ -270,7 +268,7 @@
         {
             super(request, response, mapping);
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            Roller roller = rreq.getRoller();
+            Roller roller = RollerFactory.getRoller();
             PlanetManager planet = roller.getPlanetManager();       retrievePage(templateType);
 
@@ -217,7 +218,7 @@
 
         try
         {
-            Roller roller = RollerRequest.getRollerRequest().getRoller();
+            Roller roller = RollerFactory.getRoller(); 
             UserManager userMgr = roller.getUserManager();
             UserData user = userMgr.getUser(userid);
 
@@ -291,7 +292,7 @@
                 String contextUrl =
                     RollerContext.getRollerContext(req).getAbsoluteContextUrl(req);
                 
-                UserManager umgr = rreq.getRoller().getUserManager();
+                UserManager umgr = RollerFactory.getRoller().getUserManager();
                 UserData user = umgr.getUser(userid);
                 List websites = umgr.getWebsites(user, Boolean.TRUE);
                 Iterator iter = websites.iterator();
@@ -346,7 +347,7 @@
             {
                 Timestamp current = new Timestamp(System.currentTimeMillis());
     
-                Roller roller = RollerRequest.getRollerRequest().getRoller();
+              
        loadWebsiteInfo(rollerCtx, website);

        loadTheRest(rollerCtx);
    }
    
    public void setExportAtom(boolean atom)
    {
        exportAtom = atom;
    }
    
    /**
     * Export the given entries using export_rss.vm.
     * 
     * @param entries
     * @throws ResourceNotFoundException
     * @throws ParseErrorException
     * @throws Exception
     */
    public void exportEntries(Collection entries, String fileName) throws ResourceNotFoundException, ParseErrorException, Exception 
    {
        ctx.put("entries", entries);
        
        String templateFile = RSS_TEMPLATE;
        if (exportAtom) templateFile = ATOM_TEMPLATE;
        Template template = ve.getTemplate( templateFile, "utf-8" );
        StringWriter sw = new StringWriter();
        template.merge(ctx, sw);
        
        writeResultsToFile((String)ctx.get("uploadPath"), sw, fileName);
    }

    /**
     * @param sw
     */
    private void writeResultsToFile(String filePath, StringWriter sw, String fileName) @
 
 package org.roller.presentation.weblog.actions;
 
+import java.util.List;
+
+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.ActionError;
@@ -12,15 +18,10 @@
 import org.apache.struts.action.ActionMessages;
 import org.apache.struts.actions.DispatchAction;
 import org.roller.model.RefererManager;
-import org.roller.pojos.UserData;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
-
-import java.util.List;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import org.roller.presentation.RollerSession;
 
 /**
  * Display today's referers.
@@ -54,18 +55,19 @@
     {
         ActionForward forward = mapping.findForward("referers.page");
             
             PlanetGroupData externalGroup = planet.getGroup("external");
             if (externalGroup != null) 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionFormEx.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionFormEx.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionFormEx.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionFormEx.java Sun Jul 17 18:12:36 2005
@@ -1,7 +1,5 @@
 package org.roller.presentation.planet;
 
-import java.util.Locale;
-import org.roller.pojos.PlanetSubscriptionData;
 import org.roller.presentation.forms.PlanetSubscriptionForm;
 
 /**

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet        Roller roller = RollerFactory.getRoller(); 
                 WeblogManager weblogMgr = roller.getWeblogManager();
                 WeblogEntryData entry = weblogMgr.retrieveWeblogEntry(postid);
                 entry.setText(content);
@@ -409,7 +410,7 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest();
-            Roller roller = rreq.getRoller();
+            Roller roller = RollerFactory.getRoller();
 
             Timestamp current = new Timestamp(System.currentTimeMillis());
 
@@ -474,7 +475,7 @@
         {
             Vector results = new Vector();
 
-            Roller roller = RollerRequest.getRollerRequest().getRoller();
+            Roller roller = RollerFactory.getRoller(); 
             WeblogManager weblogMgr = roller.getWeblogManager();
             if (website != null)
             {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java
URL: http://svn.apache.org/viewcvs/incubator/roller/b
        throws RollerException, IOException
    {
        filePath += "/" + user.getUserName();
        new java.io.File( filePath ).mkdirs(); // create dir path on drive
        
        filePath += "/" + fileName;
        
        File outputFile = new java.io.File( filePath );
        FileOutputStream out = null;
        try
        {
            //outputFile.createNewFile();
            out = new FileOutputStream( outputFile );
            out.write( sw.toString().getBytes() );
            out.flush();
        }
        catch ( FileNotFoundException e )
        {
            throw new RollerException( "Unable to write to: " + outputFile.getAbsolutePath(), e );
        }
        finally
        {
            try
            {
                if ( out != null )
                {
                    out.close();
                }
            }
            catch ( java.io.IOException ioe )
            {
                System.err.println( "ExportRss unable to close OutputStream" );
            }
        }
   RollerRequest rreq = RollerRequest.getRollerRequest(req);
-        RefererManager refmgr = rreq.getRoller().getRefererManager();
+        RollerSession rollerSession = RollerSession.getRollerSession(req);
+        RefererManager refmgr = RollerFactory.getRoller().getRefererManager();
         try
         {
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {   
                 req.setAttribute("pageHits",
-                    new Integer(refmgr.getDayHits(rreq.getCurrentWebsite())));
+                    new Integer(refmgr.getDayHits(RollerSession.getRollerSession(req).getCurrentWebsite())));
                     
                 req.setAttribute("totalHits",
-                    new Integer(refmgr.getTotalHits(rreq.getCurrentWebsite())));
+                    new Integer(refmgr.getTotalHits(RollerSession.getRollerSession(req).getCurrentWebsite())));
                     
-                List refs = refmgr.getTodaysReferers(rreq.getCu/PlanetSubscriptionsAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionsAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionsAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/PlanetSubscriptionsAction.java Sun Jul 17 18:12:36 2005
@@ -37,11 +37,12 @@
 import org.roller.RollerException;
 import org.roller.model.PlanetManager;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.PlanetConfigData;
 import org.roller.pojos.PlanetGroupData;
 import org.roller.pojos.PlanetSubscriptionData;
 import org.roller.presentation.BasePageModel;
-import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.util.Technorati;
 
 
ranches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/MetaWeblogAPIHandler.java Sun Jul 17 18:12:36 2005
@@ -20,6 +20,7 @@
 import org.roller.RollerException;
 import org.roller.model.FileManager;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WeblogEntryData;
@@ -69,7 +70,7 @@
 
         WebsiteData website = validate(blogid, userid,password);
         RollerRequest rreq = RollerRequest.getRollerRequest();
-        Roller roller = rreq.getRoller();
+        Roller roller = RollerFactory.getRoller();
         try
         {
             Hashtable   }

    /**
     * Load miscellaneous values into the Context.
     * @param rollerCtx
     */
    private void loadTheRest(RollerContext rollerCtx)
    {
        ctx.put("utilities",       new Utilities() );
        ctx.put("stringUtils",     new StringUtils() );        
        ctx.put("entryLength",     new Integer(-1));
    }

    /**
     * Load information pertaining to the Website and
     * its associated User.
     * @param rollerCtx
     */
    private void loadWebsiteInfo(RollerContext rollerCtx, WebsiteData website)
    {
        ctx.put("website",       website);
        ctx.put("userName",      user.getUserName() );
        ctx.put("fullName",      user.getFullName() );
        ctx.put("emailAddress",  user.getEmailAddress() );

        ctx.put("encodedEmail",  RegexUtil.encode(user.getEmailAddress()));
        ctx.put("obfuscatedEmail",  RegexUtil.obfuscateEmail(user.getEmailAddress()));

        
        // custom figureResourcePath() due to no "request" object
        StringBuffer sb = new SrrentWebsite());
+                List refs = refmgr.getTodaysReferers(RollerSession.getRollerSession(req).getCurrentWebsite());
                 req.setAttribute("referers",refs);        
             }
         }
@@ -85,14 +87,15 @@
     {
         this.servlet.log("ReferersAction.reset()");
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
+        RollerSession rollerSession = RollerSession.getRollerSession(req);
         try
         {
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
-                RefererManager refmgr = rreq.getRoller().getRefererManager();
-                WebsiteData website = rreq.getCurrentWebsite();
+                RefererManager refmgr = RollerFactory.getRoller().getRefererManager();
+                WebsiteData website = RollerSession.getRollerSession(req).getCurrentWebsite();
                 refmgr.forceTurnover(website.getId());
-                rreq.getRoller().commit();
+         @@ -69,10 +70,9 @@
         ActionForward forward = mapping.findForward("planetSubscriptions.page");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
                 PlanetManager planet = roller.getPlanetManager();
                 PlanetSubscriptionFormEx form = (PlanetSubscriptionFormEx)actionForm;
                 if (request.getParameter("feedUrl") != null)
@@ -118,10 +118,9 @@
         ActionForward forward = mapping.findForward("planetSubscriptions.page");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-  result = new Hashtable();
@@ -112,7 +113,7 @@
         mLogger.info("     UserId: " + userid);
         mLogger.info("    Publish: " + publish);
 
-        Roller roller = RollerRequest.getRollerRequest().getRoller();
+        Roller roller = RollerFactory.getRoller(); 
         WeblogManager weblogMgr = roller.getWeblogManager();
         WeblogEntryData entry = weblogMgr.retrieveWeblogEntry(postid);
 
@@ -213,7 +214,7 @@
 
         try
         {
-            Roller roller = RollerRequest.getRollerRequest().getRoller();
+            Roller roller = RollerFactory.getRoller(); 
             WeblogManager weblogMgr = roller.getWeblogManager();
 
             Timestamp current = new Timestamp(System.currentTimeMillis());
@@ -274,7 +275,7 @@
         mLogger.info("     PostId: " + postid);
         mLogger.info("     UserId: " + userid);
 
-        Roller roller = RollerRequest.getRollerRequest().getRoller();
+        Roller roller = RollerFactory.getRoller(); 
         WeblogManager weblogMgr = roller.getWeblogtringBuffer();
        String uploadDir = null;
        try {
            uploadDir = RollerFactory.getRoller().getFileManager().getUploadDir();
        } catch(Exception e) {}

        ctx.put("uploadPath", uploadDir);
    }

    /**
     * Load time-related information.
     * @param website
     */
    private void loadDates(WebsiteData website)
    {
        try
        {
            // Add current time and last updated times to context
            Date updateTime = RollerFactory.getRoller().getWeblogManager()
                .getWeblogLastPublishTime(website, null);                        
            ctx.put("updateTime",   updateTime);
        }
        catch (RollerException e)
        {                       
            ctx.put("updateTime",   new Date());
        }
        ctx.put("now",              new Date());
        
        // setup Locale for future rendering
        Locale locale = website.getLocaleInstance();
        ctx.put("locale", locale);
        
        // setup Timezone for future        RollerFactory.getRoller().commit();
             }
             this.servlet.log("ReferersAction.reset(): don't have permission");
         }
@@ -111,12 +114,13 @@
     {
         //this.servlet.log("ReferersAction.delete()");
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
+        RollerSession rollerSession = RollerSession.getRollerSession(req);
         try
         {
-            if ( rreq.isUserAuthorizedToEdit() )
+            if (rollerSession.isUserAuthorizedToEdit() )
             {
-                RefererManager refmgr = rreq.getRoller().getRefererManager();
-                WebsiteData website = rreq.getCurrentWebsite();
+                RefererManager refmgr = RollerFactory.getRoller().getRefererManager();
+                WebsiteData website = RollerSession.getRollerSession(req).getCurrentWebsite();
 
                 String[] deleteIds = req.getParameterValues("id");
                 if (deleteIds != null)
@@ -125,7 +129,7 @@
                     {
                                 Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
                 PlanetManager planet = roller.getPlanetManager();
                 PlanetSubscriptionFormEx form = (PlanetSubscriptionFormEx)actionForm;
                 
@@ -158,10 +157,10 @@
         ActionForward forward = mapping.findForward("planetSubscriptions.page");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            //RollerRequest rreq = RollerRequest.getRollerRequest(request);
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
-                Roller roller = rreq.getRoller();
+                Roller roller = RollerFactory.getRoller();
                 PlanetManager planet = roller.getPlanetManager();
                 PlanetSubscriptionFormEx form = (PlanetSubscriptionFormEx)actionForm;
                 if (form.getId() != null)
@@ -216,8 Manager();
         WeblogEntryData entry = weblogMgr.retrieveWeblogEntry(postid);
         
@@ -319,7 +320,7 @@
             
             byte[] bits = (byte[]) struct.get("bits");
 
-            Roller roller = RollerRequest.getRollerRequest().getRoller();
+            Roller roller = RollerFactory.getRoller(); 
             FileManager fmgr = roller.getFileManager();
             RollerMessages msgs = new RollerMessages();
             
@@ -380,7 +381,7 @@
         {
             Vector results = new Vector();
 
-            Roller roller = RollerRequest.getRollerRequest().getRoller();
+            Roller roller = RollerFactory.getRoller(); 
             WeblogManager weblogMgr = roller.getWeblogManager();
             if (website != null)
             {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/RollerXMLRPCServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/RollerXMLRPCServlet.java?rev=219437&r1=2rendering
        ctx.put("timezone", website.getTimeZoneInstance());

        // date formats need to be run through the Localized
        // SimpleDateFormat and pulled back out as localized patterns.
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd", locale);  
        sdf.setTimeZone( (TimeZone)ctx.get("timezone") );    
        ctx.put("plainFormat",     sdf.toLocalizedPattern());
        
        sdf.applyPattern("EEEE MMMM dd, yyyy");
        ctx.put("toStringFormat",  sdf.toLocalizedPattern());
        
        sdf.applyPattern("MMM dd yyyy, hh:mm:ss a z");
        ctx.put("timestampFormat", sdf.toLocalizedPattern());
        
        ctx.put("dateFormatter", sdf );
    }
    /**
     * Create a PageHelper.  Note that will have no values
     * necessary in parsing a Web request (such as /page) -
     * it is only useful for the restricted export_rss.vm
     * and has no PagePlugins either.  We want the exported
     * Entry.text to be the raw values.
     */
    private void loadPageHelp      refmgr.removeReferer(deleteIds[i]);
                     }
-                    rreq.getRoller().commit();
+                    RollerFactory.getRoller().commit();
                     ActionMessages messages = new ActionMessages();
                     messages.add(null, new ActionMessage("referers.deletedReferers"));
                     saveMessages(req, messages);

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ToggleLinkbackDisplayAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ToggleLinkbackDisplayAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ToggleLinkbackDisplayAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/ToggleLinkbackDisplayAction.java Sun Jul 17+215,7 @@
         ActionForward forward = mapping.findForward("planetSubscriptions.page");
         try
         {
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            Roller roller = rreq.getRoller();
+            Roller roller = RollerFactory.getRoller();
             PlanetManager planet = roller.getPlanetManager();
             PlanetSubscriptionFormEx form = (PlanetSubscriptionFormEx)actionForm;
             
@@ -227,7 +225,7 @@
 
             PlanetGroupData targetGroup = planet.getGroup(groupHandle);
 
-            if (rreq.isUserAuthorizedToEdit())
+            if (RollerSession.getRollerSession(request).isUserAuthorizedToEdit())
             {
 
                 PlanetSubscriptionData sub = null;
@@ -359,9 +357,6 @@
                 ActionMapping mapping) throws RollerException
         {
             super(request, response, mapping);
-            RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            Roller roller = rreq.getRoller();
-        19436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/RollerXMLRPCServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/xmlrpc/RollerXMLRPCServlet.java Sun Jul 17 18:12:36 2005
@@ -4,10 +4,6 @@
 
 package org.roller.presentation.xmlrpc;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.xmlrpc.XmlRpcServer;
-
 import java.io.OutputStream;
 
 import javax.servlet.ServletConfig;
@@ -15,6 +11,10 @@
 import javax.servlet.http.HttpServlet;
 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.xmlrpc.XmlRpcServer;
 
 /**
  * Roller's XML RPC Servlet sets up XmlRpcHandler for Blogger/ API.

Modified: incubator/roller/branches/roller_2.0/web/WEB-INF/eder()
    {
        // Add Velocity page helper to context
        PageHelper pageHelper = new PageHelper(null, null, ctx);
        // set no PagePlugins - we *do not* want to render them.
        ctx.put("pageHelper", pageHelper );
    }
}
\ No newline at end of file

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FlavorServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FlavorServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FlavorServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FlavorServlet.java Sun Jul 17 18:12:36 2005
@@ -1 +1 @@
-package org.roller.presentation.velocity;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.L 18:12:36 2005
@@ -1,5 +1,9 @@
 package org.roller.presentation.weblog.actions;
 
+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.Action;
@@ -7,15 +11,13 @@
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.roller.model.RefererManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.RefererData;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.pagecache.PageCacheFilter;
 
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 
 /**
  * Toggle display of a linkback.
@@ -36,24 +38,25 @@
 	{
          
         RollerRequest rreq     PlanetManager planet = roller.getPlanetManager();
             if (group != null) 
             {
                 Set subsSet = group.getSubscriptions();

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/SyncWebsitesTask.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/SyncWebsitesTask.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/SyncWebsitesTask.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/planet/SyncWebsitesTask.java Sun Jul 17 18:12:36 2005
@@ -18,7 +18,6 @@
 import org.roller.pojos.PlanetConfigData;
 import org.roller.pojos.PlanetGroupData;
 import org.roller.pojos.PlanetSubscriptionData;
-import org.roller.pojos.UserData;
 import org.roller.pojos.WebsiteData;
 import org.roller.util.Technorati;
 

Modified: incubitor-menu.xml
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/WEB-INF/editor-menu.xml?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/WEB-INF/editor-menu.xml (original)
+++ incubator/roller/branches/roller_2.0/web/WEB-INF/editor-menu.xml Sun Jul 17 18:12:36 2005
@@ -1,55 +1,86 @@
+<!-- 
+Defines the Roller Editor GUI menu and roles allowed to use each menu. 
+Each menu or menu item is governed by four attrbibutes:
+
+    1) roles: these are the global roles the are allowed to view item
+       - admin:  the Roller site-wide admin role
+       - editor: the normal Roller user role
+       Default is roles="admin,editor"
+       Use "any" to indicate that role is not required to view ite
+       
+    2) perms: these are the website specific permissions required to view item
+       - editor:  author and allowed to manage current website
+       - author:  allowed to eogFactory;
import org.apache.velocity.Template;
import org.apache.velocity.context.Context;
import org.apache.velocity.servlet.VelocityServlet;
import org.roller.RollerException;
import org.roller.presentation.RollerRequest;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspFactory;
import javax.servlet.jsp.PageContext;
/////////////////////////////////////////////////////////////////////////////
/**
  * <p>Responsible for rendering RSS feeds and other "flavors" of output for a
  * weblog.</p>
  *
  * <p>If Servlet is mapped to <code>/rss</code> and user has defined
  * an RSS override page (i.e. a page named "_rss"), then that Velocity
  * template will be used for rendering.</p>
  *
  * <p>If there is a request parameter named "flavor", then the Velocity
  * template specified by that parameter will be used for rendering. For
  * example if the flavor is "rss092" then the= RollerRequest.getRollerRequest(req);
+        RollerSession rollerSession = RollerSession.getRollerSession(req);
         try
         {
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 String refid = req.getParameter(RollerRequest.REFERERID_KEY);
                 if ( refid != null )
                 {
                     RefererManager refmgr = 
-                        rreq.getRoller().getRefererManager();                        
+                        RollerFactory.getRoller().getRefererManager();                        
                     RefererData ref = refmgr.retrieveReferer(refid); 
                     boolean was = ref.getVisible()==null ? 
                                   false : ref.getVisible().booleanValue(); 
                     ref.setVisible(Boolean.valueOf( !was )); // what up, dog?                     
                     ref.save();
                     
-                    rreq.getRolator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/BaseRollerMenu.java Sun Jul 17 18:12:36 2005
@@ -9,7 +9,12 @@
 
 import org.roller.RollerException;
 import org.roller.config.RollerConfig;
+import org.roller.model.RollerFactory;
+import org.roller.pojos.PermissionsData;
+import org.roller.pojos.UserData;
+import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.util.Utilities;
 
 /**
@@ -22,10 +27,30 @@
     protected String mEnabledProperty = nuldit any part of the current website, except users
+       - limited: allowed only to post drafts in current website
+       Default is perms="admin,author"
+       Use "any" to indicate that website perms are not required to view item
+       
+    3) enable property: if true, show this menu
 
-<!-- Defines the Roller Editor GUI menu and roles allowed to use each menu. -->
-
+    4) disable property: if true, don't show this menu
+-->
 <menu-bar>
 
-    <menu name="tabbedmenu.main">
-        <menu-item name="tabbedmenu.planet" forward="planet" 
-        	   enabledProperty="planet.aggregator.enabled" />
-        <menu-item name="tabbedmenu.main" forward="main" 
-            disabledProperty="planet.aggregator.enabled" />
+    <menu name="tabbedmenu.main" roles="any" perms="any">
+        <menu-item forward="planet"   name="tabbedmenu.planet" 
+                                      perms="any" roles="any" 
+                                      enabledProperty="planet.aggregator.enabled" />
+        <menu-item template at classpath
  * "/flavors/rss092.vm" will be used for rendering.</p>
  *
  * <p>Otherwise, the template /flavors/rss.vm" will be used for rendering.</p>
  *
  * <p>Assumes that If-Modified-Since has already been handled.</p>
  *
  * @author David M Johnson
  *
  * @web.servlet name="RssServlet"
  * @web.servlet-mapping url-pattern="/rss/*"
  * @web.servlet-mapping url-pattern="/flavor/*"
  */
public class FlavorServlet extends VelocityServlet
{
    static final long serialVersionUID = -2720532269434186051L;
    
    private static Log mLogger = LogFactory.getFactory()
                                           .getInstance(RollerRequest.class);
    public Template handleRequest(HttpServletRequest request,
                                  HttpServletResponse response, Context ctx)
    {
        RollerRequest rreq = null;
        try
        {
            rreq = RollerRequest.getRollerRequest(request,getServletContext());
            
            // This is an ugly hack to fix the following bug: 
  ler().commit();
+                    RollerFactory.getRoller().commit();
                     
-                    PageCacheFilter.removeFromCache( req, rreq.getCurrentWebsite() );
+                    PageCacheFilter.removeFromCache( req, RollerSession.getRollerSession(req).getCurrentWebsite() );
                 }                
             }
         }
@@ -69,7 +72,7 @@
 		{
 			RollerContext rctx = RollerContext.getRollerContext(
 				rreq.getServletContext());
-			url = rctx.getContextUrl( req, rreq.getCurrentWebsite());
+			url = rctx.getContextUrl( req, RollerSession.getRollerSession(req).getCurrentWebsite());
 			res.sendRedirect(url);
 		}
 		catch (Exception e)

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java?rev=219437&r1=219436&r2=219437&view=diff
========================================l;
     protected String mDisabledProperty = null;
     protected List mRoles = new ArrayList();
+    protected List mPerms = new ArrayList();
     
-    public BaseRollerMenu() {}
+    public BaseRollerMenu() 
+    {
+        init();
+    }
     
-    public BaseRollerMenu(String name) { mName = name; }
+    public BaseRollerMenu(String name) 
+    { 
+        mName = name; 
+        init();
+    }
+    
+    /**
+     * Set defaults as described in WEB-INF/editor-menu.xml
+     */
+    public void init() 
+    {
+        mRoles.add("admin"); 
+        mRoles.add("editor");
+        
+        mPerms.add("admin");
+        mPerms.add("author");
+    }
     
     /** Name of menu */ 
     public void setName( String v ) { mName = v; }
@@ -33,12 +58,18 @@
     /** Name of menu */
     public String getName() { return mName; }
     
-    /** Roles allowed to use menu, comma separated */ 
+    /** Roles allowed to view menu, comma separated */ 
     public void setRoles( String roles ) 
     {
         mRoles = A forward="main"     name="tabbedmenu.main"    
+                                      perms="any" roles="any" 
+                                      disabledProperty="planet.aggregator.enabled" />
+        <menu-item forward="editUser" name="tabbedmenu.website.user"
+                                      perms="any"
+                                      roles="editor,admin" />
     </menu>
     
-    <menu name="tabbedmenu.weblog" roles="editor,admin">
-        <menu-item name="tabbedmenu.weblog.newEntry"   forward="weblogCreate" />
-        <menu-item name="tabbedmenu.weblog.archives"    forward="weblogQuery" />
-        <menu-item name="tabbedmenu.weblog.categories"  forward="categories" />
-        <menu-item name="tabbedmenu.weblog.referers"    forward="referers" />
-        <menu-item name="tabbedmenu.weblog.pingSetup"   forward="pingSetup"
-          disabledProperty="pings.disablePingUsage"/>
-        <menu-item name="tabbedmenu.weblog.customPingTargets" forward="customPingTargets"
-          disable          // ROL-547: "Site wide RSS feed is your own if you are logged in"
            String[] pathInfo = StringUtils.split(rreq.getPathInfo(),"/"); 
            if (pathInfo.length < 1) 
            {
                // If website not specified in URL, set it to null
                rreq.setWebsite(null);
            }
        }
        catch (RollerException e)
        {
            // An error initializing the request is considered to be a 404
            if (mLogger.isDebugEnabled())
            {
                mLogger.debug("RollerRequest threw Exception", e);
            }
            try
            {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }
            catch (IOException e1)
            {
                if (mLogger.isDebugEnabled())
                {
                    mLogger.debug("IOException sending error", e);
                }
            }
            return null;
        }
        try
        {
            // Needed to init request attributes, e======================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryFormAction.java Sun Jul 17 18:12:36 2005
@@ -37,6 +37,7 @@
 import org.roller.RollerPermissionsException;
 import org.roller.model.IndexManager;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.model.RollerSpellCheck;
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
@@ -47,6 +48,7 @@
 import org.roller.presentation.MainPageAction;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.pagecache.PageCacheFilter;
 import org.roller.presentation.velocity.PageHelper;
 import org.roller.presentation.weblog.formbeans.WeblogEntryFormEx;
@@ -86,11 +88,12 @@
         try
         rrays.asList(Utilities.stringToStringArray(roles,","));
     }
     
+    /** Website permissions required to view menu, comma separated */ 
+    public void setPerms( String perms ) 
+    {
+        mPerms = Arrays.asList(Utilities.stringToStringArray(perms,","));
+    }
+    
     /** Name of property that enables menu (or null if always enabled) */
     public void setEnabledProperty(String enabledProperty)
     {
@@ -54,6 +85,7 @@
     /** Determine if menu  should be shown to use of specified request */
     public boolean isPermitted(HttpServletRequest req) throws RollerException
     {
+        // first, bail out if menu is disabled
         if (mEnabledProperty != null) 
         {
             String enabledProp = RollerConfig.getProperty(mEnabledProperty);
@@ -70,25 +102,59 @@
                 return false;
             }
         }
+        RollerSession rollerSession = RollerSession.getRollerSession(req);
+        RollerRequest rreq = RollerRequest.getRollerRequest(req);
+        boolean ret = faldProperty="pings.disallowCustomTargets"/>
-        <!-- I haven't tested these yet...
-        <menu-item name="tabbedmenu.weblog.export"      forward="exportEntries" />
-        <menu-item name="tabbedmenu.weblog.import"      forward="importEntries" />
-        -->
-    </menu>
-
-    <menu name="tabbedmenu.bookmarks" roles="editor,admin">
-        <menu-item name="tabbedmenu.bookmarks.allFolders" forward="bookmarks" />
-        <menu-item name="tabbedmenu.bookmarks.import"     forward="importBookmarks" />
-    </menu>
-
-    <menu name="tabbedmenu.website" roles="editor,admin">
-        <menu-item name="tabbedmenu.website.settings" forward="editWebsite" />
-        <menu-item name="tabbedmenu.website.themes"   forward="editTheme" />
-        <menu-item name="tabbedmenu.website.pages"    forward="editPages" />
-        <menu-item name="tabbedmenu.website.files"    forward="uploadFiles" />
-        <menu-item name="tabbedmenu.website.user"     forward="editUser" />
-        <menu-item name="tabbedmenu.websitetc.
            PageContext pageContext =
                JspFactory.getDefaultFactory().getPageContext(
                this, request,  response, "", true, 8192, true);
            rreq.setPageContext(pageContext);
            ContextLoader.setupContext(ctx, rreq, response);

            final String useTemplate;
            PageModel pageModel = (PageModel)ctx.get("pageModel");
            if (    request.getServletPath().endsWith("rss")
                 && pageModel.getPageByName("_rss") != null )
            {
                // If the request specified the "/rss" mapping and the
                // user has defined an RSS override page, we will use that.
                useTemplate = pageModel.getPageByName("_rss").getId();
            }
            else if (request.getParameter("flavor") != null)
            {
                // If request specifies a "flavor" then use that.
                String flavor = request.getParameter("flavor");
                useTemplate = "/flavors/" + flavor + ".vm";
       {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if (rreq.isUserAuthorizedToEdit())
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if (rollerSession.isUserAuthorizedToEdit())
             {
                 WeblogEntryFormEx form = (WeblogEntryFormEx)actionForm; 
                 form.initNew(request, response);
-                form.setCreatorId(rreq.getAuthenticatedUser().getId());
+                form.setCreatorId(rollerSession.getAuthenticatedUser().getId());
                 
                 request.setAttribute("model",
                         new WeblogEntryPageModel(request, response, mapping,
@@ -125,9 +128,10 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
        se;
+   
+        // next, make sure that users role permits it
         if (mRoles != null && mRoles.size() > 0)
         {
             Iterator roles = mRoles.iterator();
             while (roles.hasNext())
             {
-                RollerRequest rreq = RollerRequest.getRollerRequest(req);
                 String role = (String)roles.next();
-                if (req.isUserInRole(role)) 
+                if (       role.equals("any") 
+                        || req.isUserInRole(role) 
+                        || (role.equals("admin") && rollerSession.isAdminUser()))  
                 {
-                    return true;
-                }
-                else if (role.equals("admin") && rreq.isAdminUser()) 
-                {
-                    return true;
+                    ret = true;
+                    break;
                 }
             }
-            return false;
         }
-        return true;
+        
+        // finally make sure that user has required website permissions
+    .maintenance" forward="maintenance" />
+    <menu name="tabbedmenu.weblog" perms="admin,author,limited">
+        <menu-item forward="weblogCreate" name="tabbedmenu.weblog.newEntry" 
+                                          perms="admin,author,limited" />
+        <menu-item forward="weblogQuery"  name="tabbedmenu.weblog.archives" 
+                                          perms="admin,author,limited" />
+        <menu-item forward="categories"   name="tabbedmenu.weblog.categories" />
+        <menu-item forward="referers"     name="tabbedmenu.weblog.referers" />
+        <menu-item forward="pingSetup"    name="tabbedmenu.weblog.pingSetup" 
+                                          disabledProperty="pings.disablePingUsage" />
+        <menu-item forward="customPingTargets" name="tabbedmenu.weblog.customPingTargets" 
+                                          disabledProperty="pings.disallowCustomTargets" />
+        <!-- These need work...
+        <menu-item forward="exportEntries" name="tabbedmenu.weblo     }
            else
            {
                // Fall through to default RSS page template.
                useTemplate = "/flavors/rss.vm";
            }
            return getTemplate(useTemplate);
        }
        catch (Exception e)
        {
            mLogger.error("ERROR in RssServlet", e);
        }
        return null;
    }

    //------------------------------------------------------------------------
    /**
     * Handle error in Velocity processing.
     */
    protected void error( HttpServletRequest req, HttpServletResponse res,
        Exception e) throws ServletException, IOException
    {
        mLogger.warn("ERROR in FlavorServlet",e);
    }
}

\ No newline at end of file
+package org.roller.presentation.velocity;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspFactory;
import javax.servlet.jsp.PageContext;

import org.apache.commons.lang.     {
-                WeblogManager wmgr = rreq.getRoller().getWeblogManager();
+                WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
                 WeblogEntryData entry = rreq.getWeblogEntry();
                 WeblogEntryFormEx form = (WeblogEntryFormEx)actionForm;
                 if (entry == null && form.getId() != null)
@@ -196,7 +200,8 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 request.setAttribute("model",
                    new WeblogEntryPageModel(request, response, mapping, 
@@ -232,12 +237,13 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession =    if (ret && mPerms != null && mPerms.size() > 0)
+        {
+            UserData user = rollerSession.getAuthenticatedUser();
+            WebsiteData website = RollerSession.getRollerSession(req).getCurrentWebsite();
+            PermissionsData permsData = null;
+            if (user != null && website != null) 
+            {
+                permsData =
+                    RollerFactory.getRoller().getUserManager().getPermissions(website, user);
+            }
+            ret = false;
+            Iterator perms = mPerms.iterator();
+            while (perms.hasNext())
+            {
+               String perm = (String)perms.next();
+               if (perm.equals("any")) 
+               {
+                   ret = true; // any permission will do (including none)
+                   break;
+               }
+               if (permsData != null && 
+                  ((perm.equals("admin")  && permsData.has(PermissionsData.ADMIN)) 
+               || (perm.equals("author")  && permsData.has(Permig.export"  />
+        <menu-item forward="importEntries" name="tabbedmenu.weblog.import"  /> -->
+    </menu>
+
+    <menu name="tabbedmenu.bookmarks">
+        <menu-item forward="bookmarks"       name="tabbedmenu.bookmarks.allFolders" />
+        <menu-item forward="importBookmarks" name="tabbedmenu.bookmarks.import" />
+    </menu>
+
+    <menu name="tabbedmenu.website">
+        <menu-item forward="editWebsite" name="tabbedmenu.website.settings" />
+        <menu-item forward="editTheme"   name="tabbedmenu.website.themes" />
+        <menu-item forward="editPages"   name="tabbedmenu.website.pages" />
+        <menu-item forward="uploadFiles" name="tabbedmenu.website.files" />
+        <menu-item forward="maintenance" name="tabbedmenu.website.maintenance" />
     </menu>
 
     <menu name="tabbedmenu.admin" roles="admin">
-        <menu-item name="tabbedmenu.admin.config"     forward="rollerConfig" />
-        <menu-item name="tabbedmenu.admin.userAdmin"  forward="adminUser" />
-        <menu-item name="tStringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.velocity.Template;
import org.apache.velocity.context.Context;
import org.apache.velocity.servlet.VelocityServlet;
import org.roller.RollerException;
import org.roller.presentation.RollerRequest;
/////////////////////////////////////////////////////////////////////////////
/**
  * <p>Responsible for rendering RSS feeds and other "flavors" of output for a
  * weblog.</p>
  *
  * <p>If Servlet is mapped to <code>/rss</code> and user has defined
  * an RSS override page (i.e. a page named "_rss"), then that Velocity
  * template will be used for rendering.</p>
  *
  * <p>If there is a request parameter named "flavor", then the Velocity
  * template specified by that parameter will be used for rendering. For
  * example if the flavor is "rss092" then the template at classpath
  * "/flavors/rss092.vm" will be used for rendering.</p>
  *
  * <p>Otherwise, the template /flavors/rss.vm" will be used for RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
-                UserManager userMgr = rreq.getRoller().getUserManager();
-                WeblogManager weblogMgr = rreq.getRoller().getWeblogManager();
+                UserManager userMgr = RollerFactory.getRoller().getUserManager();
+                WeblogManager weblogMgr = RollerFactory.getRoller().getWeblogManager();
 
-                WebsiteData site = rreq.getCurrentWebsite();
+                WebsiteData site = RollerSession.getRollerSession(request).getCurrentWebsite();
                 WeblogEntryFormEx wf = (WeblogEntryFormEx)actionForm;
                 
                 // I was getting column 'x' cannot be null, so I fixed it here.
@@ -265,7 +271,7 @@
                 {
                     entry = new WeblogEntryData();  
                     UserData ud = userMgr.retrieveUser(
-                            rreq.getAuthenticatedUser().getId());
+                            RollessionsData.AUTHOR))
+               || (perm.equals("limited") && permsData.has(PermissionsData.LIMITED))))                     
+               {
+                   ret = true; // user has one of the required permissions
+                   break;
+               }
+            }
+        }
+        return ret;
     }
 
 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/EditorNavigationBarTag.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/EditorNavigationBarTag.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/EditorNavigationBarTag.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/EditorNavigationBarTag.java Sun Jul 17 18:12:36 2005
@@ -1,12 +1,13 @@
 
 package org.roller.presentation.tags.menu;
 
+import jabbedmenu.admin.createUser"  forward="createUser" />
-        <menu-item name="tabbedmenu.admin.pingTargets" forward="commonPingTargets"/>
+        <menu-item forward="rollerConfig"      name="tabbedmenu.admin.config" />
+        <menu-item forward="adminUser"         name="tabbedmenu.admin.userAdmin" />
+        <menu-item forward="createUser"        name="tabbedmenu.admin.createUser" />
+        <menu-item forward="commonPingTargets" name="tabbedmenu.admin.pingTargets" />
     </menu>
 
-    <menu name="tabbedmenu.planet" roles="admin" enabledProperty="planet.aggregator.enabled">
-        <menu-item name="tabbedmenu.admin.planetConfig"         forward="planetConfig" />
-        <menu-item name="tabbedmenu.admin.planetSubscriptions"  forward="planetSubscriptions" />
-        <menu-item name="tabbedmenu.admin.planetGroups"         forward="planetGroups" />
+    <menu name="tabbedmenu.planet" roles="admin"
+        enabledProperty="planet.aggregator.enabled">
+        <menu-item forward="planetConfig"        n rendering.</p>
  *
  * <p>Assumes that If-Modified-Since has already been handled.</p>
  *
  * @author David M Johnson
  *
  * @web.servlet name="RssServlet"
  * @web.servlet-mapping url-pattern="/rss/*"
  * @web.servlet-mapping url-pattern="/flavor/*"
  */
public class FlavorServlet extends VelocityServlet
{
    static final long serialVersionUID = -2720532269434186051L;
    
    private static Log mLogger = LogFactory.getFactory()
                                           .getInstance(RollerRequest.class);
    public Template handleRequest(HttpServletRequest request,
                                  HttpServletResponse response, Context ctx)
    {
        RollerRequest rreq = null;
        try
        {
            rreq = RollerRequest.getRollerRequest(request,getServletContext());
            
            // This is an ugly hack to fix the following bug: 
            // ROL-547: "Site wide RSS feed is your own if you are logged in"
            String[] pathInfo = StringUtils.split(rreq.getPathInfo(),"/"rSession.getRollerSession(request).getAuthenticatedUser().getId());
                     entry.setCreator(ud);
                     entry.setWebsite( site );
                 }
@@ -293,21 +299,21 @@
                 entry.setUpdateTime(new Timestamp(new Date().getTime()));
                 mLogger.debug("Saving entry");
                 entry.save();
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
                 mLogger.debug("Populating form");
                 wf.copyFrom(entry, request.getLocale());
                 
-                reindexEntry(rreq.getRoller(), entry);
+                reindexEntry(RollerFactory.getRoller(), entry);
                 
                 // open up a new session, because we will forward to the edit action
-                //rreq.getRoller().begin(); // begin already called by RequestFilter
+                //RollerFactory.getRoller().begin(); // begin already called by RequestFilter
                 
                 requavax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.presentation.RollerRequest;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.jsp.JspException;
+import org.roller.presentation.RollerSession;
 
 
 /**
@@ -38,8 +39,8 @@
 			HttpServletRequest request = 
 				(HttpServletRequest)pageContext.getRequest(); 
 			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-
-			if ( rreq.isUserAuthorizedToEdit() )
+			RollerSession rollerSession = RollerSession.getRollerSession(request);
+			if ( rollerSession.isUserAuthorizedToEdit() )
 			{
 				return super.doEndTag(pw);
 			}

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/Menu.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/Menu.java?rev=219437&r1=219436&r2=219437&view=diff
==========================ame="tabbedmenu.admin.planetConfig" 
+                                                 roles="admin" />
+        <menu-item forward="planetSubscriptions" name="tabbedmenu.admin.planetSubscriptions" 
+                                                 roles="admin" />
+        <menu-item forward="planetGroups"        name="tabbedmenu.admin.planetGroups" 
+                                                 roles="admin" />
     </menu>
 
 </menu-bar>
+
+
+
+

Modified: incubator/roller/branches/roller_2.0/web/error.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/error.jsp?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/error.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/error.jsp Sun Jul 17 18:12:36 2005
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
-<%@ pa); 
            if (pathInfo.length < 1) 
            {
                // If website not specified in URL, set it to null
                rreq.setWebsite(null);
            }
        }
        catch (RollerException e)
        {
            // An error initializing the request is considered to be a 404
            if (mLogger.isDebugEnabled())
            {
                mLogger.debug("RollerRequest threw Exception", e);
            }
            try
            {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }
            catch (IOException e1)
            {
                if (mLogger.isDebugEnabled())
                {
                    mLogger.debug("IOException sending error", e);
                }
            }
            return null;
        }
        try
        {
            // Needed to init request attributes, etc.
            PageContext pageContext =
                JspFactory.getDefaultFactory().getPageContext(
                this, request,  response, "est.setAttribute(RollerRequest.WEBLOGENTRYID_KEY, entry.getId());
                  
                 // Flush the page cache
                 mLogger.debug("Removing from cache");
-                PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
+                PageCacheFilter.removeFromCache(request, RollerSession.getRollerSession(request).getCurrentWebsite());
 				// refresh the front page cache
                 MainPageAction.flushMainPageCache();
 
@@ -422,11 +428,12 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 WeblogEntryFormEx wf = (WeblogEntryFormEx)actionForm;
                 WeblogEntryData wd = 
-                    rreq.getRoller().getWeblogManager().retrieveWeblogEntry(wf.getId());
+               ====================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/Menu.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/tags/menu/Menu.java Sun Jul 17 18:12:36 2005
@@ -1,8 +1,8 @@
 
 package org.roller.presentation.tags.menu;
-import org.roller.RollerException;
-
 import javax.servlet.http.HttpServletRequest;
+
+import org.roller.RollerException;
 
 /** An individual menu which contains MenuItems */ 
 public interface Menu 



ge import="org.roller.model.Roller" %>
+<% try { %><%@ page import="org.roller.model.Roller" %>
 <%@ page import="org.roller.pojos.UserData" %>
 <%@ page import="org.roller.presentation.RollerRequest" %>
 <%@ include file="/taglibs.jsp" %>

Modified: incubator/roller/branches/roller_2.0/web/error403.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/error403.jsp?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/error403.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/error403.jsp Sun Jul 17 18:12:36 2005
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
-<%@ page import="org.roller.model.Roller" %>
+<% try { %><%@ page import="org.roller.model.Roller" %>
 <%@ page import="org.roller.pojos.UserData" %>
 <%@ page import="org.roller.presentation.RollerReque", true, 8192, true);
            rreq.setPageContext(pageContext);
            ContextLoader.setupContext(ctx, rreq, response);

            final String useTemplate;
            PageModel pageModel = (PageModel)ctx.get("pageModel");
            if (    request.getServletPath().endsWith("rss")
                 && pageModel.getPageByName("_rss") != null )
            {
                // If the request specified the "/rss" mapping and the
                // user has defined an RSS override page, we will use that.
                useTemplate = pageModel.getPageByName("_rss").getId();
            }
            else if (request.getParameter("flavor") != null)
            {
                // If request specifies a "flavor" then use that.
                String flavor = request.getParameter("flavor");
                useTemplate = "/flavors/" + flavor + ".vm";
            }
            else
            {
                // Fall through to default RSS page template.
                useTemplate = "/flavors/rss.vm";     RollerFactory.getRoller().getWeblogManager().retrieveWeblogEntry(wf.getId());
                 wf.copyFrom(wd, request.getLocale());
                 if (wd == null || wd.getId() == null)
                 {
@@ -462,20 +469,21 @@
         try
         {
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
-                WeblogManager mgr = rreq.getRoller().getWeblogManager();
+                WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
                 WeblogEntryData wd = mgr.retrieveWeblogEntry(request.getParameter("id"));
                 
                 // Flush the page cache
-                PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
+                PageCacheFilter.removeFromCache(request, RollerSession.getRollerSession(rest" %>
 <%@ include file="/taglibs.jsp" %>

Modified: incubator/roller/branches/roller_2.0/web/error404.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/error404.jsp?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/error404.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/error404.jsp Sun Jul 17 18:12:36 2005
@@ -1,6 +1,6 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
-<%@ page import="org.roller.model.Roller" %>
+<% try { %><%@ page import="org.roller.model.Roller" %>
 <%@ page import="org.roller.pojos.UserData" %>
 <%@ page import="org.roller.presentation.RollerRequest" %>
 <%@ include file="/taglibs.jsp" %>

Modified: incubator/roller/branches/roller_2.0/web/main.jsp
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/web/main.jsp?rev=21943
            }
            return getTemplate(useTemplate);
        }
        catch (Exception e)
        {
            mLogger.error("ERROR in RssServlet", e);
        }
        return null;
    }

    //------------------------------------------------------------------------
    /**
     * Handle error in Velocity processing.
     */
    protected void error( HttpServletRequest req, HttpServletResponse res,
        Exception e) throws ServletException, IOException
    {
        mLogger.warn("ERROR in FlavorServlet",e);
    }
}

\ No newline at end of file

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FoafServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FoafServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FoafServlet.java (original)
+++ iquest).getCurrentWebsite());
 
 				// remove the index for it
                 wd.setPublishEntry(Boolean.FALSE);
-		       reindexEntry(rreq.getRoller(), wd);
+		       reindexEntry(RollerFactory.getRoller(), wd);
 
                 wd.remove();
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
 
                 ActionMessages uiMessages = new ActionMessages();
                 uiMessages.add(null, new ActionMessage("weblogEdit.entryRemoved"));
@@ -507,8 +515,9 @@
     {
         try
         {
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 HttpSession session = request.getSession(true);
                 WeblogEntryFormEx wf = (WeblogEntryFormEx)actionForm;
@@ -565,8 +574,9 @@
         ActionForward forward = ma7&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/web/main.jsp (original)
+++ incubator/roller/branches/roller_2.0/web/main.jsp Sun Jul 17 18:12:36 2005
@@ -35,7 +35,7 @@
 
             <span class="entryDetails">
 
-                <a href='<c:out value="${baseURL}" />/page/<c:out value="${post.website.user.userName}" />' class="entryDetails">
+                <a href='<c:out value="${baseURL}" />/page/<c:out value="${post.creator.userName}" />' class="entryDetails">
                 <str:truncateNicely upper="50" >
                    <c:out value="${post.website.name}" />
                 </str:truncateNicely></a> |
@@ -73,7 +73,7 @@
 
             <span class="entryDetails">
 
-                <a href='<c:out value="${baseURL}" />/page/<c:out value="${post.website.user.userName}" />' class="entryDetails">
+                <a href='<c:out value="${baseURL}" />/page/<c:out value="${post.creator.ncubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/FoafServlet.java Sun Jul 17 18:12:36 2005
@@ -1 +1 @@
-package org.roller.presentation.velocity;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.velocity.Template;
import org.apache.velocity.context.Context;
import org.apache.velocity.servlet.VelocityServlet;
import org.roller.RollerException;
import org.roller.model.UserManager;
import org.roller.pojos.PageData;
import org.roller.pojos.UserData;
import org.roller.pojos.WebsiteData;
import org.roller.presentation.RollerContext;
import org.roller.presentation.RollerRequest;
import org.roller.util.Utilities;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


//////////////////////////////////////////////////////////////////////////////

/**
  * <p>Responsible for rendering FOAF feed.  This servlet requires
  * that the Requpping.findForward("weblogEdit.page");
         try
         {
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
             RollerRequest rreq = RollerRequest.getRollerRequest(request);
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 HttpSession session = request.getSession(true);
                 WeblogEntryFormEx wf = (WeblogEntryFormEx)actionForm;
@@ -614,9 +624,10 @@
         ActionForward forward = mapping.findForward("weblogEdit.page");
         ActionErrors errors = new ActionErrors();
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
+        RollerSession rollerSession = RollerSession.getRollerSession(request);
         try
         {
-            if ( rreq.isUserAuthorizedToEdit() )
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 WeblogEntryData wd = rreq.getWeblogEntry();
                 if (wd == null || wd.userName}" />' class="entryDetails">
                 <str:truncateNicely upper="50" >
                    <c:out value="${post.website.name}" />
                 </str:truncateNicely></a> |



estFilter is in place for it, and should also
  * have the IfModifiedFilter configured.</p>
  * 
  * <p>Resources:<br />
  * <a href="http://xmlns.com/foaf/0.1/"
  *     >FOAF Vocabulary Specification</a><br />
  * <a href="http://www.xml.com/lpt/a/2004/02/04/foaf.html"
  *     >An Introduction to FOAF</a></p>
  * 
  * <p>FOAF Autodiscovery: <br />
  * <link rel="meta" type="application/rdf+xml" title="FOAF" 
  *     href="$absBaseURL/foaf/$userName" /> </p>
  *
  * @author Lance Lavandowska
  *
  * @web.servlet name="FoafServlet"
  * @web.servlet-mapping url-pattern="/foaf/*"
  */
public class FoafServlet extends VelocityServlet
{
    static final long serialVersionUID = -1893244416537298619L;
    
    private static Log mLogger = LogFactory.getFactory()
                                           .getInstance(RollerRequest.class);

    /**
     * This Velocity servlet does not make use of ContextLoader and associated
     * classes (as do FlavorServlet and PageServlet) because that is more
     * work than igetId() == null)
@@ -627,7 +638,7 @@
                 WeblogEntryFormEx form = (WeblogEntryFormEx)actionForm;
 
                 // If form indicates that comments should be deleted, then delete
-                WeblogManager mgr = rreq.getRoller().getWeblogManager();
+                WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
                 String[] deleteIds = form.getDeleteComments();
                 if (deleteIds != null && deleteIds.length > 0)
                 {
@@ -658,9 +669,9 @@
                     }
                 }
 
-                rreq.getRoller().commit();
+                RollerFactory.getRoller().commit();
                 
-                reindexEntry(rreq.getRoller(), wd);
+                reindexEntry(RollerFactory.getRoller(), wd);
                 
                 request.setAttribute("model",
                         new WeblogEntryPageModel(request, response, mapping, 
@@ -701,7 +712,8 @@
        try
        {
            RollerRequest rreq = RollerRequess really necessary.  It implements its own setupContext()
     * to load necessary values into the Velocity Context.
     * 
     * @param ctx
     * @param rreq
     * @throws RollerException
     */
    public Template handleRequest(HttpServletRequest request,
                                  HttpServletResponse response, Context ctx)
    {
        RollerRequest rreq = null;
        try
        {
            rreq = RollerRequest.getRollerRequest(request, getServletContext());
        }
        catch (RollerException e)
        {
            // An error initializing the request is considered to be a 404
            if (mLogger.isDebugEnabled())
            {
                mLogger.debug("RollerRequest threw Exception", e);
            }

            try
            {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }
            catch (IOException e1)
            {
                if (mLogger.isDebugEnabled())
                {
                    mLogger.debug("IOExceptiont.getRollerRequest(request);
-           if (rreq.isUserAuthorizedToEdit())
+           RollerSession rollerSession = RollerSession.getRollerSession(request);
+           if (rollerSession.isUserAuthorizedToEdit())
            {
                WeblogEntryFormEx form = (WeblogEntryFormEx)actionForm;
                String entryid = form.getId();
@@ -711,7 +723,7 @@
                }
 
                RollerContext rctx= RollerContext.getRollerContext(request);
-               WeblogManager wmgr= rreq.getRoller().getWeblogManager();
+               WeblogManager wmgr= RollerFactory.getRoller().getWeblogManager();
                entry = wmgr.retrieveWeblogEntry(entryid);
 
                String title = entry.getTitle();

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java?rev=219437&r1=219436&r2=219437&view= sending error", e);
                }
            }
            return null;
        }
        
        try
        {
            setupContext(ctx, rreq);

            response.setContentType("application/rdf+xml");
            return getTemplate("/flavors/foaf.vm");
        }
        catch (Exception e)
        {
            mLogger.error("ERROR in FoafServlet", e);
        }
        return null;
    }

    /**
	 * @param ctx
	 */
	private void setupContext(Context ctx, RollerRequest rreq) throws RollerException
	{
        HttpServletRequest request = rreq.getRequest();
        RollerContext rollerCtx = RollerContext.getRollerContext( request );
        
        WebsiteData website = rreq.getWebsite();
        ctx.put("fullName", website.getName()); // name for FlavorServlet compatibility
        
        // foaf:homepage to equal base URL for user
        String homepage = Utilities.escapeHTML( 
                rollerCtx.getAbsoluteContextUrl(request) + 
                    "/page/" + website.getHandle() )diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogEntryPageModel.java Sun Jul 17 18:12:36 2005
@@ -3,33 +3,34 @@
  */
 package org.roller.presentation.weblog.actions;
 
-import com.swabunga.spell.event.SpellCheckEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
 import org.roller.RollerException;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.UserData;
 import org.ro;
        ctx.put("websiteURL", homepage); // name for FlavorServlet compatibility

        // see if foaf:weblog is different Page
        UserManager usrMgr = RollerContext.getRoller(request).getUserManager();
        PageData weblog = usrMgr.getPageByName(website, "Weblog");
        // if weblog != homepage, add to context
        if (weblog != null && !website.getDefaultPageId().equals(weblog.getId()))
        {
            String weblogUrl = Utilities.escapeHTML( 
                    rollerCtx.getAbsoluteContextUrl(request) + 
                        "/page/" + website.getHandle() + 
                            "/" + weblog.getLink() );
        	ctx.put("weblog", weblogUrl);
        }
        
        // use SHA1 encrypted email address, including mailto: prefix
        String shaEmail = Utilities.encodePassword(
                "mailto:" + website.getEmailAddress(), "SHA");
        ctx.put("shaEmail", shaEmail);
	}

	//------------------------------------------------------------------------
    /**
    ller.pojos.WeblogEntryData;
 import org.roller.presentation.BasePageModel;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.tags.calendar.CalendarModel;
 import org.roller.presentation.velocity.ContextLoader;
 import org.roller.presentation.weblog.formbeans.WeblogEntryFormEx;
 import org.roller.presentation.weblog.tags.EditWeblogCalendarModel;
 import org.roller.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import com.swabunga.spell.event.SpellCheckEvent;
 
 /**
  * All data needed to render the edit-weblog page.
@@ -90,7 +91,7 @@
         
         if (null != form.getId()) 
         {
-            WeblogManager wmgr = rollerRequest.getRoller().getWebl * Handle error in Velocity processing.
     */
    protected void error( HttpServletRequest req, HttpServletResponse res,
        Exception e) throws ServletException, IOException
    {
        mLogger.warn("ERROR in FoafServlet",e);
    }
}
\ No newline at end of file
+package org.roller.presentation.velocity;

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.velocity.Template;
import org.apache.velocity.context.Context;
import org.apache.velocity.servlet.VelocityServlet;
import org.roller.RollerException;
import org.roller.model.UserManager;
import org.roller.pojos.PageData;
import org.roller.pojos.WebsiteData;
import org.roller.presentation.RollerContext;
import org.roller.presentation.RollerRequest;
import org.roller.util.Utilities;


/////////////////////////////////////////////////////////ogManager();
+            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
             comments = wmgr.getComments(form.getId(), false);
         }
     }
@@ -108,9 +109,10 @@
      */
     public List getRecentPublishedEntries() throws RollerException
     {
-        return rollerRequest.getRoller().getWeblogManager()
+        RollerSession rollerSession = RollerSession.getRollerSession(getRequest());
+        return RollerFactory.getRoller().getWeblogManager()
             .getWeblogEntries(
-                rollerRequest.getCurrentWebsite(), // userName
+                rollerSession.getCurrentWebsite(), // userName
                 null,              // startDate
                 null,              // endDate
                 null,              // catName
@@ -126,9 +128,10 @@
      */
     public List getRecentDraftEntries() throws RollerException
     {
-        return rollerRequest.getRoller().getWeblogManager()
+        RollerSession rollerSession = RollerSession.getRollerSession(get/////////////////////

/**
  * <p>Responsible for rendering FOAF feed.  This servlet requires
  * that the RequestFilter is in place for it, and should also
  * have the IfModifiedFilter configured.</p>
  * 
  * <p>Resources:<br />
  * <a href="http://xmlns.com/foaf/0.1/"
  *     >FOAF Vocabulary Specification</a><br />
  * <a href="http://www.xml.com/lpt/a/2004/02/04/foaf.html"
  *     >An Introduction to FOAF</a></p>
  * 
  * <p>FOAF Autodiscovery: <br />
  * <link rel="meta" type="application/rdf+xml" title="FOAF" 
  *     href="$absBaseURL/foaf/$userName" /> </p>
  *
  * @author Lance Lavandowska
  *
  * @web.servlet name="FoafServlet"
  * @web.servlet-mapping url-pattern="/foaf/*"
  */
public class FoafServlet extends VelocityServlet
{
    static final long serialVersionUID = -1893244416537298619L;
    
    private static Log mLogger = LogFactory.getFactory()
                                           .getInstance(RollerRequest.class);

    /**
     * This Velocity servlet does not make use of ContextLoaRequest());
+        return RollerFactory.getRoller().getWeblogManager()
             .getWeblogEntries(
-                rollerRequest.getCurrentWebsite(), 
+                rollerSession.getCurrentWebsite(), 
                 null,              // startDate
                 null,              // endDate
                 null,              // catName
@@ -170,7 +173,8 @@
     {
         // Select editor page selected by user (simple text editor,
         // DHTML editor, Ekit Java applet, etc.
-        String editorPage = rollerRequest.getCurrentWebsite().getEditorPage();
+        RollerSession rollerSession = RollerSession.getRollerSession(getRequest());
+        String editorPage = rollerSession.getCurrentWebsite().getEditorPage();
         if (StringUtils.isEmpty( editorPage ))
         {
             editorPage = "editor-text.jsp";
@@ -192,13 +196,15 @@
 
     public UserData getUser()
     {
-        return rollerRequest.getAuthenticatedUser();
+        RollerSession rollerSession = RollerSession.getRollder and associated
     * classes (as do FlavorServlet and PageServlet) because that is more
     * work than is really necessary.  It implements its own setupContext()
     * to load necessary values into the Velocity Context.
     * 
     * @param ctx
     * @param rreq
     * @throws RollerException
     */
    public Template handleRequest(HttpServletRequest request,
                                  HttpServletResponse response, Context ctx)
    {
        RollerRequest rreq = null;
        try
        {
            rreq = RollerRequest.getRollerRequest(request, getServletContext());
        }
        catch (RollerException e)
        {
            // An error initializing the request is considered to be a 404
            if (mLogger.isDebugEnabled())
            {
                mLogger.debug("RollerRequest threw Exception", e);
            }

            try
            {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }
            catch (IOException e1)
            {erSession(getRequest());
+        return rollerSession.getAuthenticatedUser();
     }
 
     public List getCategories() throws Exception
     {
-        return rollerRequest.getRoller().getWeblogManager()
-            .getWeblogCategories(rollerRequest.getCurrentWebsite(), false);
+        RollerSession rollerSession = RollerSession.getRollerSession(getRequest());
+        return RollerFactory.getRoller().getWeblogManager()
+            .getWeblogCategories(rollerSession.getCurrentWebsite(), false);
     }
 
     public List getComments() throws Exception
@@ -215,10 +221,11 @@
     {
         if (weblogEntry == null) 
         {
+            RollerSession rollerSession = RollerSession.getRollerSession(getRequest());
             weblogEntry = new WeblogEntryData();
             form.copyTo(weblogEntry, 
                     getRequest().getLocale(), getRequest().getParameterMap());
-            weblogEntry.setWebsite(rollerRequest.getCurrentWebsite());
+            weblogEntry.setWebsite(rollerSession.getCur
                if (mLogger.isDebugEnabled())
                {
                    mLogger.debug("IOException sending error", e);
                }
            }
            return null;
        }
        
        try
        {
            setupContext(ctx, rreq);

            response.setContentType("application/rdf+xml");
            return getTemplate("/flavors/foaf.vm");
        }
        catch (Exception e)
        {
            mLogger.error("ERROR in FoafServlet", e);
        }
        return null;
    }

    /**
	 * @param ctx
	 */
	private void setupContext(Context ctx, RollerRequest rreq) throws RollerException
	{
        HttpServletRequest request = rreq.getRequest();
        RollerContext rollerCtx = RollerContext.getRollerContext( request );
        
        WebsiteData website = rreq.getWebsite();
        ctx.put("fullName", website.getName()); // name for FlavorServlet compatibility
        
        // foaf:homepage to equal base URL for user
        String homepage = Utilities.escapeHTML( 
 rentWebsite());
         }
         return weblogEntry;
     }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryAction.java Sun Jul 17 18:12:36 2005
@@ -1,20 +1,21 @@
 
 package org.roller.presentation.weblog.actions;
 
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-import org.apache.struts.actions.DispatchAction;
-
 import java.io.IOException;
 
 import javax.servlet.ServletException;
 imp               rollerCtx.getAbsoluteContextUrl(request) + 
                    "/page/" + website.getHandle() );
        ctx.put("websiteURL", homepage); // name for FlavorServlet compatibility

        // see if foaf:weblog is different Page
        UserManager usrMgr = RollerContext.getRoller(request).getUserManager();
        PageData weblog = usrMgr.getPageByName(website, "Weblog");
        // if weblog != homepage, add to context
        if (weblog != null && !website.getDefaultPageId().equals(weblog.getId()))
        {
            String weblogUrl = Utilities.escapeHTML( 
                    rollerCtx.getAbsoluteContextUrl(request) + 
                        "/page/" + website.getHandle() + 
                            "/" + weblog.getLink() );
        	ctx.put("weblog", weblogUrl);
        }
        
        // use SHA1 encrypted email address, including mailto: prefix
        String shaEmail = Utilities.encodePassword(
                "mailto:" + website.getEmailAddress(), "SHA");
        ctx.put("shaort javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.actions.DispatchAction;
 import org.roller.RollerException;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.weblog.formbeans.WeblogQueryForm;
 
 
@@ -44,13 +45,13 @@
     {
         WeblogQueryForm form = (WeblogQueryForm)actionForm;
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        WeblogManager wmgr = rreq.getRoller().getWeblogManager();
+        WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
         
         request.setAttribute("model", new WeblogQueryPageModel(
            request, 
            response, 
            mapping,
-           rreq.Email", shaEmail);
	}

	//------------------------------------------------------------------------
    /**
     * Handle error in Velocity processing.
     */
    protected void error( HttpServletRequest req, HttpServletResponse res,
        Exception e) throws ServletException, IOException
    {
        mLogger.warn("ERROR in FoafServlet",e);
    }
}
\ No newline at end of file

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/MathCommentAuthenticator.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/MathCommentAuthenticator.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/MathCommentAuthenticator.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/MathCommentAuthenticator.java Sun Jul 17 18:12:36 2005
@@ -1,14 +1,15 getCurrentWebsite(),
+           RollerSession.getRollerSession(request).getCurrentWebsite(),
            form.getCategoryId(),
            form.getStartDateString(),
            form.getEndDateString(),

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/WeblogQueryPageModel.java Sun Jul 17 18:12:36 2005
@@ -3,23 +3,25 @@
  */
 package org.roller.presentation.weblog.actions;
 
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.List;
@@
 package org.roller.presentation.velocity;
 
-import javax.servlet.http.HttpServletRequest; 
+import java.util.ResourceBundle;
+
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
-import org.apache.velocity.context.Context;
-import org.roller.pojos.CommentData;
-import org.roller.presentation.RollerSession;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import java.util.ResourceBundle;
+import org.apache.velocity.context.Context;
+import org.roller.pojos.CommentData;
 
 /**
  * Asks the commenter to answer a simple math question.

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageHelper.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageHelper.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubat+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.struts.action.ActionMapping;
 import org.roller.RollerException;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.WeblogCategoryData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.BasePageModel;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.util.DateUtil;
 
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.util.Date;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * All data needed to render the edit-weblog page.
  * @author David M Johnson
@@ -27,6 +29,7 @@
 public class WeblogQueryPageModel extends BasePageModel
 {
     private RollerRequest rollerRequest = null;
+    private HttpServletRequest request = null;
     private WebsiteData websior/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageHelper.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageHelper.java Sun Jul 17 18:12:36 2005
@@ -28,6 +28,7 @@
 import org.roller.presentation.LanguageUtil;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.tags.calendar.CalendarModel;
 import org.roller.presentation.tags.calendar.CalendarTag;
 import org.roller.presentation.tags.menu.EditorNavigationBarTag;
@@ -215,7 +216,9 @@
         String link = null;
         try
         {
-            if ( mRollerReq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = 
+                RollerSession.getRollerSession(mRollerReq.getRequest());
+            if ( rollerSession.isUserAuthorizedToEdit() )
             {
                 Hashtable params = new Hashtable();
                 params.put( RollerRequest.REFte = null;
     private String category = null;
     private Date startDate = null;
@@ -47,12 +50,13 @@
     {
         super(request, response, mapping);
         rollerRequest = RollerRequest.getRollerRequest(request);
+        this.request = request;
         
         this.website = website;
         
         if (null != categoryId && !categoryId.equals("")) 
         {
-            WeblogManager wmgr = rollerRequest.getRoller().getWeblogManager();
+            WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
             WeblogCategoryData cd = wmgr.retrieveWeblogCategory(categoryId);
             category = cd.getPath();          
         }
@@ -100,7 +104,7 @@
      */
     public List getRecentWeblogEntries() throws RollerException
     {
-        return rollerRequest.getRoller().getWeblogManager().getWeblogEntries(
+        return RollerFactory.getRoller().getWeblogManager().getWeblogEntries(
                     website,
                     startDate,
                     endDateERERID_KEY, referer.getId());
@@ -252,7 +255,9 @@
     {
         try
         {
-            return mRollerReq.isUserAuthorizedToEdit();
+            RollerSession rollerSession = 
+                RollerSession.getRollerSession(mRollerReq.getRequest());
+            return rollerSession.isUserAuthorizedToEdit();
         }
         catch (Exception e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageModel.java Sun Jul 17 18:12:36 2005
@@ -15,6 +15,7 @@
 import org.roller.config.RollerRuntimeConfig;
 import org.roller.model.B,
@@ -111,8 +115,9 @@
 
     public List getCategories() throws Exception
     {
-        List categories = rollerRequest.getRoller().getWeblogManager()
-            .getWeblogCategories(rollerRequest.getCurrentWebsite());
+        RollerSession rollerSession = RollerSession.getRollerSession(request);
+        List categories = RollerFactory.getRoller().getWeblogManager()
+            .getWeblogCategories(rollerSession.getCurrentWebsite());
         return categories;
     }
 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CategoryDeleteForm.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CategoryDeleteForm.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CategoryDeleteForm.java (original)
+++ incubator/roller/branches/roller_2.0/srookmarkManager;
 import org.roller.model.RefererManager;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.BookmarkComparator;
@@ -25,6 +26,7 @@
 import org.roller.pojos.WeblogEntryData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.util.StringUtils;
 
 /**
@@ -85,10 +87,10 @@
         
         try
         {
-            mBookmarkMgr = rreq.getRoller().getBookmarkManager();
-            mRefererMgr  = rreq.getRoller().getRefererManager();
-            mUserMgr     = rreq.getRoller().getUserManager();
-            mWeblogMgr   = rreq.getRoller().getWeblogManager();
+            mBookmarkMgr = RollerFactory.getRoller().getBookmarkManager();
+            mRefererMgr  = RollerFactory.getRoller().getRefererManager();
+            mUserMgr     = RollerFactory.getRoller().getUserManager();
+            mWeblogMgr   = Roc/org/roller/presentation/weblog/formbeans/CategoryDeleteForm.java Sun Jul 17 18:12:36 2005
@@ -3,9 +3,9 @@
  */
 package org.roller.presentation.weblog.formbeans;
 
-import org.apache.struts.action.ActionForm;
-
 import java.util.List;
+
+import org.apache.struts.action.ActionForm;
 
 /**
  * @struts.form name="categoryDeleteForm"

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CommentFormEx.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CommentFormEx.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CommentFormEx.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/CommentFormEx.java Sun Jul 17 18:12:36 2005
@@ -1,13 +1,14 @@
 package org.roller.presentation.weblog.formbeans;
 
+impollerFactory.getRoller().getWeblogManager();
            
             // Preload what we can for encapsulation.  What we cannot preload we
             // will use the Managers later to fetch.
@@ -319,7 +321,7 @@
                 }
             }
             
-            ret = mRollerReq.getRoller().getWeblogManager().getWeblogEntryObjectMap(
+            ret = RollerFactory.getRoller().getWeblogManager().getWeblogEntryObjectMap(
                             mRollerReq.getWebsite(),  
                             null,                     // startDate
                             day,                 // endDate
@@ -409,7 +411,7 @@
                     catParam = null;
                 }
             }
-            WeblogManager mgr = mRollerReq.getRoller().getWeblogManager();
+            WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
             
             //ret = mgr.getRecentWeblogEntriesArray( 
                 //name, day, catParam, maxEntries, true );
@@ -440,6 +442,8 @@
       rt java.util.Locale;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.struts.action.ActionMapping;
 import org.roller.RollerException;
 import org.roller.pojos.CommentData;
 import org.roller.presentation.forms.CommentForm;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-import java.util.Locale;
 
 /**
  * Extends the WeblogEntryForm so that additional properties may be added.

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/ImportEntriesForm.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/ImportEntriesForm.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/ImportEntriesForm.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/  {
             List refs = 
                 mRefererMgr.getReferersToDate(mRollerReq.getWebsite(), date);
+            RollerSession rollerSession = 
+                RollerSession.getRollerSession(mRollerReq.getRequest());
             
             for (Iterator rdItr = refs.iterator(); rdItr.hasNext();) {
                 RefererData referer = (RefererData) rdItr.next();
@@ -449,7 +453,7 @@
                     && StringUtils.isNotEmpty(excerpt) )
                 {
                     if (   referer.getVisible().booleanValue() 
-                        || this.mRollerReq.isUserAuthorizedToEdit() )
+                        || rollerSession.isUserAuthorizedToEdit() )
                     { 
                         referers.add(referer);
                     }
@@ -641,7 +645,9 @@
     {
         try
         {
-            return mRollerReq.isUserAuthorizedToEdit();
+            RollerSession rollerSession = RollerSession.getRollerSession(
+                    mRollerReq.getRequest());
+            returoller/presentation/weblog/formbeans/ImportEntriesForm.java Sun Jul 17 18:12:36 2005
@@ -3,9 +3,9 @@
  */
 package org.roller.presentation.weblog.formbeans;
 
-import org.apache.struts.action.ActionForm;
-
 import java.util.ArrayList;
+
+import org.apache.struts.action.ActionForm;
 
 /**
  * @struts.form name="importEntries"

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogEntryFormEx.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogEntryFormEx.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogEntryFormEx.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogEntryFormEx.java Sun Jul 17 18:12:36 2005
@@ -1,13 +1,5 @@
 package org.roller.presentation.weblogrn rollerSession.isUserAuthorizedToEdit();
         }
         catch (Exception e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PageServlet.java Sun Jul 17 18:12:36 2005
@@ -1,6 +1,13 @@
 
 package org.roller.presentation.velocity;
 
+import java.util.Properties;
+
+import javax.servlet.ServletConfig;
+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;.formbeans;
 
-import org.apache.commons.lang.StringUtils;
-import org.roller.RollerException;
-import org.roller.pojos.CommentData;
-import org.roller.pojos.WeblogEntryData;
-import org.roller.presentation.RollerRequest;
-import org.roller.presentation.forms.WeblogEntryForm;
-import org.roller.util.DateUtil;
-
 import java.sql.Timestamp;
 import java.text.DateFormat;
 import java.text.ParseException;
@@ -21,7 +13,16 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.lang.StringUtils;
+import org.roller.RollerException;
+import org.roller.pojos.CommentData;
 import org.roller.pojos.EntryAttributeData;
+import org.roller.pojos.WeblogEntryData;
+import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
+import org.roller.presentation.forms.WeblogEntryForm;
+import org.roller.util.DateUtil;
 
 /**
  * Extends the WeblogEntryForm so that additional properties may be added.
@@ -62,10 +63,10 @@
     publ
 import org.apache.velocity.Template;
@@ -8,13 +15,6 @@
 import org.apache.velocity.context.Context;
 import org.apache.velocity.exception.ParseErrorException;
 import org.apache.velocity.exception.ResourceNotFoundException;
-
-import java.util.Properties;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 
 
 /**

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetFeedServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetFeedServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetFeedServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetFeedServlet.java Sun Jul 17ic void initNew(HttpServletRequest request, HttpServletResponse response) 
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        if (rreq.getCurrentWebsite().getDefaultPlugins() != null)
+        if (RollerSession.getRollerSession(request).getCurrentWebsite().getDefaultPlugins() != null)
         {
             setPluginsArray(StringUtils.split(
-                    rreq.getCurrentWebsite().getDefaultPlugins(), ",") );
+                    RollerSession.getRollerSession(request).getCurrentWebsite().getDefaultPlugins(), ",") );
         }
         allowComments = Boolean.TRUE;
         updateTime = new Timestamp(new Date().getTime());

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogQueryForm.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogQueryForm.java?rev=219437&r1=219436&r2=219437&view=diff
======================================================== 18:12:36 2005
@@ -1 +1 @@
-package org.roller.presentation.velocity;
import java.io.IOException;
import java.util.Date;

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.velocity.Template;
import org.apache.velocity.context.Context;
import org.apache.velocity.servlet.VelocityServlet;
import org.roller.RollerException;
import org.roller.model.PlanetManager;
import org.roller.presentation.RollerRequest;
import org.roller.util.Utilities;

/////////////////////////////////////////////////////////////////////////////
/**
 * Planet Roller (i.e. NOT for Planet Tool) RSS feed. 
 * @author David M Johnson
 * @web.servlet name="PlanetFeedServlet"
 * @web.servlet-mapping url-pattern="/planetrss/*"
 */
public class PlanetFeedServlet extends VelocityServlet
{
    private static Log mLogger = 
        LogFactory.getFactory().getInstance(R======================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogQueryForm.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/formbeans/WeblogQueryForm.java Sun Jul 17 18:12:36 2005
@@ -3,13 +3,13 @@
  */
 package org.roller.presentation.weblog.formbeans;
 
-import org.apache.struts.action.ActionMapping;
-
 import java.text.DateFormat;
 import java.util.Calendar;
 import java.util.Date;
 
 import javax.servlet.ServletRequest;
+
+import org.apache.struts.action.ActionMapping;
 
 /**
  * Form allows user to set Weblog Entry query and export parameters.

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/ApplyPluginsTag.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/ApplyPluginsTag.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/ollerRequest.class);
    
    public Template handleRequest(HttpServletRequest request,
                                  HttpServletResponse response, Context context)
    {
        RollerRequest rreq = null;
        try
        {
            rreq = RollerRequest.getRollerRequest(request, getServletContext());
        }
        catch (RollerException e)
        {
            // An error initializing the request is considered to be a 404
            if (mLogger.isDebugEnabled())
            {
                mLogger.debug("RollerRequest threw Exception", e);
            }
            try
            {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }
            catch (IOException e1)
            {
                if (mLogger.isDebugEnabled())
                {
                    mLogger.debug("IOException sending error", e);
                }
            }
            return null;
        }
        try
        {
            response.setContentType("application/rss+xml;charsroller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/ApplyPluginsTag.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/ApplyPluginsTag.java Sun Jul 17 18:12:36 2005
@@ -3,19 +3,19 @@
  */
 package org.roller.presentation.weblog.tags;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts.util.RequestUtils;
-import org.roller.pojos.WeblogEntryData;
-import org.roller.presentation.velocity.PageHelper;
-import org.roller.util.Utilities;
-
 import java.io.IOException;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.JspException;
 import javax.servlet.jsp.tagext.TagSupport;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts.util.RequestUtils;
+import org.roller.pojos.WeblogEntryData;
+import org.roller.presentation.velocity.PageHelper;
+import org.roller.utilet=utf-8");
            PlanetManager planet = 
                rreq.getRoller().getPlanetManager();
            if (request.getParameter("group") != null) 
            {
                context.put("groupName", request.getParameter("group"));
            }
            context.put("planet", planet);
            context.put("date", new Date());
            context.put("utilities", new Utilities());
            return getTemplate("planetrss.vm");
        }
        catch (Exception e)
        {
            mLogger.error("ERROR in PlanetFeedServlet", e);
        }
        return null;
    }

    //------------------------------------------------------------------------
    /**
     * Handle error in Velocity processing.
     */
    protected void error( HttpServletRequest req, HttpServletResponse res,
        Exception e) throws ServletException, IOException
    {
        mLogger.warn("ERROR in PlanetFeedServlet",e);
    }
}

\ No newline at end of file
+package org.roller.presentation.velocity;
import java.io.I.Utilities;
 
 /**
  * Apply configured PagePlugins to WeblogEntryData and display the result.

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/BigWeblogCalendarModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/BigWeblogCalendarModel.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/BigWeblogCalendarModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/BigWeblogCalendarModel.java Sun Jul 17 18:12:36 2005
@@ -1,21 +1,22 @@
 package org.roller.presentation.weblog.tags;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logOException;
import java.util.Date;

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.velocity.Template;
import org.apache.velocity.context.Context;
import org.apache.velocity.servlet.VelocityServlet;
import org.roller.RollerException;
import org.roller.model.PlanetManager;
import org.roller.model.RollerFactory;
import org.roller.presentation.RollerRequest;
import org.roller.util.Utilities;

/////////////////////////////////////////////////////////////////////////////
/**
 * Planet Roller (i.e. NOT for Planet Tool) RSS feed. 
 * @author David M Johnson
 * @web.servlet name="PlanetFeedServlet"
 * @web.servlet-mapping url-pattern="/planetrss/*"
 */
public class PlanetFeedServlet extends VelocityServlet
{
    private static Log mLogger = 
        LogFactory.getFactory().getInstance(RollerRequest.class);
    
    public Template hging.LogFactory;
 import org.roller.RollerException;
+import org.roller.model.RollerFactory;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.WeblogEntryData;
 import org.roller.presentation.RollerContext;
 import org.roller.presentation.RollerRequest;
 import org.roller.util.DateUtil;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.servlet.http.HttpServletResponse;
-
 /**
  * Model for big calendar that displays titles for each day.
  * @author David M Johnson
@@ -51,7 +52,7 @@
     {
         try
         {
-            WeblogManager mgr = mRollerReq.getRoller().getWeblogManager();
+            WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
             mMonthMap = mgr.getWeblogEntryObjectMap(
                             mRollerReq.getWebsite(), // userName
                             startDate,              // startDate

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentaandleRequest(HttpServletRequest request,
                                  HttpServletResponse response, Context context)
    {
        RollerRequest rreq = null;
        try
        {
            rreq = RollerRequest.getRollerRequest(request, getServletContext());
        }
        catch (RollerException e)
        {
            // An error initializing the request is considered to be a 404
            if (mLogger.isDebugEnabled())
            {
                mLogger.debug("RollerRequest threw Exception", e);
            }
            try
            {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
            }
            catch (IOException e1)
            {
                if (mLogger.isDebugEnabled())
                {
                    mLogger.debug("IOException sending error", e);
                }
            }
            return null;
        }
        try
        {
            response.setContentType("application/rss+xml;charset=utf-8");
            PlanetManager planet = tion/weblog/tags/EditWeblogCalendarModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/EditWeblogCalendarModel.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/EditWeblogCalendarModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/EditWeblogCalendarModel.java Sun Jul 17 18:12:36 2005
@@ -1,15 +1,11 @@
 
 package org.roller.presentation.weblog.tags;
 
-import org.roller.model.WeblogManager;
+import javax.servlet.http.HttpServletResponse;
+
 import org.roller.presentation.RollerRequest;
 import org.roller.presentation.tags.menu.RollerMenuModel;
 import org.roller.util.DateUtil;
-
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.servlet.http.HttpServletResponse;
 
 /** 
  * Calendar model for calendar intended for use on
                RollerFactory.getRoller().getPlanetManager();
            if (request.getParameter("group") != null) 
            {
                context.put("groupName", request.getParameter("group"));
            }
            context.put("planet", planet);
            context.put("date", new Date());
            context.put("utilities", new Utilities());
            return getTemplate("planetrss.vm");
        }
        catch (Exception e)
        {
            mLogger.error("ERROR in PlanetFeedServlet", e);
        }
        return null;
    }

    //------------------------------------------------------------------------
    /**
     * Handle error in Velocity processing.
     */
    protected void error( HttpServletRequest req, HttpServletResponse res,
        Exception e) throws ServletException, IOException
    {
        mLogger.warn("ERROR in PlanetFeedServlet",e);
    }
}

\ No newline at end of file

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetPageMo edit-weblog page.

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/WeblogCalendarModel.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/WeblogCalendarModel.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/WeblogCalendarModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/WeblogCalendarModel.java Sun Jul 17 18:12:36 2005
@@ -1,14 +1,6 @@
 
 package org.roller.presentation.weblog.tags;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.roller.RollerException;
-import org.roller.model.WeblogManager;
-import org.roller.presentation.RollerRequest;
-import org.roller.presentation.tags.calendar.CalendarModel;
-import org.roller.util.DateUtil;
-
 import java.del.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetPageModel.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetPageModel.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PlanetPageModel.java Sun Jul 17 18:12:36 2005
@@ -2,12 +2,12 @@
 package org.roller.presentation.velocity;
 import java.util.ArrayList;
 import java.util.List;
+
 import org.roller.model.PlanetManager;
-import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.PlanetGroupData;
 import org.roller.pojos.PlanetSubscriptionData;
 import org.roller.presentation.RollerRequest;
-import org.roller.presentation.velocity.PageModel;
 
 /**
  * Allow Roller page templates to get the main Planet aggregation (the 'all'
@@ -23,7 +23,7 @@
         text.ParsePosition;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
@@ -19,6 +11,15 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.roller.RollerException;
+import org.roller.model.RollerFactory;
+import org.roller.model.WeblogManager;
+import org.roller.presentation.RollerRequest;
+import org.roller.presentation.tags.calendar.CalendarModel;
+import org.roller.util.DateUtil;
+
 /** 
  * Calendar model for calendar intended for use on view-weblog page.
  */
@@ -113,7 +114,7 @@
     {
         try
         {
-            WeblogManager mgr = mRollerReq.getRoller().getWeblogManager();
+            WeblogManager mgr = RollerFactory.getRoller().getWeblogManager();
             mMonthMap = mgr.getWeblogEntryStringMap(
                             mRollerReq.getWebsite(), // userName
                             startDate,              // startDate

Modsuper.init(rreq);
         try 
         {
-            planetManager = rreq.getRoller().getPlanetManager();
+            planetManager = RollerFactory.getRoller().getPlanetManager();
         }
         catch (Exception e)
         {

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewResourceLoader.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewResourceLoader.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewResourceLoader.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewResourceLoader.java Sun Jul 17 18:12:36 2005
@@ -1,5 +1,8 @@
 package org.roller.presentation.velocity;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
 import org.apache.commons.collections.Extendified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/CommonPingTargetsAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/CommonPingTargetsAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/CommonPingTargetsAction.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/CommonPingTargetsAction.java Sun Jul 17 18:12:36 2005
@@ -8,17 +8,19 @@
 
 package org.roller.presentation.website.actions;
 
+import java.util.List;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.roller.RollerException;
 import org.roller.model.PingTargetManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.PingTargetData;
 import org.roller.presentation.edProperties;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -8,9 +11,6 @@
 import org.apache.velocity.runtime.resource.Resource;
 import org.apache.velocity.runtime.resource.loader.ResourceLoader;
 import org.roller.util.LRUCache2;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
 
 /**
  * This is a simple template file loader that loads 

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/PreviewServlet.java Sun Jul 17 18:12:36 2005
@@ -1,11 +1,11 @@
 
 package orgRollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.forms.PingTargetForm;
 import org.roller.presentation.weblog.actions.BasePingTargetsAction;
 
-import java.util.List;
-
 /**
  * Administer common ping targets.
  *
@@ -42,7 +44,7 @@
      */
     protected List getPingTargets(RollerRequest rreq) throws RollerException
     {
-        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
         return pingTargetMgr.getCommonPingTargets();
     }
 
@@ -52,7 +54,7 @@
     protected PingTargetData createPingTarget(RollerRequest rreq, PingTargetForm pingTargetForm)
         throws RollerException
     {
-        PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
+        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
         return pingTargetMgr.createCommonPingTarget(
             pingTargetForm.roller.presentation.velocity;
 
-import org.apache.velocity.Template;
-import org.apache.velocity.context.Context;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.context.Context;
 
 /**
  * Extend RollerServlet to load proper resource loader for page execution.

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/RollerResourceLoader.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/RollerResourceLoader.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/RollerResourceLoader.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/RollerResourceLoader.java Sun Jul 17 18:12:36 2005
@@ -1,5 +1,9 @@
 package org.roll.getName(), pingTargetForm.getPingUrl());
     }
@@ -64,6 +66,7 @@
     protected boolean hasRequiredRights(RollerRequest rreq) throws RollerException
     {
         // This mimics the check in other admin actions, but not sure why the latter is not sufficient.
-        return (rreq.isUserAuthorizedToEdit() && rreq.isAdminUser());
+        RollerSession rollerSession = RollerSession.getRollerSession(rreq.getRequest());
+        return (rollerSession.isUserAuthorizedToEdit() && rollerSession.isAdminUser());
     }
 }

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MaintenanceAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MaintenanceAction.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MaintenanceAction.java (original)
+++ incuer.presentation.velocity;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+
 import org.apache.commons.collections.ExtendedProperties;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -10,10 +14,6 @@
 import org.roller.model.Roller;
 import org.roller.pojos.PageData;
 import org.roller.presentation.RollerContext;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
 
 /**
  * This is a simple template file loader that loads templates

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/SearchServlet.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/SearchServlet.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentabator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MaintenanceAction.java Sun Jul 17 18:12:36 2005
@@ -22,8 +22,9 @@
 import org.apache.struts.actions.DispatchAction;
 import org.roller.RollerException;
 import org.roller.model.IndexManager;
+import org.roller.model.RollerFactory;
 import org.roller.pojos.WebsiteData;
-import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.pagecache.PageCacheFilter;
 
 /**
@@ -70,11 +71,11 @@
 	{
 		try
 		{
-			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+			if (rollerSession.isUserAuthorizedToEdit() )
 			{
-				WebsiteData website = rreq.getCurrentWebsite();
-				IndexManager manager = rreq.getRoller().getIndexManager();
+				WebsiteData website = RollerSession.getRollerSession(request).getCurrentWebsite();
+				IndexManager manager = Roltion/velocity/SearchServlet.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/SearchServlet.java Sun Jul 17 18:12:36 2005
@@ -26,6 +26,7 @@
 import org.roller.business.search.operations.SearchOperation;
 import org.roller.model.IndexManager;
 import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
 import org.roller.model.UserManager;
 import org.roller.model.WeblogManager;
 import org.roller.pojos.WeblogCategoryData;
@@ -97,7 +98,7 @@
             RollerRequest rreq = getRollerRequest(request, response);
             
             SearchOperation search = 
-                new SearchOperation(rreq.getRoller().getIndexManager());
+                new SearchOperation(RollerFactory.getRoller().getIndexManager());
             search.setTerm(request.getParameter("q"));
             ctx.put("term", request.getParameter("q"));
 
@@ -115,7 +116,7 @@
             }
 
             // execute search
-            executeSearch(rreq.getRoller(), search);
+     lerFactory.getRoller().getIndexManager();
 				manager.rebuildWebsiteIndex(website);
 				
                 ActionMessages messages = new ActionMessages();
@@ -108,10 +109,10 @@
     {
         try
         {
-			RollerRequest rreq = RollerRequest.getRollerRequest(request);
-			if ( rreq.isUserAuthorizedToEdit() )
+            RollerSession rollerSession = RollerSession.getRollerSession(request);
+			if ( rollerSession.isUserAuthorizedToEdit() )
 			{
-	            PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
+	            PageCacheFilter.removeFromCache(request, RollerSession.getRollerSession(request).getCurrentWebsite());
 
                  ActionMessages messages = new ActionMessages();
                  messages.add(null, new ActionMessage("maintenance.message.flushed"));



       executeSearch(RollerFactory.getRoller(), search);
 
             Map searchResults = new TreeMap();
             if (search.getResultsCount() == -1)

Modified: incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/VelocityPageInsert.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/VelocityPageInsert.java?rev=219437&r1=219436&r2=219437&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/VelocityPageInsert.java (original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/VelocityPageInsert.java Sun Jul 17 18:12:36 2005
@@ -2,6 +2,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import org.apache.velocity.VelocityContext;
 import org.roller.pojos.PageData;
 



Mime
View raw message