jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ajaqu...@apache.org
Subject svn commit: r682145 [3/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/forms/FormElement.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormElement.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormElement.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormElement.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.*;
@@ -45,7 +45,9 @@
      */
     public static final String FORM_VALUES_CARRIER = "nbpf_values";
 
-    // Show values:
+    /**
+     *   Show values.  Value is <tt>{@value}</tt>.
+     */
     public static final String HIDE_SUCCESS = "onsuccess";
 
     // Parameter names:
@@ -83,6 +85,9 @@
 
     /**
      * Utility method stores a FormInfo object into the WikiContext.
+     * 
+     * @param ctx The Context to store it in
+     * @param info The FormInfo to store.
      */
     protected void storeFormInfo( WikiContext ctx, FormInfo info )
     {
@@ -92,6 +97,9 @@
     /**
      * Attempts to retrieve information on the currently handled
      * form from the WikiContext.
+     * 
+     * @param ctx The Context
+     * @return The FormInfo from the context
      */
     protected FormInfo getFormInfo( WikiContext ctx )
     {

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormHandler.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormHandler.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormHandler.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormHandler.java Sun Aug  3 05:19:22 2008
@@ -1,23 +1,23 @@
-/*
-    WikiForms - a WikiPage FORM handler for JSPWiki.
- 
-    Copyright (C) 2003 BaseN. 
+/* 
+    JSPWiki - a JSP-based WikiWiki clone.
 
-    JSPWiki Copyright (C) 2002 Janne Jalkanen (Janne.Jalkanen@iki.fi)
+    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
 
-    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
-*/
+       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;
 
 

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormInfo.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormInfo.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormInfo.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormInfo.java Sun Aug  3 05:19:22 2008
@@ -1,23 +1,23 @@
-/*
-    WikiForms - a WikiPage FORM handler for JSPWiki.
+/* 
+    JSPWiki - a JSP-based WikiWiki clone.
 
-    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
-*/
+    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 java.io.Serializable;
@@ -35,90 +35,168 @@
 {
     private static final long serialVersionUID = 0L;
 
+    /** State: Form is executed. */
     public static final int EXECUTED =  1;
+    
+    /** State: Form is OK. */
     public static final int OK       =  0;
+    
+    /** State: There was an error. */
     public static final int ERROR    = -1;
 
-    public int    m_status;
-    public boolean m_hide;
-    public String m_action;
-    public String m_name;
-    public String m_handler;
-    public String m_result;
-    public String m_error;
-    //public PluginParameters submission;
-    public Map m_submission;
+    private int    m_status;
+    private boolean m_hide;
+    private String m_action;
+    private String m_name;
+    private String m_handler;
+    private String m_result;
+    private String m_error;
+    private Map<?, ?> m_submission;
 
+    /**
+     *  Creates a new FormInfo with status == OK.
+     *
+     */
     public FormInfo()
     {
         m_status = OK;
     }
 
+    /**
+     *  Set the status of the Form processing.
+     *  
+     *  @param val EXECUTED, OK or ERROR.
+     */
     public void setStatus( int val )
     {
         m_status = val;
     }
 
+    /**
+     *  Return the status.
+     *  
+     *  @return The status.
+     */
     public int getStatus()
     {
         return m_status;
     }
 
+    /**
+     *  Set the hide parameter.
+     *  
+     *  @param val True or false.
+     */
     public void setHide( boolean val )
     {
         m_hide = val;
     }
 
+    /**
+     *  Returns true, if the form is supposed to be hidden.
+     *  
+     *  @return True or false.
+     */
     public boolean hide()
     {
         return m_hide;
     }
 
+    /**
+     *  Set the value of the action parameter.
+     *  
+     *  @param val A value parameter.
+     */
     public void setAction( String val )
     {
         m_action = val;
     }
 
+    /**
+     *  Get the action set in {@link #setAction(String)}.
+     *  
+     *  @return An Action.
+     */
     public String getAction()
     {
         return m_action;
     }
 
+    /**
+     *  Sets the name of the form.
+     *  
+     *  @param val The name of the form.
+     */
     public void setName( String val )
     {
         m_name = val;
     }
 
+    /**
+     *  Return the name of the form.
+     *  
+     *  @return The name of the form.
+     */
     public String getName()
     {
         return m_name;
     }
 
+    /**
+     *  Set the name of the handler class.
+     *  
+     *  @param val The name of the class.
+     */
     public void setHandler( String val )
     {
         m_handler = val;
     }
 
+    /**
+     *  Return the name of the handler class.
+     *  
+     *  @return The name of the class.
+     */
     public String getHandler()
     {
         return m_handler;
     }
 
+    /**
+     *  Set the result.
+     *  
+     *  @param val The result.
+     */
     public void setResult( String val )
     {
         m_result = val;
     }
 
+    /**
+     *  Return the result.
+     *  
+     *  @return The result.
+     */
     public String getResult()
     {
         return m_result;
     }
 
+    /**
+     *  Set an error string.
+     *  
+     *  @param val An error string.
+     */
     public void setError( String val )
     {
         m_error = val;
     }
 
+    /**
+     *  Return the error.
+     *  
+     *  @return The error.
+     */
     public String getError()
     {
         return m_error;
@@ -128,6 +206,7 @@
      * Copies the given values into the handler parameter map using Map.putAll().
      * @param val parameter name-value pairs for a Form handler WikiPlugin
      */
+    @SuppressWarnings("unchecked")
     public void setSubmission( Map val )
     {
         m_submission = new HashMap();
@@ -138,6 +217,7 @@
      * Adds the given values into the handler parameter map.
      * @param val parameter name-value pairs for a Form handler WikiPlugin
      */
+    @SuppressWarnings("unchecked")
     public void addSubmission( Map val )
     {
         if( m_submission == null )

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormInput.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormInput.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormInput.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormInput.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.*;
@@ -34,11 +34,16 @@
 public class FormInput
     extends FormElement
 {
+    /** Parameter name for setting the type.  Value is <tt>{@value}</tt>. */
     public static final String PARAM_TYPE  = "type";
+
+    /** Parameter name for setting the size of the input field.  Value is <tt>{@value}</tt>. */
     public static final String PARAM_SIZE  = "size";
 
     /**
      * Generates a dynamic form element on the WikiPage.
+     * 
+     * {@inheritDoc}
      */
     public String execute( WikiContext ctx, Map params )
         throws PluginException
@@ -61,7 +66,7 @@
         {
             if( info.hide() )
             {
-                return( "<p>" + rb.getString( "forminput.noneedtoshow" ) + "</p>" );
+                return "<p>" + rb.getString( "forminput.noneedtoshow" ) + "</p>";
             }
             previousValues = info.getSubmission();
         }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOpen.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOpen.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOpen.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOpen.java Sun Aug  3 05:19:22 2008
@@ -1,31 +1,30 @@
-/*
-    WikiForms - a WikiPage FORM handler for JSPWiki.
+/* 
+    JSPWiki - a JSP-based WikiWiki clone.
 
-    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
-*/
+    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 java.text.MessageFormat;
 import java.util.Map;
 import java.util.ResourceBundle;
 
-import com.ecyrd.jspwiki.*;
-import com.ecyrd.jspwiki.action.ViewActionBean;
+import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.plugin.PluginException;
 import com.ecyrd.jspwiki.plugin.WikiPlugin;
 
@@ -72,9 +71,11 @@
     private static org.apache.log4j.Logger log =
         org.apache.log4j.Logger.getLogger( FormOpen.class );
 
+    /** Parameter name for setting the method (GET or POST).  Value is <tt>{@value}</tt>. */
     public static final String PARAM_METHOD = "method";
 
     /**
+     *  {@inheritDoc}
      */
     public String execute( WikiContext ctx, Map params )
         throws PluginException
@@ -90,7 +91,7 @@
         String sourcePage = ctx.getPage().getName();
         String submitServlet = (String)params.get( PARAM_SUBMITHANDLER );
         if( submitServlet == null )
-            submitServlet = ctx.getContext().getURL( ViewActionBean.class, sourcePage );
+            submitServlet = ctx.getURL( WikiContext.VIEW, sourcePage );
 
         String method = (String)params.get( PARAM_METHOD );
         if( method == null ) method="post";
@@ -116,7 +117,7 @@
                     info.getStatus() == FormInfo.EXECUTED )
                 {
                     info.setHide( true );
-                    return( "<p>" + rb.getString( "formopen.noneedtoshow" ) + "</p>" );
+                    return "<p>" + rb.getString( "formopen.noneedtoshow" ) + "</p>";
                 }
             }
             else

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormOutput.java Sun Aug  3 05:19:22 2008
@@ -1,31 +1,30 @@
-/*
-    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 java.text.MessageFormat;
 import java.util.Map;
 import java.util.ResourceBundle;
 
-import com.ecyrd.jspwiki.*;
-import com.ecyrd.jspwiki.action.ViewActionBean;
+import com.ecyrd.jspwiki.WikiContext;
 import com.ecyrd.jspwiki.plugin.PluginException;
 import com.ecyrd.jspwiki.plugin.PluginManager;
 import com.ecyrd.jspwiki.plugin.WikiPlugin;
@@ -50,7 +49,13 @@
      * <p>
      * Should there be no HTTP request associated with this request,
      * the method will return immediately with an empty string.
+     * 
+     * @param ctx {@inheritDoc}
+     * @param params {@inheritDoc}
+     * @return {@inheritDoc}
+     * @throws {@inheritDoc}
      */
+    @SuppressWarnings("unchecked")
     public String execute( WikiContext ctx, Map params )
         throws PluginException
     {
@@ -92,7 +97,7 @@
         }
 
         String sourcePage = ctx.getPage().getName();
-        String submitServlet = ctx.getContext().getURL( ViewActionBean.class, sourcePage );
+        String submitServlet = ctx.getURL( WikiContext.VIEW, sourcePage );
 
         // If there is previous FormInfo available - say, from a
         // FormSet plugin - use it.

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormSelect.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormSelect.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormSelect.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormSelect.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.*;
@@ -31,11 +31,16 @@
 import org.apache.ecs.xhtml.select;
 
 /**
+ *  Creates a Form select field.
+ *  
  *  @author ebu
  */
 public class FormSelect
     extends FormElement
 {
+    /**
+     *  {@inheritDoc}
+     */
     public String execute( WikiContext ctx, Map params )
         throws PluginException
     {
@@ -146,7 +151,7 @@
             int indicated = -1;
             options[i] = options[i].trim();
             
-            if( options[i].startsWith( optionSelector ) ) 
+            if( optionSelector != null && options[i].startsWith( optionSelector ) ) 
             {
                 options[i] = options[i].substring( optionSelector.length() );
                 indicated = i;
@@ -171,6 +176,6 @@
         if( previouslySelected > -1 ) optionElements[previouslySelected].setSelected(true);
         select field = new select( HANDLERPARAM_PREFIX + inputName, optionElements );
 
-        return( field );
+        return field;
     }
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormSet.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormSet.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormSet.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormSet.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.*;
@@ -59,6 +59,10 @@
 public class FormSet
     implements WikiPlugin
 {    
+    /**
+     *  {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
     public String execute( WikiContext ctx, Map params )
         throws PluginException
     {

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormTextarea.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormTextarea.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormTextarea.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/forms/FormTextarea.java Sun Aug  3 05:19:22 2008
@@ -1,23 +1,23 @@
-/*
-    WikiForms - a WikiPage FORM handler for JSPWiki.
+/* 
+    JSPWiki - a JSP-based WikiWiki clone.
 
-    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
-*/
+    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.*;
@@ -30,14 +30,24 @@
 import org.apache.ecs.xhtml.textarea;
 
 /**
+ *  Creates a Form text area element.   You may specify the size of the textarea
+ *  by using the {@link #PARAM_COLS} and {@link #PARAM_ROWS} to signify the width
+ *  and height of the area.
+ *  
  *  @author ebu
  */
 public class FormTextarea
     extends FormElement
 {
+    /** Parameter name for setting the rows value.  Value is <tt>{@value}</tt>. */
     public static final String PARAM_ROWS = "rows";
+    
+    /** Parameter name for setting the columns value.  Value is <tt>{@value}</tt>. */
     public static final String PARAM_COLS = "cols";
 
+    /**
+     *  {@inheritDoc}
+     */
     public String execute( WikiContext ctx, Map params )
         throws PluginException
     {

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/ForgetNullValuesLinkedHashMap.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/ForgetNullValuesLinkedHashMap.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/ForgetNullValuesLinkedHashMap.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/ForgetNullValuesLinkedHashMap.java Sun Aug  3 05:19:22 2008
@@ -1,42 +1,49 @@
-/* 
-    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
- */
-package com.ecyrd.jspwiki.htmltowiki;
-
-import java.util.LinkedHashMap;
-
-/**
- * A LinkedHashMap that does not put null values into the map.
- * 
- * @author Sebastian Baltes (sbaltes@gmx.com)
- */
-public class ForgetNullValuesLinkedHashMap extends LinkedHashMap
-{
-    private static final long serialVersionUID = 0L;
-    
-    public Object put( Object key, Object value )
-    {
-        if( value != null )
-        {
-            return super.put( key, value );
-        }
-        
-        return null;
-    }
-}
+/* 
+    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.htmltowiki;
+
+import java.util.LinkedHashMap;
+
+/**
+ * A LinkedHashMap that does not put null values into the map.
+ * 
+ * @param <K> {@inheritDoc}
+ * @param <V> {@inheritDoc}
+ * 
+ * @author Sebastian Baltes (sbaltes@gmx.com)
+ */
+public class ForgetNullValuesLinkedHashMap<K,V> extends LinkedHashMap<K,V>
+{
+    private static final long serialVersionUID = 0L;
+    
+    /**
+     *  {@inheritDoc}
+     */
+    public V put( K key, V value )
+    {
+        if( value != null )
+        {
+            return super.put( key, value );
+        }
+        
+        return null;
+    }
+}

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslator.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslator.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/HtmlStringToWikiTranslator.java Sun Aug  3 05:19:22 2008
@@ -1,88 +1,130 @@
-/* 
-    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
- */
-package com.ecyrd.jspwiki.htmltowiki;
-
-import java.io.IOException;
-import java.io.StringReader;
-
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.jdom.input.SAXBuilder;
-import org.jdom.output.XMLOutputter;
-
-import com.ecyrd.jspwiki.WikiContext;
-
-/**
- * Converting Html to Wiki Markup with NekoHtml for converting html to xhtml and
- * Xhtml2WikiTranslator for converting xhtml to Wiki Markup.
- * 
- * @author Sebastian Baltes (sbaltes@gmx.com)
- */
-public class HtmlStringToWikiTranslator
-{
-
-    private static final String CYBERNEKO_PARSER = "org.cyberneko.html.parsers.SAXParser";
-
-    public HtmlStringToWikiTranslator()
-    {}
-
-    public String translate( String html ) throws JDOMException, IOException
-    {
-        return translate( html, new XHtmlToWikiConfig() );
-    }
-
-    public String translate( String html, WikiContext wikiContext ) throws JDOMException, IOException
-    {
-        return translate( html, new XHtmlToWikiConfig( wikiContext ) );
-    }
-
-    public String translate( String html, XHtmlToWikiConfig config ) throws JDOMException, IOException
-    {
-        Element element = htmlStringToElement( html );
-        XHtmlElementToWikiTranslator xhtmlTranslator = new XHtmlElementToWikiTranslator( element, config );
-        String wikiMarkup = xhtmlTranslator.getWikiString();
-        return wikiMarkup;
-    }
-
-    /**
-     * use NekoHtml to parse HTML like well formed XHTML
-     * 
-     * @param html
-     * @return xhtml jdom root element (node "HTML")
-     * @throws JDOMException
-     * @throws IOException
-     */
-    private Element htmlStringToElement( String html ) throws JDOMException, IOException
-    {
-        SAXBuilder builder = new SAXBuilder( CYBERNEKO_PARSER, true );
-        Document doc = builder.build( new StringReader( html ) );
-        Element element = doc.getRootElement();
-        return element;
-    }
-
-    public static String element2String( Element element )
-    {
-        Document document = new Document( element );
-        XMLOutputter outputter = new XMLOutputter();
-        return outputter.outputString( document );
-    }
-
-}
+/* 
+    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.htmltowiki;
+
+import java.io.IOException;
+import java.io.StringReader;
+
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.jdom.input.SAXBuilder;
+import org.jdom.output.XMLOutputter;
+
+import com.ecyrd.jspwiki.WikiContext;
+
+/**
+ * Converting Html to Wiki Markup with NekoHtml for converting html to xhtml and
+ * Xhtml2WikiTranslator for converting xhtml to Wiki Markup.
+ * 
+ * @author Sebastian Baltes (sbaltes@gmx.com)
+ */
+public class HtmlStringToWikiTranslator
+{
+
+    private static final String CYBERNEKO_PARSER = "org.cyberneko.html.parsers.SAXParser";
+
+    /**
+     *  Create a new translator.
+     */
+    public HtmlStringToWikiTranslator()
+    {}
+
+    /**
+     *  Translates text from HTML into WikiMarkup without a WikiContext (meaning
+     *  some things perhaps cannot be translated).  Uses the default configuration.
+     *  
+     *  @param html HTML text to translate
+     *  @return WikiMarkup
+     *  
+     *  @throws JDOMException If parsing fails
+     *  @throws IOException For other kinds of errors.
+     */
+    public String translate( String html ) throws JDOMException, IOException
+    {
+        return translate( html, new XHtmlToWikiConfig() );
+    }
+
+    /**
+     *  Translates text from HTML into WikiMarkup with a WikiContext.  The translation
+     *  accuracy is better.  Uses the default configuration.
+     *  
+     *  @param html HTML text to translate
+     *  @param wikiContext The WikiContext to use.
+     *  @return WikiMarkup
+     *  
+     *  @throws JDOMException If parsing fails
+     *  @throws IOException For other kinds of errors.
+     */
+    public String translate( String html, WikiContext wikiContext ) throws JDOMException, IOException
+    {
+        return translate( html, new XHtmlToWikiConfig( wikiContext ) );
+    }
+
+    /**
+     *  Translates text from HTML into WikiMarkup using a specified configuration.
+     *  
+     *  @param html HTML text to translate
+     *  @param config The configuration to use.
+     *  @return WikiMarkup
+     *  
+     *  @throws JDOMException If parsing fails
+     *  @throws IOException For other kinds of errors.
+     */
+
+    public String translate( String html, XHtmlToWikiConfig config ) throws JDOMException, IOException
+    {
+        Element element = htmlStringToElement( html );
+        XHtmlElementToWikiTranslator xhtmlTranslator = new XHtmlElementToWikiTranslator( element, config );
+        String wikiMarkup = xhtmlTranslator.getWikiString();
+        return wikiMarkup;
+    }
+
+    /**
+     * Use NekoHtml to parse HTML like well formed XHTML
+     * 
+     * @param html
+     * @return xhtml jdom root element (node "HTML")
+     * @throws JDOMException
+     * @throws IOException
+     */
+    private Element htmlStringToElement( String html ) throws JDOMException, IOException
+    {
+        SAXBuilder builder = new SAXBuilder( CYBERNEKO_PARSER, true );
+        Document doc = builder.build( new StringReader( html ) );
+        Element element = doc.getRootElement();
+        return element;
+    }
+
+    /**
+     *  A static helper method to create HTML from an Element.
+     *  
+     *  @param element The element to get HTML from.
+     *  @return HTML
+     */
+    public static String element2String( Element element )
+    {
+        Document document = new Document( element );
+        XMLOutputter outputter = new XMLOutputter();
+        return outputter.outputString( document );
+    }
+
+}

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/PersistentMapDecorator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/PersistentMapDecorator.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/PersistentMapDecorator.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/PersistentMapDecorator.java Sun Aug  3 05:19:22 2008
@@ -1,118 +1,189 @@
-/* 
-    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
- */
-package com.ecyrd.jspwiki.htmltowiki;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-/**
- * Adds the load / save - functionality known from the Properties - class to any
- * Map implementation.
- * 
- * @author Sebastian Baltes (sbaltes@gmx.com)
- */
-public class PersistentMapDecorator extends Properties
-{
-    private static final long serialVersionUID = 0L;
-    
-    private Map m_delegate;
-
-    public PersistentMapDecorator( Map delegate )
-    {
-        this.m_delegate = delegate;
-    }
-
-    public void clear()
-    {
-        m_delegate.clear();
-    }
-
-    public boolean containsKey( Object key )
-    {
-        return m_delegate.containsKey( key );
-    }
-
-    public boolean containsValue( Object value )
-    {
-        return m_delegate.containsValue( value );
-    }
-
-    public Set entrySet()
-    {
-        return m_delegate.entrySet();
-    }
-
-    public boolean equals( Object obj )
-    {
-        return m_delegate.equals( obj );
-    }
-
-    public Object get( Object key )
-    {
-        return m_delegate.get( key );
-    }
-
-    public int hashCode()
-    {
-        return m_delegate.hashCode();
-    }
-
-    public boolean isEmpty()
-    {
-        return m_delegate.isEmpty();
-    }
-
-    public Set keySet()
-    {
-        return m_delegate.keySet();
-    }
-
-    public Object put( Object arg0, Object arg1 )
-    {
-        return m_delegate.put( arg0, arg1 );
-    }
-
-    public void putAll( Map arg0 )
-    {
-        m_delegate.putAll( arg0 );
-    }
-
-    public Object remove( Object key )
-    {
-        return m_delegate.remove( key );
-    }
-
-    public int size()
-    {
-        return m_delegate.size();
-    }
-
-    public String toString()
-    {
-        return m_delegate.toString();
-    }
-
-    public Collection values()
-    {
-        return m_delegate.values();
-    }
-}
+/* 
+    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.htmltowiki;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * Adds the load / save - functionality known from the Properties - class to any
+ * Map implementation.
+ * 
+ * @author Sebastian Baltes (sbaltes@gmx.com)
+ */
+public class PersistentMapDecorator extends Properties
+{
+    private static final long serialVersionUID = 0L;
+    
+    private Map m_delegate;
+
+    /**
+     *  Creates a new decorator for a given map.
+     *  
+     *  @param delegate The map to create a decorator for.
+     */
+    public PersistentMapDecorator( Map delegate )
+    {
+        m_delegate = delegate;
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public void clear()
+    {
+        m_delegate.clear();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public boolean containsKey( Object key )
+    {
+        return m_delegate.containsKey( key );
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public boolean containsValue( Object value )
+    {
+        return m_delegate.containsValue( value );
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public Set entrySet()
+    {
+        return m_delegate.entrySet();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public boolean equals( Object obj )
+    {
+        return m_delegate.equals( obj );
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public Object get( Object key )
+    {
+        return m_delegate.get( key );
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public int hashCode()
+    {
+        return m_delegate.hashCode();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public boolean isEmpty()
+    {
+        return m_delegate.isEmpty();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public Set keySet()
+    {
+        return m_delegate.keySet();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public Object put( Object arg0, Object arg1 )
+    {
+        return m_delegate.put( arg0, arg1 );
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public void putAll( Map arg0 )
+    {
+        m_delegate.putAll( arg0 );
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public Object remove( Object key )
+    {
+        return m_delegate.remove( key );
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public int size()
+    {
+        return m_delegate.size();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public String toString()
+    {
+        return m_delegate.toString();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
+    @Override
+    public Collection values()
+    {
+        return m_delegate.values();
+    }
+}

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/PropertiesUtils.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/PropertiesUtils.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/PropertiesUtils.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/PropertiesUtils.java Sun Aug  3 05:19:22 2008
@@ -1,145 +1,148 @@
-/*
-    JSPWiki - a JSP-based WikiWiki clone.
-
-    Copyright (C) 2001-2007 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
- */
-package com.ecyrd.jspwiki.htmltowiki;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.TreeMap;
-
-/**
- * some usefull methods for properties
- *
- * @author Sebastian Baltes (sbaltes@gmx.com)
- * @version 1.0
- */
-public final class PropertiesUtils
-{
-    private static final String OTHER_WHITESPACE = "\t\r\n\014";
-    private static final char[] HEXDIGIT = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
-    /** Private constructor to prevent instantiation. */
-    private PropertiesUtils()
-    {}
-
-    /**
-     * <p>
-     * like Properties.store, but stores the properties in sorted order
-     * </p>
-     *
-     * @param properties the properties object
-     * @return String the properties, nicely formatted 
-     */
-    public static String toSortedString( Properties properties )
-    {
-        TreeMap treemap = new TreeMap( properties );
-        String string = "";
-        Iterator iterator = treemap.entrySet().iterator();
-        while( iterator.hasNext() )
-        {
-            Map.Entry entry = (Map.Entry)iterator.next();
-            String key = (String)entry.getKey();
-            String value = entry.getValue() == null ? "null" : entry.getValue().toString();
-            string += toLine( key, value ) + '\n';
-        }
-        return string;
-    }
-
-    /**
-     * Generates a property file line from a supplied key and value.
-     * @param key the property's key
-     * @param value the property's value
-     * @return the converted string
-     */
-    public static String toLine( String key, String value )
-    {
-        return saveConvert( key, true ) + '=' + saveConvert( value, false );
-    }
-
-    /**
-     * Encodes a property file string from a supplied key/value line.
-     * @param string the string to encode
-     * @param encodeWhiteSpace <code>true</code> if whitespace should be encoded also
-     * @return the converted string
-     */
-    public static String saveConvert( String string, boolean encodeWhiteSpace )
-    {
-        int i = string.length();
-        StringBuffer stringbuffer = new StringBuffer( i * 2 );
-        for( int i3 = 0; i3 < i; i3++ )
-        {
-            char c = string.charAt( i3 );
-            switch( c )
-            {
-                case ' ':
-                    if( i3 == 0 || encodeWhiteSpace )
-                    {
-                        stringbuffer.append( '\\' );
-                    }
-                    stringbuffer.append( ' ' );
-                    break;
-                case '\\':
-                    stringbuffer.append( '\\' );
-                    stringbuffer.append( '\\' );
-                    break;
-                case '\t':
-                    stringbuffer.append( '\\' );
-                    stringbuffer.append( 't' );
-                    break;
-                case '\n':
-                    stringbuffer.append( '\\' );
-                    stringbuffer.append( 'n' );
-                    break;
-                case '\r':
-                    stringbuffer.append( '\\' );
-                    stringbuffer.append( 'r' );
-                    break;
-                case '\014':
-                    stringbuffer.append( '\\' );
-                    stringbuffer.append( 'f' );
-                    break;
-                default:
-                    if( c < 32 || c > 126 )
-                    {
-                        stringbuffer.append( '\\' );
-                        stringbuffer.append( 'u' );
-                        stringbuffer.append( toHex( c >> 12 & 0xf ) );
-                        stringbuffer.append( toHex( c >> 8 & 0xf ) );
-                        stringbuffer.append( toHex( c >> 4 & 0xf ) );
-                        stringbuffer.append( toHex( c & 0xf ) );
-                    }
-                    else
-                    {
-                        if( OTHER_WHITESPACE.indexOf( c ) != -1 )
-                        {
-                            stringbuffer.append( '\\' );
-                        }
-                        stringbuffer.append( c );
-                    }
-            }
-        }
-        return stringbuffer.toString();
-    }
-
-    private static char toHex( int i )
-    {
-        return HEXDIGIT[i & 0xf];
-    }
-}
+/*
+    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.htmltowiki;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.TreeMap;
+
+/**
+ * some usefull methods for properties
+ *
+ * @author Sebastian Baltes (sbaltes@gmx.com)
+ * @version 1.0
+ */
+// FIXME3.0 move to utils package
+public final class PropertiesUtils
+{
+    private static final String OTHER_WHITESPACE = "\t\r\n\014";
+    private static final char[] HEXDIGIT = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+
+    /** Private constructor to prevent instantiation. */
+    private PropertiesUtils()
+    {}
+
+    /**
+     * <p>
+     * like Properties.store, but stores the properties in sorted order
+     * </p>
+     *
+     * @param properties the properties object
+     * @return String the properties, nicely formatted 
+     */
+    @SuppressWarnings("unchecked")
+    public static String toSortedString( Properties properties )
+    {
+        TreeMap treemap = new TreeMap( properties );
+        String string = "";
+        Iterator iterator = treemap.entrySet().iterator();
+        while( iterator.hasNext() )
+        {
+            Map.Entry entry = (Map.Entry)iterator.next();
+            String key = (String)entry.getKey();
+            String value = entry.getValue() == null ? "null" : entry.getValue().toString();
+            string += toLine( key, value ) + '\n';
+        }
+        return string;
+    }
+
+    /**
+     * Generates a property file line from a supplied key and value.
+     * @param key the property's key
+     * @param value the property's value
+     * @return the converted string
+     */
+    public static String toLine( String key, String value )
+    {
+        return saveConvert( key, true ) + '=' + saveConvert( value, false );
+    }
+
+    /**
+     * Encodes a property file string from a supplied key/value line.
+     * @param string the string to encode
+     * @param encodeWhiteSpace <code>true</code> if whitespace should be encoded also
+     * @return the converted string
+     */
+    public static String saveConvert( String string, boolean encodeWhiteSpace )
+    {
+        int i = string.length();
+        StringBuffer stringbuffer = new StringBuffer( i * 2 );
+        for( int i3 = 0; i3 < i; i3++ )
+        {
+            char c = string.charAt( i3 );
+            switch( c )
+            {
+                case ' ':
+                    if( i3 == 0 || encodeWhiteSpace )
+                    {
+                        stringbuffer.append( '\\' );
+                    }
+                    stringbuffer.append( ' ' );
+                    break;
+                case '\\':
+                    stringbuffer.append( '\\' );
+                    stringbuffer.append( '\\' );
+                    break;
+                case '\t':
+                    stringbuffer.append( '\\' );
+                    stringbuffer.append( 't' );
+                    break;
+                case '\n':
+                    stringbuffer.append( '\\' );
+                    stringbuffer.append( 'n' );
+                    break;
+                case '\r':
+                    stringbuffer.append( '\\' );
+                    stringbuffer.append( 'r' );
+                    break;
+                case '\014':
+                    stringbuffer.append( '\\' );
+                    stringbuffer.append( 'f' );
+                    break;
+                default:
+                    if( c < 32 || c > 126 )
+                    {
+                        stringbuffer.append( '\\' );
+                        stringbuffer.append( 'u' );
+                        stringbuffer.append( toHex( c >> 12 & 0xf ) );
+                        stringbuffer.append( toHex( c >> 8 & 0xf ) );
+                        stringbuffer.append( toHex( c >> 4 & 0xf ) );
+                        stringbuffer.append( toHex( c & 0xf ) );
+                    }
+                    else
+                    {
+                        if( OTHER_WHITESPACE.indexOf( c ) != -1 )
+                        {
+                            stringbuffer.append( '\\' );
+                        }
+                        stringbuffer.append( c );
+                    }
+            }
+        }
+        return stringbuffer.toString();
+    }
+
+    private static char toHex( int i )
+    {
+        return HEXDIGIT[i & 0xf];
+    }
+}

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/WhitespaceTrimWriter.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/WhitespaceTrimWriter.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/WhitespaceTrimWriter.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/WhitespaceTrimWriter.java Sun Aug  3 05:19:22 2008
@@ -1,120 +1,153 @@
-/* 
-    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
- */
-package com.ecyrd.jspwiki.htmltowiki;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Part of the XHtmlToWikiTranslator
- * 
- * @author Sebastian Baltes (sbaltes@gmx.com)
- */
-public class WhitespaceTrimWriter extends Writer
-{
-
-    private StringBuffer m_result = new StringBuffer();
-
-    private StringBuffer m_buffer = new StringBuffer();
-
-    private boolean m_trimMode = true;
-
-    private static final Pattern ONLINE_PATTERN = Pattern.compile( ".*?\\n\\s*?", Pattern.MULTILINE );
-
-    private boolean m_currentlyOnLineBegin = true;
-
-    public void flush()
-    {
-        if( m_buffer.length() > 0 )
-        {
-            String s = m_buffer.toString();
-            s = s.replaceAll( "\r\n", "\n" );
-            if( m_trimMode )
-            {
-                s = s.replaceAll( "(\\w+) \\[\\?\\|Edit\\.jsp\\?page=\\1\\]", "[$1]" );
-                s = s.replaceAll( "\n{2,}", "\n\n" );
-                s = s.replaceAll( "\\p{Blank}+", " " );
-                s = s.replaceAll( "[ ]*\n[ ]*", "\n" );
-                s = replacePluginNewlineBackslashes( s );
-            }
-            m_result.append( s );
-            m_buffer = new StringBuffer();
-        }
-    }
-
-    private String replacePluginNewlineBackslashes( String s )
-    {
-        Pattern p = Pattern.compile( "\\{\\{\\{(.*?)\\}\\}\\}|\\{\\{(.*?)\\}\\}|\\[\\{(.*?)\\}\\]", Pattern.DOTALL
-                                                                                                    + Pattern.MULTILINE );
-        Matcher m = p.matcher( s );
-        StringBuffer sb = new StringBuffer();
-        while( m.find() )
-        {
-            String groupEscaped = m.group().replaceAll( "\\\\|\\$", "\\\\$0" );
-            if( m.group( 3 ) != null )
-            {
-                m.appendReplacement( sb, groupEscaped.replaceAll( "\\\\\\\\\\\\\\\\", "\n" ) );
-            }
-            else
-            {
-                m.appendReplacement( sb, groupEscaped );
-            }
-        }
-        m.appendTail( sb );
-        s = sb.toString();
-        return s;
-    }
-
-    public boolean isWhitespaceTrimMode()
-    {
-        return m_trimMode;
-    }
-
-    public void setWhitespaceTrimMode( boolean trimMode )
-    {
-        if( m_trimMode != trimMode )
-        {
-            flush();
-            m_trimMode = trimMode;
-        }
-    }
-
-    public void write( char[] arg0, int arg1, int arg2 ) throws IOException
-    {
-        m_buffer.append( arg0, arg1, arg2 );
-        m_currentlyOnLineBegin = ONLINE_PATTERN.matcher( m_buffer ).matches();
-    }
-
-    public void close() throws IOException
-    {}
-
-    public String toString()
-    {
-        flush();
-        return m_result.toString();
-    }
-
-    public boolean isCurrentlyOnLineBegin()
-    {
-        return m_currentlyOnLineBegin;
-    }
-}
+/* 
+    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.htmltowiki;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Part of the XHtmlToWikiTranslator.
+ * 
+ * @author Sebastian Baltes (sbaltes@gmx.com)
+ */
+// FIXME: Needs a better description as to how it works.
+public class WhitespaceTrimWriter extends Writer
+{
+
+    private StringBuffer m_result = new StringBuffer();
+
+    private StringBuffer m_buffer = new StringBuffer();
+
+    private boolean m_trimMode = true;
+
+    private static final Pattern ONLINE_PATTERN = Pattern.compile( ".*?\\n\\s*?", Pattern.MULTILINE );
+
+    private boolean m_currentlyOnLineBegin = true;
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public void flush()
+    {
+        if( m_buffer.length() > 0 )
+        {
+            String s = m_buffer.toString();
+            s = s.replaceAll( "\r\n", "\n" );
+            if( m_trimMode )
+            {
+                s = s.replaceAll( "(\\w+) \\[\\?\\|Edit\\.jsp\\?page=\\1\\]", "[$1]" );
+                s = s.replaceAll( "\n{2,}", "\n\n" );
+                s = s.replaceAll( "\\p{Blank}+", " " );
+                s = s.replaceAll( "[ ]*\n[ ]*", "\n" );
+                s = replacePluginNewlineBackslashes( s );
+            }
+            m_result.append( s );
+            m_buffer = new StringBuffer();
+        }
+    }
+
+    private String replacePluginNewlineBackslashes( String s )
+    {
+        Pattern p = Pattern.compile( "\\{\\{\\{(.*?)\\}\\}\\}|\\{\\{(.*?)\\}\\}|\\[\\{(.*?)\\}\\]", Pattern.DOTALL
+                                                                                                    + Pattern.MULTILINE );
+        Matcher m = p.matcher( s );
+        StringBuffer sb = new StringBuffer();
+        while( m.find() )
+        {
+            String groupEscaped = m.group().replaceAll( "\\\\|\\$", "\\\\$0" );
+            if( m.group( 3 ) != null )
+            {
+                m.appendReplacement( sb, groupEscaped.replaceAll( "\\\\\\\\\\\\\\\\", "\n" ) );
+            }
+            else
+            {
+                m.appendReplacement( sb, groupEscaped );
+            }
+        }
+        m.appendTail( sb );
+        s = sb.toString();
+        return s;
+    }
+
+    /**
+     *  Returns true, if this Writer is currently trimming any whitespaces.
+     *  
+     *  @return True, if trimming.
+     */
+    public boolean isWhitespaceTrimMode()
+    {
+        return m_trimMode;
+    }
+
+    /**
+     *  Set the trimming mode on/off.
+     *  
+     *  @param trimMode True, if you want trimming to be turned on.  False otherwise.
+     */
+    public void setWhitespaceTrimMode( boolean trimMode )
+    {
+        if( m_trimMode != trimMode )
+        {
+            flush();
+            m_trimMode = trimMode;
+        }
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public void write( char[] arg0, int arg1, int arg2 ) throws IOException
+    {
+        m_buffer.append( arg0, arg1, arg2 );
+        m_currentlyOnLineBegin = ONLINE_PATTERN.matcher( m_buffer ).matches();
+    }
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public void close() throws IOException
+    {}
+
+    /**
+     *  {@inheritDoc}
+     */
+    @Override
+    public String toString()
+    {
+        flush();
+        return m_result.toString();
+    }
+
+    /**
+     *  Returns true, if the writer is currently writing a line start.
+     *  
+     *  @return True or false.
+     */
+    public boolean isCurrentlyOnLineBegin()
+    {
+        return m_currentlyOnLineBegin;
+    }
+}

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlElementToWikiTranslator.java Sun Aug  3 05:19:22 2008
@@ -1,21 +1,22 @@
 /*
     JSPWiki - a JSP-based WikiWiki clone.
 
-    Copyright (C) 2001-2007 JSPWiki Development Group
-
-    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.htmltowiki;
 
@@ -37,7 +38,7 @@
 import org.jdom.xpath.XPath;
 
 /**
- * Converting XHtml to Wiki Markup
+ * Converting XHtml to Wiki Markup.  This is the class which does all of the heavy loading.
  *
  * @author Sebastian Baltes (sbaltes@gmx.com)
  */
@@ -55,11 +56,26 @@
 
     private PreStack m_preStack = new PreStack();
 
+    /**
+     *  Create a new translator using the default config.
+     *  
+     *  @param base The base element from which to start translating.
+     *  @throws IOException If reading of the DOM tree fails.
+     *  @throws JDOMException If the DOM tree is faulty.
+     */
     public XHtmlElementToWikiTranslator( Element base ) throws IOException, JDOMException
     {
         this( base, new XHtmlToWikiConfig() );
     }
 
+    /**
+     *  Create a new translator using the specified config.
+     *  
+     *  @param base The base element from which to start translating.
+     *  @param config The config to use.
+     *  @throws IOException If reading of the DOM tree fails.
+     *  @throws JDOMException If the DOM tree is faulty.
+     */
     public XHtmlElementToWikiTranslator( Element base, XHtmlToWikiConfig config ) throws IOException, JDOMException
     {
         this.m_config = config;
@@ -68,6 +84,11 @@
         print( base );
     }
 
+    /**
+     *  FIXME: I have no idea what this does...
+     * 
+     *  @return Something.
+     */
     public String getWikiString()
     {
         return m_outTimmer.toString();
@@ -668,6 +689,7 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private void printImage( Element base ) throws JDOMException
     {
         Element child = (Element)XPath.selectSingleNode( base, "TBODY/TR/TD/*" );
@@ -677,7 +699,7 @@
         }
         Element img;
         String href;
-        Map map = new ForgetNullValuesLinkedHashMap();
+        Map<Object,Object> map = new ForgetNullValuesLinkedHashMap();
         if( child.getName().equals( "A" ) )
         {
             img = child.getChild( "IMG" );
@@ -763,7 +785,7 @@
      */
     private Map getAugmentedWikiLinkAttributes( Element a )
     {
-        Map attributesMap = new HashMap();
+        Map<String,String> attributesMap = new HashMap<String,String>();
 
         String id = a.getAttributeValue( "id" );
         if( id != null && !id.equals( "" ) )
@@ -999,7 +1021,7 @@
 
     // FIXME: These should probably be better used with java.util.Stack
 
-    static class LiStack
+    private static class LiStack
     {
 
         private StringBuffer m_li = new StringBuffer();
@@ -1022,7 +1044,7 @@
 
     }
 
-    class PreStack
+    private class PreStack
     {
 
         private int m_pre = 0;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlToWikiConfig.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlToWikiConfig.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlToWikiConfig.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/htmltowiki/XHtmlToWikiConfig.java Sun Aug  3 05:19:22 2008
@@ -1,29 +1,26 @@
 /*
     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.htmltowiki;
 
 import com.ecyrd.jspwiki.WikiContext;
-import com.ecyrd.jspwiki.action.AttachActionBean;
-import com.ecyrd.jspwiki.action.EditActionBean;
-import com.ecyrd.jspwiki.action.PageInfoActionBean;
-import com.ecyrd.jspwiki.action.ViewActionBean;
 
 /**
  *  Defines a Wiki configuration to XHtmlToWikiTranslator, including things like
@@ -45,6 +42,9 @@
 
     private String m_pageName;
 
+    /**
+     *  Creates a new, empty config object.
+     */
     public XHtmlToWikiConfig()
     {}
 
@@ -52,7 +52,7 @@
      *  The constructor initializes the different internal fields
      *  according to the current URLConstructor.
      *
-     * @param wikiContext
+     * @param wikiContext A WikiContext
      */
     public XHtmlToWikiConfig( WikiContext wikiContext )
     {
@@ -65,29 +65,15 @@
         //      the Wiki page name in VIEW or ATTACH
         //
 
-        m_wikiJspPage = wikiContext.getContext().getURL( ViewActionBean.class, "" );
+        m_wikiJspPage = wikiContext.getURL( WikiContext.VIEW, "" );
 
-        m_editJspPage = wikiContext.getContext().getURL( EditActionBean.class, "" );
+        m_editJspPage = wikiContext.getURL( WikiContext.EDIT, "" );
 
-        m_attachPage = wikiContext.getContext().getURL( AttachActionBean.class, "" );
+        m_attachPage = wikiContext.getURL( WikiContext.ATTACH, "" );
 
-        m_pageInfoJsp = wikiContext.getContext().getURL( PageInfoActionBean.class, "" );
+        m_pageInfoJsp = wikiContext.getURL( WikiContext.INFO, "" );
     }
 
-    /*
-    // FIXME: Unused.
-    private String removeLast(String str, String remove )
-    {
-        int idx = str.lastIndexOf( remove );
-
-        if( idx != -1 )
-        {
-            str = StringUtils.left( str, idx ) + StringUtils.substring( str, idx+remove.length() );
-        }
-
-        return str;
-    }
-    */
     private void setWikiContext( WikiContext wikiContext )
     {
         if( wikiContext.getPage() != null )
@@ -96,61 +82,122 @@
         }
     }
 
+    /**
+     *  Return the URL for the attachments.
+     *  
+     *  @return URL for attachments.
+     */
     public String getAttachPage()
     {
         return m_attachPage;
     }
 
+    /**
+     *  Set the URL for attachments.
+     *  
+     *  @param attachPage The attachment URL.
+     */
     public void setAttachPage( String attachPage )
     {
         m_attachPage = attachPage;
     }
 
+    /**
+     *  Gets the URL of the outlink image.
+     *  
+     *  @return The URL of the outlink image.
+     */
     public String getOutlink()
     {
         return m_outlink;
     }
 
+    /**
+     *  Set the outlink URL.
+     *  
+     *  @param outlink The outlink URL.
+     */
     public void setOutlink( String outlink )
     {
         m_outlink = outlink;
     }
 
+    /**
+     *  Get the PageInfo.jsp URI.
+     *  
+     *  @return The URI for the page info display.
+     */
     public String getPageInfoJsp()
     {
         return m_pageInfoJsp;
     }
 
+    /**
+     *  Set the URI for the page info display.
+     *  
+     *  @param pageInfoJsp URI for the page info.
+     */
     public void setPageInfoJsp( String pageInfoJsp )
     {
         m_pageInfoJsp = pageInfoJsp;
     }
 
+    /**
+     *  Get the page name.
+     *  
+     *  @return The Page Name.
+     */
     public String getPageName()
     {
         return m_pageName;
     }
 
+    
+    /**
+     *  Set the page name.
+     *  
+     *  @param pageName The name of the page.
+     */
     public void setPageName( String pageName )
     {
         m_pageName = pageName;
     }
 
+    /**
+     *  Get the URI to the Wiki.jsp view.
+     *  
+     *  @return The URI to the Wiki.jsp.
+     */
     public String getWikiJspPage()
     {
         return m_wikiJspPage;
     }
 
+    /**
+     *  Set the URI to the Wiki.jsp.
+     *  
+     *  @param wikiJspPage The URI to the Wiki.jsp.
+     */
     public void setWikiJspPage( String wikiJspPage )
     {
         m_wikiJspPage = wikiJspPage;
     }
 
+    /**
+     *  Return the URI to the Edit.jsp page.
+     *  
+     *  @return The URI to the Edit.jsp page.
+     */
     public String getEditJspPage()
     {
         return m_editJspPage;
     }
 
+    /**
+     *  Set the URI to the Edit.jsp page.
+     *  
+     *  @param editJspPage The Edit.jsp URI.
+     */
     public void setEditJspPage( String editJspPage )
     {
         m_editJspPage = editJspPage;

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/i18n/InternationalizationManager.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.i18n;
 
@@ -28,7 +29,6 @@
 /**
  *  Manages all internationalization in JSPWiki.
  *
- *  @author Janne Jalkanen
  *  @since 2.6
  */
 public class InternationalizationManager
@@ -61,7 +61,7 @@
     {
         return get( CORE_BUNDLE, Locale.ENGLISH, key );
     }
-
+    
     /**
      *  Finds a resource bundle.
      *
@@ -93,4 +93,5 @@
     {
         return getBundle(bundle,locale).getString(key);
     }
+
 }

Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/modules/InternalModule.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/modules/InternalModule.java?rev=682145&r1=682144&r2=682145&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/modules/InternalModule.java (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/src/com/ecyrd/jspwiki/modules/InternalModule.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.modules;
@@ -30,7 +31,6 @@
  *  <p>
  *  A plugin developer should never implement this interface.
  *  
- *  @author jalkanen
  *  @since 2.4
  */
 public interface InternalModule



Mime
View raw message