You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by aj...@apache.org on 2008/12/03 05:38:48 UTC

svn commit: r722767 - in /incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui: AbstractCommand.java Command.java CommandResolver.java GroupCommand.java PageCommand.java RedirectCommand.java TemplateManager.java WikiCommand.java WikiJSPFilter.java

Author: ajaquith
Date: Tue Dec  2 20:38:48 2008
New Revision: 722767

URL: http://svn.apache.org/viewvc?rev=722767&view=rev
Log:
Checked in the Stripes code (about 220 classes, tests, JSPs and other files. All code compiles clean, but the JSPs do NOT work at the moment. Unit tests run clean except for some stray failing Stripes-related unit tests. See the file doc/README - Stripes Migration for some (repeat, SOME) details of what it all means. I'll sort out the JSP issues later this week.

Removed:
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/AbstractCommand.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/Command.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/CommandResolver.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/GroupCommand.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/PageCommand.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/RedirectCommand.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiCommand.java
Modified:
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java   (contents, props changed)
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java   (contents, props changed)

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java?rev=722767&r1=722766&r2=722767&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java Tue Dec  2 20:38:48 2008
@@ -39,6 +39,7 @@
 import com.ecyrd.jspwiki.InternalWikiException;
 import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
+import com.ecyrd.jspwiki.action.WikiContextFactory;
 import com.ecyrd.jspwiki.modules.ModuleManager;
 import com.ecyrd.jspwiki.preferences.Preferences;
 import com.ecyrd.jspwiki.preferences.Preferences.TimeFormat;
@@ -490,7 +491,7 @@
      */
     public Map listTimeFormats(PageContext pageContext)
     {
-        WikiContext context = WikiContext.findContext( pageContext ); 
+        WikiContext context = WikiContextFactory.findContext( pageContext ); 
         Properties props = m_engine.getWikiProperties();
         ArrayList<String> tfArr = new ArrayList<String>(40);
         LinkedHashMap<String,String> resultMap = new LinkedHashMap<String,String>();

Propchange: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/TemplateManager.java
            ('svn:eol-style' removed)

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java?rev=722767&r1=722766&r2=722767&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java Tue Dec  2 20:38:48 2008
@@ -31,9 +31,9 @@
 
 import com.ecyrd.jspwiki.TextUtil;
 import com.ecyrd.jspwiki.WikiContext;
-import com.ecyrd.jspwiki.event.WikiEventManager;
-import com.ecyrd.jspwiki.event.WikiPageEvent;
-import com.ecyrd.jspwiki.url.DefaultURLConstructor;
+import com.ecyrd.jspwiki.action.WikiActionBean;
+import com.ecyrd.jspwiki.action.WikiInterceptor;
+import com.ecyrd.jspwiki.event.*;
 import com.ecyrd.jspwiki.util.UtilJ2eeCompat;
 import com.ecyrd.jspwiki.util.WatchDog;
 
@@ -104,9 +104,14 @@
             }
         
             // fire PAGE_REQUESTED event
-            String pagename = DefaultURLConstructor.parsePageFromURL(
-                    (HttpServletRequest)request, response.getCharacterEncoding() );
-            fireEvent( WikiPageEvent.PAGE_REQUESTED, pagename );
+            WikiActionBean wikiActionBean = WikiInterceptor.findActionBean( request );
+            WikiContext wikiContext = wikiActionBean.getContext();
+            boolean isViewContext = WikiContext.VIEW .equals( wikiContext.getRequestContext() );
+            if ( isViewContext )
+            {
+                String pageName = wikiContext.getPage().getName();
+                fireEvent( WikiPageEvent.PAGE_REQUESTED, pageName );
+            }
 
             super.doFilter( request, responseWrapper, chain );
 
@@ -118,7 +123,6 @@
             try
             {
                 w.enterState( "Delivering response", 30 );
-                WikiContext wikiContext = getWikiContext( request );
                 String r = filter( wikiContext, responseWrapper );
         
                 //String encoding = "UTF-8";
@@ -131,14 +135,13 @@
                 response.getWriter().write(r);
             
                 // Clean up the UI messages and loggers
-                if( wikiContext != null )
+                // fire PAGE_DELIVERED event
+                wikiContext.getWikiSession().clearMessages();
+                if ( isViewContext )
                 {
-                    wikiContext.getWikiSession().clearMessages();
+                    String pageName = wikiContext.getPage().getName();
+                    fireEvent( WikiPageEvent.PAGE_DELIVERED, pageName );
                 }
-
-                // fire PAGE_DELIVERED event
-                fireEvent( WikiPageEvent.PAGE_DELIVERED, pagename );
-
             }
             finally
             {

Propchange: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/ui/WikiJSPFilter.java
            ('svn:eol-style' removed)