JBoss Portal SVN: r8816 - modules/test/branches/JBP_TEST_BRANCH_1_0/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-01 09:48:13 -0400 (Thu, 01 Nov 2007)
New Revision: 8816
Modified:
modules/test/branches/JBP_TEST_BRANCH_1_0/build/build-thirdparty.xml
Log:
Use correct libs
Modified: modules/test/branches/JBP_TEST_BRANCH_1_0/build/build-thirdparty.xml
===================================================================
--- modules/test/branches/JBP_TEST_BRANCH_1_0/build/build-thirdparty.xml 2007-11-01 13:47:39 UTC (rev 8815)
+++ modules/test/branches/JBP_TEST_BRANCH_1_0/build/build-thirdparty.xml 2007-11-01 13:48:13 UTC (rev 8816)
@@ -47,7 +47,7 @@
are pushed to the http://repository.jboss.com site.
-->
- <componentref name="jboss-portal/modules/common" version="1.0.0"/>
+ <componentref name="jboss-portal/modules/common" version="trunk-SNAPSHOT"/>
<componentref name="codehaus/cargo" version="0.9"/>
16 years, 6 months
JBoss Portal SVN: r8815 - in modules/portlet/branches/JBP_PORTLET_BRANCH_1_0: bridge/src/main/org/jboss/portal/portlet/bridge and 9 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-01 09:47:39 -0400 (Thu, 01 Nov 2007)
New Revision: 8815
Removed:
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeRequest.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/ide/intellij/idea60/modules/portlet/samples.iml
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/local.properties
Modified:
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeResponse.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/JBossServletContextProvider.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build-thirdparty.xml
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/jboss-portal-portlet.ipr
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
Log:
Apply bridge fix, module dependency and minor stuff
Deleted: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeRequest.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeRequest.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeRequest.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -1,329 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.bridge;
-
-import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-
-import javax.portlet.PortletRequest;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6862 $
- */
-public class BridgeRequest implements HttpServletRequest
-{
-
- protected final PortletRequest preq;
- protected final HttpServletRequest hreq;
-
- public BridgeRequest(JBossServletContextProvider.BridgeInfo info)
- {
- PortletInvocation invocation = info.getInvocation();
- this.hreq = invocation.getDispatchedRequest();
- this.preq = (PortletRequest)hreq.getAttribute("javax.portlet.request");
- }
-
- public String getProtocol()
- {
- return null;
- }
-
- public String getRemoteAddr()
- {
- return null;
- }
-
- public String getRemoteHost()
- {
- return null;
- }
-
- public String getRealPath(String s)
- {
- return null;
- }
-
- public StringBuffer getRequestURL()
- {
- return null;
- }
-
- public String getPathInfo()
- {
- return hreq.getPathInfo();
- }
-
- public String getQueryString()
- {
- return hreq.getQueryString();
- }
-
- public String getServletPath()
- {
- return hreq.getServletPath();
- }
-
- public String getRequestURI()
- {
- return hreq.getRequestURI();
- }
-
- public String getPathTranslated()
- {
- return hreq.getPathTranslated();
- }
-
- public String getScheme()
- {
- return preq.getScheme();
- }
-
- public String getServerName()
- {
- return preq.getServerName();
- }
-
- public int getServerPort()
- {
- return preq.getServerPort();
- }
-
- public Object getAttribute(String name)
- {
- return preq.getAttribute(name);
- }
-
- public Enumeration getAttributeNames()
- {
- return preq.getAttributeNames();
- }
-
- public void setAttribute(String name, Object value)
- {
- preq.setAttribute(name, value);
- }
-
- public void removeAttribute(String name)
- {
- preq.removeAttribute(name);
- }
-
- public Locale getLocale()
- {
- return preq.getLocale();
- }
-
- public Enumeration getLocales()
- {
- return preq.getLocales();
- }
-
- public boolean isSecure()
- {
- return preq.isSecure();
- }
-
- public String getAuthType()
- {
- return preq.getAuthType();
- }
-
- public String getContextPath()
- {
- return preq.getContextPath();
- }
-
- public String getRemoteUser()
- {
- return preq.getRemoteUser();
- }
-
- public Principal getUserPrincipal()
- {
- return preq.getUserPrincipal();
- }
-
- public String getRequestedSessionId()
- {
- return preq.getRequestedSessionId();
- }
-
- public boolean isRequestedSessionIdValid()
- {
- return preq.isRequestedSessionIdValid();
- }
-
- public String getParameter(String s)
- {
- return preq.getParameter(s);
- }
-
- public Enumeration getParameterNames()
- {
- return preq.getParameterNames();
- }
-
- public String[] getParameterValues(String s)
- {
- return preq.getParameterValues(s);
- }
-
- public Map getParameterMap()
- {
- return preq.getParameterMap();
- }
-
- public String getCharacterEncoding()
- {
- return null;
- }
-
- public void setCharacterEncoding(String s) throws UnsupportedEncodingException
- {
- }
-
- public int getContentLength()
- {
- return 0;
- }
-
- public String getContentType()
- {
- return null;
- }
-
- public ServletInputStream getInputStream() throws IOException
- {
- return null;
- }
-
- public BufferedReader getReader() throws IOException
- {
- return null;
- }
-
- // Must be based on properties provided by the getProperties method of the PortletRequest interface
-
- public String getHeader(String name)
- {
- return null;
- }
-
- public Enumeration getHeaders(String names)
- {
- return null;
- }
-
- public Enumeration getHeaderNames()
- {
- return null;
- }
-
- public Cookie[] getCookies()
- {
- return new Cookie[0];
- }
-
- public long getDateHeader(String s)
- {
- return 0;
- }
-
- public int getIntHeader(String s)
- {
- return 0;
- }
-
- public String getMethod()
- {
- return "GET";
- }
-
- public RequestDispatcher getRequestDispatcher(String s)
- {
- return hreq.getRequestDispatcher(s);
- }
-
- public boolean isUserInRole(String roleName)
- {
- return preq.isUserInRole(roleName);
- }
-
- public HttpSession getSession(boolean create)
- {
- return hreq.getSession(create);
- }
-
- public HttpSession getSession()
- {
- return hreq.getSession();
- }
-
- public boolean isRequestedSessionIdFromCookie()
- {
- return false;
- }
-
- public boolean isRequestedSessionIdFromURL()
- {
- return false;
- }
-
- public boolean isRequestedSessionIdFromUrl()
- {
- return false;
- }
-
- public int getRemotePort()
- {
- throw new UnsupportedOperationException("NYI");
- }
-
- public String getLocalName()
- {
- throw new UnsupportedOperationException("NYI");
- }
-
- public String getLocalAddr()
- {
- throw new UnsupportedOperationException("NYI");
- }
-
- public int getLocalPort()
- {
- throw new UnsupportedOperationException("NYI");
- }
-}
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeResponse.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeResponse.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/BridgeResponse.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -22,24 +22,25 @@
******************************************************************************/
package org.jboss.portal.portlet.bridge;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
import javax.portlet.PortletResponse;
import javax.portlet.RenderResponse;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Locale;
+import javax.servlet.http.HttpServletResponseWrapper;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 6862 $
*/
-public class BridgeResponse implements HttpServletResponse
+public class BridgeResponse extends HttpServletResponseWrapper
{
/** . */
@@ -53,6 +54,7 @@
public BridgeResponse(JBossServletContextProvider.BridgeInfo info)
{
+ super(info.getInvocation().getDispatchedResponse());
invocation = info.getInvocation();
HttpServletRequest hreq = invocation.getDispatchedRequest();
this.presp = (PortletResponse)hreq.getAttribute("javax.portlet.response");
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/JBossServletContextProvider.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/JBossServletContextProvider.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/bridge/src/main/org/jboss/portal/portlet/bridge/JBossServletContextProvider.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -22,11 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.bridge;
-import org.apache.portals.bridges.common.ServletContextProvider;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.container.PortletContainerInvoker;
-import org.jboss.portal.portlet.container.PortletContainer;
-
import javax.portlet.GenericPortlet;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
@@ -34,6 +29,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.portals.bridges.common.ServletContextProvider;
+import org.jboss.portal.portlet.container.PortletContainer;
+import org.jboss.portal.portlet.container.PortletContainerInvoker;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+
/**
* The JBoss implementation of <code>org.apache.portals.bridges.common.ServletContextProvider</code> use thread local
* variables to keep the request associated with the current thread of execution.
@@ -102,7 +102,7 @@
/** Lazy initialisation of the bridge info. */
private void init(BridgeInfo bridgeInfo)
{
- bridgeInfo.breq = new BridgeRequest(bridgeInfo);
+ bridgeInfo.breq = bridgeInfo.getInvocation().getDispatchedRequest();
bridgeInfo.bresp = new BridgeResponse(bridgeInfo);
}
@@ -115,10 +115,10 @@
private final ServletContext ctx;
/** The bridge response. */
- private BridgeRequest breq;
+ private HttpServletRequest breq;
/** The bridge response. */
- private BridgeResponse bresp;
+ private HttpServletResponse bresp;
public BridgeInfo(PortletInvocation invocation)
{
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build-thirdparty.xml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build-thirdparty.xml 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/build-thirdparty.xml 2007-11-01 13:47:39 UTC (rev 8815)
@@ -46,9 +46,9 @@
are pushed to the http://repository.jboss.com site.
-->
- <componentref name="jboss-portal/modules/common" version="1.0.0"/>
+ <componentref name="jboss-portal/modules/common" version="trunk-SNAPSHOT"/>
<componentref name="jboss-portal/modules/web" version="1.0.0"/>
- <componentref name="jboss-portal/modules/test" version="1.0.0"/>
+ <componentref name="jboss-portal/modules/test" version="1.0-SNAPSHOT"/>
<componentref name="sun-servlet" version="2.4"/>
<componentref name="sun-jaf" version="1.1"/>
Deleted: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/ide/intellij/idea60/modules/portlet/samples.iml
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/ide/intellij/idea60/modules/portlet/samples.iml 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/ide/intellij/idea60/modules/portlet/samples.iml 2007-11-01 13:47:39 UTC (rev 8815)
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
- <component name="NewModuleRootManager" inherit-compiler-output="false">
- <output url="file://$MODULE_DIR$/../../../../../../samples/output/idea50/classes" />
- <exclude-output />
- <content url="file://$MODULE_DIR$/../../../../../../samples">
- <sourceFolder url="file://$MODULE_DIR$/../../../../../../samples/src/main" isTestSource="false" />
- <excludeFolder url="file://$MODULE_DIR$/../../../../../../samples/output" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="module" module-name="api" />
- <orderEntry type="module" module-name="common" />
- <orderEntry type="module" module-name="portlet" />
- <orderEntry type="module-library">
- <library>
- <CLASSES>
- <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-log4j/lib/log4j.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntryProperties />
- </component>
- <component name="VcsManagerConfiguration">
- <option name="ACTIVE_VCS_NAME" value="svn" />
- <option name="USE_PROJECT_VCS" value="false" />
- </component>
- <component name="copyright">
- <Base>
- <setting name="state" value="1" />
- </Base>
- <LanguageOptions name="$TEMPLATE$">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="true" />
- <option name="separateAfter" value="true" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="true" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="JBoss, a division of Red Hat Copyright &#36;today.year, Red Hat Middleware, LLC, and individual contributors as indicated by the @authors tag. See the copyright.txt in the distribution for a full listing of individual contributors. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free Software Foundation, Inc., 51 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="4" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="CSS">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="HTML">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="JAVA">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="JSP">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="JavaScript">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="Properties">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="XML">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- </component>
-</module>
-
Deleted: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/local.properties
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/local.properties 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/build/local.properties 2007-11-01 13:47:39 UTC (rev 8815)
@@ -1,48 +0,0 @@
-### ====================================================================== ###
-## ##
-## Local project properties. ##
-## ##
-## Define properties that are local to your environment here. This ##
-## file (local.properties) should not be checked in. Modify the ##
-## example to affect all users. ##
-## ##
-### ====================================================================== ###
-
-### General compiler configuration ###
-
-#build.compiler=jikes
-#build.warnings=true
-#build.pedantic=true
-#javac.depend=on
-
-### Javac/Jikes compiler configuration ###
-
-javac.optimize=off
-javac.debug=on
-javac.deprecation=on
-
-### Enable verbose build output ###
-
-#init.verbose=true
-
-### JavaDoc ###
-#docs-javadocs.disable=true
-
-### Do we build xdoclet or get it from thirdparty ###
-### uncomment for thirdparty: comment to use xdoclet module.
-### To use xdoclet module also uncomment the xdoclet line in groups in build/build.xml
-#xdoclet.xdoclet.root=${project.root}/thirdparty/xdoclet
-
-# Portal database, for now : hsqldb, mysql, postgresql are the possible values
-portal.database=mysql
-# The datasource name used in the JNDI binding
-portal.datasource.name=PortalDS
-# Context root for the portal main servlet
-portal.web.context-root=/portal
-# JBoss server/<xxx> directory for JBoss Portal, ie: $JBOSS_HOME/server/default
-portal.deploy.dir=default/deploy
-portal-ha.deploy.dir=all/deploy
-# Show SQL or not
-portal.sql.show=false
-# Uncomment if you want to use a specific JBoss home path otherwise the build will use the JBOSS_HOME env variable
-#jboss.home=
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/jboss-portal-portlet.ipr
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/jboss-portal-portlet.ipr 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/jboss-portal-portlet.ipr 2007-11-01 13:47:39 UTC (rev 8815)
@@ -61,7 +61,6 @@
<option name="OUTPUT_DIRECTORY" />
</component>
<component name="GUI Designer component loader factory" />
- <component name="IdProvider" IDEtalkID="E2A438D8B6AE84F43587A2210E562521" />
<component name="InspectionProjectProfileManager">
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
@@ -88,6 +87,36 @@
<option name="myVal" value="100" />
</server>
</used_levels>
+ <inspection_tool class="JavaDoc" level="WARNING" enabled="false">
+ <option name="TOP_LEVEL_CLASS_OPTIONS">
+ <value>
+ <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+ <option name="REQUIRED_TAGS" value="" />
+ </value>
+ </option>
+ <option name="INNER_CLASS_OPTIONS">
+ <value>
+ <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+ <option name="REQUIRED_TAGS" value="" />
+ </value>
+ </option>
+ <option name="METHOD_OPTIONS">
+ <value>
+ <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+ <option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
+ </value>
+ </option>
+ <option name="FIELD_OPTIONS">
+ <value>
+ <option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
+ <option name="REQUIRED_TAGS" value="" />
+ </value>
+ </option>
+ <option name="IGNORE_DEPRECATED" value="false" />
+ <option name="IGNORE_JAVADOC_PERIOD" value="true" />
+ <option name="myAdditionalJavadocTags" value="" />
+ </inspection_tool>
+ <inspection_tool class="DuplicateThrows" level="WARNING" enabled="false" />
</profile>
</profiles>
</component>
@@ -284,13 +313,10 @@
<module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/management/management.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/management/management.iml" />
<module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/portlet/portlet.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/portlet/portlet.iml" />
<module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/test/test.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/test/test.iml" />
- <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/testsuite/testsuite.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/testsuite/testsuite.iml" />
- <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/thirdparty/thirdparty.iml" />
- <module fileurl="file://$PROJECT_DIR$/build/ide/intellij/idea60/modules/tools/tools.iml" filepath="$PROJECT_DIR$/build/ide/intellij/idea60/modules/tools/tools.iml" />
</modules>
</component>
- <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="false" project-jdk-name="1.5" project-jdk-type="JavaSDK">
- <output url="file://$PROJECT_DIR$/output" />
+ <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.5" project-jdk-type="JavaSDK">
+ <output url="file://$PROJECT_DIR$/classes" />
</component>
<component name="ProjectRunConfigurationManager" />
<component name="RmicSettings">
@@ -300,10 +326,6 @@
<option name="GENERATE_IIOP_STUBS" value="false" />
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component>
- <component name="StarteamVcsAdapter" />
- <component name="VssVcs">
- <SourceSafePersistencyRemovedFolder>$PROJECT_DIR$/wsrp/src/resources/test</SourceSafePersistencyRemovedFolder>
- </component>
<component name="com.intellij.jsf.UserDefinedFacesConfigs">
<option name="USER_DEFINED_CONFIGS">
<value>
@@ -311,179 +333,6 @@
</value>
</option>
</component>
- <component name="copyright">
- <Base>
- <setting name="state" value="1" />
- </Base>
- <LanguageOptions name="$TEMPLATE$">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="true" />
- <option name="separateAfter" value="true" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="true" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="JBoss, a division of Red Hat Copyright &#36;today.year, Red Hat Middleware, LLC, and individual contributors as indicated by the @authors tag. See the copyright.txt in the distribution for a full listing of individual contributors. This is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this software; if not, write to the Free Software Foundation, Inc., 51 Fr!
anklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF site: http://www.fsf.org." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="4" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="CSS">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="1" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="HTML">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="1" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="JAVA">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="JSP">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="1" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="JavaScript">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="1" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="Properties">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="1" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- <LanguageOptions name="XML">
- <option name="templateOptions">
- <value>
- <option name="block" value="true" />
- <option name="separateBefore" value="false" />
- <option name="separateAfter" value="false" />
- <option name="prefixLines" value="true" />
- <option name="lenBefore" value="80" />
- <option name="lenAfter" value="80" />
- <option name="box" value="false" />
- <option name="filler" value=" " />
- </value>
- </option>
- <option name="notice" value="Copyright (c) &#36;today.year, Your Corporation. All Rights Reserved." />
- <option name="keyword" value="Copyright" />
- <option name="fileTypeOverride" value="2" />
- <option name="relativeBefore" value="true" />
- <option name="addBlankAfter" value="true" />
- <option name="fileLocation" value="1" />
- <option name="useAlternate" value="false" />
- </LanguageOptions>
- </component>
<component name="libraryTable" />
<component name="uidesigner-configuration">
<option name="INSTRUMENT_CLASSES" value="true" />
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/container/PortletApplicationContext.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -42,6 +42,13 @@
ServletContext getServletContext();
/**
+ * Returns the context path of the web application
+ *
+ * @return the context path
+ */
+ String getContextPath();
+
+ /**
* Return the classloader.
*
* @return the classloader
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -71,6 +71,9 @@
/** . */
private PortletApplicationRegistrationContext registrationContext;
+
+ /** . */
+ private String contextPath;
public PortletApplicationContextImpl(
PortletApplicationRegistry registry,
@@ -79,7 +82,8 @@
PortletApplicationMetaData portletAppMD,
JBossApplicationMetaData jbossAppMD,
ServletContext servletContext,
- ClassLoader classLoader)
+ ClassLoader classLoader,
+ String contextPath)
{
this.registry = registry;
this.portletAPIFactory = portletAPIFactory;
@@ -88,6 +92,7 @@
this.jbossAppMD = jbossAppMD;
this.servletContext = servletContext;
this.classLoader = classLoader;
+ this.contextPath = contextPath;
}
public PortletApplicationImpl getPortletApplication()
@@ -189,6 +194,11 @@
return servletContext;
}
+ public String getContextPath()
+ {
+ return contextPath;
+ }
+
public ClassLoader getClassLoader()
{
return classLoader;
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletContainerImpl.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -220,7 +220,7 @@
bundleMgr);
// Create meta data
- PortletInfo info = application.getPortletInfoFactory().createPortletInfo(metaData, jbossMetaData, bundleMgr);
+ PortletInfo info = application.getPortletInfoFactory().createPortletInfo(application.getContext(), metaData, jbossMetaData, bundleMgr);
// Finally initialize the porlet instance
try
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/PortletInfoFactoryImpl.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.impl.jsr168.spi.PortletInfoFactory;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPortletInfo;
@@ -35,8 +36,8 @@
*/
public class PortletInfoFactoryImpl implements PortletInfoFactory
{
- public PortletInfo createPortletInfo(PortletMetaData portletMD, JBossPortletMetaData jbossPortletMD, ResourceBundleManager resourceBundleManager)
+ public PortletInfo createPortletInfo(PortletApplicationContext portletApplicationContext, PortletMetaData portletMD, JBossPortletMetaData jbossPortletMD, ResourceBundleManager resourceBundleManager)
{
- return new ContainerPortletInfo(portletMD, jbossPortletMD, resourceBundleManager);
+ return new ContainerPortletInfo(portletApplicationContext, portletMD, jbossPortletMD, resourceBundleManager);
}
}
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/api/PortletRequestImpl.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -32,10 +32,10 @@
import org.jboss.portal.portlet.impl.jsr168.PortletRequestAttributes;
import org.jboss.portal.portlet.impl.jsr168.info.ContainerPreferencesInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.RequestContext;
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.spi.UserContext;
+import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.portlet.state.PropertyContext;
import javax.portlet.PortalContext;
@@ -75,7 +75,7 @@
protected UserContext userContext;
protected SecurityContext securityContext;
protected RequestContext requestContext;
- protected InstanceContext instanceContext;
+ protected WindowContext windowContext;
protected PortletPreferences preferences;
protected PortletContainerImpl container;
protected HttpServletRequest dreq;
@@ -96,7 +96,7 @@
this.userContext = invocation.getUserContext();
this.securityContext = invocation.getSecurityContext();
this.requestContext = invocation.getRequestContext();
- this.instanceContext = invocation.getInstanceContext();
+ this.windowContext = invocation.getWindowContext();
this.container = (PortletContainerImpl)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER);
this.dreq = invocation.getDispatchedRequest();
this.portalContext = new PortalContextImpl(invocation.getPortalContext());
@@ -393,7 +393,7 @@
PortletApplicationImpl portletApp = (PortletApplicationImpl)container.getApplication();
psession = new PortletSessionImpl(
hsession,
- instanceContext.getId(),
+ windowContext.getId(),
portletApp.getPortletContext());
}
else if (psession == null)
@@ -407,7 +407,7 @@
PortletApplicationImpl portletApp = (PortletApplicationImpl)container.getApplication();
psession = new PortletSessionImpl(
hsession,
- instanceContext.getId(),
+ windowContext.getId(),
portletApp.getPortletContext());
}
}
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/info/ContainerPortletInfo.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.impl.jsr168.info;
import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.info.CacheInfo;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
@@ -52,6 +53,7 @@
private Boolean remotable;
public ContainerPortletInfo(
+ PortletApplicationContext portletApplicationContext,
PortletMetaData portletMD,
JBossPortletMetaData jbossPortletMD,
ResourceBundleManager bundleMgr)
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/spi/PortletInfoFactory.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.spi;
+import org.jboss.portal.portlet.container.PortletApplicationContext;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
@@ -45,6 +46,7 @@
* @return the runtime portlet meta data
*/
PortletInfo createPortletInfo(
+ PortletApplicationContext portletApplicationContext,
PortletMetaData portletMD,
JBossPortletMetaData jbossPortletMD,
ResourceBundleManager resourceBundleManager);
Modified: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java
===================================================================
--- modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-11-01 13:45:40 UTC (rev 8814)
+++ modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/test/src/main/org/jboss/portal/portlet/test/PortletApplicationDeployment.java 2007-11-01 13:47:39 UTC (rev 8815)
@@ -250,4 +250,9 @@
{
throw new NotYetImplemented();
}
+
+ public String getContextPath()
+ {
+ throw new NotYetImplemented();
+ }
}
16 years, 6 months
JBoss Portal SVN: r8814 - branches/JBoss_Portal_Branch_2_6/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-01 09:45:40 -0400 (Thu, 01 Nov 2007)
New Revision: 8814
Modified:
branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml
Log:
Use correct libraries
Modified: branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml 2007-11-01 12:57:24 UTC (rev 8813)
+++ branches/JBoss_Portal_Branch_2_6/build/build-thirdparty.xml 2007-11-01 13:45:40 UTC (rev 8814)
@@ -49,9 +49,9 @@
<componentref name="jboss-portal/modules/common" version="trunk-SNAPSHOT"/>
<componentref name="jboss-portal/modules/web" version="1.0.0"/>
- <componentref name="jboss-portal/modules/test" version="1.0.0"/>
- <componentref name="jboss-portal/modules/portlet" version="trunk-SNAPSHOT"/>
- <componentref name="jboss-portal/modules/identity" version="trunk-SNAPSHOT"/>
+ <componentref name="jboss-portal/modules/test" version="1.0-SNAPSHOT"/>
+ <componentref name="jboss-portal/modules/portlet" version="1.0-SNAPSHOT"/>
+ <componentref name="jboss-portal/modules/identity" version="1.0.0"/>
<componentref name="antlr" version="2.7.6.ga"/>
<componentref name="apache-ant" version="1.6.5"/>
<componentref name="jackrabbit" version="1.1.1"/>
16 years, 6 months
JBoss Portal SVN: r8813 - modules/test/branches.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-01 08:57:24 -0400 (Thu, 01 Nov 2007)
New Revision: 8813
Added:
modules/test/branches/JBP_TEST_BRANCH_1_0/
Log:
Branch test 1.0
Copied: modules/test/branches/JBP_TEST_BRANCH_1_0 (from rev 8812, modules/test/tags/JBP_TEST_1_0_0)
16 years, 6 months
JBoss Portal SVN: r8812 - modules/portlet/branches.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-11-01 06:03:21 -0400 (Thu, 01 Nov 2007)
New Revision: 8812
Added:
modules/portlet/branches/JBP_PORTLET_BRANCH_1_0/
Log:
Branching 1_0 based on 1.0.0 tag
Copied: modules/portlet/branches/JBP_PORTLET_BRANCH_1_0 (from rev 8811, modules/portlet/tags/JBP_PORTLET_1_0_0)
16 years, 6 months
JBoss Portal SVN: r8811 - in branches/JBoss_Portal_Branch_2_6: faces/src/main/org/jboss/portal/faces/component/portlet and 5 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-11-01 01:18:03 -0400 (Thu, 01 Nov 2007)
New Revision: 8811
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DashboardPortalObjectPathMapper.java
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DefaultPortalObjectPathMapper.java
branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/ObjectURL.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
Log:
- Made RemoteSOAPInvokerServiceFactory use URLTools since it got broken due to the use of snapshot of common in thirdparty (it was depending on URLStreamOpeningThread that got removed).
- Adapted code to refactorings in FastURLEncoder/Decoder.
- server and WSRP producer tests are failing due to mess with modules... >:-(
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DashboardPortalObjectPathMapper.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DashboardPortalObjectPathMapper.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DashboardPortalObjectPathMapper.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -113,7 +113,7 @@
while (iterator.hasNext())
{
String name = (String)iterator.next();
- name = FastURLEncoder.getInstance().encode(name);
+ name = FastURLEncoder.getUTF8Instance().encode(name);
buffer.append('/').append(name);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DefaultPortalObjectPathMapper.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DefaultPortalObjectPathMapper.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/model/portal/command/mapping/DefaultPortalObjectPathMapper.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -126,7 +126,7 @@
for (Iterator i = id.getPath().names(); i.hasNext();)
{
String name = (String)i.next();
- name = FastURLEncoder.getInstance().encode(name);
+ name = FastURLEncoder.getUTF8Instance().encode(name);
buffer.append('/').append(name);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/faces/src/main/org/jboss/portal/faces/component/portlet/JSFInvocation.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -123,13 +123,13 @@
for (Iterator i = encoder.getQueryParameters().entrySet().iterator(); i.hasNext();)
{
Map.Entry entry = (Map.Entry)i.next();
- String name = FastURLEncoder.getInstance().encode((String)entry.getKey());
+ String name = FastURLEncoder.getUTF8Instance().encode((String)entry.getKey());
String[] values = (String[])entry.getValue();
for (int j = 0; j < values.length; j++)
{
String value = values[j];
url.append("&").append(name).append('=');
- FastURLEncoder.getInstance().encode(value, url);
+ FastURLEncoder.getUTF8Instance().encode(value, url);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/server/src/main/org/jboss/portal/server/impl/ServerInvocationContextImpl.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -49,7 +49,7 @@
{
/** The fast url encoder. */
- private static final FastURLEncoder urlEncoder = FastURLEncoder.getInstance();
+ private static final FastURLEncoder urlEncoder = FastURLEncoder.getUTF8Instance();
/** The client request. */
private final HttpServletRequest req;
Modified: branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/ObjectURL.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/ObjectURL.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/theme/src/main/org/jboss/portal/test/theme/ObjectURL.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -67,12 +67,13 @@
url.append(requestContext.request.getContextPath());
url.append(requestContext.request.getServletPath());
+ FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
//
if (object instanceof WindowObject)
{
WindowObject window = (WindowObject)object;
url.append("/window/");
- FastURLEncoder.getInstance().encode(window.getId(), url);
+ encoder.encode(window.getId(), url);
}
else
{
@@ -86,9 +87,9 @@
String key = (String)entry.getKey();
String value = (String)entry.getValue();
url.append(i.isFirst() ? '?' : '&');
- FastURLEncoder.getInstance().encode(key, url);
+ encoder.encode(key, url);
url.append('=');
- FastURLEncoder.getInstance().encode(value, url);
+ encoder.encode(value, url);
}
return url.toString();
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/GGWidget.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -133,7 +133,8 @@
String value = values != null ? values[0] : prefInfo.getDefaultValue();
if (value != null)
{
- tmp.append("&up_").append(FastURLEncoder.getInstance().encode(prefName)).append("=").append(FastURLEncoder.getInstance().encode(value));
+ FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
+ tmp.append("&up_").append(encoder.encode(prefName)).append("=").append(encoder.encode(value));
}
}
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGQueryResultBuilder.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -84,7 +84,7 @@
byte[] bytes;
if ("http".equals(url.getProtocol()))
{
- bytes = URLTools.performGET(url, connectionTimeout, connectionTimeout);
+ bytes = URLTools.getContent(url, connectionTimeout, connectionTimeout);
}
else
{
Modified: branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/widget/src/main/org/jboss/portal/widget/google/provider/GGWidgetInfoBuilder.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -361,7 +361,7 @@
private byte[] obtainURL(URL url) throws Exception
{
- return URLTools.performGET(url, 5000, 5000);
+ return URLTools.getContent(url, 5000, 5000);
}
}
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-11-01 03:08:43 UTC (rev 8810)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/services/RemoteSOAPInvokerServiceFactory.java 2007-11-01 05:18:03 UTC (rev 8811)
@@ -25,7 +25,7 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.common.net.URLStreamOpeningThread;
+import org.jboss.portal.common.net.URLTools;
import org.jboss.portal.common.util.ParameterValidation;
import org.xml.sax.InputSource;
@@ -214,42 +214,13 @@
{
log.info("getBaseInputSource [wsdlUrl=" + wsdlURL + "]");
- URLStreamOpeningThread thread = new URLStreamOpeningThread(wsdlURL);
- thread.start();
-
- // Wait for the thread to finish but don't wait longer than the specified time
- long delayMillis = TIME_OUT_MS;
try
{
- thread.join(delayMillis);
-
- if (thread.isAlive())
- {
- // Timeout occurred; thread has not finished
- // todo: do we need more clean up here?
- IOTools.safeClose(thread.getInputStream());
- throw new RuntimeException("Couldn't connect to " + wsdlURL + " within " + delayMillis / 1000
- + " seconds. Check your connection parameters or the URL.");
- }
- else
- {
- // Finished
- if (thread.isConnected() && !thread.isError())
- {
- InputStream is = IOTools.safeBufferedWrapper(thread.getInputStream());
- return new InputSource(is);
- }
- else
- {
- throw new RuntimeException("An error occured while parsing the WSDL file at " + wsdlURL,
- thread.getException());
- }
- }
+ return new InputSource(URLTools.getContentAsInputStream(wsdlURL, TIME_OUT_MS, TIME_OUT_MS));
}
- catch (InterruptedException e)
+ catch (IOException e)
{
- // Thread was interrupted
- throw new RuntimeException("Parsing thread was interrupted!", e);
+ throw new RuntimeException("Couldn't retrieve WSDL for " + wsdlURL, e);
}
}
16 years, 6 months
JBoss Portal SVN: r8810 - in modules/common/trunk/common/src: main/java/org/jboss/portal/common/net and 3 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-10-31 23:08:43 -0400 (Wed, 31 Oct 2007)
New Revision: 8810
Modified:
modules/common/trunk/common/src/main/java/org/jboss/portal/common/markup/MarkupAttribute.java
modules/common/trunk/common/src/main/java/org/jboss/portal/common/net/URLTools.java
modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/FastURLDecoder.java
modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/FastURLEncoder.java
modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/net/URLToolsTestCase.java
modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/text/CharBufferTestCase.java
modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/text/FastURLEncoderTestCase.java
Log:
- Renamed performGET to getContent as it makes more sense.
- Renamed getInputStreamFor to getContentAsInputStream and do not close the input stream anymore before returning (doh!). :)
- Renamed FastURLEncoder.getInstance to getUTF8Instance to be more consistent with FastURLDecoder.
- Added FastURLDecoder.encode(String) and encode(String, StringBuilder) methods.
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/markup/MarkupAttribute.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/markup/MarkupAttribute.java 2007-10-31 23:53:29 UTC (rev 8809)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/markup/MarkupAttribute.java 2007-11-01 03:08:43 UTC (rev 8810)
@@ -24,11 +24,11 @@
import org.jboss.portal.common.io.UndeclaredIOException;
import org.jboss.portal.common.io.WriterCharWriter;
-import org.jboss.portal.common.text.FastURLEncoder;
+import org.jboss.portal.common.text.AbstractCharEncoder;
import org.jboss.portal.common.text.CharEncoder;
-import org.jboss.portal.common.text.AbstractCharEncoder;
import org.jboss.portal.common.text.CharWriter;
import org.jboss.portal.common.text.EncodingException;
+import org.jboss.portal.common.text.FastURLEncoder;
import java.io.IOException;
import java.io.StringWriter;
@@ -164,7 +164,7 @@
}
else
{
- FastURLEncoder.getInstance().encode(c, writer);
+ FastURLEncoder.getUTF8Instance().encode(c, writer);
}
}
};
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/net/URLTools.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/net/URLTools.java 2007-10-31 23:53:29 UTC (rev 8809)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/net/URLTools.java 2007-11-01 03:08:43 UTC (rev 8810)
@@ -24,18 +24,17 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.text.FastURLDecoder;
+import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.common.util.ParameterValidation;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
@@ -65,9 +64,9 @@
}
/**
- * Fetches content from an HTTP server performing a GET operation. If the status code is 200 then it will return a
- * byte array of the body otherwise returns null. The timeout values must not be negative integers, when it is equals
- * to zero it means that it does not setup a timeout and use the default values.
+ * Fetches content from of the URL as a byte array or <code>null</code> if a problem occurred. The timeout values
+ * must not be negative integers, when it is equals to zero it means that it does not setup a timeout and use the
+ * default values.
*
* @param url the URL the URL of the resource
* @param soTimeoutMillis the socket connection timeout in millis
@@ -75,12 +74,12 @@
* @return the retrieved byte array
* @throws IllegalArgumentException if the URL is null or any time out value is negative
*/
- public static byte[] performGET(URL url, int soTimeoutMillis, int connTimeoutMillis) throws IllegalArgumentException
+ public static byte[] getContent(URL url, int soTimeoutMillis, int connTimeoutMillis) throws IllegalArgumentException
{
InputStream in = null;
try
{
- in = internalGetInputStreamFor(url, soTimeoutMillis, connTimeoutMillis);
+ in = getContentAsInputStream(url, soTimeoutMillis, connTimeoutMillis);
return IOTools.getBytes(in);
}
catch (IOException e)
@@ -104,39 +103,8 @@
* @throws IllegalArgumentException if the URL is null or any time out value is negative
* @since 1.1
*/
- public static InputStream getInputStreamFor(URL url, int soTimeoutMillis, int connTimeoutMillis)
+ public static InputStream getContentAsInputStream(URL url, int soTimeoutMillis, int connTimeoutMillis) throws IOException
{
- //
- InputStream in = null;
- try
- {
- in = internalGetInputStreamFor(url, soTimeoutMillis, connTimeoutMillis);
- return in;
- }
- catch (SocketTimeoutException e)
- {
- return null;
- }
- catch (IOException e)
- {
- return null;
- }
- finally
- {
- IOTools.safeClose(in);
- }
- }
-
- /**
- * @param url
- * @param soTimeoutMillis
- * @param connTimeoutMillis
- * @return
- * @throws IOException
- * @since 1.1
- */
- private static InputStream internalGetInputStreamFor(URL url, int soTimeoutMillis, int connTimeoutMillis) throws IOException
- {
if (url == null)
{
throw new IllegalArgumentException();
@@ -166,7 +134,15 @@
conn.setReadTimeout(connTimeoutMillis);
conn.connect();
- return new BufferedInputStream(conn.getInputStream());
+ try
+ {
+ return new BufferedInputStream(conn.getInputStream());
+ }
+ catch (SocketTimeoutException e)
+ {
+ log.debug("Time out on: " + url);
+ throw e;
+ }
}
/**
@@ -200,26 +176,12 @@
public static String encodeXWWWFormURL(String s)
{
- try
- {
- return URLEncoder.encode(s, "UTF-8");
- }
- catch (UnsupportedEncodingException e)
- {
- throw new Error("UTF-8 encoding missing");
- }
+ return FastURLEncoder.getUTF8Instance().encode(s);
}
public static String decodeXWWWFormURL(String s)
{
- try
- {
- return URLDecoder.decode(s, "UTF-8");
- }
- catch (UnsupportedEncodingException e)
- {
- throw new Error("UTF-8 encoding missing");
- }
+ return FastURLDecoder.getUTF8Instance().encode(s);
}
/** Return true is the address is not null and matches the email validation regular expression. */
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/FastURLDecoder.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/FastURLDecoder.java 2007-10-31 23:53:29 UTC (rev 8809)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/FastURLDecoder.java 2007-11-01 03:08:43 UTC (rev 8810)
@@ -86,7 +86,7 @@
//
root = new LookupNonTerm();
- for (char c = FROM;c <= TO;c++)
+ for (char c = FROM; c <= TO; c++)
{
byte[] v = encoder.encode(c);
LookupNonTerm node = root;
@@ -111,10 +111,10 @@
//
conversions = new int[256][256];
- for (char i = 0;i < 256;i++)
+ for (char i = 0; i < 256; i++)
{
int x = hexValue(i);
- for (char j = 0;j < 256;j++)
+ for (char j = 0; j < 256; j++)
{
int y = hexValue(j);
if (x != -1 && y != -1)
@@ -128,10 +128,9 @@
}
}
-
//
decisions = new int[256];
- for (int i = 0;i < decisions.length;i++)
+ for (int i = 0; i < decisions.length; i++)
{
if (TextTools.isAlphaNumeric((char)i))
{
@@ -139,7 +138,7 @@
}
else
{
- switch(i)
+ switch (i)
{
case '+':
decisions[i] = PLUS;
@@ -228,7 +227,7 @@
else
{
char[] chars = new char[s.length()];
- for (int i = 0;i < s.length();i++)
+ for (int i = 0; i < s.length(); i++)
{
char c = s.charAt(i);
chars[i] = c;
@@ -237,13 +236,54 @@
}
}
+ /**
+ * @param s
+ * @return
+ * @throws IllegalArgumentException
+ * @since 1.1
+ */
+ public String encode(String s) throws IllegalArgumentException
+ {
+ StringBuilder tmp = new StringBuilder();
+ encode(s, tmp);
+ return tmp.toString();
+ }
+
+ /**
+ * @param s
+ * @param out
+ * @throws IllegalArgumentException
+ * @since 1.1
+ */
+ public void encode(String s, StringBuilder out) throws IllegalArgumentException
+ {
+ if (s == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (out == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ for (int i = 0; i < s.length(); i++)
+ {
+ char c = s.charAt(i);
+ int[] z = conversions[c];
+ if (z == null)
+ {
+ throw new MalformedInputException("Cannot encode char=" + (int)c);
+ }
+ out.append(z);
+ }
+ }
+
private void encodeNoCheck(char[] chars, int i, int length, CharWriter tmp)
{
while (i < length)
{
char c = chars[i++];
int decision = c < 256 ? decisions[c] : ERROR;
- switch(decision)
+ switch (decision)
{
case AS_IS:
tmp.append(c);
@@ -261,7 +301,7 @@
if (j + 2 > length)
{
throw new MalformedInputException("Not enough chars to decode an escaped value length should have been" +
- (j + 2) + " but is " + length);
+ (j + 2) + " but is " + length);
}
//
Modified: modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/FastURLEncoder.java
===================================================================
--- modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/FastURLEncoder.java 2007-10-31 23:53:29 UTC (rev 8809)
+++ modules/common/trunk/common/src/main/java/org/jboss/portal/common/text/FastURLEncoder.java 2007-11-01 03:08:43 UTC (rev 8810)
@@ -39,7 +39,7 @@
/** . */
private static final FastURLEncoder DEFAULT_ENCODER = new FastURLEncoder(CharToByteEncoder.Generic.UTF8);
- public static FastURLEncoder getInstance()
+ public static FastURLEncoder getUTF8Instance()
{
return DEFAULT_ENCODER;
}
@@ -61,7 +61,7 @@
this.table = new char[MAX + 1][];
//
- for (char c = 0;c <= MAX;c++)
+ for (char c = 0; c <= MAX; c++)
{
char[] z;
if (TextTools.isAlphaNumeric(c))
@@ -70,7 +70,7 @@
}
else
{
- switch(c)
+ switch (c)
{
case ' ':
z = new char[]{'+'};
@@ -87,7 +87,7 @@
{
z = new char[v.length * 3];
int index = 0;
- for (int i = 0;i < v.length;i++)
+ for (int i = 0; i < v.length; i++)
{
byte b = v[i];
z[index++] = '%';
Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/net/URLToolsTestCase.java
===================================================================
--- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/net/URLToolsTestCase.java 2007-10-31 23:53:29 UTC (rev 8809)
+++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/net/URLToolsTestCase.java 2007-11-01 03:08:43 UTC (rev 8810)
@@ -24,15 +24,11 @@
import junit.framework.TestCase;
import org.apache.log4j.Logger;
-import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.junit.ExtendedAssert;
import org.jboss.portal.common.net.URLTools;
-import java.io.BufferedInputStream;
import java.net.MalformedURLException;
-import java.net.ServerSocket;
import java.net.URL;
-import java.net.URLConnection;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -183,7 +179,7 @@
public void testURLExistsTimeout() throws Exception
{
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8080)
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8080)
{
protected void doClient()
{
@@ -210,7 +206,7 @@
public void testURLPerformGETTimeout() throws Exception
{
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8080)
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractTimeoutServer(8080)
{
protected void doClient()
{
@@ -218,7 +214,7 @@
try
{
URL url = new URL("http://localhost:8080/");
- bytes = URLTools.performGET(url, 500, 500);
+ bytes = URLTools.getContent(url, 500, 500);
}
catch (MalformedURLException e)
{
@@ -237,13 +233,13 @@
public void testURLPerformGET() throws Exception
{
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractOKServer(8080)
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractOKServer(8080)
{
protected void doClient() throws Exception
{
URL url = new URL("http://localhost:8080/");
- byte[] bytes = URLTools.performGET(url, 5000, 5000);
+ byte[] bytes = URLTools.getContent(url, 5000, 5000);
ExtendedAssert.assertEquals("CAFEBABE".getBytes("UTF-8"), bytes);
}
};
@@ -254,7 +250,7 @@
public void testURLExists() throws Exception
{
- AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractOKServer(8080)
+ AbstractSynchronizedServer server = new AbstractSynchronizedServer.AbstractOKServer(8080)
{
protected void doClient() throws Exception
Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/text/CharBufferTestCase.java
===================================================================
--- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/text/CharBufferTestCase.java 2007-10-31 23:53:29 UTC (rev 8809)
+++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/text/CharBufferTestCase.java 2007-11-01 03:08:43 UTC (rev 8810)
@@ -33,7 +33,7 @@
public class CharBufferTestCase extends TestCase
{
- private FastURLEncoder encoder = FastURLEncoder.getInstance();
+ private FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
public void testUTF8EncodedStringAppend()
{
Modified: modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/text/FastURLEncoderTestCase.java
===================================================================
--- modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/text/FastURLEncoderTestCase.java 2007-10-31 23:53:29 UTC (rev 8809)
+++ modules/common/trunk/common/src/test/java/org/jboss/portal/test/common/text/FastURLEncoderTestCase.java 2007-11-01 03:08:43 UTC (rev 8810)
@@ -22,15 +22,13 @@
******************************************************************************/
package org.jboss.portal.test.common.text;
-import org.jboss.portal.common.text.FastURLEncoder;
+import junit.framework.TestCase;
import org.jboss.portal.common.text.CharBuffer;
import org.jboss.portal.common.text.CharEncoder;
+import org.jboss.portal.common.text.FastURLEncoder;
-import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
-import junit.framework.TestCase;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
@@ -38,9 +36,9 @@
public class FastURLEncoderTestCase extends TestCase
{
- public void testEncodeThrowsIAE() throws Exception
+ public void testEncodeThrowsIAE() throws Exception
{
- CharEncoder encoder = FastURLEncoder.getInstance();
+ CharEncoder encoder = FastURLEncoder.getUTF8Instance();
try
{
encoder.encode(new char[10], -1, 0, new CharBuffer());
@@ -135,9 +133,9 @@
public void testEncode() throws Exception
{
- FastURLEncoder encoder = FastURLEncoder.getInstance();
+ FastURLEncoder encoder = FastURLEncoder.getUTF8Instance();
StringBuffer tmp = new StringBuffer();
- for (int i = 0;i < 512;i++)
+ for (int i = 0; i < 512; i++)
{
tmp.append((char)i);
}
16 years, 6 months