You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2007/02/20 23:47:18 UTC

svn commit: r509788 - in /myfaces/tobago/trunk/example/addressbook/src/main: java/org/apache/myfaces/tobago/example/addressbook/ java/org/apache/myfaces/tobago/example/addressbook/web/ resources/META-INF/ resources/error/ webapp/ webapp/WEB-INF/ webapp...

Author: bommel
Date: Tue Feb 20 14:47:16 2007
New Revision: 509788

URL: http://svn.apache.org/viewvc?view=rev&rev=509788
Log:
improved addressbook

Added:
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java   (contents, props changed)
      - copied, changed from r509469, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAO.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDaoException.java   (contents, props changed)
      - copied, changed from r509280, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAOException.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java   (contents, props changed)
      - copied, changed from r509469, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDAO.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java   (contents, props changed)
      - copied, changed from r509469, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Controller.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Countries.java   (contents, props changed)
      - copied, changed from r509280, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Countries.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java   (contents, props changed)
      - copied, changed from r509280, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressConverter.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Layout.java
      - copied, changed from r509280, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Layout.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/MessageUtils.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java
      - copied, changed from r509469, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/PictureServlet.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/SelectItemComparator.java
    myfaces/tobago/trunk/example/addressbook/src/main/resources/error/
    myfaces/tobago/trunk/example/addressbook/src/main/resources/error/messages.properties
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-de.png   (with props)
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-gb.png   (with props)
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-us.png   (with props)
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource.properties
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_de.properties
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_GB.properties
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_US.properties
Removed:
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressConverter.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAO.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAOException.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Controller.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Countries.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDAO.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Layout.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/PictureServlet.java
Modified:
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDAO.java
    myfaces/tobago/trunk/example/addressbook/src/main/resources/META-INF/persistence.xml
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/faces-config.xml
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tobago-config.xml
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/web.xml
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/editor.jsp
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/list.jsp
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook.properties.xml
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook_de.properties.xml

Modified: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Address.java Tue Feb 20 14:47:16 2007
@@ -17,12 +17,6 @@
  * limitations under the License.
  */
 
-/*
- * Created 29.11.2004 17:25:39.
- * $Id: Address.java,v 1.1.1.1 2004/12/15 12:51:35 lofwyr Exp $
- */
-
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -30,10 +24,6 @@
 import javax.persistence.Id;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
-import javax.persistence.Embedded;
-import javax.persistence.AttributeOverrides;
-import javax.persistence.AttributeOverride;
-import javax.persistence.Column;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
@@ -42,6 +32,7 @@
 import javax.persistence.PostLoad;
 import javax.persistence.OneToOne;
 import javax.persistence.CascadeType;
+import javax.persistence.Version;
 import java.util.Date;
 import java.util.Locale;
 
@@ -52,6 +43,8 @@
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
   private Integer id;
+  @Version
+  private Integer revision;
   private String firstName;
   private String lastName;
   private String street;
@@ -64,8 +57,9 @@
   private String phone;
   private String mobile;
   private String fax;
-  @Embedded
+  @Transient
   private EmailAddress email;
+  private String emailStr;
   private String icq;
   private String homePage;
   @Temporal(TemporalType.DATE)
@@ -74,15 +68,13 @@
   private String company;
   private String jobTitle;
   private String jobPhone;
-  @Embedded
-  @AttributeOverrides(@AttributeOverride(name="email", column = @Column(name = "jobEmail")))
+  @Transient
   private EmailAddress jobEmail;
+  private String jobEmailStr;
   private String jobHomePage;
   @OneToOne(cascade = {CascadeType.ALL})
   private Picture picture;
 
- 
-
   public Address() {
     LOG.debug("Creating new Address");
   }
@@ -116,12 +108,25 @@
     if (country != null) {
       countryCode = country.getCountry();
     }
+    if (email != null) {
+      emailStr = email.getEmail();
+    }
+    if (jobEmail != null) {
+      jobEmailStr = jobEmail.getEmail();
+    }
   }
+  
   @PostLoad
   private void load() {
     if (countryCode != null) {
       country = new Locale("", countryCode);
     }
+    if (emailStr != null) {
+      email = new EmailAddress(emailStr);
+    }
+    if (jobEmailStr != null) {
+      jobEmail = new EmailAddress(jobEmailStr);
+    }
   }
 
   public Integer getId() {
@@ -217,6 +222,9 @@
   }
 
   public void setEmail(EmailAddress email) {
+    if (email != null) {
+      emailStr = email.getEmail();
+    }
     this.email = email;
   }
 
