taylor 2004/01/14 20:14:00
Modified: portal maven.xml
portal/src/java/org/apache/jetspeed/container
ContainerValve.java
portal/src/java/org/apache/jetspeed/engine/core
PortalURLImpl.java
portal/src/webapp/WEB-INF/conf jetspeed.properties
Added: portal/src/java/org/apache/jetspeed/container/url
JetspeedActionURL.java JetspeedPortletURL.java
JetspeedRenderURL.java
portal/src/test/org/apache/jetspeed/container/url
TestPortletURL.java
portal/src/webapp/WEB-INF/pages testsuite.psml
Removed: portal/src/java/org/apache/jetspeed/container
JetspeedActionURL.java JetspeedPortletURL.java
JetspeedRenderURL.java
portal/src/test/org/apache/jetspeed/container
TestPortletURL.java
portal/src/webapp/WEB-INF/psml/user/anon/html default.psml
Log:
- removed old psml
- added page for testing Portlet API test suite
- added target to deploy the test suite (pam.tsdeploy)
moved around URL impl (this one is not currently used)
Revision Changes Path
1.30 +20 -1 jakarta-jetspeed-2/portal/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/portal/maven.xml,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- maven.xml 14 Jan 2004 03:58:51 -0000 1.29
+++ maven.xml 15 Jan 2004 04:14:00 -0000 1.30
@@ -4,7 +4,7 @@
xmlns:reactor="reactor">
<!-- Target of maven test:single test -->
-<property name='testcase' value='org.apache.jetspeed.pipeline.TestPipeline'/>
+<property name='testcase' value='org.apache.jetspeed.container.TestPortletURL'/>
<!--
<goal name="jaxb:portlet"
@@ -82,6 +82,25 @@
<arg value="HW_App" />
<arg value="-warfilename" />
<arg value="../applications/demo/target/demo.war" />
+ <arg value="-webappDir" />
+ <arg value="${pam.deploy.dir}/" />
+ <arg value="-PortalName" />
+ <arg value="jetspeed" />
+ </java>
+ </goal>
+
+ <goal name="pam.tsdeploy">
+ <java
classname="org.apache.jetspeed.tools.pamanager.PortletApplicationManager" fork="yes">
+ <classpath>
+ <path refid="maven.dependency.classpath"/>
+ <pathelement path="${maven.build.dest}"/>
+ </classpath>
+ <arg value="-action" />
+ <arg value="deploy" />
+ <arg value="-PortletAppName" />
+ <arg value="testsuite" />
+ <arg value="-warfilename" />
+ <arg value="../../jakarta-pluto/testsuite/target/testsuite.war" />
<arg value="-webappDir" />
<arg value="${pam.deploy.dir}/" />
<arg value="-PortalName" />
1.2 +2 -2
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/ContainerValve.java
Index: ContainerValve.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/ContainerValve.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ContainerValve.java 28 Jul 2003 23:47:37 -0000 1.1
+++ ContainerValve.java 15 Jan 2004 04:14:00 -0000 1.2
@@ -83,7 +83,7 @@
{
try
{
- PortalURL currentURL = request.getRequestedPortalURL();
+ PortalURL currentURL = request.getRequestedPortalURL();
//PortletContainerServices.prepare();
PortalControlParameter control = new PortalControlParameter(currentURL);
PortletWindow actionWindow = control.getPortletWindowOfAction();
1.1
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/JetspeedActionURL.java
Index: JetspeedActionURL.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.jetspeed.container.url;
/**
* This is the ActionURL implementation
*
*/
public class JetspeedActionURL extends JetspeedPortletURL
{
protected JetspeedActionURL( String contextPath, String peid, boolean secure )
{
super(contextPath, peid, secure, true);
}
}
1.1
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/JetspeedPortletURL.java
Index: JetspeedPortletURL.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.jetspeed.container.url;
import java.util.HashMap;
import java.util.Map;
import javax.portlet.PortletURL;
import javax.portlet.WindowState;
import javax.portlet.PortletMode;
/**
* This is the class implementing PortletURLs
* Naive, rough first implementation
*
*/
public class JetspeedPortletURL implements PortletURL
{
//protected String peid;
//protected boolean isAction;
protected StringBuffer url;
protected boolean isSecure = false;
protected HashMap parameters = new HashMap();
protected JetspeedPortletURL( String contextPath, String portletID, boolean
secure, boolean action )
{
//this.peid = portletID;
this.isSecure = secure;
//this.isAction = action;
this.url = new StringBuffer( 50 );
url.append( "http://" );
url.append( contextPath );
url.append( "/portal" );
if( action )
{
url.append( "/action/true" );
}
url.append( "/peid/");
url.append( portletID );
}
public void setWindowState( WindowState state )
{
//TBD: Substitute by an implementation
//throw new IllegalStateException("Not implemented yet");
url.append( "/state/" );
url.append( state );
}
public void setPortletMode( PortletMode mode )
{
//TBD: Substitute by an implementation
//throw new IllegalStateException("Not yet implemented. Please write it!
;-)");
url.append( "/mode/" );
url.append( mode );
}
public void setParameter( String name, String value )
{
//TBD: Substitute by an implementation
throw new IllegalStateException("Not yet implemented. Please write it! ;-)");
}
public void setParameter( String name, String[] value )
{
//TBD: Substitute by an implementation
throw new IllegalStateException("Not yet implemented. Please write it! ;-)");
}
public void setParameters( Map params )
{
//TBD: Substitute by an implementation
throw new IllegalStateException("Not yet implemented. Please write it! ;-)");
}
public void setSecure( boolean secure )
{
//TBD: Substitute by an implementation
//throw new IllegalStateException("Not yet implemented. Please write it!
;-)");
this.isSecure = secure;
}
public String toString()
{
if( this.isSecure )
{
url.insert(4, 's');
}
//TBD: should we nuke/reinit the object? The spec does not specify it.
return url.toString();
}
public void addParameter(String name, String value)
{
parameters.put( name, value);
}
public void addParameter (String name, String[] values)
{
parameters.put( name, values);
}
public String getParameter(String name)
{
return (String)parameters.get(name);
}
public String[] getParameters(String name)
{
return (String[])parameters.get(name);
}
}
1.1
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/JetspeedRenderURL.java
Index: JetspeedRenderURL.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.jetspeed.container.url;
/**
* This is the RenderURL Implementation
*
*/
public class JetspeedRenderURL extends JetspeedPortletURL
{
protected JetspeedRenderURL(String contextPath, String peid, boolean secure )
{
super(contextPath, peid, secure, false);
}
}
1.2 +2 -2
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/core/PortalURLImpl.java
Index: PortalURLImpl.java
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/engine/core/PortalURLImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PortalURLImpl.java 21 Oct 2003 21:52:02 -0000 1.1
+++ PortalURLImpl.java 15 Jan 2004 04:14:00 -0000 1.2
@@ -71,7 +71,7 @@
/**
* As part of its content, a portlet may need to create URLs that reference the
portlet itself.
* For example, when a user acts on a URL that references a portlet (i.e., by
clicking a link
- * or submitting a form) the result is a new client request to the portal targeted
to the portlet. 5
+ * or submitting a form) the result is a new client request to the portal targeted
to the portlet.
* Those URLs are called portlet URLs.
*
* NOTE: parts of this code was borrowed from Pluto's portal implementation.
1.1
jakarta-jetspeed-2/portal/src/test/org/apache/jetspeed/container/url/TestPortletURL.java
Index: TestPortletURL.java
===================================================================
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2000-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache Jetspeed" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache",
* "Apache Jetspeed", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.jetspeed.container;
import javax.portlet.PortletURL;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.jetspeed.test.JetspeedTest;
/**
* TestMarshallRegistry
*
* @author <a href="[EMAIL PROTECTED]">David Sean Taylor</a>
* @version $Id: TestPortletURL.java,v 1.1 2004/01/15 04:14:00 taylor Exp $
*/
public class TestPortletURL extends JetspeedTest
{
/**
* Defines the testcase name for JUnit.
*
* @param name the testcase's name.
*/
public TestPortletURL(String name)
{
super(name);
}
/**
* Start the tests.
*
* @param args the arguments. Not used
*/
public static void main(String args[])
{
junit.awtui.TestRunner.main(
new String[] { TestPortletURL.class.getName()});
}
public void setUp()
{
System.out.println("Setup: Testing Portlet URL impl");
}
/**
* Creates the test suite.
*
* @return a test suite (<code>TestSuite</code>) that includes all methods
* starting with "test"
*/
public static Test suite()
{
// All methods starting with "test" will be executed in the test suite.
return new TestSuite(TestPortletURL.class);
}
public void testPortletURL1() throws Exception
{
PortletURL url;
url = new JetspeedRenderURL("/jetspeed",
"P-12345",
false);
assertEquals("http:///jetspeed/portal/peid/P-12345", url.toString() );
url = new JetspeedActionURL("/jetspeed",
"P-12345",
false);
assertEquals("http:///jetspeed/portal/action/true/peid/P-12345",
url.toString() );
}
public void testPortletURL2() throws Exception
{
PortletURL url;
url = new JetspeedRenderURL("/jetspeed",
"P-12345",
false);
url.setSecure(true);
assertEquals("https:///jetspeed/portal/peid/P-12345", url.toString() );
url = new JetspeedActionURL("/jetspeed",
"P-12345",
false);
url.setSecure(true);
assertEquals("https:///jetspeed/portal/action/true/peid/P-12345",
url.toString() );
}
}
1.27 +2 -2
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/jetspeed.properties
Index: jetspeed.properties
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/portal/src/webapp/WEB-INF/conf/jetspeed.properties,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- jetspeed.properties 14 Jan 2004 01:47:27 -0000 1.26
+++ jetspeed.properties 15 Jan 2004 04:14:00 -0000 1.27
@@ -28,7 +28,7 @@
# Security Information
# -------------------------------------------------------------------
-# if no user ahs been setup, default.user.principal will be
+# if no user has been setup, default.user.principal will be
# automatically added via HttpRequestContext.setUserPrincpal()
default.user.principal=anon
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/pages/testsuite.psml
Index: testsuite.psml
===================================================================
<page id="p001">
<defaults
skin="orange"
layout-decorator="clear"
portlet-decorator="portletstd"
/>
<title>Test Suite Page</title>
<fragment id="f002" type="layout" name="VelocityTwoColumns">
<fragment id="pe066" type="portlet" name="TestPortlet1">
<property layout="TwoColumns" name="row" value="0" />
<property layout="TwoColumns" name="column" value="0" />
</fragment>
</fragment>
</page>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]