[pal-cvs 2796] [540] fixed admin pages for manufacturers.

svnno****@sourc***** svnno****@sourc*****
2007年 9月 5日 (水) 22:56:20 JST


Revision: 540
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=540
Author:   shinsuke
Date:     2007-09-05 22:56:19 +0900 (Wed, 05 Sep 2007)

Log Message:
-----------
fixed admin pages for manufacturers.

Modified Paths:
--------------
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/dxo/ManufacturersDxo.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/ManufacturerService.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/impl/ManufacturerServiceImpl.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/ManufacturerEditPage.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerListAction.java
    pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerListPage.java
    pompei/portlets/pompei-core/trunk/src/main/webapp/view/admin/product/manufacturerEdit.html
    pompei/portlets/pompei-core/trunk/src/main/webapp/view/admin/product/manufacturerList.html


-------------- next part --------------
Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/dxo/ManufacturersDxo.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/dxo/ManufacturersDxo.java	2007-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/dxo/ManufacturersDxo.java	2007-09-05 13:56:19 UTC (rev 540)
@@ -7,6 +7,7 @@
 import org.seasar.extension.dxo.annotation.ConversionRule;
 
 import jp.sf.pal.pompei.allcommon.Entity;
+import jp.sf.pal.pompei.exentity.Manufacturers;
 import jp.sf.pal.pompei.exentity.ManufacturersInfo;
 import jp.sf.pal.pompei.web.admin.product.ManufacturerEditPage;
 
@@ -15,7 +16,8 @@
     @ConversionRule("manufacturersId : manufacturersId"
             + ",manufacturersName : manufacturers.manufacturersName"
             + ",manufacturersDesc : manufacturersShortDesc")
-    void convert(List<Entity> manufacturers, List<Map> list);
+    void convert(List<ManufacturersInfo> manufacturers,
+            List<Map<String, Object>> list);
 
     @ConversionRule("manufacturersId : manufacturersId"
             + ",manufacturersName : manufacturers.manufacturersName"
@@ -25,17 +27,11 @@
             + ",manufacturersLongDesc : manufacturersLongDesc")
     void convert(ManufacturersInfo info, ManufacturerEditPage page);
 
-    ManufacturersInfo convert(ManufacturerEditPage page);
-
-    @ConversionRule("manufacturersId : manufacturersId"
-            + ",manufacturers.manufacturersName : manufacturersName"
-            + ",manufacturers.manufacturersImage : manufacturersImage"
-            + ",manufacturersUrl : manufacturersUrl"
-            + ",manufacturersShortDesc : manufacturersShortDesc"
-            + ",manufacturersLongDesc : manufacturersLongDesc")
     void convert(ManufacturerEditPage manufacturerEditPage,
-            ManufacturersInfo info);
+            ManufacturersInfo entity);
 
+    void convert(ManufacturerEditPage manufacturerEditPage, Manufacturers entity);
+
     @ConversionRule("value : manufacturersId" + ",label : manufacturersName")
     void convertCombo(List<Entity> manufacturers, List<Map> list);
 

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/ManufacturerService.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/ManufacturerService.java	2007-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/ManufacturerService.java	2007-09-05 13:56:19 UTC (rev 540)
@@ -4,7 +4,6 @@
 import java.math.BigDecimal;
 import java.util.List;
 
-import jp.sf.pal.pompei.allcommon.Entity;
 import jp.sf.pal.pompei.exentity.Manufacturers;
 import jp.sf.pal.pompei.exentity.ManufacturersInfo;
 
@@ -19,10 +18,16 @@
 
     public void deleteManufactures(BigDecimal id);
 
-    public ManufacturersInfo getManufactures(BigDecimal id);
+    public ManufacturersInfo getManufacturesInfo(BigDecimal id);
 
-    public List<Entity> getManufacturesInfoList();
+    public ManufacturersInfo getManufacturesInfo(BigDecimal id,
+            BigDecimal languagesId);
 
+    public List<ManufacturersInfo> getManufacturesInfoList();
+
+    public List<ManufacturersInfo> getManufacturesInfoList(
+            BigDecimal languagesId);
+
     public List<Manufacturers> getManufacturesList();
 
     public void updateManufactures(ManufacturersInfo info);

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/impl/ManufacturerServiceImpl.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/impl/ManufacturerServiceImpl.java	2007-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/service/impl/ManufacturerServiceImpl.java	2007-09-05 13:56:19 UTC (rev 540)
@@ -3,15 +3,16 @@
 import java.math.BigDecimal;
 import java.sql.Timestamp;
 import java.util.Date;
