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/03/17 09:09:00 UTC

svn commit: r519260 - in /myfaces/tobago/trunk/example/addressbook/src/main: java/org/apache/myfaces/tobago/example/addressbook/ java/org/apache/myfaces/tobago/example/addressbook/web/ webapp/WEB-INF/

Author: bommel
Date: Sat Mar 17 01:08:59 2007
New Revision: 519260

URL: http://svn.apache.org/viewvc?view=rev&rev=519260
Log:
DOA > doa

Added:
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java
      - copied, changed from r518244, myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDAO.java
Removed:
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDAO.java
Modified:
    myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml
    myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/faces-config.xml

Copied: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java (from r518244, 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=519260&p1=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDAO.java&r1=518244&p2=myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/JpaAddressDao.java&r2=519260
==============================================================================
--- 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 Sat Mar 17 01:08:59 2007
@@ -28,9 +28,9 @@
 
 @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);
+  private static final Log LOG = LogFactory.getLog(JpaAddressDao.class);
 
   public Address updateAddress(Address address) throws AddressDaoException {
     if (address.getId() == null) {

Modified: myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/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=519260&r1=519259&r2=519260
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/java/org/apache/myfaces/tobago/example/addressbook/web/Controller.java Sat Mar 17 01:08:59 2007
@@ -34,6 +34,8 @@
 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 org.apache.myfaces.tobago.event.SortActionEvent;
+import org.apache.myfaces.tobago.component.UIData;
 
 import javax.faces.application.FacesMessage;
 import javax.faces.application.Application;
@@ -44,6 +46,7 @@
 import javax.faces.component.EditableValueHolder;
 import javax.faces.validator.ValidatorException;
 import javax.faces.convert.DateTimeConverter;
+import javax.faces.event.ActionEvent;
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
@@ -104,10 +107,21 @@
     theme = client.getTheme();
   }
 
-  public void setAddressDAO(AddressDao addressDao) throws AddressDaoException {
+  public void setAddressDao(AddressDao addressDao) throws AddressDaoException {
     this.addressDao = addressDao;
     currentAddressList = addressDao.findAddresses();
   }
+
+  public void sheetSorter(ActionEvent event) {
+    if (event instanceof SortActionEvent) {
+      SortActionEvent sortEvent = (SortActionEvent) event;
+      UIData sheet = sortEvent.getSheet();
+      SheetState sheetState
+          = sheet.getSheetState(FacesContext.getCurrentInstance());
+      String columnId = sheetState.getSortedColumnId();
+    }
+  }
+
 
   public String search() throws AddressDaoException {
     return OUTCOME_LIST;

Modified: myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml?view=diff&rev=519260&r1=519259&r2=519260
==============================================================================
--- myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ myfaces/tobago/trunk/example/addressbook/src/main/webapp/WEB-INF/applicationContext.xml Sat Mar 17 01:08:59 2007
@@ -53,7 +53,7 @@
     <property name="dataSource" ref="dataSource"/>
   </bean>
 
-  <bean id="addressDAO" class="org.apache.myfaces.tobago.example.addressbook.JpaAddressDAO">
+  <bean id="addressDao" class="org.apache.myfaces.tobago.example.addressbook.JpaAddressDao">
     <property name="entityManagerFactory" ref="entityManagerFactory"/>
   </bean>
 

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=519260&r1=519259&r2=519260
==============================================================================
--- 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 Sat Mar 17 01:08:59 2007
@@ -48,8 +48,8 @@
     <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>
+      <property-name>addressDao</property-name>
+      <value>#{addressDao}</value>
     </managed-property>
     <managed-property>
       <property-name>countries</property-name>