jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaqu...@apache.org
Subject svn commit: r682145 [2/4] - in /incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki: dav/ dav/items/ dav/methods/ diff/ event/ filters/ forms/ htmltowiki/ i18n/ modules/
Date Sun, 03 Aug 2008 12:19:24 GMT
Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/PageEventFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/PageEventFilter.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/PageEventFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/PageEventFilter.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEngineEvent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEngineEvent.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEngineEvent.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEngineEvent.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEvent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEvent.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEvent.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEvent.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;
@@ -116,6 +117,9 @@
      * this method returns true if the event type is anything except
      * {@link #ERROR} or {@link #UNDEFINED}. This method is meant to
      * be subclassed as appropriate.
+     * 
+     * @param type The value to test.
+     * @return true, if the value is a valid WikiEvent type.
      */
     public static boolean isValidType( int type )
     {

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventListener.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventListener.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventListener.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventListener.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventManager.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventManager.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventManager.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;
@@ -153,10 +154,10 @@
     private static WikiEventListener c_monitor = null;
 
     /* The Map of client object to WikiEventDelegate. */
-    private final Map m_delegates = new HashMap();
+    private final Map<Object, WikiEventDelegate> m_delegates = new HashMap<Object, WikiEventDelegate>();
 
     /* The Vector containing any preloaded WikiEventDelegates. */
-    private final Vector m_preloadCache = new Vector();
+    private final Vector<WikiEventDelegate> m_preloadCache = new Vector<WikiEventDelegate>();
 
     /* Singleton instance of the WikiEventManager. */
     private static WikiEventManager c_instance = null;
@@ -390,7 +391,7 @@
                 // then see if any of the cached delegates match the class of the incoming client
                 for( int i = m_preloadCache.size()-1 ; i >= 0 ; i-- ) // start with most-recently added
                 {
-                    WikiEventDelegate delegate = (WikiEventDelegate)m_preloadCache.elementAt(i);
+                    WikiEventDelegate delegate = m_preloadCache.elementAt(i);
                     if( delegate.getClientClass() == null
                         || delegate.getClientClass().equals(client.getClass()) )
                     {
@@ -405,7 +406,7 @@
                 }
             }
             // otherwise treat normally...
-            WikiEventDelegate delegate = (WikiEventDelegate)m_delegates.get( client );
+            WikiEventDelegate delegate = m_delegates.get( client );
             if( delegate == null )
             {
                 delegate = new WikiEventDelegate( client );
@@ -433,7 +434,7 @@
     {
         /* A list of event listeners for this instance. */
 
-        private ArrayList m_listenerList = new ArrayList();
+        private ArrayList<WeakReference<WikiEventListener>> m_listenerList = new ArrayList<WeakReference<WikiEventListener>>();
 
         private Class  m_class  = null;
 
@@ -473,7 +474,7 @@
         {
             synchronized( m_listenerList )
             {
-                TreeSet set = new TreeSet( new WikiEventListenerComparator() );
+                TreeSet<WikiEventListener> set = new TreeSet<WikiEventListener>( new WikiEventListenerComparator() );
 
                 for( Iterator i = m_listenerList.iterator(); i.hasNext(); )
                 {
@@ -500,7 +501,7 @@
         {
             synchronized( m_listenerList )
             {
-                return m_listenerList.add( new WeakReference(listener) );
+                return m_listenerList.add( new WeakReference<WikiEventListener>(listener) );
             }
         }
 
@@ -577,7 +578,7 @@
                     {
                         for( int i = 0; i < m_listenerList.size(); i++ )
                         {
-                            WeakReference w = (WeakReference)m_listenerList.get(i);
+                            WeakReference w = m_listenerList.get(i);
 
                             if( w.get() == null ) m_listenerList.remove(i--);
                         }
@@ -597,22 +598,14 @@
 
     } // end inner class WikiEventDelegate
 
-    private static class WikiEventListenerComparator implements Comparator
+    private static class WikiEventListenerComparator implements Comparator<WikiEventListener>
     {
         // TODO: This method is a critical performance bottleneck
-        public int compare(Object arg0, Object arg1)
+        public int compare(WikiEventListener w0, WikiEventListener w1)
         {
-            if( arg0 instanceof WikiEventListener && arg1 instanceof WikiEventListener )
-            {
-                WikiEventListener w0 = (WikiEventListener) arg0;
-                WikiEventListener w1 = (WikiEventListener) arg1;
-
-                if( w1 == w0 || w0.equals(w1) ) return 0;
-
-                return w1.hashCode() - w0.hashCode();
-            }
+            if( w1 == w0 || w0.equals(w1) ) return 0;
 
-            throw new ClassCastException( arg1.getClass().getName() + " != " + arg0.getClass().getName() );
+            return w1.hashCode() - w0.hashCode();
         }
     }
 } // end com.ecyrd.jspwiki.event.WikiEventManager

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventUtils.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventUtils.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventUtils.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiEventUtils.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiPageEvent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiPageEvent.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiPageEvent.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiPageEvent.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiPageRenameEvent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiPageRenameEvent.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiPageRenameEvent.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiPageRenameEvent.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;
@@ -36,7 +37,7 @@
     private static final long serialVersionUID = 1L;
 
     /** Indicates a page rename event. This is based on events
-      * generated by {@link com.ecyrd.jspwiki.PageRenamer}. */
+      * generated by {@link com.ecyrd.jspwiki.content.PageRenamer}. */
     public static final int PAGE_RENAMED         = 28;
 
     private String m_oldpagename  = null;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiSecurityEvent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiSecurityEvent.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiSecurityEvent.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WikiSecurityEvent.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
-/* 
+/*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.    
  */
 package com.ecyrd.jspwiki.event;
 
@@ -89,6 +90,9 @@
     /** When a user logs out. */
     public static final int   LOGOUT                   = 44;
 
+    /** When a Principal should be added to the WikiSession */
+    public static final int PRINCIPAL_ADD               = 35;
+
     /** When a session expires. */
     public static final int   SESSION_EXPIRED          = 45;
 
@@ -234,6 +238,7 @@
             case LOGIN_CREDENTIAL_EXPIRED:  return "LOGIN_ACCOUNT_EXPIRED";
             case LOGIN_FAILED:              return "LOGIN_FAILED";
             case LOGOUT:                    return "LOGOUT";
+            case PRINCIPAL_ADD:                    return "PRINCIPAL_ADD";
             case SESSION_EXPIRED:           return "SESSION_EXPIRED";
             case GROUP_ADD:                 return "GROUP_ADD";
             case GROUP_REMOVE:              return "GROUP_REMOVE";
@@ -260,6 +265,7 @@
             case LOGIN_CREDENTIAL_EXPIRED:  return "login failed: credential expired";
             case LOGIN_FAILED:              return "login failed";
             case LOGOUT:                    return "user logged out";
+            case PRINCIPAL_ADD:                   return "new principal added";
             case SESSION_EXPIRED:           return "session expired";
             case GROUP_ADD:                 return "new group added";
             case GROUP_REMOVE:              return "group removed";

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WorkflowEvent.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WorkflowEvent.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WorkflowEvent.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/event/WorkflowEvent.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
- JSPWiki - a JSP-based WikiWiki clone.
+    JSPWiki - a JSP-based WikiWiki clone.
 
- Copyright (C) 2001-2006 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 
 package com.ecyrd.jspwiki.event;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/BasicPageFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/BasicPageFilter.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/BasicPageFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/BasicPageFilter.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /* 
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
@@ -29,7 +30,6 @@
  *  do anything, so it is a good idea for you to extend from this class
  *  and implement only methods that you need.
  *
- *  @author Janne Jalkanen
  */
 public class BasicPageFilter
     implements PageFilter
@@ -38,6 +38,8 @@
   
     /**
      *  If you override this, you should call super.initialize() first.
+     *  
+     *  {@inheritDoc}
      */
     public void initialize( WikiEngine engine, Properties properties )
         throws FilterException
@@ -45,29 +47,44 @@
         m_engine = engine;
     }
 
+    /**
+     *  {@inheritDoc}
+     */
     public String preTranslate( WikiContext wikiContext, String content )
         throws FilterException
     {
         return content;
     }
 
+    /**
+     *  {@inheritDoc}
+     */
     public String postTranslate( WikiContext wikiContext, String htmlContent )
         throws FilterException
     {
         return htmlContent;
     }
 
+    /**
+     *  {@inheritDoc}
+     */
     public String preSave( WikiContext wikiContext, String content )
         throws FilterException
     {
         return content;
     }
 
+    /**
+     *  {@inheritDoc}
+     */
     public void postSave( WikiContext wikiContext, String content )
         throws FilterException
     {
     }
     
+    /**
+     *  {@inheritDoc}
+     */
     public void destroy( WikiEngine engine ) 
     {
     }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/CreoleFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/CreoleFilter.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/CreoleFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/CreoleFilter.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /* 
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
@@ -103,4 +104,4 @@
         }
     }
 
-}
\ No newline at end of file
+}

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/FilterException.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/FilterException.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/FilterException.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/FilterException.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /* 
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2003 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
@@ -31,6 +32,11 @@
 {
     private static final long serialVersionUID = 0L;
     
+    /**
+     *  Constructs an exception.
+     *  
+     *  @param msg {@inheritDoc}
+     */
     public FilterException( String msg )
     {
         super( msg );

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/FilterManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/FilterManager.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/FilterManager.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/FilterManager.java Sun Aug  3 05:19:22 2008
@@ -1,28 +1,29 @@
 /* 
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2003 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
-import java.io.InputStream;
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.File;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.*;
 
@@ -40,10 +41,8 @@
 import com.ecyrd.jspwiki.event.WikiPageEvent;
 import com.ecyrd.jspwiki.modules.ModuleManager;
 import com.ecyrd.jspwiki.modules.WikiModuleInfo;
-import com.ecyrd.jspwiki.plugin.PluginManager.WikiPluginInfo;
-
-import com.ecyrd.jspwiki.util.PriorityList;
 import com.ecyrd.jspwiki.util.ClassUtil;
+import com.ecyrd.jspwiki.util.PriorityList;
 
 
 /**
@@ -91,18 +90,19 @@
  *  The &lt;filter> -sections define the filters.  For more information, please see
  *  the PageFilterConfiguration page in the JSPWiki distribution.
  *
- *  @author Janne Jalkanen
  */
 public final class FilterManager extends ModuleManager
 {
-    private PriorityList     m_pageFilters = new PriorityList();
+    private PriorityList    m_pageFilters = new PriorityList();
 
-    private HashMap          m_filterClassMap = new HashMap();
+    private HashMap<String, PageFilterInfo>          m_filterClassMap = new HashMap<String,PageFilterInfo>();
 
     private static final Logger log = Logger.getLogger(WikiEngine.class);
 
+    /** Property name for setting the filter XML property file.  Value is <tt>{@value}</tt>. */
     public static final String PROP_FILTERXML = "jspwiki.filterConfig";
     
+    /** Default location for the filter XML property file.  Value is <tt>{@value}</tt>. */
     public static final String DEFAULT_XMLFILE = "/WEB-INF/filters.xml";
 
     /** JSPWiki system filters are all below this value. */
@@ -111,6 +111,13 @@
     /** The standard user level filtering. */
     public static final int USER_FILTER_PRIORITY   = 0;
     
+    /**
+     *  Constructs a new FilterManager object.
+     *  
+     *  @param engine The WikiEngine which owns the FilterManager
+     *  @param props Properties to initialize the FilterManager with
+     *  @throws WikiException If something goes wrong.
+     */
     public FilterManager( WikiEngine engine, Properties props )
         throws WikiException
     {
@@ -131,7 +138,7 @@
      *  @param priority The priority in which position to add it in.
      *  @throws IllegalArgumentException If the PageFilter is null or invalid.
      */
-    public void addPageFilter( PageFilter f, int priority )
+    public void addPageFilter( PageFilter f, int priority ) throws IllegalArgumentException
     {
         if( f == null )
         {
@@ -145,7 +152,7 @@
     {
         try
         {
-            PageFilterInfo info = (PageFilterInfo)m_filterClassMap.get( className );
+            PageFilterInfo info = m_filterClassMap.get( className );
             
             if( info != null && !checkCompatibility(info) )
             {
@@ -191,6 +198,9 @@
 
     /**
      *  Initializes the filters from an XML file.
+     *  
+     *  @param props The list of properties.  Typically jspwiki.properties
+     *  @throws WikiException If something goes wrong.
      */
     protected void initialize( Properties props )
         throws WikiException
@@ -202,22 +212,35 @@
         {
             registerFilters();
             
-            if( xmlFile == null )
+            if( m_engine.getServletContext() != null )
             {
-                if( m_engine.getServletContext() != null )
+                log.debug( "Attempting to locate " + DEFAULT_XMLFILE + " from servlet context." );
+                if( xmlFile == null )
                 {
-                    log.debug("Attempting to locate "+DEFAULT_XMLFILE+" from servlet context.");
                     xmlStream = m_engine.getServletContext().getResourceAsStream( DEFAULT_XMLFILE );
                 }
-                
-                if( xmlStream == null )
+                else
+                {
+                    xmlStream = m_engine.getServletContext().getResourceAsStream( xmlFile );
+                }
+            }
+
+            if( xmlStream == null )
+            {
+                // just a fallback element to the old behaviour prior to 2.5.8
+                log.debug( "Attempting to locate filters.xml from class path." );
+
+                if( xmlFile == null )
                 {
-                    //just a fallback element to the old behaviour prior to 2.5.8
-                    log.debug("Attempting to locate filters.xml from class path.");
                     xmlStream = getClass().getResourceAsStream( "/filters.xml" );
                 }
+                else
+                {
+                    xmlStream = getClass().getResourceAsStream( xmlFile );
+                }
             }
-            else
+
+            if( (xmlStream == null) && (xmlFile != null) )
             {
                 log.debug("Attempting to load property file "+xmlFile);
                 xmlStream = new FileInputStream( new File(xmlFile) );
@@ -283,6 +306,13 @@
  
     /**
      *  Does the filtering before a translation.
+     *  
+     *  @param context The WikiContext
+     *  @param pageData WikiMarkup data to be passed through the preTranslate chain.
+     *  @throws FilterException If any of the filters throws a FilterException
+     *  @return The modified WikiMarkup
+     *  
+     *  @see PageFilter#preTranslate(WikiContext, String)
      */
     public String doPreTranslateFiltering( WikiContext context, String pageData )
         throws FilterException
@@ -303,8 +333,14 @@
 
     /**
      *  Does the filtering after HTML translation.
+     *  
+     *  @param context The WikiContext
+     *  @param htmlData HTML data to be passed through the postTranslate
+     *  @throws FilterException If any of the filters throws a FilterException
+     *  @return The modified HTML
+     *  @see PageFilter#postTranslate(WikiContext, String)
      */
-    public String doPostTranslateFiltering( WikiContext context, String pageData )
+    public String doPostTranslateFiltering( WikiContext context, String htmlData )
         throws FilterException
     {
         fireEvent( WikiPageEvent.POST_TRANSLATE_BEGIN, context );
@@ -313,16 +349,22 @@
         {
             PageFilter f = (PageFilter) i.next();
 
-            pageData = f.postTranslate( context, pageData );
+            htmlData = f.postTranslate( context, htmlData );
         }
 
         fireEvent( WikiPageEvent.POST_TRANSLATE_END, context );
 
-        return pageData;
+        return htmlData;
     }
 
     /**
      *  Does the filtering before a save to the page repository.
+     *  
+     *  @param context The WikiContext
+     *  @param pageData WikiMarkup data to be passed through the preSave chain.
+     *  @throws FilterException If any of the filters throws a FilterException
+     *  @return The modified WikiMarkup
+     *  @see PageFilter#preSave(WikiContext, String)
      */
     public String doPreSaveFiltering( WikiContext context, String pageData )
         throws FilterException
@@ -343,6 +385,12 @@
 
     /**
      *  Does the page filtering after the page has been saved.
+     * 
+     *  @param context The WikiContext
+     *  @param pageData WikiMarkup data to be passed through the postSave chain.
+     *  @throws FilterException If any of the filters throws a FilterException
+     * 
+     *  @see PageFilter#postSave(WikiContext, String)
      */
     public void doPostSaveFiltering( WikiContext context, String pageData )
         throws FilterException
@@ -360,6 +408,12 @@
         fireEvent( WikiPageEvent.POST_SAVE_END, context );
     }
 
+    /**
+     *  Returns the list of filters currently installed.  Note that this is not
+     *  a copy, but the actual list.  So be careful with it.
+     *  
+     *  @return A List of PageFilter objects
+     */
     public List getFilterList()
     {
         return m_pageFilters;
@@ -399,6 +453,10 @@
         }
     }
 
+    /**
+     *  {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
     public Collection modules()
     {
         ArrayList modules = new ArrayList();
@@ -476,7 +534,7 @@
      * 
      *  @since 2.6.1
      */
-    private static class PageFilterInfo extends WikiModuleInfo
+    private static final class PageFilterInfo extends WikiModuleInfo
     {
         private PageFilterInfo( String name )
         {

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PageFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PageFilter.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PageFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PageFilter.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /* 
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
@@ -39,40 +40,60 @@
  *  per each WikiEngine invocation.  If you need to store data persistently, use
  *  VariableManager, or WikiContext.
  *  <p>
- *  As of 2.5.30, initialize() gains accesso to the WikiEngine.
+ *  As of 2.5.30, initialize() gains access to the WikiEngine.
  *
- *  @author Janne Jalkanen
  */
 public interface PageFilter
 {
     /**
      *  Is called whenever the a new PageFilter is instantiated and
      *  reset.
+     *  
+     *  @param engine The WikiEngine whic owns this PageFilter
+     *  @param properties The properties ripped from filters.xml.
+     *  @throws FilterException If the filter could not be initialized. If this is thrown,
+     *                          the filter is not added to the internal queues.
      */
     public void initialize( WikiEngine engine, Properties properties )
         throws FilterException;
 
     /**
      *  This method is called whenever a page has been loaded from the provider,
-     *  but not yet been sent through the TranslatorReader.  Note that you cannot
-     *  do HTML translation here, because TranslatorReader is likely to escape it.
+     *  but not yet been sent through the markup-translation process.  Note that you cannot
+     *  do HTML translation here, because it will be escaped.
      *
      *  @param wikiContext The current wikicontext.
      *  @param content     WikiMarkup.
+     *  @return The modified wikimarkup content.
+     *  @throws FilterException If something goes wrong.  Throwing this causes the entire page
+     *                          processing to be abandoned.
      */
     public String preTranslate( WikiContext wikiContext, String content )
         throws FilterException;
 
     /**
-     *  This method is called after a page has been fed through the TranslatorReader,
+     *  This method is called after a page has been fed through the translation process,
      *  so anything you are seeing here is translated content.  If you want to
      *  do any of your own WikiMarkup2HTML translation, do it here.
+     *  
+     *  @param wikiContext The WikiContext.
+     *  @param htmlContent The translated HTML
+     *  @return The modified HTML
+     *  
+     *  @throws FilterException If something goes wrong.  Throwing this causes the entire page
+     *                          processing to be abandoned.
      */
     public String postTranslate( WikiContext wikiContext, String htmlContent )
         throws FilterException;
 
     /**
      *  This method is called before the page has been saved to the PageProvider.
+     *  
+     *  @param wikiContext The WikiContext
+     *  @param content The wikimarkup that the user just wanted to save.
+     *  @return The modified wikimarkup
+     *  @throws FilterException If something goes wrong.  Throwing this causes the entire page
+     *                          processing to be abandoned.
      */
     public String preSave( WikiContext wikiContext, String content )
         throws FilterException;
@@ -84,17 +105,22 @@
      *  <p>
      *  Since the result is discarded from this method, this is only useful
      *  for things like counters, etc.
+     *  
+     *  @param wikiContext The WikiContext
+     *  @param content The content which was just stored.
+     *  @throws FilterException If something goes wrong.  As the page is already saved,
+     *                          This is just logged.
      */
     public void postSave( WikiContext wikiContext, String content )
         throws FilterException;
 
     /**
-     * Called for every filter, e.g. on wiki eingine shutdown. Use this if you have to 
-     * clean up or close global resources you allocated in the initialize() method.
+     *  Called for every filter, e.g. on wiki eingine shutdown. Use this if you have to 
+     *  clean up or close global resources you allocated in the initialize() method.
      * 
-     * @since 2.5.36
+     *  @param engine The WikiEngine which owns this filter.
+     *  @since 2.5.36
      */
     public void destroy( WikiEngine engine );
 
-
-}
\ No newline at end of file
+}

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PingWeblogsComFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PingWeblogsComFilter.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PingWeblogsComFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/PingWeblogsComFilter.java Sun Aug  3 05:19:22 2008
@@ -1,28 +1,27 @@
 /* 
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
 import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.WikiEngine;
-import com.ecyrd.jspwiki.action.ViewActionBean;
-
 import org.apache.xmlrpc.*;
 import java.net.URL;
 import java.net.MalformedURLException;
@@ -42,15 +41,24 @@
 {
     static Logger log = Logger.getLogger( PingWeblogsComFilter.class );
 
-    public String m_pingURL;
+    private String m_pingURL;
 
+    /**
+     *  The property name for the URL to ping.  Value is <tt>{@value}</tt>.
+     */
     public static final String PROP_PINGURL = "pingurl";
 
+    /**
+     *  {@inheritDoc}
+     */
     public void initialize( WikiEngine engine, Properties props )
     {
         m_pingURL = props.getProperty( PROP_PINGURL, "http://rpc.weblogs.com/RPC2" );
     }
 
+    /**
+     *  {@inheritDoc}
+     */
     public void postSave( WikiContext context, String pagecontent )
     {
         String     blogName = context.getPage().getName();
@@ -74,10 +82,10 @@
             XmlRpcClient xmlrpc = new XmlRpcClient(m_pingURL);
             Vector<String> params = new Vector<String>();
             params.addElement( "The Butt Ugly Weblog" ); // FIXME: Must be settable
-            params.addElement( context.getContext().getURL( ViewActionBean.class, blogName, null, true ) );
+            params.addElement( engine.getURL( WikiContext.VIEW, blogName, null, true ) );
 
             if( log.isDebugEnabled() )
-                log.debug("Pinging weblogs.com with URL: "+context.getContext().getURL( ViewActionBean.class, blogName, null, true ));
+                log.debug("Pinging weblogs.com with URL: "+engine.getURL( WikiContext.VIEW, blogName, null, true ));
 
             xmlrpc.executeAsync("weblogUpdates.ping", params, 
                                 new AsyncCallback() 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/ProfanityFilter.java Sun Aug  3 05:19:22 2008
@@ -1,34 +1,89 @@
 /* 
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
-import com.ecyrd.jspwiki.WikiContext;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+
 import com.ecyrd.jspwiki.TextUtil;
+import com.ecyrd.jspwiki.WikiContext;
 
-public class ProfanityFilter
-    extends BasicPageFilter
+/**
+ *  This class is an example of how to have a simple filter.  It removes
+ *  all nasty words located at <code>profanity.properties</code> file, inside 
+ *  <code>com/ecyrd/jspwiki/filters</code> package. The search of profanities
+ *  is case unsensitive.
+ *
+ */
+public class ProfanityFilter extends BasicPageFilter
 {
-    private static final String[] c_profanities = {
-        "fuck",
-        "shit" };
+    private static Logger     log = Logger.getLogger(ProfanityFilter.class);
+    
+    private static final String PROPERTYFILE = "com/ecyrd/jspwiki/filters/profanity.properties";
+    private static String[] c_profanities = new String[0];
+    
+    static 
+    {
+        try 
+        {
+            ClassLoader loader = ProfanityFilter.class.getClassLoader();
+            InputStream in = loader.getResourceAsStream( PROPERTYFILE );
+            
+            if( in == null )
+            {
+                throw new IOException("No property file found! (Check the installation, it should be there.)");
+            }
+            
+            BufferedReader br = new BufferedReader( new InputStreamReader( in ) );
+            List<String> profs = new ArrayList<String>();
+            
+            String str;
+            while ( ( str = br.readLine() ) != null ) 
+            {
+                if( str.length() > 0 && !str.startsWith( "#" ) )
+                { // allow comments on profanities file
+                    profs.add( str );
+                }
+            }
+            c_profanities = profs.toArray( new String[0] );
+        }
+        catch( IOException e )
+        {
+            log.error( "Unable to load profanities from "+PROPERTYFILE, e );
+        }
+        catch( Exception e )
+        {
+            log.error( "Unable to initialize Profanity Filter", e );
+        }
+    }
 
+    /**
+     *  {@inheritDoc}
+     */
     public String preTranslate( WikiContext context, String content )
     {
         for( int i = 0; i < c_profanities.length; i++ )
@@ -36,7 +91,7 @@
             String word = c_profanities[i];
             String replacement = word.charAt(0)+"*"+word.charAt(word.length()-1);
 
-            content = TextUtil.replaceString( content, word, replacement );
+            content = TextUtil.replaceStringCaseUnsensitive( content, word, replacement );
         }
 
         return content;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/RedirectException.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/RedirectException.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/RedirectException.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/RedirectException.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2003 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
@@ -24,7 +25,6 @@
  *  redirect the user elsewhere.
  *
  *  @since 2.1.112
- *  @deprecated use {@link ResolutionException instead}
  */
 public class RedirectException
     extends FilterException
@@ -33,6 +33,12 @@
 
     private final String m_where;
 
+    /**
+     *  Constructs a new RedirectException.
+     *  
+     *  @param msg The message for the exception
+     *  @param redirect The redirect URI.
+     */
     public RedirectException( String msg, String redirect )
     {
         super( msg );
@@ -42,6 +48,8 @@
 
     /**
      *  Get the URI for redirection.
+     *  
+     *  @return The URI given in the constructor.
      */
     public String getRedirect()
     {

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/SpamFilter.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2005 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published by
-    the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
  */
 package com.ecyrd.jspwiki.filters;
 
@@ -35,14 +36,10 @@
 import org.apache.oro.text.regex.*;
 
 import com.ecyrd.jspwiki.*;
-import com.ecyrd.jspwiki.action.CommentActionBean;
-import com.ecyrd.jspwiki.action.NoneActionBean;
-import com.ecyrd.jspwiki.action.ViewActionBean;
 import com.ecyrd.jspwiki.attachment.Attachment;
 import com.ecyrd.jspwiki.auth.user.UserProfile;
 import com.ecyrd.jspwiki.providers.ProviderException;
 import com.ecyrd.jspwiki.ui.EditorManager;
-import com.ecyrd.jspwiki.ui.WikiInterceptor;
 
 /**
  *  This is Herb, the JSPWiki spamfilter that can also do choke modifications.
@@ -66,10 +63,12 @@
  *        and calculates a score for the spam, which is then compared to a filter level value.
  *  </ul>
  *
+ *  <p>Please see the default editors/plain.jsp for examples on how the SpamFilter integrates
+ *  with the editor system.</p>
+ *  
  *  <p>Changes by admin users are ignored in any case.</p>
  *
  *  @since 2.1.112
- *  @author Janne Jalkanen
  */
 public class SpamFilter
     extends BasicPageFilter
@@ -85,19 +84,51 @@
     private static final String REASON_UTF8_TRAP = "UTF8Trap";
 
     private static final String LISTVAR = "spamwords";
+    
+    /** The filter property name for specifying the page which contains the list of spamwords.
+     *  Value is <tt>{@value}</tt>. */
     public static final String  PROP_WORDLIST              = "wordlist";
+    
+    /** The filter property name for the page to which you are directed if Herb rejects your
+     *  edit.  Value is <tt>{@value}</tt>. */
     public static final String  PROP_ERRORPAGE             = "errorpage";
+    
+    /** The filter property name for specifying how many changes is any given IP address
+     *  allowed to do per minute.  Value is <tt>{@value}</tt>.
+     */
     public static final String  PROP_PAGECHANGES           = "pagechangesinminute";
+    
+    /** The filter property name for specifying how many similar changes are allowed
+     *  before a host is banned.  Value is <tt>{@value}</tt>.
+     */
     public static final String  PROP_SIMILARCHANGES        = "similarchanges";
+    
+    /** The filter property name for specifying how long a host is banned.  Value is <tt>{@value}</tt>.*/
     public static final String  PROP_BANTIME               = "bantime";
+    
+    /** The filter property name for the attachment containing the blacklist.  Value is <tt>{@value}</tt>.*/
     public static final String  PROP_BLACKLIST             = "blacklist";
+    
+    /** The filter property name for specifying how many URLs can any given edit contain.  
+     *  Value is <tt>{@value}</tt> */
     public static final String  PROP_MAXURLS               = "maxurls";
+    
+    /** The filter property name for specifying the Akismet API-key.  Value is <tt>{@value}</tt>. */
     public static final String  PROP_AKISMET_API_KEY       = "akismet-apikey";
+    
+    /** The filter property name for specifying whether authenticated users should be ignored. Value is <tt>{@value}</tt>. */
     public static final String  PROP_IGNORE_AUTHENTICATED  = "ignoreauthenticated";
+    
+    /** The filter property name for specifying which captcha technology should be used. Value is <tt>{@value}</tt>. */
     public static final String  PROP_CAPTCHA               = "captcha";
+    
+    /** The filter property name for specifying which filter strategy should be used.  Value is <tt>{@value}</tt>. */
     public static final String  PROP_FILTERSTRATEGY        = "strategy";
 
+    /** The string specifying the "eager" strategy. Value is <tt>{@value}</tt>. */
     public static final String  STRATEGY_EAGER             = "eager";
+    
+    /** The string specifying the "score" strategy. Value is <tt>{@value}</tt>. */
     public static final String  STRATEGY_SCORE             = "score";
 
     private static final String URL_REGEXP = "(http://|https://|mailto:)([A-Za-z0-9_/\\.\\+\\?\\#\\-\\@=&;]+)";
@@ -109,19 +140,19 @@
     private PatternMatcher  m_matcher = new Perl5Matcher();
     private PatternCompiler m_compiler = new Perl5Compiler();
 
-    private Collection      m_spamPatterns = null;
+    private Collection<Pattern> m_spamPatterns = null;
 
     private Date            m_lastRebuild = new Date( 0L );
 
-    static  Logger          spamlog = Logger.getLogger( "SpamLog" );
-    static  Logger          log = Logger.getLogger( SpamFilter.class );
+    private static  Logger  c_spamlog = Logger.getLogger( "SpamLog" );
+    private static  Logger  log = Logger.getLogger( SpamFilter.class );
 
 
-    private Vector          m_temporaryBanList = new Vector();
+    private Vector<Host>    m_temporaryBanList = new Vector<Host>();
 
     private int             m_banTime = 60; // minutes
 
-    private Vector          m_lastModifications = new Vector();
+    private Vector<Host>    m_lastModifications = new Vector<Host>();
 
     /**
      *  How many times a single IP address can change a page per minute?
@@ -155,6 +186,21 @@
 
     private boolean         m_stopAtFirstMatch = true;
 
+    private static String   c_hashName;
+    private static long     c_lastUpdate;
+
+    /** The HASH_DELAY value is a maximum amount of time that an user can keep
+     *  a session open, because after the value has expired, we will invent a new
+     *  hash field name.  By default this is {@value} hours, which should be ample
+     *  time for someone.
+     */
+    private static final long HASH_DELAY = 24;
+
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
     public void initialize( WikiEngine engine, Properties properties )
     {
         m_forbiddenWordsPage = properties.getProperty( PROP_WORDLIST,
@@ -240,12 +286,12 @@
                 throw new InternalWikiException("Illegal type "+type);
         }
 
-        spamlog.info( reason+" "+source+" "+uid+" "+addr+" \""+page+"\" "+message );
+        c_spamlog.info( reason+" "+source+" "+uid+" "+addr+" \""+page+"\" "+message );
 
         return uid;
     }
 
-
+    /** {@inheritDoc} */
     public String preSave( WikiContext context, String content )
         throws RedirectException
     {
@@ -287,9 +333,9 @@
         Integer score = (Integer)context.getVariable( ATTR_SPAMFILTER_SCORE );
 
         if( score != null )
-            score = new Integer( score.intValue()+1 );
+            score = score+1;
         else
-            score = new Integer( 1 );
+            score = 1;
 
         context.setVariable( ATTR_SPAMFILTER_SCORE, score );
     }
@@ -299,11 +345,11 @@
      *
      * @param source
      * @param list
-     * @return
+     * @return A Collection of the Patterns that were found from the lists.
      */
-    private Collection parseWordList( WikiPage source, String list )
+    private Collection<Pattern> parseWordList( WikiPage source, String list )
     {
-        ArrayList compiledpatterns = new ArrayList();
+        ArrayList<Pattern> compiledpatterns = new ArrayList<Pattern>();
 
         if( list != null )
         {
@@ -334,11 +380,11 @@
      *  Pattern objects.
      *
      *  @param list
-     *  @return
+     *  @return The parsed blacklist patterns.
      */
-    private Collection parseBlacklist( String list )
+    private Collection<Pattern> parseBlacklist( String list )
     {
-        ArrayList compiledpatterns = new ArrayList();
+        ArrayList<Pattern> compiledpatterns = new ArrayList<Pattern>();
 
         if( list != null )
         {
@@ -552,7 +598,7 @@
                 String userAgent     = req.getHeader("User-Agent");
                 String referrer      = req.getHeader( "Referer");
                 String permalink     = context.getViewURL( context.getPage().getName() );
-                String commentType   = context instanceof CommentActionBean ? "comment" : "edit";
+                String commentType   = context.getRequestContext().equals(WikiContext.COMMENT) ? "comment" : "edit";
                 String commentAuthor = context.getCurrentUser().getName();
                 String commentAuthorEmail = null;
                 String commentAuthorURL   = null;
@@ -756,7 +802,7 @@
 
                     FileUtil.copyContents( new InputStreamReader(in,"UTF-8"), out );
 
-                    Collection blackList = parseBlacklist( out.toString() );
+                    Collection<Pattern> blackList = parseBlacklist( out.toString() );
 
                     log.info("...recognizing additional "+blackList.size()+" patterns from blacklist "+m_blacklist);
 
@@ -797,10 +843,8 @@
         if( context.getHttpRequest() != null )
             change += context.getHttpRequest().getRemoteAddr();
 
-        for( Iterator i = m_spamPatterns.iterator(); i.hasNext(); )
+        for( Pattern p : m_spamPatterns )
         {
-            Pattern p = (Pattern) i.next();
-
             // log.debug("Attempting to match page contents with "+p.getPattern());
 
             if( m_matcher.contains( change, p ) )
@@ -888,10 +932,10 @@
     }
 
     /**
-     *  Returns true, if this user should be ignored.
+     *  Returns true, if this user should be ignored.  For example, admin users.
      *
      * @param context
-     * @return
+     * @return True, if this users should be ignored.
      */
     private boolean ignoreThisUser(WikiContext context)
     {
@@ -942,21 +986,18 @@
      */
     private String getRedirectPage( WikiContext ctx )
     {
-        Map<String,String> urlParams = new HashMap<String,String>();
         if( m_useCaptcha )
-        {
-            urlParams.put( "page", ctx.getEngine().encodeName( ctx.getPage().getName() ) );
-            return ctx.getContext().getURL( NoneActionBean.class, "Captcha.jsp", urlParams );
-        }
+            return ctx.getURL( WikiContext.NONE, "Captcha.jsp", "page="+ctx.getEngine().encodeName(ctx.getPage().getName()) );
 
-        return ctx.getContext().getURL( ViewActionBean.class, m_errorPage);
+        return ctx.getURL( WikiContext.VIEW, m_errorPage );
     }
 
     /**
      *  Checks whether the UserProfile matches certain checks.
      *
-     *  @param profile
-     *  @return
+     *  @param profile The profile to check
+     *  @param context The WikiContext
+     *  @return False, if this userprofile is suspect and should not be allowed to be added.
      *  @since 2.6.1
      */
     public boolean isValidUserProfile( WikiContext context, UserProfile profile )
@@ -1008,16 +1049,6 @@
      *  @since  2.6
      */
 
-    private static String c_hashName;
-    private static long   c_lastUpdate;
-
-    /** The HASH_DELAY value is a maximum amount of time that an user can keep
-     *  a session open, because after the value has expired, we will invent a new
-     *  hash field name.  By default this is {@value} hours, which should be ample
-     *  time for someone.
-     */
-    private static final long HASH_DELAY = 24;
-
     public static final String getHashFieldName( HttpServletRequest request )
     {
         String hash = null;
@@ -1054,8 +1085,8 @@
      *  and logs the incident in the spam log (it may or may not be spam, but it's rather likely
      *  that it is).
      *
-     *  @param context
-     *  @param pageContext
+     *  @param context The WikiContext
+     *  @param pageContext The JSP PageContext.
      *  @return True, if hash is okay.  False, if hash is not okay, and you need to redirect.
      *  @throws IOException If redirection fails
      *  @since 2.6
@@ -1073,7 +1104,7 @@
 
                 log( context, REJECT, "MissingHash", change );
 
-                String redirect = context.getContext().getURL( ViewActionBean.class, "SessionExpired");
+                String redirect = context.getURL(WikiContext.VIEW,"SessionExpired");
                 ((HttpServletResponse)pageContext.getResponse()).sendRedirect( redirect );
 
                 return false;
@@ -1083,9 +1114,18 @@
         return true;
     }
 
+    /**
+     *  This helper method adds all the input fields to your editor that the SpamFilter requires
+     *  to check for spam.  This <i>must</i> be in your editor form if you intend to use
+     *  the SpamFilter.
+     *  
+     *  @param pageContext The PageContext
+     *  @return A HTML string which contains input fields for the SpamFilter.
+     */
     public static final String insertInputFields( PageContext pageContext )
     {
-        WikiEngine engine = (WikiEngine)pageContext.getAttribute( WikiInterceptor.ATTR_WIKIENGINE, PageContext.REQUEST_SCOPE );
+        WikiContext ctx = WikiContext.findContext(pageContext);
+        WikiEngine engine = ctx.getEngine();
 
         StringBuffer sb = new StringBuffer();
         if (engine.getContentEncoding().equals("UTF-8"))
@@ -1098,8 +1138,6 @@
     /**
      *  A local class for storing host information.
      *
-     *  @author jalkanen
-     *
      *  @since
      */
     private class Host

Added: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/package.html
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/package.html?rev=682145&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/package.html (added)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/package.html Sun Aug  3 05:19:22 2008
@@ -0,0 +1,16 @@
+<body>
+Provides page and content filtering functionality for JSPWiki.
+
+<h2>Package specification</h2>
+
+<p>PageFilters are objects which can influence the way a page is translated from 
+WikiMarkup to HTML, or change the content when the page is saved.  They're fairly
+versatile, and you can do lots of interesting stuff with them, ranging from
+adding your own WikiMarkup rules to purifying your HTML to making a spam filter to
+counting popularity of pages.</p>
+
+<h2>Related documentation</h2>
+
+TBD.
+
+</body>
\ No newline at end of file

Added: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/profanity.properties
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/profanity.properties?rev=682145&view=auto
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/profanity.properties (added)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/filters/profanity.properties Sun Aug  3 05:19:22 2008
@@ -0,0 +1,5 @@
+# Feel free to fill this file with your preferred profanities, at the rate of one
+# profanity per line. The match performed against this file is case-unsensitive
+
+fuck
+shit

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormClose.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormClose.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormClose.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormClose.java Sun Aug  3 05:19:22 2008
@@ -1,23 +1,23 @@
-/*
-    WikiForms - a WikiPage FORM handler for JSPWiki.
- 
-    Copyright (C) 2003 BaseN. 
-
-    JSPWiki Copyright (C) 2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU Lesser General Public License as published
-    by the Free Software Foundation; either version 2.1 of the License, or
-    (at your option) any later version.
- 
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU Lesser General Public License for more details.
- 
-    You should have received a copy of the GNU Lesser General Public License
-    along with this program; if not, write to the Free Software
-*/
+/* 
+    JSPWiki - a JSP-based WikiWiki clone.
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.  
+ */
 package com.ecyrd.jspwiki.forms;
 
 import com.ecyrd.jspwiki.*;
@@ -37,6 +37,8 @@
     /**
      * Builds a Form close tag. Removes any information on the form from
      * the WikiContext.
+     * 
+     * {@inheritDoc}
      */
     public String execute( WikiContext ctx, Map params )
         throws PluginException
@@ -52,7 +54,7 @@
             if( info.hide() )
             {
                 ResourceBundle rb = ctx.getBundle(WikiPlugin.CORE_PLUGINS_RESOURCEBUNDLE);
-                return( "<p>" + rb.getString( "formclose.noneedtoshow" ) + "</p>" );
+                return "<p>" + rb.getString( "formclose.noneedtoshow" ) + "</p>";
             }
         }
 



Mime
View raw message