[pal-cvs 2778] [519] moved to constants.

svnno****@sourc***** svnno****@sourc*****
2007年 9月 1日 (土) 22:08:42 JST


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

Log Message:
-----------
moved to constants.

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/web/admin/member/MemberConfirmAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/member/MemberEditAction.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/OrderConfirmAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/OrderEditAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/CategoryEditAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerEditAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ProductEditAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ProductListAction.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-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/PompeiConstants.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -21,7 +21,9 @@
 
     public static final String DEFAULT_ORDER_URL = "/pompei/portal/order.psml";
 
-    public static final String INSERT_ACTION = "insert";
+    public static final String INSERT_MODE = "insert";
 
-    public static final String UPDATE_ACTION = "update";
+    public static final String UPDATE_MODE = "update";
+
+    public static final String DELETE_MODE = "delete";
 }

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/member/MemberConfirmAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/member/MemberConfirmAction.java	2007-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/member/MemberConfirmAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -2,6 +2,7 @@
 
 import java.io.Serializable;
 
+import jp.sf.pal.pompei.PompeiConstants;
 import jp.sf.pal.pompei.dxo.MemberDxo;
 import jp.sf.pal.pompei.exentity.AddressBook;
 import jp.sf.pal.pompei.exentity.Customers;
@@ -16,10 +17,6 @@
      */
     private static final long serialVersionUID = -1188349655650999839L;
 
-    private static final String MODE_INSERT = "insert";
-
-    private static final String MODE_UPDATE = "update";
-
     /**
      *
      */
@@ -73,12 +70,12 @@
 
     private boolean isUpdate() {
         String mode = memberConfirmPage.getMode();
-        return mode != null && mode.equals(MODE_UPDATE);
+        return mode != null && mode.equals(PompeiConstants.UPDATE_MODE);
     }
 
     private boolean isInsert() {
         String mode = memberConfirmPage.getMode();
-        return mode != null && mode.equals(MODE_INSERT);
+        return mode != null && mode.equals(PompeiConstants.INSERT_MODE);
     }
 
     /**

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/member/MemberEditAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/member/MemberEditAction.java	2007-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/member/MemberEditAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -7,6 +7,7 @@
 import java.util.List;
 import java.util.Map;
 
+import jp.sf.pal.pompei.PompeiConstants;
 import jp.sf.pal.pompei.dxo.MemberDxo;
 import jp.sf.pal.pompei.exentity.Customers;
 import jp.sf.pal.pompei.service.MemberService;
@@ -17,10 +18,6 @@
      */
     private static final long serialVersionUID = 111723657530085205L;
 
-    private static final String MODE_INSERT = "insert";
-
-    private static final String MODE_UPDATE = "update";
-
     /**
      *
      */
@@ -68,7 +65,7 @@
             String s = memberEditPage.getEntryPostcode1();
 
         } else {
-            memberEditPage.setMode(MODE_INSERT);
+            memberEditPage.setMode(PompeiConstants.INSERT_MODE);
             setDefaultValue();
         }
         return null;
@@ -110,12 +107,12 @@
 
     private boolean isUpdate() {
         String mode = memberEditPage.getMode();
-        return mode != null && mode.equals(MODE_UPDATE);
+        return mode != null && mode.equals(PompeiConstants.UPDATE_MODE);
     }
 
     private boolean isInsert() {
         String mode = memberEditPage.getMode();
-        return mode != null && mode.equals(MODE_INSERT);
+        return mode != null && mode.equals(PompeiConstants.INSERT_MODE);
     }
 
     /**

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-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/DeliveryMethodEditAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -35,10 +35,10 @@
     }
 
     public Class<?> prerender() {
-        if (PompeiConstants.INSERT_ACTION.equals(getDeliveryMethodEditPage()
+        if (PompeiConstants.INSERT_MODE.equals(getDeliveryMethodEditPage()
                 .getMode())) {
             // insert
-        } else if (PompeiConstants.UPDATE_ACTION
+        } else if (PompeiConstants.UPDATE_MODE
                 .equals(getDeliveryMethodEditPage().getMode())) {
             // update
             if (getDeliveryMethodEditPage().getTargetId() == null) {
@@ -60,7 +60,7 @@
 
     @TakeOver(type = TakeOverType.INCLUDE, properties = "mode,targetId")
     public Class<?> doUpdate() {
-        if (PompeiConstants.INSERT_ACTION.equals(getDeliveryMethodEditPage()
+        if (PompeiConstants.INSERT_MODE.equals(getDeliveryMethodEditPage()
                 .getMode())) {
             // insert
             DeliveryMethodDescription dmd = new DeliveryMethodDescription();
@@ -75,7 +75,7 @@
             getDeliveryMethodSerivce().addDeliveryMethod(dmd);
             FacesMessageUtil.addInfoMessage("added.delivery.method");
             return DeliveryMethodListPage.class;
-        } else if (PompeiConstants.UPDATE_ACTION
+        } else if (PompeiConstants.UPDATE_MODE
                 .equals(getDeliveryMethodEditPage().getMode())) {
             // update
             DeliveryMethodDescription dmd = getDeliveryMethodSerivce()

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/OrderConfirmAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/OrderConfirmAction.java	2007-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/OrderConfirmAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -5,14 +5,13 @@
 import java.sql.Timestamp;
 import java.util.Date;
 
+import jp.sf.pal.pompei.PompeiConstants;
 import jp.sf.pal.pompei.dxo.OrdersDxo;
 import jp.sf.pal.pompei.exentity.Orders;
 import jp.sf.pal.pompei.service.OrderService;
 
 public class OrderConfirmAction implements Serializable {
 
-    private static final String MODE_UPDATE = "update";
-
     /**
      *
      */
