roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r219080 - in /incubator/roller/branches/roller_2.0: src/org/roller/presentation/ src/org/roller/presentation/bookmarks/actions/ src/org/roller/presentation/weblog/actions/ src/org/roller/presentation/weblog/formbeans/ src/org/roller/present...
Date Thu, 14 Jul 2005 19:35:11 GMT
Author: snoopdave
Date: Thu Jul 14 12:35:08 2005
New Revision: 219080

URL: http://svn.apache.org/viewcvs?rev=219080&view=rev
Log:
Most of the UI unit tests are now running.

Modified:
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/RollerRequest.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/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/WeblogEntryFormEx.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/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/WebsiteFormAction.java
    incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/FileManagerTag.java
    incubator/roller/branches/roller_2.0/tests/org/roller/presentation/StrutsActionTestBase.java
    incubator/roller/branches/roller_2.0/tests/org/roller/presentation/TestAll.java
    incubator/roller/branches/roller_2.0/tests/org/roller/presentation/bookmarks/BookmarksActionTest.java
    incubator/roller/branches/roller_2.0/tests/org/roller/presentation/weblog/WeblogEntryActionTest.java

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=219080&r1=219079&r2=219080&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 Thu
Jul 14 12:35:08 2005
@@ -726,7 +726,7 @@
     {
         return mRequest.getHeader("referer");
     }
