[pal-cvs 2808] [552] added payment page.

svnno****@sourc***** svnno****@sourc*****
2007年 9月 9日 (日) 22:41:54 JST


Revision: 552
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=552
Author:   shinsuke
Date:     2007-09-09 22:41:53 +0900 (Sun, 09 Sep 2007)

Log Message:
-----------
added payment page.

Modified Paths:
--------------
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/PompeiConstants.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/dxo/DeliveryMethodDxo.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/DeliveryMethodSerivce.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/impl/DeliveryMethodServiceImpl.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodEditAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodListAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserAddressSelectAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserAddressSelectPage.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserInfoEditAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserInfoEditPage.java
    pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/checkoutConfirm.html
    pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/paymentSelect.html
    pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/userAddressSelect.html
    pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/userInfoEdit.html

Added Paths:
-----------
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectPage.java


-------------- next part --------------
Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/PompeiConstants.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/PompeiConstants.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/PompeiConstants.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -34,4 +34,24 @@
     public static final String BREADCRUMB = "breadcrumb";
 
     public static final String PRODUCTS_DESCRIPTION_LIST = "productsDescriptionList";
+
+    public static final String COD_PAYMENT_METHOD = "COD";
+
+    public static final String BANK_PAYMENT_METHOD = "BANK";
+
+    public static final String CARD_PAYMENT_METHOD = "CARD";
+
+    public static final String DELIVERY_ADDRESS_BOOK_ID = "deliveryAddressBookId";
+
+    public static final String PAYMENT_METHOD = "paymentMethod";
+
+    public static final String CARD_TYPE = "cardType";
+
+    public static final String CARD_NUMBER = "cardNumber";
+
+    public static final String CARD_OWNER = "cardOwner";
+
+    public static final String CARD_EXPIRES = "cardExpires";
+
+    public static final String DELIVERY_METHOD_ID = "deliveryMethodId";
 }

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/dxo/DeliveryMethodDxo.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/dxo/DeliveryMethodDxo.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/dxo/DeliveryMethodDxo.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -16,12 +16,17 @@
             + ",deliveryMethodId : deliveryMethodId"
             + ",deliveryClass : deliveryMethod.deliveryClass"
             + ",deliveryStatus : deliveryMethod.deliveryStatus")
-    void convert(List<DeliveryMethodDescription> deliveryMethod,
+    public void convert(List<DeliveryMethodDescription> deliveryMethod,
             List<Map<String, Object>> list);
 
-    void convert(DeliveryMethodDescription dmd, DeliveryMethodEditPage page);
+    @ConversionRule("label : deliveryMethodName" + ", value : deliveryMethodId")
+    public List<Map<String, String>> convert(List<DeliveryMethodDescription> dmd);
 
-    void convert(DeliveryMethodEditPage page, DeliveryMethod dm);
+    public void convert(DeliveryMethodDescription dmd,
+            DeliveryMethodEditPage page);
 
-    void convert(DeliveryMethodEditPage page, DeliveryMethodDescription dmd);
+    public void convert(DeliveryMethodEditPage page, DeliveryMethod dm);
+
+    public void convert(DeliveryMethodEditPage page,
+            DeliveryMethodDescription dmd);
 }

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/DeliveryMethodSerivce.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/DeliveryMethodSerivce.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/DeliveryMethodSerivce.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -8,15 +8,15 @@
 
 public interface DeliveryMethodSerivce extends Serializable {
 
-    public abstract List<DeliveryMethodDescription> getDeliveryMethodList();
+    public abstract List<DeliveryMethodDescription> getDeliveryMethodDescriptionList();
 
     public abstract DeliveryMethodDescription getDeliveryMethodDescription(
             BigDecimal deliveryMethodId);
 
-    public abstract void addDeliveryMethod(DeliveryMethodDescription d);
+    public abstract void addDeliveryMethodDescription(DeliveryMethodDescription d);
 
     public abstract void deleteDeliveryMethod(BigDecimal id);
 
-    public abstract void updateDeliveryMethod(DeliveryMethodDescription d);
+    public abstract void updateDeliveryMethodDescription(DeliveryMethodDescription d);
 
 }
