Source Code Cross Referenced for AbstractPortalObjectContainer.java in  » Portal » jboss-portal-2.6.4 » org » jboss » portal » core » impl » model » portal » 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 » jboss portal 2.6.4 » org.jboss.portal.core.impl.model.portal 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /******************************************************************************
002:         * JBoss, a division of Red Hat                                               *
003:         * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
004:         * contributors as indicated by the @authors tag. See the                     *
005:         * copyright.txt in the distribution for a full listing of                    *
006:         * individual contributors.                                                   *
007:         *                                                                            *
008:         * This is free software; you can redistribute it and/or modify it            *
009:         * under the terms of the GNU Lesser General Public License as                *
010:         * published by the Free Software Foundation; either version 2.1 of           *
011:         * the License, or (at your option) any later version.                        *
012:         *                                                                            *
013:         * This software is distributed in the hope that it will be useful,           *
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
016:         * Lesser General Public License for more details.                            *
017:         *                                                                            *
018:         * You should have received a copy of the GNU Lesser General Public           *
019:         * License along with this software; if not, write to the Free                *
020:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
021:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
022:         ******************************************************************************/package org.jboss.portal.core.impl.model.portal;
023:
024:        import org.jboss.portal.core.model.content.ContentType;
025:        import org.jboss.portal.core.model.content.spi.ContentProvider;
026:        import org.jboss.portal.core.model.content.spi.ContentProviderRegistry;
027:        import org.jboss.portal.core.model.content.spi.handler.ContentHandler;
028:        import org.jboss.portal.core.model.portal.Context;
029:        import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
030:        import org.jboss.portal.core.model.portal.PortalObject;
031:        import org.jboss.portal.core.model.portal.PortalObjectContainer;
032:        import org.jboss.portal.core.model.portal.PortalObjectId;
033:        import org.jboss.portal.core.model.portal.PortalObjectPath;
034:        import org.jboss.portal.core.model.portal.PortalObjectPermission;
035:        import org.jboss.portal.jems.as.system.AbstractJBossService;
036:        import org.jboss.portal.security.PortalPermission;
037:        import org.jboss.portal.security.PortalPermissionCollection;
038:        import org.jboss.portal.security.PortalSecurityException;
039:        import org.jboss.portal.security.RoleSecurityBinding;
040:        import org.jboss.portal.security.spi.provider.AuthorizationDomain;
041:        import org.jboss.portal.security.spi.provider.DomainConfigurator;
042:        import org.jboss.portal.security.spi.provider.PermissionFactory;
043:        import org.jboss.portal.security.spi.provider.PermissionRepository;
044:        import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
045:
046:        import java.util.Collection;
047:        import java.util.HashSet;
048:        import java.util.Set;
049:
050:        /**
051:         * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
052:         * @version $Revision: 9516 $
053:         */
054:        public abstract class AbstractPortalObjectContainer extends
055:                AbstractJBossService implements  PortalObjectContainer,
056:                PermissionFactory, AuthorizationDomain, DomainConfigurator,
057:                PermissionRepository {
058:
059:            /** . */
060:            private ContentProviderRegistry contentProviderRegistry;
061:
062:            protected AbstractPortalObjectContainer() {
063:            }
064:
065:            public ContentProviderRegistry getContentProviderRegistry() {
066:                return contentProviderRegistry;
067:            }
068:
069:            public void setContentProviderRegistry(
070:                    ContentProviderRegistry contentProviderRegistry) {
071:                this .contentProviderRegistry = contentProviderRegistry;
072:            }
073:
074:            // PortalObjectContainer implementation******************************************************************************
075:
076:            public org.jboss.portal.core.model.portal.Context getContext() {
077:                return getContext("");
078:            }
079:
080:            public PortalObject getObject(PortalObjectId id)
081:                    throws IllegalArgumentException {
082:                if (id == null) {
083:                    throw new IllegalArgumentException("No null id accepted");
084:                }
085:                ObjectNode node = getObjectNode(id);
086:                return node == null ? null : node.getObject();
087:            }
088:
089:            public Context getContext(String namespace) {
090:                if (namespace == null) {
091:                    throw new IllegalArgumentException(
092:                            "No null namespace accepted");
093:                }
094:                PortalObjectId id = new PortalObjectId(namespace,
095:                        PortalObjectPath.ROOT_PATH);
096:                ObjectNode node = getObjectNode(id);
097:                return node == null ? null : (Context) node.getObject();
098:            }
099:
100:            public Context createContext(String namespace)
101:                    throws DuplicatePortalObjectException {
102:                if (namespace == null) {
103:                    throw new IllegalArgumentException(
104:                            "No null namespace accepted");
105:                }
106:                return createRoot(namespace);
107:            }
108:
109:            public AuthorizationDomain getAuthorizationDomain() {
110:                return this ;
111:            }
112:
113:            protected abstract ContextImpl createRoot(String namespace)
114:                    throws DuplicatePortalObjectException;
115:
116:            // AuthorizationDomain implementation *******************************************************************************
117:
118:            public String getType() {
119:                return PortalObjectPermission.PERMISSION_TYPE;
120:            }
121:
122:            public DomainConfigurator getConfigurator() {
123:                return this ;
124:            }
125:
126:            public PermissionRepository getPermissionRepository() {
127:                return this ;
128:            }
129:
130:            public PermissionFactory getPermissionFactory() {
131:                return this ;
132:            }
133:
134:            // PermissionFactory implementation *********************************************************************************
135:
136:            public PortalPermission createPermissionContainer(
137:                    PortalPermissionCollection collection)
138:                    throws PortalSecurityException {
139:                return new PortalObjectPermission(collection);
140:            }
141:
142:            public PortalPermission createPermission(String uri, String action)
143:                    throws PortalSecurityException {
144:                PortalObjectId id = PortalObjectId.parse(uri,
145:                        PortalObjectPath.CANONICAL_FORMAT);
146:                return new PortalObjectPermission(id, action);
147:            }
148:
149:            public PortalPermission createPermission(String uri,
150:                    Collection actions) throws PortalSecurityException {
151:                PortalObjectId id = PortalObjectId.parse(uri,
152:                        PortalObjectPath.CANONICAL_FORMAT);
153:                return new PortalObjectPermission(id, actions);
154:            }
155:
156:            // PermissionRepository implementation ******************************************************************************
157:
158:            public PortalPermission getPermission(String roleName, String uri)
159:                    throws PortalSecurityException {
160:                PortalObjectId id = PortalObjectId.parse(uri,
161:                        PortalObjectPath.CANONICAL_FORMAT);
162:                ObjectNode on = getObjectNode(id);
163:                if (on != null) {
164:                    RoleSecurityBinding binding = on.getBinding(roleName);
165:                    if (binding != null) {
166:                        return createPermission(uri, binding.getActions());
167:                    }
168:                }
169:                return null;
170:            }
171:
172:            // DomainConfigurator implementation ********************************************************************************
173:
174:            public void removeSecurityBindings(String uri)
175:                    throws SecurityConfigurationException {
176:                PortalObjectId id = PortalObjectId.parse(uri,
177:                        PortalObjectPath.CANONICAL_FORMAT);
178:                ObjectNode on = getObjectNode(id);
179:                if (on == null) {
180:                    throw new SecurityConfigurationException(
181:                            "The object should exist prior its security is configured : fixme");
182:                }
183:                on.setBindings(new HashSet());
184:            }
185:
186:            public void setSecurityBindings(String uri, Set securityBindings)
187:                    throws SecurityConfigurationException {
188:                PortalObjectId id = PortalObjectId.parse(uri,
189:                        PortalObjectPath.CANONICAL_FORMAT);
190:                ObjectNode on = getObjectNode(id);
191:                if (on == null) {
192:                    throw new SecurityConfigurationException(
193:                            "The object should exist prior its security is configured : fixme");
194:                }
195:                on.setBindings(securityBindings);
196:            }
197:
198:            public Set getSecurityBindings(String uri) {
199:                PortalObjectId id = PortalObjectId.parse(uri,
200:                        PortalObjectPath.CANONICAL_FORMAT);
201:                ObjectNode on = getObjectNode(id);
202:                if (on != null) {
203:                    return on.getBindings();
204:                } else {
205:                    return null;
206:                }
207:            }
208:
209:            // ******************************************************************************************************************
210:
211:            /**
212:             * Must be subclasses to provide the access to a node.
213:             *
214:             * @param id the portal object path
215:             * @return a node or null if not found
216:             */
217:            protected abstract ObjectNode getObjectNode(PortalObjectId id);
218:
219:            public class ContainerContext {
220:                /**
221:                 */
222:                public PortalObjectContainer getContainer() {
223:                    return AbstractPortalObjectContainer.this ;
224:                }
225:
226:                public ContentType getDefaultContentType() {
227:                    return ContentType.PORTLET;
228:                }
229:
230:                /**
231:                 */
232:                public void destroyChild(ObjectNode node) {
233:                }
234:
235:                /**
236:                 * @throws DuplicatePortalObjectException 
237:                 */
238:                public void createChild(ObjectNode node)
239:                        throws DuplicatePortalObjectException {
240:                }
241:
242:                /**
243:                 */
244:                public void updated(ObjectNode node) {
245:                }
246:
247:                /**
248:                 */
249:                public ContentHandler getContentHandler(ContentType contentType) {
250:                    ContentProvider contentProvider = contentProviderRegistry
251:                            .getContentProvider(contentType);
252:
253:                    //
254:                    if (contentProvider != null) {
255:                        return contentProvider.getHandler();
256:                    } else {
257:                        return null;
258:                    }
259:                }
260:            }
261:        }
w__w___w___.j__a___v__a_2_s_.__c_o_m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.