-    
+     
     /**
      * Gets the WebsiteData specified in the path info of the request URI, this is 
      * NOT the same thing as the "current website" (i.e. the one that the session's 

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=219080&r1=219079&r2=219080&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/BookmarksAction.java
Thu Jul 14 12:35:08 2005
@@ -27,6 +27,7 @@
 import org.roller.pojos.FolderData;
 import org.roller.pojos.WebsiteData;
 import org.roller.presentation.RollerRequest;
+import org.roller.presentation.RollerSession;
 import org.roller.presentation.bookmarks.formbeans.BookmarksForm;
 
 /**
@@ -215,7 +216,9 @@
         throws RollerException
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        WebsiteData wd = rreq.getWebsite();
+        //WebsiteData wd = rreq.getWebsite();
+        RollerSession rollerSession = RollerSession.getRollerSession(request);
+        WebsiteData wd = rollerSession.getCurrentWebsite();
         BookmarkManager bmgr = rreq.getRoller().getBookmarkManager();
 
         TreeSet allFolders = new TreeSet(new FolderPathComparator());

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -152,7 +152,7 @@
         throws RollerException
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        WebsiteData wd = rreq.getWebsite();
+        WebsiteData wd = rreq.getCurrentWebsite();
         WeblogManager wmgr = rreq.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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -54,7 +54,7 @@
             if (form.isDelete() == null)
             {
                 // Present CategoryDeleteOK? page to user
-                WebsiteData website = rreq.getWebsite();
+                WebsiteData website = rreq.getCurrentWebsite();
                 WeblogCategoryData theCat = wmgr.retrieveWeblogCategory(catid);
                 Iterator allCats = 
                     wmgr.getWeblogCategories(website).iterator();

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=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryEditAction.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/CategoryEditAction.java
Thu Jul 14 12:35:08 2005
@@ -34,7 +34,7 @@
         throws Exception
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        WebsiteData wd = rreq.getWebsite();
+        WebsiteData wd = rreq.getCurrentWebsite();
         WeblogManager wmgr = rreq.getRoller().getWeblogManager();
         WeblogCategoryFormEx form = (WeblogCategoryFormEx)actionForm;
         

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=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- 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
Thu Jul 14 12:35:08 2005
@@ -51,7 +51,7 @@
             else 
             {
                 cd = wmgr.createWeblogCategory();
-                cd.setWebsite(rreq.getWebsite());
+                cd.setWebsite(rreq.getCurrentWebsite());
                 
                 String parentId = form.getParentId();
                 cd.setParent(wmgr.retrieveWeblogCategory(parentId));

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -58,7 +58,7 @@
         req.setAttribute("allowCustomTargets", allowCustomTargets);
 
         List customPingTargets = allowCustomTargets.booleanValue() ?
-            pingTargetMgr.getCustomPingTargets(rreq.getWebsite()) : Collections.EMPTY_LIST;
+            pingTargetMgr.getCustomPingTargets(rreq.getCurrentWebsite()) : Collections.EMPTY_LIST;
 
         return customPingTargets;
     }
@@ -71,7 +71,7 @@
     {
         PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
         return pingTargetMgr.createCustomPingTarget(
-            pingTargetForm.getName(), pingTargetForm.getPingUrl(), rreq.getWebsite());
+            pingTargetForm.getName(), pingTargetForm.getPingUrl(), rreq.getCurrentWebsite());
     }
 
 

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=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- 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
Thu Jul 14 12:35:08 2005
@@ -156,7 +156,7 @@
                     //System.out.println("Export: got " + entries.size() + " entries.");
                     
                     List entries = weblogMgr.getWeblogEntries(
-                                    rreq.getWebsite(), // userName
+                                    rreq.getCurrentWebsite(), // userName
                                     startDate,         // startDate
                                     endDate,           // endDate
                                     null,              // catName
@@ -169,7 +169,7 @@
                     Map entryMap = seperateByPeriod(entries, form.getFileBy());
 
                     // now export each List in the entryMap
-                    ExportRss exporter = new ExportRss(rreq.getWebsite());
+                    ExportRss exporter = new ExportRss(rreq.getCurrentWebsite());
                     String exportTo = form.getExportFormat().toLowerCase();
                     if ("atom".equals(exportTo))
                     {
@@ -271,7 +271,7 @@
             JspFactory.getDefaultFactory().getPageContext( 
                 this.getServlet(), request, response, "", true, 8192, true);
         Map params = new HashMap();
-        params.put( RollerRequest.WEBSITEHANDLE_KEY,  rreq.getWebsite().getHandle());
+        params.put( RollerRequest.WEBSITEHANDLE_KEY,  rreq.getCurrentWebsite().getHandle());
         params.put("rmik", "Files");
         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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -61,7 +61,7 @@
                 if (StringUtils.isNotEmpty(form.getImportFileName()))
                 {
                     // "default" values
-                    WebsiteData website = rreq.getWebsite();
+                    WebsiteData website = rreq.getCurrentWebsite();
 
                     // load selected file
                     ServletContext app = this.getServlet().getServletConfig().getServletContext();
@@ -147,7 +147,7 @@
     {
 		ServletContext app = this.getServlet().getServletConfig().getServletContext();
 		String dir = RollerContext.getUploadDir( app );
-		File d = new File(dir + rreq.getWebsite().getHandle());
+		File d = new File(dir + rreq.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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -83,7 +83,7 @@
         ActionForward forward = mapping.findForward(PING_SETUP_PAGE);
         RollerRequest rreq = RollerRequest.getRollerRequest(req);
         PingTargetManager pingTargetMgr = rreq.getRoller().getPingTargetManager();
-        WebsiteData website = rreq.getWebsite();
+        WebsiteData website = rreq.getCurrentWebsite();
         try
         {
             if (!isAuthorized(rreq))
@@ -122,7 +122,7 @@
         throws RollerException
     {
         AutoPingManager autoPingMgr = rreq.getRoller().getAutopingManager();
-        WebsiteData website = rreq.getWebsite();
+        WebsiteData website = rreq.getCurrentWebsite();
 
         // Build isEnabled map (keyed by ping target id and values Boolean.TRUE/Boolean.FALSE)
         Map isEnabled = new HashMap();
@@ -171,7 +171,7 @@
                 return mapping.findForward("access-denied");
             }
             PingTargetData pingTarget = select(rreq);
-            AutoPingData autoPing = autoPingMgr.createAutoPing(pingTarget, rreq.getWebsite());
+            AutoPingData autoPing = autoPingMgr.createAutoPing(pingTarget, rreq.getCurrentWebsite());
             autoPingMgr.storeAutoPing(autoPing);
             rreq.getRoller().commit();
 
@@ -200,7 +200,7 @@
                 return mapping.findForward("access-denied");
             }
             PingTargetData pingTarget = select(rreq);
-            autoPingMgr.removeAutoPing(pingTarget, rreq.getWebsite());
+            autoPingMgr.removeAutoPing(pingTarget, rreq.getCurrentWebsite());
             rreq.getRoller().commit();
 
             return view(mapping, form, req, res);
@@ -224,7 +224,7 @@
             RollerRequest rreq = RollerRequest.getRollerRequest(req);
             String absoluteUrl = RollerContext.getRollerContext(req).getAbsoluteContextUrl(req);
             PingTargetData pingTarget = select(rreq);
-            WebsiteData website = rreq.getWebsite();
+            WebsiteData website = rreq.getCurrentWebsite();
             try
             {
                 if (!isAuthorized(rreq))

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -60,12 +60,12 @@
             if ( rreq.isUserAuthorizedToEdit() )
             {   
                 req.setAttribute("pageHits",
-                    new Integer(refmgr.getDayHits(rreq.getWebsite())));
+                    new Integer(refmgr.getDayHits(rreq.getCurrentWebsite())));
                     
                 req.setAttribute("totalHits",
-                    new Integer(refmgr.getTotalHits(rreq.getWebsite())));
+                    new Integer(refmgr.getTotalHits(rreq.getCurrentWebsite())));
                     
-                List refs = refmgr.getTodaysReferers(rreq.getWebsite());
+                List refs = refmgr.getTodaysReferers(rreq.getCurrentWebsite());
                 req.setAttribute("referers",refs);        
             }
         }
@@ -90,7 +90,7 @@
             if ( rreq.isUserAuthorizedToEdit() )
             {
                 RefererManager refmgr = rreq.getRoller().getRefererManager();
-                WebsiteData website = rreq.getWebsite();
+                WebsiteData website = rreq.getCurrentWebsite();
                 refmgr.forceTurnover(website.getId());
                 rreq.getRoller().commit();
             }
@@ -116,7 +116,7 @@
             if ( rreq.isUserAuthorizedToEdit() )
             {
                 RefererManager refmgr = rreq.getRoller().getRefererManager();
-                WebsiteData website = rreq.getWebsite();
+                WebsiteData website = rreq.getCurrentWebsite();
 
                 String[] deleteIds = req.getParameterValues("id");
                 if (deleteIds != null)

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -53,7 +53,7 @@
                     
                     rreq.getRoller().commit();
                     
-                    PageCacheFilter.removeFromCache( req, rreq.getWebsite() );
+                    PageCacheFilter.removeFromCache( req, rreq.getCurrentWebsite() );
                 }                
             }
         }
@@ -69,7 +69,7 @@
 		{
 			RollerContext rctx = RollerContext.getRollerContext(
 				rreq.getServletContext());
-			url = rctx.getContextUrl( req, rreq.getWebsite());
+			url = rctx.getContextUrl( req, rreq.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=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- 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
Thu Jul 14 12:35:08 2005
@@ -236,7 +236,7 @@
                 UserManager userMgr = rreq.getRoller().getUserManager();
                 WeblogManager weblogMgr = rreq.getRoller().getWeblogManager();
 
-                WebsiteData site = rreq.getWebsite();
+                WebsiteData site = rreq.getCurrentWebsite();
                 WeblogEntryFormEx wf = (WeblogEntryFormEx)actionForm;
                 
                 // I was getting column 'x' cannot be null, so I fixed it here.
@@ -303,7 +303,7 @@
                  
                 // Flush the page cache
                 mLogger.debug("Removing from cache");
-                PageCacheFilter.removeFromCache(request, rreq.getWebsite());
+                PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
 				// refresh the front page cache
                 MainPageAction.flushMainPageCache();
 
@@ -464,7 +464,7 @@
                 WeblogEntryData wd = mgr.retrieveWeblogEntry(request.getParameter("id"));
                 
                 // Flush the page cache
-                PageCacheFilter.removeFromCache(request, rreq.getWebsite());
+                PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
 
 				// remove the index for it
                 wd.setPublishEntry(Boolean.FALSE);

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=219080&r1=219079&r2=219080&view=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
Thu Jul 14 12:35:08 2005
@@ -110,7 +110,7 @@
     {
         return rollerRequest.getRoller().getWeblogManager()
             .getWeblogEntries(
-                rollerRequest.getWebsite(), // userName
+                rollerRequest.getCurrentWebsite(), // userName
                 null,              // startDate
                 null,              // endDate
                 null,              // catName
@@ -128,7 +128,7 @@
     {
         return rollerRequest.getRoller().getWeblogManager()
             .getWeblogEntries(
-                rollerRequest.getWebsite(), 
+                rollerRequest.getCurrentWebsite(), 
                 null,              // startDate
                 null,              // endDate
                 null,              // catName
@@ -170,7 +170,7 @@
     {
         // Select editor page selected by user (simple text editor,
         // DHTML editor, Ekit Java applet, etc.
-        String editorPage = rollerRequest.getWebsite().getEditorPage();
+        String editorPage = rollerRequest.getCurrentWebsite().getEditorPage();
         if (StringUtils.isEmpty( editorPage ))
         {
             editorPage = "editor-text.jsp";
@@ -198,7 +198,7 @@
     public List getCategories() throws Exception
     {
         return rollerRequest.getRoller().getWeblogManager()
-            .getWeblogCategories(rollerRequest.getWebsite(), false);
+            .getWeblogCategories(rollerRequest.getCurrentWebsite(), false);
     }
 
     public List getComments() throws Exception
@@ -218,7 +218,7 @@
             weblogEntry = new WeblogEntryData();
             form.copyTo(weblogEntry, 
                     getRequest().getLocale(), getRequest().getParameterMap());
-            weblogEntry.setWebsite(rollerRequest.getWebsite());
+            weblogEntry.setWebsite(rollerRequest.getCurrentWebsite());
         }
         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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -50,7 +50,7 @@
            request, 
            response, 
            mapping,
-           rreq.getWebsite(),
+           rreq.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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -112,7 +112,7 @@
     public List getCategories() throws Exception
     {
         List categories = rollerRequest.getRoller().getWeblogManager()
-            .getWeblogCategories(rollerRequest.getWebsite());
+            .getWeblogCategories(rollerRequest.getCurrentWebsite());
         return categories;
     }
 

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -61,10 +61,10 @@
     public void initNew(HttpServletRequest request, HttpServletResponse response) 
     {
         RollerRequest rreq = RollerRequest.getRollerRequest(request);
-        if (rreq.getWebsite().getDefaultPlugins() != null)
+        if (rreq.getCurrentWebsite().getDefaultPlugins() != null)
         {
             setPluginsArray(StringUtils.split(
-                    rreq.getWebsite().getDefaultPlugins(), ",") );
+                    rreq.getCurrentWebsite().getDefaultPlugins(), ",") );
         }
         allowComments = Boolean.TRUE;
         updateTime = new Timestamp(new Date().getTime());

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=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MaintenanceAction.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/MaintenanceAction.java
Thu Jul 14 12:35:08 2005
@@ -73,7 +73,7 @@
 			RollerRequest rreq = RollerRequest.getRollerRequest(request);
 			if ( rreq.isUserAuthorizedToEdit() )
 			{
-				WebsiteData website = rreq.getWebsite();
+				WebsiteData website = rreq.getCurrentWebsite();
 				IndexManager manager = rreq.getRoller().getIndexManager();
 				manager.rebuildWebsiteIndex(website);
 				
@@ -111,7 +111,7 @@
 			RollerRequest rreq = RollerRequest.getRollerRequest(request);
 			if ( rreq.isUserAuthorizedToEdit() )
 			{
-	            PageCacheFilter.removeFromCache(request, rreq.getWebsite());
+	            PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
 
                  ActionMessages messages = new ActionMessages();
                  messages.add(null, new ActionMessage("maintenance.message.flushed"));

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -62,7 +62,7 @@
                 PageForm form = (PageForm)actionForm;
                 PageData data = new PageData();
                 form.copyTo(data, request.getLocale());
-                WebsiteData hd = rreq.getWebsite();
+                WebsiteData hd = rreq.getCurrentWebsite();
 
                 data.setWebsite( hd );
                 data.setUpdateTime( new java.util.Date() );
@@ -80,7 +80,7 @@
                                 data.getName()));
                 saveMessages(request, uiMessages);
                 
-                PageCacheFilter.removeFromCache( request, rreq.getWebsite() );
+                PageCacheFilter.removeFromCache( request, rreq.getCurrentWebsite() );
                     
                 actionForm.reset(mapping,request);                
                 
@@ -117,7 +117,7 @@
                 PageForm pf = (PageForm)actionForm;
                 pf.copyFrom(pd, request.getLocale());
 
-                PageCacheFilter.removeFromCache( request, rreq.getWebsite() );
+                PageCacheFilter.removeFromCache( request, rreq.getCurrentWebsite() );
                 
                 addModelObjects(rreq);
             }
@@ -185,7 +185,7 @@
                 mgr.removePageSafely( data.getId() );
                 rreq.getRoller().commit();
 
-                PageCacheFilter.removeFromCache( request, rreq.getWebsite() );
+                PageCacheFilter.removeFromCache( request, rreq.getCurrentWebsite() );
                     
                 addModelObjects(rreq);
 
@@ -265,7 +265,7 @@
                 data.save(); // should through exception if no save permission
                 form.copyTo(data, request.getLocale());
                 data.setUpdateTime( new java.util.Date() );
-                data.setWebsite( rreq.getWebsite() );
+                data.setWebsite( rreq.getCurrentWebsite() );
 
                 validateLink( data );
 
@@ -281,7 +281,7 @@
                                 data.getName()));
                 saveMessages(request, uiMessages);
 
-                PageCacheFilter.removeFromCache(request, rreq.getWebsite());
+                PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
             }
             else
             {
@@ -358,7 +358,7 @@
         UserData user = rreq.getAuthenticatedUser();
         request.setAttribute("user",user);
 
-        WebsiteData wd = rreq.getWebsite();
+        WebsiteData wd = rreq.getCurrentWebsite();
         request.setAttribute("website", wd);
 
         List pages = mgr.getPages(wd);

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -208,7 +208,7 @@
 				// will be able to find it
 				PageData page = getDefaultPage( rreq );			
 				PreviewResourceLoader.setTemplate(page.getId(), 
-					teForm.getThemeTemplate(), rreq.getWebsite().getHandle() );
+					teForm.getThemeTemplate(), rreq.getCurrentWebsite().getHandle() );
 				
 				// save the template in session for later editing
 				session.setAttribute(SESSION_TEMPLATE,
@@ -260,7 +260,7 @@
                  RollerContext rollerContext = 
                                 RollerContext.getRollerContext( ctx );
                  
-                 WebsiteData website = rreq.getWebsite();
+                 WebsiteData website = rreq.getCurrentWebsite();
                 	
 				// load the template either from the Form
 				// or from the disk (if its a stock Theme).
@@ -294,7 +294,7 @@
                 setThemePages(rreq, theme);
 
 				// clear the page cache
-				PageCacheFilter.removeFromCache(request, rreq.getWebsite());
+				PageCacheFilter.removeFromCache(request, rreq.getCurrentWebsite());
 				teForm.setThemeName("Custom");
 			}
 			else
@@ -336,7 +336,7 @@
 			if ( rreq.isUserAuthorizedToEdit() )
 			{
 				// clear the page cache
-				WebsiteData website = rreq.getWebsite();
+				WebsiteData website = rreq.getCurrentWebsite();
 				PageCacheFilter.removeFromCache( request, website );
                  ThemeEditorForm teForm = (ThemeEditorForm)form;
 								
@@ -418,7 +418,7 @@
 		try
 		{
 			UserManager mgr = rreq.getRoller().getUserManager();
-			WebsiteData wd = rreq.getWebsite();
+			WebsiteData wd = rreq.getCurrentWebsite();
 			String defaultPageId = wd.getDefaultPageId();
 			return mgr.retrievePage( defaultPageId );
 		}
@@ -453,7 +453,7 @@
                 UserManager umgr = rreq.getRoller().getUserManager();
                 WebsiteData website = rreq.getCurrentWebsite();
                 String handle = website.getHandle();
-                PageData page = umgr.getPageByName( rreq.getWebsite(), pageName );
+                PageData page = umgr.getPageByName( rreq.getCurrentWebsite(), pageName );
                 if (page != null)
                 {
                     PreviewResourceLoader.setTemplate(page.getId(),sb, handle);
@@ -509,7 +509,7 @@
                 String pageName = children[i].substring(
                     0,children[i].length()-3);
     
-                PageData page = mgr.getPageByName(rreq.getWebsite(), pageName);
+                PageData page = mgr.getPageByName(rreq.getCurrentWebsite(), pageName);
                 if (page != null)
                 {
                     PreviewResourceLoader.clearTemplate( page.getId() );
@@ -549,7 +549,7 @@
         try
         {
             UserManager mgr = rreq.getRoller().getUserManager();
-            WebsiteData website = rreq.getWebsite();
+            WebsiteData website = rreq.getCurrentWebsite();
         
             HashMap pages = rollerContext.readThemeMacros(theme);
             Iterator iter = pages.keySet().iterator();
@@ -558,7 +558,7 @@
                 String pageName = (String) iter.next();
                 String pageContent = (String)pages.get( pageName );
     
-                PageData page = mgr.getPageByName( rreq.getWebsite(), pageName );
+                PageData page = mgr.getPageByName( rreq.getCurrentWebsite(), pageName );
                 if (page != null)
                 {
                     // User already has page by that name, so overwrite it.

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -62,7 +62,7 @@
             {
                 return mapping.findForward("access-denied");
             }
-            website = rreq.getWebsite();
+            website = rreq.getCurrentWebsite();
         }
         catch (Exception e)
         {
@@ -163,7 +163,7 @@
         try
         {
             FileManager fmgr = rreq.getRoller().getFileManager();
-            WebsiteData website = rreq.getWebsite();
+            WebsiteData website = rreq.getCurrentWebsite();
             String[] deleteFiles = theForm.getDeleteFiles();
             for (int i=0; i<deleteFiles.length; i++)
             {

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=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java
(original)
+++ incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/actions/WebsiteFormAction.java
Thu Jul 14 12:35:08 2005
@@ -75,19 +75,19 @@
                 UserData ud = rreq.getAuthenticatedUser();
                 request.setAttribute("user",ud);
 
-                WebsiteData hd = rreq.getWebsite();
+                WebsiteData hd = rreq.getCurrentWebsite();
                 WebsiteForm wf = (WebsiteFormEx)actionForm;
                 wf.copyFrom(hd, request.getLocale());
 
                 List cd = rreq.getRoller().getWeblogManager()
-                   .getWeblogCategories(rreq.getWebsite(), true);
+                   .getWeblogCategories(rreq.getCurrentWebsite(), true);
                 request.setAttribute("categories",cd);
 
                 List bcd = rreq.getRoller().getWeblogManager()
-                    .getWeblogCategories(rreq.getWebsite(), true);
+                    .getWeblogCategories(rreq.getCurrentWebsite(), true);
                 request.setAttribute("bloggerCategories",bcd);
 
-                List pages = rreq.getRoller().getUserManager().getPages(rreq.getWebsite());
+                List pages = rreq.getRoller().getUserManager().getPages(rreq.getCurrentWebsite());
                 request.setAttribute("pages",pages);
 
                 ServletContext ctx = request.getSession().getServletContext();

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=219080&r1=219079&r2=219080&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
Thu Jul 14 12:35:08 2005
@@ -87,7 +87,7 @@
                     // to PRIMARY
                     java.text.Collator locCollator =
                         java.text.Collator.getInstance(
-                            rreq.getWebsite().getLocaleInstance());
+                            rreq.getCurrentWebsite().getLocaleInstance());
                     locCollator.setStrength(Collator.PRIMARY);
                     java.util.Arrays.sort(files, locCollator);
 

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/presentation/StrutsActionTestBase.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/presentation/StrutsActionTestBase.java?rev=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/presentation/StrutsActionTestBase.java
(original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/presentation/StrutsActionTestBase.java
Thu Jul 14 12:35:08 2005
@@ -2,8 +2,13 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpSession;
 
+import org.roller.RollerException;
 import org.roller.RollerTestBase;
+import org.roller.model.UserManager;
+import org.roller.pojos.UserData;
+import org.roller.pojos.WebsiteData;
 import org.roller.presentation.filters.PersistenceSessionFilter;
 import org.roller.presentation.filters.RequestFilter;
 
@@ -42,12 +47,21 @@
         rollerContext = new MockRollerContext();
         rollerContext.init(ctx);
     }
-    protected void authenticateUser(String username, String role)
+    protected void authenticateUser(String username, String role) 
+        throws RollerException
     {
         MockHttpServletRequest mockRequest = getMockFactory().getMockRequest();
         mockRequest.setRemoteUser(username);
         mockRequest.setUserPrincipal(new MockPrincipal(username));
         mockRequest.setUserInRole(role, true);
+        
+        HttpSession session = mockRequest.getSession(true);        
+        RollerSession rollerSession = new RollerSession();
+        UserManager umgr = getRoller().getUserManager();
+        UserData user = umgr.getUser(username);
+        WebsiteData website = (WebsiteData)umgr.getWebsites(user, null).get(0); 
+        rollerSession.setCurrentWebsite(website);
+        session.setAttribute(RollerSession.ROLLER_SESSION, rollerSession);
     }
     
     protected void doFilters()

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/presentation/TestAll.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/presentation/TestAll.java?rev=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/presentation/TestAll.java (original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/presentation/TestAll.java Thu Jul
14 12:35:08 2005
@@ -27,14 +27,14 @@
     public static Test suite()
     {
         TestSuite suite = new TestSuite();
+        suite.addTest(BookmarksActionTest.suite());
+        suite.addTest(WeblogEntryActionTest.suite());
         suite.addTest(BlacklistTest.suite());
         suite.addTest(DateTest.suite());
-        suite.addTest(BookmarksActionTest.suite());
         suite.addTest(RequestFilterTest.suite());
         suite.addTest(SearchServletTest.suite());
         suite.addTest(SmileysTest.suite());
         suite.addTest(TextileTest.suite());
-        suite.addTest(WeblogEntryActionTest.suite());
         suite.addTest(RollerXmlRpcServerTest.suite());
         suite.addTest(LinkbackExtractorTest.suite());
         suite.addTest(LRUCache2Test.suite());

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/presentation/bookmarks/BookmarksActionTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/presentation/bookmarks/BookmarksActionTest.java?rev=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/presentation/bookmarks/BookmarksActionTest.java
(original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/presentation/bookmarks/BookmarksActionTest.java
Thu Jul 14 12:35:08 2005
@@ -42,14 +42,14 @@
         {
             umgr = getRoller().getUserManager();
             user = (UserData)umgr.getUsers(mWebsite, null).get(0);       
+            doFilters();
+            authenticateUser(user.getUserName(), "editor");
         }
         catch (RollerException e)
         {
             e.printStackTrace();
             fail();
         }
-        authenticateUser(user.getUserName(), "editor");
-        doFilters();
 
         // Setup form bean
         BookmarksForm form = (BookmarksForm)

Modified: incubator/roller/branches/roller_2.0/tests/org/roller/presentation/weblog/WeblogEntryActionTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/tests/org/roller/presentation/weblog/WeblogEntryActionTest.java?rev=219080&r1=219079&r2=219080&view=diff
==============================================================================
--- incubator/roller/branches/roller_2.0/tests/org/roller/presentation/weblog/WeblogEntryActionTest.java
(original)
+++ incubator/roller/branches/roller_2.0/tests/org/roller/presentation/weblog/WeblogEntryActionTest.java
Thu Jul 14 12:35:08 2005
@@ -22,25 +22,24 @@
 {
     public void testCreateWeblogEntry() 
     {
+        MockHttpServletRequest mockRequest = getMockFactory().getMockRequest();
+        mockRequest.setContextPath("/dummy");        
+        doFilters();
+        
         UserManager umgr = null;
         UserData user = null; 
         try
         {
             umgr = getRoller().getUserManager();
             user = (UserData)umgr.getUsers(mWebsite, null).get(0);       
+            authenticateUser(user.getUserName(), "editor");
         }
         catch (RollerException e)
         {
             e.printStackTrace();
             fail();
         }
-        authenticateUser(user.getUserName(), "editor");
         
-        MockHttpServletRequest mockRequest = getMockFactory().getMockRequest();
-        mockRequest.setContextPath("/dummy");
-        
-        doFilters();
-
         // Setup mapping and request parameters
         MockActionMapping mapping = strutsModule.getMockActionMapping();
         mapping.setupForwards(new String[] {



Mime
View raw message