@@ -281,6 +289,9 @@
   }
 
   public void setJobEmail(EmailAddress jobEmail) {
+    if (jobEmail != null) {
+      jobEmailStr = jobEmail.getEmail();
+    }
     this.jobEmail = jobEmail;
   }
 

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java (from r509469, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAO.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java?view=diff&rev=509788&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAO.java&r1=509469&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAO.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java Tue Feb 20 14:47:16 2007
@@ -24,13 +24,13 @@
 
 import java.util.List;
 
-public interface AddressDAO {
+public interface AddressDao {
 
-  Address updateAddress(Address address) throws AddressDAOException;
+  Address updateAddress(Address address) throws AddressDaoException;
 
-  List<Address> findAddresses() throws AddressDAOException;
+  List<Address> findAddresses() throws AddressDaoException;
 
-  void removeAddress(Address address) throws AddressDAOException;
+  void removeAddress(Address address) throws AddressDaoException;
 
   Address getAddress(Integer id);
 }

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDao.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDaoException.java (from r509280, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAOException.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDaoException.java?view=diff&rev=509788&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAOException.java&r1=509280&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDaoException.java&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDAOException.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDaoException.java Tue Feb 20 14:47:16 2007
@@ -17,20 +17,20 @@
  * limitations under the License.
  */
 
-public class AddressDAOException extends Exception {
+public class AddressDaoException extends Exception {
   
-  public AddressDAOException() {
+  public AddressDaoException() {
   }
 
-  public AddressDAOException(String message) {
+  public AddressDaoException(String message) {
     super(message);
   }
 
-  public AddressDAOException(String message, Throwable cause) {
+  public AddressDaoException(String message, Throwable cause) {
     super(message, cause);
   }
 
-  public AddressDAOException(Throwable cause) {
+  public AddressDaoException(Throwable cause) {
     super(cause);
   }
 

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressDaoException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/EmailAddress.java Tue Feb 20 14:47:16 2007
@@ -17,16 +17,11 @@
  * limitations under the License.
  */
 
-import javax.persistence.Embeddable;
 
-@Embeddable
 public class EmailAddress {
 
   private String email;
 
-  public EmailAddress() {
-  }
-
   public EmailAddress(String email) {
     this.email = email;
   }
@@ -39,8 +34,40 @@
     this.email = email;
   }
 
+  public String getLocalPart() {
+    String[] parts = email.split("@");
+    return parts[0];
+  }
+
+  public String getDomain() {
+    String[] parts = email.split("@");
+    return parts[1];
+  }
+
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+
+    EmailAddress that = (EmailAddress) o;
+
+    if (email != null ? !email.equals(that.email) : that.email != null) {
+      return false;
+    }
+
+    return true;
+  }
+
+  public int hashCode() {
+    return (email != null ? email.hashCode() : 0);
+  }
+
+  @Override
   public String toString() {
-    return email;
+     return email;
   }
 
 }

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java (from r509469, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDAO.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java?view=diff&rev=509788&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDAO.java&r1=509469&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDAO.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java Tue Feb 20 14:47:16 2007
@@ -30,13 +30,13 @@
 import java.util.Iterator;
 import java.util.List;
 
-public class InMemoryAddressDAO implements AddressDAO {
+public class InMemoryAddressDao implements AddressDao {
 
-  private static final Log LOG = LogFactory.getLog(InMemoryAddressDAO.class);
+  private static final Log LOG = LogFactory.getLog(InMemoryAddressDao.class);
 
   private List<Address> addresses;
 
-  public InMemoryAddressDAO() {
+  public InMemoryAddressDao() {
     addresses = new ArrayList<Address>();
   }
 

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/InMemoryAddressDao.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDAO.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDAO.java?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDAO.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDAO.java Tue Feb 20 14:47:16 2007
@@ -25,19 +25,14 @@
 
 import java.util.List;
 
-/*
- * Created by IntelliJ IDEA.
- * User: bommel
- * Date: Feb 18, 2007
- * Time: 1:14:29 PM
- */
+
 @Repository
 @Transactional()
-public class JpaAddressDAO extends JpaDaoSupport implements AddressDAO {
+public class JpaAddressDAO extends JpaDaoSupport implements AddressDao {
 
   private static final Log LOG = LogFactory.getLog(JpaAddressDAO.class);
 
-  public Address updateAddress(Address address) throws AddressDAOException {
+  public Address updateAddress(Address address) throws AddressDaoException {
     if (address.getId() == null) {
       getJpaTemplate().persist(address);
     } else {
@@ -50,11 +45,11 @@
     return address;
   }
 
-  public List<Address> findAddresses() throws AddressDAOException{
+  public List<Address> findAddresses() throws AddressDaoException {
     return getJpaTemplate().find("select a from Address a");
   }
 
-  public  void removeAddress(Address address) throws AddressDAOException {
+  public  void removeAddress(Address address) throws AddressDaoException {
     address = getAddress(address.getId());
     getJpaTemplate().remove(address);
   }

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java (from r509469, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Controller.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java?view=diff&rev=509788&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Controller.java&r1=509469&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Controller.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java Tue Feb 20 14:47:16 2007
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.addressbook;
+package org.apache.myfaces.tobago.example.addressbook.web;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -25,14 +25,31 @@
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.WordUtils;
 import org.apache.myfaces.tobago.model.SheetState;
-import org.springframework.context.ApplicationContext;
-import org.springframework.web.jsf.FacesContextUtils;
+import org.apache.myfaces.tobago.context.Theme;
+import org.apache.myfaces.tobago.context.ClientProperties;
+import org.apache.myfaces.tobago.config.TobagoConfig;
+import org.apache.myfaces.tobago.example.addressbook.web.Countries;
+import org.apache.myfaces.tobago.example.addressbook.Address;
+import org.apache.myfaces.tobago.example.addressbook.AddressDao;
+import org.apache.myfaces.tobago.example.addressbook.AddressDaoException;
+import org.apache.myfaces.tobago.example.addressbook.Picture;
 
 import javax.faces.application.FacesMessage;
+import javax.faces.application.Application;
 import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.EditableValueHolder;
+import javax.faces.validator.ValidatorException;
+import javax.faces.convert.DateTimeConverter;
 import java.util.Collections;
 import java.util.List;
+import java.util.Locale;
+import java.util.ArrayList;
+import java.util.Iterator;
 
 public class Controller {
 
@@ -45,30 +62,56 @@
   private Address currentAddress;
   private SheetState selectedAddresses;
 
+  private String searchCriterion;
+
+  private Locale language;
+
+  private List<SelectItem> languages = new ArrayList<SelectItem>();
+
+  private Countries countries;
+
+  private Theme theme;
+
+  private List<SelectItem> themeItems = new ArrayList<SelectItem>();
+
+  private boolean simple;
+
   private boolean renderPopup;
   private boolean renderFirstName = true;
   private boolean renderLastName = true;
   private boolean renderDayOfBirth = false;
 
-  private AddressDAO addressDAO;
+  private AddressDao addressDao;
 
   private FileItem uploadedFile;
   private boolean renderFileUploadPopup;
 
   public Controller() {
-    LOG.debug("Creating new Controller");
-    System.err.println("Controller " + this);
+    FacesContext facesContext = FacesContext.getCurrentInstance();
+    Application application = facesContext.getApplication();
+    language = application.getDefaultLocale();
+    facesContext.getExternalContext().getSession(true);
+    initLanguages();
+
+    TobagoConfig tobagoConfig = TobagoConfig.getInstance(facesContext);
+    List<Theme> themes = new ArrayList<Theme>(tobagoConfig.getSupportedThemes());
+    themes.add(0, tobagoConfig.getDefaultTheme());
+    themeItems = new ArrayList<SelectItem>();
+    for (Theme theme : themes) {
+      themeItems.add(new SelectItem(theme, theme.getDisplayName()));
+    }
+
+    ClientProperties client = ClientProperties.getInstance(facesContext);
+    theme = client.getTheme();
   }
 
-  public void setAddressDAO(AddressDAO addressDAO) throws AddressDAOException {
-    this.addressDAO = addressDAO;
-    LOG.debug("AddressDAO set.");
-    ApplicationContext ctx
-        = FacesContextUtils.getWebApplicationContext(FacesContext.getCurrentInstance());
-    LOG.debug("applicationContext: "+ctx);
-    currentAddressList = addressDAO.findAddresses();
-    currentAddress = new Address();
+  public void setAddressDAO(AddressDao addressDao) throws AddressDaoException {
+    this.addressDao = addressDao;
+    currentAddressList = addressDao.findAddresses();
+  }
 
+  public String search() throws AddressDaoException {
+    return OUTCOME_LIST;
   }
 
   public String createAddress() {
@@ -77,10 +120,6 @@
     return OUTCOME_EDITOR;
   }
 
-  public String cancelAddress() throws AddressDAOException {
-    currentAddressList = addressDAO.findAddresses();    
-    return OUTCOME_LIST;
-  }
 
   public String editAddress() {
     LOG.debug("action: editAddress");
@@ -94,16 +133,7 @@
     return OUTCOME_EDITOR;
   }
 
-  public String storeAddress() throws AddressDAOException {
-    LOG.debug("action: storeAddress");
-    currentAddress = addressDAO.updateAddress(currentAddress);
-    selectedAddresses.resetSelected();
-    currentAddressList = addressDAO.findAddresses();
-    return OUTCOME_LIST;
-  }
-
-  public String deleteAddresses() throws AddressDAOException {
-    LOG.debug("action: deleteAddresses");
+  public String deleteAddresses() throws AddressDaoException {
     List<Integer> selection = selectedAddresses.getSelectedRows();
     if (selection.size() < 1) {
       FacesMessage error = new FacesMessage("Please select at least one address.");
@@ -113,13 +143,61 @@
     Collections.sort(selection); // why?
     for (int i = selection.size() - 1; i >= 0; i--) {
       Address address = currentAddressList.get(selection.get(i));
-      addressDAO.removeAddress(address);
+      addressDao.removeAddress(address);
     }
     selectedAddresses.resetSelected();
-    currentAddressList = addressDAO.findAddresses();
+    currentAddressList = addressDao.findAddresses();
+    return OUTCOME_LIST;
+  }
+
+  public String store() throws AddressDaoException {
+    LOG.debug("action: storeAddress");
+    currentAddress = addressDao.updateAddress(currentAddress);
+    selectedAddresses.resetSelected();
+    currentAddressList = addressDao.findAddresses();
+    return OUTCOME_LIST;
+  }
+
+  public String cancel() throws AddressDaoException {
+    currentAddressList = addressDao.findAddresses();
     return OUTCOME_LIST;
   }
 
+  public String languageChanged() {
+    FacesContext facesContext = FacesContext.getCurrentInstance();
+    countries.init(language);
+    initLanguages();
+
+    // reinit date converter
+    UIViewRoot viewRoot = facesContext.getViewRoot();
+    EditableValueHolder component = (EditableValueHolder)
+        viewRoot.findComponent(":page:dayOfBirth");
+    if (component != null) {
+      DateTimeConverter converter = (DateTimeConverter) component.getConverter();
+      converter.setPattern(MessageUtils.getLocalizedString(facesContext, "editorDatePattern"));
+    }
+    return null;
+  }
+
+  public String themeChanged() {
+    FacesContext facesContext = FacesContext.getCurrentInstance();
+    ClientProperties client = ClientProperties.getInstance(facesContext);
+    client.setTheme(theme);
+    return null;
+  }
+
+  public void validatePhoneNumber(
+      FacesContext context, UIComponent component, Object value) {
+    String phoneNumber = (String) value;
+    if (phoneNumber == null || phoneNumber.length() == 0) {
+      return;
+    }
+    if (!phoneNumber.matches("\\+?[0-9 ]*(\\([0-9 ]*\\))?[0-9 ]*")) {
+      throw new ValidatorException(MessageUtils.createErrorMessage(
+          "validator_phone", context));
+    }
+  }
+
   public List getCurrentAddressList() {
     return currentAddressList;
   }
@@ -141,13 +219,13 @@
   }
 
   public void setRenderFileUploadPopup(boolean renderFileUploadPopup) {
-    LOG.debug(">>> "+renderFileUploadPopup);
+    LOG.debug(">>> " + renderFileUploadPopup);
     this.renderFileUploadPopup = renderFileUploadPopup;
   }
 
   public String cancelFileUploadPopup() {
     setRenderFileUploadPopup(false);
-    return OUTCOME_EDITOR;
+    return null;
   }
 
   public void setRenderPopup(boolean renderPopup) {
@@ -181,6 +259,61 @@
     return OUTCOME_LIST;
   }
 
+  public Locale getLanguage() {
+    return language;
+  }
+
+  public String getDisplayLanguage() {
+    return language.getDisplayName(language);
+  }
+
+  public void setLanguage(Locale language) {
+    this.language = language;
+  }
+
+  public List<SelectItem> getLanguages() {
+    return languages;
+  }
+
+  public void setLanguages(List<SelectItem> languages) {
+    this.languages = languages;
+  }
+
+  public Countries getCountries() {
+    return countries;
+  }
+
+  public void setCountries(Countries countries) {
+    this.countries = countries;
+    countries.init(language);
+  }
+
+  public List<SelectItem> getThemeItems() {
+    return themeItems;
+  }
+
+  public Theme getTheme() {
+    return theme;
+  }
+
+  @Deprecated
+  public String getThemeName() {
+    return WordUtils.capitalize(theme.getDisplayName());
+  }
+
+  public void setTheme(Theme theme) {
+    this.theme = theme;
+  }
+
+
+  public boolean isSimple() {
+    return simple;
+  }
+
+  public void setSimple(boolean simple) {
+    this.simple = simple;
+  }
+
   public boolean isRenderFirstName() {
     return renderFirstName;
   }
@@ -216,6 +349,19 @@
   public String popupFileUpload() {
     setRenderFileUploadPopup(true);
     return null;
+  }
+
+  private void initLanguages() {
+    languages.clear();
+    FacesContext facesContext = FacesContext.getCurrentInstance();
+    Application application = facesContext.getApplication();
+    Iterator supportedLocales = application.getSupportedLocales();
+    while (supportedLocales.hasNext()) {
+      Locale locale = (Locale) supportedLocales.next();
+      SelectItem item = new SelectItem(locale, locale.getDisplayName(language));
+      languages.add(item);
+    }
+    Collections.sort(languages, new SelectItemComparator());
   }
 
 }

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Countries.java (from r509280, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Countries.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Countries.java?view=diff&rev=509788&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Countries.java&r1=509280&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Countries.java&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Countries.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Countries.java Tue Feb 20 14:47:16 2007
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.addressbook;
+package org.apache.myfaces.tobago.example.addressbook.web;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -17,28 +17,25 @@
  * limitations under the License.
  */
 
-/*
- * Created 02.12.2004 21:42:13.
- * $Id: Countries.java,v 1.1.1.1 2004/12/15 12:51:35 lofwyr Exp $
- */
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 import javax.faces.model.SelectItem;
 import java.util.ArrayList;
 import java.util.Locale;
+import java.util.Collections;
 
-public class Countries extends ArrayList {
-
-  private static final Log LOG = LogFactory.getLog(Countries.class);
+public class Countries extends ArrayList<SelectItem> {
 
-  public Countries() {
-    LOG.debug("Creating new Countries object.");
-    Locale language = Locale.US;
-    add(new SelectItem(Locale.GERMANY, Locale.GERMANY.getDisplayCountry(language)));
-    add(new SelectItem(Locale.UK, Locale.UK.getDisplayCountry(language)));
-    add(new SelectItem(Locale.US, Locale.US.getDisplayCountry(language)));
-    add(new SelectItem(Locale.CHINA, Locale.CHINA.getDisplayCountry(language)));
+  public void init(Locale language) {
+    clear();
+    Locale[] availableLocales = Locale.getAvailableLocales();
+    for (Locale locale : availableLocales) {
+      String displayCountry = locale.getDisplayCountry(language);
+      if (displayCountry != null && displayCountry.length() > 0) {
+        add(new SelectItem(locale, displayCountry));
+      }
+    }
+    Collections.sort(this, new SelectItemComparator());
   }
 }

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Countries.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java (from r509280, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressConverter.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java?view=diff&rev=509788&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressConverter.java&r1=509280&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/AddressConverter.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java Tue Feb 20 14:47:16 2007
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.addressbook;
+package org.apache.myfaces.tobago.example.addressbook.web;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -24,19 +24,26 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.tobago.example.addressbook.EmailAddress;
 
 import javax.faces.component.UIComponent;
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
 
-public class AddressConverter implements Converter {
+public class EmailAddressConverter implements Converter {
 
-  private static final Log LOG = LogFactory.getLog(AddressConverter.class);
+  private static final Log LOG = LogFactory.getLog(EmailAddressConverter.class);
 
   public Object getAsObject(
       FacesContext facesContext, UIComponent component, String reference) {
     if (reference == null || reference.length() == 0) {
       return null;
+    }
+    String[] parts = reference.split("@");
+    if (parts == null || parts.length != 2) {
+      throw new ConverterException(MessageUtils.createErrorMessage(
+          "converterEmailParts", facesContext));
     }
     return new EmailAddress(reference);
   }

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressConverter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/EmailAddressValidator.java Tue Feb 20 14:47:16 2007
@@ -0,0 +1,62 @@
+package org.apache.myfaces.tobago.example.addressbook.web;
+
+
+/*
+ * 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.
+ */
+
+import org.apache.myfaces.tobago.example.addressbook.EmailAddress;
+
+import javax.faces.validator.Validator;
+import javax.faces.validator.ValidatorException;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+
+public class EmailAddressValidator implements Validator {
+
+  private static final String EMAIL_ATOM
+      = "[^()<>@,;:\\\\.\\[\\]\\\"]";
+  private static final String LOCAL_PART_SPEC
+      = EMAIL_ATOM + "+(\\." + EMAIL_ATOM + "+)*";
+  private static final String DOMAIN_SPEC
+      = EMAIL_ATOM + "+(\\." + EMAIL_ATOM + "+)+";
+
+  private static final Pattern LOCAL_PART_PATTERN
+      = Pattern.compile(LOCAL_PART_SPEC);
+  private static final Pattern DOMAIN_PATTERN
+      = Pattern.compile(DOMAIN_SPEC);
+
+  public void validate(
+      FacesContext facesContext, UIComponent uiComponent, Object value)
+      throws ValidatorException {
+    EmailAddress emailAddress = (EmailAddress) value;
+
+    Matcher matcher = LOCAL_PART_PATTERN.matcher(emailAddress.getLocalPart());
+    if (!matcher.matches()) {
+      throw new ValidatorException(MessageUtils.createErrorMessage(
+          "validatorEmailLocalPart", facesContext));
+    }
+
+    matcher = DOMAIN_PATTERN.matcher(emailAddress.getDomain());
+    if (!matcher.matches()) {
+      throw new ValidatorException(MessageUtils.createErrorMessage(
+          "validatorEmailDomain", facesContext));
+    }
+  }
+
+}

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Layout.java (from r509280, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Layout.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Layout.java?view=diff&rev=509788&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Layout.java&r1=509280&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Layout.java&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/Layout.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Layout.java Tue Feb 20 14:47:16 2007
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.addressbook;
+package org.apache.myfaces.tobago.example.addressbook.web;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -19,12 +19,6 @@
 
 import org.apache.myfaces.tobago.model.PageStateImpl;
 
-/*
- * Created by IntelliJ IDEA.
- * User: bommel
- * Date: Nov 9, 2006
- * Time: 10:12:22 AM
- */
 public class Layout extends PageStateImpl {
 
   private int width;

Added: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/LocaleConverter.java Tue Feb 20 14:47:16 2007
@@ -0,0 +1,60 @@
+package org.apache.myfaces.tobago.example.addressbook.web;
+
+/*
+ * 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.
+ */
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+import java.util.Locale;
+
+public class LocaleConverter implements Converter {
+
+  public Object getAsObject(
+      FacesContext facesContext, UIComponent component, String value) {
+    Locale locale = createLocale(value);
+    if (locale == null) {
+      throw new ConverterException(MessageUtils.getLocalizedString(
+          facesContext, "converterLocaleParserError", value));
+    }
+    return locale;
+  }
+
+  public String getAsString(
+      FacesContext facesContext, UIComponent component, Object value) {
+    return value == null ? null : value.toString();
+  }
+
+  public static Locale createLocale(String value) {
+    Locale locale = null;
+    String[] strings = value.split("_");
+    switch (strings.length) {
+      case 1:
+        locale = new Locale(strings[0]);
+        break;
+      case 2:
+        locale = new Locale(strings[0], strings[1]);
+        break;
+      case 3:
+        locale = new Locale(strings[0], strings[1], strings[2]);
+        break;
+    }
+    return locale;
+  }
+
+}

Added: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/MessageUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/MessageUtils.java?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/MessageUtils.java (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/MessageUtils.java Tue Feb 20 14:47:16 2007
@@ -0,0 +1,59 @@
+package org.apache.myfaces.tobago.example.addressbook.web;
+
+/*
+ * 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.
+ */
+
+import javax.faces.context.FacesContext;
+import javax.faces.application.FacesMessage;
+import java.util.ResourceBundle;
+import java.text.MessageFormat;
+
+public class MessageUtils {
+
+  private MessageUtils() {
+  }
+
+  public static String getLocalizedString(FacesContext facesContext, String key) {
+    ResourceBundle bundle = ResourceBundle.getBundle(
+        facesContext.getApplication().getMessageBundle(),
+        facesContext.getViewRoot().getLocale());
+    return bundle.getString(key);
+  }
+
+  public static String getLocalizedString(FacesContext facesContext,
+      String key, String value) {
+    return MessageFormat.format(
+        getLocalizedString(facesContext, key), value);
+  }
+
+  public static String getLocalizedString(FacesContext facesContext,
+      String key, int value) {
+    return MessageFormat.format(
+        getLocalizedString(facesContext, key), value);
+  }
+
+  public static FacesMessage createErrorMessage(
+      String key, FacesContext facesContext) {
+    FacesMessage message = new FacesMessage();
+    // TODO _detail
+    message.setDetail(getLocalizedString(facesContext, key));
+    message.setSummary(getLocalizedString(facesContext, key));
+    message.setSeverity(FacesMessage.SEVERITY_ERROR);
+    return message;
+  }
+
+}

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java (from r509469, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/PictureServlet.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java?view=diff&rev=509788&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/PictureServlet.java&r1=509469&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/PictureServlet.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/PictureServlet.java Tue Feb 20 14:47:16 2007
@@ -1,4 +1,4 @@
-package org.apache.myfaces.tobago.example.addressbook;
+package org.apache.myfaces.tobago.example.addressbook.web;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
@@ -18,6 +18,9 @@
  */
 
 import org.apache.myfaces.tobago.util.VariableResolverUtil;
+import org.apache.myfaces.tobago.example.addressbook.web.Controller;
+import org.apache.myfaces.tobago.example.addressbook.Address;
+import org.apache.myfaces.tobago.example.addressbook.Picture;
 import org.apache.commons.io.IOUtils;
 
 import javax.servlet.http.HttpServlet;
@@ -33,12 +36,6 @@
 import java.io.ByteArrayInputStream;
 
 
-/*
- * Created by IntelliJ IDEA.
- * User: bommel
- * Date: Feb 19, 2007
- * Time: 8:09:49 PM
- */
 public class PictureServlet extends HttpServlet {
 
   protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

Added: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/SelectItemComparator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/SelectItemComparator.java?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/SelectItemComparator.java (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/SelectItemComparator.java Tue Feb 20 14:47:16 2007
@@ -0,0 +1,29 @@
+package org.apache.myfaces.tobago.example.addressbook.web;
+
+/*
+ * 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.
+ */
+
+import javax.faces.model.SelectItem;
+import java.util.Comparator;
+
+public class SelectItemComparator implements Comparator<SelectItem> {
+
+  public int compare(SelectItem s1, SelectItem s2) {
+    return s1.getLabel().compareTo(s2.getLabel());
+  }
+
+}

Modified: myfaces/tobago/trunk/example/addressbook/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/resources/META-INF/persistence.xml?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/resources/META-INF/persistence.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/resources/META-INF/persistence.xml Tue Feb 20 14:47:16 2007
@@ -21,7 +21,6 @@
 
     <persistence-unit name="addressBook" transaction-type="RESOURCE_LOCAL">
       <class>org.apache.myfaces.tobago.example.addressbook.Address</class>
-      <class>org.apache.myfaces.tobago.example.addressbook.EmailAddress</class>
       <class>org.apache.myfaces.tobago.example.addressbook.Picture</class>
     </persistence-unit>
 </persistence>

Added: myfaces/tobago/trunk/example/addressbook/src/main/resources/error/messages.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/resources/error/messages.properties?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/resources/error/messages.properties (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/resources/error/messages.properties Tue Feb 20 14:47:16 2007
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+
+# converter
+converterEmailParts=Exactly two eMail parts expected
+converterLocaleParserError=Cannot parse "{0}" to a locale.
+
+# validator
+validatorEmailLocalPart=eMail address is not valid: local part
+validatorEmailDomain=eMail address is not valid: domain
+validatorPhone=Invalid phone number
+
+

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/faces-config.xml?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/faces-config.xml Tue Feb 20 14:47:16 2007
@@ -22,16 +22,22 @@
     "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
 
 <faces-config>
-
+  
   <application>
     <action-listener>org.apache.myfaces.tobago.util.DebugActionListener</action-listener>
     <navigation-handler>org.apache.myfaces.tobago.util.DebugNavigationHandler</navigation-handler>
     <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
-    <locale-config>
-      <default-locale>en</default-locale>
+     <locale-config>
+      <default-locale>en_US</default-locale>
+      <supported-locale>de</supported-locale>
+      <supported-locale>en_GB</supported-locale>
+      <supported-locale>en_US</supported-locale>
     </locale-config>
+    <message-bundle>error.messages</message-bundle>
   </application>
 
+
+
   <lifecycle>
     <phase-listener>org.apache.myfaces.tobago.util.DebugPhaseListener</phase-listener>
   </lifecycle>
@@ -39,23 +45,27 @@
 
   <managed-bean>
     <managed-bean-name>controller</managed-bean-name>
-    <managed-bean-class>org.apache.myfaces.tobago.example.addressbook.Controller</managed-bean-class>
+    <managed-bean-class>org.apache.myfaces.tobago.example.addressbook.web.Controller</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
     <managed-property>
       <property-name>addressDAO</property-name>
       <value>#{addressDAO}</value>
     </managed-property>
+    <managed-property>
+      <property-name>countries</property-name>
+      <value>#{countries}</value>
+    </managed-property>
   </managed-bean>
 
   <managed-bean>
     <managed-bean-name>countries</managed-bean-name>
-    <managed-bean-class>org.apache.myfaces.tobago.example.addressbook.Countries</managed-bean-class>
-    <managed-bean-scope>application</managed-bean-scope>
+    <managed-bean-class>org.apache.myfaces.tobago.example.addressbook.web.Countries</managed-bean-class>
+    <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>
 
   <managed-bean>
     <managed-bean-name>layout</managed-bean-name>
-    <managed-bean-class>org.apache.myfaces.tobago.example.addressbook.Layout</managed-bean-class>
+    <managed-bean-class>org.apache.myfaces.tobago.example.addressbook.web.Layout</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
     <managed-property>
       <property-name>width</property-name>
@@ -75,7 +85,7 @@
     <managed-property>
       <property-name>minimumHeight</property-name>
       <property-class>int</property-class>
-      <value>500</value>
+      <value>600</value>
     </managed-property>
      <managed-property>
       <property-name>maximumWidth</property-name>
@@ -85,14 +95,24 @@
     <managed-property>
       <property-name>maximumHeight</property-name>
       <property-class>int</property-class>
-      <value>500</value>
+      <value>600</value>
     </managed-property>
 
   </managed-bean>
 
   <converter>
+    <converter-for-class>java.util.Locale</converter-for-class>
+    <converter-class>org.apache.myfaces.tobago.example.addressbook.web.LocaleConverter</converter-class>
+  </converter>
+
+  <validator>
+    <validator-id>EmailAddressValidator</validator-id>
+    <validator-class>org.apache.myfaces.tobago.example.addressbook.web.EmailAddressValidator</validator-class>
+  </validator>
+
+  <converter>
     <converter-for-class>org.apache.myfaces.tobago.example.addressbook.EmailAddress</converter-for-class>
-    <converter-class>org.apache.myfaces.tobago.example.addressbook.AddressConverter</converter-class>
+    <converter-class>org.apache.myfaces.tobago.example.addressbook.web.EmailAddressConverter</converter-class>
   </converter>
 
   <navigation-rule>

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tobago-config.xml?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/tobago-config.xml Tue Feb 20 14:47:16 2007
@@ -24,6 +24,8 @@
 
   <theme-config>
     <default-theme>speyside</default-theme>
+    <supported-theme>scarborough</supported-theme>
+    <supported-theme>richmond</supported-theme>
   </theme-config>
 
   <resource-dir>tobago-resource</resource-dir>

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/web.xml?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/web.xml Tue Feb 20 14:47:16 2007
@@ -58,7 +58,7 @@
 
   <servlet>
     <servlet-name>PictureServlet</servlet-name>
-    <servlet-class>org.apache.myfaces.tobago.example.addressbook.PictureServlet</servlet-class>
+    <servlet-class>org.apache.myfaces.tobago.example.addressbook.web.PictureServlet</servlet-class>
   </servlet>
 
   <!-- workaround for a bug in Bea Weblogic 8.1 SP 2 and older -->

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/editor.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/editor.jsp?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/editor.jsp (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/editor.jsp Tue Feb 20 14:47:16 2007
@@ -18,8 +18,8 @@
 <%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
 
-<f:view>
-  <tc:loadBundle basename="addressbook" var="bundle" />
+<f:view locale="#{controller.language}">
+  <tc:loadBundle basename="resource" var="bundle" />
 
   <tc:page label="#{bundle.editorTitle}"  state="#{layout}" width="#{layout.width}" height="#{layout.height}" >
 
@@ -35,7 +35,7 @@
 
         <tc:messages />
 
-        <tc:tabGroup>
+        <tc:tabGroup >
         <tc:tab label="#{bundle.editorTabPersonal}">
           <tc:panel>
             <f:facet name="layout">
@@ -50,7 +50,9 @@
                   <tc:gridLayout rows="fixed;fixed;fixed;fixed;fixed;*"/>
                 </f:facet>
                 <tx:in value="#{controller.currentAddress.firstName}"
-                       label="#{bundle.editorFirstName}" required="true"/>
+                       label="#{bundle.editorFirstName}" required="true">
+                  <f:validateLength minimum="2" maximum="20"/>
+                </tx:in>
 
                 <tx:label value="#{bundle.editorLastName}">
                   <tc:in value="#{controller.currentAddress.lastName}"
@@ -122,26 +124,32 @@
                   <tc:gridLayout rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;1*"/>
                 </f:facet>
                 <tx:in value="#{controller.currentAddress.phone}"
-                       label="#{bundle.editorPhone}"/>
+                    label="#{bundle.editorPhone}"
+                    validator="#{controller.validatePhoneNumber}"/>
 
                 <tx:in value="#{controller.currentAddress.mobile}"
-                       label="#{bundle.editorMobile}"/>
+                    label="#{bundle.editorMobile}"
+                    validator="#{controller.validatePhoneNumber}"/>
 
                 <tx:in value="#{controller.currentAddress.fax}"
-                       label="#{bundle.editorFax}"/>
+                    label="#{bundle.editorFax}"
+                    validator="#{controller.validatePhoneNumber}"/>
 
                 <tx:in value="#{controller.currentAddress.email}"
-                       label="#{bundle.editorEmail}"/>
+                       label="#{bundle.editorEmail}">
+                  <f:validator validatorId="EmailAddressValidator"/>
+                </tx:in>
 
                 <tx:in value="#{controller.currentAddress.icq}"
-                       label="#{bundle.editorIcq}"/>
-
+                       label="#{bundle.editorIcq}">
+                  <f:validateLongRange minimum="0"/>
+                </tx:in>
                 <tx:in value="#{controller.currentAddress.homePage}"
                        label="#{bundle.editorHomepage}"/>
 
-                <tx:date value="#{controller.currentAddress.dayOfBirth}"
+                <tx:date id="dayOfBirth" value="#{controller.currentAddress.dayOfBirth}"
                          label="#{bundle.editorBirthday}">
-                  <f:convertDateTime pattern="dd.MM.yyyy"/>
+                  <f:convertDateTime pattern="#{bundle.editorDatePattern}"/>
                 </tx:date>
 
                 <tc:cell/>
@@ -149,7 +157,7 @@
             </tc:panel>
           </tc:tab>
 
-          <tc:tab label="#{bundle.editorTabBusiness}">
+          <tc:tab label="#{bundle.editorTabBusiness}" rendered="#{!controller.simple}">
             <tc:panel>
               <f:facet name="layout">
                 <tc:gridLayout rows="fixed;fixed;fixed;fixed;fixed;1*" />
@@ -161,10 +169,13 @@
                   label="#{bundle.editorJobTitle}" />
 
               <tx:in value="#{controller.currentAddress.jobPhone}"
-                  label="#{bundle.editorPhone}" />
+                  label="#{bundle.editorPhone}"
+                  validator="#{controller.validatePhoneNumber}" />
 
               <tx:in value="#{controller.currentAddress.jobEmail}"
-                  label="#{bundle.editorEmail}" />
+                  label="#{bundle.editorEmail}" >
+                <f:validator validatorId="EmailAddressValidator"/>
+              </tx:in>
 
               <tx:in value="#{controller.currentAddress.jobHomePage}"
                   label="#{bundle.editorHomepage}" />
@@ -174,7 +185,7 @@
             </tc:panel>
           </tc:tab>
 
-          <tc:tab label="#{bundle.editorTabMisc}">
+          <tc:tab label="#{bundle.editorTabMisc}" rendered="#{!controller.simple}">
             <tc:panel>
               <f:facet name="layout">
                 <tc:gridLayout rows="1*" />
@@ -193,9 +204,9 @@
           </f:facet>
 
           <tc:cell />
-          <tc:button action="#{controller.storeAddress}"
+          <tc:button action="#{controller.store}"
               label="#{bundle.editorStore}" defaultCommand="true" />
-          <tc:button action="#{controller.cancelAddress}" immediate="true"
+          <tc:button action="#{controller.cancel}" immediate="true"
               label="#{bundle.editorCancel}" />
         </tc:panel>
 

Added: myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-de.png
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-de.png?view=auto&rev=509788
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-de.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-gb.png
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-gb.png?view=auto&rev=509788
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-gb.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-us.png
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-us.png?view=auto&rev=509788
==============================================================================
Binary file - no diff available.

Propchange: myfaces/tobago/trunk/example/addressbook/src/main/webapp/icon/flag-us.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/list.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/list.jsp?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/list.jsp (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/list.jsp Tue Feb 20 14:47:16 2007
@@ -15,15 +15,16 @@
  * limitations under the License.
 --%>
 <%@ taglib uri="http://myfaces.apache.org/tobago/component" prefix="tc" %>
+<%@ taglib uri="http://myfaces.apache.org/tobago/extension" prefix="tx" %>
 <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
-<f:view>
-  <tc:loadBundle basename="addressbook" var="bundle"/>
+<f:view locale="#{controller.language}">
+  <tc:loadBundle basename="resource" var="bundle"/>
 
   <tc:page label="#{bundle.listPageTitle}" state="#{layout}" width="#{layout.width}" height="#{layout.height}" >
 
     <tc:panel>
       <f:facet name="layout">
-        <tc:gridLayout margin="10px"/>
+        <tc:gridLayout margin="10px"  rows="1*;20px"/>
       </f:facet>
       <tc:box label="#{bundle.listBoxTitle}" >
         <f:facet name="layout">
@@ -90,6 +91,30 @@
         </tc:sheet>
 
       </tc:box>
+      <tc:panel>
+      <f:facet name="layout">
+        <tc:gridLayout columns="*;20px;*"/>
+      </f:facet>
+      <tc:form>
+        <tx:selectOneChoice label="#{bundle.footerLanguage}"
+               value="#{controller.language}">
+          <f:selectItems value="#{controller.languages}" />
+          <f:facet name="click">
+            <tc:command />
+          </f:facet>
+        </tx:selectOneChoice>
+      </tc:form>
+      <tc:image alt="#{bundle.footerFlag}" width="16" height="11"
+                value="#{bundle.footerFlagIcon}"/>
+      <tc:form>
+        <tx:selectOneChoice label="#{bundle.footerTheme}" value="#{controller.theme}">
+          <f:selectItems value="#{controller.themeItems}" />
+          <f:facet name="click">
+            <tc:command action="#{controller.themeChanged}"/>
+          </f:facet>
+        </tx:selectOneChoice>
+      </tc:form>
+    </tc:panel>
     </tc:panel>
   </tc:page>
 </f:view>

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook.properties.xml?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook.properties.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook.properties.xml Tue Feb 20 14:47:16 2007
@@ -19,7 +19,6 @@
 
 <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
 
-<!--# $Id: spellchecker.properties.xml,v 1.1 2005/09/09 14:50:08 lofwyr Exp $-->
 
 <properties>
 <!-- Editor -->

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook_de.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook_de.properties.xml?view=diff&rev=509788&r1=509787&r2=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook_de.properties.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/addressbook_de.properties.xml Tue Feb 20 14:47:16 2007
@@ -18,7 +18,7 @@
 
 <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
 
-<!--# $Id: spellchecker.properties.xml,v 1.1 2005/09/09 14:50:08 lofwyr Exp $-->
+
 
 <properties>
 

Added: myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource.properties?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource.properties (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource.properties Tue Feb 20 14:47:16 2007
@@ -0,0 +1,84 @@
+#
+# 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.
+#
+
+# editor
+editorPageTitle=Addressbook Editor
+editorTitle=Address Editor
+editorBoxTitle=Address Editor
+editorFirstName=First Name
+editorLastName=Last Name
+editorStreet=Street / No
+editorCity=ZIP / City
+editorCountry=Country
+editorPhone=Phone
+editorMobile=Mobile
+editorFax=Fax
+editorEmail=eMail
+editorIcq=ICQ
+editorHomepage=Homepage
+editorBirthday=Day of Birth
+editorDatePattern=MM/dd/yyyy
+editorJobCompany=Company
+editorJobTitle=Job Title
+editorJobPhone=Phone, business
+editorJobEmail=eMail, business
+editorJobHomepage=Company Homepage
+editorNote=Note
+editorStore=Store
+editorCancel=Cancel
+editorTabPersonal=Personal
+editorTabBusiness=Business
+editorTabMisc=Misc
+
+# address list
+listFilter=Search
+listSearch=Search
+listPageTitle=List Of Addresses
+listBoxTitle=Addresses
+listNew=New
+listEdit=Edit
+listDelete=Delete
+listFirstName=First Name
+listLastName=Last Name
+listDeleteConfirmation=Do you want to delete the selected addresses?
+listFooter={0,choice,0#No addresses|1#1 Address|1<{0,number,integer} Addresses}
+
+# footer
+footerLanguage=Language
+footerTheme=Theme
+footerFlag=Flag
+footerFlagIcon=icon/flag-us.png
+
+# menu
+menuFile=_File
+menuFileNew=_New
+menuSettings=_Settings
+menuSettingsLanguage=_Language
+menuSettingsTheme=_Theme
+menuSettingsMode=Simple _Mode
+menuHelp=_Help
+menuHelpAbout=_About
+
+# toolbar
+toolbarAddressList=Address List
+toolbarAbout=About
+aboutMessage=Addressbook Demo
+
+# error
+errorPageTitle=Error
+errorTitle=Error
+errorPageOk=OK
\ No newline at end of file

Added: myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_de.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_de.properties?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_de.properties (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_de.properties Tue Feb 20 14:47:16 2007
@@ -0,0 +1,83 @@
+#
+# 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.
+#
+
+# editor
+editorPageTitle=Adressbucheditor
+editorTitle=Adresseneditor
+editorFirstName=Vorname
+editorLastName=Nachname
+editorStreet=Stra\u00dfe / Nr.
+editorCity=PLZ / Stadt
+editorCountry=Land
+editorPhone=Telefon
+editorMobile=Handy
+editorFax=Fax
+editorEmail=eMail
+editorIcq=ICQ
+editorHomepage=Homepage
+editorBirthday=Geburtstag
+editorDatePattern=dd.MM.yyyy
+editorJobCompany=Firma
+editorJobTitle=Beruf
+editorJobPhone=Telefon, gesch\u00e4ftlich
+editorJobEmail=eMail, gesch\u00e4ftlich
+editorJobHomepage=Firmen-Homepage
+editorNote=Notiz
+editorStore=Speichern
+editorCancel=Abbrechen
+editorTabPersonal=Pers\u00f6nlich
+editorTabBusiness=Gesch\u00e4ftlich
+
+# address list
+listFilter=Suchen
+listSearch=Suchen
+listPageTitle=Adressen
+listBoxTitle=Adressen
+listNew=Neu
+listEdit=Editieren
+listDelete=L\u00f6schen
+listFirstName=Vorname
+listLastName=Nachname
+listDeleteConfirmation=Wollen Sie diesen Eintrag wirklich l\u00f6schen?
+listFooter={0,choice,0#Keine Adresse|1#1 Adresse|1<{0,number,integer} Adressen}
+
+# footer
+footerLanguage=Sprache
+footerTheme=Design
+footerFlag=Flagge
+footerFlagIcon=icon/flag-de.png
+
+
+# menu
+menuFile=_Datei
+menuFileNew=_Neue Adresse
+menuSettings=_Einstellungen
+menuSettingsLanguage=_Sprache
+menuSettingsTheme=Des_ign
+menuSettings_mode=Einfacher _Modus
+menuHelp=_Hilfe
+menuHelpAbout=_\u00dcber
+
+# toolbar
+toolbarAddressList=Adressliste
+toolbarAbout=\u00dcber
+aboutMessage=Adressbuch Demo
+
+# error
+errorPageTitle=Fehler
+errorTitle=Fehler
+errorPageOk=OK
\ No newline at end of file

Added: myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_GB.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_GB.properties?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_GB.properties (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_GB.properties Tue Feb 20 14:47:16 2007
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+# editor
+editorDatePattern=dd/MM/yyyy
+
+# footer
+footerFlagIcon=icon/flag-gb.png
\ No newline at end of file

Added: myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_US.properties
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_US.properties?view=auto&rev=509788
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_US.properties (added)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/tobago-resource/html/standard/standard/property/resource_en_US.properties Tue Feb 20 14:47:16 2007
@@ -0,0 +1,17 @@
+#
+# 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.
+#
+