You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by mo...@apache.org on 2003/06/06 21:42:17 UTC

cvs commit: jakarta-jetspeed/webapp/WEB-INF/templates/vm/parameters/html CheckBox.vm

morciuch    2003/06/06 12:42:17

  Modified:    src/java/org/apache/jetspeed/modules/parameters
                        CheckBox.java TextArea.java
  Added:       webapp/WEB-INF/templates/jsp/parameters/html TextArea.jsp
               webapp/WEB-INF/templates/vm/parameters/html CheckBox.vm
  Log:
  Fixed CheckBox parameter style to retain its state and converted to Velocity (see Bugzilla bug# 16346)
  
  Also, converted TextArea style from ECS to JSP.
  
  Revision  Changes    Path
  1.2       +2 -24     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/CheckBox.java
  
  Index: CheckBox.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/CheckBox.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CheckBox.java	20 Aug 2002 17:37:17 -0000	1.1
  +++ CheckBox.java	6 Jun 2003 19:42:16 -0000	1.2
  @@ -54,38 +54,16 @@
   
   package org.apache.jetspeed.modules.parameters;
   
  -//turbine support
  -import org.apache.turbine.util.RunData;
  -
  -// java stuff
  -import java.util.Map;
  -
  -// ecs stuff
  -import org.apache.ecs.html.Input;
  -
   /**
    * Returns check box control intialized with the value parameter.
    * 
    * @author <a href="mailto:mark_orciuch@ngsltd.com">Mark Orciuch</a>
    * @version $Id$
    */
  -public class CheckBox extends ParameterPresentationStyle
  +public class CheckBox extends VelocityParameterPresentationStyle
   {
   
       public static final String ROWS = "rows";
       public static final String COLS = "cols";
  -
  -    /**
  -     * Returns presentation control
  -     */
  -    public String getContent(RunData data, String name, String value, Map parms)
  -    {
  -
  -        Input cb = new Input(Input.CHECKBOX, name, 1);
  -        cb.setChecked(new Boolean(value).booleanValue());
  -
  -        return cb.toString();
  -
  -    }
   
   }
  
  
  
  1.2       +2 -23     jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/TextArea.java
  
  Index: TextArea.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/modules/parameters/TextArea.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TextArea.java	20 Aug 2002 17:37:18 -0000	1.1
  +++ TextArea.java	6 Jun 2003 19:42:16 -0000	1.2
  @@ -54,12 +54,6 @@
   
   package org.apache.jetspeed.modules.parameters;
   
  -//turbine support
  -import org.apache.turbine.util.RunData;
  -
  -// java stuff
  -import java.util.Map;
  -
   /**
    * Returns texarea control intialized with the value parameter using the following options:
    * <UL>
  @@ -70,25 +64,10 @@
    * @author <a href="mailto:mark_orciuch@ngsltd.com">Mark Orciuch</a>
    * @version $Id$
    */
  -public class TextArea extends ParameterPresentationStyle
  +public class TextArea extends JspParameterPresentationStyle
   {
   
       public static final String ROWS = "rows";
       public static final String COLS = "cols";
  -
  -    /**
  -     * Returns presentation control
  -     */
  -    public String getContent(RunData data, String name, String value, Map parms)
  -    {
  -
  -        String rows = (String)this.getParm(this.ROWS, "3");
  -        String cols = (String)this.getParm(this.COLS, "80");
  -
  -        org.apache.ecs.html.TextArea tx = new org.apache.ecs.html.TextArea(name, rows, cols).addElement(value);
  -
  -        return tx.toString();
  -
  -    }
   
   }
  
  
  
  1.1                  jakarta-jetspeed/webapp/WEB-INF/templates/jsp/parameters/html/TextArea.jsp
  
  Index: TextArea.jsp
  ===================================================================
  <%@ page import = "java.util.Map" %>
  
  <%
  /**
   * Returns texarea control intialized with the value parameter using the following options:
   * <UL>
   * <LI><code>rows</code>: number of rows (default = 3)</LI>
   * <LI><code>cols</code>: number of columns (default = 80)</LI> 
   *</UL>
   * 
   * @author <a href="mailto:morciuch@apache.org">Mark Orciuch</a>
   * @version $Id: TextArea.jsp,v 1.1 2003/06/06 19:42:16 morciuch Exp $
   */
  
  Map parms = (Map) request.getAttribute("parms");          
  String rows = (String) parms.get("rows"); rows = rows != null ? rows : "3";
  String cols = (String) parms.get("cols"); cols = cols != null ? cols : "80";
  %>
  
  <textarea name="<%=request.getAttribute("name")%>" rows="<%=rows%>" cols="<%=cols%>">
  <%=request.getAttribute("value")%>
  </textarea>
  
  
  
  1.1                  jakarta-jetspeed/webapp/WEB-INF/templates/vm/parameters/html/CheckBox.vm
  
  Index: CheckBox.vm
  ===================================================================
  <input type="checkbox" name="$name" value="1" #if ($value != "") checked #end>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org