<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE howto PUBLIC "-//APACHE//DTD How-to V1.0//EN" "http://apache.org/forrest/dtd/howto-v10.dtd">

<howto>

  <header>
    <title>How to build an XMLForm Wizard, Step Three</title>
    <authors>
      <person name="Heidi Brannan" email="heidi@wkwyw.net"/>
    </authors>
  <abstract></abstract>
  <last-modified-content-date date="2002-05-19"/>
  </header>

    <steps title="Step Three: JavaBean"> 
      <section>
        <title>HowToBean.java</title>
        <p>Next we create the simple JavaBean which holds the data filled in the form. Each value has a set and get method. Each value must map with the form data. This is done using JXPath.</p>
        <p>Copy the file below and save it as HowToBean.java in the folder \apache\xml-cocoon2\src\scratchpad\src\org\apache\cocoon\samples\xmlform</p>
        <source>
        <![CDATA[
package org.apache.cocoon.samples.xmlform;

import java.util.Set;
import java.util.HashSet;
import java.util.List;
import java.util.ArrayList;

import org.w3c.dom.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;

/**
 *
 * A sample domain object used as a Form model.
 * Notice that it has mixed content: 
 * JavaBean properties and 
 * DOM Nodes, which are handled correctly by the
 * framework when referenced via XPath.
 *
 */

public class HowToBean 
{
  private String username = "DonaldDuck";
  private String email = "donald@disney.com";
  private String password = "secret123";
  private boolean organicGardening = true;
  private boolean cooking = true;
  private boolean smallholdingManagement = true;
  private boolean flowers = true;
  private boolean vegetables = true;  
  private boolean fruitTrees = true;
  private boolean traditionalReciepes = true;
  private boolean soups = true;
  private boolean veganCookery = true;
  private boolean pigKeeping = true;
  private boolean pygmyGoats = true;
  private boolean henKeeping = true;
  private Node system;

  public HowToBean ()
  {
 
  }

  public String getUserName() {
    return username;
  }
  
  public void setUserName(String newUserName) {
    username = newUserName;
  }

  public String getPassword() {
    return password;
  }
  
  public void setPassword(String newPassword) {
    password = newPassword;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String newEmail) {
    email = newEmail;
  }
   
  public boolean getOrganicGardening() 
    {
    return organicGardening;
    }
  
  public void setOrganicGardening( boolean newOrganicGardening ) 
    {
    organicGardening = newOrganicGardening;
    }

  public boolean getCooking() 
    {
    return cooking;
    }
  
  public void setCooking( boolean newCooking ) 
    {
    cooking = newCooking;
    }
  
  public boolean getSmallholdingManagement() 
    {
    return smallholdingManagement;
    }
  
  public void setSmallholdingManagement( boolean newSmallholdingManagement ) 
    {
    smallholdingManagement = newSmallholdingManagement;
    }

  public boolean getFlowers() 
    {
    return flowers;
    }
  
  public void setFlowers( boolean newFlowers ) 
    {
    flowers = newFlowers;
    }

  public boolean getVegetables() 
    {
    return vegetables;
    }
  
  public void setVegetables( boolean newVegetables ) 
    {
    vegetables = newVegetables;
    }

  public boolean getFruitTrees() 
    {
    return fruitTrees;
    }
  
  public void setFruitTrees( boolean newFruitTrees ) 
    {
    fruitTrees = newFruitTrees;
    }

  public boolean getTraditionalReciepes() 
    {
    return traditionalReciepes;
    }
  
  public void setTraditionalReciepes( boolean newTraditionalReciepes ) 
    {
    traditionalReciepes = newTraditionalReciepes;
    }

  public boolean getSoups() 
    {
    return soups;
    }
  
  public void setSoups( boolean newSoups ) 
    {
    soups = newSoups;
    }

  public boolean getVeganCookery() 
    {
    return veganCookery;
    }
  
  public void setVeganCookery( boolean newVeganCookery ) 
    {
    veganCookery = newVeganCookery;
    }

  public boolean getPigKeeping() 
    {
    return pigKeeping;
    }
  
  public void setPigKeeping( boolean newPigKeeping ) 
    {
    pigKeeping = newPigKeeping;
    }
    
  public boolean getPygmyGoats() 
    {
    return pygmyGoats;
    }
  
  public void setPygmyGoats( boolean newPygmyGoats ) 
    {
    pygmyGoats = newPygmyGoats;
    }

  public boolean getHenKeeping() 
    {
    return henKeeping;
    }
  
  public void setHenKeeping( boolean newHenKeeping ) 
    {
    henKeeping = newHenKeeping;
    }
}
]]>
        </source>  
        <p>Now we move on to <link href="site:xmlform/step4">Step 4:HowtoWizardAction.java</link></p>
      
      
      </section>
    </steps>

</howto>