+import java.util.Iterator;
 import java.util.List;
 
-import jp.sf.pal.pompei.allcommon.Entity;
 import jp.sf.pal.pompei.cbean.ManufacturersCB;
 import jp.sf.pal.pompei.cbean.ManufacturersInfoCB;
 import jp.sf.pal.pompei.exbhv.ManufacturersBhv;
 import jp.sf.pal.pompei.exbhv.ManufacturersInfoBhv;
 import jp.sf.pal.pompei.exentity.Manufacturers;
 import jp.sf.pal.pompei.exentity.ManufacturersInfo;
+import jp.sf.pal.pompei.service.LanguageService;
 import jp.sf.pal.pompei.service.ManufacturerService;
 
 /**
@@ -26,10 +27,26 @@
      */
     private static final long serialVersionUID = -6815449303231732191L;
 
+    private LanguageService languageService;
+
     ManufacturersBhv manufacturersBhv;
 
     ManufacturersInfoBhv manufacturersInfoBhv;
 
+    /**
+     * @return languageService
+     */
+    public LanguageService getLanguageService() {
+        return languageService;
+    }
+
+    /**
+     * @param languageService 設定する languageService
+     */
+    public void setLanguageService(LanguageService languageService) {
+        this.languageService = languageService;
+    }
+
     public void addManufactures(ManufacturersInfo info) {
         Manufacturers manufacturers = info.getManufacturers();
         manufacturers.setDateAdded(new Timestamp(new Date().getTime()));
@@ -42,27 +59,48 @@
     }
 
     public void deleteManufactures(BigDecimal id) {
-        ManufacturersInfo info = getManufactures(id);
-        manufacturersInfoBhv.delete(info);
+        ManufacturersInfoCB cb = new ManufacturersInfoCB();
+        cb.query().setManufacturersId_Equal(id);
+        List<ManufacturersInfo> entities = manufacturersInfoBhv.selectList(cb);
+        for (Iterator<ManufacturersInfo> itr = entities.iterator(); itr
+                .hasNext();) {
+            manufacturersInfoBhv.delete(itr.next());
+        }
 
-        Manufacturers manufacturers = info.getManufacturers();
+        ManufacturersCB cb2 = new ManufacturersCB();
+        cb2.query().setManufacturersId_Equal(id);
+        Manufacturers manufacturers = manufacturersBhv.selectEntity(cb2);
         manufacturersBhv.delete(manufacturers);
     }
 
