Source Code Cross Referenced for CatalogBean.java in  » J2EE » jfox » com » ibatis » jpetstore » presentation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » jfox » com.ibatis.jpetstore.presentation 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.ibatis.jpetstore.presentation;
002:
003:        import org.huihoo.jfox.soaf.container.ServiceFactory;
004:
005:        import com.ibatis.common.util.PaginatedList;
006:        import com.ibatis.jpetstore.domain.Category;
007:        import com.ibatis.jpetstore.domain.Item;
008:        import com.ibatis.jpetstore.domain.Product;
009:        import com.ibatis.jpetstore.service.CatalogService;
010:        import com.ibatis.struts.ActionContext;
011:        import com.ibatis.struts.BaseBean;
012:
013:        /**
014:         * <p/>Date: Mar 9, 2004 10:16:59 PM
015:         * 
016:         * @author Clinton Begin
017:         */
018:        public class CatalogBean extends BaseBean {
019:
020:            /* Constants */
021:
022:            private CatalogService catalogService = (CatalogService) ServiceFactory
023:                    .getInstance().getService(CatalogService.class);
024:
025:            /* Private Fields */
026:
027:            private String keyword;
028:
029:            private String pageDirection;
030:
031:            private String categoryId;
032:
033:            private Category category;
034:
035:            private PaginatedList categoryList;
036:
037:            private String productId;
038:
039:            private Product product;
040:
041:            private PaginatedList productList;
042:
043:            private String itemId;
044:
045:            private Item item;
046:
047:            private PaginatedList itemList;
048:
049:            /* JavaBeans Properties */
050:
051:            public String getKeyword() {
052:                return keyword;
053:            }
054:
055:            public void setKeyword(String keyword) {
056:                this .keyword = keyword;
057:            }
058:
059:            public String getPageDirection() {
060:                return pageDirection;
061:            }
062:
063:            public void setPageDirection(String pageDirection) {
064:                this .pageDirection = pageDirection;
065:            }
066:
067:            public String getCategoryId() {
068:                return categoryId;
069:            }
070:
071:            public void setCategoryId(String categoryId) {
072:                this .categoryId = categoryId;
073:            }
074:
075:            public String getProductId() {
076:                return productId;
077:            }
078:
079:            public void setProductId(String productId) {
080:                this .productId = productId;
081:            }
082:
083:            public String getItemId() {
084:                return itemId;
085:            }
086:
087:            public void setItemId(String itemId) {
088:                this .itemId = itemId;
089:            }
090:
091:            public Category getCategory() {
092:                return category;
093:            }
094:
095:            public void setCategory(Category category) {
096:                this .category = category;
097:            }
098:
099:            public Product getProduct() {
100:                return product;
101:            }
102:
103:            public void setProduct(Product product) {
104:                this .product = product;
105:            }
106:
107:            public Item getItem() {
108:                return item;
109:            }
110:
111:            public void setItem(Item item) {
112:                this .item = item;
113:            }
114:
115:            public PaginatedList getCategoryList() {
116:                return categoryList;
117:            }
118:
119:            public void setCategoryList(PaginatedList categoryList) {
120:                this .categoryList = categoryList;
121:            }
122:
123:            public PaginatedList getProductList() {
124:                return productList;
125:            }
126:
127:            public void setProductList(PaginatedList productList) {
128:                this .productList = productList;
129:            }
130:
131:            public PaginatedList getItemList() {
132:                return itemList;
133:            }
134:
135:            public void setItemList(PaginatedList itemList) {
136:                this .itemList = itemList;
137:            }
138:
139:            /* Public Methods */
140:
141:            public String viewCategory() {
142:                if (categoryId != null) {
143:                    productList = catalogService
144:                            .getProductListByCategory(categoryId);
145:                    category = catalogService.getCategory(categoryId);
146:                }
147:                return "success";
148:            }
149:
150:            public String searchProducts() {
151:                if (keyword == null || keyword.length() < 1) {
152:                    ActionContext
153:                            .getActionContext()
154:                            .setSimpleMessage(
155:                                    "Please enter a keyword to search for, then press the search button.");
156:                    return "failure";
157:                } else {
158:                    productList = catalogService.searchProductList(keyword
159:                            .toLowerCase());
160:                    return "success";
161:                }
162:            }
163:
164:            public String switchProductListPage() {
165:                if ("next".equals(pageDirection)) {
166:                    productList.nextPage();
167:                } else if ("previous".equals(pageDirection)) {
168:                    productList.previousPage();
169:                }
170:                return "success";
171:            }
172:
173:            public String viewProduct() {
174:                if (productId != null) {
175:                    itemList = catalogService.getItemListByProduct(productId);
176:                    product = catalogService.getProduct(productId);
177:                }
178:                return "success";
179:            }
180:
181:            public String switchItemListPage() {
182:                if ("next".equals(pageDirection)) {
183:                    itemList.nextPage();
184:                } else if ("previous".equals(pageDirection)) {
185:                    itemList.previousPage();
186:                }
187:                return "success";
188:            }
189:
190:            public String viewItem() {
191:                item = catalogService.getItem(itemId);
192:                product = item.getProduct();
193:                return "success";
194:            }
195:
196:            public void clear() {
197:                keyword = null;
198:                pageDirection = null;
199:
200:                categoryId = null;
201:                category = null;
202:                categoryList = null;
203:
204:                productId = null;
205:                product = null;
206:                productList = null;
207:
208:                itemId = null;
209:                item = null;
210:                itemList = null;
211:            }
212:
213:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.