Source Code Cross Referenced for PortletInfoDescriptor.java in  » Portal » Open-Portal » com » sun » portal » portletcontainercommon » descriptor » 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 » Open Portal » com.sun.portal.portletcontainercommon.descriptor 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002 Sun Microsystems, Inc. All 
003:         * rights reserved. Use of this product is subject 
004:         * to license terms. Federal Acquisitions: 
005:         * Commercial Software -- Government Users 
006:         * Subject to Standard License Terms and 
007:         * Conditions. 
008:         * 
009:         * Sun, Sun Microsystems, the Sun logo, and Sun ONE 
010:         * are trademarks or registered trademarks of Sun Microsystems, 
011:         * Inc. in the United States and other countries. 
012:         */
013:        package com.sun.portal.portletcontainercommon.descriptor;
014:
015:        import java.util.List;
016:        import java.util.ArrayList;
017:        import java.util.StringTokenizer;
018:        import java.util.logging.Logger;
019:
020:        import org.jdom.Element;
021:        import org.jdom.Namespace;
022:
023:        /**
024:         * The portlet info descriptor is the descriptor for the specific
025:         * portlet information. For example, the resource bundle definition.
026:         * <P>
027:         * There are two ways to specify the resource bundle in the
028:         * descriptor, the first way is to define in the descriptor directly, the
029:         * second way is to reference to a resource bundle in the descriptor.
030:         * <P>
031:         * While getting the resource bundle descriptor information, clients
032:         * need to first use the <code>getType</code>() method to figure out
033:         * which way the resource bundle is defined.
034:         */
035:        public class PortletInfoDescriptor {
036:
037:            // Portlet info descriptor element names
038:            public static final String TITLE = "title";
039:            public static final String SHORT_TITLE = "short-title";
040:            public static final String KEYWORDS = "keywords";
041:
042:            // Global variables
043:            private String _title;
044:            private String _shortTitle;
045:            private List _keywords = new ArrayList();
046:
047:            public PortletInfoDescriptor(Logger logger) {
048:            }
049:
050:            /**
051:             * Loads the portlet info descriptor into memory.
052:             * <P>
053:             * @param The portlet info descriptor Element 
054:             */
055:            public void load(Element element, Namespace namespace) {
056:                _title = element.getChildTextTrim(TITLE, namespace);
057:                _shortTitle = element.getChildTextTrim(SHORT_TITLE, namespace);
058:                String keywordsStr = element.getChildTextTrim(KEYWORDS,
059:                        namespace);
060:                if (keywordsStr != null) {
061:                    loadKeywords(keywordsStr);
062:                }
063:
064:            }
065:
066:            /**
067:             * Returns the title. 
068:             * <P>
069:             * @return <code>String</code> of the title.
070:             */
071:            public String getTitle() {
072:                return _title;
073:            }
074:
075:            /**
076:             * Returns the short title. 
077:             * <P>
078:             * @return <code>String</code> of the title.
079:             */
080:            public String getShortTitle() {
081:                return _shortTitle;
082:            }
083:
084:            /**
085:             * Returns the keywords. 
086:             * <P>
087:             * @return <code>List</code> of <code>String</code>s represent the 
088:             * keywords.
089:             */
090:            public List getKeywords() {
091:                return _keywords;
092:            }
093:
094:            /*
095:             * Loads the keywords into a <code>List</code>
096:             */
097:            private void loadKeywords(String keywordsStr) {
098:                StringTokenizer st = new StringTokenizer(keywordsStr, ",",
099:                        false);
100:                while (st.hasMoreTokens()) {
101:                    String kw = st.nextToken().trim();
102:                    _keywords.add(kw);
103:                }
104:
105:            }
106:
107:            /**
108:             * The toString method.
109:             * <P>
110:             * @return the <code>String</code> representation of the portlet
111:             * info descriptor.
112:             */
113:            public String toString() {
114:                StringBuffer sb = new StringBuffer("PortletInfoDescriptor ");
115:
116:                if (_title != null) {
117:                    sb.append(" title [");
118:                    sb.append(_title);
119:                    sb.append("]");
120:                }
121:
122:                if (_shortTitle != null) {
123:                    sb.append(" short title [");
124:                    sb.append(_shortTitle);
125:                    sb.append("]");
126:                }
127:
128:                sb.append(" keywords [");
129:                for (int i = 0; i < _keywords.size(); i++) {
130:                    sb.append((String) _keywords.get(i));
131:                    sb.append(", ");
132:                }
133:                sb.append("]");
134:
135:                return sb.toString();
136:
137:            }
138:
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.