Source Code Cross Referenced for DynamicInformationProviderImpl.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » portal » pluto » 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 » apache lenya 2.0 » org.apache.cocoon.portal.pluto 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:        package org.apache.cocoon.portal.pluto;
018:
019:        import java.util.HashSet;
020:        import java.util.Iterator;
021:
022:        import javax.portlet.PortletMode;
023:        import javax.portlet.WindowState;
024:
025:        import org.apache.avalon.framework.service.ServiceManager;
026:        import org.apache.cocoon.portal.coplet.CopletInstanceData;
027:        import org.apache.cocoon.portal.pluto.om.PortletEntityImpl;
028:        import org.apache.pluto.om.window.PortletWindow;
029:        import org.apache.pluto.services.information.DynamicInformationProvider;
030:        import org.apache.pluto.services.information.PortletActionProvider;
031:        import org.apache.pluto.services.information.PortletURLProvider;
032:        import org.apache.pluto.services.information.ResourceURLProvider;
033:
034:        /**
035:         * Our own dynamic information provider
036:         *
037:         * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
038:         * 
039:         * @version CVS $Id: DynamicInformationProviderImpl.java 433543 2006-08-22 06:22:54Z crossley $
040:         */
041:        public class DynamicInformationProviderImpl implements 
042:                DynamicInformationProvider {
043:
044:            /** Service manager */
045:            protected final ServiceManager manager;
046:
047:            /** The portal context provider */
048:            protected final PortalContextProviderImpl provider;
049:
050:            /**
051:             * Constructor
052:             */
053:            public DynamicInformationProviderImpl(ServiceManager manager,
054:                    PortalContextProviderImpl provider) {
055:                this .manager = manager;
056:                this .provider = provider;
057:            }
058:
059:            /* (non-Javadoc)
060:             * @see org.apache.pluto.services.information.DynamicInformationProvider#getPortletURLProvider(org.apache.pluto.om.window.PortletWindow)
061:             */
062:            public PortletURLProvider getPortletURLProvider(
063:                    PortletWindow portletWindow) {
064:                return new PortletURLProviderImpl(portletWindow, this .manager);
065:            }
066:
067:            /* (non-Javadoc)
068:             * @see org.apache.pluto.services.information.DynamicInformationProvider#getResourceURLProvider(org.apache.pluto.om.window.PortletWindow)
069:             */
070:            public ResourceURLProvider getResourceURLProvider(
071:                    PortletWindow portletWindow) {
072:                return new ResourceURLProviderImpl(this .provider);
073:            }
074:
075:            /**
076:             * @see org.apache.pluto.services.information.DynamicInformationProvider#getPortletActionProvider(org.apache.pluto.om.window.PortletWindow)
077:             */
078:            public PortletActionProvider getPortletActionProvider(
079:                    PortletWindow portletWindow) {
080:                return new PortletActionProviderImpl(portletWindow);
081:            }
082:
083:            /**
084:             * @see org.apache.pluto.services.information.DynamicInformationProvider#getPortletMode(org.apache.pluto.om.window.PortletWindow)
085:             */
086:            public PortletMode getPortletMode(PortletWindow portletWindow) {
087:                final CopletInstanceData cid = ((PortletEntityImpl) portletWindow
088:                        .getPortletEntity()).getCopletInstanceData();
089:                final String pmString = (String) cid
090:                        .getTemporaryAttribute("portlet-mode");
091:                if (pmString == null) {
092:                    return PortletMode.VIEW;
093:                }
094:                return new PortletMode(pmString);
095:            }
096:
097:            /**
098:             * @see org.apache.pluto.services.information.DynamicInformationProvider#getWindowState(org.apache.pluto.om.window.PortletWindow)
099:             */
100:            public WindowState getWindowState(PortletWindow portletWindow) {
101:                final CopletInstanceData cid = ((PortletEntityImpl) portletWindow
102:                        .getPortletEntity()).getCopletInstanceData();
103:                final String wsString = (String) cid
104:                        .getTemporaryAttribute("window-state");
105:                if (wsString != null) {
106:                    return new WindowState(wsString);
107:                }
108:                return WindowState.NORMAL;
109:            }
110:
111:            /**
112:             * @see org.apache.pluto.services.information.DynamicInformationProvider#getResponseContentType()
113:             */
114:            public String getResponseContentType() {
115:                return "text/html";
116:            }
117:
118:            static protected final HashSet responseMimeTypes = new HashSet();
119:
120:            static {
121:                responseMimeTypes.add("text/html");
122:            }
123:
124:            /* (non-Javadoc)
125:             * @see org.apache.pluto.services.information.DynamicInformationProvider#getResponseContentTypes()
126:             */
127:            public Iterator getResponseContentTypes() {
128:                return responseMimeTypes.iterator();
129:            }
130:
131:            /* (non-Javadoc)
132:             * @see org.apache.pluto.services.information.DynamicInformationProvider#isPortletModeAllowed(javax.portlet.PortletMode)
133:             */
134:            public boolean isPortletModeAllowed(PortletMode mode) {
135:                return this .provider.getSupportedPortletModes().contains(mode);
136:            }
137:
138:            /* (non-Javadoc)
139:             * @see org.apache.pluto.services.information.DynamicInformationProvider#isWindowStateAllowed(javax.portlet.WindowState)
140:             */
141:            public boolean isWindowStateAllowed(WindowState state) {
142:                return this.provider.getSupportedWindowStates().contains(state);
143:            }
144:
145:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.