Initial Import of Pluto 1.1 seed code.

git-svn-id: https://svn.apache.org/repos/asf/portals/pluto/branches/portal@54049 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/.cvsignore b/.cvsignore
new file mode 100644
index 0000000..28002d5
--- /dev/null
+++ b/.cvsignore
@@ -0,0 +1,4 @@
+target

+*.log

+.classpath

+.project
\ No newline at end of file
diff --git a/maven.xml b/maven.xml
new file mode 100644
index 0000000..62fe0f7
--- /dev/null
+++ b/maven.xml
@@ -0,0 +1,132 @@
+<!-- 

+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.

+-->

+<project default="deployPlutoToTomcat"

+    xmlns:j="jelly:core"

+    xmlns:maven="jelly:maven"

+    xmlns:ant="jelly:ant">

+

+    <!-- the war goal should always create pluto.war

+          with no version numbers. Why?-->

+    <preGoal name="war:init">

+        <j:set var="maven.war.final.name" value="pluto.war"/>

+    </preGoal>

+

+    <preGoal name="war:install">

+        <attainGoal name="jar:install"/>

+    </preGoal>

+

+    <preGoal name="tomcat:deploy">

+        <j:set var="maven.war.final.name" value="pluto.war"/>

+    </preGoal>

+

+    <goal name="tomcat:init">

+        <j:set var="vers" value="${maven.tomcat.version.major}"/>

+        <j:if test="${vers==null}">

+            <ant:available property="maven.tomcat.version.major"

+                value="5"

+                type="file"

+                file="${maven.tomcat.home}/conf/Catalina/admin.xml"/>

+        </j:if>

+

+        <j:set var="vers" value="${maven.tomcat.version.major}"/>

+        <j:if test="${vers==null}">

+            <ant:available property="maven.tomcat.version.major"

+                value="5"

+                type="file"

+                file="${maven.tomcat.home}/webapps/admin.xml"/>

+        </j:if>

+

+        <j:set var="depl" value="${maven.tomcat.deploy}"/>

+        <j:if test="${depl != 'exploded'}">

+            <j:set var="maven.tomcat.deploy" value="war"/>

+        </j:if>

+

+        <echo>Deploying to Tomcat:

+		  Location:       ${maven.tomcat.home}

+		  Major Version:  ${maven.tomcat.version.major}

+		  Hosts:          ${maven.tomcat.host}

+		  Context Config: ${maven.tomcat.context.config}

+		  Deploy Type:    ${maven.tomcat.deploy}

+

+        </echo>

+    </goal>

+

+    <goal name="tomcat:deploy">

+        <attainGoal name="tomcat:init"/>

+        <!-- ===================== -->

+        <!-- Deploy Dependencies   -->

+        <!-- ===================== -->

+        <j:forEach var="lib" items="${pom.artifacts}">

+            <j:set var="dep" value="${lib.dependency}"/>

+            <j:if test="${dep.getProperty('tomcat.common')=='true'}">

+                <j:if test="${dep.type =='jar'}">

+                    <j:if test="${dep.getProperty('tomcat.common.endorsed')!='true'}">

+                        <ant:copy todir="${maven.tomcat.home}/common/lib" file="${lib.path}"/>

+                    </j:if>

+                    <j:if test="${dep.getProperty('tomcat.common.endorsed')=='true'}">

+                        <ant:copy todir="${maven.tomcat.home}/common/endorsed" file="${lib.path}"/>

+                    </j:if>

+                </j:if>

+

+                <j:if test="${dep.type !='jar'}">

+                    <ant:copy todir="${maven.tomcat.home}/common/classes" file="${lib.path}"/>

+                </j:if>

+            </j:if>

+

+            <j:if test="${dep.getProperty('tomcat.shared')=='true'}">

+                <j:if test="${dep.type =='jar'}">

+                    <ant:copy todir="${maven.tomcat.home}/shared/lib" file="${lib.path}"/>

+                </j:if>

+

+                <j:if test="${dep.type !='jar'}">

+                    <ant:copy todir="${maven.tomcat.home}/shared/classes" file="${lib.path}"/>

+                </j:if>

+            </j:if>

+

+        </j:forEach>

+

+        <!-- ===================== -->

+        <!-- Deploy War            -->

+        <!-- ===================== -->

+        <j:set var="depType" value="${maven.tomcat.deploy}"/>

+        <j:if test="${depType=='exploded'}">

+            <unwar src="target/${maven.war.final.name}" dest="${maven.tomcat.home}/webapps/pluto"/>

+        </j:if>

+        <j:if test="${depType=='war'}">

+            <copy file="target/${maven.war.final.name}"

+                todir="${maven.tomcat.home}/webapps"/>

+        </j:if>

+

+

+        <!-- ===================== -->

+        <!-- Deploy Context Config -->

+        <!-- ===================== -->

+        <j:set var="version" value="${maven.tomcat.version.major}"/>

+

+        <!-- If we are in Tomcat4.x-->

+        <j:if test="${version==4}">

+            <copy file="${maven.tomcat.context.config}"

+                todir="${maven.tomcat.home}/webapps"/>

+        </j:if>

+

+        <!-- If we are in Tomcat5.x-->

+        <j:if test="${version==5}">

+            <copy file="${maven.tomcat.context.config}"

+                todir="${maven.tomcat.home}/conf/Catalina/${maven.tomcat.host}"/>

+        </j:if>

+    </goal>

+</project>

diff --git a/portal.iml b/portal.iml
new file mode 100644
index 0000000..1cd03da
--- /dev/null
+++ b/portal.iml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<module version="4" relativePaths="true" type="J2EE_WEB_MODULE" j2ee-integration="Tomcat Server">

+  <component name="ModuleRootManager" />

+  <component name="NewModuleRootManager">

+    <output url="file://$MODULE_DIR$/../target" />

+    <exclude-output />

+    <exploded url="file://$MODULE_DIR$/../target/pluto" />

+    <exclude-exploded />

+    <content url="file://$MODULE_DIR$">

+      <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />

+      <excludeFolder url="file://$MODULE_DIR$/target" />

+    </content>

+    <orderEntry type="inheritedJdk" />

+    <orderEntry type="sourceFolder" forTests="false" />

+    <orderEntry type="module" module-name="container" />

+    <orderEntry type="library" name="servlet-api-2.3" level="application" />

+    <orderEntry type="library" name="portlet-api-1.0" level="application" />

+    <orderEntry type="library" name="castor-0.9.5" level="application" />

+    <orderEntry type="module" module-name="binding" />

+    <orderEntry type="library" name="commons-logging-1.0.3" level="application" />

+    <orderEntry type="library" name="commons-digester-1.5" level="application" />

+    <orderEntry type="library" name="jstl-standard-1.0.4" level="application" />

+    <orderEntry type="library" name="Tomcat" level="application_server_libraries" />

+    <orderEntryProperties />

+  </component>

+  <component name="WebModuleBuildComponent">

+    <setting name="EXPLODED_URL" value="file://$MODULE_DIR$/../target/pluto" />

+    <setting name="EXPLODED_ENABLED" value="true" />

+    <setting name="JAR_URL" value="file://" />

+    <setting name="JAR_ENABLED" value="false" />

+    <setting name="SYNC_EXPLODED_DIR" value="true" />

+    <setting name="BUILD_ON_FRAME_DEACTIVATION" value="false" />

+    <setting name="RUN_JASPER_VALIDATION" value="false" />

+  </component>

+  <component name="WebModuleProperties">

+    <containerElement type="module" name="container">

+      <attribute name="method" value="1" />

+      <attribute name="URI" value="/WEB-INF/classes" />

+    </containerElement>

+    <containerElement type="library" level="application" name="castor-0.9.5">

+      <attribute name="method" value="1" />

+      <attribute name="URI" value="/WEB-INF/lib" />

+    </containerElement>

+    <containerElement type="library" level="application" name="commons-logging-1.0.3">

+      <attribute name="method" value="1" />

+      <attribute name="URI" value="/WEB-INF/lib" />

+    </containerElement>

+    <containerElement type="library" level="application" name="jstl-standard-1.0.4">

+      <attribute name="method" value="1" />

+      <attribute name="URI" value="/WEB-INF/lib" />

+    </containerElement>

+    <containerElement type="library" level="application" name="portlet-api-1.0">

+      <attribute name="method" value="1" />

+      <attribute name="URI" value="/WEB-INF/lib" />

+    </containerElement>

+    <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/src/webapp/WEB-INF/web.xml" version="2.3" />

+    <webroots>

+      <root url="file://$MODULE_DIR$/src/webapp" relative="/" />

+    </webroots>

+  </component>

+  <component name="WeblogicWebModuleProperties">

+    <option name="IS_RUN_APPC" value="false" />

+  </component>

+</module>

+

diff --git a/project.properties b/project.properties
new file mode 100644
index 0000000..3baa4bf
--- /dev/null
+++ b/project.properties
@@ -0,0 +1,37 @@
+# 

+# 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.

+#

+#

+# Display the date on the Maven web site

+maven.xdoc.date = left

+

+# Display the maven version the web site is documenting

+maven.xdoc.version = ${pom.currentVersion}

+

+maven.compile.deprecation=on

+

+maven.junit.fork = true

+

+maven.checkstyle.header.file = ${basedir}/../LICENSE.TXT

+maven.license.licenseFile=${basedir}/../LICENSE.TXT

+

+maven.multiproject.type=war

+

+maven.checkstyle.format=turbine

+

+maven.tomcat.host=localhost

+maven.tomcat.context.config=src/conf/pluto.xml

+maven.tomcat.deploy=exploded

diff --git a/project.xml b/project.xml
new file mode 100644
index 0000000..94fab71
--- /dev/null
+++ b/project.xml
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<!-- 

+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.

+-->

+<project>

+    <extend>${basedir}/../project.xml</extend>

+    <name>Pluto Portal Driver</name>

+    <id>pluto-portal</id>

+

+    <organization>

+        <logo>/../../images/apache-portals.gif</logo>

+    </organization>

+    <logo>/../../images/pluto.png</logo>

+

+    <shortDescription>

+    Simple portal that allows testing of Pluto with the Sun(tm) TCK.

+    </shortDescription>

+

+    <description>

+    Simple portal that allows testing of Pluto with the Sun(tm) TCK .

+    This is not meant to be a fully functional portal as it only meets

+    the bare minimum requirements for the Pluto container to be tested.

+    </description>

+

+    <dependencies>

+        <dependency>

+            <id>commons-digester</id>

+            <version>1.6</version>

+            <properties>

+                <war.bundle>false</war.bundle>

+                <tomcat.shared>true</tomcat.shared>

+            </properties>

+        </dependency>

+

+        <dependency>

+            <id>commons-beanutils</id>

+            <version>1.6.1</version>

+            <url>http://jakarta.apache.org/commons/beanutils</url>

+            <properties>

+                <war.bundle>false</war.bundle>

+                <tomcat.shared>true</tomcat.shared>

+            </properties>

+        </dependency>

+

+        <dependency>

+            <id>commons-logging</id>

+            <version>1.0.4</version>

+            <properties>

+                <war.bundle>true</war.bundle>

+            </properties>

+        </dependency>

+

+        <dependency>

+            <id>pluto</id>

+            <groupId>pluto</groupId>

+            <version>1.0.1</version>

+            <properties>

+                <war.bundle>false</war.bundle>

+                <tomcat.shared>true</tomcat.shared>

+            </properties>

+        </dependency>

+

+        <dependency>

+            <id>pluto-binding</id>

+            <groupId>pluto</groupId>

+            <version>1.0.1</version>

+            <properties>

+                <war.bundle>false</war.bundle>

+                <tomcat.shared>true</tomcat.shared>

+            </properties>

+        </dependency>

+

+        <dependency>

+            <id>portlet-api</id>

+            <groupId>portlet-api</groupId>

+            <version>1.0</version>

+            <properties>

+                <war.bundle>false</war.bundle>

+                <tomcat.shared>true</tomcat.shared>

+            </properties>

+        </dependency>

+

+        <dependency>

+            <id>servletapi</id>

+            <version>2.3</version>

+            <properties>

+                <war.bundle>false</war.bundle>

+            </properties>

+        </dependency>

+

+        <dependency>

+            <id>jstl</id>

+            <version>1.0.2</version>

+            <properties>

+                <war.bundle>true</war.bundle>

+            </properties>

+        </dependency>

+

+        <dependency>

+            <groupId>taglibs</groupId>

+            <artifactId>standard</artifactId>

+            <version>1.0.4</version>

+            <properties>

+                <war.bundle>true</war.bundle>

+            </properties>

+        </dependency>

+    </dependencies>

+

+    <build>

+

+        <nagEmailAddress>pluto-dev@jakarta.apache.org</nagEmailAddress>

+

+        <sourceDirectory>src/java</sourceDirectory>

+        <aspectSourceDirectory/>

+

+        <resources>

+            <resource>

+                <directory>${basedir}/src/resources</directory>

+            </resource>

+        </resources>

+

+        <unitTestSourceDirectory>src/test</unitTestSourceDirectory>

+

+        <unitTest>

+            <includes>

+                <include>**/*Test.java</include>

+            </includes>

+        </unitTest>

+

+        <integrationUnitTestSourceDirectory>src/rttest</integrationUnitTestSourceDirectory>

+

+        <integrationUnitTest>

+            <includes>

+                <include>**/*Test.java</include>

+            </includes>

+        </integrationUnitTest>

+

+        <resources>

+            <includes>

+                <include>conf/**/*pipeline.xml</include>

+                <include>conf/**/*valve.xml</include>

+            </includes>

+        </resources>

+

+        <jars/>

+

+    </build>

+

+</project>

diff --git a/src/conf/pluto.xml b/src/conf/pluto.xml
new file mode 100644
index 0000000..112dcd3
--- /dev/null
+++ b/src/conf/pluto.xml
@@ -0,0 +1,18 @@
+<!-- 

+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.

+-->

+<Context path="/pluto" docBase="pluto" crossContext="true">

+</Context>

diff --git a/src/java/org/apache/pluto/driver/AttributeKeys.java b/src/java/org/apache/pluto/driver/AttributeKeys.java
new file mode 100644
index 0000000..101edd9
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/AttributeKeys.java
@@ -0,0 +1,49 @@
+/*

+ * 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;

+

+/**

+ * <B>TODO</B>: Document

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 25, 2004

+ */

