Permalink
Browse files

Upgrade to 5.3.3

  • Loading branch information...
1 parent 72ca54e commit cec081a4238367f5ac131d50be8d8e17aa8e9a07 @got5 committed May 1, 2012
View
@@ -1,4 +1,7 @@
.classpath
.project
.settings/
-target/
+target/
+.gradle
+build/
+.DS_Store
View
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.tapestry</groupId>
<artifactId>tapestry5-portlet</artifactId>
- <version>5.2.0</version>
+ <version>5.3.0-SNAPSHOT</version>
<name>Tapestry5 Portlet 2.0 Integration</name>
<dependencies>
<dependency>
@@ -24,6 +24,13 @@
</exclusion>
</exclusions>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.tapestry</groupId>
+ <artifactId>tapestry-test</artifactId>
+ <version>${tapestry-release-version}</version>
+ <scope>test</scope>
+ </dependency>
<dependency>
<artifactId>commons-io</artifactId>
@@ -318,7 +325,7 @@
</pluginRepositories>
<properties>
- <tapestry-release-version>5.2.6</tapestry-release-version>
+ <tapestry-release-version>5.3.3</tapestry-release-version>
<liferay.version>6.1.0</liferay.version>
</properties>
</project>
@@ -6,6 +6,7 @@
import javax.portlet.PortletResponse;
import org.apache.tapestry5.Link;
+import org.apache.tapestry5.internal.services.LinkSecurity;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.portlet.PortletConstants;
import org.apache.tapestry5.portlet.PortletUtilities;
@@ -126,4 +127,15 @@ public String toAbsoluteURI(boolean secure)
return toAbsoluteURI();
}
+ //5.3
+ public void setSecurity(LinkSecurity newSecurity)
+ {
+ this.delegate.setSecurity(newSecurity);
+ }
+
+ public LinkSecurity getSecurity()
+ {
+ return this.delegate.getSecurity();
+ }
+
}
@@ -8,6 +8,7 @@
* needed between Tapestry link API and Portlet API.
*
* @author ccordenier
+ * @author ffacon
*/
public interface PortletLink
{
@@ -256,7 +256,7 @@ private boolean isXHR(String containingPageName, String nestedComponentId, Strin
ParameterConduit paramConduit = internalRes.getParameterConduit("zone");
log.info(cptName+" "+paramConduit.toString());
//Fix: make sure zone is bound to a real component
- if(paramConduit.get()==null) return false;
+ if(!paramConduit.isBound()) return false;
else return true;
}
@@ -21,6 +21,7 @@
import javax.portlet.PortletRequest;
import javax.portlet.PortletSession;
+import javax.servlet.http.HttpServletRequest;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.portlet.PortletUtilities;
@@ -34,6 +35,7 @@
* Portlet request wrapper
*
* @author ccordenier
+ * @author ffacon
*/
public class PortletRequestImpl implements Request
{
@@ -165,15 +167,46 @@ public String getMethod()
return "POST";
}
+ /**
+ * Not allowed in a portlet.
+ *
+ * @throws IllegalStateException
+ * Not allowed in a portlet.
+ */
public int getLocalPort()
{
- return 0;
- //todo return request.getLocalPort();
+ if (request instanceof HttpServletRequest) {
+ return ((HttpServletRequest) request).getLocalPort();
+ }
+ throw new IllegalStateException("getLocalPort Not allowed in a portlet");
}
+ /**
+ * Not allowed in a portlet.
+ *
+ * @throws IllegalStateException
+ * Not allowed in a portlet.
+ */
public int getServerPort()
{
- return request.getServerPort();
+ if (request instanceof HttpServletRequest) {
+ return ((HttpServletRequest) request).getServerPort();
+ }
+ throw new IllegalStateException("getServerPort Not allowed in a portlet");
+ }
+
+ /**
+ * Not allowed in a portlet.
+ *
+ * @throws IllegalStateException
+ * Not allowed in a portlet.
+ */
+ public String getRemoteHost()
+ {
+ if (request instanceof HttpServletRequest) {
+ return ((HttpServletRequest) request).getRemoteHost();
+ }
+ throw new IllegalStateException("getRemoteHost Not allowed in a portlet");
}
}
@@ -117,22 +117,7 @@ public void setMaxInactiveInterval(int seconds)
public void restoreDirtyObjects()
{
- if (invalidated) return;
-
- if (sessionAttributeCache.isEmpty()) return;
-
- for (Map.Entry<String, Object> entry : sessionAttributeCache.entrySet())
- {
- String attributeName = entry.getKey();
-
- Object attributeValue = entry.getValue();
-
- if (attributeValue == null)
- continue;
-
- if (analyzer.isDirty(attributeValue))
- session.setAttribute(attributeName, attributeValue);
- }
+
}
}
@@ -4,19 +4,21 @@
import org.apache.commons.io.FileCleaner;
import org.apache.tapestry5.ioc.Configuration;
+import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.ioc.OrderedConfiguration;
import org.apache.tapestry5.ioc.ScopeConstants;
import org.apache.tapestry5.ioc.annotations.Autobuild;
+import org.apache.tapestry5.ioc.annotations.Contribute;
import org.apache.tapestry5.ioc.annotations.Marker;
import org.apache.tapestry5.ioc.annotations.Scope;
import org.apache.tapestry5.ioc.services.PerthreadManager;
import org.apache.tapestry5.ioc.services.RegistryShutdownHub;
import org.apache.tapestry5.ioc.services.RegistryShutdownListener;
+import org.apache.tapestry5.ioc.services.ServiceOverride;
import org.apache.tapestry5.portlet.annotations.Portlet;
import org.apache.tapestry5.portlet.services.PortletActionRequestFilter;
import org.apache.tapestry5.portlet.upload.internal.services.PortletMultipartDecoderFilter;
import org.apache.tapestry5.portlet.upload.internal.services.PortletMultipartDecoderImpl;
-import org.apache.tapestry5.services.AliasContribution;
import org.apache.tapestry5.upload.services.MultipartDecoder;
/**
@@ -25,6 +27,7 @@
* context of a portlet.
*
* @author ccordenier
+ * @author ffacon
*/
public class PortletUploadModule
{
@@ -36,7 +39,7 @@ public static PortletMultipartDecoder buildPortletMultipartDecoder(
PerthreadManager perthreadManager, RegistryShutdownHub shutdownHub, @Autobuild
PortletMultipartDecoderImpl multipartDecoder)
{
- // This is proabably overkill since the FileCleaner should catch
+ // This is probably overkill since the FileCleaner should catch
// temporary files, but lets
// be safe.
perthreadManager.addThreadCleanupListener(multipartDecoder);
@@ -70,9 +73,14 @@ public static void contributePortletActionRequestHandler(
* @param configuration
* @param multiPartDecoder
*/
- public void contributeAliasOverrides(Configuration<AliasContribution> configuration, @Portlet
- final PortletMultipartDecoder multiPartDecoder)
- {
- configuration.add(AliasContribution.create(MultipartDecoder.class, multiPartDecoder));
+ @Contribute(value = ServiceOverride.class)
+ public static void setupApplicationServiceOverrides(
+ @Portlet final PortletMultipartDecoder multiPartDecoder,
+ MappedConfiguration<Class, Object> configuration) {
+
+ configuration.add(MultipartDecoder.class, multiPartDecoder);
}
+
+
+
}
@@ -59,9 +59,6 @@
<short-title>T5 Portlet About</short-title>
<keywords>Portlet Tapestry About</keywords>
</portlet-info>
- <supported-processing-event>
- <name>sampleEvent</name>
- </supported-processing-event>
<container-runtime-option>
<name>javax.portlet.renderHeaders</name>
<value>true</value>
@@ -1,8 +1,10 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
-<suite name="tapestryportlet2 Application Test Suite" annotations="1.5">
- <test name="Unit Tests">
+<suite name="tapestry5-portlet Application Test Suite" annotations="1.5">
+ <test name="Pluto Integration Tests" enabled="true">
+ <parameter name="tapestry.web-app-folder" value="src/main/webapp"/>
+
<packages>
- <package name="de.wiv.tapestryportlet2"/>
+ <package name="org.apache.tapestry5.portlet"/>
</packages>
</test>
</suite>
@@ -1 +0,0 @@
-This placeholder exists to ensure the directory is created. It may be deleted when real files are placed under src/test/java.
@@ -151,11 +151,11 @@ public Object onActionFromRefreshAction()
return renderable;
}
- public Object onActionFromReDownloadResource()
+ /*public Object onActionFromReDownloadResource()
{
System.out.println("fromredownload");
return Contact.class;
- }
+ }*/
@OnEvent(component = "actionException")
void onActionFromActionException()
@@ -1 +0,0 @@
-This placeholder exists to ensure the directory is created. It may be deleted when real files are placed under src/test/resources.

0 comments on commit cec081a

Please sign in to comment.