You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by dd...@apache.org on 2005/09/03 03:03:59 UTC
svn commit: r267364 -
/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/
Author: ddewolf
Date: Fri Sep 2 18:03:55 2005
New Revision: 267364
URL: http://svn.apache.org/viewcvs?rev=267364&view=rev
Log:
oops, adding services from spring commit.
Added:
portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/
portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationService.java
portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PortletRegistryService.java
portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PropertyConfigService.java
portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/RenderConfigService.java
Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java?rev=267364&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java Fri Sep 2 18:03:55 2005
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.driver.config.impl;
+
+import org.apache.pluto.driver.services.impl.resource.PortletApplicationConfig;
+import org.apache.pluto.driver.services.impl.resource.PortletWindowConfig;
+import org.apache.pluto.driver.services.impl.resource.PageConfig;
+import org.apache.pluto.driver.config.DriverConfiguration;
+
+import javax.servlet.ServletContext;
+import java.util.Collection;
+
+/**
+ * Encapsulation of the Pluto Driver Configuration.
+ *
+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>
+ * @version 1.0
+ * @since Sep 23, 2004
+ */
+public class DriverConfigurationImpl implements DriverConfiguration {
+
+ private PropertyConfigService propertyService;
+ private PortletRegistryService registryService;
+ private RenderConfigService renderService;
+
+ public DriverConfigurationImpl(PropertyConfigService propertyService,
+ PortletRegistryService registryService,
+ RenderConfigService renderService) {
+ this.propertyService = propertyService;
+ this.registryService = registryService;
+ this.renderService = renderService;
+ }
+
+ /**
+ * Standard Getter.
+ * @return the name of the portal.
+ */
+ public String getPortalName() {
+ return propertyService.getPortalName();
+ }
+
+ /**
+ * Standard Getter.
+ * @return the portal version.
+ */
+ public String getPortalVersion() {
+ return propertyService.getPortalVersion();
+ }
+
+ /**
+ * Standard Getter.
+ * @return the name of the container.
+ */
+ public String getContainerName() {
+ return propertyService.getContainerName();
+ }
+
+ /**
+ * Standard Getter.
+ * @return the names of the supported portlet modes.
+ */
+ public Collection getSupportedPortletModes() {
+ return propertyService.getSupportedPortletModes();
+ }
+
+ /**
+ * Standard Getter.
+ * @return the names of the supported window states.
+ */
+ public Collection getSupportedWindowStates() {
+ return propertyService.getSupportedWindowStates();
+ }
+
+ /**
+ * Standard Getter.
+ * @return the configuration data of all configured portlet applications.
+ */
+ public Collection getPortletApplications() {
+ return registryService.getPortletApplications();
+ }
+
+ /**
+ * Retrieve the portlet application with the given id.
+ * @param id the id of the portlet application.
+ * @return the portlet application configuration data.
+ */
+ public PortletApplicationConfig getPortletApp(String id) {
+ return registryService.getPortletApplication(id);
+ }
+
+ /**
+ * Retrieve the window configuration associated with the given id.
+ * @param id the id of the portlet window.
+ * @return the portlet window configuration data.
+ */
+ public PortletWindowConfig getPortletWindowConfig(String id) {
+ return registryService.getPortlet(id);
+ }
+
+ /**
+ * Standard Getter.
+ * @return the render configuration.
+ */
+ public Collection getPages() {
+ return renderService.getPages();
+ }
+
+ public PageConfig getPageConfig(String pageId) {
+ return renderService.getPage(pageId);
+ }
+
+ public void init(ServletContext context) {
+ this.propertyService.init(context);
+ this.registryService.init(context);
+ this.renderService.init(context);
+ }
+}
+
Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationService.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationService.java?rev=267364&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationService.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationService.java Fri Sep 2 18:03:55 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.driver.config.impl;
+
+import org.apache.pluto.driver.config.DriverConfigurationException;
+
+import javax.servlet.ServletContext;
+
+/**
+ * Abstract interface defining lifecycle methods for
+ * Driver configuration services.
+ *
+ * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
+ * @since Aug 10, 2005
+ */
+public interface DriverConfigurationService {
+
+ /**
+ * Initialize the service for use by the driver.
+ * This method allows the service to retrieve required
+ * resources from the context and instantiate any required
+ * services.
+ *
+ * @param ctx the Portal's servlet context in which the
+ * service will be executing.
+ *
+ */
+ void init(ServletContext ctx) throws DriverConfigurationException;
+
+ /**
+ * Destroy the service, notifying it of shutdown.
+ */
+ void destroy() throws DriverConfigurationException;
+}
Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PortletRegistryService.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PortletRegistryService.java?rev=267364&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PortletRegistryService.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PortletRegistryService.java Fri Sep 2 18:03:55 2005
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pluto.driver.config.impl;
+
+import org.apache.pluto.driver.services.impl.resource.PortletWindowConfig;
+import org.apache.pluto.driver.services.impl.resource.PortletApplicationConfig;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
+ * @since Aug 10, 2005
+ */
+public interface PortletRegistryService extends DriverConfigurationService {
+
+ /**
+ * A set of all Portlet Applications
+ * @return a set of uniqe PortletAppConfig instances.
+ */
+ Set getPortletApplications();
+
+ /**
+ * Retrieves the PortletAppConfig associated
+ * with the specified id.
+ * @param id the unique id of the portlet application config
+ * @return the PortletAppConfig instance for the specified id.
+ */
+ PortletApplicationConfig getPortletApplication(String id);
+
+ /**
+ * Utility method used to retrieve a portlet
+ * directly from the service to prevent the driver
+ * from needing to navigate the portlet application
+ * object graph.
+ *
+ * @param id the unique id of the portlet being requested.
+ * @return PortletWindowConfig for the specified id.
+ */
+ PortletWindowConfig getPortlet(String id);
+
+}
Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PropertyConfigService.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PropertyConfigService.java?rev=267364&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PropertyConfigService.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/PropertyConfigService.java Fri Sep 2 18:03:55 2005
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pluto.driver.config.impl;
+
+import java.util.Set;
+
+/**
+ * Service interface which defines the methods required
+ * for a provider wishing to provide property management.
+ *
+ * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
+ * @since Aug 10, 2005
+ */
+public interface PropertyConfigService extends DriverConfigurationService {
+
+ /**
+ * Name of the portal driver.
+ * @return the name of this portal implementation
+ */
+ String getPortalName();
+
+ /**
+ * Portal driver version.
+ * @return version information
+ */
+ String getPortalVersion();
+
+ /**
+ * Unique name of the Portlet Container
+ * used to service this portal instance.
+ * @return container name
+ */
+ String getContainerName();
+
+ /**
+ * Set of unique Portlet Modes.
+ * The set must include
+ * {@link javax.portlet.PortletMode#VIEW},
+ * {@link javax.portlet.PortletMode#EDIT}, and
+ * {@link javax.portlet.PortletMode#HELP}
+ * @return set of unique portlet modes.
+ */
+ Set getSupportedPortletModes();
+
+ /**
+ * Set of unique Window States.
+ * The set must include:
+ * {@link javax.portlet.WindowState#NORMAL},
+ * {@link javax.portlet.WindowState#MAXIMIZED}, and
+ * {@link javax.portlet.WindowState#MINIMIZED}
+ * @return set of unique window states.
+ */
+ Set getSupportedWindowStates();
+}
Added: portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/RenderConfigService.java
URL: http://svn.apache.org/viewcvs/portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/RenderConfigService.java?rev=267364&view=auto
==============================================================================
--- portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/RenderConfigService.java (added)
+++ portals/pluto/branches/pluto-1.1/pluto-portal/src/main/java/org/apache/pluto/driver/config/impl/RenderConfigService.java Fri Sep 2 18:03:55 2005
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.driver.config.impl;
+
+import org.apache.pluto.driver.services.impl.resource.PageConfig;
+
+import java.util.List;
+
+/**
+ * Service interface defining methods necessary for
+ * a provider wishing to manage page administration.
+ *
+ * @author <a href="mailto:ddewolf@apache.org">David H. DeWolf</a>
+ * @since Aug 10, 2005
+ */
+public interface RenderConfigService extends DriverConfigurationService {
+
+ /**
+ * Retrieve an ordered list of all PageConfig instances.
+ * @return list of all PageConfig instances.
+ */
+ List getPages();
+
+ /**
+ * Retrieve the PageConfig for the default
+ * page.
+ * @return PageConfig instance of the default page.
+ */
+ PageConfig getDefaultPage();
+
+ /**
+ * Retrieve the PageConfig for the given
+ * page id.
+ *
+ * @param id
+ * @return PageConfig instance for the specified id.
+ */
+ PageConfig getPage(String id);
+
+}