@@ -62,7 +61,8 @@
 
     private boolean isUpdate() {
         if (orderConfirmPage.getMode() != null
-                && orderConfirmPage.getMode().equals(MODE_UPDATE)) {
+                && orderConfirmPage.getMode().equals(
+                        PompeiConstants.UPDATE_MODE)) {
             return true;
         }
         return false;

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/OrderEditAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/OrderEditAction.java	2007-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/order/OrderEditAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -3,6 +3,7 @@
 import java.io.Serializable;
 import java.math.BigDecimal;
 
+import jp.sf.pal.pompei.PompeiConstants;
 import jp.sf.pal.pompei.dxo.OrdersDxo;
 import jp.sf.pal.pompei.exentity.Orders;
 import jp.sf.pal.pompei.service.OrderService;
@@ -14,8 +15,6 @@
      */
     private static final long serialVersionUID = -6673518950403637316L;
 
-    private static final String MODE_UPDATE = "update";
-
     /**
      *
      */
@@ -42,7 +41,7 @@
 
     private boolean isUpdate() {
         if (orderEditPage.getMode() != null
-                && orderEditPage.getMode().equals(MODE_UPDATE)) {
+                && orderEditPage.getMode().equals(PompeiConstants.UPDATE_MODE)) {
             return true;
         }
         return false;

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/CategoryEditAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/CategoryEditAction.java	2007-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/CategoryEditAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -7,6 +7,7 @@
 import java.util.List;
 import java.util.Map;
 
+import jp.sf.pal.pompei.PompeiConstants;
 import jp.sf.pal.pompei.dxo.CategoriesDxo;
 import jp.sf.pal.pompei.exentity.Categories;
 import jp.sf.pal.pompei.exentity.CategoriesDescription;
@@ -45,7 +46,7 @@
     }
 
     public Class<?> initialize() {
-        if (categoryEditPage.getMode().equals("update")) {
+        if (categoryEditPage.getMode().equals(PompeiConstants.UPDATE_MODE)) {
             CategoriesDescription d = categoryService
                     .getCategoriesDescription(categoryEditPage.getTargetId());
             Categories c = d.getCategories();
@@ -87,7 +88,7 @@
         }
         c.setParentId(parentId);
 
-        if (categoryEditPage.getMode().equals("insert")) {
+        if (categoryEditPage.getMode().equals(PompeiConstants.INSERT_MODE)) {
             categoryService.addCategory(d);
         } else {
             c.setCategoriesId(categoryEditPage.getTargetId());

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerEditAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerEditAction.java	2007-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerEditAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -3,6 +3,7 @@
 import java.io.Serializable;
 import java.math.BigDecimal;
 
+import jp.sf.pal.pompei.PompeiConstants;
 import jp.sf.pal.pompei.dxo.ManufacturersDxo;
 import jp.sf.pal.pompei.exentity.Manufacturers;
 import jp.sf.pal.pompei.exentity.ManufacturersInfo;
@@ -32,14 +33,15 @@
                 dxo.convert(info, manufacturerEditPage);
             }
         } else {
-            manufacturerEditPage.setMode("insert");
+            manufacturerEditPage.setMode(PompeiConstants.INSERT_MODE);
         }
         return null;
     }
 
     private boolean isUpdate() {
         return manufacturerEditPage.getMode() != null
-                && manufacturerEditPage.getMode().equals("update");
+                && manufacturerEditPage.getMode().equals(
+                        PompeiConstants.UPDATE_MODE);
     }
 
     public Class prerender() {

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ProductEditAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ProductEditAction.java	2007-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ProductEditAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -7,6 +7,7 @@
 
 import jp.sf.pal.common.CommonException;
 import jp.sf.pal.common.util.FacesMessageUtil;
+import jp.sf.pal.pompei.PompeiConstants;
 import jp.sf.pal.pompei.dxo.ManufacturersDxo;
 import jp.sf.pal.pompei.dxo.ProductDxo;
 import jp.sf.pal.pompei.exentity.Products;
@@ -21,10 +22,6 @@
      */
     private static final long serialVersionUID = -9187256555144964188L;
 
-    private static final String MODE_INSERT = "insert";
-
-    private static final String MODE_UPDATE = "update";
-
     /**	 */
     private ProductEditPage productEditPage;
 
@@ -70,7 +67,7 @@
             productDxo.convert(description, productEditPage);
 
         } else {
-            productEditPage.setMode(MODE_INSERT);
+            productEditPage.setMode(PompeiConstants.INSERT_MODE);
             productEditPage.setProductsName("");
             productEditPage.setProductsModel("");
             productEditPage.setProductsImage("");
@@ -130,12 +127,12 @@
 
     private boolean isUpdate() {
         String mode = productEditPage.getMode();
-        return mode != null && mode.equals(MODE_UPDATE);
+        return mode != null && mode.equals(PompeiConstants.UPDATE_MODE);
     }
 
     private boolean isInsert() {
         String mode = productEditPage.getMode();
-        return mode != null && mode.equals(MODE_INSERT);
+        return mode != null && mode.equals(PompeiConstants.INSERT_MODE);
     }
 
     /**

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ProductListAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ProductListAction.java	2007-08-31 23:46:48 UTC (rev 518)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ProductListAction.java	2007-09-01 13:08:41 UTC (rev 519)
@@ -20,8 +20,6 @@
      */
     private static final long serialVersionUID = 3259525565087243422L;
 
-    private static final String MODE_DELETE = "delete";
-
     /**  */
     private ProductListPage productListPage;
 


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