Source Code Cross Referenced for PortletsDescriptor.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 2004-2005 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.Iterator;
018:        import java.util.LinkedHashMap;
019:        import java.util.logging.Logger;
020:
021:        import org.jdom.Element;
022:        import org.jdom.Namespace;
023:        import com.sun.portal.log.common.PortalLogger;
024:
025:        /**
026:         * The Portlets Descriptor is the entry point of accessing portlet 
027:         * descriptors. 
028:         * <P>
029:         * The PortletsDescriptor loads all the portlet descriptors into memory, 
030:         * it delegates the loading of each portlet descriptor to the 
031:         * <code>PortletDescriptor</code> classe.
032:         * <P>
033:         * The PortletsDescriptor class provides member methods to get to all
034:         * portlet descriptors, the portlet names, as well as to a specified portlet
035:         * description. The following get**() methods are available:
036:         * <UL>
037:         *   <LI><code>getPortletDescriptors()</code>
038:         *   <LI><code>getPortletNames()</code>
039:         *   <LI><code>getPortletDescriptor()</code>
040:         *</UL>
041:         *
042:         */
043:        public class PortletsDescriptor {
044:
045:            // Portlets Descriptor Element Name
046:            public static final String PORTLET = "portlet";
047:
048:            // Global variables
049:            private List _portletDescriptors = new ArrayList();
050:            private List _portletNames = new ArrayList();
051:            private DeploymentExtensionDescriptor _depExtDescriptor;
052:
053:            // Create a logger for this class
054:            private static Logger debugLogger = PortalLogger
055:                    .getLogger(PortletsDescriptor.class);
056:
057:            public PortletsDescriptor(Logger logger,
058:                    DeploymentExtensionDescriptor depExtDescriptor) {
059:                _depExtDescriptor = depExtDescriptor;
060:            }
061:
062:            /**
063:             * Loads the portlets descriptor into memory.
064:             * <P>
065:             * This class only loads the top level elements, it delegates the load 
066:             * action into portlet descriptor class.
067:             * <P>
068:             * @param The root Element of the deployment descriptor document
069:             */
070:            public void load(Element element, Namespace namespace)
071:                    throws DeploymentDescriptorException {
072:                List portletElements = element.getChildren(PORTLET, namespace);
073:                if (portletElements.isEmpty()) {
074:                    debugLogger.warning("PSPL_PCCCSPPCCD0010");
075:                }
076:
077:                Iterator iterator = portletElements.iterator();
078:                while (iterator.hasNext()) {
079:                    Element portletElement = (Element) iterator.next();
080:                    PortletDescriptor portletDescriptor = new PortletDescriptor(
081:                            debugLogger, _depExtDescriptor);
082:                    portletDescriptor.load(portletElement, namespace);
083:                    _portletDescriptors.add(portletDescriptor);
084:                    _portletNames.add(portletDescriptor.getPortletName());
085:                }
086:            }
087:
088:            /**
089:             * Returns the portlet names.
090:             * <P>
091:             * @return A List of portlet names
092:             */
093:            public List getPortletNames() {
094:                return _portletNames;
095:            }
096:
097:            public LinkedHashMap getGeneratedEvents() {
098:                if (_depExtDescriptor == null) {
099:                    return new LinkedHashMap();
100:                } else {
101:                    return _depExtDescriptor.getGeneratedEvents();
102:                }
103:            }
104:
105:            public LinkedHashMap getConsumeEvents() {
106:                if (_depExtDescriptor == null) {
107:                    return new LinkedHashMap();
108:                } else {
109:                    return _depExtDescriptor.getConsumeEvents();
110:                }
111:            }
112:
113:            /**
114:             * Returns the portlet descriptors.
115:             * <P>
116:             * @return A List of <code>PortletDescriptor</code>s
117:             */
118:            public List getPortletDescriptors() {
119:                return _portletDescriptors;
120:            }
121:
122:            /**
123:             * Returns the specified portlet descriptor.
124:             * <P>
125:             * @param portletName The portlet name
126:             * @return A <code>PortletDescriptor</code>. The returned value could be
127:             * null if the specified portlet descriptor is not found.
128:             */
129:            public PortletDescriptor getPortletDescriptor(String portletName) {
130:                PortletDescriptor portlet = null;
131:                boolean stop = false;
132:                Iterator iterator = _portletDescriptors.iterator();
133:                while (iterator.hasNext() && !stop) {
134:                    PortletDescriptor portletDescriptor = (PortletDescriptor) iterator
135:                            .next();
136:                    if (portletDescriptor.getPortletName().equals(portletName)) {
137:                        portlet = portletDescriptor;
138:                        stop = true;
139:                    }
140:                }
141:
142:                return portlet;
143:            }
144:
145:            /**
146:             * The toString method.
147:             * <P>
148:             * @return the <code>String</code> representation of the portlets
149:             * descriptor.
150:             */
151:            public String toString() {
152:                StringBuffer sb = new StringBuffer("PortletsDescriptor [");
153:
154:                Iterator iterator = _portletDescriptors.iterator();
155:                while (iterator.hasNext()) {
156:                    PortletDescriptor portletDescriptor = (PortletDescriptor) iterator
157:                            .next();
158:                    sb.append(portletDescriptor.toString());
159:                    sb.append("\n");
160:                }
161:                sb.append("]");
162:                sb.append("\n");
163:                return sb.toString();
164:            }
165:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.