[pal-cvs 2601] [333]

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2007年 7月 23日 (月) 09:00:16 JST


Revision: 333
          http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=333
Author:   takeharu
Date:     2007-07-23 09:00:15 +0900 (Mon, 23 Jul 2007)

Log Message:
-----------
 

Modified Paths:
--------------
    pompei/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/CategoryListAction.java


-------------- next part --------------
Modified: pompei/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/CategoryListAction.java
===================================================================
--- pompei/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/CategoryListAction.java	2007-07-22 23:56:12 UTC (rev 332)
+++ pompei/trunk/src/main/java/jp/sf/pal/pompei/web/admin/product/CategoryListAction.java	2007-07-23 00:00:15 UTC (rev 333)
@@ -6,14 +6,16 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.faces.model.DataModel;
-
 import jp.sf.pal.pompei.dxo.CategoriesDxo;
 import jp.sf.pal.pompei.exentity.CategoriesDescription;
 
 public class CategoryListAction {
+
+	/**
+	 *
+	 */
 	private CategoriesDxo dxo;
-	private DataModel model;
+
 	/**
 	 *
 	 */
@@ -22,8 +24,51 @@
 	/**
 	 *
 	 */
-	private CategoryService categoryListService;
+	private CategoryService categoryService;
 
+	public Class initialize() {
+		System.out.println("CategoryListAction:initialize");
+		return null;
+	}
+
+	public Class prerender() {
+		System.out.println("CategoryListAction:prerender");
+		System.out.println("isPostback:" + categoryListPage.isPostback());
+
+		if(categoryListPage.getParentId() == null) {
+			categoryListPage.setParentId(new BigDecimal("0"));
+		}
+
+		if(categoryListPage.getBreadcrumbItems() == null) {
+
+			categoryListPage.setCategoriesId(new BigDecimal("0"));
+
+			List<Map> list = new ArrayList<Map>();
+			Map<String, Object> m = new HashMap<String, Object>();
+			m.put("categoriesId",new BigDecimal("0"));
+			m.put("breadcrumb","TOP");
+			list.add(m);
+			categoryListPage.setBreadcrumbItems(list);
+
+		}else {
+			if(categoryListPage.getCategoriesId()!=null) {
+				categoryListPage.setParentId(categoryListPage.getCategoriesId());
+			}
+
+			//パンくずリストを再セット
+			List list = setBreadcrumb(categoryListPage.getBreadcrumbItems(),categoryListPage.getParentId());
+			categoryListPage.setBreadcrumbItems(list);
+		}
+
+		//カテゴリ一覧の取得
+		List list = categoryService.getSubCategoryList(categoryListPage.getParentId());
+		List cList = new ArrayList();
+		dxo.convert(list,cList);
+		categoryListPage.setCategoryItems(cList);
+
+		return null;
+	}
+
 	public Class doChangeOrder() {
 		return null;
 	}
@@ -34,11 +79,11 @@
 		//選択行を取得
 		BigDecimal id = getCategoriesId();
 
-		if(categoryListService.hasChild(id)) {
+		if(categoryService.hasChild(id)) {
 			return null;
 		}
 
-		categoryListService.deleteCategories(id);
+		categoryService.deleteCategories(id);
 
 		return null;
 	}
@@ -68,16 +113,12 @@
 	/**
 	 * @return categoryListService
 	 */
-	public CategoryService getCategoryListService() {
-		return categoryListService;
+	public CategoryService getCategoryService() {
+		return categoryService;
 	}
 
-	public Class initialize() {
-		System.out.println("CategoryListAction:initialize");
-		return null;
-	}
 
-	private List<Map> setBreadcrumb(List<Map> breadcrumbItems, BigDecimal id,String name) {
+	private List<Map> setBreadcrumb(List<Map> breadcrumbItems, BigDecimal id) {
 		List<Map> list = new ArrayList<Map>();
 		for (Map m : breadcrumbItems) {
 			list.add(m);
@@ -86,7 +127,7 @@
 			}
 		}
 
-		CategoriesDescription d = categoryListService.getCategoriesDescription(categoryListPage.getCategoriesId());
+		CategoriesDescription d = categoryService.getCategoriesDescription(categoryListPage.getCategoriesId());
 
 		Map m = new HashMap();
 		m.put("categoriesId", id);
@@ -95,58 +136,11 @@
 		return list;
 	}
 
-
-	public Class prerender() {
-		System.out.println("CategoryListAction:prerender");
-		System.out.println("isPostback:" + categoryListPage.isPostback());
-
-		if(categoryListPage.getParentId() == null) {
-			categoryListPage.setParentId(new BigDecimal("0"));
-		}
-
-		if(categoryListPage.getBreadcrumbItems() == null) {
-
-			categoryListPage.setCategoriesId(new BigDecimal("0"));
-
-			List<Map> list = new ArrayList<Map>();
-			Map<String, Object> m = new HashMap<String, Object>();
-			m.put("categoriesId",new BigDecimal("0"));
-			m.put("breadcrumb","TOP");
-			list.add(m);
-			categoryListPage.setBreadcrumbItems(list);
-		}else {
-			if(categoryListPage.getCategoriesId()!=null) {
-				categoryListPage.setParentId(categoryListPage.getCategoriesId());
-			}
-
-			//パンくずリストを再セット
-			List list = setBreadcrumb(categoryListPage.getBreadcrumbItems(),categoryListPage.getParentId(),categoryListPage.getCategoriesName());
-			categoryListPage.setBreadcrumbItems(list);
-		}
-
-		//一覧の取得
-		List list = categoryListService.getSubCategoryList(categoryListPage.getParentId());
-		List cList = new ArrayList();
-		dxo.convert(list,cList);
-		categoryListPage.setCategoryItems(cList);
-
-		return null;
-	}
-
 	/**
-	 * Editページからの戻りかどうかを表すフラグ
-	 * @return
-	 */
-	private boolean returnedEditPage() {
-		return !(categoryListPage.getPreviousViewId()!= null && categoryListPage.getPreviousViewId().endsWith("categoryEdit.html"));
-	}
-
-
-	/**
 	 * @param categoryListService 設定する categoryListService
 	 */
-	public void setCategoryListService(CategoryService categoryListService) {
-		this.categoryListService = categoryListService;
+	public void setCategoryService(CategoryService categoryListService) {
+		this.categoryService = categoryListService;
 	}
 
 	public Class goCategoryList() {
@@ -162,14 +156,6 @@
 		this.dxo = dxo;
 	}
 
-	public DataModel getModel() {
-		return model;
-	}
-
-	public void setModel(DataModel model) {
-		this.model = model;
-	}
-
 	public String doUpdate() {
 		BigDecimal id = getCategoriesId();
 		categoryListPage.setTargetId(id);


pal-cvs メーリングリストの案内
Back to archive index