+public class AttributeKeys {

+

+    private AttributeKeys() {

+    }

+

+    /**

+     * Attribute Key used to bind the applications driver config to the

+     * ServletContext.

+     */

+    public static final String DRIVER_CONFIG = "driverConfig";

+

+    /**

+     * Attribute Key used to bind the application's portlet container to the

+     * ServletContext.

+     */

+    public static final String PORTLET_CONTAINER = "portletContainer";

+

+

+    /**

+     * Attribute Key used to bind the current page to the request.

+     */

+    public static final String CURRENT_PAGE = "currentPage";

+

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/PortalDriverServlet.java b/src/java/org/apache/pluto/driver/PortalDriverServlet.java
new file mode 100644
index 0000000..794be61
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/PortalDriverServlet.java
@@ -0,0 +1,129 @@
+/*

+ * 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;

+

+import java.io.IOException;

+

+import javax.portlet.PortletException;

+import javax.servlet.RequestDispatcher;

+import javax.servlet.ServletContext;

+import javax.servlet.ServletException;

+import javax.servlet.http.HttpServlet;

+import javax.servlet.http.HttpServletRequest;

+import javax.servlet.http.HttpServletResponse;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+import org.apache.pluto.PortletContainer;

+import org.apache.pluto.PortletContainerException;

+import org.apache.pluto.driver.config.DriverConfiguration;

+import org.apache.pluto.driver.config.PageConfig;

+import org.apache.pluto.driver.config.PortletWindowConfig;

+import org.apache.pluto.driver.config.RenderConfig;

+import org.apache.pluto.driver.core.PortalEnvironment;

+import org.apache.pluto.driver.core.PortalURL;

+import org.apache.pluto.driver.core.PortletWindowImpl;

+

+/**

+ * The controller servlet used to driver the Portal Driver. All requests mapped

+ * to this servlet will be processed as Portal Requests.

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 22, 2004

+ */

+public class PortalDriverServlet extends HttpServlet {

+    private static final Log LOG = LogFactory.getLog(PortalDriverServlet.class);

+

+    /**

+     * The portlet container to which we will forward all portlet requests.

+     */

+    private PortletContainer container;

+

+    /**

+     * The driver configuration defining our configuraiton.

+     */

+    private DriverConfiguration driverConfig;

+

+    /**

+     * Initialize the Portal Driver. Initialization completes the following

+     * tasks: <ul><li>Retrieve and Cache the <code>PortletContainer</code></li>

+     * <li>Retrieve and Cache the <code>DriverConfiguration</code></li>

+     * @see PortletContainer

+     * @see DriverConfiguration

+     */

+    public void init() {

+        ServletContext ctx = getServletContext();

+

+        String key = AttributeKeys.PORTLET_CONTAINER;

+        container = (PortletContainer) ctx.getAttribute(key);

+

+        key = AttributeKeys.DRIVER_CONFIG;

+        driverConfig = (DriverConfiguration) ctx.getAttribute(key);

+    }

+

+    /**

+     * Handle all requests.

+     * @param req the HttpServletRequest

+     * @param res the HttpServletResponse

+     * @throws ServletException if an internal error occurs.

+     * @throws IOException      if an error occurs writing to the response.

+     */

+    public void doGet(HttpServletRequest req,

+                      HttpServletResponse res)

+        throws ServletException, IOException {

+

+        PortalEnvironment env = new PortalEnvironment(req, res);

+

+        PortalURL currentURL = env.getRequestedPortalURL();

+

+        String actionWindowId = currentURL.getActionWindow();

+        PortletWindowConfig winConfig =

+            driverConfig.getPortletWindowConfig(actionWindowId);

+

+        // Window will only exist if there's an action;

+        if (winConfig != null) {

+            PortletWindowImpl window = new PortletWindowImpl(winConfig,

+                                                             currentURL);

+            if (LOG.isDebugEnabled()) {

+                LOG.debug("Window Found: " + window.getId());

+            }

+            try {

+                container.doAction(window, req, res);

+

+            } catch (PortletContainerException exc) {

+                throw new ServletException(exc);

+            } catch (PortletException exc) {

+                throw new ServletException(exc);

+            }

+        } else {

+            String currentPage = currentURL.getRenderPath();

+

+            if (LOG.isDebugEnabled()) {

+                LOG.debug("Rendering Portal: Requested Page: " + currentPage);

+            }

+            RenderConfig renderConfig = driverConfig.getRenderConfig();

+            PageConfig page = renderConfig.getPageConfig(currentPage);

+

+            req.setAttribute(AttributeKeys.CURRENT_PAGE, page);

+            String uri = page.getUri();

+            RequestDispatcher disp = req.getRequestDispatcher(uri);

+            disp.forward(req, res);

+        }

+    }

+

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/PortalStartupListener.java b/src/java/org/apache/pluto/driver/PortalStartupListener.java
new file mode 100644
index 0000000..d4902cb
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/PortalStartupListener.java
@@ -0,0 +1,136 @@
+/*

+ * 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;

+

+import java.io.IOException;

+import java.io.InputStream;

+

+import javax.servlet.ServletContext;

+import javax.servlet.ServletContextEvent;

+import javax.servlet.ServletContextListener;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+import org.apache.pluto.PortletContainer;

+import org.apache.pluto.PortletContainerException;

+import org.apache.pluto.PortletContainerFactory;

+import org.apache.pluto.driver.config.DriverConfiguration;

+import org.apache.pluto.driver.config.DriverConfigurationFactory;

+import org.apache.pluto.driver.services.ContainerServicesImpl;

+import org.apache.pluto.driver.services.PortalContextImpl;

+import org.xml.sax.SAXException;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 22, 2004

+ */

+public class PortalStartupListener implements ServletContextListener {

+    private static final Log LOG =

+        LogFactory.getLog(PortalStartupListener.class);

+

+    private static final String CONFIG_FILE =

+        "/WEB-INF/pluto-portal-driver-config.xml";

+

+    private static final String CONTAINER_KEY = AttributeKeys.PORTLET_CONTAINER;

+

+    private static final String CONFIG_KEY = AttributeKeys.DRIVER_CONFIG;

+

+

+    public void contextInitialized(ServletContextEvent event) {

+        ServletContext ctx = event.getServletContext();

+        try {

+            if (LOG.isDebugEnabled()) {

+                LOG.debug("Starting Pluto Portal Driver. . .");

+            }

+            InputStream in = ctx.getResourceAsStream(CONFIG_FILE);

+

+            if (LOG.isDebugEnabled()) {

+                LOG.debug(" - Reading Configuration. . .");

+            }

+            DriverConfiguration config =

+                DriverConfigurationFactory.getFactory().parse(in);

+

+            if (LOG.isDebugEnabled()) {

+                LOG.debug(

+                    " - Creating Portal Context [" + config.getPortalName() +

+                    "/" +

+                    config.getPortalVersion() +

+                    "]. . .");

+            }

+

+            PortalContextImpl context = new PortalContextImpl(config);

+

+            if (LOG.isDebugEnabled()) {

+                LOG.debug(" - Creating Container Services. . .");

+            }

+

+            ContainerServicesImpl impl = new ContainerServicesImpl(context);

+

+            if (LOG.isDebugEnabled()) {

+                LOG.debug(" - Creating Portlet Container. . .");

+            }

+

+            PortletContainerFactory factory = PortletContainerFactory.getInstance();

+            PortletContainer container = factory.createContainer(

+                config.getContainerName(), impl);

+

+            if (LOG.isDebugEnabled()) {

+                LOG.debug(" - Starting Portlet Container");

+            }

+

+            container.init(ctx);

+

+            if (LOG.isDebugEnabled()) {

+                LOG.debug(" Pluto Portal Driver Started.");

+            }

+

+            ctx.setAttribute(CONFIG_KEY, config);

+            ctx.setAttribute(CONTAINER_KEY, container);

+        } catch (IOException io) {

+            LOG.error(

+                "Unable to start portal.  Configuration not found at '" +

+                CONFIG_FILE +

+                "'.",

+                io);

+        } catch (SAXException sax) {

+            LOG.error(

+                "Unable to start portal.  Invalid configuration found at '" +

+                CONFIG_FILE +

+                "'.",

+                sax);

+        } catch (PortletContainerException exception) {

+            LOG.error("Unable to start portlet container. ", exception);

+        }

+    }

+

+    public void contextDestroyed(ServletContextEvent event) {

+        ServletContext ctx = event.getServletContext();

+        PortletContainer container =

+            (PortletContainer) ctx.getAttribute(CONTAINER_KEY);

+

+        try {

+            container.destroy();

+        } catch (PortletContainerException exc) {

+            LOG.error("Unable to shutdown portlet container. ", exc);

+        } finally {

+            ctx.removeAttribute(CONTAINER_KEY);

+        }

+    }

+

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/config/DriverConfiguration.java b/src/java/org/apache/pluto/driver/config/DriverConfiguration.java
new file mode 100644
index 0000000..6009fcd
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/config/DriverConfiguration.java
@@ -0,0 +1,157 @@
+/*

+ * 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;

+

+import java.util.ArrayList;

+import java.util.Collection;

+import java.util.Map;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+

+/**

+ * Encapsulation of Configuration Info

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 23, 2004

+ */

+public class DriverConfiguration {

+    private static final Log LOG =

+        LogFactory.getLog(DriverConfiguration.class);

+

+    private String portalName;

+    private String portalVersion;

+    private String containerName;

+

+    private Collection supportedPortletModes;

+    private Collection supportedWindowStates;

+

+    private Map portletApplications;

+    private RenderConfig renderConfig;

+

+    public DriverConfiguration() {

+        this.supportedWindowStates = new ArrayList();

+        this.supportedPortletModes = new ArrayList();

+        this.portletApplications = new java.util.HashMap();

+    }

+

+    public String getPortalName() {

+        return portalName;

+    }

+

+    public void setPortalName(String portalName) {

+        this.portalName = portalName;

+    }

+

+    public String getPortalVersion() {

+        return portalVersion;

+    }

+

+    public void setPortalVersion(String portalVersion) {

+        this.portalVersion = portalVersion;

+    }

+

+    public String getContainerName() {

+        return containerName;

+    }

+

+    public void setContainerName(String containerName) {

+        this.containerName = containerName;

+    }

+

+    public Collection getSupportedPortletModes() {

+        return supportedPortletModes;

+    }

+

+    public void setSupportedPortletModes(Collection supportedPortletModes) {

+        this.supportedPortletModes = supportedPortletModes;

+    }

+

+    public void addSupportedPortletMode(String mode) {

+        supportedPortletModes.add(mode);

+    }

+

+    public Collection getSupportedWindowStates() {

+        return supportedWindowStates;

+    }

+

+    public void setSupportedWindowStates(Collection supportedWindowStates) {

+        this.supportedWindowStates = supportedWindowStates;

+    }

+

+    public void addSupportedWindowState(String state) {

+        this.supportedWindowStates.add(state);

+    }

+

+    public Collection getPortletApplications() {

+        return portletApplications.values();

+    }

+

+    public void addPortletApp(PortletApplicationConfig app) {

+        if (LOG.isDebugEnabled()) {

+            LOG.debug(

+                " - - Adding PortletApp Configuration for: " +

+                app.getContextPath());

+        }

+        portletApplications.put(app.getContextPath(), app);

+    }

+

+    public PortletApplicationConfig getPortletApp(String id) {

+        return (PortletApplicationConfig) portletApplications.get(id);

+    }

+

+    public PortletWindowConfig getPortletWindowConfig(String id) {

+        if (id == null) {

+            return null;

+        }

+        String context = getContextFromPortletId(id);

+        String portlet = getPortletNameFromPortletId(id);

+

+        PortletApplicationConfig app = getPortletApp(context);

+        if (app == null) {

+            if (LOG.isErrorEnabled()) {

+                LOG.error("Portlet Application '" + context + "' not found.");

+            }

+            return null;

+        }

+        return app.getPortlet(portlet);

+    }

+

+    public RenderConfig getRenderConfig() {

+        return renderConfig;

+    }

+

+    public void setRenderConfig(RenderConfig renderConfig) {

+        this.renderConfig = renderConfig;

+    }

+

+    private String getContextFromPortletId(String portletId) {

+        int idx = portletId.indexOf(".");

+        if (idx < 0) {

+            return null;

+        }

+        return portletId.substring(0, idx);

+    }

+

+    private String getPortletNameFromPortletId(String portletId) {

+        int idx = portletId.indexOf(".");

+        if (idx < 0) {

+            return null;

+        }

+        return portletId.substring(idx + 1);

+    }

+}

+

diff --git a/src/java/org/apache/pluto/driver/config/DriverConfigurationFactory.java b/src/java/org/apache/pluto/driver/config/DriverConfigurationFactory.java
new file mode 100644
index 0000000..fb02da1
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/config/DriverConfigurationFactory.java
@@ -0,0 +1,115 @@
+/*

+ * 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;

+

+import java.io.IOException;

+import java.io.InputStream;

+

+import org.apache.commons.digester.Digester;

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+import org.xml.sax.SAXException;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 23, 2004

+ */

+public class DriverConfigurationFactory {

+

+    private static final Log LOG =

+        LogFactory.getLog(DriverConfigurationFactory.class);

+

+    private static DriverConfigurationFactory factory;

+

+    public static DriverConfigurationFactory getFactory() {

+        if (factory == null) {

+            factory = new DriverConfigurationFactory();

+        }

+        return factory;

+    }

+

+    private Digester digester;

+

+    private DriverConfigurationFactory() {

+        digester = new Digester();

+        digester.setLogger(LOG);

+        digester.setClassLoader(Thread.currentThread().getContextClassLoader());

+        init();

+    }

+

+    public DriverConfiguration parse(InputStream in)

+        throws IOException, SAXException {

+        return (DriverConfiguration) digester.parse(in);

+    }

+

+

+// Digester Setup

+

+    private void init() {

+        digester.addObjectCreate("pluto-portal-driver",

+                                 DriverConfiguration.class);

+        digester.addBeanPropertySetter("pluto-portal-driver/portal-name",

+                                       "portalName");

+        digester.addBeanPropertySetter("pluto-portal-driver/portal-version",

+                                       "portalVersion");

+        digester.addBeanPropertySetter("pluto-portal-driver/container-name",

+                                       "containerName");

+

+        digester.addCallMethod("pluto-portal-driver/supports/portlet-mode",

+                               "addSupportedPortletMode", 0);

+        digester.addCallMethod("pluto-portal-driver/supports/window-state",

+                               "addSupportedWindowState", 0);

+

+        digester.addObjectCreate("pluto-portal-driver/portlet-app",

+                                 PortletApplicationConfig.class);

+        digester.addBeanPropertySetter(

+            "pluto-portal-driver/portlet-app/context-path", "contextPath");

+

+        digester.addObjectCreate(

+            "pluto-portal-driver/portlet-app/portlets/portlet",

+            PortletWindowConfig.class);

+        digester.addSetProperties(

+            "pluto-portal-driver/portlet-app/portlets/portlet", "name",

+            "portletName");

+        digester.addSetNext("pluto-portal-driver/portlet-app/portlets/portlet",

+                            "addPortlet");

+        digester.addSetNext("pluto-portal-driver/portlet-app", "addPortletApp");

+

+        digester.addObjectCreate("pluto-portal-driver/render-config",

+                                 RenderConfig.class);

+        digester.addSetProperties("pluto-portal-driver/render-config",

+                                  "default", "defaultPageId");

+        digester.addObjectCreate("pluto-portal-driver/render-config/page",

+                                 PageConfig.class);

+        digester.addSetProperties("pluto-portal-driver/render-config/page");

+        digester.addCallMethod(

+            "pluto-portal-driver/render-config/page/portlet", "addPortlet", 2);

+        digester.addCallParam("pluto-portal-driver/render-config/page/portlet",

+                              0, "context");

+        digester.addCallParam("pluto-portal-driver/render-config/page/portlet",

+                              1, "name");

+        digester.addSetNext("pluto-portal-driver/render-config/page",

+                            "addPage");

+        digester.addSetNext("pluto-portal-driver/render-config",

+                            "setRenderConfig");

+

+

+    }

+

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/config/PageConfig.java b/src/java/org/apache/pluto/driver/config/PageConfig.java
new file mode 100644
index 0000000..5a5fda3
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/config/PageConfig.java
@@ -0,0 +1,59 @@
+/*

+ * 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;

+

+import java.util.ArrayList;

+import java.util.Collection;

+

+/**

+ * @author <a href="david.dewolf@vivare.com">David H. DeWolf</a>

+ */

+public class PageConfig {

+

+    private String name;

+    private String uri;

+    private Collection portletIds;

+

+    public PageConfig() {

+        this.portletIds = new ArrayList();

+    }

+

+    public String getName() {

+        return name;

+    }

+

+    public void setName(String name) {

+        this.name = name;

+    }

+

+    public String getUri() {

+        return uri;

+    }

+

+    public void setUri(String uri) {

+        this.uri = uri;

+    }

+

+    public Collection getPortletIds() {

+        return portletIds;

+    }

+

+    public void addPortlet(String contextPath, String portletName) {

+        portletIds.add(

+            PortletWindowConfig.createPortletId(contextPath, portletName));

+    }

+

+}

diff --git a/src/java/org/apache/pluto/driver/config/PortalDisplayConfig.java b/src/java/org/apache/pluto/driver/config/PortalDisplayConfig.java
new file mode 100644
index 0000000..3ccf9e4
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/config/PortalDisplayConfig.java
@@ -0,0 +1,26 @@
+/*

+ * 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;

+

+/**

+ * @author <a href="david.dewolf@vivare.com">David H. DeWolf</a>

+ */

+public class PortalDisplayConfig {

+

+    public PortalDisplayConfig() {

+

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/config/PortletApplicationConfig.java b/src/java/org/apache/pluto/driver/config/PortletApplicationConfig.java
new file mode 100644
index 0000000..d4f3255
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/config/PortletApplicationConfig.java
@@ -0,0 +1,59 @@
+/*

+ * 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;

+

+import java.util.Collection;

+import java.util.Map;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+

+/**

+ * @author <a href="david.dewolf@vivare.com">David H. DeWolf</a>

+ */

+public class PortletApplicationConfig {

+    private static final Log LOG =

+        LogFactory.getLog(PortletApplicationConfig.class);

+

+    private String contextPath;

+    private Map portlets;

+

+    public PortletApplicationConfig() {

+        portlets = new java.util.HashMap();

+    }

+

+    public String getContextPath() {

+        return contextPath;

+    }

+

+    public void setContextPath(String contextPath) {

+        this.contextPath = contextPath;

+    }

+

+    public Collection getPortlets() {

+        return portlets.values();

+    }

+

+    public PortletWindowConfig getPortlet(String portletName) {

+        return (PortletWindowConfig) portlets.get(portletName);

+    }

+

+    public void addPortlet(PortletWindowConfig portlet) {

+        portlet.setContextPath(getContextPath());

+        portlets.put(portlet.getPortletName(), portlet);

+    }

+

+}

diff --git a/src/java/org/apache/pluto/driver/config/PortletWindowConfig.java b/src/java/org/apache/pluto/driver/config/PortletWindowConfig.java
new file mode 100644
index 0000000..3b01cf6
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/config/PortletWindowConfig.java
@@ -0,0 +1,58 @@
+/*

+ * 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;

+

+/**

+ * @author <a href="david.dewolf@vivare.com">David H. DeWolf</a>

+ */

+public class PortletWindowConfig {

+

+    private String contextPath;

+    private String portletName;

+

+    public PortletWindowConfig() {

+    }

+

+    public String getId() {

+        return createPortletId(contextPath, portletName);

+    }

+

+    public String getContextPath() {

+        return contextPath;

+    }

+

+    /**

+     * Should only be set by the application upon being added.

+     * @param contextPath

+     */

+    void setContextPath(String contextPath) {

+        this.contextPath = contextPath;

+    }

+

+    public String getPortletName() {

+        return portletName;

+    }

+

+    public void setPortletName(String portletName) {

+        this.portletName = portletName;

+    }

+

+    public static String createPortletId(String contextPath,

+                                         String portletName) {

+        return contextPath + "." + portletName;

+    }

+

+}

diff --git a/src/java/org/apache/pluto/driver/config/RenderConfig.java b/src/java/org/apache/pluto/driver/config/RenderConfig.java
new file mode 100644
index 0000000..0d06fba
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/config/RenderConfig.java
@@ -0,0 +1,67 @@
+/*

+ * 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;

+

+import java.util.Collection;

+import java.util.Map;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+

+/**

+ * @author <a href="david.dewolf@vivare.com">David H. DeWolf</a>

+ */

+public class RenderConfig {

+    private static final Log LOG =

+        LogFactory.getLog(RenderConfig.class);

+

+    private Map pages;

+    private String defaultPageId;

+

+    public RenderConfig() {

+        this.pages = new java.util.HashMap();

+    }

+

+

+    public String getDefaultPageId() {

+        return defaultPageId;

+    }

+

+    public void setDefaultPageId(String defaultPageId) {

+        this.defaultPageId = defaultPageId;

+    }

+

+    public Collection getPages() {

+        return pages.values();

+    }

+

+    public PageConfig getPageConfig(String pageId) {

+        if (pageId == null || "".equals(pageId)) {

+            if (LOG.isDebugEnabled()) {

+                LOG.debug(

+                    "Requested page is null.  Returning default: " +

+                    defaultPageId);

+            }

+            pageId = defaultPageId;

+        }

+        return (PageConfig) pages.get(pageId);

+    }

+

+    public void addPage(PageConfig config) {

+        pages.put(config.getName(), config);

+    }

+

+}

diff --git a/src/java/org/apache/pluto/driver/core/PortalEnvironment.java b/src/java/org/apache/pluto/driver/core/PortalEnvironment.java
new file mode 100644
index 0000000..3930edb
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/PortalEnvironment.java
@@ -0,0 +1,80 @@
+/*

+ * Copyright 2003,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.core;

+

+import javax.servlet.http.HttpServletRequest;

+import javax.servlet.http.HttpServletResponse;

+

+import org.apache.pluto.driver.config.DriverConfiguration;

+

+public class PortalEnvironment {

+

+    public final static String REQUEST_PORTALENV = "org.apache.pluto.driver.core.PortalEnvironment";

+

+    private HttpServletRequest request;

+    private HttpServletResponse response;

+    private DriverConfiguration driverConfig;

+

+

+    private PortalURL requestedPortalURL;

+

+    public PortalEnvironment(HttpServletRequest request,

+                             HttpServletResponse response) {

+        this.request = request;

+        this.response = response;

+        init();

+

+

+    }

+

+    private void init() {

+

+        requestedPortalURL =

+        PortalUrlFactory.getFactory().createPortalUrl(request);

+

+

+        // set Environment in Request for later use

+        this.request.setAttribute(REQUEST_PORTALENV, this);

+    }

+

+

+    public static PortalEnvironment getPortalEnvironment(

+        HttpServletRequest request) {

+        return (PortalEnvironment) request.getAttribute(REQUEST_PORTALENV);

+    }

+

+    public HttpServletRequest getRequest() {

+        return request;

+    }

+

+    public HttpServletResponse getResponse() {

+        return response;

+    }

+

+/*

+    public List getNavigationalInformation()

+    {

+        return navigationalInformation;

+    }

+*/    

+    public PortalURL getRequestedPortalURL() {

+        return requestedPortalURL;

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/core/PortalServletRequest.java b/src/java/org/apache/pluto/driver/core/PortalServletRequest.java
new file mode 100644
index 0000000..d31293e
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/PortalServletRequest.java
@@ -0,0 +1,130 @@
+/*

+ * Copyright 2003,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.core;

+

+import java.util.Collections;

+import java.util.Enumeration;

+import java.util.HashMap;

+import java.util.Iterator;

+import java.util.Map;

+

+import javax.servlet.http.HttpServletRequest;

+import javax.servlet.http.HttpServletRequestWrapper;

+

+import org.apache.pluto.PortletWindow;

+

+public class PortalServletRequest extends HttpServletRequestWrapper {

+

+    private PortletWindow portletWindow = null;

+

+    private PortalURL url;

+    private Map portletParameters;

+

+    public PortalServletRequest(HttpServletRequest request,

+                                PortletWindow window) {

+        super(request);

+        this.portletWindow = window;

+

+        url =

+        PortalEnvironment.getPortalEnvironment(request).getRequestedPortalURL();

+    }

+

+

+// HttpServletRequestWrapper overlay

+          

+    public java.lang.String getContentType() {

+        String contentType = super.getContentType();

+        return contentType;

+    }

+

+// ServletRequestWrapper overlay

+

+    public String getParameter(String name) {

+        String[] values = (String[]) this.getParameterMap().get(name);

+        if (values != null) {

+            return values[0];

+        }

+        return null;

+    }

+

+    /**

+     * Retreive the Parameters.

+     * @return Map of parameters targeted to the window associated with this

+     *         request.

+     */

+    public Map getParameterMap() {

+        if (portletParameters == null) {

+            initParameterMap();

+        }

+        return Collections.unmodifiableMap(portletParameters);

+    }

+

+    /**

+     * Initialize parameters for this request.  We must be careful to make sure

+     * that render parameters are only made available if they were targeted for

+     * this specific window.

+     */

+    private void initParameterMap() {

+        portletParameters = new HashMap();

+

+        Iterator iterator = url.getParameters().iterator();

+        while (iterator.hasNext()) {

+            PortalUrlParameter param = (PortalUrlParameter) iterator.next();

+            String name = (String) param.getName();

+            String[] values = (String[]) param.getValues();

+            if (param.getWindowId().equals(portletWindow.getId().toString())) {

+                portletParameters.put(name, values);

+            }

+        }

+

+        String id = portletWindow.getId().toString();

+        if (portletWindow.getId().toString().equals(id)) {

+            Enumeration params = super.getParameterNames();

+            while (params.hasMoreElements()) {

+                String name = params.nextElement().toString();

+                String[] values = super.getParameterValues(name);

+                if (portletParameters.containsKey(name)) {

+                    String[] temp = (String[]) portletParameters.get(name);

+                    String[] all = new String[values.length + temp.length];

+                    System.arraycopy(values, 0, all, 0, values.length);

+                    System.arraycopy(temp, 0, all, values.length, temp.length);

+                }

+                portletParameters.put(name, values);

+            }

+        }

+    }

+

+    /**

+     * Get an enumeration which contains each of the names for which parameters

+     * exist.

+     * @return

+     */

+    public Enumeration getParameterNames() {

+        return Collections.enumeration(getParameterMap().keySet());

+    }

+

+    /**

+     * Get the values associated with the given parameter key.

+     * @param name the Parameter name used to key the parameter.

+     * @return

+     */

+    public String[] getParameterValues(String name) {

+        return (String[]) getParameterMap().get(name);

+    }

+

+}

+

+

diff --git a/src/java/org/apache/pluto/driver/core/PortalServletResponse.java b/src/java/org/apache/pluto/driver/core/PortalServletResponse.java
new file mode 100644
index 0000000..3a97478
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/PortalServletResponse.java
@@ -0,0 +1,59 @@
+/*

+ * Copyright 2003,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.core;

+

+import java.io.IOException;

+import java.io.PrintWriter;

+import java.io.StringWriter;

+

+import javax.servlet.http.HttpServletResponse;

+

+public class PortalServletResponse

+    extends javax.servlet.http.HttpServletResponseWrapper {

+

+    private StringWriter buffer = null;

+    private PrintWriter writer = null;

+    private String contentType = "text/html";

+

+    public PortalServletResponse(HttpServletResponse response) {

+        super(response);

+        buffer = new StringWriter();

+        writer = new PrintWriter(buffer);

+    }

+

+    public String getContentType() {

+        return contentType;

+    }

+

+    public PrintWriter getWriter() {

+        return writer;

+    }

+

+    public StringWriter getInternalBuffer() {

+        return buffer;

+    }

+

+    public PrintWriter getInternalResponseWriter()

+        throws IOException {

+        return super.getWriter();

+    }

+

+

+}

diff --git a/src/java/org/apache/pluto/driver/core/PortalURL.java b/src/java/org/apache/pluto/driver/core/PortalURL.java
new file mode 100644
index 0000000..5c4f7c9
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/PortalURL.java
@@ -0,0 +1,181 @@
+/*

+ * Copyright 2003,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.core;

+

+import java.util.Collection;

+import java.util.Collections;

+import java.util.HashMap;

+import java.util.Iterator;

+import java.util.Map;

+

+import javax.portlet.PortletMode;

+import javax.portlet.WindowState;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+

+public class PortalURL implements Cloneable {

+

+    private static final Log LOG = LogFactory.getLog(PortalURL.class);

+

+    /**

+     * The baseURL consists of the URI up to the servlet path.  The dynamic

+     * portion of the PortalURL is the pathInfo;

+     */

+    private StringBuffer server;

+    private StringBuffer servletPath;

+    private String renderPath;

+    private String actionWindow;

+

+    private Map windowStates;

+    private Map portletModes;

+    private Map parameters;

+

+    public PortalURL(String protocol, String server) {

+        this.server = new StringBuffer();

+        this.server.append(protocol).append(server);

+        this.parameters = new java.util.HashMap();

+        this.windowStates = new java.util.HashMap();

+        this.portletModes = new java.util.HashMap();

+    }

+

+    private PortalURL() {

+

+    }

+

+    public PortalURL(String protocol, String server, int port) {

+        this(protocol, server);

+        this.server.append(":").append(port);

+    }

+

+    public PortalURL(String protocol, String server, String contextPath,

+                     String servletPath) {

+        this(protocol, server);

+        setControllerPath(contextPath, servletPath);

+    }

+

+    public PortalURL(String protocol, String server, int port,

+                     String contextPath, String servletPath) {

+        this(protocol, server, port);

+        setControllerPath(contextPath, servletPath);

+    }

+

+    public void setControllerPath(String context, String servletPath) {

+        this.servletPath = new StringBuffer();

+        this.servletPath = this.servletPath.append(context + servletPath);

+    }

+

+    // BasePortalURL

+    public void setRenderPath(String renderPath) {

+        this.renderPath = renderPath;

+    }

+

+    public String getRenderPath() {

+        return renderPath;

+    }

+

+    public void addParameter(PortalUrlParameter param) {

+        parameters.put(param.getWindowId() + param.getName(), param);

+    }

+

+    public Collection getParameters() {

+        return parameters.values();

+    }

+

+    public void setActionWindow(String window) {

+        this.actionWindow = window;

+    }

+

+    public String getActionWindow() {

+        return actionWindow;

+    }

+

+    public Map getPortletModes() {

+        return Collections.unmodifiableMap(portletModes);

+    }

+

+    public PortletMode getPortletMode(String windowId) {

+        PortletMode mode = (PortletMode) portletModes.get(windowId);

+        if (mode == null) {

+            mode = PortletMode.VIEW;

+        }

+        return mode;

+    }

+

+    public void setPortletMode(String windowId, PortletMode portletMode) {

+        this.portletModes.put(windowId, portletMode);

+    }

+

+    public Map getWindowStates() {

+        return Collections.unmodifiableMap(windowStates);

+    }

+

+    public WindowState getWindowState(String windowId) {

+        WindowState state = (WindowState) windowStates.get(windowId);

+        if (state == null) {

+            state = WindowState.NORMAL;

+        }

+        return state;

+    }

+

+    public void setWindowState(String windowId, WindowState windowState) {

+        this.windowStates.put(windowId, windowState);

+    }

+

+    public void clearParameters(String window) {

+        Iterator it = parameters.entrySet().iterator();

+        while (it.hasNext()) {

+            Map.Entry entry = (Map.Entry) it.next();

+            if (((PortalUrlParameter) entry.getValue()).getWindowId().equals(

+                window)) {

+                it.remove();

+            }

+        }

+    }

+

+    public String toString() {

+        return PortalUrlParser.getParser().toString(this);

+    }

+

+

+    /**

+     * Retrieve the server uri, (protocol, name, port).

+     * @return

+     */

+    public String getServerUri() {

+        return server.toString();

+    }

+

+    public String getControllerPath() {

+        return servletPath.toString();

+    }

+

+    public Object clone() {

+        PortalURL url = new PortalURL();

+        url.portletModes = new HashMap(portletModes);

+        url.windowStates = new HashMap(windowStates);

+        url.parameters = new HashMap(parameters);

+        url.server = new StringBuffer(server.toString());

+        url.servletPath = new StringBuffer(servletPath.toString());

+        url.renderPath = renderPath;

+        url.actionWindow = actionWindow;

+        return url;

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/core/PortalUrlFactory.java b/src/java/org/apache/pluto/driver/core/PortalUrlFactory.java
new file mode 100644
index 0000000..9bd16f1
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/PortalUrlFactory.java
@@ -0,0 +1,31 @@
+package org.apache.pluto.driver.core;

+

+import javax.servlet.http.HttpServletRequest;

+

+/**

+ * @author <a href="david.dewolf@vivare.com">David H. DeWolf</a>

+ */

+public class PortalUrlFactory {

+

+    private static final String KEY = PortalURL.class.getName();

+

+    private static PortalUrlFactory factory;

+

+    public static PortalUrlFactory getFactory() {

+        if (factory == null) {

+            factory = new PortalUrlFactory();

+        }

+        return factory;

+    }

+

+    public PortalURL createPortalUrl(HttpServletRequest req) {

+        if (req.getAttribute(KEY) == null) {

+            PortalURL gnew = PortalUrlParser.getParser().parse(req);

+            req.setAttribute(KEY, gnew);

+        }

+

+        PortalURL url = (PortalURL) req.getAttribute(KEY);

+        return (PortalURL) url.clone();

+    }

+

+}

diff --git a/src/java/org/apache/pluto/driver/core/PortalUrlParameter.java b/src/java/org/apache/pluto/driver/core/PortalUrlParameter.java
new file mode 100644
index 0000000..e136da7
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/PortalUrlParameter.java
@@ -0,0 +1,63 @@
+/*

+ * 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.core;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 30, 2004

+ */

+public class PortalUrlParameter {

+

+

+    private String window;

+    private String name;

+    private String[] values;

+

+    public PortalUrlParameter(String window, String name, String value) {

+        this.window = window;

+        this.name = name;

+        this.values = new String[]{value};

+    }

+

+    public PortalUrlParameter(String window, String name, String[] values) {

+        this.window = window;

+        this.name = name;

+        this.values = values;

+    }

+

+    public String getName() {

+        return name;

+    }

+

+    public void setName(String name) {

+        this.name = name;

+    }

+

+    public String[] getValues() {

+        return values;

+    }

+

+    public void setValues(String[] values) {

+        this.values = values;

+    }

+

+    public String getWindowId() {

+        return window;

+    }

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/core/PortalUrlParser.java b/src/java/org/apache/pluto/driver/core/PortalUrlParser.java
new file mode 100644
index 0000000..caa5e9b
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/PortalUrlParser.java
@@ -0,0 +1,262 @@
+/*

+ * 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.core;

+

+import java.util.Iterator;

+import java.util.Map;

+import java.util.StringTokenizer;

+

+import javax.portlet.PortletMode;

+import javax.portlet.WindowState;

+import javax.servlet.http.HttpServletRequest;

+

+import org.apache.pluto.util.StringUtils;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 30, 2004

+ */

+class PortalUrlParser {

+

+    private static PortalUrlParser parser;

+

+

+    public static PortalUrlParser getParser() {

+        if (parser == null) {

+            parser = new PortalUrlParser();

+        }

+        return parser;

+    }

+

+    public PortalURL parse(HttpServletRequest req) {

+

+        String protocol = req.isSecure() ? "https://" : "http://";

+        String server = req.getServerName();

+        int port = req.getServerPort();

+

+        PortalURL url;

+        if ((req.isSecure() && port != 443) ||

+            (!req.isSecure() && port != 80)) {

+            url = new PortalURL(protocol, server, port);

+        } else {

+            url = new PortalURL(protocol, server);

+        }

+

+        url.setControllerPath(req.getContextPath(), req.getServletPath());

+

+        StringBuffer renderPath = new StringBuffer();

+        if (req.getPathInfo() == null) {

+            return url;

+        }

+        StringTokenizer st = new StringTokenizer(req.getPathInfo(), "/", false);

+

+        while (st.hasMoreTokens()) {

+            String token = st.nextToken();

+

+            // render path

+            if (!token.startsWith(PREFIX)) {

+                renderPath.append(token);

+            } else if (token.startsWith(PREFIX + ACTION)) {

+                url.setActionWindow(decode(token)[0]);

+            } else if (token.startsWith(PREFIX + WINDOW_STATE)) {

+                String[] decoded = decode(token);

+                url.setWindowState(decoded[0], new WindowState(decoded[1]));

+            } else if (token.startsWith(PREFIX + PORTLET_MODE)) {

+                String[] decoded = decode(token);

+                url.setPortletMode(decoded[0], new PortletMode(decoded[1]));

+            } else {

+                String value = null;

+                if (st.hasMoreTokens()) {

+                    value = st.nextToken();

+                }

+                url.addParameter(decode(token, value));

+            }

+        }

+

+        if (renderPath.length() > 0) {

+            url.setRenderPath(renderPath.toString());

+        }

+

+        return url;

+    }

+

+    public String toString(PortalURL url) {

+        StringBuffer sb = new StringBuffer();

+        // 1)  The Servlet Path

+        sb.append(url.getServerUri()).append(url.getControllerPath());

+

+        // 2) Start the PathInfo with the Path to the Render URL (Page).

+        if (url.getRenderPath() != null) {

+            sb.append("/");

+            sb.append(url.getRenderPath());

+        }

+

+        // 3) Add the action window, if it exists

+        if (url.getActionWindow() != null) {

+            sb.append("/");

+            sb.append(PREFIX + ACTION).append(encode(url.getActionWindow()));

+        }

+

+        Iterator it = url.getPortletModes().entrySet().iterator();

+        while (it.hasNext()) {

+            Map.Entry entry = (Map.Entry) it.next();

+            sb.append("/").append(

+                encode(PORTLET_MODE, entry.getKey().toString(),

+                       entry.getValue().toString()));

+        }

+

+

+        it = url.getWindowStates().entrySet().iterator();

+        while (it.hasNext()) {

+            Map.Entry entry = (Map.Entry) it.next();

+            sb.append("/").append(

+                encode(WINDOW_STATE, entry.getKey().toString(),

+                       entry.getValue().toString()));

+        }

+

+        // 4) Add parameters

+        StringBuffer query = new StringBuffer("?");

+

+        it = url.getParameters().iterator();

+        while (it.hasNext()) {

+            PortalUrlParameter param = (PortalUrlParameter) it.next();

+            if (url.getActionWindow() != null &&

+                url.getActionWindow().equals(param.getWindowId())) {

+                query.append("&").append(param.getName()).append("=").append(

+                    convert((String[]) param.getValues()));

+            } else if (param.getValues() != null &&

+                       param.getValues().length > 0) {

+                String valueString = encode(param.getValues());

+                if (valueString.length() > 0) {

+                    sb.append("/").append(

+                        encode(RENDER_PARAM, param.getWindowId(),

+                               param.getName()));

+                    sb.append("/").append(valueString);

+                }

+            }

+        }

+

+        // 5) Add local nav

+

+        return sb.append(query).toString();

+    }

+

+    private static final String PREFIX = "__";

+    private static final String DELIM = "_";

+    private static final String PORTLET_ID = "pd";

+    private static final String ACTION = "ac";

+    private static final String RENDER_PARAM = "rp";

+    private static final String WINDOW_STATE = "ws";

+    private static final String PORTLET_MODE = "pm";

+

+    private static final String[][] ENCODINGS =

+        new String[][]{

+            new String[]{"_", "0x1"},

+            new String[]{".", "0x2"},

+            new String[]{"/", "0x3"},

+            new String[]{"\r", "0x4"},

+            new String[]{"\n", "0x5"},

+            new String[]{"<", "0x6"},

+            new String[]{">", "0x7"},

+            new String[]{" ", "0x8"}

+        };

+

+    private String encode(String type, String windowId, String name) {

+        return PREFIX + type + encode(windowId) + DELIM + name;

+    }

+

+    private String encode(String[] values) {

+        String value = "";

+        for (int i = 0; i < values.length; i++) {

+            value += values[i];

+            if (i + 1 != values.length) {

+                value += ",";

+            }

+        }

+        for (int i = 0; i < ENCODINGS.length; i++) {

+            value =

+            StringUtils.replace(value, ENCODINGS[i][0], ENCODINGS[i][1]);

+        }

+        return value;

+    }

+

+    /**

+     * Parse a control parameter into the porlet which it effects and it's

+     * original value.

+     * @param ctl

+     * @return

+     */

+    private String[] decode(String ctl) {

+        int length = (PREFIX + PORTLET_ID).length();

+        ctl = ctl.substring(length);

+        String[] vals = new String[2];

+        if (ctl.indexOf(DELIM) > -1) {

+            vals[0] = ctl.substring(0, ctl.indexOf(DELIM));

+            vals[1] = ctl.substring(ctl.indexOf(DELIM) + 1);

+            for (int i = 0; i < ENCODINGS.length; i++) {

+                vals[0] =

+                StringUtils.replace(vals[0], ENCODINGS[i][1], ENCODINGS[i][0]);

+                vals[1] =

+                StringUtils.replace(vals[1], ENCODINGS[i][1], ENCODINGS[i][0]);

+            }

+        } else {

+            vals[0] = ctl;

+            for (int i = 0; i < ENCODINGS.length; i++) {

+                vals[0] =

+                StringUtils.replace(vals[0], ENCODINGS[i][1], ENCODINGS[i][0]);

+            }

+        }

+        return vals;

+    }

+

+    private PortalUrlParameter decode(String name, String value) {

+        String nopre = name.substring((PREFIX + PORTLET_ID).length());

+        String windowId = nopre.substring(0, nopre.indexOf(DELIM));

+        String param = nopre.substring(nopre.indexOf(DELIM) + 1);

+

+        for (int i = 0; i < ENCODINGS.length; i++) {

+            windowId =

+            StringUtils.replace(windowId, ENCODINGS[i][1], ENCODINGS[i][0]);

+            if (value != null) {

+                value =

+                StringUtils.replace(value, ENCODINGS[i][1], ENCODINGS[i][0]);

+            }

+        }

+        return new PortalUrlParameter(windowId, param, value);

+    }

+

+    private String encode(String string) {

+        for (int i = 0; i < ENCODINGS.length; i++) {

+            string =

+            StringUtils.replace(string, ENCODINGS[i][0], ENCODINGS[i][1]);

+        }

+        return string;

+    }

+

+    private String convert(String[] strings) {

+        StringBuffer sb = new StringBuffer();

+        for (int i = 0; i < strings.length; i++) {

+            sb.append(strings[i]);

+            if (i + 1 != strings.length) {

+                sb.append(",");

+            }

+        }

+        return sb.toString();

+    }

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/core/PortletWindowImpl.java b/src/java/org/apache/pluto/driver/core/PortletWindowImpl.java
new file mode 100644
index 0000000..a752e45
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/PortletWindowImpl.java
@@ -0,0 +1,63 @@
+/*

+ * Copyright 2003,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.core;

+

+import javax.portlet.PortletMode;

+import javax.portlet.WindowState;

+

+import org.apache.pluto.PortletWindow;

+import org.apache.pluto.driver.config.PortletWindowConfig;

+import org.apache.pluto.driver.util.ObjectIdImpl;

+import org.apache.pluto.om.ObjectID;

+

+public class PortletWindowImpl implements PortletWindow {

+

+    private PortletWindowConfig config;

+    private PortalURL url;

+    private ObjectIdImpl objectIdImpl;

+

+    public PortletWindowImpl(PortletWindowConfig config, PortalURL url) {

+        this.config = config;

+        this.url = url;

+    }

+

+    public String getContextPath() {

+        return config.getContextPath();

+    }

+

+    public String getPortletName() {

+        return config.getPortletName();

+    }

+

+    public WindowState getWindowState() {

+        return url.getWindowState(getId().toString());

+    }

+

+    public PortletMode getPortletMode() {

+        return url.getPortletMode(getId().toString());

+    }

+

+    public ObjectID getId() {

+        if (objectIdImpl == null) {

+            objectIdImpl = ObjectIdImpl.createFromString(config.getId());

+        }

+        return objectIdImpl;

+    }

+}
\ No newline at end of file
diff --git a/src/java/org/apache/pluto/driver/core/ResourceURLProviderImpl.java b/src/java/org/apache/pluto/driver/core/ResourceURLProviderImpl.java
new file mode 100644
index 0000000..d240f09
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/core/ResourceURLProviderImpl.java
@@ -0,0 +1,69 @@
+/*

+ * Copyright 2003,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.core;

+

+import java.net.MalformedURLException;

+import java.net.URL;

+

+import javax.servlet.http.HttpServletRequest;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+import org.apache.pluto.PortletWindow;

+import org.apache.pluto.services.ResourceURLProvider;

+

+public class ResourceURLProviderImpl implements ResourceURLProvider {

+

+    private static final Log LOG =

+        LogFactory.getLog(ResourceURLProviderImpl.class);

+

+    private String stringUrl = "";

+    private String base = "";

+

+    public ResourceURLProviderImpl(HttpServletRequest req,

+                                   PortletWindow internalPortletWindow) {

+        this.base =

+        PortalUrlFactory.getFactory().createPortalUrl(req).getServerUri();

+        if (LOG.isDebugEnabled()) {

+            LOG.debug("Resource URL Created with base: " + base);

+        }

+    }

+

+    public void setAbsoluteURL(String path) {

+        stringUrl = path;

+    }

+

+    public void setFullPath(String path) {

+        stringUrl = base + path;

+    }

+

+    public String toString() {

+        URL url = null;

+

+        if (!"".equals(stringUrl)) {

+            try {

+                url = new URL(stringUrl);

+            } catch (MalformedURLException e) {

+                throw new java.lang.IllegalArgumentException(

+                    "A malformed URL has occured");

+            }

+        }

+

+        return ((url == null) ? "" : url.toString());

+

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/services/ContainerServicesImpl.java b/src/java/org/apache/pluto/driver/services/ContainerServicesImpl.java
new file mode 100644
index 0000000..d92fd93
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/services/ContainerServicesImpl.java
@@ -0,0 +1,90 @@
+/*

+ * 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.services;

+

+import javax.portlet.PortalContext;

+import javax.servlet.http.HttpServletRequest;

+

+import org.apache.pluto.services.DynamicInformationProvider;

+import org.apache.pluto.services.PortalCallbackProvider;

+import org.apache.pluto.services.PortletContainerServices;

+import org.apache.pluto.services.PortletPreferencesFactory;

+import org.apache.pluto.services.PropertyManagerService;

+

+/**

+ * The Portal Driver's <code>PortletContainerServices</code> implementation. The

+ * <code>PortletContainerServices</code> interface is the main integration point

+ * between the pluto container and the surrounding portal.

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 21, 2004

+ */

+public class ContainerServicesImpl implements PortletContainerServices {

+

+

+    private PortalContextImpl context;

+

+    private PortletPreferencesFactory preferencesFactory;

+    private PortalCallbackProvider callback;

+    private PropertyManagerService propertyService;

+

+    /**

+     * Default Constructor.

+     */

+    public ContainerServicesImpl(PortalContextImpl context) {

+        this.context = context;

+        preferencesFactory = new PortletPreferencesProviderImpl();

+        callback = new PortalCallbackProviderImpl();

+        propertyService = new PropertyManagerProviderImpl();

+    }

+

+    public PortalContext getPortalContext() {

+        return context;

+    }

+

+    /**

+     * The PortletPreferencesFactory provides access to the portal's

+     * PortletPreference persistence mechanism.

+     * @return

+     */

+    public PortletPreferencesFactory getPortletPreferencesFactory() {

+        return preferencesFactory;

+    }

+

+    /**

+     * The DynamicInformationProvider provides dynamic, runtime evaluated,

+     * information.

+     * @param req

+     * @return

+     */

+    public DynamicInformationProvider getDynamicInformationProvider(

+        HttpServletRequest req) {

+        return new DynamicInformationProviderImpl(req);

+    }

+

+

+    public PortalCallbackProvider getPortalCallbackProvider() {

+        return callback;

+    }

+

+

+    public PropertyManagerService getPropertyManagerService() {

+        return this.propertyService;

+    }

+

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/services/DynamicInformationProviderImpl.java b/src/java/org/apache/pluto/driver/services/DynamicInformationProviderImpl.java
new file mode 100644
index 0000000..a0a1fee
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/services/DynamicInformationProviderImpl.java
@@ -0,0 +1,79 @@
+/*

+ * Copyright 2003,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.services;

+

+import java.util.HashSet;

+import java.util.Iterator;

+

+import javax.servlet.http.HttpServletRequest;

+

+import org.apache.pluto.PortletWindow;

+import org.apache.pluto.driver.core.PortalEnvironment;

+import org.apache.pluto.driver.core.ResourceURLProviderImpl;

+import org.apache.pluto.services.DynamicInformationProvider;

+import org.apache.pluto.services.PortletURLProvider;

+import org.apache.pluto.services.ResourceURLProvider;

+

+

+public class DynamicInformationProviderImpl

+    implements DynamicInformationProvider {

+

+    /**

+     * The number of known MimtTypes which may be added to the response content

+     * type set.  This number is used to initialize the HashSets created here.

+     */

+    private final static int NUMBER_KNOWN_MIMETYPES = 15;

+

+

+    private PortalEnvironment env;

+

+    public DynamicInformationProviderImpl(HttpServletRequest request) {

+        env = PortalEnvironment.getPortalEnvironment(request);

+    }

+

+    // DynamicInformationProviderImpl implementation.

+

+    public PortletURLProvider getPortletURLProvider(

+        PortletWindow internalPortletWindow) {

+        return new PortletURLProviderImpl(env.getRequest(),

+                                          internalPortletWindow);

+    }

+

+    public ResourceURLProvider getResourceURLProvider(

+        PortletWindow internalPortletWindow) {

+        return new ResourceURLProviderImpl(env.getRequest(),

+                                           internalPortletWindow);

+    }

+

+    public String getResponseContentType() {

+        return "text/html";

+    }

+

+    /**

+     * @return

+     * @todo not implemented properly.

+     */

+    public Iterator getResponseContentTypes() {

+        HashSet responseMimeTypes = new HashSet(NUMBER_KNOWN_MIMETYPES);

+        responseMimeTypes.add("text/html");

+

+        return responseMimeTypes.iterator();

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/services/PortalCallbackProviderImpl.java b/src/java/org/apache/pluto/driver/services/PortalCallbackProviderImpl.java
new file mode 100644
index 0000000..8c2f8e7
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/services/PortalCallbackProviderImpl.java
@@ -0,0 +1,42 @@
+/*

+ * 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.services;

+

+import javax.servlet.http.HttpServletRequest;

+

+import org.apache.pluto.PortletWindow;

+import org.apache.pluto.services.PortalCallbackProvider;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 22, 2004

+ */

+public class PortalCallbackProviderImpl implements PortalCallbackProvider {

+

+    public PortalCallbackProviderImpl() {

+

+    }

+

+    public void setTitle(HttpServletRequest request,

+                         PortletWindow window,

+                         String title) {

+        request.setAttribute("org.apache.pluto.dynamic_title", title);

+    }

+

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/services/PortalContextImpl.java b/src/java/org/apache/pluto/driver/services/PortalContextImpl.java
new file mode 100644
index 0000000..d891c06
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/services/PortalContextImpl.java
@@ -0,0 +1,166 @@
+/*

+ * Copyright 2003,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.services;

+

+import java.util.Enumeration;

+import java.util.HashMap;

+import java.util.Vector;

+

+import javax.portlet.PortalContext;

+import javax.portlet.PortletMode;

+import javax.portlet.WindowState;

+

+import org.apache.pluto.driver.config.DriverConfiguration;

+

+/**

+ * <code>PortalContext</code> implementation for the Pluto Portal Driver.

+ */

+public class PortalContextImpl implements PortalContext {

+

+    /**

+     * The <code>DriverConfiguration</code> from which this

+     * <code>PortalContext</code> recieves it's configuration information.

+     */

+    private DriverConfiguration config;

+

+    /**

+     * Portal information.

+     */

+    private String info = null;

+

+    /**

+     * Portal Properties

+     */

+    private HashMap properties = new HashMap();

+

+    /**

+     * Supported PortletModes.

+     */

+    private Vector portletModes;

+

+    /**

+     * Supported WindowStates.

+     */

+    private Vector windowStates;

+

+

+    /**

+     * Default Constructor.

+     * @param config

+     */

+    public PortalContextImpl(DriverConfiguration config) {

+        this.config = config;

+        reset();

+    }

+

+    /**

+     * Get a dynamic portal property.

+     * @param name

+     * @return the property value associated with the given key.

+     * @throws IllegalArgumentException if the specified name is null.

+     */

+    public String getProperty(String name) {

+        if (name == null) {

+            throw new IllegalArgumentException("Property name == null");

+        }

+

+        return (String) properties.get(name);

+    }

+

+

+    /**

+     * Get an enumeration containing all names of the portal properties.

+     * @return

+     */

+    public Enumeration getPropertyNames() {

+        Vector names = new Vector(properties.keySet());

+        return names.elements();

+    }

+

+

+    /**

+     * Get an enumeration of all <code>PortletMode</code>s supported by this

+     * portal.

+     * @return

+     */

+    public Enumeration getSupportedPortletModes() {

+        if (portletModes == null) {

+            portletModes = new Vector();

+            Enumeration enum = new Vector(config.getSupportedPortletModes()).elements();

+            while (enum.hasMoreElements()) {

+                portletModes.add(

+                    new PortletMode(enum.nextElement().toString()));

+            }

+        }

+        return portletModes.elements();

+    }

+

+    /**

+     * Get an enumeration of all <code>WindowState</code>s supported by this

+     * portal.

+     * @return

+     */

+    public Enumeration getSupportedWindowStates() {

+        if (windowStates == null) {

+            windowStates = new Vector();

+            Enumeration enum = new Vector(config.getSupportedWindowStates()).elements();

+            while (enum.hasMoreElements()) {

+                windowStates.add(

+                    new WindowState(enum.nextElement().toString()));

+            }

+        }

+        return windowStates.elements();

+    }

+

+    /**

+     * Get the portal info for this portal.

+     * @return

+     */

+    public String getPortalInfo() {

+        return info;

+    }

+

+

+    // additional methods.

+    // methods used container internally to set

+

+    public void setProperty(String name, String value) {

+        if (name == null) {

+            throw new IllegalArgumentException("Property name == null");

+        }

+

+        properties.put(name, value);

+    }

+

+

+    /**

+     * reset all values to default portlet modes and window states; delete all

+     * properties and set the given portlet information as portlet info string.

+     */

+    public void reset() {

+        info = config.getPortalName() + "/" + config.getPortalVersion();

+        properties.clear();

+    }

+

+    public DriverConfiguration getDriverConfiguration() {

+        return config;

+    }

+

+}

diff --git a/src/java/org/apache/pluto/driver/services/PortletPreferencesProviderImpl.java b/src/java/org/apache/pluto/driver/services/PortletPreferencesProviderImpl.java
new file mode 100644
index 0000000..8bcff48
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/services/PortletPreferencesProviderImpl.java
@@ -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.services;

+

+import java.io.IOException;

+

+import javax.portlet.PortletRequest;

+

+import org.apache.pluto.PortletWindow;

+import org.apache.pluto.core.PortletPreference;

+import org.apache.pluto.services.PortletPreferencesFactory;

+

+/**

+ * The Portal Driver's PortletPreferencesFactory implementation. This

+ * implementation makes use of the filesystem for writing portlet preferences.

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 22, 2004

+ */

+public class PortletPreferencesProviderImpl

+    implements PortletPreferencesFactory {

+

+    public PortletPreferencesProviderImpl() {

+

+    }

+

+    public PortletPreference[] getStoredPreferences(PortletWindow window,

+                                                    PortletRequest req) {

+        return new PortletPreference[0];

+    }

+

+    public PortletPreference getStoredPreference(PortletWindow window,

+                                                 PortletRequest req,

+                                                 String preferenceName) {

+        return null;

+    }

+

+    public void store(PortletPreference[] preferences) throws IOException {

+

+    }

+}

+

diff --git a/src/java/org/apache/pluto/driver/services/PortletURLProviderImpl.java b/src/java/org/apache/pluto/driver/services/PortletURLProviderImpl.java
new file mode 100644
index 0000000..feb5d14
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/services/PortletURLProviderImpl.java
@@ -0,0 +1,90 @@
+/*

+ * Copyright 2003,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.services;

+

+import java.util.Iterator;

+import java.util.Map;

+

+import javax.portlet.PortletMode;

+import javax.portlet.WindowState;

+import javax.servlet.http.HttpServletRequest;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+import org.apache.pluto.PortletWindow;

+import org.apache.pluto.driver.core.PortalURL;

+import org.apache.pluto.driver.core.PortalUrlFactory;

+import org.apache.pluto.driver.core.PortalUrlParameter;

+import org.apache.pluto.services.PortletURLProvider;

+

+public class PortletURLProviderImpl implements PortletURLProvider {

+

+    private static final Log LOG =

+        LogFactory.getLog(PortletURLProviderImpl.class);

+

+    private PortalURL url;

+    private String window;

+

+    public PortletURLProviderImpl(HttpServletRequest request,

+                                  PortletWindow internalPortletWindow) {

+        url = PortalUrlFactory.getFactory().createPortalUrl(request);

+        this.window = internalPortletWindow.getId().toString();

+    }

+

+    public void setPortletMode(PortletMode mode) {

+        url.setPortletMode(window, mode);

+    }

+

+    public void setWindowState(WindowState state) {

+        url.setWindowState(window, state);

+    }

+

+    public void setAction(boolean action) {

+        if (action) {

+            url.setActionWindow(window);

+        } else {

+            url.setActionWindow(null);

+        }

+    }

+

+    public void setSecure() {

+        //url.setSecure(true);

+    }

+

+    public void clearParameters() {

+        url.clearParameters(window);

+    }

+

+    public void setParameters(Map parameters) {

+        Iterator it = parameters.entrySet().iterator();

+        while (it.hasNext()) {

+            Map.Entry entry = (Map.Entry) it.next();

+            PortalUrlParameter param = new PortalUrlParameter(window,

+                                                              (String) entry.getKey(),

+                                                              (String[]) entry.getValue());

+            url.addParameter(param);

+        }

+    }

+

+    public String toString() {

+        return url.toString();

+    }

+

+}

diff --git a/src/java/org/apache/pluto/driver/services/PropertyManagerProviderImpl.java b/src/java/org/apache/pluto/driver/services/PropertyManagerProviderImpl.java
new file mode 100644
index 0000000..e3a592a
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/services/PropertyManagerProviderImpl.java
@@ -0,0 +1,45 @@
+/*

+ * 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.services;

+

+import java.util.Map;

+

+import javax.servlet.http.HttpServletRequest;

+import javax.servlet.http.HttpServletResponse;

+

+import org.apache.pluto.PortletWindow;

+import org.apache.pluto.services.PropertyManagerService;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Sep 22, 2004

+ */

+public class PropertyManagerProviderImpl implements PropertyManagerService {

+

+

+    public void setResponseProperties(PortletWindow window,

+                                      HttpServletRequest request,

+                                      HttpServletResponse response,

+                                      Map properties) {

+    }

+

+    public Map getRequestProperties(PortletWindow window,

+                                    HttpServletRequest request) {

+        return null;

+    }

+}

+

diff --git a/src/java/org/apache/pluto/driver/services/package.html b/src/java/org/apache/pluto/driver/services/package.html
new file mode 100644
index 0000000..8ebe587
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/services/package.html
@@ -0,0 +1,6 @@
+<HTML>

+<BODY>

+The services package contains implementations of the services required

+to integrate with the Pluto Container.

+</BODY>

+</HTML>
\ No newline at end of file
diff --git a/src/java/org/apache/pluto/driver/tags/PortletRenderTag.java b/src/java/org/apache/pluto/driver/tags/PortletRenderTag.java
new file mode 100644
index 0000000..1babaa4
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/tags/PortletRenderTag.java
@@ -0,0 +1,69 @@
+/*

+ * 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.tags;

+

+import java.io.IOException;

+import java.io.PrintWriter;

+

+import javax.servlet.jsp.JspException;

+import javax.servlet.jsp.tagext.TagSupport;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Oct 4, 2004

+ */

+public class PortletRenderTag extends TagSupport {

+

+    public int doEndTag()

+        throws JspException {

+        PortletTag parent =

+            (PortletTag) TagSupport

+            .findAncestorWithClass(this, PortletTag.class);

+

+        if (parent == null) {

+            throw new JspException(

+                "Portlet Window Controls may only reside within a pluto:portlet tag.");

+        }

+

+        if (parent.getStatus() == PortletTag.SUCCESS) {

+            try {

+                StringBuffer sb =

+                    parent.getPortalServletResponse()

+                    .getInternalBuffer().getBuffer();

+

+                pageContext.getOut().print(sb.toString());

+            } catch (IOException io) {

+                throw new JspException(io);

+            }

+        } else {

+            try {

+                pageContext.getOut().print("Error rendering portlet.");

+                pageContext.getOut().print("<pre>");

+                parent.getThrowable().printStackTrace(

+                    new PrintWriter(pageContext.getOut()));

+                pageContext.getOut().print("</pre>");

+            } catch (IOException io) {

+                throw new JspException(io);

+            }

+        }

+

+        return SKIP_BODY;

+    }

+

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/tags/PortletTag.java b/src/java/org/apache/pluto/driver/tags/PortletTag.java
new file mode 100644
index 0000000..fc13351
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/tags/PortletTag.java
@@ -0,0 +1,139 @@
+package org.apache.pluto.driver.tags;

+

+import java.util.Iterator;

+import java.util.Map;

+

+import javax.portlet.WindowState;

+import javax.servlet.ServletContext;

+import javax.servlet.http.HttpServletRequest;

+import javax.servlet.http.HttpServletResponse;

+import javax.servlet.jsp.JspException;

+import javax.servlet.jsp.tagext.BodyTagSupport;

+

+import org.apache.commons.logging.Log;

+import org.apache.commons.logging.LogFactory;

+import org.apache.pluto.PortletContainer;

+import org.apache.pluto.PortletWindow;

+import org.apache.pluto.driver.AttributeKeys;

+import org.apache.pluto.driver.config.DriverConfiguration;

+import org.apache.pluto.driver.config.PortletWindowConfig;

+import org.apache.pluto.driver.core.PortalEnvironment;

+import org.apache.pluto.driver.core.PortalServletRequest;

+import org.apache.pluto.driver.core.PortalServletResponse;

+import org.apache.pluto.driver.core.PortalURL;

+import org.apache.pluto.driver.core.PortletWindowImpl;

+import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager;

+

+/**

+ * @author <a href="david.dewolf@vivare.com">David H. DeWolf</a>

+ */

+public class PortletTag extends BodyTagSupport {

+

+    private static final Log LOG =

+        LogFactory.getLog(PortletTag.class);

+

+    public static final int FAILED = 0;

+    public static final int SUCCESS = 1;

+

+    private String portletId;

+    private String evaluatedPortletId;

+

+    // Cached Results!

+    private PortalServletResponse response;

+    private int status;

+    private Throwable throwable;

+

+

+    public int doStartTag() throws JspException {

+        evaluateExpressions();

+        ServletContext ctx = pageContext.getServletContext();

+        DriverConfiguration config = (DriverConfiguration)

+            ctx.getAttribute(AttributeKeys.DRIVER_CONFIG);

+

+        PortletWindowConfig winConfig = (PortletWindowConfig)

+            config.getPortletWindowConfig(evaluatedPortletId);

+

+        if (LOG.isDebugEnabled()) {

+            LOG.debug("Rendering Portlet Window: " + winConfig);

+        }

+

+

+        PortalEnvironment env = (PortalEnvironment) pageContext.getRequest()

+            .getAttribute(PortalEnvironment.REQUEST_PORTALENV);

+

+        PortalURL thisURL = env.getRequestedPortalURL();

+

+        PortletWindow window = new PortletWindowImpl(winConfig, thisURL);

+

+        Map states = thisURL.getWindowStates();

+        Iterator it = states.keySet().iterator();

+        while (it.hasNext()) {

+            String wdw = (String) it.next();

+            WindowState state = (WindowState) states.get(wdw);

+            if (WindowState.MAXIMIZED.equals(state) &&

+                !window.getId().equals(wdw)) {

+                // Someone else is maximized, don't show my content.

+                return SKIP_BODY;

+            }

+        }

+

+        HttpServletRequest request = (HttpServletRequest)

+            pageContext.getRequest();

+

+        PortalServletRequest req =

+            new PortalServletRequest(request, window);

+

+        PortalServletResponse res =

+            new PortalServletResponse(

+                (HttpServletResponse) pageContext.getResponse());

+

+        PortletContainer container = (PortletContainer)

+            ctx.getAttribute(AttributeKeys.PORTLET_CONTAINER);

+

+        try {

+            container.doRender(window, req, res);

+            response = res;

+            status = SUCCESS;

+        } catch (Throwable e) {

+            status = FAILED;

+            throwable = e;

+        }

+        return EVAL_BODY_INCLUDE;

+    }

+

+    int getStatus() {

+        return status;

+    }

+

+    PortalServletResponse getPortalServletResponse() {

+        return response;

+    }

+

+    Throwable getThrowable() {

+        return throwable;

+    }

+

+    String getEvaluatedPortletId() {

+        return evaluatedPortletId;

+    }

+

+    public String getPortletId() {

+        return portletId;

+    }

+

+    public void setPortletId(String portletId) {

+        this.portletId = portletId;

+    }

+

+    private void evaluateExpressions()

+        throws JspException {

+        Object obj = ExpressionEvaluatorManager.evaluate("portletId",

+                                                         portletId,

+                                                         String.class, this,

+                                                         pageContext);

+        if (LOG.isDebugEnabled()) {

+            LOG.debug("Evaluated portletId to: " + obj);

+        }

+        evaluatedPortletId = (String) obj;

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/tags/PortletTitleTag.java b/src/java/org/apache/pluto/driver/tags/PortletTitleTag.java
new file mode 100644
index 0000000..f754058
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/tags/PortletTitleTag.java
@@ -0,0 +1,52 @@
+/*

+ * 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.tags;

+

+import java.io.IOException;

+

+import javax.servlet.jsp.JspException;

+import javax.servlet.jsp.tagext.TagSupport;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Oct 4, 2004

+ */

+public class PortletTitleTag extends TagSupport {

+

+

+    public int doStartTag()

+        throws JspException {

+        PortletTag parent =

+            (PortletTag) TagSupport

+            .findAncestorWithClass(this, PortletTag.class);

+

+        if (parent == null) {

+            throw new JspException(

+                "Portlet Window Controls may only reside within a pluto:portlet tag.");

+        }

+

+        try {

+            pageContext.getOut().print(

+                pageContext.getRequest().getAttribute(

+                    "org.apache.pluto.dynamic_title"));

+        } catch (IOException io) {

+            throw new JspException(io);

+        }

+        return SKIP_BODY;

+    }

+}

+

diff --git a/src/java/org/apache/pluto/driver/tags/PortletWindowControlTag.java b/src/java/org/apache/pluto/driver/tags/PortletWindowControlTag.java
new file mode 100644
index 0000000..77e9a50
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/tags/PortletWindowControlTag.java
@@ -0,0 +1,92 @@
+/*

+ * 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.tags;

+

+import java.io.IOException;

+

+import javax.portlet.PortletMode;

+import javax.portlet.WindowState;

+import javax.servlet.http.HttpServletRequest;

+import javax.servlet.jsp.JspException;

+import javax.servlet.jsp.tagext.BodyTagSupport;

+import javax.servlet.jsp.tagext.TagSupport;

+

+import org.apache.pluto.driver.core.PortalURL;

+import org.apache.pluto.driver.core.PortalUrlFactory;

+

+/**

+ * @author <a href="ddewolf@apache.org">David H. DeWolf</a>

+ * @version 1.0

+ * @since Oct 4, 2004

+ */

+public class PortletWindowControlTag extends BodyTagSupport {

+

+    private String windowState;

+    private String portletMode;

+

+    public int doStartTag()

+        throws JspException {

+        PortletTag parent =

+            (PortletTag) TagSupport

+            .findAncestorWithClass(this, PortletTag.class);

+

+        if (parent == null) {

+            throw new JspException(

+                "Portlet Window Controls may only reside within a pluto:portlet tag.");

+        }

+

+        String id = parent.getEvaluatedPortletId();

+        HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();

+        PortalURL url = PortalUrlFactory.getFactory().createPortalUrl(req);

+

+        if (windowState != null) {

+            WindowState state = new WindowState(windowState);

+            url.setWindowState(id, state);

+        }

+

+        if (portletMode != null) {

+            PortletMode mode = new PortletMode(portletMode);

+            url.setPortletMode(id, mode);

+        }

+

+        try {

+            pageContext.getOut().print(url.toString());

+        } catch (IOException io) {

+            throw new JspException(io);

+        }

+

+        return EVAL_BODY_INCLUDE;

+    }

+

+    public String getWindowState() {

+        return windowState;

+    }

+

+    public void setWindowState(String windowState) {

+        this.windowState = windowState;

+    }

+

+    public String getPortletMode() {

+        return portletMode;

+    }

+

+    public void setPortletMode(String portletMode) {

+        this.portletMode = portletMode;

+    }

+

+

+}

+

diff --git a/src/java/org/apache/pluto/driver/util/NameValuePairs.java b/src/java/org/apache/pluto/driver/util/NameValuePairs.java
new file mode 100644
index 0000000..7619289
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/util/NameValuePairs.java
@@ -0,0 +1,345 @@
+/*

+ * Copyright 2003,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.util;

+

+import java.util.Iterator;

+import java.util.LinkedList;

+import java.util.List;

+

+import org.apache.pluto.util.StringUtils;

+

+/**

+ * * This class collects name/value pairs and provides * convenient methods to

+ * access them as different types. * * @see   Properties * @see   Parameters

+ */

+

+public abstract class NameValuePairs {

+

+    /**

+     * * Returns the number of name/value pairs. Names * that have more than one

+     * value are counted as one name. * * @return   the number of name/value

+     * pairs

+     */

+

+    public int size() {

+        return (iEntries.size());

+    }

+

+    /**

+     * * Returns the value for the given name as string, * or <CODE>null</CODE>

+     * if there is no pair with the given name. * * @param   aName *

+     * the name of a pair * * @return   the value of the pair

+     */

+

+    public String getString(String aName) {

+        return (findString(aName));

+    }

+

+    /**

+     * * Returns the value for the given name as string, * or the given default

+     * if there is no pair with the given name. * * @param   aName *

+     * the name of a pair * @param   aDefault *          the default value * *

+     * @return   the value of the pair

+     */

+

+    public String getString(String aName, String aDefault) {

+        String result = findString(aName);

+

+        if (result == null) {

+            result = aDefault;

+        }

+

+        return (result);

+    }

+

+    /**

+     * * Returns all values for the given name as a string array, * or

+     * <CODE>null</CODE> if there is no pair with the given name. * * @param

+     * aName *          the name of a pair * * @return   the values of the pair

+     */

+

+    public String[] getStrings(String aName) {

+        String[] result = null;

+

+        Entry entry = findEntry(aName);

+

+        if (entry != null) {

+            result = entry.iValues;

+        }

+

+        return (result);

+

+    }

+

+    public Integer getInteger(String aName) {

+        return (getInteger(aName, null));

+    }

+

+    public Integer getInteger(String aName, Integer aDefault) {

+        Integer result = aDefault;

+

+        String value = findString(aName);

+

+        if (value != null) {

+            result = Integer.valueOf(value);

+        }

+

+        return (result);

+    }

+

+    public int getInteger(String aName, int aDefault) {

+        int result = aDefault;

+

+        String value = findString(aName);

+

+        if (value != null) {

+            result = Integer.parseInt(value);

+        }

+

+        return (result);

+    }

+

+    public Boolean getBoolean(String aName) {

+        return (getBoolean(aName, null));

+    }

+

+    public Boolean getBoolean(String aName, Boolean aDefault) {

+        Boolean result = aDefault;

+

+        String value = findString(aName);

+

+        if (value != null) {

+            result = StringUtils.booleanOf(value);

+        }

+

+        return (result);

+    }

+

+    public boolean getBoolean(String aName, boolean aDefault) {

+        return (getBoolean(aName, aDefault ? Boolean.TRUE : Boolean.FALSE)

+            .booleanValue());

+    }

+

+    public Iterator names() {

+        return (new EntryIterator(this));

+    }

+

+    public final Iterator keys() {

+        return (names());

+    }

+

+    public void setParent(NameValuePairs aParent) {

+        iParent = aParent;

+    }

+

+    public String toString() {

+        return (iEntries.toString());

+    }

+

+    // --- PROTECTED MEMBERS --- //

+

+    protected NameValuePairs() {

+    }

+

+    protected void add(String aName, String aValue) {

+        add(aName, new String[]{aValue});

+    }

+

+    protected void add(String aName, String[] aValues) {

+        if (aName == null) {

+            throw (new IllegalArgumentException(

+                "NameValuePairs: Argument \"aName\" cannot be null."));

+        }

+        if (aValues == null) {

+            throw (new IllegalArgumentException(

+                "NameValuePairs: Argument \"aValues\" cannot be null."));

+        }

+

+        for (int i = 0; i < aValues.length; i++) {

+            if (aValues[i] == null) {

+                throw (new IllegalArgumentException(

+                    "NameValuePairs: Argument \"aValues\" cannot contain null."));

+            }

+        }

+

+        Entry entry = findEntry(aName);

+

+        if (entry == null) {

+            entry = new Entry(aName, aValues);

+

+            iEntries.add(entry);

+        } else {

+            String[] values = new String[entry.iValues.length + aValues.length];

+

+            System.arraycopy(entry.iValues, 0, values, 0, entry.iValues.length);

+            System.arraycopy(aValues, 0, values, entry.iValues.length,

+                             aValues.length);

+

+            entry.iValues = values;

+        }

+    }

+

+    protected Entry findEntry(String aName) {

+        if (aName == null) {

+            throw (new IllegalArgumentException(

+                "NameValuePairs: Argument \"aName\" cannot be null!"));

+        }

+

+        Entry result = null;

+

+        for (Iterator iter = iEntries.iterator(); iter.hasNext();) {

+            Entry entry = (Entry) iter.next();

+

+            if (entry.iName.equals(aName)) {

+                result = entry;

+                break;

+            }

+        }

+

+        if (result == null && iParent != null) {

+            result = iParent.findEntry(aName);

+        }

+

+        return (result);

+    }

+

+    protected void removeEntry(String aName) {

+        if (aName == null) {

+            throw (new IllegalArgumentException(

+                "NameValuePairs: Argument \"aName\" cannot be null!"));

+        }

+

+        boolean found = false;

+

+        for (Iterator iter = iEntries.iterator(); iter.hasNext();) {

+            Entry entry = (Entry) iter.next();

+

+            if (entry.iName.equals(aName)) {

+                iter.remove();

+

+                found = true;

+                break;

+            }

+        }

+

+        if (!found && iParent != null) {

+            iParent.removeEntry(aName);

+        }

+    }

+

+    private NameValuePairs iParent;

+

+    private List iEntries = new LinkedList();

+

+    private String findString(String aName) {

+        String result = null;

+

+        Entry entry = findEntry(aName);

+

+        if (entry != null) {

+            result = entry.iValues[0];

+        }

+

+        return (result);

+    }

+

+    NameValuePairs getParent() {

+        return iParent;

+    }

+

+    List getEntries() {

+        return iEntries;

+    }

+

+    public static class Entry {

+

+        String iName;

+        String[] iValues;

+

+        protected Entry(String aName, String[] aValues) {

+            iName = aName;

+            iValues = aValues;

+        }

+

+        public String toString() {

+            StringBuffer result = new StringBuffer();

+

+            result.append(iName);

+            result.append(" = ");

+

+            for (int i = 0; i < iValues.length; i++) {

+                if (i > 0) {

+                    result.append(", ");

+                }

+

+                result.append(iValues[i]);

+            }

+

+            return (result.toString());

+        }

+    }

+

+    private static class EntryIterator implements Iterator {

+

+        private NameValuePairs iPairs;

+        private Iterator iIterator;

+

+        private EntryIterator(NameValuePairs aPairs) {

+            iPairs = aPairs;

+            iIterator = iPairs.getEntries().iterator();

+            ;

+        }

+

+        // Iterator implementation.

+        

+        public boolean hasNext() {

+            if (!nextParent()) {

+                return false;

+            }

+            return (iIterator.hasNext());

+        }

+

+        public Object next() {

+            if (!nextParent()) {

+                return null;

+            }

+            return (((Entry) iIterator.next()).iName);

+        }

+

+        public void remove() {

+            iIterator.remove();

+        }

+

+        // additional methods.

+

+        private boolean nextParent() {

+            while (!iIterator.hasNext()) {

+                iPairs = iPairs.getParent();

+                if (iPairs == null) {

+                    return false;

+                }

+                iIterator = iPairs.getEntries().iterator();

+                ;

+            }

+            return true;

+        }

+

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/util/ObjectIdImpl.java b/src/java/org/apache/pluto/driver/util/ObjectIdImpl.java
new file mode 100644
index 0000000..422cb98
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/util/ObjectIdImpl.java
@@ -0,0 +1,103 @@
+/*

+ * Copyright 2003,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.util;

+

+import java.io.IOException;

+import java.io.ObjectInputStream;

+import java.io.ObjectOutputStream;

+

+/**

+ * * Wraps around the internal Object IDs. By holding both * the string and the

+ * integer version of an Object ID this class * helps speed up the internal

+ * processing.

+ */

+

+public class ObjectIdImpl implements org.apache.pluto.om.ObjectID,

+                                     java.io.Serializable {

+

+    private String stringOID = null;

+    private int intOID;

+

+    private ObjectIdImpl(int oid) {

+        stringOID = String.valueOf(oid);

+        intOID = oid;

+    }

+

+

+    private ObjectIdImpl(int oid, String stringOID) {

+        this.stringOID = stringOID;

+        intOID = oid;

+    }   

+

+    // internal methods.

+    

+    private void readObject(ObjectInputStream stream) throws IOException,

+                                                             ClassNotFoundException {

+        intOID = stream.readInt();

+

+        stringOID = String.valueOf(intOID);

+    }

+

+    private void writeObject(ObjectOutputStream stream) throws IOException {

+        stream.write(intOID);

+    }

+

+    

+    // addtional methods.

+    

+    public boolean equals(Object object) {

+        boolean result = false;

+

+        if (object instanceof ObjectIdImpl) {

+            result = (intOID == ((ObjectIdImpl) object).intOID);

+        } else if (object instanceof String) {

+            result = stringOID.equals(object);

+        } else if (object instanceof Integer) {

+            result = (intOID == ((Integer) object).intValue());

+        }

+        return (result);

+    }

+

+    public int hashCode() {

+        return (intOID);

+    }

+

+    public String toString() {

+        return (stringOID);

+    }

+

+    public int intValue() {

+        return (intOID);

+    }

+

+    static public ObjectIdImpl createFromString(String idStr) {

+        char[] id = idStr.toCharArray();

+        int _id = 1;

+        for (int i = 0; i < id.length; i++) {

+            if ((i % 2) == 0) {

+                _id *= id[i];

+            } else {

+                _id ^= id[i];

+            }

+            _id = Math.abs(_id);

+        }

+        return new ObjectIdImpl(_id, idStr);

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/util/Parameters.java b/src/java/org/apache/pluto/driver/util/Parameters.java
new file mode 100644
index 0000000..081bc42
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/util/Parameters.java
@@ -0,0 +1,104 @@
+/*

+ * Copyright 2003,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.util;

+

+import java.util.ArrayList;

+import java.util.Enumeration;

+import java.util.Iterator;

+import java.util.List;

+import java.util.Map;

+

+import javax.servlet.ServletConfig;

+import javax.servlet.ServletContext;

+

+public class Parameters extends NameValuePairs {

+

+    private final static String RAW_ENCODING = "8859_1";

+    private final static String DEFAULT_ENCODING = "UTF-8";

+

+    public Parameters(Map params) {

+        Iterator iterator = params.keySet().iterator();

+

+        while (iterator.hasNext()) {

+            String name = (String) iterator.next();

+

+            super.add(name, (String) params.get(name));

+        }

+    }

+

+    public Parameters(ServletConfig aConfig) {

+        for (Enumeration e = aConfig.getInitParameterNames(); e.hasMoreElements();) {

+            String name = (String) e.nextElement();

+

+            super.add(name, aConfig.getInitParameter(name));

+        }

+    }

+

+    public Parameters(ServletContext aContext) {

+        for (Enumeration e = aContext.getInitParameterNames(); e.hasMoreElements();) {

+            String name = (String) e.nextElement();

+

+            super.add(name, aContext.getInitParameter(name));

+        }

+    }

+

+    public void setString(String aKey, String aValue) {

+        if (aKey == null) {

+            throw (new IllegalArgumentException(

+                "Parameters: Argument \"aKey\" cannot be null."));

+        }

+        if (aValue == null) {

+            throw (new IllegalArgumentException(

+                "Parameters: Argument \"aValue\" cannot be null."));

+        }

+

+        super.add(aKey, aValue);

+    }

+

+    /**

+     * * Removes all values with the given name. * * @param   aName *

+     * the name of a pair

+     */

+

+    public void remove(String aName) {

+        super.removeEntry(aName);

+    }

+

+    /**

+     * * Removes all values with names that start with the given prefix. * *

+     * @param   aPrefix *          the name prefix

+     */

+

+    public void removeWithPrefix(String aPrefix) {

+        List deletables = new ArrayList();

+

+        for (Iterator iter = names(); iter.hasNext();) {

+            String name = (String) iter.next();

+

+            if (name.startsWith(aPrefix)) {

+                deletables.add(name);

+            }

+        }

+

+        for (Iterator iter = deletables.iterator(); iter.hasNext();) {

+            super.removeEntry((String) iter.next());

+        }

+    }

+}

diff --git a/src/java/org/apache/pluto/driver/util/Properties.java b/src/java/org/apache/pluto/driver/util/Properties.java
new file mode 100644
index 0000000..f2183b4
--- /dev/null
+++ b/src/java/org/apache/pluto/driver/util/Properties.java
@@ -0,0 +1,108 @@
+/*

+ * Copyright 2003,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.util;

+

+import java.io.BufferedReader;

+import java.io.IOException;

+import java.io.InputStream;

+import java.io.InputStreamReader;

+import java.util.Iterator;

+

+/**

+ * * This class loads name/value pairs from a properties * file. The properties

+ * file is specified as input stream * and follows the usual convention for Java

+ * properties files.

+ */

+

+public class Properties extends NameValuePairs {

+

+    /**

+     * * Loads name/value pairs from the given input stream.

+     */

+

+    public void load(InputStream aInputStream) throws IOException {

+        if (aInputStream == null) {

+            return;

+        }

+

+        BufferedReader reader = new BufferedReader(

+            new InputStreamReader(aInputStream, "UTF-8"));

+

+        String line;

+

+        while ((line = reader.readLine()) != null) {

+            if (line.startsWith("#") ||

+                line.startsWith("//")) {

+                continue;

+            }

+

+            int index = line.indexOf('=');

+

+            if (index > 0) {

+                String name = line.substring(0, index).trim();

+

+                if (name.length() == 0) {

+                    name = null;

+                }

+

+                String value = null;

+

+                if (index + 1 < line.length()) {

+                    value = line.substring(index + 1).trim();

+

+                    if (value.length() == 0) {

+                        value = null;

+                    }

+                }

+

+                if (name != null && value != null) {

+                    add(name, value);

+                }

+            }

+        }

+    }

+

+

+    /**

+     * * Returns a subset of the NameValuePairs where the names are starting

+     * with the specified prefix. * As keys of the result set all start with the

+     * same prefix, this prfix is cut off.</br> * E.g:</br> * Given following

+     * set: {[A1,x], [A2,y], [A3,z], [B1,x], [B2,y]]}</br> * getSubSet("A")

+     * returns {[1,x], [2,y], [3,z]}</p> * * Please note: the implementation of

+     * this method is <b>slow</b>, to be used only for initialisation tasks or

+     * alike! * * @param   aNamePrefix *          the prefix that all returned

+     * pair names have in common.

+     */

+

+    public Properties getSubSet(String aNamePrefix) {

+        Properties subset = new Properties();

+        int prefixLength = aNamePrefix.length();

+        String name;

+

+        for (Iterator iter = this.names(); iter.hasNext();) {

+            name = (String) iter.next();

+

+            if (name.startsWith(aNamePrefix)) {

+                subset.add(name.substring(prefixLength), getStrings(name));

+            }

+        }

+        return (subset);

+    }

+}

diff --git a/src/resources/org/apache/pluto/portalImpl/xml/XMLSchema.dtd b/src/resources/org/apache/pluto/portalImpl/xml/XMLSchema.dtd
new file mode 100644
index 0000000..6003dda
--- /dev/null
+++ b/src/resources/org/apache/pluto/portalImpl/xml/XMLSchema.dtd
@@ -0,0 +1,418 @@
+<!-- 

+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.

+-->

+<!-- DTD for XML Schemas: Part 1: Structures

+     Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"

+     Official Location: http://www.w3.org/2001/XMLSchema.dtd -->

+<!-- $Id: XMLSchema.dtd,v 1.1.1.1 2003/09/30 14:03:01 rubys Exp $ -->

+<!-- Note this DTD is NOT normative, or even definitive. -->           <!--d-->

+<!-- prose copy in the structures REC is the definitive version -->    <!--d-->

+<!-- (which shouldn't differ from this one except for this -->         <!--d-->

+<!-- comment and entity expansions, but just in case) -->              <!--d-->

+<!-- With the exception of cases with multiple namespace

+     prefixes for the XML Schema namespace, any XML document which is

+     not valid per this DTD given redefinitions in its internal subset of the

+     'p' and 's' parameter entities below appropriate to its namespace

+     declaration of the XML Schema namespace is almost certainly not

+     a valid schema. -->

+

+<!-- The simpleType element and its constituent parts

+     are defined in XML Schema: Part 2: Datatypes -->

+<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >

+

+<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a

+                         schema document to establish a different

+                         namespace prefix -->

+<!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must

+                         also define %s as the suffix for the appropriate

+                         namespace declaration (e.g. :foo) -->

+<!ENTITY % nds 'xmlns%s;'>

+

+<!-- Define all the element names, with optional prefix -->

+<!ENTITY % schema "%p;schema">

+<!ENTITY % complexType "%p;complexType">

+<!ENTITY % complexContent "%p;complexContent">

+<!ENTITY % simpleContent "%p;simpleContent">

+<!ENTITY % extension "%p;extension">

+<!ENTITY % element "%p;element">

+<!ENTITY % unique "%p;unique">

+<!ENTITY % key "%p;key">

+<!ENTITY % keyref "%p;keyref">

+<!ENTITY % selector "%p;selector">

+<!ENTITY % field "%p;field">

+<!ENTITY % group "%p;group">

+<!ENTITY % all "%p;all">

+<!ENTITY % choice "%p;choice">

+<!ENTITY % sequence "%p;sequence">

+<!ENTITY % any "%p;any">

+<!ENTITY % anyAttribute "%p;anyAttribute">

+<!ENTITY % attribute "%p;attribute">

+<!ENTITY % attributeGroup "%p;attributeGroup">

+<!ENTITY % include "%p;include">

+<!ENTITY % import "%p;import">

+<!ENTITY % redefine "%p;redefine">

+<!ENTITY % notation "%p;notation">

+

+<!-- annotation elements -->

+<!ENTITY % annotation "%p;annotation">

+<!ENTITY % appinfo "%p;appinfo">

+<!ENTITY % documentation "%p;documentation">

+

+<!-- Customisation entities for the ATTLIST of each element type.

+     Define one of these if your schema takes advantage of the

+     anyAttribute='##other' in the schema for schemas -->

+

+<!ENTITY % schemaAttrs ''>

+<!ENTITY % complexTypeAttrs ''>

+<!ENTITY % complexContentAttrs ''>

+<!ENTITY % simpleContentAttrs ''>

+<!ENTITY % extensionAttrs ''>

+<!ENTITY % elementAttrs ''>

+<!ENTITY % groupAttrs ''>

+<!ENTITY % allAttrs ''>

+<!ENTITY % choiceAttrs ''>

+<!ENTITY % sequenceAttrs ''>

+<!ENTITY % anyAttrs ''>

+<!ENTITY % anyAttributeAttrs ''>

+<!ENTITY % attributeAttrs ''>

+<!ENTITY % attributeGroupAttrs ''>

+<!ENTITY % uniqueAttrs ''>

+<!ENTITY % keyAttrs ''>

+<!ENTITY % keyrefAttrs ''>

+<!ENTITY % selectorAttrs ''>

+<!ENTITY % fieldAttrs ''>

+<!ENTITY % includeAttrs ''>

+<!ENTITY % importAttrs ''>

+<!ENTITY % redefineAttrs ''>

+<!ENTITY % notationAttrs ''>

+<!ENTITY % annotationAttrs ''>

+<!ENTITY % appinfoAttrs ''>

+<!ENTITY % documentationAttrs ''>

+

+<!ENTITY % complexDerivationSet "CDATA">

+<!-- #all or space-separated list drawn from derivationChoice -->

+<!ENTITY % blockSet "CDATA">

+<!-- #all or space-separated list drawn from

+                derivationChoice + 'substitution' -->

+

+<!ENTITY % mgs '%all; | %choice; | %sequence;'>

+<!ENTITY % cs '%choice; | %sequence;'>

+<!ENTITY % formValues '(qualified|unqualified)'>

+

+

+<!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>

+

+<!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>

+

+<!-- This is used in part2 -->

+<!ENTITY % restriction1 '((%mgs; | %group;)?)'>

+

+%xs-datatypes;

+

+<!-- the duplication below is to produce an unambiguous content model

+     which allows annotation everywhere -->

+<!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,

+                    ((%simpleType; | %complexType;

+                      | %element; | %attribute;

+                      | %attributeGroup; | %group;

+                      | %notation; ),

+                     (%annotation;)*)* )>

+<!ATTLIST %schema;

+targetNamespace      %URIref;               #IMPLIED

+version              CDATA                  #IMPLIED

+%nds;                %URIref;               #FIXED 'http://www.w3.org/2001/XMLSchema'

+xmlns                CDATA                  #IMPLIED

+finalDefault         %complexDerivationSet; ''

+blockDefault         %blockSet;             ''

+id                   ID                     #IMPLIED

+elementFormDefault   %formValues;           'unqualified'

+attributeFormDefault %formValues;           'unqualified'

+xml:lang             CDATA                  #IMPLIED

+%schemaAttrs;>

+<!-- Note the xmlns declaration is NOT in the Schema for Schemas,

+     because at the Infoset level where schemas operate,

+     xmlns(:prefix) is NOT an attribute! -->

+<!-- The declaration of xmlns is a convenience for schema authors -->

+ 

+<!-- The id attribute here and below is for use in external references

+     from non-schemas using simple fragment identifiers.

+     It is NOT used for schema-to-schema reference, internal or

+     external. -->

+

+<!-- a type is a named content type specification which allows attribute

+     declarations-->

+<!-- -->

+

+<!ELEMENT %complexType; ((%annotation;)?,

+                         (%simpleContent;|%complexContent;|

+                          %particleAndAttrs;))>

+

+<!ATTLIST %complexType;

+name      %NCName;                        #IMPLIED

+id        ID                              #IMPLIED

+abstract  %boolean;                       #IMPLIED

+final     %complexDerivationSet;          #IMPLIED

+block     %complexDerivationSet;          #IMPLIED

+mixed (true|false) 'false'

+%complexTypeAttrs;>

+

+<!-- particleAndAttrs is shorthand for a root type -->

+<!-- mixed is disallowed if simpleContent, overriden if complexContent

+     has one too. -->

+

+<!-- If anyAttribute appears in one or more referenced attributeGroups

+     and/or explicitly, the intersection of the permissions is used -->

+

+<!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))>

+<!ATTLIST %complexContent;

+mixed (true|false) #IMPLIED

+id    ID           #IMPLIED

+%complexContentAttrs;>

+

+<!-- restriction should use the branch defined above, not the simple

+     one from part2; extension should use the full model  -->

+

+<!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))>

+<!ATTLIST %simpleContent;

+id    ID           #IMPLIED

+%simpleContentAttrs;>

+

+<!-- restriction should use the simple branch from part2, not the 

+     one defined above; extension should have no particle  -->

+

+<!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))>

+<!ATTLIST %extension;

+base  %QName;      #REQUIRED

+id    ID           #IMPLIED

+%extensionAttrs;>

+

+<!-- an element is declared by either:

+ a name and a type (either nested or referenced via the type attribute)

+ or a ref to an existing element declaration -->

+

+<!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,

+                     (%unique; | %key; | %keyref;)*)>

+<!-- simpleType or complexType only if no type|ref attribute -->

+<!-- ref not allowed at top level -->

+<!ATTLIST %element;

+name               %NCName;               #IMPLIED

+id                 ID                     #IMPLIED

+ref                %QName;                #IMPLIED

+type               %QName;                #IMPLIED

+minOccurs          %nonNegativeInteger;   #IMPLIED

+maxOccurs          CDATA                  #IMPLIED

+nillable           %boolean;              #IMPLIED

+substitutionGroup  %QName;                #IMPLIED

+abstract           %boolean;              #IMPLIED

+final              %complexDerivationSet; #IMPLIED

+block              %blockSet;             #IMPLIED

+default            CDATA                  #IMPLIED

+fixed              CDATA                  #IMPLIED

+form               %formValues;           #IMPLIED

+%elementAttrs;>

+<!-- type and ref are mutually exclusive.

+     name and ref are mutually exclusive, one is required -->

+<!-- In the absence of type AND ref, type defaults to type of

+     substitutionGroup, if any, else the ur-type, i.e. unconstrained -->

+<!-- default and fixed are mutually exclusive -->

+

+<!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>

+<!ATTLIST %group;

+name        %NCName;               #IMPLIED

+ref         %QName;                #IMPLIED

+minOccurs   %nonNegativeInteger;   #IMPLIED

+maxOccurs   CDATA                  #IMPLIED

+id          ID                     #IMPLIED

+%groupAttrs;>

+

+<!ELEMENT %all; ((%annotation;)?, (%element;)*)>

+<!ATTLIST %all;

+minOccurs   (1)                    #IMPLIED

+maxOccurs   (1)                    #IMPLIED

+id          ID                     #IMPLIED

+%allAttrs;>

+

+<!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>

+<!ATTLIST %choice;

+minOccurs   %nonNegativeInteger;   #IMPLIED

+maxOccurs   CDATA                  #IMPLIED

+id          ID                     #IMPLIED

+%choiceAttrs;>

+

+<!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>

+<!ATTLIST %sequence;

+minOccurs   %nonNegativeInteger;   #IMPLIED

+maxOccurs   CDATA                  #IMPLIED

+id          ID                     #IMPLIED

+%sequenceAttrs;>

+

+<!-- an anonymous grouping in a model, or

+     a top-level named group definition, or a reference to same -->

+

+<!-- Note that if order is 'all', group is not allowed inside.

+     If order is 'all' THIS group must be alone (or referenced alone) at

+     the top level of a content model -->

+<!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->

+<!-- Should allow minOccurs=0 inside order='all' . . . -->

+

+<!ELEMENT %any; (%annotation;)?>

+<!ATTLIST %any;

+namespace       CDATA                  '##any'

+processContents (skip|lax|strict)      'strict'

+minOccurs       %nonNegativeInteger;   '1'

+maxOccurs       CDATA                  '1'

+id              ID                     #IMPLIED

+%anyAttrs;>

+

+<!-- namespace is interpreted as follows:

+                  ##any      - - any non-conflicting WFXML at all

+

+                  ##other    - - any non-conflicting WFXML from namespace other

+                                  than targetNamespace

+

+                  ##local    - - any unqualified non-conflicting WFXML/attribute

+                  one or     - - any non-conflicting WFXML from

+                  more URI        the listed namespaces

+                  references

+

+                  ##targetNamespace ##local may appear in the above list,

+                    with the obvious meaning -->

+

+<!ELEMENT %anyAttribute; (%annotation;)?>

+<!ATTLIST %anyAttribute;

+namespace       CDATA              '##any'

+processContents (skip|lax|strict)  'strict'

+id              ID                 #IMPLIED

+%anyAttributeAttrs;>

+<!-- namespace is interpreted as for 'any' above -->

+

+<!-- simpleType only if no type|ref attribute -->

+<!-- ref not allowed at top level, name iff at top level -->

+<!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>

+<!ATTLIST %attribute;

+name      %NCName;      #IMPLIED

+id        ID            #IMPLIED

+ref       %QName;       #IMPLIED

+type      %QName;       #IMPLIED

+use       (prohibited|optional|required) #IMPLIED

+default   CDATA         #IMPLIED

+fixed     CDATA         #IMPLIED

+form      %formValues;  #IMPLIED

+%attributeAttrs;>

+<!-- type and ref are mutually exclusive.

+     name and ref are mutually exclusive, one is required -->

+<!-- default for use is optional when nested, none otherwise -->

+<!-- default and fixed are mutually exclusive -->

+<!-- type attr and simpleType content are mutually exclusive -->

+

+<!-- an attributeGroup is a named collection of attribute decls, or a

+     reference thereto -->

+<!ELEMENT %attributeGroup; ((%annotation;)?,

+                       (%attribute; | %attributeGroup;)*,

+                       (%anyAttribute;)?) >

+<!ATTLIST %attributeGroup;

+name       %NCName;       #IMPLIED

+id         ID             #IMPLIED

+ref        %QName;        #IMPLIED

+%attributeGroupAttrs;>

+

+<!-- ref iff no content, no name.  ref iff not top level -->

+

+<!-- better reference mechanisms -->

+<!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>

+<!ATTLIST %unique;

+name     %NCName;       #REQUIRED

+id       ID             #IMPLIED

+%uniqueAttrs;>

+

+<!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>

+<!ATTLIST %key;

+name     %NCName;       #REQUIRED

+id       ID             #IMPLIED

+%keyAttrs;>

+

+<!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>

+<!ATTLIST %keyref;

+name     %NCName;       #REQUIRED

+refer    %QName;        #REQUIRED

+id       ID             #IMPLIED

+%keyrefAttrs;>

+

+<!ELEMENT %selector; ((%annotation;)?)>

+<!ATTLIST %selector;

+xpath %XPathExpr; #REQUIRED

+id    ID          #IMPLIED

+%selectorAttrs;>

+<!ELEMENT %field; ((%annotation;)?)>

+<!ATTLIST %field;

+xpath %XPathExpr; #REQUIRED

+id    ID          #IMPLIED

+%fieldAttrs;>

+

+<!-- Schema combination mechanisms -->

+<!ELEMENT %include; (%annotation;)?>

+<!ATTLIST %include;

+schemaLocation %URIref; #REQUIRED

+id             ID       #IMPLIED

+%includeAttrs;>

+

+<!ELEMENT %import; (%annotation;)?>

+<!ATTLIST %import;

+namespace      %URIref; #IMPLIED

+schemaLocation %URIref; #IMPLIED

+id             ID       #IMPLIED

+%importAttrs;>

+

+<!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |

+                      %attributeGroup; | %group;)*>

+<!ATTLIST %redefine;

+schemaLocation %URIref; #REQUIRED

+id             ID       #IMPLIED

+%redefineAttrs;>

+

+<!ELEMENT %notation; (%annotation;)?>

+<!ATTLIST %notation;

+name        %NCName;    #REQUIRED

+id          ID          #IMPLIED

+public      CDATA       #REQUIRED

+system      %URIref;    #IMPLIED

+%notationAttrs;>

+

+<!-- Annotation is either application information or documentation -->

+<!-- By having these here they are available for datatypes as well

+     as all the structures elements -->

+

+<!ELEMENT %annotation; (%appinfo; | %documentation;)*>

+<!ATTLIST %annotation; %annotationAttrs;>

+

+<!-- User must define annotation elements in internal subset for this

+     to work -->

+<!ELEMENT %appinfo; ANY>   <!-- too restrictive -->

+<!ATTLIST %appinfo;

+source     %URIref;      #IMPLIED

+id         ID         #IMPLIED

+%appinfoAttrs;>

+<!ELEMENT %documentation; ANY>   <!-- too restrictive -->

+<!ATTLIST %documentation;

+source     %URIref;   #IMPLIED

+id         ID         #IMPLIED

+xml:lang   CDATA      #IMPLIED

+%documentationAttrs;>

+

+<!NOTATION XMLSchemaStructures PUBLIC

+'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >

+<!NOTATION XML PUBLIC

+'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >

diff --git a/src/resources/org/apache/pluto/portalImpl/xml/datatypes.dtd b/src/resources/org/apache/pluto/portalImpl/xml/datatypes.dtd
new file mode 100644
index 0000000..088b3e7
--- /dev/null
+++ b/src/resources/org/apache/pluto/portalImpl/xml/datatypes.dtd
@@ -0,0 +1,219 @@
+<!-- 

+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.

+-->

+<!--

+        DTD for XML Schemas: Part 2: Datatypes

+        $Id: datatypes.dtd,v 1.1.1.1 2003/09/30 14:03:00 rubys Exp $

+        Note this DTD is NOT normative, or even definitive. - - the

+        prose copy in the datatypes REC is the definitive version

+        (which shouldn't differ from this one except for this comment

+        and entity expansions, but just in case)

+  -->

+

+<!--

+        This DTD cannot be used on its own, it is intended

+        only for incorporation in XMLSchema.dtd, q.v.

+  -->

+

+<!-- Define all the element names, with optional prefix -->

+<!ENTITY % simpleType "%p;simpleType">

+<!ENTITY % restriction "%p;restriction">

+<!ENTITY % list "%p;list">

+<!ENTITY % union "%p;union">

+<!ENTITY % maxExclusive "%p;maxExclusive">

+<!ENTITY % minExclusive "%p;minExclusive">

+<!ENTITY % maxInclusive "%p;maxInclusive">

+<!ENTITY % minInclusive "%p;minInclusive">

+<!ENTITY % totalDigits "%p;totalDigits">

+<!ENTITY % fractionDigits "%p;fractionDigits">

+<!ENTITY % length "%p;length">

+<!ENTITY % minLength "%p;minLength">

+<!ENTITY % maxLength "%p;maxLength">

+<!ENTITY % enumeration "%p;enumeration">

+<!ENTITY % whiteSpace "%p;whiteSpace">

+<!ENTITY % pattern "%p;pattern">

+

+<!--

+        Customisation entities for the ATTLIST of each element

+        type. Define one of these if your schema takes advantage

+        of the anyAttribute='##other' in the schema for schemas

+  -->

+

+<!ENTITY % simpleTypeAttrs "">

+<!ENTITY % restrictionAttrs "">

+<!ENTITY % listAttrs "">

+<!ENTITY % unionAttrs "">

+<!ENTITY % maxExclusiveAttrs "">

+<!ENTITY % minExclusiveAttrs "">

+<!ENTITY % maxInclusiveAttrs "">

+<!ENTITY % minInclusiveAttrs "">

+<!ENTITY % totalDigitsAttrs "">

+<!ENTITY % fractionDigitsAttrs "">

+<!ENTITY % lengthAttrs "">

+<!ENTITY % minLengthAttrs "">

+<!ENTITY % maxLengthAttrs "">

+<!ENTITY % enumerationAttrs "">

+<!ENTITY % whiteSpaceAttrs "">

+<!ENTITY % patternAttrs "">

+

+<!-- Define some entities for informative use as attribute

+        types -->

+<!ENTITY % URIref "CDATA">

+<!ENTITY % XPathExpr "CDATA">

+<!ENTITY % QName "NMTOKEN">

+<!ENTITY % QNames "NMTOKENS">

+<!ENTITY % NCName "NMTOKEN">

+<!ENTITY % nonNegativeInteger "NMTOKEN">

+<!ENTITY % boolean "(true|false)">

+<!ENTITY % simpleDerivationSet "CDATA">

+<!--

+        #all or space-separated list drawn from derivationChoice

+  -->

+

+<!--

+        Note that the use of 'facet' below is less restrictive

+        than is really intended:  There should in fact be no

+        more than one of each of minInclusive, minExclusive,

+        maxInclusive, maxExclusive, totalDigits, fractionDigits,

+        length, maxLength, minLength within datatype,

+        and the min- and max- variants of Inclusive and Exclusive

+        are mutually exclusive. On the other hand,  pattern and

+        enumeration may repeat.

+  -->

+<!ENTITY % minBound "(%minInclusive; | %minExclusive;)">

+<!ENTITY % maxBound "(%maxInclusive; | %maxExclusive;)">

+<!ENTITY % bounds "%minBound; | %maxBound;">

+<!ENTITY % numeric "%totalDigits; | %fractionDigits;">

+<!ENTITY % ordered "%bounds; | %numeric;">

+<!ENTITY % unordered

+"%pattern; | %enumeration; | %whiteSpace; | %length; |

+%maxLength; | %minLength;">

+<!ENTITY % facet "%ordered; | %unordered;">

+<!ENTITY % facetAttr

+"value CDATA #REQUIRED

+id ID #IMPLIED">

+<!ENTITY % fixedAttr "fixed %boolean; #IMPLIED">

+<!ENTITY % facetModel "(%annotation;)?">

+<!ELEMENT %simpleType;

+((%annotation;)?, (%restriction; | %list; | %union;))>

+<!ATTLIST %simpleType;

+name      %NCName; #IMPLIED

+final     %simpleDerivationSet; #IMPLIED

+id        ID       #IMPLIED

+%simpleTypeAttrs;>

+<!-- name is required at top level -->

+<!ELEMENT %restriction; ((%annotation;)?,

+                         (%restriction1; |

+                          ((%simpleType;)?,(%facet;)*)),

+                         (%attrDecls;))>

+<!ATTLIST %restriction;

+base      %QName;                  #IMPLIED

+id        ID       #IMPLIED

+%restrictionAttrs;>

+<!--

+        base and simpleType child are mutually exclusive,

+        one is required.

+

+        restriction is shared between simpleType and

+        simpleContent and complexContent (in XMLSchema.xsd).

+        restriction1 is for the latter cases, when this

+        is restricting a complex type, as is attrDecls.

+  -->

+<!ELEMENT %list; ((%annotation;)?,(%simpleType;)?)>

+<!ATTLIST %list;

+itemType      %QName;             #IMPLIED

+id        ID       #IMPLIED

+%listAttrs;>

+<!--

+        itemType and simpleType child are mutually exclusive,

+        one is required

+  -->

+<!ELEMENT %union; ((%annotation;)?,(%simpleType;)*)>

+<!ATTLIST %union;

+id            ID       #IMPLIED

+memberTypes   %QNames;            #IMPLIED

+%unionAttrs;>

+<!--

+        At least one item in memberTypes or one simpleType

+        child is required

+  -->

+

+<!ELEMENT %maxExclusive; %facetModel;>

+<!ATTLIST %maxExclusive;

+%facetAttr;

+%fixedAttr;

+%maxExclusiveAttrs;>

+<!ELEMENT %minExclusive; %facetModel;>

+<!ATTLIST %minExclusive;

+%facetAttr;

+%fixedAttr;

+%minExclusiveAttrs;>

+

+<!ELEMENT %maxInclusive; %facetModel;>

+<!ATTLIST %maxInclusive;

+%facetAttr;

+%fixedAttr;

+%maxInclusiveAttrs;>

+<!ELEMENT %minInclusive; %facetModel;>

+<!ATTLIST %minInclusive;

+%facetAttr;

+%fixedAttr;

+%minInclusiveAttrs;>

+

+<!ELEMENT %totalDigits; %facetModel;>

+<!ATTLIST %totalDigits;

+%facetAttr;

+%fixedAttr;

+%totalDigitsAttrs;>

+<!ELEMENT %fractionDigits; %facetModel;>

+<!ATTLIST %fractionDigits;

+%facetAttr;

+%fixedAttr;

+%fractionDigitsAttrs;>

+

+<!ELEMENT %length; %facetModel;>

+<!ATTLIST %length;

+%facetAttr;

+%fixedAttr;

+%lengthAttrs;>

+<!ELEMENT %minLength; %facetModel;>

+<!ATTLIST %minLength;

+%facetAttr;

+%fixedAttr;

+%minLengthAttrs;>

+<!ELEMENT %maxLength; %facetModel;>

+<!ATTLIST %maxLength;

+%facetAttr;

+%fixedAttr;

+%maxLengthAttrs;>

+

+<!-- This one can be repeated -->

+<!ELEMENT %enumeration; %facetModel;>

+<!ATTLIST %enumeration;

+%facetAttr;

+%enumerationAttrs;>

+

+<!ELEMENT %whiteSpace; %facetModel;>

+<!ATTLIST %whiteSpace;

+%facetAttr;

+%fixedAttr;

+%whiteSpaceAttrs;>

+

+<!-- This one can be repeated -->

+<!ELEMENT %pattern; %facetModel;>

+<!ATTLIST %pattern;

+%facetAttr;

+%patternAttrs;>

diff --git a/src/resources/org/apache/pluto/portalImpl/xml/portlet-app_1_0.xsd b/src/resources/org/apache/pluto/portalImpl/xml/portlet-app_1_0.xsd
new file mode 100644
index 0000000..334772f
--- /dev/null
+++ b/src/resources/org/apache/pluto/portalImpl/xml/portlet-app_1_0.xsd
@@ -0,0 +1,648 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<!-- 

+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.

+-->

+<schema targetNamespace="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0" xml:lang="en">

+    <annotation>

+        <documentation>

+		This is the XML Schema for the Portlet 1.0 deployment descriptor.

+        </documentation>

+    </annotation>

+    <annotation>

+        <documentation>

+		The following conventions apply to all J2EE

+		deployment descriptor elements unless indicated otherwise.

+		- In elements that specify a pathname to a file within the

+		  same JAR file, relative filenames (i.e., those not

+		  starting with "/") are considered relative to the root of

+		  the JAR file's namespace.  Absolute filenames (i.e., those

+		  starting with "/") also specify names in the root of the

+		  JAR file's namespace.  In general, relative names are

+		  preferred.  The exception is .war files where absolute

+		  names are preferred for consistency with the Servlet API.

+        </documentation>

+    </annotation>

+    <!-- *********************************************************** -->

+    <import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>

+    <element name="portlet-app" type="portlet:portlet-appType">

+        <annotation>

+            <documentation>

+			The portlet-app element is the root of the deployment descriptor

+			for a portlet application. This element has a required attribute version

+			to specify to which version of the schema the deployment descriptor

+			conforms.

+            </documentation>

+        </annotation>

+        <unique name="portlet-name-uniqueness">

+            <annotation>

+                <documentation>

+				The portlet element contains the name of a portlet.

+				This name must be unique within the portlet application.

+                </documentation>

+            </annotation>

+            <selector xpath="portlet:portlet"/>

+            <field xpath="portlet:portlet-name"/>

+        </unique>

+        <unique name="custom-portlet-mode-uniqueness">

+            <annotation>

+                <documentation>

+				The custom-portlet-mode element contains the portlet-mode.

+				This portlet mode must be unique within the portlet application.

+                </documentation>

+            </annotation>

+            <selector xpath="portlet:custom-portlet-mode"/>

+            <field xpath="portlet:portlet-mode"/>

+        </unique>

+        <unique name="custom-windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state-uniqueness">

+            <annotation>

+                <documentation>

+				The custom-windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state element contains the windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state.

+				This windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal state must be unique within the portlet application.

+                </documentation>

+            </annotation>

+            <selector xpath="portlet:custom-windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state"/>

+            <field xpath="portlet:windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state"/>

+        </unique>

+        <unique name="user-attribute-name-uniqueness">

+            <annotation>

+                <documentation>

+				The user-attribute element contains the name the attribute.

+				This name must be unique within the portlet application.

+                </documentation>

+            </annotation>

+            <selector xpath="portlet:user-attribute"/>

+            <field xpath="portlet:name"/>

+        </unique>

+    </element>

+    <complexType name="portlet-appType">

+        <sequence>

+            <element name="portlet" type="portlet:portletType" minOccurs="0" maxOccurs="unbounded">

+                <unique name="init-param-name-uniqueness">

+                    <annotation>

+                        <documentation>

+						The init-param element contains the name the attribute.

+						This name must be unique within the portlet.

+                        </documentation>

+                    </annotation>

+                    <selector xpath="portlet:init-param"/>

+                    <field xpath="portlet:name"/>

+                </unique>

+                <unique name="supports-mime-type-uniqueness">

+                    <annotation>

+                        <documentation>

+						The supports element contains the supported mime-type.

+						This mime type must be unique within the portlet.

+                        </documentation>

+                    </annotation>

+                    <selector xpath="portlet:supports"/>

+                    <field xpath="mime-type"/>

+                </unique>

+                <unique name="preference-name-uniqueness">

+                    <annotation>

+                        <documentation>

+						The preference element contains the name the preference.

+						This name must be unique within the portlet.

+                        </documentation>

+                    </annotation>

+                    <selector xpath="portlet:portlet-preferences/portlet:preference"/>

+                    <field xpath="portlet:name"/>

+                </unique>

+                <unique name="security-role-ref-name-uniqueness">

+                    <annotation>

+                        <documentation>

+						The security-role-ref element contains the role-name.

+						This role name must be unique within the portlet.

+                        </documentation>

+                    </annotation>

+                    <selector xpath="portlet:security-role-ref"/>

+                    <field xpath="portlet:role-name"/>

+                </unique>

+            </element>

+            <element name="custom-portlet-mode" type="portlet:custom-portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="custom-windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state" type="portlet:custom-windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-stateType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="user-attribute" type="portlet:user-attributeType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="security-constraint" type="portlet:security-constraintType" minOccurs="0" maxOccurs="unbounded"/>

+        </sequence>

+        <attribute name="version" type="string" use="required"/>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="custom-portlet-modeType">

+        <annotation>

+            <documentation>

+			A custom portlet mode that one or more portlets in 

+			this portlet application supports.

+			Used in: portlet-app

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="portlet-mode" type="portlet:portlet-modeType"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="custom-windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-stateType">

+        <annotation>

+            <documentation>

+			A custom windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal state that one or more portlets in this

+			portlet application supports.

+			Used in: portlet-app

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state" type="portlet:windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-stateType"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="expiration-cacheType">

+        <annotation>

+            <documentation>

+			Expriation-cache defines expiration-based caching for this

+			portlet. The parameter indicates

+			the time in seconds after which the portlet output expires. 

+			-1 indicates that the output never expires.

+			Used in: portlet

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="int"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="init-paramType">

+        <annotation>

+            <documentation>

+			The init-param element contains a name/value pair as an 

+			initialization param of the portlet

+			Used in:portlet

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="name" type="portlet:nameType"/>

+            <element name="value" type="portlet:valueType"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="keywordsType">

+        <annotation>

+            <documentation>

+			Locale specific keywords associated with this portlet.

+			The kewords are separated by commas.

+			Used in: portlet-info

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="mime-typeType">

+        <annotation>

+            <documentation>

+			MIME type name, e.g. "text/html".

+			The MIME type may also contain the wildcard

+			character '*', like "text/*" or "*/*".

+			Used in: supports

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="nameType">

+        <annotation>

+            <documentation>

+			The name element contains the name of a parameter. 

+			Used in: init-param, ...

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="portletType">

+        <annotation>

+            <documentation>

+			The portlet element contains the declarative data of a portlet. 

+			Used in: portlet-app

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="portlet-name" type="portlet:portlet-nameType"/>

+            <element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="portlet-class" type="portlet:portlet-classType"/>

+            <element name="init-param" type="portlet:init-paramType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="expiration-cache" type="portlet:expiration-cacheType" minOccurs="0"/>

+            <element name="supports" type="portlet:supportsType" maxOccurs="unbounded"/>

+            <element name="supported-locale" type="portlet:supported-localeType" minOccurs="0" maxOccurs="unbounded"/>

+            <choice>

+                <sequence>

+                    <element name="resource-bundle" type="portlet:resource-bundleType"/>

+                    <element name="portlet-info" type="portlet:portlet-infoType" minOccurs="0"/>

+                </sequence>

+                <element name="portlet-info" type="portlet:portlet-infoType"/>

+            </choice>

+            <element name="portlet-preferences" type="portlet:portlet-preferencesType" minOccurs="0"/>

+            <element name="security-role-ref" type="portlet:security-role-refType" minOccurs="0" maxOccurs="unbounded"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <simpleType name="portlet-classType">

+        <annotation>

+            <documentation>

+			 The portlet-class element contains the fully

+			 qualified class name of the portlet.

+			Used in: portlet

+            </documentation>

+        </annotation>

+        <restriction base="portlet:fully-qualified-classType"/>

+    </simpleType>

+    <complexType name="portlet-collectionType">

+        <annotation>

+            <documentation>

+			The portlet-collectionType is used to identify a subset

+			of portlets within a portlet application to which a 

+			security constraint applies.

+			Used in: security-constraint

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="portlet-name" type="portlet:portlet-nameType" maxOccurs="unbounded"/>

+        </sequence>

+    </complexType>

+    <complexType name="portlet-infoType">

+        <sequence>

+            <element name="title" type="portlet:titleType"/>

+            <element name="short-title" type="portlet:short-titleType" minOccurs="0"/>

+            <element name="keywords" type="portlet:keywordsType" minOccurs="0"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="portlet-modeType">

+        <annotation>

+            <documentation>

+			Portlet modes. The specification pre-defines the following values 

+			as valid portlet mode constants: 

+			"edit", "help", "view".

+			Portlet mode names are not case sensitive.

+			Used in: custom-portlet-mode, supports

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="portlet-nameType">

+        <annotation>

+            <documentation>

+			The portlet-name element contains the canonical name of the 

+			portlet. Each portlet name is unique within the portlet 

+			application.

+			Used in: portlet, portlet-mapping

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="portlet-preferencesType">

+        <annotation>

+            <documentation>

+			Portlet persistent preference store.

+			Used in: portlet

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="preference" type="portlet:preferenceType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="preferences-validator" type="portlet:preferences-validatorType" minOccurs="0"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="preferenceType">

+        <annotation>

+            <documentation>

+			Persistent preference values that may be used for customization 

+			and personalization by the portlet.

+			Used in: portlet-preferences

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="name" type="portlet:nameType"/>

+            <element name="value" type="portlet:valueType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="read-only" type="portlet:read-onlyType" minOccurs="0"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <simpleType name="preferences-validatorType">

+        <annotation>

+            <documentation>

+			The class specified under preferences-validator implements

+			the PreferencesValidator interface to validate the 

+			preferences settings.

+			Used in: portlet-preferences

+            </documentation>

+        </annotation>

+        <restriction base="portlet:fully-qualified-classType"/>

+    </simpleType>

+    <simpleType name="read-onlyType">

+        <annotation>

+            <documentation>

+			read-only indicates that a setting cannot

+			be changed in any of the standard portlet modes 

+			("view","edit" or "help").

+			Per default all preferences are modifiable.

+			Valid values are: 

+			- true for read-only

+			- false for modifiable

+			Used in: preferences

+            </documentation>

+        </annotation>

+        <restriction base="portlet:string">

+            <enumeration value="true"/>

+            <enumeration value="false"/>

+        </restriction>

+    </simpleType>

+    <complexType name="resource-bundleType">

+        <annotation>

+            <documentation>

+			Filename of the resource bundle containing the language specific 

+			portlet informations in different languages.

+			Used in: portlet-info

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="role-linkType">

+        <annotation>

+            <documentation>

+			The role-link element is a reference to a defined security role. 

+			The role-link element must contain the name of one of the 

+			security roles defined in the security-role elements.

+			Used in: security-role-ref

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="security-constraintType">

+        <annotation>

+            <documentation>

+			The security-constraintType is used to associate

+			intended security constraints with one or more portlets.

+			Used in: portlet-app

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="display-name" type="portlet:display-nameType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="portlet-collection" type="portlet:portlet-collectionType"/>

+            <element name="user-data-constraint" type="portlet:user-data-constraintType"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="security-role-refType">

+        <annotation>

+            <documentation>

+			The security-role-ref element contains the declaration of a 

+			security role reference in the code of the web application. The 

+			declaration consists of an optional description, the security 

+			role name used in the code, and an optional link to a security 

+			role. If the security role is not specified, the Deployer must 

+			choose an appropriate security role.

+			The value of the role name element must be the String used 

+			as the parameter to the 

+			EJBContext.isCallerInRole(String roleName) method

+			or the HttpServletRequest.isUserInRole(String role) method.

+			Used in: portlet

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="role-name" type="portlet:role-nameType"/>

+            <element name="role-link" type="portlet:role-linkType" minOccurs="0"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="short-titleType">

+        <annotation>

+            <documentation>

+			Locale specific short version of the static title.

+			Used in: portlet-info

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="supportsType">

+        <annotation>

+            <documentation>

+			Supports indicates the portlet modes a 

+			portlet supports for a specific content type. All portlets must 

+			support the view mode. 

+			Used in: portlet

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="mime-type" type="portlet:mime-typeType"/>

+            <element name="portlet-mode" type="portlet:portlet-modeType" minOccurs="0" maxOccurs="unbounded"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="supported-localeType">

+        <annotation>

+            <documentation>

+			Indicated the locales the portlet supports.

+			Used in: portlet

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="titleType">

+        <annotation>

+            <documentation>

+			Locale specific static title for this portlet.

+			Used in: portlet-info

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <simpleType name="transport-guaranteeType">

+        <annotation>

+            <documentation>

+			The transport-guaranteeType specifies that 

+			the communication between client and portlet should 

+			be NONE, INTEGRAL, or CONFIDENTIAL. 

+			NONE means that the portlet does not

+			require any transport guarantees. A value of 

+			INTEGRAL means that the portlet requires that the 

+			data sent between the client and portlet be sent in 

+			such a way that it can't be changed in transit. 

+			CONFIDENTIAL means that the portlet requires 

+			that the data be transmitted in a fashion that

+			prevents other entities from observing the contents 

+			of the transmission. 

+			In most cases, the presence of the INTEGRAL or

+			CONFIDENTIAL flag will indicate that the use 

+			of SSL is required.

+ 			Used in: user-data-constraint

+            </documentation>

+        </annotation>

+        <restriction base="portlet:string">

+            <enumeration value="NONE"/>

+            <enumeration value="INTEGRAL"/>

+            <enumeration value="CONFIDENTIAL"/>

+        </restriction>

+    </simpleType>

+    <complexType name="user-attributeType">

+        <annotation>

+            <documentation>

+			User attribute defines a user specific attribute that the

+			portlet application needs. The portlet within this application 

+			can access this attribute via the request parameter USER_INFO

+			map.

+			Used in: portlet-app

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="name" type="portlet:nameType"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="user-data-constraintType">

+        <annotation>

+            <documentation>

+			The user-data-constraintType is used to indicate how

+			data communicated between the client and portlet should be

+			protected.

+			Used in: security-constraint

+            </documentation>

+        </annotation>

+        <sequence>

+            <element name="description" type="portlet:descriptionType" minOccurs="0" maxOccurs="unbounded"/>

+            <element name="transport-guarantee" type="portlet:transport-guaranteeType"/>

+        </sequence>

+        <attribute name="id" type="string" use="optional"/>

+    </complexType>

+    <complexType name="valueType">

+        <annotation>

+            <documentation>

+			The value element contains the value of a parameter.

+			Used in: init-param

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <complexType name="windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-stateType">

+        <annotation>

+            <documentation>

+			Portlet windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal state. Window state names are not case sensitive.

+			Used in: custom-windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string"/>

+        </simpleContent>

+    </complexType>

+    <!--- everything below is copied from j2ee_1_4.xsd -->

+    <complexType name="descriptionType">

+        <annotation>

+            <documentation>

+			The description element is used to provide text describing the 

+			parent element. The description element should include any 

+			information that the portlet application war file producer wants

+			to provide to the consumer of the portlet application war file 

+			(i.e., to the Deployer). Typically, the tools used by the 

+			portlet application war file consumer will display the 

+			description when processing the parent element that contains the 

+			description. It has an optional attribute xml:lang to indicate 

+			which language is used in the description according to 

+			RFC 1766 (http://www.ietf.org/rfc/rfc1766.txt). The default

+			value of this attribute is English(“en�).

+			Used in: init-param, portlet, portlet-app, security-role

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="string">

+                <attribute ref="xml:lang"/>

+            </extension>

+        </simpleContent>

+    </complexType>

+    <complexType name="display-nameType">

+        <annotation>

+            <documentation>

+			The display-name type contains a short name that is intended

+			to be displayed by tools. It is used by display-name

+			elements.  The display name need not be unique.

+			Example:

+				...

+                <display-name xml:lang="en">Employee Self Service</display-name>

+

+			It has an optional attribute xml:lang to indicate 

+			which language is used in the description according to 

+			RFC 1766 (http://www.ietf.org/rfc/rfc1766.txt). The default

+			value of this attribute is English(“en�).

+            </documentation>

+        </annotation>

+        <simpleContent>

+            <extension base="portlet:string">

+                <attribute ref="xml:lang"/>

+            </extension>

+        </simpleContent>

+    </complexType>

+    <simpleType name="fully-qualified-classType">

+        <annotation>

+            <documentation>

+			The elements that use this type designate the name of a

+			Java class or interface.

+            </documentation>

+        </annotation>

+        <restriction base="portlet:string"/>

+    </simpleType>

+    <simpleType name="role-nameType">

+        <annotation>

+            <documentation>

+			The role-nameType designates the name of a security role.

+

+			The name must conform to the lexical rules for an NMTOKEN.

+            </documentation>

+        </annotation>

+        <restriction base="NMTOKEN"/>

+    </simpleType>

+    <simpleType name="string">

+        <annotation>

+            <documentation>

+			This is a special string datatype that is defined by J2EE 

+			as a base type for defining collapsed strings. When 

+			schemas require trailing/leading space elimination as 

+			well as collapsing the existing whitespace, this base 

+			type may be used.

+            </documentation>

+        </annotation>

+        <restriction base="string">

+            <whiteSpace value="collapse"/>

+        </restriction>

+    </simpleType>

+</schema>

diff --git a/src/resources/org/apache/pluto/portalImpl/xml/web-app_2_3.dtd b/src/resources/org/apache/pluto/portalImpl/xml/web-app_2_3.dtd
new file mode 100644
index 0000000..b733607
--- /dev/null
+++ b/src/resources/org/apache/pluto/portalImpl/xml/web-app_2_3.dtd
@@ -0,0 +1,1063 @@
+<!--

+Copyright (c) 2000 Sun Microsystems, Inc.,

+901 San Antonio Road,

+Palo Alto, California 94303, U.S.A.

+All rights reserved.

+

+Sun Microsystems, Inc. has intellectual property rights relating to

+technology embodied in the product that is described in this document.

+In particular, and without limitation, these intellectual property

+rights may include one or more of the U.S. patents listed at

+http://www.sun.com/patents and one or more additional patents or

+pending patent applications in the U.S. and in other countries.

+

+This document and the product to which it pertains are distributed

+under licenses restricting their use, copying, distribution, and

+decompilation.  This document may be reproduced and distributed but may

+not be changed without prior written authorization of Sun and its

+licensors, if any.

+

+Third-party software, including font technology, is copyrighted and

+licensed from Sun suppliers.

+

+Sun,  Sun Microsystems,  the Sun logo,  Java,  JavaServer Pages,  Java

+Naming and Directory Interface,  JDBC,  JDK,  JavaMail and  and

+Enterprise JavaBeans are trademarks or registered trademarks of Sun

+Microsystems, Inc. in the U.S. and other countries.

+

+Federal Acquisitions: Commercial Software - Government Users Subject to

+Standard License Terms and Conditions.

+

+DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED

+CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED

+WARRANTY OF MERCHANTABILITY, FITNESS FOR FOR A PARTICULAR PURPOSE OR

+NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH

+DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

+

+

+_________________________________________________________________________

+

+Copyright (c) 2000 Sun Microsystems, Inc.,

+901 San Antonio Road,

+Palo Alto, California 94303, E'tats-Unis.

+Tous droits re'serve's.

+

+Sun Microsystems, Inc. a les droits de proprie'te' intellectuels

+relatants a` la technologie incorpore'e dans le produit qui est de'crit

+dans ce document. En particulier, et sans la limitation, ces droits de

+proprie'te' intellectuels peuvent inclure un ou plus des brevets

+ame'ricains e'nume're's a` http://www.sun.com/patents et un ou les

+brevets plus supple'mentaires ou les applications de brevet en attente

+dans les E'tats-Unis et dans les autres pays.

+

+Ce produit ou document est prote'ge' par un copyright et distribue'

+avec des licences qui en restreignent l'utilisation, la copie, la

+distribution, et la de'compilation.  Ce documention associe n peut

+e^tre reproduite et distribuer, par quelque moyen que ce soit, sans

+l'autorisation pre'alable et e'crite de Sun et de ses bailleurs de

+licence, le cas e'che'ant.

+

+Le logiciel de'tenu par des tiers, et qui comprend la technologie

+relative aux polices de caracte`res, est prote'ge' par un copyright et

+licencie' par des fournisseurs de Sun.

+

+Sun,  Sun Microsystems,  le logo Sun,  Java,  JavaServer Pages,  Java

+Naming and Directory Interface,  JDBC,  JDK,  JavaMail et  and

+Enterprise JavaBeans sont des marques de fabrique ou des marques

+de'pose'es de Sun Microsystems, Inc. aux E'tats-Unis et dans d'autres

+pays.

+

+LA DOCUMENTATION EST FOURNIE "EN L'E'TAT" ET TOUTES AUTRES CONDITIONS,

+DECLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT

+EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS

+NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A

+L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE

+CONTREFAC,ON.

+-->

+

+<!--

+This is the XML DTD for the Servlet 2.3 deployment descriptor.

+All Servlet 2.3 deployment descriptors must include a DOCTYPE

+of the following form:

+

+  <!DOCTYPE web-app PUBLIC

+	"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

+	"http://java.sun.com/dtd/web-app_2_3.dtd">

+

+-->

+

+<!--

+The following conventions apply to all J2EE deployment descriptor

+elements unless indicated otherwise.

+

+- In elements that contain PCDATA, leading and trailing whitespace

+  in the data may be ignored.

+

+- In elements whose value is an "enumerated type", the value is

+  case sensitive.

+

+- In elements that specify a pathname to a file within the same

+  JAR file, relative filenames (i.e., those not starting with "/")

+  are considered relative to the root of the JAR file's namespace.

+  Absolute filenames (i.e., those starting with "/") also specify

+  names in the root of the JAR file's namespace.  In general, relative

+  names are preferred.  The exception is .war files where absolute

+  names are preferred for consistency with the servlet API.

+-->

+

+

+<!--

+The web-app element is the root of the deployment descriptor for

+a web application.

+-->

+<!ELEMENT web-app (icon?, display-name?, description?, distributable?,

+context-param*, filter*, filter-mapping*, listener*, servlet*,

+servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,

+error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,

+login-config?, security-role*, env-entry*, ejb-ref*,  ejb-local-ref*)>

+

+<!--

+The auth-constraint element indicates the user roles that should

+be permitted access to this resource collection. The role-name

+used here must either correspond to the role-name of one of the

+security-role elements defined for this web application, or be

+the specially reserved role-name "*" that is a compact syntax for

+indicating all roles in the web application. If both "*" and

+rolenames appear, the container interprets this as all roles.

+If no roles are defined, no user is allowed access to the portion of

+the web application described by the containing security-constraint.

+The container matches role names case sensitively when determining

+access.

+

+

+Used in: security-constraint

+-->

+<!ELEMENT auth-constraint (description?, role-name*)>

+

+<!--

+The auth-method element is used to configure the authentication

+mechanism for the web application. As a prerequisite to gaining access to any web resources which are protected by an authorization

+constraint, a user must have authenticated using the configured

+mechanism. Legal values for this element are "BASIC", "DIGEST",

+"FORM", or "CLIENT-CERT".

+

+Used in: login-config

+-->

+<!ELEMENT auth-method (#PCDATA)>

+

+<!--

+The context-param element contains the declaration of a web

+application's servlet context initialization parameters.

+

+Used in: web-app

+-->

+<!ELEMENT context-param (param-name, param-value, description?)>

+

+<!--

+The description element is used to provide text describing the parent

+element.  The description element should include any information that

+the web application war file producer wants to provide to the consumer of

+the web application war file (i.e., to the Deployer). Typically, the tools

+used by the web application war file consumer will display the description

+when processing the parent element that contains the description.

+

+Used in: auth-constraint, context-param, ejb-local-ref, ejb-ref,

+env-entry, filter, init-param, resource-env-ref, resource-ref, run-as,

+security-role, security-role-ref, servlet, user-data-constraint,

+web-app, web-resource-collection

+-->

+<!ELEMENT description (#PCDATA)>

+

+<!--

+The display-name element contains a short name that is intended to be

+displayed by tools.  The display name need not be unique.

+

+Used in: filter, security-constraint, servlet, web-app

+

+Example:

+

+<display-name>Employee Self Service</display-name>

+-->

+<!ELEMENT display-name (#PCDATA)>

+

+<!--

+The distributable element, by its presence in a web application

+deployment descriptor, indicates that this web application is

+programmed appropriately to be deployed into a distributed servlet

+container

+

+Used in: web-app

+-->

+<!ELEMENT distributable EMPTY>

+

+<!--

+The ejb-link element is used in the ejb-ref or ejb-local-ref

+elements to specify that an EJB reference is linked to an

+enterprise bean.

+

+The name in the ejb-link element is composed of a

+path name specifying the ejb-jar containing the referenced enterprise

+bean with the ejb-name of the target bean appended and separated from

+the path name by "#".  The path name is relative to the war file

+containing the web application that is referencing the enterprise bean.

+This allows multiple enterprise beans with the same ejb-name to be

+uniquely identified.

+

+Used in: ejb-local-ref, ejb-ref

+

+Examples:

+

+	<ejb-link>EmployeeRecord</ejb-link>

+

+	<ejb-link>../products/product.jar#ProductEJB</ejb-link>

+

+-->

+<!ELEMENT ejb-link (#PCDATA)>

+

+<!--

+The ejb-local-ref element is used for the declaration of a reference to

+an enterprise bean's local home. The declaration consists of:

+

+	- an optional description

+	- the EJB reference name used in the code of the web application

+	  that's referencing the enterprise bean

+	- the expected type of the referenced enterprise bean

+	- the expected local home and local interfaces of the referenced

+	  enterprise bean

+	- optional ejb-link information, used to specify the referenced

+	  enterprise bean

+

+Used in: web-app

+-->

+<!ELEMENT ejb-local-ref (description?, ejb-ref-name, ejb-ref-type,

+		local-home, local, ejb-link?)>

+

+<!--

+The ejb-ref element is used for the declaration of a reference to

+an enterprise bean's home. The declaration consists of:

+

+	- an optional description

+	- the EJB reference name used in the code of

+	  the web application that's referencing the enterprise bean

+	- the expected type of the referenced enterprise bean

+	- the expected home and remote interfaces of the referenced

+	  enterprise bean

+	- optional ejb-link information, used to specify the referenced

+	  enterprise bean

+

+Used in: web-app

+-->

+<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type,

+		home, remote, ejb-link?)>

+

+<!--

+The ejb-ref-name element contains the name of an EJB reference. The

+EJB reference is an entry in the web application's environment and is

+relative to the java:comp/env context.  The name must be unique

+within the web application.

+

+It is recommended that name is prefixed with "ejb/".

+

+Used in: ejb-local-ref, ejb-ref

+

+Example:

+

+<ejb-ref-name>ejb/Payroll</ejb-ref-name>

+-->

+<!ELEMENT ejb-ref-name (#PCDATA)>

+

+<!--

+The ejb-ref-type element contains the expected type of the

+referenced enterprise bean.

+

+The ejb-ref-type element must be one of the following:

+

+	<ejb-ref-type>Entity</ejb-ref-type>

+	<ejb-ref-type>Session</ejb-ref-type>

+

+Used in: ejb-local-ref, ejb-ref

+-->

+<!ELEMENT ejb-ref-type (#PCDATA)>

+

+<!--

+The env-entry element contains the declaration of a web application's

+environment entry. The declaration consists of an optional

+description, the name of the environment entry, and an optional

+value.  If a value is not specified, one must be supplied

+during deployment.

+-->

+<!ELEMENT env-entry (description?, env-entry-name, env-entry-value?,

+env-entry-type)>

+

+<!--

+The env-entry-name element contains the name of a web applications's

+environment entry.  The name is a JNDI name relative to the

+java:comp/env context.  The name must be unique within a web application.

+

+Example:

+

+<env-entry-name>minAmount</env-entry-name>

+

+Used in: env-entry

+-->

+<!ELEMENT env-entry-name (#PCDATA)>

+

+<!--

+The env-entry-type element contains the fully-qualified Java type of

+the environment entry value that is expected by the web application's

+code.

+

+The following are the legal values of env-entry-type:

+

+	java.lang.Boolean

+	java.lang.Byte

+	java.lang.Character

+	java.lang.String

+	java.lang.Short

+	java.lang.Integer

+	java.lang.Long

+	java.lang.Float

+	java.lang.Double

+

+Used in: env-entry

+-->

+<!ELEMENT env-entry-type (#PCDATA)>

+

+<!--

+The env-entry-value element contains the value of a web application's

+environment entry. The value must be a String that is valid for the

+constructor of the specified type that takes a single String

+parameter, or for java.lang.Character, a single character.

+

+Example:

+

+<env-entry-value>100.00</env-entry-value>

+

+Used in: env-entry

+-->

+<!ELEMENT env-entry-value (#PCDATA)>

+

+<!--

+The error-code contains an HTTP error code, ex: 404

+

+Used in: error-page

+-->

+<!ELEMENT error-code (#PCDATA)>

+

+<!--

+The error-page element contains a mapping between an error code

+or exception type to the path of a resource in the web application

+

+Used in: web-app

+-->

+<!ELEMENT error-page ((error-code | exception-type), location)>

+

+<!--

+The exception type contains a fully qualified class name of a

+Java exception type.

+

+Used in: error-page

+-->

+<!ELEMENT exception-type (#PCDATA)>

+

+<!--

+The extension element contains a string describing an

+extension. example: "txt"

+

+Used in: mime-mapping

+-->

+<!ELEMENT extension (#PCDATA)>

+

+<!--

+Declares a filter in the web application. The filter is mapped to

+either a servlet or a URL pattern in the filter-mapping element, using

+the filter-name value to reference. Filters can access the

+initialization parameters declared in the deployment descriptor at

+runtime via the FilterConfig interface.

+

+Used in: web-app

+-->

+<!ELEMENT filter (icon?, filter-name, display-name?, description?,

+filter-class, init-param*)>

+

+<!--

+The fully qualified classname of the filter.

+

+Used in: filter

+-->

+<!ELEMENT filter-class (#PCDATA)>

+

+<!--

+Declaration of the filter mappings in this web application. The

+container uses the filter-mapping declarations to decide which filters

+to apply to a request, and in what order. The container matches the

+request URI to a Servlet in the normal way. To determine which filters

+to apply it matches filter-mapping declarations either on servlet-name,

+or on url-pattern for each filter-mapping element, depending on which

+style is used. The order in which filters are invoked is the order in

+which filter-mapping declarations that match a request URI for a

+servlet appear in the list of filter-mapping elements.The filter-name

+value must be the value of the <filter-name> sub-elements of one of the

+<filter> declarations in the deployment descriptor.

+

+Used in: web-app

+-->

+<!ELEMENT filter-mapping (filter-name, (url-pattern | servlet-name))>

+

+<!--

+The logical name of the filter. This name is used to map the filter.

+Each filter name is unique within the web application.

+

+Used in: filter, filter-mapping

+-->

+<!ELEMENT filter-name (#PCDATA)>

+

+<!--

+The form-error-page element defines the location in the web app

+where the error page that is displayed when login is not successful

+can be found. The path begins with a leading / and is interpreted

+relative to the root of the WAR.

+

+Used in: form-login-config

+-->

+<!ELEMENT form-error-page (#PCDATA)>

+

+<!--

+The form-login-config element specifies the login and error pages

+that should be used in form based login. If form based authentication

+is not used, these elements are ignored.

+

+Used in: login-config

+-->

+<!ELEMENT form-login-config (form-login-page, form-error-page)>

+

+<!--

+The form-login-page element defines the location in the web app

+where the page that can be used for login can be found. The path

+begins with a leading / and is interpreted relative to the root of the WAR.

+

+Used in: form-login-config

+-->

+<!ELEMENT form-login-page (#PCDATA)>

+

+<!--

+The home element contains the fully-qualified name of the enterprise

+bean's home interface.

+

+Used in: ejb-ref

+

+Example:

+

+<home>com.aardvark.payroll.PayrollHome</home>

+-->

+<!ELEMENT home (#PCDATA)>

+

+<!--

+The http-method contains an HTTP method (GET | POST |...).

+

+Used in: web-resource-collection

+-->

+<!ELEMENT http-method (#PCDATA)>

+

+<!--

+The icon element contains small-icon and large-icon elements that

+specify the file names for small and a large GIF or JPEG icon images

+used to represent the parent element in a GUI tool.

+

+Used in: filter, servlet, web-app

+-->

+<!ELEMENT icon (small-icon?, large-icon?)>

+

+<!--

+The init-param element contains a name/value pair as an

+initialization param of the servlet

+

+Used in: filter, servlet

+-->

+<!ELEMENT init-param (param-name, param-value, description?)>

+

+<!--

+The jsp-file element contains the full path to a JSP file within

+the web application beginning with a `/'.

+

+Used in: servlet

+-->

+<!ELEMENT jsp-file (#PCDATA)>

+

+<!--

+The large-icon element contains the name of a file

+containing a large (32 x 32) icon image. The file

+name is a relative path within the web application's

+war file.

+

+The image may be either in the JPEG or GIF format.

+The icon can be used by tools.

+

+Used in: icon

+

+Example:

+

+<large-icon>employee-service-icon32x32.jpg</large-icon>

+-->

+<!ELEMENT large-icon (#PCDATA)>

+

+<!--

+The listener element indicates the deployment properties for a web

+application listener bean.

+

+Used in: web-app

+-->

+<!ELEMENT listener (listener-class)>

+

+<!--

+The listener-class element declares a class in the application must be

+registered as a web application listener bean. The value is the fully qualified classname of the listener class.

+

+

+Used in: listener

+-->

+<!ELEMENT listener-class (#PCDATA)>

+

+<!--

+The load-on-startup element indicates that this servlet should be

+loaded (instantiated and have its init() called) on the startup

+of the web application. The optional contents of

+these element must be an integer indicating the order in which

+the servlet should be loaded. If the value is a negative integer,

+or the element is not present, the container is free to load the

+servlet whenever it chooses. If the value is a positive integer

+or 0, the container must load and initialize the servlet as the

+application is deployed. The container must guarantee that

+servlets marked with lower integers are loaded before servlets

+marked with higher integers. The container may choose the order

+of loading of servlets with the same load-on-start-up value.

+

+Used in: servlet

+-->

+<!ELEMENT load-on-startup (#PCDATA)>

+

+<!--

+

+The local element contains the fully-qualified name of the

+enterprise bean's local interface.

+

+Used in: ejb-local-ref

+

+-->

+<!ELEMENT local (#PCDATA)>

+

+<!--

+

+The local-home element contains the fully-qualified name of the

+enterprise bean's local home interface.

+

+Used in: ejb-local-ref

+-->

+<!ELEMENT local-home (#PCDATA)>

+

+<!--

+The location element contains the location of the resource in the web

+application relative to the root of the web application. The value of

+the location must have a leading `/'.

+

+Used in: error-page

+-->

+<!ELEMENT location (#PCDATA)>

+

+<!--

+The login-config element is used to configure the authentication

+method that should be used, the realm name that should be used for

+this application, and the attributes that are needed by the form login

+mechanism.

+

+Used in: web-app

+-->

+<!ELEMENT login-config (auth-method?, realm-name?, form-login-config?)>

+

+<!--

+The mime-mapping element defines a mapping between an extension

+and a mime type.

+

+Used in: web-app

+-->

+<!ELEMENT mime-mapping (extension, mime-type)>

+

+<!--

+The mime-type element contains a defined mime type. example:

+"text/plain"

+

+Used in: mime-mapping

+-->

+<!ELEMENT mime-type (#PCDATA)>

+

+<!--

+The param-name element contains the name of a parameter. Each parameter

+name must be unique in the web application.

+

+

+Used in: context-param, init-param

+-->

+<!ELEMENT param-name (#PCDATA)>

+

+<!--

+The param-value element contains the value of a parameter.

+

+Used in: context-param, init-param

+-->

+<!ELEMENT param-value (#PCDATA)>

+

+<!--

+The realm name element specifies the realm name to use in HTTP

+Basic authorization.

+

+Used in: login-config

+-->

+<!ELEMENT realm-name (#PCDATA)>

+

+<!--

+The remote element contains the fully-qualified name of the enterprise

+bean's remote interface.

+

+Used in: ejb-ref

+

+Example:

+

+<remote>com.wombat.empl.EmployeeService</remote>

+-->

+<!ELEMENT remote (#PCDATA)>

+

+<!--

+The res-auth element specifies whether the web application code signs

+on programmatically to the resource manager, or whether the Container

+will sign on to the resource manager on behalf of the web application. In the

+latter case, the Container uses information that is supplied by the

+Deployer.

+

+The value of this element must be one of the two following:

+

+	<res-auth>Application</res-auth>

+	<res-auth>Container</res-auth>

+

+Used in: resource-ref

+-->

+<!ELEMENT res-auth (#PCDATA)>

+

+<!--

+The res-ref-name element specifies the name of a resource manager

+connection factory reference.  The name is a JNDI name relative to the

+java:comp/env context.  The name must be unique within a web application.

+

+Used in: resource-ref

+-->

+<!ELEMENT res-ref-name (#PCDATA)>

+

+<!--

+The res-sharing-scope element specifies whether connections obtained

+through the given resource manager connection factory reference can be

+shared. The value of this element, if specified, must be one of the

+two following:

+

+	<res-sharing-scope>Shareable</res-sharing-scope>

+	<res-sharing-scope>Unshareable</res-sharing-scope>

+

+The default value is Shareable.

+

+Used in: resource-ref

+-->

+<!ELEMENT res-sharing-scope (#PCDATA)>

+

+<!--

+The res-type element specifies the type of the data source. The type

+is specified by the fully qualified Java language class or interface

+expected to be implemented by the data source.

+

+Used in: resource-ref

+-->

+<!ELEMENT res-type (#PCDATA)>

+

+<!--

+The resource-env-ref element contains a declaration of a web application's

+reference to an administered object associated with a resource

+in the web application's environment.  It consists of an optional

+description, the resource environment reference name, and an

+indication of the resource environment reference type expected by

+the web application code.

+

+Used in: web-app

+

+Example:

+

+<resource-env-ref>

+    <resource-env-ref-name>jms/StockQueue</resource-env-ref-name>

+    <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>

+</resource-env-ref>

+-->

+<!ELEMENT resource-env-ref (description?, resource-env-ref-name,

+		resource-env-ref-type)>

+

+<!--

+The resource-env-ref-name element specifies the name of a resource

+environment reference; its value is the environment entry name used in

+the web application code.  The name is a JNDI name relative to the

+java:comp/env context and must be unique within a web application.

+

+Used in: resource-env-ref

+-->

+<!ELEMENT resource-env-ref-name (#PCDATA)>

+

+<!--

+The resource-env-ref-type element specifies the type of a resource

+environment reference.  It is the fully qualified name of a Java

+language class or interface.

+

+Used in: resource-env-ref

+-->

+<!ELEMENT resource-env-ref-type (#PCDATA)>

+

+<!--

+The resource-ref element contains a declaration of a web application's

+reference to an external resource. It consists of an optional

+description, the resource manager connection factory reference name,

+the indication of the resource manager connection factory type

+expected by the web application code, the type of authentication

+(Application or Container), and an optional specification of the

+shareability of connections obtained from the resource (Shareable or

+Unshareable).

+

+Used in: web-app

+

+Example:

+

+    <resource-ref>

+	<res-ref-name>jdbc/EmployeeAppDB</res-ref-name>

+	<res-type>javax.sql.DataSource</res-type>

+	<res-auth>Container</res-auth>

+	<res-sharing-scope>Shareable</res-sharing-scope>

+    </resource-ref>

+-->

+<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth,

+		res-sharing-scope?)>

+

+<!--

+The role-link element is a reference to a defined security role. The

+role-link element must contain the name of one of the security roles

+defined in the security-role elements.

+

+Used in: security-role-ref

+-->

+<!ELEMENT role-link (#PCDATA)>

+

+<!--

+The role-name element contains the name of a security role.

+

+The name must conform to the lexical rules for an NMTOKEN.

+

+Used in: auth-constraint, run-as, security-role, security-role-ref

+-->

+<!ELEMENT role-name (#PCDATA)>

+

+<!--

+The run-as element specifies the run-as identity to be used for the

+execution of the web application. It contains an optional description, and

+the name of a security role.

+

+Used in: servlet

+-->

+<!ELEMENT run-as (description?, role-name)>

+

+<!--

+The security-constraint element is used to associate security

+constraints with one or more web resource collections

+

+Used in: web-app

+-->

+<!ELEMENT security-constraint (display-name?, web-resource-collection+,

+auth-constraint?, user-data-constraint?)>

+

+<!--

+The security-role element contains the definition of a security

+role. The definition consists of an optional description of the

+security role, and the security role name.

+

+Used in: web-app

+

+Example:

+

+    <security-role>

+	<description>

+	    This role includes all employees who are authorized

+	    to access the employee service application.

+	</description>

+	<role-name>employee</role-name>

+    </security-role>

+-->

+<!ELEMENT security-role (description?, role-name)>

+

+<!--

+The security-role-ref element contains the declaration of a security

+role reference in the web application's code. The declaration consists

+of an optional description, the security role name used in the code,

+and an optional link to a security role. If the security role is not

+specified, the Deployer must choose an appropriate security role.

+

+The value of the role-name element must be the String used as the

+parameter to the EJBContext.isCallerInRole(String roleName) method

+or the HttpServletRequest.isUserInRole(String role) method.

+

+Used in: servlet

+

+-->

+<!ELEMENT security-role-ref (description?, role-name, role-link?)>

+

+<!--

+The servlet element contains the declarative data of a

+servlet. If a jsp-file is specified and the load-on-startup element is

+present, then the JSP should be precompiled and loaded.

+

+Used in: web-app

+-->

+<!ELEMENT servlet (icon?, servlet-name, display-name?, description?,

+(servlet-class|jsp-file), init-param*, load-on-startup?, run-as?, security-role-ref*)>

+

+<!--

+The servlet-class element contains the fully qualified class name

+of the servlet.

+

+Used in: servlet

+-->

+<!ELEMENT servlet-class (#PCDATA)>

+

+<!--

+The servlet-mapping element defines a mapping between a servlet

+and a url pattern

+

+Used in: web-app

+-->

+<!ELEMENT servlet-mapping (servlet-name, url-pattern)>

+

+<!--

+The servlet-name element contains the canonical name of the

+servlet. Each servlet name is unique within the web application.

+

+Used in: filter-mapping, servlet, servlet-mapping

+-->

+<!ELEMENT servlet-name (#PCDATA)>

+

+<!--

+The session-config element defines the session parameters for

+this web application.

+

+Used in: web-app

+-->

+<!ELEMENT session-config (session-timeout?)>

+

+<!--

+The session-timeout element defines the default session timeout

+interval for all sessions created in this web application. The

+specified timeout must be expressed in a whole number of minutes.

+If the timeout is 0 or less, the container ensures the default

+behaviour of sessions is never to time out.

+

+Used in: session-config

+-->

+<!ELEMENT session-timeout (#PCDATA)>

+

+<!--

+The small-icon element contains the name of a file

+containing a small (16 x 16) icon image. The file

+name is a relative path within the web application's

+war file.

+

+The image may be either in the JPEG or GIF format.

+The icon can be used by tools.

+

+Used in: icon

+

+Example:

+

+<small-icon>employee-service-icon16x16.jpg</small-icon>

+-->

+<!ELEMENT small-icon (#PCDATA)>

+

+<!--

+The taglib element is used to describe a JSP tag library.

+

+Used in: web-app

+-->

+<!ELEMENT taglib (taglib-uri, taglib-location)>

+

+<!--

+the taglib-location element contains the location (as a resource

+relative to the root of the web application) where to find the Tag

+Libary Description file for the tag library.

+

+Used in: taglib

+-->

+<!ELEMENT taglib-location (#PCDATA)>

+

+<!--

+The taglib-uri element describes a URI, relative to the location

+of the web.xml document, identifying a Tag Library used in the Web

+Application.

+

+Used in: taglib

+-->

+<!ELEMENT taglib-uri (#PCDATA)>

+

+<!--

+The transport-guarantee element specifies that the communication

+between client and server should be NONE, INTEGRAL, or

+CONFIDENTIAL. NONE means that the application does not require any

+transport guarantees. A value of INTEGRAL means that the application

+requires that the data sent between the client and server be sent in

+such a way that it can't be changed in transit. CONFIDENTIAL means

+that the application requires that the data be transmitted in a

+fashion that prevents other entities from observing the contents of

+the transmission. In most cases, the presence of the INTEGRAL or

+CONFIDENTIAL flag will indicate that the use of SSL is required.

+

+Used in: user-data-constraint

+-->

+<!ELEMENT transport-guarantee (#PCDATA)>

+

+<!--

+The url-pattern element contains the url pattern of the mapping. Must

+follow the rules specified in Section 11.2 of the Servlet API

+Specification.

+

+Used in: filter-mapping, servlet-mapping, web-resource-collection

+-->

+<!ELEMENT url-pattern (#PCDATA)>

+

+<!--

+The user-data-constraint element is used to indicate how data

+communicated between the client and container should be protected.

+

+Used in: security-constraint

+-->

+<!ELEMENT user-data-constraint (description?, transport-guarantee)>

+

+<!--

+The web-resource-collection element is used to identify a subset

+of the resources and HTTP methods on those resources within a web

+application to which a security constraint applies. If no HTTP methods

+are specified, then the security constraint applies to all HTTP

+methods.

+

+Used in: security-constraint

+-->

+<!ELEMENT web-resource-collection (web-resource-name, description?,

+url-pattern*, http-method*)>

+

+<!--

+The web-resource-name contains the name of this web resource

+collection.

+

+Used in: web-resource-collection

+-->

+<!ELEMENT web-resource-name (#PCDATA)>

+

+<!--

+The welcome-file element contains file name to use as a default

+welcome file, such as index.html

+

+Used in: welcome-file-list

+-->

+<!ELEMENT welcome-file (#PCDATA)>

+

+<!--

+The welcome-file-list contains an ordered list of welcome files

+elements.

+

+Used in: web-app

+-->

+<!ELEMENT welcome-file-list (welcome-file+)>

+

+<!--

+The ID mechanism is to allow tools that produce additional deployment

+information (i.e., information beyond the standard deployment

+descriptor information) to store the non-standard information in a

+separate file, and easily refer from these tool-specific files to the

+information in the standard deployment descriptor.

+

+Tools are not allowed to add the non-standard information into the

+standard deployment descriptor.

+-->

+

+<!ATTLIST auth-constraint id ID #IMPLIED>

+<!ATTLIST auth-method id ID #IMPLIED>

+<!ATTLIST context-param id ID #IMPLIED>

+<!ATTLIST description id ID #IMPLIED>

+<!ATTLIST display-name id ID #IMPLIED>

+<!ATTLIST distributable id ID #IMPLIED>

+<!ATTLIST ejb-link id ID #IMPLIED>

+<!ATTLIST ejb-local-ref id ID #IMPLIED>

+<!ATTLIST ejb-ref id ID #IMPLIED>

+<!ATTLIST ejb-ref-name id ID #IMPLIED>

+<!ATTLIST ejb-ref-type id ID #IMPLIED>

+<!ATTLIST env-entry id ID #IMPLIED>

+<!ATTLIST env-entry-name id ID #IMPLIED>

+<!ATTLIST env-entry-type id ID #IMPLIED>

+<!ATTLIST env-entry-value id ID #IMPLIED>

+<!ATTLIST error-code id ID #IMPLIED>

+<!ATTLIST error-page id ID #IMPLIED>

+<!ATTLIST exception-type id ID #IMPLIED>

+<!ATTLIST extension id ID #IMPLIED>

+<!ATTLIST filter id ID #IMPLIED>

+<!ATTLIST filter-class id ID #IMPLIED>

+<!ATTLIST filter-mapping id ID #IMPLIED>

+<!ATTLIST filter-name id ID #IMPLIED>

+<!ATTLIST form-error-page id ID #IMPLIED>

+<!ATTLIST form-login-config id ID #IMPLIED>

+<!ATTLIST form-login-page id ID #IMPLIED>

+<!ATTLIST home id ID #IMPLIED>

+<!ATTLIST http-method id ID #IMPLIED>

+<!ATTLIST icon id ID #IMPLIED>

+<!ATTLIST init-param id ID #IMPLIED>

+<!ATTLIST jsp-file id ID #IMPLIED>

+<!ATTLIST large-icon id ID #IMPLIED>

+<!ATTLIST listener id ID #IMPLIED>

+<!ATTLIST listener-class id ID #IMPLIED>

+<!ATTLIST load-on-startup id ID #IMPLIED>

+<!ATTLIST local id ID #IMPLIED>

+<!ATTLIST local-home id ID #IMPLIED>

+<!ATTLIST location id ID #IMPLIED>

+<!ATTLIST login-config id ID #IMPLIED>

+<!ATTLIST mime-mapping id ID #IMPLIED>

+<!ATTLIST mime-type id ID #IMPLIED>

+<!ATTLIST param-name id ID #IMPLIED>

+<!ATTLIST param-value id ID #IMPLIED>

+<!ATTLIST realm-name id ID #IMPLIED>

+<!ATTLIST remote id ID #IMPLIED>

+<!ATTLIST res-auth id ID #IMPLIED>

+<!ATTLIST res-ref-name id ID #IMPLIED>

+<!ATTLIST res-sharing-scope id ID #IMPLIED>

+<!ATTLIST res-type id ID #IMPLIED>

+<!ATTLIST resource-env-ref id ID #IMPLIED>

+<!ATTLIST resource-env-ref-name id ID #IMPLIED>

+<!ATTLIST resource-env-ref-type id ID #IMPLIED>

+<!ATTLIST resource-ref id ID #IMPLIED>

+<!ATTLIST role-link id ID #IMPLIED>

+<!ATTLIST role-name id ID #IMPLIED>

+<!ATTLIST run-as id ID #IMPLIED>

+<!ATTLIST security-constraint id ID #IMPLIED>

+<!ATTLIST security-role id ID #IMPLIED>

+<!ATTLIST security-role-ref id ID #IMPLIED>

+<!ATTLIST servlet id ID #IMPLIED>

+<!ATTLIST servlet-class id ID #IMPLIED>

+<!ATTLIST servlet-mapping id ID #IMPLIED>

+<!ATTLIST servlet-name id ID #IMPLIED>

+<!ATTLIST session-config id ID #IMPLIED>

+<!ATTLIST session-timeout id ID #IMPLIED>

+<!ATTLIST small-icon id ID #IMPLIED>

+<!ATTLIST taglib id ID #IMPLIED>

+<!ATTLIST taglib-location id ID #IMPLIED>

+<!ATTLIST taglib-uri id ID #IMPLIED>

+<!ATTLIST transport-guarantee id ID #IMPLIED>

+<!ATTLIST url-pattern id ID #IMPLIED>

+<!ATTLIST user-data-constraint id ID #IMPLIED>

+<!ATTLIST web-app id ID #IMPLIED>

+<!ATTLIST web-resource-collection id ID #IMPLIED>

+<!ATTLIST web-resource-name id ID #IMPLIED>

+<!ATTLIST welcome-file id ID #IMPLIED>

+<!ATTLIST welcome-file-list id ID #IMPLIED>

diff --git a/src/resources/org/apache/pluto/portalImpl/xml/xml.xsd b/src/resources/org/apache/pluto/portalImpl/xml/xml.xsd
new file mode 100644
index 0000000..1ca95e4
--- /dev/null
+++ b/src/resources/org/apache/pluto/portalImpl/xml/xml.xsd
@@ -0,0 +1,97 @@
+<?xml version='1.0'?>

+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" >

+<!-- 

+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.

+-->

+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">

+

+    <xs:annotation>

+        <xs:documentation>

+   See http://www.w3.org/XML/1998/namespace.html and

+   http://www.w3.org/TR/REC-xml for information about this namespace.

+        </xs:documentation>

+    </xs:annotation>

+

+    <xs:annotation>

+        <xs:documentation>This schema defines attributes and an attribute group

+        suitable for use by

+        schemas wishing to allow xml:base, xml:lang or xml:space attributes

+        on elements they define.

+

+        To enable this, such a schema must import this schema

+        for the XML namespace, e.g. as follows:

+            &lt;schema . . .>

+         . . .

+            &lt;import namespace="http://www.w3.org/XML/1998/namespace"

+                    schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>

+

+        Subsequently, qualified reference to any of the attributes

+        or the group defined below will have the desired effect, e.g.

+

+            &lt;type . . .>

+         . . .

+            &lt;attributeGroup ref="xml:specialAttrs"/>

+ 

+         will define a type which will schema-validate an instance

+         element with any of those attributes</xs:documentation>

+    </xs:annotation>

+

+    <xs:annotation>

+        <xs:documentation>In keeping with the XML Schema WG's standard versioning

+   policy, this schema document will persist at

+   http://www.w3.org/2001/03/xml.xsd.

+   At the date of issue it can also be found at

+   http://www.w3.org/2001/xml.xsd.

+   The schema document at that URI may however change in the future,

+   in order to remain compatible with the latest version of XML Schema

+   itself.  In other words, if the XML Schema namespace changes, the version

+   of this document at

+   http://www.w3.org/2001/xml.xsd will change

+   accordingly; the version at

+   http://www.w3.org/2001/03/xml.xsd will not change.

+        </xs:documentation>

+    </xs:annotation>

+

+    <xs:attribute name="lang" type="xs:language">

+        <xs:annotation>

+            <xs:documentation>In due course, we should install the relevant ISO 2- and 3-letter

+         codes as the enumerated possible values . . .</xs:documentation>

+        </xs:annotation>

+    </xs:attribute>

+

+    <xs:attribute name="space" default="preserve">

+        <xs:simpleType>

+            <xs:restriction base="xs:NCName">

+                <xs:enumeration value="default"/>

+                <xs:enumeration value="preserve"/>

+            </xs:restriction>

+        </xs:simpleType>

+    </xs:attribute>

+

+    <xs:attribute name="base" type="xs:anyURI">

+        <xs:annotation>

+            <xs:documentation>See http://www.w3.org/TR/xmlbase/ for

+                     information about this attribute.</xs:documentation>

+        </xs:annotation>

+    </xs:attribute>

+

+    <xs:attributeGroup name="specialAttrs">

+        <xs:attribute ref="xml:base"/>

+        <xs:attribute ref="xml:lang"/>

+        <xs:attribute ref="xml:space"/>

+    </xs:attributeGroup>

+

+</xs:schema>

diff --git a/src/webapp/WEB-INF/aggregation/Banner.jsp b/src/webapp/WEB-INF/aggregation/Banner.jsp
new file mode 100644
index 0000000..74658a6
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/Banner.jsp
@@ -0,0 +1,24 @@
+<%@ page import="org.apache.pluto.core.Environment"%>

+ <%--

+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.

+--%>

+<table>

+  <tr><th><img src="http://portals.apache.org/pluto/images/pluto.png"/></th></tr>

+  <tr class="banner"><td>Pluto Portal Driver <FONT class="small">(<%=Environment.getServerInfo()%>)</FONT></td>

+      <td align="right"><A href="<%=request.getContextPath()%>/login_success.jsp">Login</A></td>

+  </tr>

+</table>

+<br>

diff --git a/src/webapp/WEB-INF/aggregation/ColumnFragment.jsp b/src/webapp/WEB-INF/aggregation/ColumnFragment.jsp
new file mode 100644
index 0000000..0052b88
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/ColumnFragment.jsp
@@ -0,0 +1,37 @@
+<%--

+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.

+--%>

+<%@ page session="false" buffer="none" %>

+<%@ page import="java.util.Iterator,

+                 org.apache.pluto.driver.aggregation.Fragment" %>

+<%@ page import="org.apache.pluto.driver.aggregation.Fragment" %>

+<jsp:useBean id="fragment" type="org.apache.pluto.driver.aggregation.Fragment" scope="request" />

+<%

+        Iterator iterator = fragment.getChildFragments().iterator();

+

+        while (iterator.hasNext())

+        {

+            Fragment subfragment = (Fragment)iterator.next();

+%>

+<TD valign="top">

+<%

+            subfragment.service(request, response);

+%>

+</TD>

+<TD> &nbsp; </TD>

+<%

+        }

+%>
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/aggregation/Head.jsp b/src/webapp/WEB-INF/aggregation/Head.jsp
new file mode 100644
index 0000000..174157c
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/Head.jsp
@@ -0,0 +1,20 @@
+<%--

+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.

+--%>

+<HEAD>

+    <TITLE>Pluto Portal Driver</TITLE>

+    <link rel="stylesheet" href="<%=request.getContextPath()%>/pluto_style.css" type="text/css">

+</HEAD>

diff --git a/src/webapp/WEB-INF/aggregation/PageFragment.jsp b/src/webapp/WEB-INF/aggregation/PageFragment.jsp
new file mode 100644
index 0000000..dc83c93
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/PageFragment.jsp
@@ -0,0 +1,43 @@
+<%--

+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.

+--%>

+<%@ page session="false" buffer="none" %>

+<%@ page import="java.util.Iterator,

+                 org.apache.pluto.driver.core.PortalURL,

+                 org.apache.pluto.driver.core.PortalEnvironment" %>

+<%@ page import="org.apache.pluto.driver.core.PortalURL" %>

+<%@ page import="org.apache.pluto.driver.core.PortalEnvironment" %>

+<%@ page import="org.apache.pluto.driver.aggregation.Fragment" %>

+<jsp:useBean id="fragment" type="org.apache.pluto.driver.aggregation.Fragment" scope="request" />

+<%

+    PortalURL url = PortalEnvironment.getPortalEnvironment(request).getRequestedPortalURL();

+    if (url.isPartOfGlobalNavigation(fragment.getId()))

+    {

+%>

+<I><%=fragment.getNavigation().getTitle()%></I><br>

+<%

+        Iterator childIterator = fragment.getChildFragments().iterator();

+        while (childIterator.hasNext())

+        {

+            Fragment subfragment = (Fragment)childIterator.next();

+

+            subfragment.service(request, response);

+

+        }

+%>

+<%

+    }

+%>

diff --git a/src/webapp/WEB-INF/aggregation/PortletFragmentFooter.jsp b/src/webapp/WEB-INF/aggregation/PortletFragmentFooter.jsp
new file mode 100644
index 0000000..c796cc8
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/PortletFragmentFooter.jsp
@@ -0,0 +1,19 @@
+<%--

+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.

+--%>

+		</td>

+	</tr>

+</table>

diff --git a/src/webapp/WEB-INF/aggregation/PortletFragmentHeader.jsp b/src/webapp/WEB-INF/aggregation/PortletFragmentHeader.jsp
new file mode 100644
index 0000000..f054e38
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/PortletFragmentHeader.jsp
@@ -0,0 +1,81 @@
+<%--

+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.

+--%>

+<jsp:useBean id="portletInfo" type="org.apache.pluto.driver.aggregation.PortletFragment.PortletInfo" scope="request" />

+<table border='1' cellpadding='1' cellspacing='1' width='100%' height='90%'>

+	<tr>

+		<td bgcolor='#DDDDDD'>

+			<table border='0' cellpadding='0' cellspacing='0' width='100%' height='10px'>

+				<tr>

+					<td>

+						<I><b><%= portletInfo.getTitle() %></b></I>

+					</td>

+					<td align='right'>

+						<font size='-3'>

+							<%

+				            java.util.List modeList = portletInfo.getAvailablePortletModes();

+				            java.util.Collections.sort(modeList);

+				            for (java.util.Iterator iter = modeList.iterator(); iter.hasNext();) {

+								org.apache.pluto.driver.aggregation.PortletFragment.PortletModeInfo modeInfo = (org.apache.pluto.driver.aggregation.PortletFragment.PortletModeInfo) iter.next();

+								if (!modeInfo.isCurrent()) {

+									%>

+									<a href="<%=modeInfo.getUrl() %>">

+									<%

+								}

+

+								out.print(modeInfo.getName());

+

+								if (!modeInfo.isCurrent()) {

+									%>

+									</a>&nbsp;

+									<%

+								}

+							}

+							%>

+							<%

+							java.util.List windowStateList = portletInfo.getAvailablePortletWindowStates();

+							java.util.Collections.sort(windowStateList);

+

+							if (modeList.size() > 0 && windowStateList.size() > 0) {

+							%>

+								&nbsp;|&nbsp;

+							<%

+							}

+							for (java.util.Iterator iter = windowStateList.iterator(); iter.hasNext();) {

+								org.apache.pluto.driver.aggregation.PortletFragment.PortletWindowStateInfo stateInfo = (org.apache.pluto.driver.aggregation.PortletFragment.PortletWindowStateInfo) iter.next();

+								if (!stateInfo.isCurrent()) {

+									%>

+									<a href="<%=stateInfo.getUrl()%>">

+									<%

+								}

+								out.println(stateInfo.getLabel());

+								if (!stateInfo.isCurrent()) {

+									%>

+									</a>&nbsp;

+									<%

+								}

+							}

+							%>

+						</font>

+					</td>

+				</tr>

+			</table>

+		</td>

+	</tr>

+	<tr>

+		<td>

+

+

diff --git a/src/webapp/WEB-INF/aggregation/RootFragment.jsp b/src/webapp/WEB-INF/aggregation/RootFragment.jsp
new file mode 100644
index 0000000..76b0ab2
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/RootFragment.jsp
@@ -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.

+--%>

+<%@ page session="true" buffer="none" %>

+<%@ page import="java.util.Iterator,

+                 org.apache.pluto.driver.aggregation.Fragment,

+                 org.apache.pluto.driver.aggregation.navigation.AbstractNavigationFragment" %>

+<%@ page import="org.apache.pluto.driver.aggregation.Fragment" %>

+<%@ page import="org.apache.pluto.driver.aggregation.navigation.AbstractNavigationFragment" %>

+<jsp:useBean id="fragment" type="org.apache.pluto.driver.aggregation.Fragment" scope="request" />

+<html>

+<%@ include file="./Head.jsp" %>

+<body marginwidth="0" marginheight="0">

+<%@ include file="./Banner.jsp" %>

+<table>

+  <tr><td valign="top" class="nav" width="150">

+<%

+        Iterator childIterator = fragment.getChildFragments().iterator();

+

+        while (childIterator.hasNext()) {

+            Fragment subfragment = (Fragment)childIterator.next();

+

+            if (subfragment instanceof AbstractNavigationFragment)

+            {

+                subfragment.service(request, response);

+                break;

+            }

+

+        }

+%>

+    </td>

+<%

+        childIterator = fragment.getChildFragments().iterator();

+

+        while (childIterator.hasNext()) {

+%>

+       <td valign="top">

+<%

+            Fragment subfragment = (Fragment)childIterator.next();

+

+            if (!(subfragment instanceof AbstractNavigationFragment))

+            {

+                subfragment.service(request, response);

+            }

+%>

+       </td>

+<%

+

+        }

+%>

+    </td>

+  </tr>

+</table>

+</body>

+</html>
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/aggregation/RowFragment.jsp b/src/webapp/WEB-INF/aggregation/RowFragment.jsp
new file mode 100644
index 0000000..daac2f7
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/RowFragment.jsp
@@ -0,0 +1,37 @@
+<%--

+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.

+--%>

+<%@ page session="false" buffer="none" %>

+<%@ page import="java.util.Iterator" %>

+<%@ page import="org.apache.pluto.driver.aggregation.Fragment" %>

+<jsp:useBean id="fragment" type="org.apache.pluto.driver.aggregation.Fragment" scope="request" />

+<table border="0" cellpadding="0" cellspacing="0" width="100%">

+<%

+        Iterator iterator = fragment.getChildFragments().iterator();

+

+        while (iterator.hasNext())

+        {

+            Fragment subfragment = (Fragment)iterator.next();

+%>

+<TR>

+<%

+            subfragment.service(request, response);

+%>

+</TR>

+<%

+        }

+%>

+</TABLE>
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/aggregation/TabNavigation.jsp b/src/webapp/WEB-INF/aggregation/TabNavigation.jsp
new file mode 100644
index 0000000..7975af5
--- /dev/null
+++ b/src/webapp/WEB-INF/aggregation/TabNavigation.jsp
@@ -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.

+--%>

+<%@ page session="false" buffer="none" %>

+<%@ page import="org.apache.pluto.driver.core.PortalURL,

+                 org.apache.pluto.driver.core.PortalURL,

+                 org.apache.pluto.driver.core.PortalEnvironment" %>

+<%@ page import="org.apache.pluto.driver.core.PortalEnvironment" %>

+<%@ page import="org.apache.pluto.driver.aggregation.navigation.Navigation" %>

+<%@ page import="org.apache.pluto.driver.aggregation.navigation.NavigationTreeBean" %>

+<jsp:useBean id="fragment" type="org.apache.pluto.driver.aggregation.navigation.TabNavigation" scope="request" />

+<table class="nav">

+<%

+    PortalURL url = PortalEnvironment.getPortalEnvironment(request).getRequestedPortalURL();

+    NavigationTreeBean[] tree = fragment.getNavigationView(url);

+    for (int i=0; i<tree.length; i++) {

+            %><TR><%

+            Navigation nav = tree[i].navigation;

+            boolean partOfNav = tree[i].partOfGlobalNav;

+            if (partOfNav) {

+                %><td class="nav" nowrap><%

+            } else {

+                %><td bgcolor="#AAAAFF" nowrap><%

+            }

+            for (int k=0; k<tree[i].depth; k++) {

+                %>&nbsp;&nbsp;&nbsp;<%

+            }

+            %>&nbsp;<a href="<%=new PortalURL(request, nav.getLinkedFragment()).toString()%>"><%

+            if (partOfNav) {

+                %><B><%

+            }

+            %><%=nav.getTitle()%><%

+            if (partOfNav) {

+                %></B><%

+            }

+            %></A>&nbsp;</TD><%

+            %><TR><%

+    }

+

+%>

+</table>

+

diff --git a/src/webapp/WEB-INF/classes/castor.properties b/src/webapp/WEB-INF/classes/castor.properties
new file mode 100644
index 0000000..99fed2d
--- /dev/null
+++ b/src/webapp/WEB-INF/classes/castor.properties
@@ -0,0 +1,26 @@
+# 

+# 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.

+#

+#

+# Example properties indent the output, require validation

+# on input and turn debugging on.

+#

+org.exolab.castor.parser.validation=false

+org.exolab.castor.parser.namespaces=true

+org.exolab.castor.indent=true

+org.exolab.castor.debug=false

+

+

diff --git a/src/webapp/WEB-INF/classes/commons-logging.properties b/src/webapp/WEB-INF/classes/commons-logging.properties
new file mode 100644
index 0000000..d7170f4
--- /dev/null
+++ b/src/webapp/WEB-INF/classes/commons-logging.properties
@@ -0,0 +1 @@
+org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/classes/simplelog.properties b/src/webapp/WEB-INF/classes/simplelog.properties
new file mode 100644
index 0000000..7d96f26
--- /dev/null
+++ b/src/webapp/WEB-INF/classes/simplelog.properties
@@ -0,0 +1,8 @@
+org.apache.commons.logging.simplelog.defaultlog=ERROR

+

+org.apache.commons.logging.simplelog.log.org.apache.pluto=DEBUG

+

+org.apache.commons.logging.simplelog.log.org.apache.pluto.core.PortletContainerImpl=DEBUG

+

+org.apache.commons.logging.simplelog.log.org.apache.pluto.driver.PortalStartupListener=DEBUG

+org.apache.commons.logging.simplelog.log.org.apache.pluto.driver.config.DriverConfigurationFactory=ERROR
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/config/services.properties b/src/webapp/WEB-INF/config/services.properties
new file mode 100644
index 0000000..ea1faab
--- /dev/null
+++ b/src/webapp/WEB-INF/config/services.properties
@@ -0,0 +1,36 @@
+# 

+# 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.

+#

+#

+# ------------------------------------------- #

+# The List (and Order) of Registered Services #

+# ------------------------------------------- #

+

+org.apache.pluto.driver.services.ConfigService = org.apache.pluto.driver.services.ConfigServiceImpl

+

+org.apache.pluto.driver.services

+.LogService= org.apache.pluto.driver.services

+.LogServiceImpl

+

+

+org.apache.pluto.portalImpl.services.factorymanager.FactoryManagerService = org.apache.pluto.portalImpl.services.factorymanager.FactoryManagerServiceImpl

+

+org.apache.pluto.driver.registry.PortletDefinitionRegistryService = org.apache.pluto.driver.registry.PortletDefinitionRegistryServiceFileImpl

+

+org.apache.pluto.driver.registry.PortletEntityRegistryService = org.apache.pluto.driver.registry.PortletEntityRegistryServiceFileImpl

+

+org.apache.pluto.driver.registry.PageRegistryService = org.apache.pluto.driver.registry.PageRegistryServiceFileImpl

+

diff --git a/src/webapp/WEB-INF/config/services/ConfigService.properties b/src/webapp/WEB-INF/config/services/ConfigService.properties
new file mode 100644
index 0000000..2053bfe
--- /dev/null
+++ b/src/webapp/WEB-INF/config/services/ConfigService.properties
@@ -0,0 +1,42 @@
+# 

+# 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.

+#

+#

+

+# -------------------------------- #

+# Properties of the Config Service #

+# -------------------------------- #

+

+host.name = localhost

+host.port.http = 8080

+host.port.https = 

+

+supported.portletmode = view

+supported.portletmode = edit

+supported.portletmode = help

+supported.portletmode = config

+

+supported.windowstate = normal

+supported.windowstate = maximized

+supported.windowstate = minimized

+

+

+# portlet container relevant properties

+

+portletcontainer.uniquename = pluto

+portletcontainer.entrance.impl = org.apache.pluto.core.PortletContainerImpl

+portletcontainer.entrance.wrapper.impl = org.apache.pluto.portalImpl.core.PortletContainerWrapperImpl

+

diff --git a/src/webapp/WEB-INF/config/services/LogService.properties b/src/webapp/WEB-INF/config/services/LogService.properties
new file mode 100644
index 0000000..4e23df1
--- /dev/null
+++ b/src/webapp/WEB-INF/config/services/LogService.properties
@@ -0,0 +1,29 @@
+# 

+# 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.

+#

+#

+

+# ----------------------------- #

+# Properties of the Log Service #

+# ----------------------------- #

+

+debug.enable = true

+

+info.enable = true

+

+warn.enable = true

+

+error.enable = true

diff --git a/src/webapp/WEB-INF/config/services/PageRegistryService.properties b/src/webapp/WEB-INF/config/services/PageRegistryService.properties
new file mode 100644
index 0000000..9315825
--- /dev/null
+++ b/src/webapp/WEB-INF/config/services/PageRegistryService.properties
@@ -0,0 +1,22 @@
+# 

+# 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.

+#

+#

+

+# --------------------------------------- #

+# Properties of the Page Registry Service #

+# --------------------------------------- #

+

diff --git a/src/webapp/WEB-INF/config/services/PortletDefinitionRegistryService.properties b/src/webapp/WEB-INF/config/services/PortletDefinitionRegistryService.properties
new file mode 100644
index 0000000..b209560
--- /dev/null
+++ b/src/webapp/WEB-INF/config/services/PortletDefinitionRegistryService.properties
@@ -0,0 +1,22 @@
+# 

+# 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.

+#

+#

+

+# ----------------------------------------------------- #

+# Properties of the Portlet Definition Registry Service #

+# ----------------------------------------------------- #

+

diff --git a/src/webapp/WEB-INF/config/services/PortletEntityRegistryService.properties b/src/webapp/WEB-INF/config/services/PortletEntityRegistryService.properties
new file mode 100644
index 0000000..1168b7d
--- /dev/null
+++ b/src/webapp/WEB-INF/config/services/PortletEntityRegistryService.properties
@@ -0,0 +1,22 @@
+# 

+# 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.

+#

+#

+

+# ------------------------------------------------- #

+# Properties of the Portlet Entity Registry Service #

+# ------------------------------------------------- #

+

diff --git a/src/webapp/WEB-INF/data/pageregistry.xml b/src/webapp/WEB-INF/data/pageregistry.xml
new file mode 100644
index 0000000..008f147
--- /dev/null
+++ b/src/webapp/WEB-INF/data/pageregistry.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>

+<!-- 

+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.

+-->

+<portal>

+

+    <fragment name="navigation" class="org.apache.pluto.driver.aggregation.navigation.TabNavigation">

+    </fragment>

+

+    <fragment name="test" type="page">

+        <navigation>

+            <title>Test</title>

+            <description>...</description>

+        </navigation>

+

+        <fragment name="row" type="row">

+

+            <fragment name="col1" type="column">

+

+                <fragment name="p1" type="portlet">

+                    <property name="portlet" value="3.1"/>

+                </fragment>

+

+                <fragment name="p2" type="portlet">

+                    <property name="portlet" value="4.1"/>

+                </fragment>

+

+            </fragment>

+

+        </fragment>

+

+    </fragment>

+

+

+</portal>

diff --git a/src/webapp/WEB-INF/data/portletentityregistry.xml b/src/webapp/WEB-INF/data/portletentityregistry.xml
new file mode 100644
index 0000000..57b4596
--- /dev/null
+++ b/src/webapp/WEB-INF/data/portletentityregistry.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<!-- 

+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.

+-->

+<portlet-entity-registry>

+    <application id="3">

+        <definition-id>testsuite</definition-id>

+        <portlet id="1">

+            <definition-id>testsuite.TestPortlet1</definition-id>

+            <preferences>

+                <pref-name>TestName4</pref-name>

+                <pref-value>TestValue4</pref-value>

+                <read-only>true</read-only>

+            </preferences>

+        </portlet>

+    </application>

+    <application id="4">

+        <definition-id>testsuite</definition-id>

+        <portlet id="1">

+            <definition-id>testsuite.TestPortlet2</definition-id>

+            <preferences>

+                <pref-name>TestName4</pref-name>

+                <pref-value>TestValue4</pref-value>

+                <read-only>true</read-only>

+            </preferences>

+        </portlet>

+    </application>

+</portlet-entity-registry>

diff --git a/src/webapp/WEB-INF/data/xml/pageregistrymapping.xml b/src/webapp/WEB-INF/data/xml/pageregistrymapping.xml
new file mode 100644
index 0000000..1d0ac9f
--- /dev/null
+++ b/src/webapp/WEB-INF/data/xml/pageregistrymapping.xml
@@ -0,0 +1,90 @@
+<?xml version="1.0"?>

+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"

+                           "http://castor.exolab.org/mapping.dtd">

+<!-- 

+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.

+-->

+<mapping>

+

+    <class name="org.apache.pluto.driver.aggregation.page.impl.PropertyImpl">

+

+        <field name="name" type="java.lang.String" required="true">

+            <bind-xml name="name" node="attribute"/>

+        </field>

+

+        <field name="value" type="java.lang.String" required="true">

+            <bind-xml name="value" node="attribute"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.driver.aggregation.page.impl.NavigationImpl">

+

+        <field name="title" type="java.lang.String" required="true">

+            <bind-xml name="title" node="element"/>

+        </field>

+

+        <field name="description" type="java.lang.String" required="false">

+            <bind-xml name="description" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.driver.aggregation.page.impl.FragmentImpl">

+

+        <field name="name" type="java.lang.String" required="true">

+            <bind-xml name="name" node="attribute"/>

+        </field>

+        <field name="classname" type="java.lang.String">

+            <bind-xml name="class" node="attribute"/>

+        </field>

+        <field name="type" type="java.lang.String">

+            <bind-xml name="type" node="attribute"/>

+        </field>

+

+        <field name="navigation"

+            type="org.apache.pluto.driver.aggregation.page.impl.NavigationImpl"

+            required="false">

+            <bind-xml name="navigation" node="element"/>

+        </field>

+

+        <field name="properties"

+            type="org.apache.pluto.driver.aggregation.page.impl.PropertyImpl"

+            collection="collection">

+            <bind-xml name="property" node="element"/>

+        </field>

+

+        <field name="fragments"

+            type="org.apache.pluto.driver.aggregation.page.impl.FragmentImpl"

+            collection="collection">

+            <bind-xml name="fragment" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.driver.aggregation.page.impl.PortalImpl">

+        <map-to xml="portal"/>

+

+        <field name="fragments"

+            type="org.apache.pluto.driver.aggregation.page.impl.FragmentImpl"

+            collection="collection"

+            required="true">

+            <bind-xml name="fragment" node="element"/>

+        </field>

+

+    </class>

+

+</mapping>
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/data/xml/portletdefinitionmapping.xml b/src/webapp/WEB-INF/data/xml/portletdefinitionmapping.xml
new file mode 100644
index 0000000..5f5392b
--- /dev/null
+++ b/src/webapp/WEB-INF/data/xml/portletdefinitionmapping.xml
@@ -0,0 +1,218 @@
+<?xml version="1.0"?>

+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"

+                           "http://castor.exolab.org/mapping.dtd">

+<!-- 

+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.

+-->

+<mapping xmlns:portlet="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.DisplayNameImpl">

+

+        <field name="displayName" type="java.lang.String">

+            <bind-xml node="text"/>

+        </field>

+        <field name="castorLocale" type="java.lang.String">

+            <bind-xml name="xml:lang" node="attribute"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl">

+

+        <field name="description" type="java.lang.String">

+            <bind-xml node="text"/>

+        </field>

+        <field name="castorLocale" type="java.lang.String">

+            <bind-xml name="xml:lang" node="attribute"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.SecurityRoleRefImpl">

+

+        <field name="castorDescriptions"

+            type="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl"

+            collection="collection">

+            <bind-xml name="portlet:description" node="element"/>

+        </field>

+        <field name="roleName" type="java.lang.String" required="true">

+            <bind-xml name="portlet:role-name" node="element"/>

+        </field>

+        <field name="roleLink" type="java.lang.String">

+            <bind-xml name="portlet:role-link" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.ParameterImpl">

+        <field name="castorDescriptions"

+            type="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl"

+            collection="collection">

+            <bind-xml name="portlet:description" node="element"/>

+        </field>

+        <field name="name" type="java.lang.String" required="true">

+            <bind-xml name="portlet:name" node="element"/>

+        </field>

+        <field name="value" type="java.lang.String" required="true">

+            <bind-xml name="portlet:value" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.PreferenceImpl">

+

+        <field name="name" type="java.lang.String" required="true">

+            <bind-xml name="portlet:name" node="element"/>

+        </field>

+        <field name="castorValues" type="java.lang.String" collection="collection" required="true">

+            <bind-xml name="portlet:value" node="element"/>

+        </field>

+        <!--field name="modifiable" type="java.lang.Boolean">

+          <bind-xml name="portlet:modifiable" node="element"/>

+        </field-->

+        <field name="readOnly" type="java.lang.String">

+            <bind-xml name="portlet:read-only" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.portlet.impl.ContentTypeImpl">

+

+        <field name="contentType" type="java.lang.String">

+            <bind-xml name="portlet:mime-type" node="element"/>

+        </field>

+

+        <field name="castorPortletModes"

+            type="java.lang.String"

+            collection="collection">

+            <bind-xml name="portlet:portlet-mode" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.PreferenceSetImpl">

+

+        <field name="castorPreferences" type="org.apache.pluto.portalImpl.om.common.impl.PreferenceImpl" collection="collection">

+            <bind-xml name="portlet:preference" node="element"/>

+        </field>

+        <field name="castorPreferencesValidator" type="java.lang.String">

+            <bind-xml name="portlet:preferences-validator" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.LanguageSetImpl">

+

+        <field name="title" type="java.lang.String">

+            <bind-xml name="portlet:title" node="element"/>

+        </field>

+        <field name="shortTitle" type="java.lang.String">

+            <bind-xml name="portlet:short-title" node="element"/>

+        </field>

+        <field name="castorKeywords" type="java.lang.String">

+            <bind-xml name="portlet:keywords" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.portlet.impl.PortletDefinitionImpl">

+

+        <field name="id" type="java.lang.String" direct="true">

+            <bind-xml name="id" node="attribute"/>

+        </field>

+        <field name="castorDescriptions"

+            type="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl"

+            collection="collection">

+            <bind-xml name="portlet:description" node="element"/>

+        </field>

+        <field name="name" type="java.lang.String">

+            <bind-xml name="portlet:portlet-name" node="element"/>

+        </field>

+        <field name="castorDisplayNames"

+            type="org.apache.pluto.portalImpl.om.common.impl.DisplayNameImpl"

+            collection="collection">

+            <bind-xml name="portlet:display-name" node="element"/>

+        </field>

+        <field name="className" type="java.lang.String">

+            <bind-xml name="portlet:portlet-class" node="element"/>

+        </field>

+        <field name="castorInitParams"

+            type="org.apache.pluto.portalImpl.om.common.impl.ParameterImpl"

+            collection="collection">

+            <bind-xml name="portlet:init-param" node="element"/>

+        </field>

+

+        <field name="expirationCache" type="java.lang.String">

+            <bind-xml name="portlet:expiration-cache" node="element"/>

+        </field>

+        <field name="castorContentTypes"

+            type="org.apache.pluto.portalImpl.om.portlet.impl.ContentTypeImpl"

+            collection="collection">

+            <bind-xml name="portlet:supports" node="element"/>

+        </field>

+        <field name="castorSupportedLocales" type="java.lang.String" collection="collection">

+            <bind-xml name="portlet:supported-locale" node="element"/>

+        </field>

+        <field name="resourceBundle" type="java.lang.String">

+            <bind-xml name="portlet:resource-bundle" node="element"/>

+        </field>

+        <field name="castorResources" type="org.apache.pluto.portalImpl.om.common.impl.LanguageSetImpl">

+            <bind-xml name="portlet:portlet-info" node="element"/>

+        </field>

+

+        <field name="castorPreferences"

+            type="org.apache.pluto.portalImpl.om.common.impl.PreferenceSetImpl">

+            <bind-xml name="portlet:portlet-preferences" node="element"/>

+        </field>

+        <field name="castorInitSecurityRoleRefs"

+            type="org.apache.pluto.portalImpl.om.common.impl.SecurityRoleRefImpl"

+            collection="collection">

+            <bind-xml name="portlet:security-role-ref" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.portlet.impl.PortletApplicationDefinitionImpl">

+        <map-to xml="portlet-app" ns-uri="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"/>

+

+        <field name="version" type="java.lang.String">

+            <bind-xml name="version" node="attribute"/>

+        </field>

+        <field name="appId" type="java.lang.String">

+            <bind-xml name="id" node="attribute"/>

+        </field>

+

+        <field name="castorPortlets"

+            type="org.apache.pluto.portalImpl.om.portlet.impl.PortletDefinitionImpl"

+            collection="collection">

+            <bind-xml name="portlet:portlet" node="element"/>

+        </field>

+        <field name="customPortletMode" type="java.lang.String" collection="collection">

+            <bind-xml name="portlet:custom-portlet-mode" node="element"/>

+        </field>

+        <field name="customPortletState" type="java.lang.String" collection="collection">

+            <bind-xml name="portlet:custom-windowInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternalInternal-state" node="element"/>

+        </field>

+        <field name="userAttribute" type="java.lang.String" collection="collection">

+            <bind-xml name="portlet:user-attribute" node="element"/>

+        </field>

+        <field name="securityConstraint" type="java.lang.String" collection="collection">

+            <bind-xml name="portlet:security-constraint" node="element"/>

+        </field>

+

+    </class>

+

+</mapping>

diff --git a/src/webapp/WEB-INF/data/xml/portletentitymapping.xml b/src/webapp/WEB-INF/data/xml/portletentitymapping.xml
new file mode 100644
index 0000000..90cffb4
--- /dev/null
+++ b/src/webapp/WEB-INF/data/xml/portletentitymapping.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0"?>

+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"

+                           "http://castor.exolab.org/mapping.dtd">

+<!-- 

+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.

+-->

+<mapping>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.PreferenceImpl">

+

+        <field name="name" type="java.lang.String">

+            <bind-xml name="pref-name" node="element"/>

+        </field>

+        <field name="castorValues" type="java.lang.String" collection="collection">

+            <bind-xml name="pref-value" node="element"/>

+        </field>

+        <field name="readOnly" type="java.lang.String">

+            <bind-xml name="read-only" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.entity.impl.PortletEntityImpl">

+

+        <field name="castorId" type="java.lang.String">

+

+            <bind-xml name="id" node="attribute"/>

+        </field>

+

+        <field name="definitionId" type="java.lang.String">

+            <bind-xml name="definition-id" node="element"/>

+        </field>

+        <field name="castorPreferences"

+            type="org.apache.pluto.portalImpl.om.common.impl.PreferenceImpl"

+            collection="collection">

+            <bind-xml name="preferences" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.entity.impl.PortletApplicationEntityImpl">

+

+        <field name="castorId" type="java.lang.String">

+

+            <bind-xml name="id" node="attribute"/>

+        </field>

+

+        <field name="definitionId" type="java.lang.String">

+            <bind-xml name="definition-id" node="element"/>

+        </field>

+        <field name="castorPortlets"

+            type="org.apache.pluto.portalImpl.om.entity.impl.PortletEntityImpl"

+            collection="collection">

+            <bind-xml name="portlet" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.entity.impl.PortletApplicationEntityListImpl">

+        <map-to xml="portlet-entity-registry"/>

+

+        <field name="castorApplications"

+            type="org.apache.pluto.portalImpl.om.entity.impl.PortletApplicationEntityImpl"

+            collection="collection">

+            <bind-xml name="application" node="element"/>

+        </field>

+    </class>

+

+</mapping>
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml b/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml
new file mode 100644
index 0000000..021e28b
--- /dev/null
+++ b/src/webapp/WEB-INF/data/xml/servletdefinitionmapping.xml
@@ -0,0 +1,289 @@
+<?xml version="1.0"?>

+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN"

+                           "http://castor.exolab.org/mapping.dtd">

+<!-- 

+  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.

+-->

+<mapping>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.DisplayNameImpl">

+

+        <field name="displayName" type="java.lang.String">

+            <bind-xml node="text"/>

+        </field>

+        <field name="castorLocale" type="java.lang.String">

+            <bind-xml name="xml:lang" node="attribute"/>

+        </field>

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.servlet.impl.TagDefinitionImpl">

+

+        <field name="uri" type="java.lang.String" required="true">

+            <bind-xml name="taglib-uri" node="element"/>

+        </field>

+

+        <field name="location" type="java.lang.String" required="true">

+            <bind-xml name="taglib-location" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.servlet.impl.ResourceRef">

+

+        <field name="description" type="java.lang.String" required="false">

+            <bind-xml name="description" node="element"/>

+        </field>

+

+        <field name="name" type="java.lang.String" required="false">

+            <bind-xml name="res-ref-name" node="element"/>

+        </field>

+

+        <field name="type" type="java.lang.String" required="false">

+            <bind-xml name="res-type" node="element"/>

+        </field>

+

+        <field name="auth" type="java.lang.String" required="false">

+            <bind-xml name="res-auth" node="element"/>

+        </field>

+

+        <field name="sharing" type="java.lang.String" required="false">

+            <bind-xml name="res-sharing-scope" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.servlet.impl.MimeTypeImpl">

+

+        <field name="extension" type="java.lang.String" required="true">

+            <bind-xml name="extension" node="element"/>

+        </field>

+

+        <field name="mimeType" type="java.lang.String" required="true">

+            <bind-xml name="mime-type" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl">

+

+        <field name="description" type="java.lang.String">

+            <bind-xml node="text"/>

+        </field>

+        <field name="castorLocale" type="java.lang.String">

+            <bind-xml name="xml:lang" node="attribute"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.SecurityRoleImpl">

+

+        <field name="description" type="java.lang.String" required="false">

+            <bind-xml name="description" node="element"/>

+        </field>

+        <field name="roleName" type="java.lang.String" required="true">

+            <bind-xml name="role-name" node="element"/>

+        </field>

+    </class>

+

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.SecurityRoleRefImpl">

+

+        <field name="castorDescriptions"

+            type="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl"

+            collection="collection">

+            <bind-xml name="description" node="element"/>

+        </field>

+        <field name="roleName" type="java.lang.String" required="true">

+            <bind-xml name="role-name" node="element"/>

+        </field>

+        <field name="roleLink" type="java.lang.String" required="false">

+            <bind-xml name="role-link" node="element"/>

+        </field>

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.common.impl.ParameterImpl">

+

+        <field name="name" type="java.lang.String" required="true">

+            <bind-xml name="param-name" node="element"/>

+        </field>

+        <field name="value" type="java.lang.String" required="true">

+            <bind-xml name="param-value" node="element"/>

+        </field>

+        <field name="castorDescriptions"

+            type="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl"

+            collection="collection">

+            <bind-xml name="description" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.servlet.impl.ServletMappingImpl">

+

+        <field name="id" type="java.lang.String">

+            <bind-xml name="id" node="attribute"/>

+        </field>

+

+        <field name="servletName" type="java.lang.String" required="true">

+            <bind-xml name="servlet-name" node="element"/>

+        </field>

+        <field name="urlPattern" type="java.lang.String" required="true">

+            <bind-xml name="url-pattern" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.servlet.impl.ServletDefinitionImpl">

+

+        <field name="castorId" type="java.lang.String">

+

+            <bind-xml name="id" node="attribute"/>

+        </field>

+

+        <field name="servletName" type="java.lang.String" required="true">

+            <bind-xml name="servlet-name" node="element"/>

+        </field>

+        <field name="castorDisplayNames"

+            type="org.apache.pluto.portalImpl.om.common.impl.DisplayNameImpl"

+            collection="collection">

+            <bind-xml name="display-name" node="element"/>

+        </field>

+        <field name="castorDescriptions"

+            type="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl"

+            collection="collection">

+            <bind-xml name="description" node="element"/>

+        </field>

+        <field name="servletClass" type="java.lang.String">

+            <bind-xml name="servlet-class" node="element"/>

+        </field>

+        <field name="castorInitParams"

+            type="org.apache.pluto.portalImpl.om.common.impl.ParameterImpl"

+            collection="collection">

+            <bind-xml name="init-param" node="element"/>

+        </field>

+

+        <!-- only for completion, not used in class file -->

+        <field name="icon" transient="true" direct="true">

+            <bind-xml name="icon" node="element"/>

+        </field>

+        <field name="loadOnStartup" transient="true" direct="true">

+            <bind-xml name="load-on-startup" node="element"/>

+        </field>

+        <field name="jspFile" type="java.lang.String">

+            <bind-xml name="jsp-file" node="element"/>

+        </field>

+        <field name="castorInitSecurityRoleRefs"

+            type="org.apache.pluto.portalImpl.om.common.impl.SecurityRoleRefImpl"

+            collection="collection">

+            <bind-xml name="security-role-ref" node="element"/>

+        </field>

+

+    </class>

+

+    <class name="org.apache.pluto.portalImpl.om.servlet.impl.WebApplicationDefinitionImpl">

+        <map-to xml="web-app"/>

+

+        <field name="castorId" type="java.lang.String">

+            <bind-xml name="id" node="attribute"/>

+        </field>

+

+        <field name="castorDisplayNames"

+            type="org.apache.pluto.portalImpl.om.common.impl.DisplayNameImpl"

+            collection="collection">

+            <bind-xml name="display-name" node="element"/>

+        </field>

+        <field name="castorDescriptions"

+            type="org.apache.pluto.portalImpl.om.common.impl.DescriptionImpl"

+            collection="collection">

+            <bind-xml name="description" node="element"/>

+        </field>

+        <field name="castorInitParams"

+            type="org.apache.pluto.portalImpl.om.common.impl.ParameterImpl"

+            collection="collection">

+            <bind-xml name="context-param" node="element"/>

+        </field>

+        <field name="castorServlets"

+            type="org.apache.pluto.portalImpl.om.servlet.impl.ServletDefinitionImpl"

+            collection="collection"

+            required="true">

+            <bind-xml name="servlet" node="element"/>

+        </field>

+        <field name="servletMappings"

+            type="org.apache.pluto.portalImpl.om.servlet.impl.ServletMappingImpl"

+            collection="collection"

+            required="true">

+            <bind-xml name="servlet-mapping" node="element"/>

+        </field>

+

+        <field name="castorTagDefinitions"

+            type="org.apache.pluto.portalImpl.om.servlet.impl.TagDefinitionImpl"

+            collection="collection">

+            <bind-xml name="taglib" node="element"/>

+        </field>

+

+        <field name="castorResourceRefSet"

+            type="org.apache.pluto.portalImpl.om.servlet.impl.ResourceRef"

+            collection="collection">

+            <bind-xml name="resource-ref" node="element"/>

+        </field>

+

+        <!-- only for completion, not used in class file -->

+        <field name="icon" transient="true" direct="true">

+            <bind-xml name="icon" node="element"/>

+        </field>

+        <field name="distributable" transient="true" direct="true">

+            <bind-xml name="distributable" node="element"/>

+        </field>

+        <field name="sessionConfig" transient="true" direct="true">

+            <bind-xml name="session-config" node="element"/>

+        </field>

+        <field name="castorMimeMappings"

+            transient="true"

+            required="false"

+            type="org.apache.pluto.portalImpl.om.servlet.impl.MimeTypeImpl"

+            collection="collection">

+            <bind-xml name="mime-mapping" node="element"/>

+        </field>

+        <field name="welcomeFileList" transient="true" direct="true">

+            <bind-xml name="welcome-file-list" node="element"/>

+        </field>

+        <field name="errorPage" transient="true" direct="true">

+            <bind-xml name="error-page" node="element"/>

+        </field>

+

+        <field name="securityConstraint" transient="true" direct="true">

+            <bind-xml name="security-constraint" node="element"/>

+        </field>

+        <field name="loginConfig" transient="true" direct="true">

+            <bind-xml name="login-config" node="element"/>

+        </field>

+        <!--field name="securityRole" transient="false" direct="true">

+            <bind-xml name="security-role" node="element"/>

+        </field-->

+        <field name="securityRoles"

+            transient="false"

+            type="org.apache.pluto.portalImpl.om.common.impl.SecurityRoleImpl"

+            required="false"

+            collection="collection">

+            <bind-xml name="security-role" node="element"/>

+        </field>

+        <field name="envEntry" transient="true" direct="true">

+            <bind-xml name="env-entry" node="element"/>

+        </field>

+        <field name="ejbRef" transient="true" direct="true">

+            <bind-xml name="ejb-ref" node="element"/>

+        </field>

+    </class>

+

+</mapping>

diff --git a/src/webapp/WEB-INF/fragments/portlet-page.jsp b/src/webapp/WEB-INF/fragments/portlet-page.jsp
new file mode 100644
index 0000000..ed901c6
--- /dev/null
+++ b/src/webapp/WEB-INF/fragments/portlet-page.jsp
@@ -0,0 +1,13 @@
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

+<%@ taglib uri="http://portals.apache.org/pluto" prefix="pluto" %>

+<TABLE>

+<c:forEach var="portlet" varStatus="status" items="${currentPage.portletIds}">

+<c:if test="${status.index % 2 == 0}">

+<TR>

+</c:if>

+<TD valign="top"><c:set var="portlet" value="${portlet}" scope="request"/><jsp:include page="portlet-skin.jsp"/></TD>

+<c:if test="${status.index % 2 != 0}">

+</TR>

+</c:if>

+</c:forEach>

+</TABLE>

diff --git a/src/webapp/WEB-INF/fragments/portlet-skin.jsp b/src/webapp/WEB-INF/fragments/portlet-skin.jsp
new file mode 100644
index 0000000..85a56bf
--- /dev/null
+++ b/src/webapp/WEB-INF/fragments/portlet-skin.jsp
@@ -0,0 +1,17 @@
+<%@ taglib uri="http://portals.apache.org/pluto" prefix="pluto" %>

+

+<pluto:portlet portletId="${portlet}">

+<TABLE class="portlet" border="1">

+<TR class="banner"><TD><pluto:title/></TD>

+    <TD><A href="<pluto:window windowState="minimized">">min</pluto:window></TD>

+    <TD><A href="<pluto:window windowState="maximized">">max</pluto:window></TD>

+    <TD><A href="<pluto:window windowState="normal">">nor</pluto:window></TD>

+    <TD><A href="<pluto:window portletMode="help">">help</pluto:window></TD>

+    <TD><A href="<pluto:window portletMode="edit">">edit</pluto:window></TD>

+    <TD><A href="<pluto:window portletMode="view">">view</pluto:window></TD></TR>

+<TR><TD colspan="7">

+    <pluto:render/>

+    </TD></TR>

+</TABLE>

+</pluto:portlet>

+

diff --git a/src/webapp/WEB-INF/fragments/template.jsp b/src/webapp/WEB-INF/fragments/template.jsp
new file mode 100644
index 0000000..46b19c7
--- /dev/null
+++ b/src/webapp/WEB-INF/fragments/template.jsp
@@ -0,0 +1,43 @@
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

+

+<HTML>

+<HEAD>

+<TITLE>Pluto Portal Driver</TITLE>

+<link rel="stylesheet" href="<c:out value="${pageContext.request.contextPath}"/>/pluto_style.css" type="text/css"></link>

+</HEAD>

+

+<BODY>

+

+<TABLE>

+<TR><TD><IMG src="<c:out value="${pageContext.request.contextPath}"/>/images/pluto.png"/></TD>

+    <TD style="align:right">Pluto Portal Driver</TD></TR>

+<TR><TD class="banner-highlight" colspan="2"></TD></TR>

+<TR><TD colspan="2"> &nbsp; </TD></TR>

+</TABLE>

+

+<TABLE>

+<TR class="tab">

+    <c:forEach var="page" items="${driverConfig.renderConfig.pages}">

+    <c:choose>

+    <c:when test="${page == currentPage}">

+    <TD nowrap="true" class="tab-selected">

+    </c:when>

+    <c:otherwise>

+    <TD nowrap="true">

+    </c:otherwise>

+    </c:choose>

+        <A href="<c:out value="${pageContext.request.contextPath}"/>/portal/<c:out value="${page.name}"/>"><c:out value="${page.name}"/></A></TD>

+    <TD style="background-color:white"> &nbsp; </TD>

+    <c:set var="span" value="${span + 1}"/>

+    </c:forEach>

+    <TD style="background-color:white;width:100%;"> &nbsp; </TD></TR>

+    <TR><TD colspan="<c:out value="${span * 2}"/>"> &nbsp; </TD></TR>

+</TABLE>

+

+<TR><TD>

+    <%-- This could be dynamic.  At this point there's no need --%>

+    <jsp:include page="/WEB-INF/fragments/portlet-page.jsp"/>

+    </TD></TR>

+</TABLE>

+</BODY>

+</HTML>

diff --git a/src/webapp/WEB-INF/pluto-portal-driver-config.xml b/src/webapp/WEB-INF/pluto-portal-driver-config.xml
new file mode 100644
index 0000000..d1c60f4
--- /dev/null
+++ b/src/webapp/WEB-INF/pluto-portal-driver-config.xml
@@ -0,0 +1,69 @@
+<pluto-portal-driver>

+

+    <portal-name>pluto-portal-driver</portal-name>

+    <portal-version>1.0.1</portal-version>

+    <container-name>Pluto Portal Driver</container-name>

+

+    <supports>

+        <portlet-mode>view</portlet-mode>

+        <portlet-mode>edit</portlet-mode>

+        <portlet-mode>help</portlet-mode>

+        <portlet-mode>config</portlet-mode>

+

+        <window-state>normal</window-state>

+        <window-state>maximized</window-state>

+        <window-state>minimized</window-state>

+    </supports>

+

+    <host>

+        <!-- Yuck, Yuck, Yuck -->

+        <name>localhost</name>

+        <http-port>8080</http-port>

+        <https-port></https-port>

+    </host>

+

+    <portlet-app>

+        <context-path>/testsuite</context-path>

+        <portlets>

+            <portlet name="TestPortlet1"/>

+            <portlet name="TestPortlet2"/>

+        </portlets>

+    </portlet-app>

+

+    <render-config default="Test Page">

+        <page name="Test Page" uri="/WEB-INF/fragments/template.jsp">

+            <portlet context="/testsuite" name="TestPortlet1"/>

+            <portlet context="/testsuite" name="TestPortlet2"/>

+        </page>

+        <page name="Secondary Page" uri="/WEB-INF/fragments/template.jsp">

+            <portlet context="/testsuite" name="TestPortlet1"/>

+            <portlet context="/testsuite" name="TestPortlet2"/>

+        </page>

+    </render-config>

+

+    <!--

+      <aggregation>

+        <fragment name="navigation" class="org.apache.pluto.driver.aggregation.navigation.TabNavigation"/>

+        <fragment name="test" type="org.apache.pluto.driver.aggregation.PageFragment">

+            <navigation>

+                <title>Test</title>

+                <description>...</description>

+            </navigation>

+

+            <fragment name="row" type="org.apache.pluto.driver.aggregation.RowFragment">

+                <fragment name="col1" type="org.apache.pluto.driver.aggregation.ColumnFragment">

+                    <fragment name="p1" type="org.apache.pluto.driver.aggregation.PortletFragment">

+                        <property name="app-id" value="primary"/>

+                        <property name="portlet" value="TestPortlet1"/>

+                    </fragment>

+

+                    <fragment name="p2" type="org.apache.pluto.driver.aggregation.PortletFragment">

+                        <property name="app-id" value="secondary"/>

+                        <property name="portlet" value="TestPortlet2"/>

+                    </fragment>

+                </fragment>

+            </fragment>

+        </fragment>

+      </aggregation>

+    -->

+</pluto-portal-driver>
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/tld/pluto.tld b/src/webapp/WEB-INF/tld/pluto.tld
new file mode 100644
index 0000000..92aec8b
--- /dev/null
+++ b/src/webapp/WEB-INF/tld/pluto.tld
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>

+<!DOCTYPE taglib PUBLIC

+  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"

+  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

+<!-- 

+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.

+-->

+<taglib>

+    <tlibversion>1.0</tlibversion>

+    <jspversion>1.1</jspversion>

+    <shortname>pluto</shortname>

+    <uri>http://portals.apache.org/pluto</uri>

+

+    <!-- Insert the rendering of a portlet -->

+    <tag>

+        <name>portlet</name>

+        <tagclass>org.apache.pluto.driver.tags.PortletTag</tagclass>

+        <bodycontent>JSP</bodycontent>

+        <attribute>

+            <name>portletId</name>

+            <required>true</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+    </tag>

+

+    <tag>

+        <name>title</name>

+        <tagclass>org.apache.pluto.driver.tags.PortletTitleTag</tagclass>

+        <bodycontent>empty</bodycontent>

+    </tag>

+

+    <tag>

+        <name>window</name>

+        <tagclass>org.apache.pluto.driver.tags.PortletWindowControlTag</tagclass>

+        <bodycontent>JSP</bodycontent>

+        <attribute>

+            <name>portletMode</name>

+            <required>false</required>

+            <rtexprvalue>false</rtexprvalue>

+        </attribute>

+        <attribute>

+            <name>windowState</name>

+            <required>false</required>

+            <rtexprvalue>false</rtexprvalue>

+        </attribute>

+    </tag>

+

+    <tag>

+        <name>render</name>

+        <tagclass>org.apache.pluto.driver.tags.PortletRenderTag</tagclass>

+        <bodycontent>empty</bodycontent>

+    </tag>

+

+

+</taglib>
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/tld/portlet.tld b/src/webapp/WEB-INF/tld/portlet.tld
new file mode 100644
index 0000000..cb9f0ae
--- /dev/null
+++ b/src/webapp/WEB-INF/tld/portlet.tld
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>

+<!DOCTYPE taglib PUBLIC

+  "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"

+  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

+<!-- 

+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.

+-->

+<taglib>

+    <tlibversion>1.0</tlibversion>

+    <jspversion>1.1</jspversion>

+    <shortname>portlet</shortname>

+    <uri>http://java.sun.com/portlet</uri>

+    <tag>

+        <name>defineObjects</name>

+        <tagclass>org.apache.pluto.tags.DefineObjectsTag</tagclass>

+        <teiclass>org.apache.pluto.tags.DefineObjectsTag$TEI</teiclass>

+        <bodycontent>empty</bodycontent>

+    </tag>

+    <tag>

+        <name>param</name>

+        <tagclass>org.apache.pluto.tags.ParamTag</tagclass>

+        <bodycontent>empty</bodycontent>

+        <attribute>

+            <name>name</name>

+            <required>true</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+        <attribute>

+            <name>value</name>

+            <required>true</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+    </tag>

+    <tag>

+        <name>actionURL</name>

+        <tagclass>org.apache.pluto.tags.ActionURLTag</tagclass>

+        <teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>

+        <bodycontent>JSP</bodycontent>

+        <attribute>

+            <name>windowState</name>

+            <required>false</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+        <attribute>

+            <name>portletMode</name>

+            <required>false</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+        <attribute>

+            <name>secure</name>

+            <required>false</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+        <attribute>

+            <name>var</name>

+            <required>false</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+    </tag>

+    <tag>

+        <name>renderURL</name>

+        <tagclass>org.apache.pluto.tags.RenderURLTag</tagclass>

+        <teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>

+        <bodycontent>JSP</bodycontent>

+        <attribute>

+            <name>windowState</name>

+            <required>false</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+        <attribute>

+            <name>portletMode</name>

+            <required>false</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+        <attribute>

+            <name>secure</name>

+            <required>false</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+        <attribute>

+            <name>var</name>

+            <required>false</required>

+            <rtexprvalue>true</rtexprvalue>

+        </attribute>

+    </tag>

+    <tag>

+        <name>namespace</name>

+        <tagclass>org.apache.pluto.tags.NamespaceTag</tagclass>

+        <bodycontent>empty</bodycontent>

+    </tag>

+</taglib>
\ No newline at end of file
diff --git a/src/webapp/WEB-INF/web.xml b/src/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..52f3160
--- /dev/null
+++ b/src/webapp/WEB-INF/web.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>

+

+<!DOCTYPE web-app

+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

+           "http://java.sun.com/dtd/web-app_2_3.dtd">

+<!-- 

+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.

+-->

+<web-app>

+

+    <display-name>Pluto Reference Implementation</display-name>

+

+    <servlet>

+        <servlet-name>plutoPortalDriver</servlet-name>

+        <display-name>Pluto Portal Driver</display-name>

+        <description>Pluto Portal Driver Controller</description>

+        <servlet-class>org.apache.pluto.driver.PortalDriverServlet</servlet-class>

+        <!-- Uncomment the following to allow for non latin-1 character sets in output. -->

+        <!--

+        <init-param>

+            <param-name>charset</param-name>

+            <param-value>utf-8</param-value>

+        </init-param>

+        -->

+    </servlet>

+

+    <servlet-mapping>

+        <servlet-name>plutoPortalDriver</servlet-name>

+        <url-pattern>/portal/*</url-pattern>

+    </servlet-mapping>

+

+    <listener>

+        <listener-class>org.apache.pluto.driver.PortalStartupListener</listener-class>

+    </listener>

+

+    <security-constraint>

+        <web-resource-collection>

+            <web-resource-name></web-resource-name>

+            <url-pattern>/login_success.jsp</url-pattern>

+            <http-method>GET</http-method>

+            <http-method>POST</http-method>

+            <http-method>PUT</http-method>

+        </web-resource-collection>

+        <auth-constraint>

+            <role-name>tomcat</role-name>

+        </auth-constraint>

+    </security-constraint>

+

+    <login-config>

+        <auth-method>BASIC</auth-method>

+    </login-config>

+

+    <security-role>

+        <role-name>tomcat</role-name>

+    </security-role>

+

+    <taglib>

+        <taglib-uri>http://java.sun.com/portlet</taglib-uri>

+        <taglib-location>/WEB-INF/tld/portlet.tld</taglib-location>

+    </taglib>

+

+    <taglib>

+        <taglib-uri>http://portals.apache.org/pluto</taglib-uri>

+        <taglib-location>/WEB-INF/tld/pluto.tld</taglib-location>

+    </taglib>

+

+</web-app>

+

diff --git a/src/webapp/images/pluto.png b/src/webapp/images/pluto.png
new file mode 100644
index 0000000..c2a1c80
--- /dev/null
+++ b/src/webapp/images/pluto.png
Binary files differ
diff --git a/src/webapp/login_success.jsp b/src/webapp/login_success.jsp
new file mode 100644
index 0000000..ce6cf40
--- /dev/null
+++ b/src/webapp/login_success.jsp
@@ -0,0 +1,6 @@
+<HTML>

+<HEAD><TITLE>Login Successful</TITLE></HEAD>

+<BODY>

+Login Successfull. <a href="<%=request.getContextPath()%>/portal/test"> Click here to return to the portal tests.</A>

+</BODY>

+</HTML>
\ No newline at end of file
diff --git a/src/webapp/pluto_style.css b/src/webapp/pluto_style.css
new file mode 100644
index 0000000..35e4bc9
--- /dev/null
+++ b/src/webapp/pluto_style.css
@@ -0,0 +1,48 @@
+BODY, P, TH, TD {

+    font-family: arial, helvetica, sans-serif;

+    text-align: left;

+}

+

+.BODY, .P, .TD {

+    font-size: 12px;

+}

+

+TABLE {

+    width: 100%;

+    padding: 2px 3px;

+    border-collapse:collapse;

+    border-spacing: 3px 3px;

+}

+

+

+.banner, .banner TD, .banner A:link, .banner A:visited, .banner A:hover {

+    background-color: #DDDDDD;

+    color: #36a;

+}

+

+.banner-highlight, .banner-highlight TD {

+    background-color: #003366;

+    color: #ffffff;

+    height: 2px;

+}

+

+.tab TD, .tab A:link, .tab A:visited, .tab A:hover {

+    background-color: #DDDDDD;

+    color: #36a;

+}

+

+.tab-selected, .tab-selected TD, .tab-selected A:link, .tab-selected A:visited, .tab-selected A:hover {

+    background-color: #003366;

+    color: ffffff#;

+}

+

+TABLE.portlet {

+    border-collapse: seperated;

+    border-width: 2px;

+    border-color: #DDDDDD;

+}

+

+.small {

+    font-size: -1;

+}

+

diff --git a/src/webapp/test_session.jsp b/src/webapp/test_session.jsp
new file mode 100644
index 0000000..27f34d2
--- /dev/null
+++ b/src/webapp/test_session.jsp
@@ -0,0 +1,4 @@
+<%

+    RequestDispatcher rd = application.getContext("/testsuite").getRequestDispatcher("/test_session.jsp");

+    rd.forward(request, response);

+%>
\ No newline at end of file