-    public ManufacturersInfo getManufactures(BigDecimal id) {
-        ManufacturersInfoCB infoCb = new ManufacturersInfoCB();
-        infoCb.setupSelect_Manufacturers();
-        infoCb.query().setManufacturersId_Equal(id);
-        return manufacturersInfoBhv.selectEntity(infoCb);
+    public ManufacturersInfo getManufacturesInfo(BigDecimal id) {
+        return getManufacturesInfo(id, getLanguageService()
+                .getCurrentLanguage().getLanguagesId());
     }
 
-    public List<Entity> getManufacturesInfoList() {
-        ManufacturersInfoCB infoCb = new ManufacturersInfoCB();
-        infoCb.addOrderBy_PK_Asc();
-        infoCb.setupSelect_Manufacturers();
-        return manufacturersInfoBhv.callReadList(infoCb);
+    public ManufacturersInfo getManufacturesInfo(BigDecimal id,
+            BigDecimal languagesId) {
+        ManufacturersInfoCB cb = new ManufacturersInfoCB();
+        cb.setupSelect_Manufacturers();
+        cb.query().setManufacturersId_Equal(id);
+        cb.query().setLanguagesId_Equal(languagesId);
+        return manufacturersInfoBhv.selectEntity(cb);
     }
 
+    public List<ManufacturersInfo> getManufacturesInfoList() {
+        return getManufacturesInfoList(getLanguageService()
+                .getCurrentLanguage().getLanguagesId());
+    }
+
+    public List<ManufacturersInfo> getManufacturesInfoList(
+            BigDecimal languagesId) {
+        ManufacturersInfoCB cb = new ManufacturersInfoCB();
+        cb.addOrderBy_PK_Asc();
+        cb.setupSelect_Manufacturers();
+        cb.query().setLanguagesId_Equal(languagesId);
+        return manufacturersInfoBhv.selectList(cb);
+    }
+
     public List<Manufacturers> getManufacturesList() {
         ManufacturersCB cb = new ManufacturersCB();
         List<Manufacturers> list = manufacturersBhv.selectList(cb);

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-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerEditAction.java	2007-09-05 13:56:19 UTC (rev 540)
@@ -7,6 +7,7 @@
 import jp.sf.pal.pompei.dxo.ManufacturersDxo;
 import jp.sf.pal.pompei.exentity.Manufacturers;
 import jp.sf.pal.pompei.exentity.ManufacturersInfo;
+import jp.sf.pal.pompei.service.LanguageService;
 import jp.sf.pal.pompei.service.ManufacturerService;
 
 public class ManufacturerEditAction implements Serializable {
@@ -21,20 +22,14 @@
      */
     private ManufacturerEditPage manufacturerEditPage;
 
+    private LanguageService languageService;
+
     private ManufacturerService manufacturerService;
 
-    private ManufacturersDxo dxo;
+    private ManufacturersDxo manufacturersDxo;
 
-    public Class initialize() {
-        if (isUpdate()) {
-            BigDecimal id = manufacturerEditPage.getManufacturersId();
-            ManufacturersInfo info = manufacturerService.getManufactures(id);
-            if (info != null) {
-                dxo.convert(info, manufacturerEditPage);
-            }
-        } else {
-            manufacturerEditPage.setMode(PompeiConstants.INSERT_MODE);
-        }
+    public Class<?> initialize() {
+
         return null;
     }
 
@@ -44,39 +39,57 @@
                         PompeiConstants.UPDATE_MODE);
     }
 
-    public Class prerender() {
+    public Class<?> prerender() {
+        if (isUpdate()) {
+            BigDecimal id = manufacturerEditPage.getManufacturersId();
+            ManufacturersInfo info = manufacturerService.getManufacturesInfo(
+                    id, getLanguageService().getDefaultLanguage()
+                            .getLanguagesId());
+            if (info != null) {
+                manufacturersDxo.convert(info, manufacturerEditPage);
+            } else {
+                //TODO exception and then move to a list page
+            }
+        } else {
+            manufacturerEditPage.setMode(PompeiConstants.INSERT_MODE);
+        }
         return null;
     }
 
-    public Class doAdd() {
-        ManufacturersInfo info = null;
+    public Class<?> doUpdate() {
         if (isUpdate()) {
-            BigDecimal id = manufacturerEditPage.getManufacturersId();
-            info = manufacturerService.getManufactures(id);
-            dxo.convert(manufacturerEditPage, info);
+            // update
+            BigDecimal id = getManufacturerEditPage().getManufacturersId();
+            ManufacturersInfo info = getManufacturerService()
+                    .getManufacturesInfo(
+                            id,
+                            getLanguageService().getDefaultLanguage()
+                                    .getLanguagesId());
+            getManufacturersDxo().convert(getManufacturerEditPage(), info);
             Manufacturers manufacturers = info.getManufacturers();
+            getManufacturersDxo().convert(getManufacturerEditPage(),
+                    manufacturers);
             manufacturers.setManufacturersName(manufacturerEditPage
                     .getManufacturersName());
             manufacturers.setManufacturersImage(manufacturerEditPage
                     .getManufacturersImage());
             manufacturerService.updateManufactures(info);
-
+            // TODO put message
+            return ManufacturerEditPage.class;
         } else {
-            info = dxo.convert(manufacturerEditPage);
-            info.setLanguagesId(new BigDecimal("1"));
-            Manufacturers manufacturers = info.getManufacturers();
-            if (manufacturers == null) {
-                manufacturers = new Manufacturers();
-            }
-            manufacturers.setManufacturersName(manufacturerEditPage
-                    .getManufacturersName());
-            manufacturers.setManufacturersImage(manufacturerEditPage
-                    .getManufacturersImage());
+            // insert
+            ManufacturersInfo info = new ManufacturersInfo();
+            getManufacturersDxo().convert(getManufacturerEditPage(), info);
+            info.setLanguagesId(getLanguageService().getDefaultLanguage()
+                    .getLanguagesId());
+            Manufacturers manufacturers = new Manufacturers();
+            getManufacturersDxo().convert(getManufacturerEditPage(),
+                    manufacturers);
             info.setManufacturers(manufacturers);
             manufacturerService.addManufactures(info);
+            // TODO put message
+            return ManufacturerListPage.class;
         }
-
-        return ManufacturerListPage.class;
     }
 
     /**
@@ -94,12 +107,12 @@
         this.manufacturerEditPage = manufacturerEditPage;
     }
 
-    public ManufacturersDxo getDxo() {
-        return dxo;
+    public ManufacturersDxo getManufacturersDxo() {
+        return manufacturersDxo;
     }
 
-    public void setDxo(ManufacturersDxo dxo) {
-        this.dxo = dxo;
+    public void setManufacturersDxo(ManufacturersDxo dxo) {
+        this.manufacturersDxo = dxo;
     }
 
     public ManufacturerService getManufacturerService() {
@@ -110,4 +123,18 @@
         this.manufacturerService = manufacturerService;
     }
 
+    /**
+     * @return languageService
+     */
+    public LanguageService getLanguageService() {
+        return languageService;
+    }
+
+    /**
+     * @param languageService 設定する languageService
+     */
+    public void setLanguageService(LanguageService languageService) {
+        this.languageService = languageService;
+    }
+
 }

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerEditPage.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerEditPage.java	2007-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerEditPage.java	2007-09-05 13:56:19 UTC (rev 540)
@@ -3,6 +3,8 @@
 import java.io.Serializable;
 import java.math.BigDecimal;
 
+import org.seasar.teeda.extension.util.LabelHelper;
+
 public class ManufacturerEditPage implements Serializable {
 
     /**
@@ -28,11 +30,29 @@
 
     private String title;
 
+    private BigDecimal targetId;
+
     /**
      * 処理モード
      */
     private String mode;
 
+    private LabelHelper labelHelper;
+
+    /**
+     * @return targetId
+     */
+    public BigDecimal getTargetId() {
+        return targetId;
+    }
+
+    /**
+     * @param targetId 設定する targetId
+     */
+    public void setTargetId(BigDecimal targetId) {
+        this.targetId = targetId;
+    }
+
     public String getManufacturersImage() {
         return manufacturersImage;
     }
@@ -97,4 +117,21 @@
         this.mode = mode;
     }
 
+    /**
+     * @return labelHelper
+     */
+    public LabelHelper getLabelHelper() {
+        return labelHelper;
+    }
+
+    /**
+     * @param labelHelper 設定する labelHelper
+     */
+    public void setLabelHelper(LabelHelper labelHelper) {
+        this.labelHelper = labelHelper;
+    }
+
+    public String getDoUpdateValue() {
+        return getLabelHelper().getLabelValue(getMode());
+    }
 }

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerListAction.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerListAction.java	2007-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerListAction.java	2007-09-05 13:56:19 UTC (rev 540)
@@ -1,12 +1,13 @@
 package jp.sf.pal.pompei.web.admin.product;
 
 import java.io.Serializable;
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import jp.sf.pal.common.util.FacesMessageUtil;
 import jp.sf.pal.pompei.dxo.ManufacturersDxo;
+import jp.sf.pal.pompei.exentity.ManufacturersInfo;
 import jp.sf.pal.pompei.service.ManufacturerService;
 
 public class ManufacturerListAction implements Serializable {
@@ -26,27 +27,34 @@
      */
     private ManufacturerService manufacturerService;
 
-    private ManufacturersDxo dxo;
+    private ManufacturersDxo manufacturersDxo;
 
-    public Class doDelete() {
-        //IDをセット
-        Map m = (Map) manufacuturerListPage.getManufacturerItems().get(
-                manufacuturerListPage.getRowIndex());
-        BigDecimal id = (BigDecimal) m.get("manufacturersId");
+    /**
+     * @return manufacuturerListPage
+     */
+    public ManufacturerListPage getManufacuturerListPage() {
+        return manufacuturerListPage;
+    }
 
-        manufacturerService.deleteManufactures(id);
+    /**
+     * @param manufacuturerListPage 設定する manufacuturerListPage
+     */
+    public void setManufacuturerListPage(
+            ManufacturerListPage manufacuturerListPage) {
+        this.manufacuturerListPage = manufacuturerListPage;
+    }
 
+    public Class<?> doDelete() {
+        manufacturerService.deleteManufactures(getManufacuturerListPage()
+                .getTargetId());
+
+        //TODO put message
         return null;
     }
 
-    public Class doUpdate() {
-
-        //IDをセット
-        Map m = (Map) manufacuturerListPage.getManufacturerItems().get(
-                manufacuturerListPage.getRowIndex());
-        BigDecimal id = (BigDecimal) m.get("manufacturersId");
-        manufacuturerListPage.setManufacturersId(id);
-
+    public Class<?> doUpdate() {
+        getManufacturerListPage().setManufacturersId(
+                getManufacturerListPage().getTargetId());
         return ManufacturerEditPage.class;
     }
 
@@ -64,19 +72,21 @@
         this.manufacuturerListPage = listPage;
     }
 
-    public Class initialize() {
+    public Class<?> initialize() {
         return null;
     }
 
-    public Class prerender() {
+    public Class<?> prerender() {
         //		List list = getMockList();
         //		makerListPage.setManufacturerItems(list);
-        List list = manufacturerService.getManufacturesInfoList();
-        List mapList = new ArrayList();
-        if (list.size() > 0) {
-            dxo.convert(list, mapList);
-        }
-        manufacuturerListPage.setManufacturerItems(mapList);
+        List<ManufacturersInfo> list = manufacturerService
+                .getManufacturesInfoList();
+        List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
+        manufacturersDxo.convert(list, mapList);
+        getManufacuturerListPage().setManufacturerItems(mapList);
+
+        // redner FacesMessage
+        FacesMessageUtil.renderMessages();
         return null;
     }
 
@@ -106,12 +116,12 @@
         this.manufacturerService = manufacturerService;
     }
 
-    public ManufacturersDxo getDxo() {
-        return dxo;
+    public ManufacturersDxo getManufacturersDxo() {
+        return manufacturersDxo;
     }
 
-    public void setDxo(ManufacturersDxo dxo) {
-        this.dxo = dxo;
+    public void setManufacturersDxo(ManufacturersDxo dxo) {
+        this.manufacturersDxo = dxo;
     }
 
 }

Modified: pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerListPage.java
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerListPage.java	2007-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/ManufacturerListPage.java	2007-09-05 13:56:19 UTC (rev 540)
@@ -3,96 +3,102 @@
 import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.List;
+import java.util.Map;
 
 import org.seasar.teeda.extension.annotation.scope.SubapplicationScope;
 
 public class ManufacturerListPage implements Serializable {
 
-	/**
+    /**
      * 
      */
     private static final long serialVersionUID = 1619134135122729994L;
 
     private String manufacturersDesc;
 
-	private int manufacturerIndex=1;
+    private int manufacturerIndex = 1;
 
-	@SubapplicationScope
-	private List manufacturerItems;
+    @SubapplicationScope
+    private List<Map<String, Object>> manufacturerItems;
 
-	private String manufacturersName;
+    private String manufacturersName;
 
-	private String mode;
+    private String mode;
 
-	private int rowIndex;
+    private BigDecimal targetId;
 
-	private BigDecimal manufacturersId;
+    private BigDecimal manufacturersId;
 
-	private String title;
+    private String title;
 
-	public String getManufacturersDesc() {
-		return manufacturersDesc;
-	}
+    public String getManufacturersDesc() {
+        return manufacturersDesc;
+    }
 
-	public void setManufacturersDesc(String manufacturerDesc) {
-		this.manufacturersDesc = manufacturerDesc;
-	}
+    public void setManufacturersDesc(String manufacturerDesc) {
+        this.manufacturersDesc = manufacturerDesc;
+    }
 
-	public int getManufacturerIndex() {
-		return manufacturerIndex+1;
-	}
+    public int getManufacturerIndex() {
+        return manufacturerIndex + 1;
+    }
 
-	public void setManufacturerIndex(int manufacturerIndex) {
-		this.manufacturerIndex = manufacturerIndex;
-	}
+    public void setManufacturerIndex(int manufacturerIndex) {
+        this.manufacturerIndex = manufacturerIndex;
+    }
 
-	public List getManufacturerItems() {
-		return manufacturerItems;
-	}
+    public List<Map<String, Object>> getManufacturerItems() {
+        return manufacturerItems;
+    }
 
-	public void setManufacturerItems(List manufacturerItems) {
-		this.manufacturerItems = manufacturerItems;
-	}
+    public void setManufacturerItems(List<Map<String, Object>> manufacturerItems) {
+        this.manufacturerItems = manufacturerItems;
+    }
 
-	public String getManufacturersName() {
-		return manufacturersName;
-	}
+    public String getManufacturersName() {
+        return manufacturersName;
+    }
 
-	public void setManufacturersName(String manufacturerName) {
-		this.manufacturersName = manufacturerName;
-	}
+    public void setManufacturersName(String manufacturerName) {
+        this.manufacturersName = manufacturerName;
+    }
 
-	public String getMode() {
-		return mode;
-	}
+    public String getMode() {
+        return mode;
+    }
 
-	public void setMode(String mode) {
-		this.mode = mode;
-	}
+    public void setMode(String mode) {
+        this.mode = mode;
+    }
 
-	public int getRowIndex() {
-		return rowIndex;
-	}
+    /**
+     * @return targetId
+     */
+    public BigDecimal getTargetId() {
+        return targetId;
+    }
 
-	public void setRowIndex(int rowIndex) {
-		this.rowIndex = rowIndex;
-	}
+    /**
+     * @param targetId 設定する targetId
+     */
+    public void setTargetId(BigDecimal targetId) {
+        this.targetId = targetId;
+    }
 
-	public String getTitle() {
-		return title;
-	}
+    public String getTitle() {
+        return title;
+    }
 
-	public void setTitle(String title) {
-		this.title = title;
-	}
+    public void setTitle(String title) {
+        this.title = title;
+    }
 
-	public BigDecimal getManufacturersId() {
-		return manufacturersId;
-	}
+    public BigDecimal getManufacturersId() {
+        return manufacturersId;
+    }
 
-	public void setManufacturersId(BigDecimal manufacturersId) {
-		this.manufacturersId = manufacturersId;
-	}
+    public void setManufacturersId(BigDecimal manufacturersId) {
+        this.manufacturersId = manufacturersId;
+    }
 
-
 }

Modified: pompei/portlets/pompei-core/trunk/src/main/webapp/view/admin/product/manufacturerEdit.html
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/webapp/view/admin/product/manufacturerEdit.html	2007-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/webapp/view/admin/product/manufacturerEdit.html	2007-09-05 13:56:19 UTC (rev 540)
@@ -7,7 +7,7 @@
 </head>
 <body>
 <form id="form" method="post">
-<input type="hidden" id="manufacturersId"/>
+<input type="hidden" id="manufacturersId"/>
 <div><span id="allMessages"></span></div>
 <table border="1">
 	<tr style="dummy" height="20px">
@@ -32,7 +32,7 @@
 	</tr>
 </table>
 <br/>
-<input type="submit" id="doAdd" value="登録する" />
+<input type="submit" id="doUpdate" value="登録する" />
 <input type="submit" id="jumpManufacturerList" value="一覧に戻る" />
 </form>
 </body></html>

Modified: pompei/portlets/pompei-core/trunk/src/main/webapp/view/admin/product/manufacturerList.html
===================================================================
--- pompei/portlets/pompei-core/trunk/src/main/webapp/view/admin/product/manufacturerList.html	2007-09-05 09:57:39 UTC (rev 539)
+++ pompei/portlets/pompei-core/trunk/src/main/webapp/view/admin/product/manufacturerList.html	2007-09-05 13:56:19 UTC (rev 540)
@@ -6,10 +6,9 @@
 <title id="title-head">メーカー一覧</title>
 <script language="javascript">
 <!--
-function setRowIndex(form, updId){
-	args = updId.split(":");
+function setTargetId(form, id){
 	children = form.childNodes;
-	children[1].value = args[2];
+	children[1].value = id;
 }
 function setMode(form, mode){
 	children = form.childNodes;
@@ -19,7 +18,7 @@
 </script>
 </head>
 <body>
-<form id="form" method="post"><input type="hidden" id="mode" /><input type="hidden" id="rowIndex" />
+<form id="form" method="post"><input type="hidden" id="mode" /><input type="hidden" id="targetId" />
 
 <table border="1">
 	<thead>
@@ -36,8 +35,7 @@
 			<td><span id="manufacturersName">アディダス</span>&amp;nbsp;</td>
 			<td><span id="manufacturersDesc">ドイツのスポーツメーカー</span>&amp;nbsp;</td>
 			<td>
-				<input type="submit" id="doUpdate" value="編集" onclick="setMode(this.form,'update');setRowIndex(this.form,this.name)"/>
-				<input type="submit" id="doDelete" value="削除" onclick="if(confirm('削除します。よろしいですか?')){setMode(this.form,'delete');setRowIndex(this.form,this.name)}else{return false}"/>
+              <input type="submit" id="doUpdate" value="編集" onclick="setMode(this.form,'update');setTargetId(this.form,this.nextSibling.value);" /><input type="hidden" id="manufacturersId" /><input type="button" id="doDelete" value="削除" onclick="if(confirm('削除します。よろしいですか?')){setMode(this.form,'delete');setTargetId(this.form,this.previousSibling.value)}else{return false}" />
 			</td>
 		</tr>
 	</tbody>


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