Source Code Cross Referenced for SelectionTagsBean.java in  » Content-Management-System » contineo » org » contineo » web » 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 » Content Management System » contineo » org.contineo.web 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.contineo.web;
002:
003:        import org.contineo.core.security.Group;
004:        import org.contineo.core.security.dao.GroupDAO;
005:
006:        import org.contineo.util.Context;
007:        import org.contineo.util.config.LoggingConfigurator;
008:
009:        import org.contineo.web.i18n.Messages;
010:
011:        import java.util.Collection;
012:        import java.util.Iterator;
013:
014:        import javax.faces.model.SelectItem;
015:
016:        /**
017:         * <p>
018:         * The SelectionTagsBean Class is the backing bean for selection lists. It is
019:         * used to store the options of the various selection components.
020:         * <p>
021:         */
022:        public class SelectionTagsBean {
023:            /**
024:             * Gets the option items for languages
025:             */
026:            public SelectItem[] getLanguages() {
027:                return new SelectItem[] {
028:                        new SelectItem("en", Messages
029:                                .getMessage("msg.jsp.login.language.english")),
030:                        new SelectItem("it", Messages
031:                                .getMessage("msg.jsp.login.language.italian")),
032:                        new SelectItem("de", Messages
033:                                .getMessage("msg.jsp.login.language.german")),
034:                        new SelectItem("fr", Messages
035:                                .getMessage("msg.jsp.login.language.french")),
036:                        new SelectItem("es", Messages
037:                                .getMessage("msg.jsp.login.language.spanish")) };
038:            }
039:
040:            /**
041:             * Gets the option items for yes/no flags
042:             */
043:            public SelectItem[] getYesNo() {
044:                return new SelectItem[] {
045:                        new SelectItem(1, Messages.getMessage("yes")),
046:                        new SelectItem(0, Messages.getMessage("no")) };
047:            }
048:
049:            /**
050:             * Gets the option items for version types
051:             */
052:            public SelectItem[] getVersionTypes() {
053:                return new SelectItem[] {
054:                        new SelectItem("release", Messages
055:                                .getMessage("msg.jsp.newrelease")),
056:                        new SelectItem("oldversion", Messages
057:                                .getMessage("msg.jsp.oldversion")),
058:                        new SelectItem("subversion", Messages
059:                                .getMessage("msg.jsp.newsubversion")) };
060:            }
061:
062:            /**
063:             * Gets the option items for groups selection
064:             */
065:            public SelectItem[] getGroups() {
066:                // gets available groups
067:                GroupDAO dao = (GroupDAO) Context.getInstance().getBean(
068:                        GroupDAO.class);
069:                Collection coll = dao.findAll();
070:
071:                SelectItem[] items = new SelectItem[coll.size() - 1];
072:
073:                int i = 0;
074:
075:                for (Iterator iter = coll.iterator(); iter.hasNext();) {
076:                    Group currGroup = (Group) iter.next();
077:
078:                    // do not include admin group in list
079:                    if (!currGroup.getGroupName().equals("admin")) {
080:                        items[i++] = new SelectItem(currGroup.getGroupName());
081:                    }
082:                }
083:
084:                return items;
085:            }
086:
087:            /**
088:             * Gets the option items for relations
089:             */
090:            public SelectItem[] getRelations() {
091:                return new SelectItem[] {
092:                        new SelectItem("gt", Messages
093:                                .getMessage("msg.jsp.greater")),
094:                        new SelectItem("eq", Messages
095:                                .getMessage("msg.jsp.equals")),
096:                        new SelectItem("lt", Messages
097:                                .getMessage("msg.jsp.less")) };
098:            }
099:
100:            /**
101:             * Gets the option items for relations regarding dates
102:             */
103:            public SelectItem[] getDateRelations() {
104:                return new SelectItem[] {
105:                        new SelectItem("gt", Messages
106:                                .getMessage("msg.jsp.after")),
107:                        new SelectItem("eq", Messages.getMessage("msg.jsp.at")),
108:                        new SelectItem("lt", Messages
109:                                .getMessage("msg.jsp.before")) };
110:            }
111:
112:            /**
113:             * Gets the option items for file formats
114:             */
115:            public SelectItem[] getFormats() {
116:                return new SelectItem[] {
117:                        new SelectItem("html", Messages
118:                                .getMessage("msg.jsp.internetpage")
119:                                + " (.html)"),
120:                        new SelectItem("xml", Messages
121:                                .getMessage("msg.jsp.xmlfile")
122:                                + " (.xml)"),
123:                        new SelectItem("pdf", "Adobe Acrobat (.pdf)"),
124:                        new SelectItem("ps", "Adobe Postscript (.ps)"),
125:                        new SelectItem("doc", "Microsoft Word (.doc)"),
126:                        new SelectItem("sxw", "OpenOffice Writer (.sxw)"),
127:                        new SelectItem("sxc", "OpenOffice Calc (.sxc)"),
128:                        new SelectItem("sxi", "OpenOffice Impress (.sxi)"),
129:                        new SelectItem("wpd", "Word Perfect (.wpd)"),
130:                        new SelectItem("rtf", "Rich Text Format (.rtf)"),
131:                        new SelectItem("txt", Messages
132:                                .getMessage("msg.jsp.textfile")
133:                                + " (.txt)") };
134:            }
135:
136:            /**
137:             * Gets the option items for message priorities
138:             */
139:            public SelectItem[] getMessagePriorities() {
140:                return new SelectItem[] {
141:                        new SelectItem(0, Messages.getMessage("msg.jsp.low")),
142:                        new SelectItem(1, Messages.getMessage("msg.jsp.normal")),
143:                        new SelectItem(2, Messages.getMessage("msg.jsp.high")) };
144:            }
145:
146:            /**
147:             * Gets the option items for web log appenders
148:             */
149:            public SelectItem[] getWebAppenders() {
150:                LoggingConfigurator conf = new LoggingConfigurator();
151:                Collection<String> loggings = conf.getWebLoggingFiles();
152:                SelectItem[] items = new SelectItem[loggings.size()];
153:                int i = 0;
154:
155:                for (String logfile : loggings) {
156:                    items[i++] = new SelectItem(logfile, logfile);
157:                }
158:
159:                return items;
160:            }
161:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.