Source Code Cross Referenced for CategoryForm.java in  » Portal » DLOG4J » dlog4j » formbean » 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 » Portal » DLOG4J » dlog4j.formbean 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  This program is free software; you can redistribute it and/or modify
003:         *  it under the terms of the GNU General Public License as published by
004:         *  the Free Software Foundation; either version 2 of the License, or
005:         *  (at your option) any later version.
006:         *
007:         *  This program is distributed in the hope that it will be useful,
008:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
009:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
010:         *  GNU Library General Public License for more details.
011:         *
012:         *  You should have received a copy of the GNU General Public License
013:         *  along with this program; if not, write to the Free Software
014:         *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
015:         */
016:        package dlog4j.formbean;
017:
018:        import javax.servlet.http.HttpServletRequest;
019:
020:        import java.util.List;
021:
022:        import org.apache.commons.lang.StringUtils;
023:        import org.apache.struts.action.ActionError;
024:        import org.apache.struts.action.ActionErrors;
025:        import org.apache.struts.action.ActionForm;
026:        import org.apache.struts.action.ActionMapping;
027:
028:        /** 
029:         * CategoryForm.java created by EasyStruts - XsltGen.
030:         * http://easystruts.sf.net
031:         * created on 02-03-2004
032:         * 
033:         * XDoclet definition:
034:         * @struts:form name="categoryForm"
035:         */
036:        public class CategoryForm extends ActionForm {
037:
038:            public final static int TYPE_OWNER = 0x00; //只有日记所有者才可以看
039:            public final static int TYPE_GENERAL = 0x01; //一般的日记分类
040:            public final static int TYPE_COMMON = 0x02; //只要是角色为ROLE_FRIEND的都可以发表日志
041:            // --------------------------------------------------------- Instance Variables
042:
043:            /** iconUrl property */
044:            private String iconUrl;
045:
046:            /** type property */
047:            private int type;
048:
049:            /** order property */
050:            private int order = -1;//该初始值请不要修改,用于创建分类时order字段的自动处理
051:
052:            /** name property */
053:            private String name;
054:
055:            /** id property */
056:            private int id = -1;
057:
058:            /** logs property */
059:            private List logs;
060:
061:            private SiteForm site;
062:
063:            private int logCount = 0;
064:
065:            // --------------------------------------------------------- Methods
066:            public boolean isCommon() {
067:                return type == TYPE_COMMON;
068:            }
069:
070:            public boolean isOwnerOnly() {
071:                return type == TYPE_OWNER;
072:            }
073:
074:            /** 
075:             * Method validate
076:             * @param ActionMapping mapping
077:             * @param HttpServletRequest request
078:             * @return ActionErrors
079:             */
080:            public ActionErrors validate(ActionMapping mapping,
081:                    HttpServletRequest request) {
082:                ActionErrors aes = new ActionErrors();
083:                if (type != TYPE_OWNER && type != TYPE_GENERAL
084:                        && type != TYPE_COMMON)
085:                    aes
086:                            .add("edit", new ActionError(
087:                                    "category_type_not_accept"));
088:                if (name != null && StringUtils.isEmpty(name))
089:                    aes.add("edit", new ActionError("not_empty_allow"));
090:                return aes;
091:            }
092:
093:            /** 
094:             * Returns the iconUrl.
095:             * @return String
096:             */
097:            public String getIconUrl() {
098:                return iconUrl;
099:            }
100:
101:            /** 
102:             * Set the iconUrl.
103:             * @param iconUrl The iconUrl to set
104:             */
105:            public void setIconUrl(String iconUrl) {
106:                if (!"".equals(iconUrl))
107:                    this .iconUrl = iconUrl;
108:            }
109:
110:            /** 
111:             * Returns the type.
112:             * @return int
113:             */
114:            public int getType() {
115:                return type;
116:            }
117:
118:            public String getTypeDesc() {
119:                switch (type) {
120:                case TYPE_OWNER:
121:                    return "隐藏分类";
122:                case TYPE_GENERAL:
123:                    return "普通分类";
124:                case TYPE_COMMON:
125:                    return "开放分类";
126:                }
127:                return null;
128:            }
129:
130:            /** 
131:             * Set the type.
132:             * @param type The type to set
133:             */
134:            public void setType(int type) {
135:                this .type = type;
136:            }
137:
138:            /** 
139:             * Returns the order.
140:             * @return int
141:             */
142:            public int getOrder() {
143:                return order;
144:            }
145:
146:            /** 
147:             * Set the order.
148:             * @param order The order to set
149:             */
150:            public void setOrder(int order) {
151:                this .order = order;
152:            }
153:
154:            /** 
155:             * Returns the name.
156:             * @return String
157:             */
158:            public String getName() {
159:                return name;
160:            }
161:
162:            /** 
163:             * Set the name.
164:             * @param name The name to set
165:             */
166:            public void setName(String name) {
167:                this .name = name;
168:            }
169:
170:            /** 
171:             * Returns the id.
172:             * @return int
173:             */
174:            public int getId() {
175:                return id;
176:            }
177:
178:            /** 
179:             * Set the id.
180:             * @param id The id to set
181:             */
182:            public void setId(int id) {
183:                this .id = id;
184:            }
185:
186:            /**
187:             * @return
188:             */
189:            public List getLogs() {
190:                return logs;
191:            }
192:
193:            /**
194:             * @param list
195:             */
196:            public void setLogs(List list) {
197:                logs = list;
198:            }
199:
200:            /* (non-Javadoc)
201:             * @see java.lang.Object#toString()
202:             */
203:            public String toString() {
204:                return name;
205:            }
206:
207:            /**
208:             * @return
209:             */
210:            public SiteForm getSite() {
211:                return site;
212:            }
213:
214:            /**
215:             * @param form
216:             */
217:            public void setSite(SiteForm form) {
218:                site = form;
219:            }
220:
221:            public int getLogCount() {
222:                return logCount;
223:            }
224:
225:            public void setLogCount(int logCount) {
226:                this.logCount = logCount;
227:            }
228:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.