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/02/02 11:35:36 UTC
[8/8] portals-pluto git commit: * Removed unnecessary includes from
PortletHubDemo portlets * Implemented new version 3.0 methods: -
PortletConfig#getPublicRenderParameterDefinitions() -
PortletConfig#getWindowStates(String mimeType) - PortletConfi
* Removed unnecessary includes from PortletHubDemo portlets
* Implemented new version 3.0 methods:
- PortletConfig#getPublicRenderParameterDefinitions()
- PortletConfig#getWindowStates(String mimeType)
- PortletConfig#getPortletModes(String mimeType)
* Implemented portlets to display V3 PortletConfig info in PortletV3Demo
portlet application
* Cleaned up SupportedModesServiceImpl.java so that it uses interfaces
rather than directly using the CustomPortletModesType.java APIs
Project: http://git-wip-us.apache.org/repos/asf/portals-pluto/repo
Commit: http://git-wip-us.apache.org/repos/asf/portals-pluto/commit/6f30042b
Tree: http://git-wip-us.apache.org/repos/asf/portals-pluto/tree/6f30042b
Diff: http://git-wip-us.apache.org/repos/asf/portals-pluto/diff/6f30042b
Branch: refs/heads/V3Prototype
Commit: 6f30042b0f4a5148f9b862286062cd5850660c17
Parents: a4e54d4
Author: Scott Nicklous <ms...@apache.org>
Authored: Mon Feb 2 11:25:01 2015 +0100
Committer: Scott Nicklous <ms...@apache.org>
Committed: Mon Feb 2 11:25:01 2015 +0100
----------------------------------------------------------------------
.../java/basic/portlet/ColorSelPortlet.java | 2 -
.../java/basic/portlet/MessageBoxPortlet.java | 2 -
.../basic/portlet/PartialActionPortlet.java | 4 -
.../java/basic/portlet/ColorSelPortlet.java | 2 -
.../src/main/java/basic/portlet/Constants.java | 5 +
.../java/basic/portlet/MessageBoxPortlet.java | 2 -
.../basic/portlet/PartialActionPortlet.java | 114 ---------------
.../basic/portlet/PortletConfigPortlet.java | 139 +++++++++++++++++++
.../src/main/webapp/WEB-INF/jsp/view-pap.jsp | 108 --------------
.../src/main/webapp/WEB-INF/jsp/view-pcp.jsp | 55 ++++++++
.../src/main/webapp/WEB-INF/portlet.xml | 72 +++++++++-
.../resource/SupportedModesServiceImpl.java | 18 +--
.../container/DriverPortletConfigImpl.java | 119 ++++++++++++++--
.../main/java/javax/portlet/GenericPortlet.java | 89 ++++++++----
.../main/java/javax/portlet/PortletConfig.java | 50 ++++++-
15 files changed, 493 insertions(+), 288 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletHubDemo/src/main/java/basic/portlet/ColorSelPortlet.java
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/java/basic/portlet/ColorSelPortlet.java b/PortletHubDemo/src/main/java/basic/portlet/ColorSelPortlet.java
index 326191c..c6447dc 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/ColorSelPortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/ColorSelPortlet.java
@@ -21,14 +21,12 @@ package basic.portlet;
import static basic.portlet.Constants.*;
import java.io.IOException;
-import java.io.PrintWriter;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.ResourceRequest;
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java b/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java
index 232b696..f8363b0 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/MessageBoxPortlet.java
@@ -31,14 +31,12 @@ import javax.portlet.ActionResponse;
import javax.portlet.EventRequest;
import javax.portlet.EventResponse;
import javax.portlet.GenericPortlet;
-import javax.portlet.PortletContext;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
/**
* A management portlet that displays the current deep link configuraion
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
----------------------------------------------------------------------
diff --git a/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java b/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
index eb5b6cb..50ef9a0 100644
--- a/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
+++ b/PortletHubDemo/src/main/java/basic/portlet/PartialActionPortlet.java
@@ -22,7 +22,6 @@ import static basic.portlet.Constants.*;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -31,14 +30,12 @@ import javax.portlet.ActionResponse;
import javax.portlet.EventRequest;
import javax.portlet.EventResponse;
import javax.portlet.GenericPortlet;
-import javax.portlet.PortletContext;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
/**
* A management portlet that displays the current deep link configuraion
@@ -92,7 +89,6 @@ public class PartialActionPortlet extends GenericPortlet {
/* (non-Javadoc)
* @see javax.portlet.GenericPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
*/
- @SuppressWarnings("unchecked")
@Override
public void serveResource(ResourceRequest req, ResourceResponse resp)
throws PortletException, IOException {
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java
index 326191c..c6447dc 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/ColorSelPortlet.java
@@ -21,14 +21,12 @@ package basic.portlet;
import static basic.portlet.Constants.*;
import java.io.IOException;
-import java.io.PrintWriter;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.ResourceRequest;
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletV3Demo/src/main/java/basic/portlet/Constants.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/Constants.java b/PortletV3Demo/src/main/java/basic/portlet/Constants.java
index faf5092..de2ebf1 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/Constants.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/Constants.java
@@ -50,4 +50,9 @@ public class Constants {
public final static String EVENT_NAME = "Message";
public final static String DELIM = ";%;";
+
+ // For PortletConfig portlet
+ public final static String ATTRIB_PRPS = "prps";
+ public final static String ATTRIB_PMS = "portletModes";
+ public final static String ATTRIB_WS = "windowStates";
}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java
index 232b696..f8363b0 100644
--- a/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java
+++ b/PortletV3Demo/src/main/java/basic/portlet/MessageBoxPortlet.java
@@ -31,14 +31,12 @@ import javax.portlet.ActionResponse;
import javax.portlet.EventRequest;
import javax.portlet.EventResponse;
import javax.portlet.GenericPortlet;
-import javax.portlet.PortletContext;
import javax.portlet.PortletException;
import javax.portlet.PortletRequestDispatcher;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.ResourceRequest;
import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
/**
* A management portlet that displays the current deep link configuraion
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletV3Demo/src/main/java/basic/portlet/PartialActionPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/PartialActionPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/PartialActionPortlet.java
deleted file mode 100644
index eb5b6cb..0000000
--- a/PortletV3Demo/src/main/java/basic/portlet/PartialActionPortlet.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/* 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 basic.portlet;
-
-import static basic.portlet.Constants.*;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.EventRequest;
-import javax.portlet.EventResponse;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ResourceRequest;
-import javax.portlet.ResourceResponse;
-import javax.portlet.ResourceURL;
-
-/**
- * A management portlet that displays the current deep link configuraion
- */
-public class PartialActionPortlet extends GenericPortlet {
-
- // Set up logging
- private static final String LOG_CLASS = PartialActionPortlet.class.getName();
- private final Logger logger = Logger.getLogger(LOG_CLASS);
-
- protected void doView(RenderRequest req, RenderResponse resp)
- throws PortletException, IOException {
-
- if (logger.isLoggable(Level.FINE)) {
- logger.logp(Level.FINE, this.getClass().getName(), "doView", "Entry");
- }
-
- resp.setContentType("text/html");
-
- PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(
- "/WEB-INF/jsp/view-pap.jsp");
- rd.include(req, resp);
-
- }
-
- @Override
- public void processAction(ActionRequest req, ActionResponse resp)
- throws PortletException, IOException {
-
- // the only action for this portlet is to increment the execition counter
-
- String val = req.getParameter(PARAM_NUM_ACTIONS);
- int na = 1;
- if (val != null) {
- try {
- na = Integer.parseInt(val) + 1;
- } catch (Exception e) {}
- }
-
- String actionName = req.getParameter("action");
- logger.fine("PAP: executing partial action. action number = " + na + ", name = " + actionName);
-
- resp.setRenderParameter(PARAM_NUM_ACTIONS, Integer.toString(na));
- }
-
- @Override
- public void processEvent(EventRequest req, EventResponse resp)
- throws PortletException ,IOException {
- };
-
- /* (non-Javadoc)
- * @see javax.portlet.GenericPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
- */
- @SuppressWarnings("unchecked")
- @Override
- public void serveResource(ResourceRequest req, ResourceResponse resp)
- throws PortletException, IOException {
-
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
-
- String num = req.getParameter(PARAM_NUM_ACTIONS);
- num = (num == null) ? "error" : num;
-
- String pageState = req.getPageState();
-
- writer.write("<p>Partial Action has been executed " + num + " times.</p>\n");
- writer.write(";#delimiter#;");
- writer.write(pageState);
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java b/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java
new file mode 100644
index 0000000..af1c1dc
--- /dev/null
+++ b/PortletV3Demo/src/main/java/basic/portlet/PortletConfigPortlet.java
@@ -0,0 +1,139 @@
+/* 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 basic.portlet;
+
+import static basic.portlet.Constants.*;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.WindowState;
+import javax.xml.namespace.QName;
+
+/**
+ * A management portlet that displays the current deep link configuraion
+ */
+public class PortletConfigPortlet extends GenericPortlet {
+
+ // Set up logging
+ private static final String LOG_CLASS = PortletConfigPortlet.class.getName();
+ private final Logger logger = Logger.getLogger(LOG_CLASS);
+
+ protected void doView(RenderRequest req, RenderResponse resp)
+ throws PortletException, IOException {
+
+ if (logger.isLoggable(Level.FINE)) {
+ logger.logp(Level.FINE, this.getClass().getName(), "doView", "Entry");
+ }
+
+ resp.setContentType("text/html");
+
+ // Get the information from the new V3.0 PortletConfig APIs through
+ // the GenericPortlet class in order to test the adapted GenericPortlet
+ // interfaces as well. Store resulting strings in request attributes
+ // for display through the JSP.
+
+ ArrayList<String> prps = new ArrayList<String>();
+ ArrayList<String> wss = new ArrayList<String>();
+ ArrayList<String> pms = new ArrayList<String>();
+
+ Map<String, QName> prpmap = getPublicRenderParameterDefinitions();
+ for (String prp : prpmap.keySet()) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Name: ").append(prp);
+ sb.append(", QName: ").append(prpmap.get(prp).toString());
+ prps.add(sb.toString());
+ }
+ req.setAttribute(ATTRIB_PRPS, prps);
+
+ String mimetype = "text/html";
+ for (WindowState ws : Collections.list(getWindowStates(mimetype))) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("MIME type: ").append(mimetype);
+ sb.append(", WindowState: ").append(ws.toString());
+ sb.append(", Allowed: ").append(req.isWindowStateAllowed(ws));
+ wss.add(sb.toString());
+ }
+ for (PortletMode pm : Collections.list(getPortletModes(mimetype))) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("MIME type: ").append(mimetype);
+ sb.append(", PortletMode: ").append(pm.toString());
+ sb.append(", Allowed: ").append(req.isPortletModeAllowed(pm));
+ pms.add(sb.toString());
+ }
+
+ mimetype = "text/vnd.wap.wml";
+ for (WindowState ws : Collections.list(getWindowStates(mimetype))) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("MIME type: ").append(mimetype);
+ sb.append(", WindowState: ").append(ws.toString());
+ wss.add(sb.toString());
+ }
+ for (PortletMode pm : Collections.list(getPortletModes(mimetype))) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("MIME type: ").append(mimetype);
+ sb.append(", PortletMode: ").append(pm.toString());
+ pms.add(sb.toString());
+ }
+
+ req.setAttribute(ATTRIB_WS, wss);
+ req.setAttribute(ATTRIB_PMS, pms);
+
+ PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher(
+ "/WEB-INF/jsp/view-pcp.jsp");
+ rd.include(req, resp);
+
+ }
+
+ @Override
+ public void processAction(ActionRequest req, ActionResponse resp)
+ throws PortletException, IOException {
+ }
+
+ @Override
+ public void processEvent(EventRequest req, EventResponse resp)
+ throws PortletException ,IOException {
+ };
+
+ /* (non-Javadoc)
+ * @see javax.portlet.GenericPortlet#serveResource(javax.portlet.ResourceRequest, javax.portlet.ResourceResponse)
+ */
+ @Override
+ public void serveResource(ResourceRequest req, ResourceResponse resp)
+ throws PortletException, IOException {
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-pap.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-pap.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-pap.jsp
deleted file mode 100644
index c9ccb8b..0000000
--- a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-pap.jsp
+++ /dev/null
@@ -1,108 +0,0 @@
-<%--
-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.
---%>
-<%@ page session="false" %>
-<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-
-<portlet:defineObjects />
-
-<%
- StringBuffer style = new StringBuffer(256);
- style.append("border-style:solid; border-width:3px;");
- style.append(" padding:4px; overflow:auto;");
- style.append(" border-color:#008800; min-height:30px;");
- style.append(" background:#E0E0E0;");
-%>
-
-<h3>Partial Action Portlet</h3>
-<hr/>
-<p>This portlet exercises the Partial Action execution path.</p>
-<form onsubmit='return false;' enctype='multipart/form-data'><input id='<portlet:namespace/>-doPA' type='submit' name='action' value='Do Partial Action' /></form>
-<div id='<portlet:namespace/>-responseDiv' style="<%=style.toString()%>"></div>
-
-<script>
-(function () {
- 'use strict';
- var pid = '<portlet:namespace/>',
- resdiv = '<portlet:namespace/>-responseDiv',
- paButton = '<portlet:namespace/>-doPA',
-
- state,
- actparms,
- hub,
-
- // Handler for onStateChange event
- update = function (type, s) {
- var nc = s.p.getValue('color', '#E0E0E0');
- console.log("PAP: state updated. Event type = " + type);
-
- // change background color for message box
- if (state.p.getValue('color') !== nc) {
- document.getElementById(resdiv).style.background = nc;
- }
- state = s;
- };
-
- // Handler for "partial action" button. Perform partial action sequence.
- document.getElementById(paButton).onclick = function () {
- var xhr = new XMLHttpRequest(), vals, pagestate = null, markup;
- console.log("PAP: Partial action button clicked.");
-
- // Add the render parameter counter as action parameter
- actparms.setValue('numActions', state.p.getValue('numActions'));
-
- hub.startPartialAction(actparms).then(function (pai) {
-
- console.log("PAP: got partial action init object. URL: " + pai.url);
-
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- if (xhr.status === 200) {
- vals = xhr.responseText.split(";#delimiter#;");
- if (vals.length !== 2) {
- markup = "<p>Error parsing return data. # fields = " + vals.length + ".</p>";
- } else {
- markup = vals[0];
- pagestate = vals[1];
- }
- } else {
- markup = "<p>Communication error. XHR status=" + xhr.statusText + "</p>";
- }
- // Make sure setPageState is called even in error case in order to unblock the P.H.
- pai.setPageState(pagestate);
- document.getElementById(resdiv).innerHTML = markup;
- }
- };
- xhr.open("POST",pai.url,true);
- xhr.send();
-
- });
- };
-
- // Register portlet with Portlet Hub; add onStateChange listener
- portlet.register(pid).then(function (pi) {
- console.log("PAP: registered: " + pid);
- hub = pi;
- state = hub.newState();
- actparms = hub.newParameters();
- hub.addEventListener("portlet.onStateChange", update);
- });
-
-}());
-</script>
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-pcp.jsp
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-pcp.jsp b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-pcp.jsp
new file mode 100644
index 0000000..b997660
--- /dev/null
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/jsp/view-pcp.jsp
@@ -0,0 +1,55 @@
+<%--
+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.
+--%>
+<%@ page import="static basic.portlet.Constants.*" %>
+<%@ page session="false" %>
+<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<portlet:defineObjects />
+
+<%
+ StringBuffer style = new StringBuffer(256);
+ style.append("border-style:solid; border-width:3px;");
+ style.append(" padding:4px; overflow:auto;");
+ style.append(" border-color:#008800; min-height:30px;");
+ style.append(" background:#E0E0E0;");
+%>
+
+<h3><%=portletConfig.getPortletName()%></h3>
+<hr/>
+<p>This portlet displays information from the new V3.0 PortletConfig APIs
+getPortletModes(String), getWindowStates(String), and getPublicRenderParameterDefinitions()</p>
+<h5>Portlet Modes:</h5>
+<ul>
+<c:forEach items="<%=renderRequest.getAttribute(ATTRIB_PMS) %>" var="pm">
+ <li><c:out value="${pm}"></c:out></li>
+</c:forEach>
+</ul>
+<h5>Window States:</h5>
+<ul>
+<c:forEach items="<%=renderRequest.getAttribute(ATTRIB_WS) %>" var="ws">
+ <li><c:out value="${ws}"></c:out></li>
+</c:forEach>
+</ul>
+<h5>Public Render Parameters:</h5>
+<ul>
+<c:forEach items="<%=renderRequest.getAttribute(ATTRIB_PRPS) %>" var="prp">
+ <li><c:out value="${prp}"></c:out></li>
+</c:forEach>
+</ul>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml b/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
index 1b7f4e7..5d39bd8 100644
--- a/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
+++ b/PortletV3Demo/src/main/webapp/WEB-INF/portlet.xml
@@ -94,24 +94,88 @@
</portlet>
<portlet>
- <portlet-name>PartialActionPortlet</portlet-name>
- <display-name>Partial Action Portlet</display-name>
+ <portlet-name>PortletConfigPortlet1</portlet-name>
+ <display-name>Portlet Config Portlet #1</display-name>
- <portlet-class>basic.portlet.PartialActionPortlet</portlet-class>
+ <portlet-class>basic.portlet.PortletConfigPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>MyMode_nonPortalManaged_1</portlet-mode>
+ <portlet-mode>MyMode_nonPortalManaged_2</portlet-mode>
+ <portlet-mode>MyMode_PortalManaged_3</portlet-mode>
+ <window-state>TestWindowState_1</window-state>
+ <window-state>TestWindowState_2</window-state>
+ </supports>
+
+ <supports>
+ <mime-type>text/vnd.wap.wml</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>MyMode_nonPortalManaged_1</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
- <title>PH Partial Action Portlet</title>
+ <title>Portlet Config Portlet #1</title>
</portlet-info>
<supported-public-render-parameter>color</supported-public-render-parameter>
+ <supported-public-render-parameter>photo</supported-public-render-parameter>
</portlet>
+
+ <portlet>
+ <portlet-name>PortletConfigPortlet2</portlet-name>
+ <display-name>Portlet Config Portlet #2</display-name>
+
+ <portlet-class>basic.portlet.PortletConfigPortlet</portlet-class>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>HELP</portlet-mode>
+ <portlet-mode>MyMode_nonPortalManaged_1</portlet-mode>
+ <window-state>TestWindowState_1</window-state>
+ </supports>
+
+ <supported-locale>en</supported-locale>
+
+ <portlet-info>
+ <title>Portlet Config Portlet #2</title>
+ </portlet-info>
+
+ <supported-public-render-parameter>color</supported-public-render-parameter>
+ </portlet>
+
+ <custom-portlet-mode>
+ <description>Test mode #1</description>
+ <portlet-mode>MyMode_nonPortalManaged_1</portlet-mode>
+ <portal-managed>false</portal-managed>
+ </custom-portlet-mode>
+
+ <custom-portlet-mode>
+ <description>Test mode #2</description>
+ <portlet-mode>MyMode_nonPortalManaged_2</portlet-mode>
+ <portal-managed>false</portal-managed>
+ </custom-portlet-mode>
+
+ <custom-portlet-mode>
+ <description>Test mode #3</description>
+ <portlet-mode>MyMode_PortalManaged_3</portlet-mode>
+ <portal-managed>true</portal-managed>
+ </custom-portlet-mode>
+
+ <custom-window-state>
+ <description>Test window State #1</description>
+ <window-state>TestWindowState_1</window-state>
+ </custom-window-state>
+
+ <custom-window-state>
+ <description>Test window State #2</description>
+ <window-state>TestWindowState_2</window-state>
+ </custom-window-state>
<event-definition>
<qname>rp:Message</qname>
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
index 333dcc4..7c4f9e2 100644
--- a/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
+++ b/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/SupportedModesServiceImpl.java
@@ -22,7 +22,7 @@ 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.Supports;
-import org.apache.pluto.container.om.portlet20.impl.CustomPortletModeType;
+import org.apache.pluto.container.om.portlet.CustomPortletMode;
import org.apache.pluto.driver.services.portal.PortletWindowConfig;
import org.apache.pluto.driver.services.portal.PropertyConfigService;
import org.apache.pluto.driver.services.portal.SupportedModesService;
@@ -113,13 +113,13 @@ public class SupportedModesServiceImpl implements SupportedModesService
throw new PortletContainerException("Optional Portlet Registry Service not found.");
}
PortletApplicationDefinition ctx = portletRegistry.getPortletApplication(applicationName);
- Iterator i = ctx.getPortlets().iterator();
+ Iterator<? extends PortletDefinition> i = ctx.getPortlets().iterator();
while (i.hasNext())
{
PortletDefinition dd = (PortletDefinition) i.next();
if (portletName.equals(dd.getPortletName()))
{
- Iterator i2 = dd.getSupports().iterator();
+ Iterator<? extends Supports> i2 = dd.getSupports().iterator();
while (i2.hasNext())
{
Supports sd = (Supports) i2.next();
@@ -129,7 +129,7 @@ public class SupportedModesServiceImpl implements SupportedModesService
return true;
} else
{
- Iterator pd = sd.getPortletModes().iterator();
+ Iterator<String> pd = sd.getPortletModes().iterator();
while (pd.hasNext())
{
if (mode.equalsIgnoreCase((String) pd.next()))
@@ -158,7 +158,7 @@ public class SupportedModesServiceImpl implements SupportedModesService
// Add the PortletModes supported by the portal to the
// supportedPortletModesByPortal set.
LOG.debug("Loading supported portal modes...");
- Iterator modes = propertyService.getSupportedPortletModes().iterator();
+ Iterator<String> modes = propertyService.getSupportedPortletModes().iterator();
while (modes.hasNext())
{
String mode = (String) modes.next();
@@ -181,10 +181,10 @@ public class SupportedModesServiceImpl implements SupportedModesService
try
{
PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName);
- Iterator customModes = portletApp.getCustomPortletModes().iterator();
+ Iterator<? extends CustomPortletMode> customModes = portletApp.getCustomPortletModes().iterator();
while (customModes.hasNext())
{
- CustomPortletModeType customMode = (CustomPortletModeType) customModes.next();
+ CustomPortletMode customMode = (CustomPortletMode) customModes.next();
boolean isPortletManagedMode = !customMode.isPortalManaged();
if (isPortletManagedMode && customMode.getPortletMode().equalsIgnoreCase(mode))
{
@@ -226,13 +226,13 @@ public class SupportedModesServiceImpl implements SupportedModesService
throw new PortletContainerException("Optional Portlet Registry Service not found.");
}
PortletApplicationDefinition portletApp = portletRegistry.getPortletApplication(applicationName);
- Iterator i = portletApp.getPortlets().iterator();
+ Iterator<? extends PortletDefinition> i = portletApp.getPortlets().iterator();
while (i.hasNext())
{
PortletDefinition dd = (PortletDefinition) i.next();
if (portletName.equals(dd.getPortletName()))
{
- Iterator i2 = dd.getSupports().iterator();
+ Iterator<? extends Supports> i2 = dd.getSupports().iterator();
while (i2.hasNext())
{
Supports sd = (Supports) i2.next();
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java
----------------------------------------------------------------------
diff --git a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java
index 3ee0cb5..a4a624b 100644
--- a/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java
+++ b/pluto-portal-driver/src/main/java/org/apache/pluto/driver/container/DriverPortletConfigImpl.java
@@ -16,22 +16,27 @@
*/
package org.apache.pluto.driver.container;
-import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
import java.util.Locale;
+import java.util.Map;
import java.util.ResourceBundle;
-import javax.portlet.PortalContext;
import javax.portlet.PortletContext;
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
+import javax.xml.namespace.QName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.pluto.container.driver.DriverPortletConfig;
-import org.apache.pluto.container.driver.PlutoServices;
import org.apache.pluto.container.impl.AbstractPortletConfigImpl;
+import org.apache.pluto.container.om.portlet.CustomWindowState;
import org.apache.pluto.container.om.portlet.PortletDefinition;
+import org.apache.pluto.container.om.portlet.PublicRenderParameter;
+import org.apache.pluto.container.om.portlet.Supports;
public class DriverPortletConfigImpl extends AbstractPortletConfigImpl implements DriverPortletConfig {
@@ -54,13 +59,109 @@ public class DriverPortletConfigImpl extends AbstractPortletConfigImpl implement
return bundles.getResourceBundle(locale);
}
- public Enumeration<PortletMode> getPortletModes() {
- // TODO Auto-generated method stub
- return null;
+ public Enumeration<PortletMode> getPortletModes(String mimeType) {
+ HashSet<PortletMode> portletModes = getPMList(mimeType);
+ return Collections.enumeration(portletModes);
}
- public Enumeration<WindowState> getWindowStates() {
- // TODO Auto-generated method stub
- return null;
+ public Enumeration<WindowState> getWindowStates(String mimeType) {
+ HashSet<WindowState> windowStates = getWSList(mimeType);
+ return Collections.enumeration(windowStates);
+ }
+
+ public Map<String, QName> getPublicRenderParameterDefinitions() {
+ HashMap<String, QName> prpdefs = new HashMap<String, QName>();
+ HashMap<String, PublicRenderParameter> prps = new HashMap<String, PublicRenderParameter>();
+
+ // Get the public render parameter definitions for the portlet app
+
+ for (PublicRenderParameter prp : portlet.getApplication().getPublicRenderParameters()) {
+ prps.put(prp.getIdentifier(), prp);
+ }
+
+ // Get the supported PRPs for this portlet
+
+ for (String prpname : portlet.getSupportedPublicRenderParameters()) {
+ PublicRenderParameter prp = prps.get(prpname);
+ if (prp != null) {
+ QName qn = prp.getQName();
+ if (qn == null) {
+ String name = prp.getName();
+ String ns = portlet.getApplication().getDefaultNamespace();
+ if (name != null && ns != null) {
+ qn = new QName(ns, name);
+ } else {
+ LOG.warn("Bad public render parameter name / namespace definition. name="
+ + name + ", namespace=" + ns);
+ }
+ }
+
+ if (qn != null) {
+ prpdefs.put(prpname, qn);
+ }
+ } else {
+ LOG.warn("Could not get public render parameter definition for identifier: " + prpname);
+ }
+ }
+
+ return prpdefs;
+ }
+
+ private HashSet<PortletMode> getPMList(String mimeType) {
+ HashSet<PortletMode> pms = new HashSet<PortletMode>();
+
+ pms.add(PortletMode.VIEW); // all portlets support view
+
+ // Add the portlet mode to the list
+
+ for (Supports s : portlet.getSupports()) {
+ if (mimeType.equalsIgnoreCase(s.getMimeType())) {
+ for (String pmname : s.getPortletModes()) {
+ PortletMode pm = new PortletMode(pmname);
+ pms.add(pm);
+ }
+ }
+ }
+
+ return pms;
+ }
+
+ private HashSet<WindowState> getWSList(String mimeType) {
+ HashSet<WindowState> winstates = new HashSet<WindowState>();
+ HashSet<WindowState> custWS = new HashSet<WindowState>();
+
+ // all portlets support normal, maximized, & minimized window states
+
+ winstates.add(WindowState.NORMAL);
+ winstates.add(WindowState.MAXIMIZED);
+ winstates.add(WindowState.MINIMIZED);
+
+ // get list of custom window states for the portlet app
+
+ for (CustomWindowState cws : portlet.getApplication().getCustomWindowStates()) {
+ custWS.add(new WindowState(cws.getWindowState()));
+ }
+
+ // See if a restricted list of Window States is specified
+
+ boolean restricted = false;
+ for (Supports s : portlet.getSupports()) {
+ if (mimeType.equalsIgnoreCase(mimeType)) {
+ for (String wsname : s.getWindowStates()) {
+ WindowState ws = new WindowState(wsname);
+ winstates.add(ws);
+ restricted = true;
+ }
+ }
+ }
+
+ // If the window state list has not been restricted in the deployment descriptor,
+ // add all of the custom window states
+
+ if (!restricted) {
+ winstates.addAll(custWS);
+ }
+
+ return winstates;
}
}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/GenericPortlet.java b/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
index 34906e6..8b9b8c4 100644
--- a/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
+++ b/portlet-api/src/main/java/javax/portlet/GenericPortlet.java
@@ -786,18 +786,23 @@ public abstract class GenericPortlet implements Portlet, PortletConfig, EventPor
// -------------------------------------------------------------------------
- /**
- * <div class="changed_added_3_0">
- * Returns an <code>Enumeration</code> of PortletMode objects that are defined
- * in the portlet descriptor for the portlet and supported by the portlet container.
- * <p>
- * Note that a supported portlet mode may not be allowed in all situations
- * due to security or other reasons. To
- * determine whether a portlet mode is allowed during a request, use the
- * {@link PortletRequest#isPortletModeAllowed(PortletMode)} method.
- * </div>
- *
- * @since 3.0
+ /**
+ * <div class="changed_added_3_0">
+ * Returns an <code>Enumeration</code> of PortletMode objects that are defined
+ * for the portlet for the given MIME type.
+ * <p>
+ * Note that a supported portlet mode may not be allowed in all situations
+ * due to security or other reasons. To
+ * determine whether a portlet mode is allowed during a request, use the
+ * {@link PortletRequest#isPortletModeAllowed(PortletMode)} method.
+ * To determine which portlet modes are supported by the portal, use
+ * {@link PortalContext#getSupportedPortletModes()}
+ * </div>
+ *
+ * @param mimeType MIME type
+ *
+ *
+ * @since 3.0
*
* @see PortletMode
* @see PortletRequest#isPortletModeAllowed(PortletMode)
@@ -805,25 +810,28 @@ public abstract class GenericPortlet implements Portlet, PortletConfig, EventPor
* @return an <code>Enumeration</code> of <code>PortletMode</code>
* objects containing the defined and supported portlet modes.
*/
- public java.util.Enumeration<PortletMode> getPortletModes() {
+ public java.util.Enumeration<PortletMode> getPortletModes(String mimeType) {
if (config == null)
throw new java.lang.IllegalStateException(
"Config is null, please ensure that your init(config) method calls super.init(config)");
- return config.getPortletModes();
+ return config.getPortletModes(mimeType);
}
/**
- * <div class="changed_added_3_0">
- * Returns an <code>Enumeration</code> of WindowState objects that are defined
- * in the portlet descriptor for the portlet and supported by the portlet container.
- * <p>
- * Note that a supported window state may not be allowed in all situations
- * due to security or other reasons. To
- * determine whether a window state is allowed during a request, use the
- * {@link PortletRequest#isWindowStateAllowed(WindowState)} method.
- * </div>
- *
+ * <div class="changed_added_3_0">
+ * Returns an <code>Enumeration</code> of WindowState objects that are defined
+ * for the portlet for the given MIME type.
+ * <p>
+ * Note that a supported window state may not be allowed in all situations
+ * due to security or other reasons. To
+ * determine whether a window state is allowed during a request, use the
+ * {@link PortletRequest#isWindowStateAllowed(WindowState)} method.
+ * To determine which window states are supported by the portal, use
+ * {@link PortalContext#getSupportedWindowStates()}.
+ * </div>
+ *
+ * @param mimeType MIME type
* @since 3.0
*
* @see WindowState
@@ -832,11 +840,40 @@ public abstract class GenericPortlet implements Portlet, PortletConfig, EventPor
* @return an <code>Enumeration</code> of <code>WindowState</code>
* objects containing the defined and supported window states.
*/
- public java.util.Enumeration<WindowState> getWindowStates() {
+ public java.util.Enumeration<WindowState> getWindowStates(String mimeType) {
+ if (config == null)
+ throw new java.lang.IllegalStateException(
+ "Config is null, please ensure that your init(config) method calls super.init(config)");
+ return config.getWindowStates(mimeType);
+ }
+
+
+ /**
+ * <div class="changed_added_3_0">
+ * Returns a Map of public render parameter names to their qualified names.
+ * The names are the values returned by the
+ * {@link PortletConfig#getPublicRenderParameterNames()} method.
+ * The values are the <code>QName</code> values associated with the public
+ * render parameter.
+ * <p>
+ * If the public render parameter is specified in the portlet descriptor
+ * using the <code><.name>.</code> tag rather than the
+ * <code><.qname>.</code> tag, the QName is built from the default namespace
+ * from the deployment descriptor
+ * together with the value from the <code><.name>.</code> tag.
+ * </div>
+ *
+ * @since 3.0
+ *
+ * @see PortletConfig#getPublicRenderParameterNames()
+ *
+ * @return an <code>Map</code> of <code>String</code> to <code>QName</code>
+ */
+ public Map<String, QName> getPublicRenderParameterDefinitions() {
if (config == null)
throw new java.lang.IllegalStateException(
"Config is null, please ensure that your init(config) method calls super.init(config)");
- return config.getWindowStates();
+ return config.getPublicRenderParameterDefinitions();
}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/6f30042b/portlet-api/src/main/java/javax/portlet/PortletConfig.java
----------------------------------------------------------------------
diff --git a/portlet-api/src/main/java/javax/portlet/PortletConfig.java b/portlet-api/src/main/java/javax/portlet/PortletConfig.java
index 223fac9..f92dda9 100644
--- a/portlet-api/src/main/java/javax/portlet/PortletConfig.java
+++ b/portlet-api/src/main/java/javax/portlet/PortletConfig.java
@@ -24,6 +24,10 @@
package javax.portlet;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
@@ -258,45 +262,79 @@ public interface PortletConfig
/**
* <div class="changed_added_3_0">
* Returns an <code>Enumeration</code> of PortletMode objects that are defined
- * in the portlet descriptor for the portlet and supported by the portlet container.
+ * for the portlet for the given MIME type.
* <p>
* Note that a supported portlet mode may not be allowed in all situations
* due to security or other reasons. To
* determine whether a portlet mode is allowed during a request, use the
- * {@link PortletRequest#isPortletModeAllowed(PortletMode)} method.
+ * {@link PortletRequest#isPortletModeAllowed(PortletMode)} method.
+ * To determine which portlet modes are supported by the portal, use
+ * {@link PortalContext#getSupportedPortletModes()}
* </div>
+ *
+ * @param mimeType MIME type
*
* @since 3.0
*
* @see PortletMode
* @see PortletRequest#isPortletModeAllowed(PortletMode)
+ * @see PortalContext#getSupportedPortletModes()
*
* @return an <code>Enumeration</code> of <code>PortletMode</code>
* objects containing the defined and supported portlet modes.
*/
- public java.util.Enumeration<PortletMode> getPortletModes();
+ public java.util.Enumeration<PortletMode> getPortletModes(String mimeType);
/**
* <div class="changed_added_3_0">
* Returns an <code>Enumeration</code> of WindowState objects that are defined
- * in the portlet descriptor for the portlet and supported by the portlet container.
+ * for the portlet for the given MIME type.
* <p>
* Note that a supported window state may not be allowed in all situations
* due to security or other reasons. To
* determine whether a window state is allowed during a request, use the
- * {@link PortletRequest#isWindowStateAllowed(WindowState)} method.
+ * {@link PortletRequest#isWindowStateAllowed(WindowState)} method.
+ * To determine which window states are supported by the portal, use
+ * {@link PortalContext#getSupportedWindowStates()}.
* </div>
+ *
+ * @param mimeType MIME type
*
* @since 3.0
*
* @see WindowState
* @see PortletRequest#isWindowStateAllowed(WindowState)
+ * @see PortalContext#getSupportedWindowStates()
*
* @return an <code>Enumeration</code> of <code>WindowState</code>
* objects containing the defined and supported window states.
*/
- public java.util.Enumeration<WindowState> getWindowStates();
+ public java.util.Enumeration<WindowState> getWindowStates(String mimeType);
+
+
+ /**
+ * <div class="changed_added_3_0">
+ * Returns a Map of public render parameter names to their qualified names.
+ * The names are the values returned by the
+ * {@link PortletConfig#getPublicRenderParameterNames()} method.
+ * The values are the <code>QName</code> values associated with the public
+ * render parameter.
+ * <p>
+ * If the public render parameter is specified in the portlet descriptor
+ * using the <code><.name>.</code> tag rather than the
+ * <code><.qname>.</code> tag, the QName is built from the default namespace
+ * from the deployment descriptor
+ * together with the value from the <code><.name>.</code> tag.
+ * </div>
+ *
+ * @since 3.0
+ *
+ * @see PortletConfig#getPublicRenderParameterNames()
+ *
+ * @return an <code>Map</code> of <code>String</code> to <code>QName</code>
+ */
+ public Map<String, QName> getPublicRenderParameterDefinitions();
}