1 | /* |
2 | * Copyright 2004 The Apache Software Foundation. |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | */ |
16 | package org.apache.pluto.driver.services.container; |
17 | |
18 | import org.apache.pluto.OptionalContainerServices; |
19 | import org.apache.pluto.RequiredContainerServices; |
20 | import org.apache.pluto.internal.InternalPortletWindow; |
21 | import org.apache.pluto.driver.config.DriverConfiguration; |
22 | import org.apache.pluto.spi.PortalCallbackService; |
23 | import org.apache.pluto.spi.optional.PortletPreferencesService; |
24 | import org.apache.pluto.spi.optional.PortletEnvironmentService; |
25 | import org.apache.pluto.spi.optional.PortletInvokerService; |
26 | |
27 | import javax.portlet.PortalContext; |
28 | |
29 | /** |
30 | * The Portal Driver's <code>PortletContainerServices</code> implementation. The |
31 | * <code>PortletContainerServices</code> interface is the main integration point |
32 | * between the pluto container and the surrounding portal. |
33 | * @author <a href="ddewolf@apache.org">David H. DeWolf</a> |
34 | * @version 1.0 |
35 | * @since Sep 21, 2004 |
36 | */ |
37 | public class ContainerServicesImpl |
38 | implements RequiredContainerServices, OptionalContainerServices { |
39 | |
40 | |
41 | private PortalContextImpl context; |
42 | private DriverConfiguration driverConfig; |
43 | |
44 | |
45 | /** |
46 | * Default Constructor. |
47 | */ |
48 | public ContainerServicesImpl(PortalContextImpl context, |
49 | DriverConfiguration driverConfig) { |
50 | this.context = context; |
51 | this.driverConfig = driverConfig; |
52 | } |
53 | |
54 | /** |
55 | * Standard Getter. |
56 | * @return the portal context for the portal which we service. |
57 | */ |
58 | public PortalContext getPortalContext() { |
59 | return context; |
60 | } |
61 | |
62 | /** |
63 | * The PortletPreferencesService provides access to the portal's |
64 | * PortletPreference persistence mechanism. |
65 | * @return a PortletPreferencesService instance. |
66 | */ |
67 | public PortletPreferencesService getPortletPreferencesService() { |
68 | return driverConfig.getPortletPreferencesService(); |
69 | } |
70 | |
71 | /** |
72 | * The PortalCallbackService allows the container to communicate |
73 | * actions back to the portal. |
74 | * @return a PortalCallbackService implementation. |
75 | */ |
76 | public PortalCallbackService getPortalCallbackService() { |
77 | return driverConfig.getPortalCallbackService(); |
78 | } |
79 | |
80 | public PortletEnvironmentService getPortletEnvironmentService() { |
81 | return null; //To change body of implemented methods use File | Settings | File Templates. |
82 | } |
83 | |
84 | public PortletInvokerService getPortletInvokerService(InternalPortletWindow window) { |
85 | return null; //To change body of implemented methods use File | Settings | File Templates. |
86 | } |
87 | } |
88 | |