\ No newline at end of file

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/impl/DeliveryMethodServiceImpl.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/impl/DeliveryMethodServiceImpl.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/impl/DeliveryMethodServiceImpl.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -55,7 +55,7 @@
     /* (non-Javadoc)
      * @see jp.sf.pal.pompei.service.impl.DeliveryMethodSerivce#getDeliveryMethodList()
      */
-    public List<DeliveryMethodDescription> getDeliveryMethodList() {
+    public List<DeliveryMethodDescription> getDeliveryMethodDescriptionList() {
         DeliveryMethodDescriptionCB cb = new DeliveryMethodDescriptionCB();
         cb.setupSelect_DeliveryMethod();
         cb.query().setLanguageId_Equal(new BigDecimal("1"));
@@ -84,7 +84,7 @@
     /* (non-Javadoc)
      * @see jp.sf.pal.pompei.service.impl.DeliveryMethodSerivce#addDeliveryMethod(jp.sf.pal.pompei.exentity.DeliveryMethodDescription)
      */
-    public void addDeliveryMethod(DeliveryMethodDescription d) {
+    public void addDeliveryMethodDescription(DeliveryMethodDescription d) {
         DeliveryMethod dm = d.getDeliveryMethod();
         dm.setDateAdded(new Timestamp(new Date().getTime()));
         dm.setLastModified(new Timestamp(new Date().getTime()));
@@ -115,7 +115,7 @@
     /* (non-Javadoc)
      * @see jp.sf.pal.pompei.service.impl.DeliveryMethodSerivce#updateDeliveryMethod(jp.sf.pal.pompei.exentity.DeliveryMethodDescription)
      */
-    public void updateDeliveryMethod(DeliveryMethodDescription d) {
+    public void updateDeliveryMethodDescription(DeliveryMethodDescription d) {
         DeliveryMethod c = d.getDeliveryMethod();
         c.setLastModified(new Timestamp(new Date().getTime()));
 

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodEditAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodEditAction.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodEditAction.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -75,7 +75,7 @@
             getDeliveryMethodDxo().convert(getDeliveryMethodEditPage(), dmd);
             //TODO LANGUAGE_ID
             dmd.setLanguageId(new BigDecimal(1));
-            getDeliveryMethodSerivce().addDeliveryMethod(dmd);
+            getDeliveryMethodSerivce().addDeliveryMethodDescription(dmd);
             FacesMessageUtil.addInfoMessage("added.delivery.method");
             return DeliveryMethodListPage.class;
         } else if (PompeiConstants.UPDATE_MODE
@@ -93,7 +93,7 @@
             getDeliveryMethodDxo().convert(getDeliveryMethodEditPage(),
                     dmd.getDeliveryMethod());
             getDeliveryMethodDxo().convert(getDeliveryMethodEditPage(), dmd);
-            getDeliveryMethodSerivce().updateDeliveryMethod(dmd);
+            getDeliveryMethodSerivce().updateDeliveryMethodDescription(dmd);
             FacesMessageUtil.addInfoMessage("updated.delivery.method");
             return DeliveryMethodEditPage.class;
         } else {

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodListAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodListAction.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodListAction.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -33,7 +33,7 @@
     public Class<?> prerender() {
         List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
         getDeliveryMethodDxo().convert(
-                getDeliveryMethodSerivce().getDeliveryMethodList(), list);
+                getDeliveryMethodSerivce().getDeliveryMethodDescriptionList(), list);
         getDeliveryMethodListPage().setDeliveryMethodItems(list);
         return null;
     }

Added: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectAction.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectAction.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -0,0 +1,223 @@
+package jp.sf.pal.pompei.web.user.checkout;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import jp.sf.pal.common.util.FacesMessageUtil;
+import jp.sf.pal.pompei.PompeiConstants;
+import jp.sf.pal.pompei.dxo.DeliveryMethodDxo;
+import jp.sf.pal.pompei.exentity.Customers;
+import jp.sf.pal.pompei.exentity.DeliveryMethodDescription;
+import jp.sf.pal.pompei.service.CustomerService;
+import jp.sf.pal.pompei.service.DeliveryMethodSerivce;
+import jp.sf.pal.pompei.util.SessionUtil;
+
+import org.seasar.framework.util.StringUtil;
+import org.seasar.teeda.extension.annotation.takeover.TakeOver;
+import org.seasar.teeda.extension.annotation.takeover.TakeOverType;
+
+public class PaymentSelectAction implements Serializable {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 5613498829230308147L;
+
+    /**
+     * 
+     */
+    private PaymentSelectPage paymentSelectPage;
+
+    private CustomerService customerService;
+
+    private DeliveryMethodSerivce deliveryMethodSerivce;
+
+    private DeliveryMethodDxo deliveryMethodDxo;
+
+    public Class<?> initialize() {
+        return null;
+    }
+
+    public Class<?> prerender() {
+        // check login
+        String remoteUser = FacesContext.getCurrentInstance()
+                .getExternalContext().getRemoteUser();
+        if (remoteUser == null) {
+            return UserInfoEditPage.class;
+        }
+
+        // check user info
+        Customers customers = getCustomerService().getCustomers(remoteUser);
+        if (customers == null) {
+            return UserInfoEditPage.class;
+        }
+
+        List<DeliveryMethodDescription> dmd = getDeliveryMethodSerivce()
+                .getDeliveryMethodDescriptionList();
+        getPaymentSelectPage().setDeliveryMethodIdItems(
+                getDeliveryMethodDxo().convert(dmd));
+
+        // render FacesMessage
+        FacesMessageUtil.renderMessages();
+        return null;
+    }
+
+    @TakeOver(type = TakeOverType.INCLUDE, properties = "orderProcessId")
+    public Class<?> doNext() {
+        Map<String, Object> map = (Map<String, Object>) SessionUtil
+                .getFromLocalScope(getPaymentSelectPage().getOrderProcessId());
+        if (map == null) {
+            // expires session
+            // TODO clear session info for card
+            //TODO put message
+            return UserInfoEditPage.class;
+        }
+
+        String paymentMethod = getPaymentSelectPage().getPaymentMethod();
+        if (StringUtil.isEmpty(paymentMethod)) {
+            // TODO clear session info for card
+            // TODO put message
+            return null;
+        }
+        if (PompeiConstants.COD_PAYMENT_METHOD.equals(paymentMethod)
+                || PompeiConstants.BANK_PAYMENT_METHOD.equals(paymentMethod)
+                || PompeiConstants.CARD_PAYMENT_METHOD.equals(paymentMethod)) {
+            map.put(PompeiConstants.PAYMENT_METHOD, paymentMethod);
+        } else {
+            // invalid payment string
+            // TODO clear session info for card
+            // TODO put message
+            return null;
+        }
+
+        // card
+        if (PompeiConstants.CARD_PAYMENT_METHOD.equals(paymentMethod)) {
+            // card type
+            if (!StringUtil.isEmpty(getPaymentSelectPage().getCcOwner())) {
+                map.put(PompeiConstants.CARD_TYPE, getPaymentSelectPage()
+                        .getCcType());
+            } else {
+                // invalid card owner
+                // TODO clear session info for card
+                // TODO put message
+                return null;
+            }
+            // card number
+            if (!StringUtil.isEmpty(getPaymentSelectPage().getCcNumber1())
+                    && !StringUtil.isEmpty(getPaymentSelectPage()
+                            .getCcNumber2())
+                    && !StringUtil.isEmpty(getPaymentSelectPage()
+                            .getCcNumber3())
+                    && !StringUtil.isEmpty(getPaymentSelectPage()
+                            .getCcNumber4())) {
+                map.put(PompeiConstants.CARD_NUMBER, getPaymentSelectPage()
+                        .getCcNumber1()
+                        + getPaymentSelectPage().getCcNumber2()
+                        + getPaymentSelectPage().getCcNumber3()
+                        + getPaymentSelectPage().getCcNumber4());
+            } else {
+                // invalid card number
+                // TODO clear session info for card
+                // TODO put message
+                return null;
+            }
+            // owner
+            if (!StringUtil.isEmpty(getPaymentSelectPage().getCcOwner())) {
+                map.put(PompeiConstants.CARD_OWNER, getPaymentSelectPage()
+                        .getCcOwner());
+            } else {
+                // invalid card number
+                // TODO clear session info for card
+                // TODO put message
+                return null;
+            }
+            // expire
+            if (!StringUtil.isEmpty(getPaymentSelectPage().getCcExpiresMonth())
+                    && !StringUtil.isEmpty(getPaymentSelectPage()
+                            .getCcExpiresYear())) {
+                map.put(PompeiConstants.CARD_EXPIRES, getPaymentSelectPage()
+                        .getCcExpiresMonth()
+                        + getPaymentSelectPage().getCcExpiresYear());
+            } else {
+                // invalid card number
+                // TODO clear session info for card
+                // TODO put message
+                return null;
+            }
+        }
+        // delivery method
+        if (!StringUtil.isEmpty(getPaymentSelectPage().getDeliveryMethodId())) {
+            map.put(PompeiConstants.DELIVERY_METHOD_ID, getPaymentSelectPage()
+                    .getDeliveryMethodId());
+        } else {
+            // invalid card number
+            // TODO clear session info for card
+            // TODO put message
+            return null;
+        }
+
+        // TODO
+        return null;
+    }
+
+    /**
+     * @return paymentSelectPage
+     */
+    public PaymentSelectPage getPaymentSelectPage() {
+        return paymentSelectPage;
+    }
+
+    /**
+     * @param paymentSelectPage 設定する paymentSelectPage
+     */
+    public void setPaymentSelectPage(PaymentSelectPage paymentSelectPage) {
+        this.paymentSelectPage = paymentSelectPage;
+    }
+
+    /**
+     * @return customerService
+     */
+    public CustomerService getCustomerService() {
+        return customerService;
+    }
+
+    /**
+     * @param customerService 設定する customerService
+     */
+    public void setCustomerService(CustomerService customerService) {
+        this.customerService = customerService;
+    }
+
+    /**
+     * @return deliveryMethodSerivce
+     */
+    public DeliveryMethodSerivce getDeliveryMethodSerivce() {
+        return deliveryMethodSerivce;
+    }
+
+    /**
+     * @param deliveryMethodSerivce 設定する deliveryMethodSerivce
+     */
+    public void setDeliveryMethodSerivce(
+            DeliveryMethodSerivce deliveryMethodSerivce) {
+        this.deliveryMethodSerivce = deliveryMethodSerivce;
+    }
+
+    /**
+     * @return deliveryMethodDxo
+     */
+    public DeliveryMethodDxo getDeliveryMethodDxo() {
+        return deliveryMethodDxo;
+    }
+
+    /**
+     * @param deliveryMethodDxo 設定する deliveryMethodDxo
+     */
+    public void setDeliveryMethodDxo(DeliveryMethodDxo deliveryMethodDxo) {
+        this.deliveryMethodDxo = deliveryMethodDxo;
+    }
+
+}


Property changes on: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectAction.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectPage.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectPage.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectPage.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -0,0 +1,162 @@
+package jp.sf.pal.pompei.web.user.checkout;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+public class PaymentSelectPage implements Serializable {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1857507480950925420L;
+
+    private String orderProcessId;
+
+    private String ccExpiresMonth;
+
+    private String ccExpiresYear;
+
+    private String ccNumber1;
+
+    private String ccNumber2;
+
+    private String ccNumber3;
+
+    private String ccNumber4;
+
+    private String ccOwner;
+
+    private String ccType;
+
+    private int deliveryMethodIdIndex;
+
+    private List<Map<String, String>> deliveryMethodIdItems;
+
+    private String deliveryMethodId;
+
+    private String paymentMethod;
+
+    /**
+     * @return orderProcessId
+     */
+    public String getOrderProcessId() {
+        return orderProcessId;
+    }
+
+    /**
+     * @param orderProcessId 設定する orderProcessId
+     */
+    public void setOrderProcessId(String orderProcessId) {
+        this.orderProcessId = orderProcessId;
+    }
+
+    public String getCcExpiresMonth() {
+        return ccExpiresMonth;
+    }
+
+    public void setCcExpiresMonth(String ccExpiresMonth) {
+        this.ccExpiresMonth = ccExpiresMonth;
+    }
+
+    public String getCcExpiresYear() {
+        return ccExpiresYear;
+    }
+
+    public void setCcExpiresYear(String ccExpiresYear) {
+        this.ccExpiresYear = ccExpiresYear;
+    }
+
+    public String getCcNumber1() {
+        return ccNumber1;
+    }
+
+    public void setCcNumber1(String ccNumber1) {
+        this.ccNumber1 = ccNumber1;
+    }
+
+    public String getCcNumber2() {
+        return ccNumber2;
+    }
+
+    public void setCcNumber2(String ccNumber2) {
+        this.ccNumber2 = ccNumber2;
+    }
+
+    public String getCcNumber3() {
+        return ccNumber3;
+    }
+
+    public void setCcNumber3(String ccNumber3) {
+        this.ccNumber3 = ccNumber3;
+    }
+
+    public String getCcNumber4() {
+        return ccNumber4;
+    }
+
+    public void setCcNumber4(String ccNumber4) {
+        this.ccNumber4 = ccNumber4;
+    }
+
+    public String getCcOwner() {
+        return ccOwner;
+    }
+
+    public void setCcOwner(String ccOwner) {
+        this.ccOwner = ccOwner;
+    }
+
+    public String getCcType() {
+        return ccType;
+    }
+
+    public void setCcType(String ccType) {
+        this.ccType = ccType;
+    }
+
+    public String getDeliveryMethodId() {
+        return deliveryMethodId;
+    }
+
+    public void setDeliveryMethodId(String deliveryMethod) {
+        this.deliveryMethodId = deliveryMethod;
+    }
+
+    public String getPaymentMethod() {
+        return paymentMethod;
+    }
+
+    public void setPaymentMethod(String paymentMethod) {
+        this.paymentMethod = paymentMethod;
+    }
+
+    /**
+     * @return deliveryMethodIndex
+     */
+    public int getDeliveryMethodIdIndex() {
+        return deliveryMethodIdIndex;
+    }
+
+    /**
+     * @param deliveryMethodIndex 設定する deliveryMethodIndex
+     */
+    public void setDeliveryMethodIdIndex(int deliveryMethodIndex) {
+        this.deliveryMethodIdIndex = deliveryMethodIndex;
+    }
+
+    /**
+     * @return deliveryMethodItems
+     */
+    public List<Map<String, String>> getDeliveryMethodIdItems() {
+        return deliveryMethodIdItems;
+    }
+
+    /**
+     * @param deliveryMethodItems 設定する deliveryMethodItems
+     */
+    public void setDeliveryMethodIdItems(List<Map<String, String>> deliveryMethodItems) {
+        this.deliveryMethodIdItems = deliveryMethodItems;
+    }
+
+}


Property changes on: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/PaymentSelectPage.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserAddressSelectAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserAddressSelectAction.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserAddressSelectAction.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -10,11 +10,13 @@
 import javax.faces.context.FacesContext;
 
 import jp.sf.pal.common.util.FacesMessageUtil;
+import jp.sf.pal.pompei.PompeiConstants;
 import jp.sf.pal.pompei.dxo.CustomerDxo;
 import jp.sf.pal.pompei.exentity.AddressBook;
 import jp.sf.pal.pompei.exentity.Customers;
 import jp.sf.pal.pompei.exentity.Zones;
 import jp.sf.pal.pompei.service.CustomerService;
+import jp.sf.pal.pompei.util.SessionUtil;
 
 import org.seasar.teeda.extension.annotation.takeover.TakeOver;
 import org.seasar.teeda.extension.annotation.takeover.TakeOverType;
@@ -86,7 +88,7 @@
         return null;
     }
 
-    @TakeOver(type = TakeOverType.NEVER)
+    @TakeOver(type = TakeOverType.INCLUDE, properties = "orderProcessId")
     public Class<?> doAdd() {
         // check login
         String remoteUser = FacesContext.getCurrentInstance()
@@ -162,10 +164,20 @@
         return null;
     }
 
-    @TakeOver(type = TakeOverType.NEVER)
+    @TakeOver(type = TakeOverType.INCLUDE, properties = "orderProcessId")
     public Class<?> doNext() {
-        //TODO
-        return null;
+        Map<String, Object> map = (Map<String, Object>) SessionUtil
+                .getFromLocalScope(getUserAddressSelectPage()
+                        .getOrderProcessId());
+        if (map == null) {
+            // expires session
+            //TODO put message
+            return UserInfoEditPage.class;
+        }
+        // set address book
+        map.put(PompeiConstants.DELIVERY_ADDRESS_BOOK_ID,
+                getUserAddressSelectPage().getAddressBookId());
+        return PaymentSelectPage.class;
     }
 
     /**

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserAddressSelectPage.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserAddressSelectPage.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserAddressSelectPage.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -11,6 +11,8 @@
      */
     private static final long serialVersionUID = -2196818928662366687L;
 
+    private String orderProcessId;
+
     private int addressBookIdIndex;
 
     private List<Map<String, String>> addressBookIdItems;
@@ -40,6 +42,20 @@
     private String entryGender;
 
     /**
+     * @return orderProcessId
+     */
+    public String getOrderProcessId() {
+        return orderProcessId;
+    }
+
+    /**
+     * @param orderProcessId 設定する orderProcessId
+     */
+    public void setOrderProcessId(String orderProcessId) {
+        this.orderProcessId = orderProcessId;
+    }
+
+    /**
      * @return addressBookIdIndex
      */
     public int getAddressBookIdIndex() {

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserInfoEditAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserInfoEditAction.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserInfoEditAction.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -4,6 +4,7 @@
 import java.math.BigDecimal;
 import java.sql.Timestamp;
 import java.util.Date;
+import java.util.HashMap;
 
 import javax.faces.context.FacesContext;
 
@@ -13,6 +14,7 @@
 import jp.sf.pal.pompei.exentity.Customers;
 import jp.sf.pal.pompei.exentity.Zones;
 import jp.sf.pal.pompei.service.CustomerService;
+import jp.sf.pal.pompei.util.SessionUtil;
 
 import org.seasar.teeda.extension.annotation.takeover.TakeOver;
 import org.seasar.teeda.extension.annotation.takeover.TakeOverType;
@@ -93,8 +95,21 @@
         return UserInfoEditPage.class;
     }
 
-    @TakeOver(type = TakeOverType.NEVER)
+    @TakeOver(type = TakeOverType.INCLUDE, properties = "orderProcessId")
     public Class<?> doNext() {
+        // start order process
+        if (getUserInfoEditPage().getCustomersId() == null) {
+            //TODO put message
+            return UserInfoEditAction.class;
+        }
+        getUserInfoEditPage().setOrderProcessId(
+                getUserInfoEditPage().getCustomersId()
+                        + String.valueOf(new Date().getTime()));
+        // set info to session
+        SessionUtil.removeFromLocalScope(getUserInfoEditPage()
+                .getOrderProcessId());
+        SessionUtil.putToLocalScope(getUserInfoEditPage().getOrderProcessId(),
+                new HashMap<String, Object>());
         return UserAddressSelectPage.class;
     }
 

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserInfoEditPage.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserInfoEditPage.java	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/user/checkout/UserInfoEditPage.java	2007-09-09 13:41:53 UTC (rev 552)
@@ -1,6 +1,7 @@
 package jp.sf.pal.pompei.web.user.checkout;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 import org.seasar.teeda.extension.util.LabelHelper;
 
@@ -13,6 +14,8 @@
 
     private LabelHelper labelHelper;
 
+    private String orderProcessId;
+
     private String customersCellphone;
 
     private String customersEmailAddress;
@@ -41,6 +44,8 @@
 
     private String customersPortalId;
 
+    private BigDecimal customersId;
+
     private boolean isUser;
 
     private boolean isLogin;
@@ -60,6 +65,20 @@
     }
 
     /**
+     * @return orderProcessId
+     */
+    public String getOrderProcessId() {
+        return orderProcessId;
+    }
+
+    /**
+     * @param orderProcessId 設定する orderProcessId
+     */
+    public void setOrderProcessId(String orderProcessId) {
+        this.orderProcessId = orderProcessId;
+    }
+
+    /**
      * @return portalId
      */
     public String getCustomersPortalId() {
@@ -129,6 +148,20 @@
         this.customersTelephone = customersTelephone;
     }
 
+    /**
+     * @return customersId
+     */
+    public BigDecimal getCustomersId() {
+        return customersId;
+    }
+
+    /**
+     * @param customersId 設定する customersId
+     */
+    public void setCustomersId(BigDecimal customersId) {
+        this.customersId = customersId;
+    }
+
     public String getEntryCity() {
         return entryCity;
     }

Modified: pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/checkoutConfirm.html
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/checkoutConfirm.html	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/checkoutConfirm.html	2007-09-09 13:41:53 UTC (rev 552)
@@ -6,7 +6,8 @@
     <title id="title-head">注文確認画面</title>
   </head>
   <body>
-    <form id="Form">
+    <form id="Form">
+      <input id="orderProcessId" type="hidden"/>
       <div>
         <span id="messages"></span>
       </div>

Modified: pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/paymentSelect.html
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/paymentSelect.html	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/paymentSelect.html	2007-09-09 13:41:53 UTC (rev 552)
@@ -7,6 +7,7 @@
   </head>
   <body>
     <form id="Form">
+      <input id="orderProcessId" type="hidden"/>
       <div>
         <span id="messages" fatalClass="portlet-msg-error" errorClass="portlet-msg-error" warnClass="portlet-msg-alert" infoClass="portlet-msg-info"></span>
       </div>
@@ -28,6 +29,9 @@
             <td><input type="radio" name="paymentMethod" value="CARD" />クレジットカード</td>
             <td>※ここにクレジットに関する説明を表示</td>
           </tr>
+        </table>
+      </span>
+        <table>
           <tr>
             <td></td>
             <td>
@@ -68,13 +72,12 @@
             </td>
           </tr>
         </table>
-      </span>
       <h3 class="portlet-section-header">
         <label>配送方法の選択</label>
       </h3>
-      <span id="deliveryMethod"><input type="radio" name="deliveryMethod" value="0" checked="checked" />aaa
-  <input type="radio" name="deliveryMethod" value="1" />bbb
-  <input type="radio" name="deliveryMethod" value="2" />ccc
+      <span id="deliveryMethodId"><input type="radio" name="deliveryMethodId" value="0" checked="checked" />aaa
+  <input type="radio" name="deliveryMethodId" value="1" />bbb
+  <input type="radio" name="deliveryMethodId" value="2" />ccc
 </span>
       <input id="doNext" type="button" value="次へ" onclick="location.href='./userAddressSelection.html'" />
     </form>

Modified: pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/userAddressSelect.html
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/userAddressSelect.html	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/userAddressSelect.html	2007-09-09 13:41:53 UTC (rev 552)
@@ -7,6 +7,7 @@
   </head>
   <body>
     <form id="Form">
+      <input id="orderProcessId" type="hidden"/>
       <div>
         <span id="messages" fatalClass="portlet-msg-error" errorClass="portlet-msg-error" warnClass="portlet-msg-alert" infoClass="portlet-msg-info"></span>
       </div>

Modified: pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/userInfoEdit.html
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/userInfoEdit.html	2007-09-08 23:02:17 UTC (rev 551)
+++ pompei/portlets/pompei-core/trunk/src/main/webapp/view/user/checkout/userInfoEdit.html	2007-09-09 13:41:53 UTC (rev 552)
@@ -249,6 +249,7 @@
           </tbody>
         </table>
 <!-- Term of Licence -->
+        <input id="customersId-hidden" type="hidden"/>
         <input id="doModify" type="button" value="登録情報の修正(TBD)" onclick="location.href='./userInfoEdit.html'" />
         <input id="doNext" type="button" value="次へ" onclick="location.href='./userAddressSelect.html'" />
       </div>


pal-cvs メーリングリストの案内