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.pluto.driver.config;
018:
019: import java.util.Collection;
020:
021: import javax.servlet.ServletContext;
022:
023: import org.apache.pluto.driver.services.portal.PageConfig;
024: import org.apache.pluto.driver.services.portal.RenderConfigService;
025: import org.apache.pluto.driver.url.PortalURLParser;
026: import org.apache.pluto.spi.PortalCallbackService;
027: import org.apache.pluto.spi.optional.PortletPreferencesService;
028:
029: /**
030: * Interface defining a means for retrieving driver services
031: * based upon configuration information. Within the portal,
032: * an implementation of this interface should be bound to
033: * the portal's ServletContext.
034: *
035: *
036: * @since Sep 2, 2005
037: *
038: */
039: public interface DriverConfiguration {
040:
041: //
042: // Lifecycle Methods
043: //
044:
045: /**
046: * Initialization method used to place the driver
047: * configuration into service.
048: * @throws DriverConfigurationException when an error occurs during startup.
049: * @param context
050: */
051: void init(ServletContext context)
052: throws DriverConfigurationException;
053:
054: /**
055: * Shutdown method used to remove the driver
056: * configuration from service;
057: * @throws DriverConfigurationException when an error occurs during shutdown.
058: */
059: void destroy() throws DriverConfigurationException;
060:
061: //
062: // Service / Configuration Methods
063: //
064:
065: /**
066: * Retrieve the name of the portal
067: * as should be returned in
068: * {@link javax.portlet.PortalContext#getPortalInfo()}
069: * @return the name of the portal.
070: */
071: String getPortalName();
072:
073: /**
074: * Retrieve the version of the portal
075: * as should be returned in
076: * {@link javax.portlet.PortalContext#getPortalInfo()}
077: * @return the portal version.
078: */
079: String getPortalVersion();
080:
081: /**
082: * Retrieves the name of the container which
083: * pluto should create and embed.
084: * @return the container name.
085: */
086: String getContainerName();
087:
088: Collection getSupportedPortletModes();
089:
090: Collection getSupportedWindowStates();
091:
092: Collection getPages();
093:
094: PageConfig getPageConfig(String pageId);
095:
096: boolean isPortletModeSupportedByPortal(String mode);
097:
098: boolean isPortletModeSupportedByPortlet(String portletId,
099: String mode);
100:
101: boolean isPortletModeSupported(String portletId, String mode);
102:
103: boolean isWindowStateSupportedByPortal(String windowState);
104:
105: boolean isWindowStateSupportedByPortlet(String portletId,
106: String windowState);
107:
108: boolean isWindowStateSupported(String portletId, String windowState);
109:
110: //
111: // Utility methods for the container
112: //
113: PortalCallbackService getPortalCallbackService();
114:
115: PortletPreferencesService getPortletPreferencesService();
116:
117: PortalURLParser getPortalUrlParser();
118:
119: public RenderConfigService getRenderConfigService();
120: }
|