You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ms...@apache.org on 2015/01/27 09:01:48 UTC
[04/19] portals-pluto git commit: More progress towards a PRP mapping
service. Initial implementation of PRP mapper based on QName. Propagated all
necessary data up to the URL generation code. Started work on URL parser /
generator to take PRP mapping in
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/505393c3/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java
index 29b3a49..5b6927f 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapper.java
@@ -16,142 +16,30 @@
* under the License.
*/
-
package org.apache.pluto.driver.services.portal;
-import static java.util.logging.Level.*;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.xml.namespace.QName;
-
import org.apache.pluto.driver.url.PortalURLPublicParameter;
-import org.apache.pluto.container.driver.PortletRegistryService;
-import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
-import org.apache.pluto.container.om.portlet.PortletDefinition;
-import org.apache.pluto.container.om.portlet.PublicRenderParameter;
/**
- * Provides public render parameter mappings for a given page.
- * This mapper maps public render paraaameters on the basis of Qnames.
- * If two PRPs have the same QName, they are considered to refer to the same
- * public render parameter. The mapping is limited to the current page.
+ * Interface for the public render parameter mapper.
*
* @author msnicklous
* @since 16/01/2015
*/
-public class PublicRenderParameterMapper {
- private final Logger LOGGER = LoggerFactory.getLogger(PublicRenderParameterMapper.class);
-
- // Maps the portlet window ID to a set of public render parameters
- private final Map<String, Set<PortalURLPublicParameter>> wid2PRP =
- new HashMap<String, Set<PortalURLPublicParameter>>();
+public interface PublicRenderParameterMapper {
+
+ /**
+ * Returns the set of public render parameters matching the input public render parameter.
+ * The returned set will include the input PRP (providing that it is used on the page at all).
+ *
+ * @param prp The public render parameter to be matched
+ * @return Set containing all matching PRPs
+ */
+ public Set<PortalURLPublicParameter> getMappedPublicParameters(PortalURLPublicParameter prp);
+
+ // scafolding function - to be thrown away then the URL generation is complete.
+ public Set<PortalURLPublicParameter> getPRPsForId(String id, String[] vals);
- // Maps the PRP QName to a set of public render parameters
- private final Map<QName, Set<PortalURLPublicParameter>> qn2PRP =
- new HashMap<QName, Set<PortalURLPublicParameter>>();
-
- public PublicRenderParameterMapper(PageConfig paco, PortletRegistryService pore) {
-
- Collection<String> pids = paco.getPortletIds();
- LOGGER.debug("Setting up the PRP mapper. There are " + pids.size() + " portlets to process.");
-
- StringBuilder dbgstr = new StringBuilder(1024);
- boolean isDebug = LOGGER.isDebugEnabled();
- for (String pid : pids) {
- if (isDebug) {
- dbgstr.append("\n Processing portlet id = " + pid);
- }
-
- PortletWindowConfig pwc = null;
- PortletApplicationDefinition pad = null;
- PortletDefinition pd = null;
-
- pwc = PortletWindowConfig.fromId(pid);
- String cxtpa = pwc.getContextPath();
- String portletName = pwc.getPortletName();
-
- try {
- pad = pore.getPortletApplication(cxtpa);
- pd = pore.getPortlet(cxtpa, portletName);
-
- if (isDebug) {
- dbgstr.append("\n For context: " + cxtpa + ", App name is "
- + pad.getName() + ", portlet name is " + pd.getPortletName());
- }
-
- Collection<String> prpIds = pd.getSupportedPublicRenderParameters();
- if (prpIds != null && prpIds.size() > 0) {
- Collection<? extends PublicRenderParameter> prpDefs = pad.getPublicRenderParameters();
- String namespace = pad.getDefaultNamespace();
- for (String prpId : prpIds) {
- Iterator<? extends PublicRenderParameter> i = prpDefs.iterator();
- QName qn = null;
- while (qn == null && i.hasNext()) {
- PublicRenderParameter prpDef = i.next();
- if (prpDef.getIdentifier().equals(prpId)) {
- qn = prpDef.getQName();
- if (qn == null) {
- // If qname is null, build a qnamme from the name & namespace fields
- String name = prpDef.getName();
- if (name == null) {
- LOGGER.error("Problem with PRP definition: Both QName and Nqme are null.");
- } else {
- qn = new QName(namespace, name);
- }
- }
- }
- }
- if (qn == null) {
- LOGGER.error("Problem with PRP definition: Both QName could not be obtained.");
- } else {
- PortalURLPublicParameter pupp = new PortalURLPublicParameter(pid, prpId, qn);
-
- // Add PRP to the window ID to PRP mapping
- if (wid2PRP.containsKey(pid)) {
- wid2PRP.get(pid).add(pupp);
- } else {
- Set<PortalURLPublicParameter> s = new HashSet<PortalURLPublicParameter>();
- s.add(pupp);
- wid2PRP.put(pid, s);
- }
-
- // Add PRP to the QName to PRP mapping
- if (qn2PRP.containsKey(qn)) {
- qn2PRP.get(qn).add(pupp);
- } else {
- Set<PortalURLPublicParameter> s = new HashSet<PortalURLPublicParameter>();
- s.add(pupp);
- qn2PRP.put(qn, s);
- }
-
- if (isDebug) {
- dbgstr.append("\n Added mapping for QName = " + qn.toString()
- + ", ID = " + prpId);
- }
- }
- }
- }
-
- } catch (Exception e) {
- if (pad == null) {
- LOGGER.error("Could not get portlet app for: " + cxtpa);
- } else {
- LOGGER.error("Could not get portlet definition for: " + portletName);
- }
- }
- }
- if (isDebug) {
- LOGGER.debug(dbgstr.toString());
- }
- }
-
}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/505393c3/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapperImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapperImpl.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapperImpl.java
new file mode 100644
index 0000000..3f3025b
--- /dev/null
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterMapperImpl.java
@@ -0,0 +1,175 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.portal;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.xml.namespace.QName;
+
+import org.apache.pluto.driver.url.PortalURLPublicParameter;
+import org.apache.pluto.container.driver.PortletRegistryService;
+import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
+import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+
+/**
+ * Provides public render parameter mappings for a given page.
+ * This mapper maps public render parameters on the basis of Qnames.
+ * If two PRPs have the same QName, they are considered to refer to the same
+ * public render parameter. The mapping is limited to the current page.
+ *
+ * @author msnicklous
+ * @since 16/01/2015
+ */
+public class PublicRenderParameterMapperImpl implements PublicRenderParameterMapper {
+ private final Logger LOGGER = LoggerFactory.getLogger(PublicRenderParameterMapperImpl.class);
+
+ // Set of all public render parameters on the page
+ Set<PortalURLPublicParameter> prps = new HashSet<PortalURLPublicParameter>();
+
+ public PublicRenderParameterMapperImpl(PageConfig paco, PortletRegistryService pore) {
+
+ Collection<String> pids = paco.getPortletIds();
+ LOGGER.debug("Setting up the PRP mapper. There are " + pids.size() + " portlets to process.");
+
+ StringBuilder dbgstr = new StringBuilder(1024);
+ boolean isDebug = LOGGER.isDebugEnabled();
+ for (String pid : pids) {
+ if (isDebug) {
+ dbgstr.append("\n Processing portlet id = " + pid);
+ }
+
+ PortletWindowConfig pwc = null;
+ PortletApplicationDefinition pad = null;
+ PortletDefinition pd = null;
+
+ pwc = PortletWindowConfig.fromId(pid);
+ String cxtpa = pwc.getContextPath();
+ String portletName = pwc.getPortletName();
+
+ try {
+ pad = pore.getPortletApplication(cxtpa);
+ pd = pore.getPortlet(cxtpa, portletName);
+
+ if (isDebug) {
+ dbgstr.append("\n For context: " + cxtpa + ", App name is "
+ + pad.getName() + ", portlet name is " + pd.getPortletName());
+ }
+
+ Collection<String> prpIds = pd.getSupportedPublicRenderParameters();
+ if (prpIds != null && prpIds.size() > 0) {
+ Collection<? extends PublicRenderParameter> prpDefs = pad.getPublicRenderParameters();
+ String namespace = pad.getDefaultNamespace();
+ for (String prpId : prpIds) {
+ Iterator<? extends PublicRenderParameter> i = prpDefs.iterator();
+ QName qn = null;
+ while (qn == null && i.hasNext()) {
+ PublicRenderParameter prpDef = i.next();
+ if (prpDef.getIdentifier().equals(prpId)) {
+ qn = prpDef.getQName();
+ if (qn == null) {
+ // If qname is null, build a qnamme from the name & namespace fields
+ String name = prpDef.getName();
+ if (name == null) {
+ LOGGER.error("Problem with PRP definition: Both QName and Nqme are null.");
+ } else {
+ qn = new QName(namespace, name);
+ }
+ }
+ }
+ }
+ if (qn == null) {
+ LOGGER.error("Problem with PRP definition: Both QName could not be obtained.");
+ } else {
+ PortalURLPublicParameter pupp = new PortalURLPublicParameter(pid, prpId, qn);
+
+ prps.add(pupp);
+
+ if (isDebug) {
+ dbgstr.append("\n Added PRP for window = " + pid + " QName = " + qn.toString()
+ + ", ID = " + prpId);
+ }
+ }
+ }
+ }
+
+ } catch (Exception e) {
+ if (pad == null) {
+ LOGGER.error("Could not get portlet app for: " + cxtpa);
+ } else {
+ LOGGER.error("Could not get portlet definition for: " + portletName);
+ }
+ }
+ }
+ if (isDebug) {
+ LOGGER.debug(dbgstr.toString());
+ }
+ }
+
+ /**
+ * Returns set of related PRPs for the input PRP. The mapping is done on the basis of the QName.
+ * The value arrays of all PRPs in the returned set are set to the value array in the input PRP.
+ */
+ public Set<PortalURLPublicParameter> getMappedPublicParameters(PortalURLPublicParameter prp) {
+ Set<PortalURLPublicParameter> oprps = new HashSet<PortalURLPublicParameter>();
+ for (PortalURLPublicParameter ip : prps) {
+ if (ip.getQName().equals(prp.getQName())) {
+ PortalURLPublicParameter p = ip.clone();
+ p.setValues(prp.getValues().clone());
+ oprps.add(p);
+ }
+ }
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("getMappedPublicParameters - Returning " + oprps.size() + " for window = " + prp.getWindowId()
+ + " QName = " + prp.getQName().toString() + ", ID = " + prp.getName());
+ }
+ return oprps;
+ }
+
+ /**
+ * Returns the set of all PRPs with the same parameter names (IDs).
+ * Scaffolding code to be thrown away when the URL gen code is complete.
+ *
+ * @param id
+ * @param vals
+ * @return
+ */
+ public Set<PortalURLPublicParameter> getPRPsForId(String id, String[] vals) {
+ Set<PortalURLPublicParameter> oprps = new HashSet<PortalURLPublicParameter>();
+ for (PortalURLPublicParameter ip : prps) {
+ if (ip.getName().equals(id)) {
+ PortalURLPublicParameter p = ip.clone();
+ p.setValues(vals.clone());
+ oprps.add(p);
+ }
+ }
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("getPRPsForId - Returning " + oprps.size() + " for ID = " + id);
+ }
+ return oprps;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/505393c3/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterService.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterService.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterService.java
index 3ad2fd4..3dd10bf 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterService.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/PublicRenderParameterService.java
@@ -36,5 +36,5 @@ public interface PublicRenderParameterService {
* @param page Page name
* @return A PRP mapper for the page
*/
- public PublicRenderParameterMapper getPRPMapper(String page);
+ public PublicRenderParameterMapperImpl getPRPMapper(String page);
}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/505393c3/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
index de5e0d6..7ed34d3 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURL.java
@@ -18,12 +18,14 @@ package org.apache.pluto.driver.url;
import java.util.Collection;
import java.util.Map;
+import java.util.Set;
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
import javax.servlet.ServletContext;
import org.apache.pluto.driver.services.portal.PageConfig;
+import org.apache.pluto.driver.services.portal.PublicRenderParameterMapper;
/**
* Created by IntelliJ IDEA.
@@ -40,6 +42,25 @@ public interface PortalURL extends Cloneable {
void addParameter(PortalURLParameter param);
void addPublicRenderParametersNew(Map<String, String[]> parameters);
+
+ /**
+ * Adds a new public render parameter.
+ *
+ * @param pup
+ */
+ void addPublicRenderParameter(PortalURLPublicParameter pup);
+
+ /**
+ * Add the PRP mapper for the page being processed
+ * @param prpm
+ */
+ void setPublicRenderParameterMapper(PublicRenderParameterMapper prpm);
+
+ /**
+ * get the PRP mapper for the page being processed
+ * @return
+ */
+ PublicRenderParameterMapper getPublicRenderParameterMapper();
Collection<PortalURLParameter> getParameters();
@@ -98,8 +119,6 @@ public interface PortalURL extends Cloneable {
void setResourceWindow(String window);
PageConfig getPageConfig(ServletContext servletContext);
-
- void addPublicParameterActionResourceParameter(String parameterName, String value);
void setCacheability(String cacheLevel);
String getCacheability();
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/505393c3/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLParameter.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLParameter.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLParameter.java
index 5f7a655..af59c2e 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLParameter.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLParameter.java
@@ -26,9 +26,9 @@ package org.apache.pluto.driver.url;
public class PortalURLParameter {
- private String window;
- private String name;
- private String[] values;
+ protected final String window;
+ protected final String name;
+ protected String[] values;
public PortalURLParameter(String window, String name) {
this.window = window;
@@ -52,10 +52,6 @@ public class PortalURLParameter {
return name;
}
- public void setName(String name) {
- this.name = name;
- }
-
public String[] getValues() {
return values;
}
@@ -67,9 +63,59 @@ public class PortalURLParameter {
public String getWindowId() {
return window;
}
-
- public void setWindowId(String window) {
- this.window = window;
+
+ @Override
+ public PortalURLParameter clone() {
+ // shallow clone works because strings are immutable
+ return new PortalURLParameter(window, name, (values == null ? values : values.clone()));
+ }
+
+ /**
+ * For this class, "equals" means "refers to the same parameter". The parameter name & window
+ * are compared, the values are NOT compared. The combination of window ID and parameter name
+ * must always be unique when the objects are used in collections.
+ */
+ @Override
+ public boolean equals(Object o) {
+ boolean eq = false;
+ if (o instanceof PortalURLParameter) {
+ if (o == this) {
+ eq = true;
+ } else {
+ PortalURLParameter pup = (PortalURLParameter) o;
+ if (equals(window, pup.window)) {
+ if (equals(name, pup.name)) {
+ eq = true;
+ }
+ }
+ }
+ }
+ return eq;
+ }
+
+ @Override
+ public int hashCode() {
+ int hc = 17;
+ if (window != null) {
+ hc += 37*hc + window.hashCode();
+ }
+ if (name != null) {
+ hc += 37*hc + name.hashCode();
+ }
+ return hc;
+ }
+
+ /**
+ * helper function for comparison.
+ */
+ protected boolean equals(Object o1, Object o2) {
+ boolean eq = false;
+ if (o1 == o2) {
+ eq = true;
+ } else if (o1 != null && o2 != null) {
+ eq = o1.equals(o2);
+ }
+ return eq;
}
}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/505393c3/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLPublicParameter.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLPublicParameter.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLPublicParameter.java
index c129249..d90f92d 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLPublicParameter.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/url/PortalURLPublicParameter.java
@@ -28,7 +28,10 @@ import javax.xml.namespace.QName;
*/
public class PortalURLPublicParameter extends PortalURLParameter {
- private QName qname;
+ private final QName qname;
+
+ // mark if this PRP is to be removed from the current set
+ private boolean removed = false;
/**
* Constructor when no value is available
@@ -65,12 +68,42 @@ public class PortalURLPublicParameter extends PortalURLParameter {
this.qname = qname;
}
+ /**
+ * Returns the Qname
+ * @return QName
+ */
public QName getQName() {
return qname;
}
- public void setQName(QName qname) {
- this.qname = qname;
+ /**
+ * Provides the information that the public render parameter designated by this object is to be
+ * removed from the current set.
+ *
+ * @param removed marks whether the PR is to be removed
+ */
+ public void setRemoved(boolean removed) {
+ this.removed = removed;
}
-
+
+ /**
+ * Tests whether the PRP has been removed
+ * @return
+ */
+ public boolean isRemoved() {
+ return removed;
+ }
+
+ /**
+ * Returns a clone of the parameter
+ */
+ @Override
+ public PortalURLPublicParameter clone() {
+ // shallow clone of the values array works because strings are immutable
+ QName qn = new QName(qname.getNamespaceURI(), qname.getLocalPart(), qname.getPrefix());
+ PortalURLPublicParameter pupp = new PortalURLPublicParameter(window, name, qn, (values == null ? values : values.clone()));
+ pupp.setRemoved(removed);
+ return pupp;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/505393c3/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml b/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml
index 9cc1117..2a3168f 100644
--- a/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml
+++ b/pluto-testsuite/src/main/webapp/WEB-INF/portlet.xml
@@ -1,324 +1,325 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You 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.
--->
-<!-- FIXME: schema location points to temp location of portlet spec -->
-<portlet-app
- xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
- version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
- http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
-
- <!-- Test Portlet #1 ===================================================== -->
-
- <portlet>
-
- <description>TestSuiteDescription</description>
- <portlet-name>TestPortlet1</portlet-name>
- <display-name>Test Portlet #1</display-name>
- <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
-
- <init-param>
- <name>config</name>
- <value>/WEB-INF/testsuite-config.xml</value>
- </init-param>
- <init-param>
- <name>dummyName</name>
- <value>dummyValue</value>
- </init-param>
-
- <expiration-cache>-1</expiration-cache>
-
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
-
- <supported-locale>en</supported-locale>
- <supported-locale>de</supported-locale>
-
- <portlet-info>
- <title>Test Portlet #1</title>
- <short-title>Test #1</short-title>
- <keywords>Test,Testing</keywords>
- </portlet-info>
-
- <portlet-preferences>
- <preference>
- <name>dummyName</name>
- <value>dummyValue</value>
- <read-only>false</read-only>
- </preference>
- <preference>
- <name>dummyName2</name>
- <value>dummyValue2</value>
- </preference>
- <preference>
- <name>readonly</name>
- <value>readonly</value>
- <read-only>true</read-only>
- </preference>
- <preference>
- <name>nameWithNoValue</name>
- </preference>
- <preferences-validator>org.apache.pluto.testsuite.validator.PreferencesValidatorImpl</preferences-validator>
- </portlet-preferences>
-
- <security-role-ref>
- <role-name>plutoTestRole</role-name>
- <role-link>tomcat</role-link>
- </security-role-ref>
-
- </portlet>
-
-
-
- <!-- Test Portlet #2 ===================================================== -->
-
- <portlet>
-
- <description>TestSuiteDescription</description>
- <portlet-name>TestPortlet2</portlet-name>
- <display-name>Test Portlet #2</display-name>
- <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
-
- <init-param>
- <name>config</name>
- <value>/WEB-INF/testsuite-2-config.xml</value>
- </init-param>
- <init-param>
- <name>dummyName</name>
- <value>dummyValue</value>
- </init-param>
-
- <expiration-cache>-1</expiration-cache>
-
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
-
- <supported-locale>en</supported-locale>
- <supported-locale>de</supported-locale>
- <resource-bundle>TestPortlet</resource-bundle>
-
- <portlet-preferences >
- <preference>
- <name>dummyName</name>
- <value>dummyValue</value>
- <read-only>false</read-only>
- </preference>
- <preference>
- <name>dummyName2</name>
- <value>dummyValue2</value>
- </preference>
- <preference>
- <name>readonly</name>
- <value>readonly</value>
- <read-only>true</read-only>
- </preference>
- <preference>
- <name>nameWithNoValue</name>
- </preference>
- <preferences-validator>org.apache.pluto.testsuite.validator.PreferencesValidatorImpl2</preferences-validator>
- </portlet-preferences>
-
- <security-role-ref>
- <role-name>plutoTestRole</role-name>
- <role-link>tomcat</role-link>
- </security-role-ref>
-
- </portlet>
-
- <!-- JSR 286 Compatibility Test Portlet -->
-
- <portlet>
-
- <description>JSR 286 Compatibility Tests</description>
- <portlet-name>286TestPortlet</portlet-name>
- <display-name>JSR 286 Test Portlet</display-name>
- <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
-
- <init-param>
- <name>config</name>
- <value>/WEB-INF/testsuite-286-config.xml</value>
- </init-param>
-
- <expiration-cache>-1</expiration-cache>
-
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- <portlet-mode>EDIT</portlet-mode>
- <portlet-mode>HELP</portlet-mode>
- </supports>
-
- <portlet-info>
- <title>286 Test Portlet</title>
- <short-title>286 Tests</short-title>
- <keywords>JSR 286,Tests</keywords>
- </portlet-info>
-
- <supported-processing-event>
- <name>trigger-event-phase</name>
- </supported-processing-event>
-
- <supported-processing-event>
- <name>event-with-complex-value</name>
- </supported-processing-event>
-
- <supported-processing-event>
- <name>event-with-simple-value</name>
- </supported-processing-event>
-
- <supported-publishing-event>
- <name>trigger-event-phase</name>
- </supported-publishing-event>
-
- <supported-publishing-event>
- <name>event-with-simple-value</name>
- </supported-publishing-event>
-
- <supported-publishing-event>
- <name>event-with-complex-value</name>
- </supported-publishing-event>
-
- <supported-publishing-event>
- <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
- </supported-publishing-event>
-
- <supported-public-render-parameter>public-render-param1</supported-public-render-parameter>
-
- </portlet>
-
- <portlet>
-
- <description>JSR 286 Test Portlet Companion</description>
- <portlet-name>286TestCompanionPortlet</portlet-name>
- <portlet-class>
- org.apache.pluto.testsuite.test.jsr286.TestCompanionPortlet
- </portlet-class>
-
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- </supports>
-
- <portlet-info>
- <title>286 Test Portlet Companion</title>
- <short-title>286 Test Companion</short-title>
- <keywords>JSR 286,Tests</keywords>
- </portlet-info>
-
- <supported-processing-event>
- <name>event-with-simple-value</name>
- </supported-processing-event>
-
- <supported-processing-event>
- <name>event-with-complex-value</name>
- </supported-processing-event>
-
- <supported-processing-event>
- <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
- </supported-processing-event>
-
- <supported-public-render-parameter>public-render-param1</supported-public-render-parameter>
-
- </portlet>
-
- <filter>
-
- <description>
- This filter should be applied both the JSR 286
- test portlet as well as its helper portlet.
- </description>
-
- <display-name>Wildcard Mapped Filter</display-name>
-
- <filter-name>WildcardMappedFilter</filter-name>
- <filter-class>org.apache.pluto.testsuite.test.jsr286.filter.WildcardMappedFilter</filter-class>
-
- <lifecycle>ACTION_PHASE</lifecycle>
- <lifecycle>RENDER_PHASE</lifecycle>
- <lifecycle>EVENT_PHASE</lifecycle>
- <lifecycle>RESOURCE_PHASE</lifecycle>
-
- </filter>
-
- <filter>
-
- <description>
- This filter implements portlet filter methods for all four
- lifecycle phases and is used in the various portlet filter tests.
- </description>
-
- <display-name>Test Portlet Filter</display-name>
-
- <filter-name>TestFilter</filter-name>
- <filter-class>org.apache.pluto.testsuite.test.jsr286.filter.TestFilter</filter-class>
-
- <lifecycle>ACTION_PHASE</lifecycle>
- <lifecycle>RENDER_PHASE</lifecycle>
- <lifecycle>EVENT_PHASE</lifecycle>
- <lifecycle>RESOURCE_PHASE</lifecycle>
-
- </filter>
-
- <filter-mapping>
- <filter-name>WildcardMappedFilter</filter-name>
- <portlet-name>286*</portlet-name>
- </filter-mapping>
-
- <filter-mapping>
- <filter-name>TestFilter</filter-name>
- <portlet-name>286TestPortlet</portlet-name>
- </filter-mapping>
-
- <!-- JSR 286 Portlet Coordination Definitions -->
-
- <default-namespace>http://portals.apache.org/pluto/testsuite</default-namespace>
-
- <event-definition>
- <name>trigger-event-phase</name>
- <value-type>java.lang.String</value-type>
- </event-definition>
-
- <event-definition>
- <name>event-with-simple-value</name>
- <value-type>java.lang.String</value-type>
- </event-definition>
-
- <event-definition>
- <name>event-with-complex-value</name>
- <value-type>org.apache.pluto.testsuite.test.jsr286.event.ComposedObject</value-type>
- </event-definition>
-
- <event-definition>
- <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
- <value-type>java.lang.Integer</value-type>
- </event-definition>
-
- <public-render-parameter>
- <identifier>public-render-param1</identifier>
- </public-render-parameter>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You 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.
+-->
+<!-- FIXME: schema location points to temp location of portlet spec -->
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
+ http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
+
+ <!-- Test Portlet #1 ===================================================== -->
+
+ <portlet>
+
+ <description>TestSuiteDescription</description>
+ <portlet-name>TestPortlet1</portlet-name>
+ <display-name>Test Portlet #1</display-name>
+ <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
+
+ <init-param>
+ <name>config</name>
+ <value>/WEB-INF/testsuite-config.xml</value>
+ </init-param>
+ <init-param>
+ <name>dummyName</name>
+ <value>dummyValue</value>
+ </init-param>
+
+ <expiration-cache>-1</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+
+ <supported-locale>en</supported-locale>
+ <supported-locale>de</supported-locale>
+
+ <portlet-info>
+ <title>Test Portlet #1</title>
+ <short-title>Test #1</short-title>
+ <keywords>Test,Testing</keywords>
+ </portlet-info>
+
+ <portlet-preferences>
+ <preference>
+ <name>dummyName</name>
+ <value>dummyValue</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>dummyName2</name>
+ <value>dummyValue2</value>
+ </preference>
+ <preference>
+ <name>readonly</name>
+ <value>readonly</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>nameWithNoValue</name>
+ </preference>
+ <preferences-validator>org.apache.pluto.testsuite.validator.PreferencesValidatorImpl</preferences-validator>
+ </portlet-preferences>
+
+ <security-role-ref>
+ <role-name>plutoTestRole</role-name>
+ <role-link>tomcat</role-link>
+ </security-role-ref>
+
+ </portlet>
+
+
+
+ <!-- Test Portlet #2 ===================================================== -->
+
+ <portlet>
+
+ <description>TestSuiteDescription</description>
+ <portlet-name>TestPortlet2</portlet-name>
+ <display-name>Test Portlet #2</display-name>
+ <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
+
+ <init-param>
+ <name>config</name>
+ <value>/WEB-INF/testsuite-2-config.xml</value>
+ </init-param>
+ <init-param>
+ <name>dummyName</name>
+ <value>dummyValue</value>
+ </init-param>
+
+ <expiration-cache>-1</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+
+ <supported-locale>en</supported-locale>
+ <supported-locale>de</supported-locale>
+ <resource-bundle>TestPortlet</resource-bundle>
+
+ <portlet-preferences >
+ <preference>
+ <name>dummyName</name>
+ <value>dummyValue</value>
+ <read-only>false</read-only>
+ </preference>
+ <preference>
+ <name>dummyName2</name>
+ <value>dummyValue2</value>
+ </preference>
+ <preference>
+ <name>readonly</name>
+ <value>readonly</value>
+ <read-only>true</read-only>
+ </preference>
+ <preference>
+ <name>nameWithNoValue</name>
+ </preference>
+ <preferences-validator>org.apache.pluto.testsuite.validator.PreferencesValidatorImpl2</preferences-validator>
+ </portlet-preferences>
+
+ <security-role-ref>
+ <role-name>plutoTestRole</role-name>
+ <role-link>tomcat</role-link>
+ </security-role-ref>
+
+ </portlet>
+
+ <!-- JSR 286 Compatibility Test Portlet -->
+
+ <portlet>
+
+ <description>JSR 286 Compatibility Tests</description>
+ <portlet-name>286TestPortlet</portlet-name>
+ <display-name>JSR 286 Test Portlet</display-name>
+ <portlet-class>org.apache.pluto.testsuite.TestPortlet</portlet-class>
+
+ <init-param>
+ <name>config</name>
+ <value>/WEB-INF/testsuite-286-config.xml</value>
+ </init-param>
+
+ <expiration-cache>-1</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+
+ <portlet-info>
+ <title>286 Test Portlet</title>
+ <short-title>286 Tests</short-title>
+ <keywords>JSR 286,Tests</keywords>
+ </portlet-info>
+
+ <supported-processing-event>
+ <name>trigger-event-phase</name>
+ </supported-processing-event>
+
+ <supported-processing-event>
+ <name>event-with-complex-value</name>
+ </supported-processing-event>
+
+ <supported-processing-event>
+ <name>event-with-simple-value</name>
+ </supported-processing-event>
+
+ <supported-publishing-event>
+ <name>trigger-event-phase</name>
+ </supported-publishing-event>
+
+ <supported-publishing-event>
+ <name>event-with-simple-value</name>
+ </supported-publishing-event>
+
+ <supported-publishing-event>
+ <name>event-with-complex-value</name>
+ </supported-publishing-event>
+
+ <supported-publishing-event>
+ <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
+ </supported-publishing-event>
+
+ <supported-public-render-parameter>public-render-param1</supported-public-render-parameter>
+
+ </portlet>
+
+ <portlet>
+
+ <description>JSR 286 Test Portlet Companion</description>
+ <portlet-name>286TestCompanionPortlet</portlet-name>
+ <portlet-class>
+ org.apache.pluto.testsuite.test.jsr286.TestCompanionPortlet
+ </portlet-class>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+
+ <portlet-info>
+ <title>286 Test Portlet Companion</title>
+ <short-title>286 Test Companion</short-title>
+ <keywords>JSR 286,Tests</keywords>
+ </portlet-info>
+
+ <supported-processing-event>
+ <name>event-with-simple-value</name>
+ </supported-processing-event>
+
+ <supported-processing-event>
+ <name>event-with-complex-value</name>
+ </supported-processing-event>
+
+ <supported-processing-event>
+ <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
+ </supported-processing-event>
+
+ <supported-public-render-parameter>public-render-param1</supported-public-render-parameter>
+
+ </portlet>
+
+ <filter>
+
+ <description>
+ This filter should be applied both the JSR 286
+ test portlet as well as its helper portlet.
+ </description>
+
+ <display-name>Wildcard Mapped Filter</display-name>
+
+ <filter-name>WildcardMappedFilter</filter-name>
+ <filter-class>org.apache.pluto.testsuite.test.jsr286.filter.WildcardMappedFilter</filter-class>
+
+ <lifecycle>ACTION_PHASE</lifecycle>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ <lifecycle>EVENT_PHASE</lifecycle>
+ <lifecycle>RESOURCE_PHASE</lifecycle>
+
+ </filter>
+
+ <filter>
+
+ <description>
+ This filter implements portlet filter methods for all four
+ lifecycle phases and is used in the various portlet filter tests.
+ </description>
+
+ <display-name>Test Portlet Filter</display-name>
+
+ <filter-name>TestFilter</filter-name>
+ <filter-class>org.apache.pluto.testsuite.test.jsr286.filter.TestFilter</filter-class>
+
+ <lifecycle>ACTION_PHASE</lifecycle>
+ <lifecycle>RENDER_PHASE</lifecycle>
+ <lifecycle>EVENT_PHASE</lifecycle>
+ <lifecycle>RESOURCE_PHASE</lifecycle>
+
+ </filter>
+
+ <filter-mapping>
+ <filter-name>WildcardMappedFilter</filter-name>
+ <portlet-name>286*</portlet-name>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>TestFilter</filter-name>
+ <portlet-name>286TestPortlet</portlet-name>
+ </filter-mapping>
+
+ <!-- JSR 286 Portlet Coordination Definitions -->
+
+ <default-namespace>http://portals.apache.org/pluto/testsuite</default-namespace>
+
+ <event-definition>
+ <name>trigger-event-phase</name>
+ <value-type>java.lang.String</value-type>
+ </event-definition>
+
+ <event-definition>
+ <name>event-with-simple-value</name>
+ <value-type>java.lang.String</value-type>
+ </event-definition>
+
+ <event-definition>
+ <name>event-with-complex-value</name>
+ <value-type>org.apache.pluto.testsuite.test.jsr286.event.ComposedObject</value-type>
+ </event-definition>
+
+ <event-definition>
+ <qname xmlns:pluto="http://portals.apache.org/pluto/altns">event-with-qname</qname>
+ <value-type>java.lang.Integer</value-type>
+ </event-definition>
+
+ <public-render-parameter>
+ <identifier>public-render-param1</identifier>
+ <qname xmlns:pluto="http://portals.apache.org/pluto/altns">public-render-param1</qname>
+ </public-render-parameter>
+
</portlet-app>
\ No newline at end of file