You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by at...@apache.org on 2007/09/03 15:24:06 UTC
svn commit: r572321 - in
/wicket/branches/wicket-1.3.0-beta3-portlet-support: ./ jdk-1.4/wicket/
jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/
Author: ate
Date: Mon Sep 3 06:24:05 2007
New Revision: 572321
URL: http://svn.apache.org/viewvc?rev=572321&view=rev
Log:
WICKET-650: New Wicket Portlet support: use a RequestContext for abstracted url generation, writing header response and namespacing
See: https://issues.apache.org/jira/browse/WICKET-650 and https://issues.apache.org/jira/browse/WICKET-660
- New portlet support package with features like the WicketPortlet and the PortletRequestContext extension of RequestContext, as well as
several Portlet "wrapper" classes used when serving a Portlet request.
These portlet-support objects are all hooked in transparent, e.g. hidden from developers POV: all the portlet-support integration API is handled
through the generic (e.g. Portlet independant) o.a.w.RequestContext class.
For bootstrapping the portlet-support only WicketFilter needs a few internal changes which are transparent as well.
- As the portlet-support is and should be optional, the required build dependencies (portlet-api, portal-bridges-common) are optional as well.
Furthermore, the way the portlet-support will be bootstrapped by WicketFilter (to be committed after this), runtime dependency will be optional as well,
e.g. unless a Portlet Context is (dynamically) discovered, none of these classes will be loaded.
- This contains changes originally committed to the wicket-1.3-portlet-support branch for WiCKET-650 and -660 as well as several new improvements,
now applied to the new wicket-1.3.0-beta3-portlet-support branch.
Added:
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/EmbeddedPortletHeaderResponse.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/FilterRequestContext.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletActionServletResponseWrapper.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletInvalidMarkupFilter.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRenderServletResponseWrapper.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRequestContext.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletResponseWrapper.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketFilterPortletContext.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketPortlet.java (with props)
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketResponseState.java (with props)
Modified:
wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/pom.xml
wicket/branches/wicket-1.3.0-beta3-portlet-support/pom.xml
Modified: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/pom.xml
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/pom.xml?rev=572321&r1=572320&r2=572321&view=diff
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/pom.xml (original)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/pom.xml Mon Sep 3 06:24:05 2007
@@ -39,6 +39,20 @@
component model backed by POJO data beans that can easily be
persisted using your favorite technology.
</description>
+ <dependencies>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.bridges</groupId>
+ <artifactId>portals-bridges-common</artifactId>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ </dependencies>
<build>
<plugins>
<plugin>
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/EmbeddedPortletHeaderResponse.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/EmbeddedPortletHeaderResponse.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/EmbeddedPortletHeaderResponse.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/EmbeddedPortletHeaderResponse.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,116 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.wicket.RequestContext;
+import org.apache.wicket.Response;
+import org.apache.wicket.markup.html.internal.HeaderResponse;
+import org.apache.wicket.response.StringResponse;
+
+/**
+ * @author Ate Douma
+ */
+public class EmbeddedPortletHeaderResponse extends HeaderResponse
+{
+ private Response realResponse;
+ private StringResponse bufferedResponse;
+
+ public EmbeddedPortletHeaderResponse(Response realResponse)
+ {
+ this.realResponse = realResponse;
+ bufferedResponse = new StringResponse();
+ }
+
+ public void renderCSSReference(String url, String media)
+ {
+ if (!isClosed())
+ {
+ List token = Arrays.asList(new Object[] { "css", url, media });
+ if (wasRendered(token) == false)
+ {
+ getResponse().write("<script type=\"text/javascript\">");
+ getResponse().write("var elem=document.createElement(\"link\");");
+ getResponse().write("elem.setAttribute(\"rel\",\"stylesheet\");");
+ getResponse().write("elem.setAttribute(\"type\",\"text/css\");");
+ getResponse().write("elem.setAttribute(\"href\",\""+url+"\");");
+ if (media != null)
+ {
+ getResponse().write("elem.setAttribute(\"media\",\""+media+"\");");
+ }
+ getResponse().write("document.getElementsByTagName(\"head\")[0].appendChild(elem);");
+ getResponse().println("</script>");
+ markRendered(token);
+ }
+ }
+ }
+
+
+ /**
+ * @see org.apache.wicket.markup.html.internal.HeaderResponse#close()
+ */
+ public void close()
+ {
+ super.close();
+ // Automatically add <head> if necessary
+ CharSequence output = bufferedResponse.getBuffer();
+ if (output.length() > 0)
+ {
+ if (output.charAt(0) == '\r')
+ {
+ for (int i = 2; i < output.length(); i += 2)
+ {
+ char ch = output.charAt(i);
+ if (ch != '\r')
+ {
+ output = output.subSequence(i - 2, output.length());
+ break;
+ }
+ }
+ }
+ else if (output.charAt(0) == '\n')
+ {
+ for (int i = 1; i < output.length(); i++)
+ {
+ char ch = output.charAt(i);
+ if (ch != '\n')
+ {
+ output = output.subSequence(i - 1, output.length());
+ break;
+ }
+ }
+ }
+ }
+ if (output.length() > 0)
+ {
+ realResponse.write("<span id=\""+RequestContext.get().getNamespace()+"_embedded_head\" style=\"display:none\">");
+ realResponse.write(output);
+ realResponse.write("</span>");
+ }
+ bufferedResponse.reset();
+ }
+
+ /**
+ * @see org.apache.wicket.markup.html.internal.HeaderResponse#getRealResponse()
+ */
+ protected Response getRealResponse()
+ {
+ return bufferedResponse;
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/EmbeddedPortletHeaderResponse.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/EmbeddedPortletHeaderResponse.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/EmbeddedPortletHeaderResponse.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/FilterRequestContext.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/FilterRequestContext.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/FilterRequestContext.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/FilterRequestContext.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,49 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+public final class FilterRequestContext
+{
+ private HttpServletRequest request;
+ private HttpServletResponse response;
+
+ public FilterRequestContext(HttpServletRequest request, HttpServletResponse response)
+ {
+ this.request = request;
+ this.response = response;
+ }
+
+ public HttpServletRequest getRequest()
+ {
+ return request;
+ }
+ public void setRequest(HttpServletRequest request)
+ {
+ this.request = request;
+ }
+ public HttpServletResponse getResponse()
+ {
+ return response;
+ }
+ public void setResponse(HttpServletResponse response)
+ {
+ this.response = response;
+ }
+}
\ No newline at end of file
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/FilterRequestContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/FilterRequestContext.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/FilterRequestContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletActionServletResponseWrapper.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletActionServletResponseWrapper.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletActionServletResponseWrapper.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletActionServletResponseWrapper.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,137 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author Ate Douma
+ */
+public class PortletActionServletResponseWrapper extends PortletServletResponseWrapper
+{
+
+ public PortletActionServletResponseWrapper(HttpServletResponse response, WicketResponseState responseState)
+ {
+ super(response, responseState);
+ }
+
+ public void addCookie(Cookie cookie)
+ {
+ }
+
+ public void addDateHeader(String s, long l)
+ {
+ }
+
+ public void addHeader(String s, String s1)
+ {
+ }
+
+ public void addIntHeader(String s, int i)
+ {
+ }
+
+ public String encodeRedirectUrl(String s)
+ {
+ return s;
+ }
+
+ public String encodeRedirectURL(String s)
+ {
+ return s;
+ }
+
+ public String encodeUrl(String s)
+ {
+ return s;
+ }
+
+ public String encodeURL(String s)
+ {
+ return s;
+ }
+
+ public void flushBuffer() throws IOException
+ {
+ }
+
+ public int getBufferSize()
+ {
+ return 0;
+ }
+
+ public ServletOutputStream getOutputStream() throws IOException
+ {
+ return null;
+ }
+
+ public PrintWriter getWriter() throws IOException
+ {
+ return null;
+ }
+
+ public boolean isCommitted()
+ {
+ return false;
+ }
+
+ public void reset()
+ {
+ }
+
+ public void resetBuffer()
+ {
+ }
+
+ public void setBufferSize(int i)
+ {
+ }
+
+ public void setCharacterEncoding(String charset)
+ {
+ }
+
+ public void setContentLength(int i)
+ {
+ }
+
+ public void setContentType(String s)
+ {
+ }
+
+ public void setDateHeader(String s, long l)
+ {
+ }
+
+ public void setHeader(String s, String s1)
+ {
+ }
+
+ public void setIntHeader(String s, int i)
+ {
+ }
+
+ public void setLocale(Locale locale)
+ {
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletActionServletResponseWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletActionServletResponseWrapper.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletActionServletResponseWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletInvalidMarkupFilter.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletInvalidMarkupFilter.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletInvalidMarkupFilter.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletInvalidMarkupFilter.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,79 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import org.apache.wicket.IResponseFilter;
+import org.apache.wicket.RequestContext;
+import org.apache.wicket.util.string.AppendingStringBuffer;
+
+
+/**
+ * This filter removes html page top level markup elements like <html>, <head> and <body>.
+ * The filter is configured automatically by WicketFilter if it detects the application is (potentially) invoked as a Portlet.
+ *
+ * @author Ate Douma
+ */
+public class PortletInvalidMarkupFilter implements IResponseFilter
+{
+ /**
+ * @see org.apache.wicket.IResponseFilter#filter(AppendingStringBuffer)
+ */
+ public AppendingStringBuffer filter(AppendingStringBuffer responseBuffer)
+ {
+ RequestContext rc = RequestContext.get();
+ if (rc.isPortletRequest() && ((PortletRequestContext)rc).isEmbedded())
+ {
+ deleteFragment(responseBuffer, "<?xml", "?>");
+ deleteFragment(responseBuffer, "<!DOCTYPE", ">");
+ deleteOpenTag(responseBuffer, "html");
+ deleteOpenTag(responseBuffer, "head");
+ deleteOpenTag(responseBuffer, "body");
+ }
+
+ return responseBuffer;
+ }
+
+ private void deleteFragment(AppendingStringBuffer responseBuffer, String prefix, String postfix)
+ {
+ int startIndex, endIndex;
+ if ((startIndex = responseBuffer.indexOf(prefix)) > -1)
+ {
+ if ((endIndex = responseBuffer.indexOf(postfix, startIndex)) >-1)
+ {
+ responseBuffer.delete(startIndex, endIndex+postfix.length());
+ }
+ }
+ }
+
+ private void deleteOpenTag(AppendingStringBuffer responseBuffer, String tagName)
+ {
+ int startIndex, endIndex;
+ // find and remove opening tag
+ if ((startIndex = responseBuffer.indexOf("<"+tagName)) > -1)
+ {
+ if ((endIndex = responseBuffer.indexOf(">", startIndex)) >-1)
+ {
+ responseBuffer.delete(startIndex, endIndex+1);
+ }
+ // remove closing tag
+ if ((startIndex = responseBuffer.indexOf("</"+tagName+">")) > -1)
+ {
+ responseBuffer.delete(startIndex, startIndex+tagName.length()+3);
+ }
+ }
+ }
+}
\ No newline at end of file
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletInvalidMarkupFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletInvalidMarkupFilter.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletInvalidMarkupFilter.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRenderServletResponseWrapper.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRenderServletResponseWrapper.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRenderServletResponseWrapper.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRenderServletResponseWrapper.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,72 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import java.io.IOException;
+
+import javax.portlet.RenderResponse;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.wicket.RequestContext;
+
+/**
+ * @author Ate Douma
+ */
+public class PortletRenderServletResponseWrapper extends PortletServletResponseWrapper
+{
+ RenderResponse renderResponse;
+
+ public PortletRenderServletResponseWrapper(HttpServletResponse response, RenderResponse renderResponse, WicketResponseState responseState)
+ {
+ super(response, responseState);
+ this.renderResponse = renderResponse;
+ }
+
+ /**
+ * @see javax.servlet.ServletResponseWrapper#setContentType(java.lang.String)
+ */
+ public void setContentType(String arg0)
+ {
+ renderResponse.setContentType(arg0);
+ }
+
+ public void sendRedirect(String redirectLocation) throws IOException
+ {
+ RequestContext rc = RequestContext.get();
+ if (rc instanceof PortletRequestContext)
+ {
+ String wicketUrl = ((PortletRequestContext)rc).getLastEncodedPath(redirectLocation);
+ if (wicketUrl != null)
+ {
+ redirectLocation = wicketUrl;
+ }
+ else
+ {
+ String contextPath = ((PortletRequestContext)rc).getPortletRequest().getContextPath();
+ if (redirectLocation.startsWith(contextPath+"/"))
+ {
+ redirectLocation = redirectLocation.substring(contextPath.length());
+ if (redirectLocation.length() == 0)
+ {
+ redirectLocation = "/";
+ }
+ }
+ }
+ }
+ super.sendRedirect(redirectLocation);
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRenderServletResponseWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRenderServletResponseWrapper.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRenderServletResponseWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRequestContext.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRequestContext.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRequestContext.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRequestContext.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,282 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import java.util.HashMap;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.portals.bridges.common.PortletResourceURLFactory;
+import org.apache.portals.bridges.util.PortletWindowUtils;
+import org.apache.wicket.RequestContext;
+import org.apache.wicket.RequestCycle;
+import org.apache.wicket.Response;
+import org.apache.wicket.markup.html.IHeaderResponse;
+import org.apache.wicket.protocol.http.WebRequest;
+import org.apache.wicket.protocol.http.WebResponse;
+import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
+
+/**
+ * @author Ate Douma
+ */
+public class PortletRequestContext extends RequestContext
+{
+ private final PortletConfig portletConfig;
+ private final PortletRequest portletRequest;
+ private final PortletResponse portletResponse;
+ // needed for JSR-168 support which only allows PortletURLs to be created by RenderResponse, with JSR-286 PortletResponse can do that too
+ private final RenderResponse renderResponse;
+ private final PortletResourceURLFactory resourceURLFactory;
+ private final IHeaderResponse headerResponse;
+ private String portletWindowId;
+ private final boolean ajax;
+ private final boolean embedded;
+ private final boolean resourceRequest;
+ private String[] lastEncodedUrl = new String[2];
+
+ private static final String SERVLET_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX = "/ps:";
+
+ public static final String decodePortletWindowId(String pathInfo)
+ {
+ String portletWindowId = null;
+ if (pathInfo != null && pathInfo.startsWith(SERVLET_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX))
+ {
+ int nextPath = pathInfo.indexOf('/',1);
+ if (nextPath > -1)
+ {
+ portletWindowId = pathInfo.substring(SERVLET_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX.length(),nextPath);
+ }
+ else
+ {
+ portletWindowId = pathInfo.substring(SERVLET_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX.length());
+ }
+ }
+ return portletWindowId;
+ }
+
+ public static final String stripWindowIdFromPathInfo(String pathInfo)
+ {
+ if (pathInfo != null && pathInfo.startsWith(SERVLET_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX))
+ {
+ int nextPath = pathInfo.indexOf('/',1);
+ pathInfo = nextPath > -1 ? pathInfo.substring(nextPath) : null;
+ }
+ return pathInfo;
+ }
+
+ public PortletRequestContext(ServletWebRequest request, WebResponse response)
+ {
+ HttpServletRequest servletRequest = request.getHttpServletRequest();
+ this.portletConfig = (PortletConfig)servletRequest.getAttribute("javax.portlet.config");
+ this.portletRequest = (PortletRequest)servletRequest.getAttribute("javax.portlet.request");
+ this.portletResponse = (PortletResponse)servletRequest.getAttribute("javax.portlet.response");
+ this.renderResponse = (portletResponse instanceof RenderResponse) ? (RenderResponse)portletResponse : null;
+ this.resourceURLFactory = (PortletResourceURLFactory)servletRequest.getAttribute(WicketPortlet.RESOURCE_URL_FACTORY_ATTR);
+ this.ajax = request.isAjax();
+ this.resourceRequest = "true".equals(servletRequest.getAttribute(WicketPortlet.PORTLET_RESOURCE_URL_ATTR));
+ this.embedded = !(ajax || resourceRequest);
+ this.headerResponse = embedded ? newPortletHeaderResponse(response) : null;
+ }
+
+ protected IHeaderResponse newPortletHeaderResponse(Response response)
+ {
+ return new EmbeddedPortletHeaderResponse(response);
+ }
+
+ public String getLastEncodedPath(String url)
+ {
+ if (url != null && lastEncodedUrl != null && url.equals(lastEncodedUrl[0]))
+ {
+ return lastEncodedUrl[1];
+ }
+ return null;
+ }
+
+ protected String saveLastEncodedUrl(String url, String path)
+ {
+ lastEncodedUrl[0] = url;
+ lastEncodedUrl[1] = path;
+ return url;
+ }
+
+ /**
+ * @see org.apache.wicket.RequestContext#encodeActionURL(java.lang.CharSequence)
+ */
+ public CharSequence encodeActionURL(CharSequence path)
+ {
+ if (resourceRequest)
+ {
+ return encodeResourceURL(path);
+ }
+ if ( path != null )
+ {
+ path = getQualifiedPath(path);
+ if (renderResponse != null)
+ {
+ PortletURL url = renderResponse.createActionURL();
+ url.setParameter(WicketPortlet.WICKET_URL_PORTLET_PARAMETER, path.toString());
+ path = saveLastEncodedUrl(url.toString(), path.toString());
+ }
+ }
+ return path;
+ }
+
+ /**
+ * @see org.apache.wicket.RequestContext#encodeMarkupId(java.lang.String)
+ */
+ public String encodeMarkupId(String markupId)
+ {
+ if ( markupId != null )
+ {
+ markupId = getNamespace() + "_" + markupId;
+ }
+ return markupId;
+ }
+
+ /**
+ * @see org.apache.wicket.RequestContext#encodeRenderURL(java.lang.CharSequence)
+ */
+ public CharSequence encodeRenderURL(CharSequence path)
+ {
+ if (resourceRequest)
+ {
+ return encodeResourceURL(path);
+ }
+ if ( path != null )
+ {
+ path = getQualifiedPath(path);
+ if (renderResponse != null)
+ {
+ PortletURL url = renderResponse.createRenderURL();
+ url.setParameter(WicketPortlet.WICKET_URL_PORTLET_PARAMETER, path.toString());
+ path = saveLastEncodedUrl(url.toString(), path.toString());
+ path = url.toString();
+ }
+ }
+ return path;
+ }
+
+ /**
+ * @see org.apache.wicket.RequestContext#encodeResourceURL(java.lang.CharSequence)
+ */
+ public CharSequence encodeResourceURL(CharSequence path)
+ {
+ if ( path != null )
+ {
+ path = getQualifiedPath(path);
+ if (renderResponse != null)
+ {
+ try
+ {
+ HashMap parameters = new HashMap(2);
+ parameters.put(WicketPortlet.WICKET_URL_PORTLET_PARAMETER, new String[]{path.toString()});
+ parameters.put(WicketPortlet.PORTLET_RESOURCE_URL_PARAMETER, new String[]{"true"});
+ path = saveLastEncodedUrl(resourceURLFactory.createResourceURL(portletConfig, (RenderRequest)portletRequest, renderResponse, parameters), path.toString());
+ }
+ catch (PortletException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ return path;
+ }
+
+ /**
+ * @see org.apache.wicket.RequestContext#encodeSharedResourceURL(java.lang.CharSequence)
+ */
+ public CharSequence encodeSharedResourceURL(CharSequence path)
+ {
+ if ( path != null )
+ {
+ String url = (SERVLET_RESOURCE_URL_PORTLET_WINDOW_ID_PREFIX.substring(1) + getPortletWindowId() + "/" + path);
+ return saveLastEncodedUrl(url,url);
+ }
+ return null;
+ }
+
+ /**
+ * @see org.apache.wicket.RequestContext#getHeaderResponse()
+ */
+ public IHeaderResponse getHeaderResponse()
+ {
+ return headerResponse;
+ }
+
+ /**
+ * @see org.apache.wicket.RequestContext#getNamespace()
+ */
+ public CharSequence getNamespace()
+ {
+ return renderResponse != null ? renderResponse.getNamespace() : "";
+ }
+
+ /**
+ * @see org.apache.wicket.RequestContext#isPortletRequest()
+ */
+ public boolean isPortletRequest()
+ {
+ return true;
+ }
+
+ public boolean isEmbedded()
+ {
+ return embedded;
+ }
+
+ protected String getQualifiedPath(CharSequence path)
+ {
+ HttpServletRequest request = ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest();
+ return request.getServletPath() + "/" + path;
+ }
+
+ protected String getPortletWindowId()
+ {
+ if (portletWindowId == null)
+ {
+ portletWindowId = PortletWindowUtils.getPortletWindowId(portletRequest.getPortletSession());
+ }
+ return portletWindowId;
+ }
+
+ public PortletConfig getPortletConfig()
+ {
+ return portletConfig;
+ }
+
+ public PortletRequest getPortletRequest()
+ {
+ return portletRequest;
+ }
+
+ public PortletResponse getPortletResponse()
+ {
+ return portletResponse;
+ }
+
+ public boolean isAjax()
+ {
+ return ajax;
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRequestContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRequestContext.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletRequestContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,138 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpSession;
+
+/**
+ * @author Ate Douma
+ */
+public class PortletServletRequestWrapper extends HttpServletRequestWrapper
+{
+ private ServletContext context;
+ private String contextPath;
+ private String servletPath;
+ private String pathInfo;
+ private String requestURI;
+ private String queryString;
+ private HttpSession session;
+
+ private static String decodePathInfo(HttpServletRequest request, String filterPath)
+ {
+ String pathInfo = request.getRequestURI().substring(request.getContextPath().length()+filterPath.length());
+ return pathInfo == null || pathInfo.length() < 2 ? null : pathInfo;
+ }
+
+ private static String makeServletPath(String filterPath)
+ {
+ return "/"+filterPath.substring(0,filterPath.length()-1);
+ }
+
+ protected PortletServletRequestWrapper(ServletContext context, HttpSession proxiedSession, HttpServletRequest request, String filterPath)
+ {
+ super(request);
+ this.context = context;
+ this.session = proxiedSession;
+ if ( proxiedSession == null )
+ {
+ this.session = request.getSession(false);
+ }
+ this.servletPath = makeServletPath(filterPath);
+ if ((this.contextPath = (String) request.getAttribute("javax.servlet.include.context_path")) != null)
+ {
+ this.requestURI = (String) request.getAttribute("javax.servlet.include.request_uri");
+ this.queryString = (String) request.getAttribute("javax.servlet.include.query_string");
+ }
+ else if ((this.contextPath = (String) request.getAttribute("javax.servlet.forward.context_path")) != null)
+ {
+ this.requestURI = (String) request.getAttribute("javax.servlet.forward.request_uri");
+ this.queryString = (String) request.getAttribute("javax.servlet.forward.query_string");
+ }
+ else
+ {
+ this.contextPath = request.getContextPath();
+ this.requestURI = request.getRequestURI();
+ this.queryString = request.getQueryString();
+ }
+ }
+
+ public PortletServletRequestWrapper(ServletContext context, HttpServletRequest request, HttpSession proxiedSession, String filterPath)
+ {
+ this(context, proxiedSession, request, filterPath);
+
+ String pathInfo = this.requestURI.substring(this.contextPath.length()+filterPath.length());
+ this.pathInfo = pathInfo == null || pathInfo.length() < 2 ? null : pathInfo;
+ }
+
+ public PortletServletRequestWrapper(ServletContext context, HttpServletRequest request, HttpSession proxiedSession, String filterPath, String pathInfo)
+ {
+ this(context, proxiedSession, request, filterPath);
+
+ this.pathInfo = pathInfo;
+ // override requestURI
+ this.requestURI = this.contextPath+this.servletPath+(pathInfo!=null?pathInfo:"");
+ }
+
+ public String getContextPath()
+ {
+ return contextPath;
+ }
+
+ public String getServletPath()
+ {
+ return servletPath;
+ }
+
+ public String getPathInfo()
+ {
+ return pathInfo;
+ }
+
+ public String getRequestURI()
+ {
+ return requestURI;
+ }
+
+ public String getQueryString()
+ {
+ return queryString;
+ }
+
+ public HttpSession getSession()
+ {
+ return getSession(true);
+ }
+
+ public HttpSession getSession(boolean create)
+ {
+ return session != null ? session : super.getSession(create);
+ }
+
+ public Object getAttribute(String name)
+ {
+ // TODO: check if these can possibly be set/handled
+ // nullifying these for now to prevent Wicket ServletWebRequest.getRelativePathPrefixToWicketHandler() going the wrong route
+ if ("javax.servlet.error.request_uri".equals(name) || "javax.servlet.forward.servlet_path".equals(name))
+ {
+ return null;
+ }
+ return super.getAttribute(name);
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletRequestWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletResponseWrapper.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletResponseWrapper.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletResponseWrapper.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletResponseWrapper.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,70 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import java.io.IOException;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
+/**
+ * @author Ate Douma
+ */
+public class PortletServletResponseWrapper extends HttpServletResponseWrapper
+{
+ private WicketResponseState responseState;
+
+ public PortletServletResponseWrapper(HttpServletResponse response, WicketResponseState responseState)
+ {
+ super(response);
+ this.responseState = responseState;
+ }
+
+ /**
+ * @see javax.servlet.http.HttpServletResponseWrapper#sendError(int, java.lang.String)
+ */
+ public void sendError(int errorCode, String errorMessage) throws IOException
+ {
+ responseState.setErrorCode(errorCode);
+ responseState.setErrorMessage(errorMessage);
+ }
+
+ /**
+ * @see javax.servlet.http.HttpServletResponseWrapper#sendError(int)
+ */
+ public void sendError(int errorCode) throws IOException
+ {
+ responseState.setErrorCode(errorCode);
+ responseState.setErrorMessage(null);
+ }
+
+ /**
+ * @see javax.servlet.http.HttpServletResponseWrapper#sendRedirect(java.lang.String)
+ */
+ public void sendRedirect(String redirectLocation) throws IOException
+ {
+ responseState.setRedirectLocation(redirectLocation);
+ }
+
+ /**
+ * @see javax.servlet.http.HttpServletResponseWrapper#setStatus(int)
+ */
+ public void setStatus(int statusCode)
+ {
+ responseState.setStatusCode(statusCode);
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletResponseWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletResponseWrapper.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/PortletServletResponseWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketFilterPortletContext.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketFilterPortletContext.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketFilterPortletContext.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketFilterPortletContext.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,87 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import java.io.IOException;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.RenderResponse;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.portals.bridges.util.ServletPortletSessionProxy;
+import org.apache.wicket.protocol.http.WebApplication;
+import org.apache.wicket.protocol.http.WebRequest;
+import org.apache.wicket.protocol.http.WebResponse;
+import org.apache.wicket.protocol.http.servlet.ServletWebRequest;
+import org.apache.wicket.settings.IRequestCycleSettings;
+
+/**
+ * @author Ate Douma
+ */
+public class WicketFilterPortletContext
+{
+ public void initFilter(FilterConfig filterConfig, WebApplication webApplication) throws ServletException
+ {
+ webApplication.getRequestCycleSettings().setRenderStrategy(IRequestCycleSettings.REDIRECT_TO_RENDER);
+ webApplication.getRequestCycleSettings().addResponseFilter(new PortletInvalidMarkupFilter());
+ }
+
+ public void setupFilter(FilterConfig config, FilterRequestContext filterRequestContext, String filterPath) throws IOException, ServletException
+ {
+ PortletConfig portletConfig = (PortletConfig)filterRequestContext.getRequest().getAttribute("javax.portlet.config");
+ if ( portletConfig != null )
+ {
+ WicketResponseState responseState = (WicketResponseState)filterRequestContext.getRequest().getAttribute(WicketPortlet.RESPONSE_STATE_ATTR);
+ filterRequestContext.setRequest(new PortletServletRequestWrapper(config.getServletContext(),filterRequestContext.getRequest(), ServletPortletSessionProxy.createProxy(filterRequestContext.getRequest()), filterPath));
+ if ( WicketPortlet.ACTION_REQUEST.equals(filterRequestContext.getRequest().getAttribute(WicketPortlet.REQUEST_TYPE_ATTR)))
+ {
+ filterRequestContext.setResponse(new PortletActionServletResponseWrapper(filterRequestContext.getResponse(), responseState));
+ }
+ else
+ {
+ filterRequestContext.setResponse(new PortletRenderServletResponseWrapper(filterRequestContext.getResponse(), (RenderResponse)filterRequestContext.getRequest().getAttribute("javax.portlet.response"),responseState));
+ }
+ }
+ else
+ {
+ ServletContext context = config.getServletContext();
+ HttpServletRequest request = filterRequestContext.getRequest();
+ String pathInfo = request.getRequestURI().substring(request.getContextPath().length()+filterPath.length());
+ String portletWindowId = PortletRequestContext.decodePortletWindowId(pathInfo);
+ if (portletWindowId != null)
+ {
+ HttpSession proxiedSession = ServletPortletSessionProxy.createProxy(request, portletWindowId);
+ pathInfo = PortletRequestContext.stripWindowIdFromPathInfo(pathInfo);
+ filterRequestContext.setRequest(new PortletServletRequestWrapper(context,request,proxiedSession, filterPath, pathInfo));
+ }
+ }
+ }
+
+ public boolean createPortletRequestContext(WebRequest request, WebResponse response)
+ {
+ if (request.getHttpServletRequest().getAttribute("javax.portlet.config") != null)
+ {
+ new PortletRequestContext((ServletWebRequest)request, response);
+ return true;
+ }
+ return false;
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketFilterPortletContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketFilterPortletContext.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketFilterPortletContext.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketPortlet.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketPortlet.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketPortlet.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketPortlet.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,321 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.portals.bridges.common.PortletResourceURLFactory;
+import org.apache.portals.bridges.common.ServletContextProvider;
+
+/**
+ * @author Ate Douma
+ */
+public class WicketPortlet extends GenericPortlet
+{
+ public static final String WICKET_URL_PORTLET_PARAMETER = "wicketUrl";
+ public static final String PORTLET_RESOURCE_URL_PARAMETER = "resourceUrl";
+ public static final String WICKET_FILTER_PATH_PARAM = "wicketFilterPath";
+ public static final String PARAM_SERVLET_CONTEXT_PROVIDER = "ServletContextProvider";
+ public static final String PARAM_PORTLET_RESOURCE_URL_FACTORY = "PortletResourceURLFactory";
+ public static final String ACTION_REQUEST = "ACTION";
+ public static final String VIEW_REQUEST = "VIEW";
+ public static final String RESOURCE_REQUEST = "RESOURCE";
+ public static final String CUSTOM_REQUEST = "CUSTOM";
+ public static final String EDIT_REQUEST = "EDIT";
+ public static final String HELP_REQUEST = "HELP";
+ public static final String REQUEST_TYPE_ATTR = WicketPortlet.class.getName() + "REQUEST_TYPE";
+ public static final String RESPONSE_STATE_ATTR = WicketResponseState.class.getName();
+ public static final String RESOURCE_URL_FACTORY_ATTR = PortletResourceURLFactory.class.getName();
+ public static final String PORTLET_RESOURCE_URL_ATTR = "resourceUrl";
+
+ private ServletContextProvider servletContextProvider;
+ private PortletResourceURLFactory resourceURLFactory;
+ private String wicketFilterPath;
+
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+ String contextProviderClassName = getContextProviderClassNameParameter(config);
+ if (contextProviderClassName == null)
+ {
+ contextProviderClassName = config.getPortletContext().getInitParameter(
+ ServletContextProvider.class.getName());
+ }
+ if (contextProviderClassName == null)
+ {
+ throw new PortletException("Portlet " + config.getPortletName()
+ + " is incorrectly configured. Init parameter "
+ + PARAM_SERVLET_CONTEXT_PROVIDER + " not specified, nor context parameter "
+ + ServletContextProvider.class.getName() + ".");
+ }
+ try
+ {
+ Class clazz = Class.forName(contextProviderClassName);
+ servletContextProvider = (ServletContextProvider)clazz.newInstance();
+ }
+ catch (Exception e)
+ {
+ if (e instanceof PortletException)
+ {
+ throw (PortletException)e;
+ }
+ throw new PortletException("Initialization failure", e);
+ }
+
+ String resourceURLFactoryClassName = getPortletResourceURLFactoryClassNameParameter(config);
+ if (resourceURLFactoryClassName == null)
+ {
+ resourceURLFactoryClassName = config.getPortletContext().getInitParameter(
+ PortletResourceURLFactory.class.getName());
+ }
+ if (resourceURLFactoryClassName == null)
+ {
+ throw new PortletException("Portlet " + config.getPortletName()
+ + " is incorrectly configured. Init parameter "
+ + PARAM_PORTLET_RESOURCE_URL_FACTORY + " not specified, nor context parameter "
+ + PortletResourceURLFactory.class.getName() + ".");
+ }
+ try
+ {
+ Class clazz = Class.forName(resourceURLFactoryClassName);
+ resourceURLFactory = (PortletResourceURLFactory)clazz.newInstance();
+ }
+ catch (Exception e)
+ {
+ if (e instanceof PortletException)
+ {
+ throw (PortletException)e;
+ }
+ throw new PortletException("Initialization failure", e);
+ }
+
+ wicketFilterPath = config.getInitParameter(WICKET_FILTER_PATH_PARAM);
+ if (wicketFilterPath == null || wicketFilterPath.length() == 0)
+ {
+ wicketFilterPath = "/";
+ }
+ else
+ {
+ if (!wicketFilterPath.startsWith("/"))
+ {
+ wicketFilterPath = "/" + wicketFilterPath;
+ }
+ if (wicketFilterPath.endsWith("*"))
+ {
+ wicketFilterPath = wicketFilterPath.substring(0, wicketFilterPath.length() - 1);
+ }
+ if (!wicketFilterPath.endsWith("/"))
+ {
+ wicketFilterPath += "/";
+ }
+ }
+ }
+
+ public void processAction(ActionRequest request, ActionResponse response)
+ throws PortletException, IOException
+ {
+ processRequest(request, response, ACTION_REQUEST);
+ }
+
+ protected void doView(RenderRequest request, RenderResponse response) throws PortletException,
+ IOException
+ {
+ processRequest(request, response, VIEW_REQUEST);
+ }
+
+ public void destroy()
+ {
+ resourceURLFactory = null;
+ servletContextProvider = null;
+ super.destroy();
+ }
+
+ protected String getContextProviderClassNameParameter(PortletConfig config)
+ {
+ return config.getInitParameter(PARAM_SERVLET_CONTEXT_PROVIDER);
+ }
+
+ protected String getPortletResourceURLFactoryClassNameParameter(PortletConfig config)
+ {
+ return config.getInitParameter(PARAM_PORTLET_RESOURCE_URL_FACTORY);
+ }
+
+ protected ServletContextProvider getServletContextProvider()
+ {
+ return servletContextProvider;
+ }
+
+ protected ServletContext getServletContext(GenericPortlet portlet, PortletRequest request,
+ PortletResponse response)
+ {
+ return getServletContextProvider().getServletContext(portlet);
+ }
+
+ protected HttpServletRequest getHttpServletRequest(GenericPortlet portlet,
+ PortletRequest request, PortletResponse response)
+ {
+ return getServletContextProvider().getHttpServletRequest(portlet, request);
+ }
+
+ protected HttpServletResponse getHttpServletResponse(GenericPortlet portlet,
+ PortletRequest request, PortletResponse response)
+ {
+ return getServletContextProvider().getHttpServletResponse(portlet, response);
+ }
+
+ protected void processRequest(PortletRequest request, PortletResponse response,
+ String requestType) throws PortletException, IOException
+ {
+ String wicketURL = request.getParameter(WICKET_URL_PORTLET_PARAMETER);
+
+ if (wicketURL == null)
+ {
+ wicketURL = wicketFilterPath;
+ }
+
+ boolean actionRequest = ACTION_REQUEST.equals(requestType);
+
+ WicketResponseState responseState = new WicketResponseState();
+
+ request.setAttribute(RESPONSE_STATE_ATTR, responseState);
+ request.setAttribute(RESOURCE_URL_FACTORY_ATTR, resourceURLFactory);
+ request.setAttribute(REQUEST_TYPE_ATTR, requestType);
+ String portletResourceURL = request.getParameter(PORTLET_RESOURCE_URL_PARAMETER);
+ if (portletResourceURL != null)
+ {
+ request.setAttribute(PORTLET_RESOURCE_URL_ATTR,portletResourceURL);
+ }
+
+ if (actionRequest)
+ {
+ ServletContext servletContext = getServletContext(this, request, response);
+ HttpServletRequest req = getHttpServletRequest(this, request, response);
+ HttpServletResponse res = getHttpServletResponse(this, request, response);
+ RequestDispatcher rd = servletContext.getRequestDispatcher(wicketURL);
+
+ if (rd != null)
+ {
+ // http://issues.apache.org/jira/browse/PB-2:
+ // provide servlet access to the Portlet components even from
+ // an actionRequest in extension to the JSR-168 requirement
+ // PLT.16.3.2 which (currently) only covers renderRequest
+ // servlet inclusion.
+ if (req.getAttribute("javax.portlet.config") == null)
+ {
+ req.setAttribute("javax.portlet.config", getPortletConfig());
+ }
+ if (req.getAttribute("javax.portlet.request") == null)
+ {
+ req.setAttribute("javax.portlet.request", request);
+ }
+ if (req.getAttribute("javax.portlet.response") == null)
+ {
+ req.setAttribute("javax.portlet.response", response);
+ }
+ try
+ {
+ rd.include(req, res);
+ processActionResponseState(wicketURL, (ActionRequest)request, (ActionResponse)response, responseState);
+ }
+ catch (ServletException e)
+ {
+ throw new PortletException(e);
+ }
+ }
+ }
+ else
+ {
+ PortletRequestDispatcher rd = null;
+ String previousURL = null;
+ while (true)
+ {
+ rd = getPortletContext().getRequestDispatcher(wicketURL);
+ if (rd != null)
+ {
+ rd.include((RenderRequest)request, (RenderResponse)response);
+ String redirectLocation = responseState.getRedirectLocation();
+ if (redirectLocation != null)
+ {
+ boolean matchStart = redirectLocation.startsWith(wicketFilterPath);
+ if (!matchStart && (redirectLocation+"/").equals(wicketFilterPath))
+ {
+ redirectLocation += "/";
+ matchStart = true;
+ }
+ if (portletResourceURL != null)
+ {
+ if (matchStart)
+ {
+ HashMap parameters = new HashMap(2);
+ parameters.put(WICKET_URL_PORTLET_PARAMETER, new String[]{redirectLocation});
+ parameters.put(PORTLET_RESOURCE_URL_PARAMETER, new String[]{"true"});
+ redirectLocation = resourceURLFactory.createResourceURL(getPortletConfig(), (RenderRequest)request, (RenderResponse)response, parameters);
+ }
+ getHttpServletResponse(this, request, response).sendRedirect(redirectLocation);
+ }
+ else if (matchStart && ((previousURL == null || previousURL != redirectLocation)))
+ {
+ previousURL = wicketURL;
+ wicketURL = redirectLocation;
+ ((RenderResponse)response).reset();
+ responseState.reset();
+ continue;
+ }
+ else
+ {
+ // TODO: unhandled/unsupport RenderResponse redirect
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ protected void processActionResponseState(String wicketURL, ActionRequest request, ActionResponse response, WicketResponseState responseState) throws PortletException, IOException
+ {
+ if ( responseState.getRedirectLocation() != null )
+ {
+ wicketURL = responseState.getRedirectLocation();
+ if (wicketURL.startsWith(wicketFilterPath))
+ {
+ response.setRenderParameter(WICKET_URL_PORTLET_PARAMETER, wicketURL);
+ }
+ else
+ {
+ response.sendRedirect(responseState.getRedirectLocation());
+ }
+ }
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketPortlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketPortlet.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketPortlet.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketResponseState.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketResponseState.java?rev=572321&view=auto
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketResponseState.java (added)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketResponseState.java Mon Sep 3 06:24:05 2007
@@ -0,0 +1,108 @@
+/*
+ * 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.wicket.protocol.http.portlet;
+
+/**
+ * @author Ate Douma
+ */
+public class WicketResponseState
+{
+ private int errorCode;
+ private String errorMessage;
+ private int statusCode;
+ private String redirectLocation;
+
+ /**
+ * Gets errorCode.
+ * @return errorCode
+ */
+ public int getErrorCode()
+ {
+ return errorCode;
+ }
+
+ /**
+ * Sets errorCode.
+ * @param errorCode errorCode
+ */
+ public void setErrorCode(int errorCode)
+ {
+ this.errorCode = errorCode;
+ }
+
+ /**
+ * Gets errorMessage.
+ * @return errorMessage
+ */
+ public String getErrorMessage()
+ {
+ return errorMessage;
+ }
+
+ /**
+ * Sets errorMessage.
+ * @param errorMessage errorMessage
+ */
+ public void setErrorMessage(String errorMessage)
+ {
+ this.errorMessage = errorMessage;
+ }
+
+ /**
+ * Gets redirectLocation.
+ * @return redirectLocation
+ */
+ public String getRedirectLocation()
+ {
+ return redirectLocation;
+ }
+
+ /**
+ * Sets redirectLocation.
+ * @param redirectLocation redirectLocation
+ */
+ public void setRedirectLocation(String redirectLocation)
+ {
+ this.redirectLocation = redirectLocation;
+ }
+
+ /**
+ * Gets statusCode.
+ * @return statusCode
+ */
+ public int getStatusCode()
+ {
+ return statusCode;
+ }
+
+ /**
+ * Sets statusCode.
+ * @param statusCode statusCode
+ */
+ public void setStatusCode(int statusCode)
+ {
+ this.statusCode = statusCode;
+ }
+
+ public void reset()
+ {
+ errorCode = 0;
+ errorMessage = null;
+ statusCode = 0;
+ redirectLocation = null;
+ }
+}
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketResponseState.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketResponseState.java
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: wicket/branches/wicket-1.3.0-beta3-portlet-support/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/portlet/WicketResponseState.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: wicket/branches/wicket-1.3.0-beta3-portlet-support/pom.xml
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.0-beta3-portlet-support/pom.xml?rev=572321&r1=572320&r2=572321&view=diff
==============================================================================
--- wicket/branches/wicket-1.3.0-beta3-portlet-support/pom.xml (original)
+++ wicket/branches/wicket-1.3.0-beta3-portlet-support/pom.xml Mon Sep 3 06:24:05 2007
@@ -407,6 +407,20 @@
<version>1.4-rc3</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.bridges</groupId>
+ <artifactId>portals-bridges-common</artifactId>
+ <version>1.0.3</version>
+ <scope>provided</scope>
+ <optional>true</optional>
+ </dependency>
</dependencies>
</dependencyManagement>
<dependencies>