EMMA Coverage Report (generated Fri Sep 15 10:32:43 EDT 2006)
[all classes][org.apache.pluto.driver.config.impl]

COVERAGE SUMMARY FOR SOURCE FILE [DriverConfigurationImpl.java]

nameclass, %method, %block, %line, %
DriverConfigurationImpl.java100% (1/1)6%   (1/17)14%  (15/104)18%  (6/33)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DriverConfigurationImpl100% (1/1)6%   (1/17)14%  (15/104)18%  (6/33)
destroy (): void 0%   (0/1)0%   (0/19)0%   (0/7)
getContainerName (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getPageConfig (String): PageConfig 0%   (0/1)0%   (0/5)0%   (0/1)
getPages (): Collection 0%   (0/1)0%   (0/4)0%   (0/1)
getPortalCallbackService (): PortalCallbackService 0%   (0/1)0%   (0/3)0%   (0/1)
getPortalName (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getPortalVersion (): String 0%   (0/1)0%   (0/4)0%   (0/1)
getPortletApp (String): PortletApplicationConfig 0%   (0/1)0%   (0/5)0%   (0/1)
getPortletApplications (): Collection 0%   (0/1)0%   (0/4)0%   (0/1)
getPortletPreferencesService (): PortletPreferencesService 0%   (0/1)0%   (0/3)0%   (0/1)
getPortletWindowConfig (String): PortletWindowConfig 0%   (0/1)0%   (0/5)0%   (0/1)
getSupportedPortletModes (): Collection 0%   (0/1)0%   (0/4)0%   (0/1)
getSupportedWindowStates (): Collection 0%   (0/1)0%   (0/4)0%   (0/1)
init (ServletContext): void 0%   (0/1)0%   (0/13)0%   (0/4)
setPortalCallbackService (PortalCallbackService): void 0%   (0/1)0%   (0/4)0%   (0/2)
setPortletPreferencesService (PortletPreferencesService): void 0%   (0/1)0%   (0/4)0%   (0/2)
DriverConfigurationImpl (PropertyConfigService, PortletRegistryService, Rende... 100% (1/1)100% (15/15)100% (6/6)

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 */
16package org.apache.pluto.driver.config.impl;
17 
18import java.util.Collection;
19 
20import javax.servlet.ServletContext;
21 
22import org.apache.pluto.driver.config.DriverConfiguration;
23import org.apache.pluto.driver.services.portal.PageConfig;
24import org.apache.pluto.driver.services.portal.PortletApplicationConfig;
25import org.apache.pluto.driver.services.portal.PortletRegistryService;
26import org.apache.pluto.driver.services.portal.PortletWindowConfig;
27import org.apache.pluto.driver.services.portal.PropertyConfigService;
28import org.apache.pluto.driver.services.portal.RenderConfigService;
29import org.apache.pluto.spi.PortalCallbackService;
30import org.apache.pluto.spi.optional.PortletPreferencesService;
31 
32/**
33 * Encapsulation of the Pluto Driver ResourceConfig.
34 *
35 * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
36 * @version 1.0
37 * @since Sep 23, 2004
38 */
39public class DriverConfigurationImpl implements DriverConfiguration {
40 
41    private PropertyConfigService propertyService;
42    private PortletRegistryService registryService;
43    private RenderConfigService renderService;
44 
45    // Container Services
46    private PortalCallbackService portalCallbackService;
47    private PortletPreferencesService portletPreferencesService;
48 
49    public DriverConfigurationImpl(PropertyConfigService propertyService,
50                                   PortletRegistryService registryService,
51                                   RenderConfigService renderService,
52                                   PortalCallbackService portalCallback) {
53        this.propertyService = propertyService;
54        this.registryService = registryService;
55        this.renderService = renderService;
56        this.portalCallbackService = portalCallback;
57    }
58 
59    /**
60     * Standard Getter.
61     * @return the name of the portal.
62     */
63    public String getPortalName() {
64        return propertyService.getPortalName();
65    }
66 
67    /**
68     * Standard Getter.
69     * @return the portal version.
70     */
71    public String getPortalVersion() {
72        return propertyService.getPortalVersion();
73    }
74 
75    /**
76     * Standard Getter.
77     * @return the name of the container.
78     */
79    public String getContainerName() {
80        return propertyService.getContainerName();
81    }
82 
83    /**
84     * Standard Getter.
85     * @return the names of the supported portlet modes.
86     */
87    public Collection getSupportedPortletModes() {
88        return propertyService.getSupportedPortletModes();
89    }
90 
91    /**
92     * Standard Getter.
93     * @return the names of the supported window states.
94     */
95    public Collection getSupportedWindowStates() {
96        return propertyService.getSupportedWindowStates();
97    }
98 
99    /**
100     * Standard Getter.
101     * @return the configuration data of all configured portlet applications.
102     */
103    public Collection getPortletApplications() {
104        return registryService.getPortletApplications();
105    }
106 
107   /**
108     * Retrieve the portlet application with the given id.
109     * @param id the id of the portlet application.
110     * @return the portlet application configuration data.
111     */
112    public PortletApplicationConfig getPortletApp(String id) {
113        return registryService.getPortletApplication(id);
114    }
115 
116    /**
117     * Retrieve the window configuration associated with the given id.
118     * @param id the id of the portlet window.
119     * @return the portlet window configuration data.
120     */
121    public PortletWindowConfig getPortletWindowConfig(String id) {
122        return registryService.getPortlet(id);
123    }
124 
125    /**
126     * Standard Getter.
127     * @return the render configuration.
128     */
129    public Collection getPages() {
130        return renderService.getPages();
131    }
132 
133    public PageConfig getPageConfig(String pageId) {
134        return renderService.getPage(pageId);
135    }
136 
137    public void init(ServletContext context) {
138        this.propertyService.init(context);
139        this.registryService.init(context);
140        this.renderService.init(context);
141    }
142 
143    public void destroy() {
144        if(propertyService != null)
145            propertyService.destroy();
146 
147        if(registryService != null)
148            registryService.destroy();
149 
150        if(renderService != null)
151            renderService.destroy();
152    }
153 
154 
155//
156// Container Services
157//
158    public PortalCallbackService getPortalCallbackService() {
159        return portalCallbackService;
160    }
161 
162    public void setPortalCallbackService(PortalCallbackService portalCallbackService) {
163        this.portalCallbackService = portalCallbackService;
164    }
165 
166    public PortletPreferencesService getPortletPreferencesService() {
167        return portletPreferencesService;
168    }
169 
170    public void setPortletPreferencesService(PortletPreferencesService portletPreferencesService) {
171        this.portletPreferencesService = portletPreferencesService;
172    }
173}
174 

[all classes][org.apache.pluto.driver.config.impl]
EMMA 2.0.5312 (C) Vladimir Roubtsov