JBoss Portal SVN: r6273 - in branches/JBoss_Portal_Branch_2_4/test/src: resources/portal-test-jar/org/jboss/portal/test/framework/container and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-14 09:59:51 -0500 (Wed, 14 Feb 2007)
New Revision: 6273
Modified:
branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/Node.java
branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeId.java
branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeManager.java
branches/JBoss_Portal_Branch_2_4/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
Log:
better impl of NodeManager / Node wiring
Modified: branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/Node.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/Node.java 2007-02-14 14:40:50 UTC (rev 6272)
+++ branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/Node.java 2007-02-14 14:59:51 UTC (rev 6273)
@@ -31,20 +31,16 @@
public class Node
{
+ /** . */
private final NodeId id;
- private MBeanServer server;
+ /** . */
+ private final MBeanServer server;
- private NodeManager nodeManager;
-
- public Node(String id, MBeanServer server, NodeManager nodeManager)
+ public Node(String id, MBeanServer server)
{
this.id = new NodeId(id);
this.server = server;
- this.nodeManager = nodeManager;
-
- //
- nodeManager.nodeMap.put(this.id, this);
}
public NodeId getId()
Modified: branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeId.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeId.java 2007-02-14 14:40:50 UTC (rev 6272)
+++ branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeId.java 2007-02-14 14:59:51 UTC (rev 6273)
@@ -40,6 +40,7 @@
/** . */
public static final NodeId PORTS_02 = new NodeId("ports-02");
+ /** . */
private final String value;
public NodeId(String value)
@@ -62,19 +63,12 @@
{
return true;
}
- if (o == null || getClass() != o.getClass())
+ if (o instanceof NodeId)
{
- return false;
+ NodeId that = (NodeId)o;
+ return value.equals(that.value);
}
-
- final NodeId nodeId = (NodeId)o;
-
- if (!value.equals(nodeId.value))
- {
- return false;
- }
-
- return true;
+ return false;
}
public int hashCode()
Modified: branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeManager.java
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeManager.java 2007-02-14 14:40:50 UTC (rev 6272)
+++ branches/JBoss_Portal_Branch_2_4/test/src/main/org/jboss/portal/test/framework/server/NodeManager.java 2007-02-14 14:59:51 UTC (rev 6273)
@@ -33,16 +33,17 @@
public class NodeManager
{
- Map nodeMap;
+ /** The nodes. */
+ private final Map nodeMap;
- public NodeManager()
+ public NodeManager(Node[] nodes)
{
- nodeMap = new HashMap();
-// for (Iterator i = nodes.iterator(); i.hasNext();)
-// {
-// Node node = (Node)i.next();
-// nodeMap.put(node.getId(), node);
-// }
+ this.nodeMap = new HashMap();
+ for (int i = 0;i < nodes.length;i++)
+ {
+ Node node = nodes[i];
+ nodeMap.put(node.getId(), node);
+ }
}
public Collection getNodes()
Modified: branches/JBoss_Portal_Branch_2_4/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_4/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2007-02-14 14:40:50 UTC (rev 6272)
+++ branches/JBoss_Portal_Branch_2_4/test/src/resources/portal-test-jar/org/jboss/portal/test/framework/container/jboss-beans.xml 2007-02-14 14:59:51 UTC (rev 6273)
@@ -88,7 +88,6 @@
<constructor>
<parameter><value>default</value></parameter>
<parameter><inject bean="MBeanServerFactory0" property="server"/></parameter>
- <parameter><inject bean="NodeManager"/></parameter>
</constructor>
</bean>
@@ -96,7 +95,6 @@
<constructor>
<parameter><value>ports-01</value></parameter>
<parameter><inject bean="MBeanServerFactory1" property="server"/></parameter>
- <parameter><inject bean="NodeManager"/></parameter>
</constructor>
</bean>
@@ -104,11 +102,19 @@
<constructor>
<parameter><value>ports-02</value></parameter>
<parameter><inject bean="MBeanServerFactory2" property="server"/></parameter>
- <parameter><inject bean="NodeManager"/></parameter>
</constructor>
</bean>
<bean name="NodeManager" class="org.jboss.portal.test.framework.server.NodeManager">
+ <constructor>
+ <parameter>
+ <array class="[org.jboss.portal.test.framework.server.Node;">
+ <inject bean="Node0"/>
+ <inject bean="Node1"/>
+ <inject bean="Node2"/>
+ </array>
+ </parameter>
+ </constructor>
</bean>
<bean name="Deployer" class="org.jboss.portal.test.framework.deployment.Deployer">
19 years, 2 months
JBoss Portal SVN: r6272 - in trunk/core-samples/src: resources/portal-samples-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-14 09:40:50 -0500 (Wed, 14 Feb 2007)
New Revision: 6272
Modified:
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
Log:
added help mode support in the charset portlet
Modified: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-02-14 14:35:31 UTC (rev 6271)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-02-14 14:40:50 UTC (rev 6272)
@@ -93,6 +93,17 @@
}
}
+
+ protected void doHelp(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ //
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
+ writer.print("This portlet shows different ways to properly display and submit unicode text");
+ }
+
protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
{
String sameString = req.getParameter("same");
@@ -129,9 +140,6 @@
}
//
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
-
StringBuffer escapedText = new StringBuffer();
StringBuffer text = new StringBuffer();
for (int i = from; i < to; i++)
@@ -153,6 +161,10 @@
}
//
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+
+ //
writer.println("<div style=\"border-top:solid 1px\">Testing range:</div>");
writer.print(
"<div>" +
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml 2007-02-14 14:35:31 UTC (rev 6271)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/portlet.xml 2007-02-14 14:40:50 UTC (rev 6272)
@@ -181,14 +181,14 @@
</portlet-info>
</portlet>
<portlet>
- <description>Portlet for testing charset</description>
+ <description>Portlet showing different ways to properly display and submit unicode text</description>
<portlet-name>CharsetPortlet</portlet-name>
<display-name>Charset Portlet</display-name>
-
<portlet-class>org.jboss.portal.core.portlet.test.CharsetPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
</supports>
<portlet-info>
<title>Test charset</title>
19 years, 2 months
JBoss Portal SVN: r6271 - trunk/core-samples/src/main/org/jboss/portal/core/portlet/test.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-14 09:35:31 -0500 (Wed, 14 Feb 2007)
New Revision: 6271
Modified:
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
Log:
update charset portlet to test various use case with process action : textarea, text field and portlet url parameter
Modified: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-02-14 14:30:58 UTC (rev 6270)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-02-14 14:35:31 UTC (rev 6271)
@@ -201,14 +201,26 @@
"</div>");
//
- if (same == Boolean.TRUE)
+ PortletURL url2 = resp.createActionURL();
+ url2.setParameter("text", text.toString());
+ url2.setParameter("from", "" + from);
+ url2.setParameter("to", "" + to);
+ writer.println("<div style=\"border-top:solid 1px\"><a href=\"" + url2 + "\">Test</a> processAction() with a portlet parameter:</div>");
+
+ //
+ if (same != null)
{
- writer.print("<div>Test result: The input matched the expected result</div>");
+ writer.print("<div style=\"color:red;margin-top:2em;margin-bottom:2em\">Test result: ");
+ if (same == Boolean.TRUE)
+ {
+ writer.print("The input matched the expected result");
+ }
+ else if (same == Boolean.FALSE)
+ {
+ writer.print("The input did not matched the expected result");
+ }
+ writer.print("</div>");
}
- else if (same == Boolean.FALSE)
- {
- writer.print("<div>Test result: The input did not matched the expected result</div>");
- }
//
writer.close();
19 years, 2 months
JBoss Portal SVN: r6270 - trunk/core-samples/src/main/org/jboss/portal/core/portlet/test.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-14 09:30:58 -0500 (Wed, 14 Feb 2007)
New Revision: 6270
Modified:
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
Log:
update charset portlet to test various use case with process action : textarea, text field and portlet url parameter
Modified: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-02-14 14:15:02 UTC (rev 6269)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-02-14 14:30:58 UTC (rev 6270)
@@ -32,6 +32,7 @@
import javax.portlet.PortletSecurityException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
import java.io.IOException;
import java.io.PrintWriter;
@@ -131,56 +132,85 @@
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
- //
- if (same == Boolean.TRUE)
- {
- writer.print("The input matched the expected result");
- }
- else if (same == Boolean.FALSE)
- {
- writer.print("The input did not matched the expected result");
- }
-
- //
- writer.print(
- "<div> Testing range : " +
- "<form action=\"" + resp.createActionURL() + "\" method=\"post\"\">" +
- "<input type=\"text\" name=\"from\" value=\"" + from + "\"/>" +
- "<input type=\"text\" name=\"to\" value=\"" + to + "\"/>" +
- "<input type=\"submit\" value=\"change\"/>" +
- "</form>" +
- "</div>");
-
- //
- writer.println(
- "<div>" +
- "<form action=\"" + resp.createActionURL() + "\" accept-charset=\"" + resp.getCharacterEncoding() + "\" method=\"post\">" +
- "<input type=\"hidden\" name=\"from\" value=\"" + from + "\"/>" +
- "<input type=\"hidden\" name=\"to\" value=\"" + to + "\"/>" +
- "<textarea name=\"text\" cols=\"20\" rows=\"10\" wrap=\"virtual\">");
+ StringBuffer escapedText = new StringBuffer();
+ StringBuffer text = new StringBuffer();
for (int i = from; i < to; i++)
{
char c = (char)i;
if (useChar(c))
{
+ text.append(c);
String s = EntityTable.FULL.lookup(c);
if (s == null)
{
- writer.print(c);
+ escapedText.append(c);
}
else
{
- writer.print("&" + s + ";");
+ escapedText.append("&").append(s).append(";");
}
}
}
+
+ //
+ writer.println("<div style=\"border-top:solid 1px\">Testing range:</div>");
+ writer.print(
+ "<div>" +
+ "<form action=\"" + resp.createActionURL() + "\" method=\"post\"\">" +
+ "<input type=\"text\" name=\"from\" value=\"" + from + "\"/>" +
+ "<input type=\"text\" name=\"to\" value=\"" + to + "\"/>" +
+ "<input type=\"submit\" value=\"change\"/>" +
+ "</form>" +
+ "</div>");
+
+ //
+ writer.println("<div style=\"border-top:solid 1px\">Test processAction() with a textarea field:</div>");
writer.println(
- "</textarea>" +
- "<input type=\"submit\" value=\"check\"/>" +
- "</form>" +
- "</div>");
+ "<div>" +
+ "<form action=\"" + resp.createActionURL() + "\" accept-charset=\"" + resp.getCharacterEncoding() + "\" method=\"post\">" +
+ "<input type=\"hidden\" name=\"from\" value=\"" + from + "\"/>" +
+ "<input type=\"hidden\" name=\"to\" value=\"" + to + "\"/>" +
+ "<textarea name=\"text\" cols=\"20\" rows=\"10\" wrap=\"virtual\">" + escapedText + "</textarea>" +
+ "<input type=\"submit\" value=\"check\"/>" +
+ "</form>" +
+ "</div>");
//
+ writer.println("<div style=\"border-top:solid 1px\">Test processAction() with a text field:</div>");
+ writer.println(
+ "<div>" +
+ "<form action=\"" + resp.createActionURL() + "\" accept-charset=\"" + resp.getCharacterEncoding() + "\" method=\"post\">" +
+ "<input type=\"hidden\" name=\"from\" value=\"" + from + "\"/>" +
+ "<input type=\"hidden\" name=\"to\" value=\"" + to + "\"/>" +
+ "<input type=\"text\" name=\"text\" value=\"" + escapedText + "\"/>" +
+ "<input type=\"submit\" value=\"check\"/>" +
+ "</form>" +
+ "</div>");
+
+ //
+ PortletURL url = resp.createActionURL();
+ url.setParameter("text", text.toString());
+ writer.println("<div style=\"border-top:solid 1px\">Test processAction() with a portlet parameter:</div>");
+ writer.println(
+ "<div>" +
+ "<form action=\"" + url + "\" accept-charset=\"" + resp.getCharacterEncoding() + "\" method=\"post\">" +
+ "<input type=\"hidden\" name=\"from\" value=\"" + from + "\"/>" +
+ "<input type=\"hidden\" name=\"to\" value=\"" + to + "\"/>" +
+ "<input type=\"submit\" value=\"check\"/>" +
+ "</form>" +
+ "</div>");
+
+ //
+ if (same == Boolean.TRUE)
+ {
+ writer.print("<div>Test result: The input matched the expected result</div>");
+ }
+ else if (same == Boolean.FALSE)
+ {
+ writer.print("<div>Test result: The input did not matched the expected result</div>");
+ }
+
+ //
writer.close();
}
19 years, 2 months
JBoss Portal SVN: r6269 - in trunk: core-samples/src/main/org/jboss/portal/core/portlet/test and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-14 09:15:02 -0500 (Wed, 14 Feb 2007)
New Revision: 6269
Removed:
trunk/common/src/main/org/jboss/portal/common/ant/
Modified:
trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
Log:
make the Charset portlet work by skipping non displayable unicode letters
Modified: trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java
===================================================================
--- trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-02-14 13:39:58 UTC (rev 6268)
+++ trunk/core-samples/src/main/org/jboss/portal/core/portlet/test/CharsetPortlet.java 2007-02-14 14:15:02 UTC (rev 6269)
@@ -50,11 +50,10 @@
public void processAction(ActionRequest req, ActionResponse resp) throws PortletException, PortletSecurityException, IOException
{
- //
String fromString = req.getParameter("from");
String toString = req.getParameter("to");
- int from = 0;
- int to = 0;
+ int from;
+ int to;
try
{
from = Integer.parseInt(fromString);
@@ -62,33 +61,35 @@
}
catch (NumberFormatException ignore)
{
- //
+ from = 65;
+ to = 256;
}
+ resp.setRenderParameter("from", "" + from);
+ resp.setRenderParameter("to", "" + to);
//
- StringBuffer buffer = new StringBuffer();
- for (int i = from; i < to; i++)
- {
- char c = (char)i;
- buffer.append(c);
- }
-
- //
String text = req.getParameter("text");
- boolean same = buffer.toString().equals(text);
-
- //
- if (!same)
+ if (text != null)
{
- log.error("The input does not match the expected string");
- log.error("Expected string " + buffer);
- log.error("Received string " + text);
+ StringBuffer buffer = new StringBuffer();
+ for (int i = from; i < to; i++)
+ {
+ char c = (char)i;
+ if (useChar(c))
+ {
+ buffer.append(c);
+ }
+ }
+ String expectedText = buffer.toString();
+ boolean same = expectedText.equals(text);
+ if (!same)
+ {
+ log.error("The input does not match the expected string");
+ log.error("Expected string " + expectedText);
+ log.error("Received string " + text);
+ }
+ resp.setRenderParameter("same", "" + same);
}
-
- //
- resp.setRenderParameter("from", "" + from);
- resp.setRenderParameter("to", "" + to);
- resp.setRenderParameter("same", "" + same);
}
protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
@@ -143,7 +144,7 @@
//
writer.print(
"<div> Testing range : " +
- "<form action=\"" + resp.createRenderURL() + "\" method=\"post\"\">" +
+ "<form action=\"" + resp.createActionURL() + "\" method=\"post\"\">" +
"<input type=\"text\" name=\"from\" value=\"" + from + "\"/>" +
"<input type=\"text\" name=\"to\" value=\"" + to + "\"/>" +
"<input type=\"submit\" value=\"change\"/>" +
@@ -160,15 +161,18 @@
for (int i = from; i < to; i++)
{
char c = (char)i;
- String s = EntityTable.FULL.lookup(c);
- if (s == null)
+ if (useChar(c))
{
- writer.print(c);
+ String s = EntityTable.FULL.lookup(c);
+ if (s == null)
+ {
+ writer.print(c);
+ }
+ else
+ {
+ writer.print("&" + s + ";");
+ }
}
- else
- {
- writer.print("&" + s + ";");
- }
}
writer.println(
"</textarea>" +
@@ -180,4 +184,44 @@
writer.close();
}
+ public static boolean useChar(char c)
+ {
+ switch (Character.getType(c))
+ {
+ case Character.LOWERCASE_LETTER: // Ll
+ case Character.UPPERCASE_LETTER: // Lu
+ case Character.TITLECASE_LETTER: // Lt
+ case Character.MODIFIER_LETTER: // Lm
+ case Character.OTHER_LETTER: // Lo
+ case Character.NON_SPACING_MARK: // Mn
+ case Character.ENCLOSING_MARK: // Me
+ case Character.COMBINING_SPACING_MARK: // Mc
+ case Character.DECIMAL_DIGIT_NUMBER: // Nd
+ case Character.LETTER_NUMBER: // Nl
+ case Character.OTHER_NUMBER: // No
+ case Character.SPACE_SEPARATOR: // Zs
+ case Character.LINE_SEPARATOR: // Zl
+ case Character.PARAGRAPH_SEPARATOR: // Zp
+ case Character.DASH_PUNCTUATION: // Pd
+ case Character.START_PUNCTUATION: // Ps
+ case Character.END_PUNCTUATION: // Pe
+ case Character.CONNECTOR_PUNCTUATION: // Pc
+ case Character.OTHER_PUNCTUATION: // Po
+ case Character.INITIAL_QUOTE_PUNCTUATION: // Pi
+ case Character.FINAL_QUOTE_PUNCTUATION: // Pf
+ case Character.MATH_SYMBOL: // Sm
+ case Character.CURRENCY_SYMBOL: // Sc
+ case Character.MODIFIER_SYMBOL: // Sk
+ case Character.OTHER_SYMBOL: // So
+ return true;
+ default:
+ case Character.UNASSIGNED: // Cn
+ case Character.CONTROL: // Cc
+ case Character.FORMAT: // Cf
+ case Character.PRIVATE_USE: // Co
+ case Character.SURROGATE: // Cs
+ return false;
+ }
+ }
+
}
19 years, 2 months
JBoss Portal SVN: r6268 - in trunk/core/src: resources/portal-core-war/WEB-INF/classes and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-14 08:39:58 -0500 (Wed, 14 Feb 2007)
New Revision: 6268
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties
trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_es.properties
trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_fr.properties
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/login.jsp
trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/register_ty.jsp
Log:
Fixed: User registration, usability issue [JBPORTAL-1217]
Modified: trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-02-14 13:07:21 UTC (rev 6267)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/user/UserPortlet.java 2007-02-14 13:39:58 UTC (rev 6268)
@@ -519,14 +519,12 @@
else
{
// User is not logged in
- if (req.getWindowState() != WindowState.MAXIMIZED)
+ op = req.getParameters().get(getOperationName(), OP_SHOWLOGIN);
+
+ if (req.getWindowState() != WindowState.MAXIMIZED && ! OP_SHOWREGISTER_TY.equals(op))
{
op = OP_SHOWLOGIN;
}
- else
- {
- op = req.getParameters().get(getOperationName(), OP_SHOWLOGIN);
- }
if (OP_SHOWREGISTER.equals(op))
{
@@ -536,16 +534,6 @@
else if (OP_SHOWREGISTER_TY.equals(op))
{
PortletRequestDispatcher rd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/user/register_ty.jsp");
- PortalNode currentNode = Navigation.getCurrentNode();
- PortalNodeURL url = resp.createRenderURL(currentNode);
- url.setAuthenticated(Boolean.TRUE);
- if ("1".equals(getPortletConfig().getInitParameter("useSSL")))
- {
- url.setSecure(Boolean.TRUE);
- req.setAttribute("secureURL", url.toString());
- }
- url.setSecure(null);
- req.setAttribute("URL", url.toString());
rd.include(req, resp);
}
else if (OP_SHOWLOGIN.equals(op))
@@ -754,7 +742,7 @@
{
log.info("You didn't specify a default role in the portlet init configuration, please refer to the documentation");
}
- //resp.setRenderParameter("op", OP_SHOWREGISTER_TY);
+ resp.setRenderParameter("op", OP_SHOWREGISTER_TY);
resp.setWindowState(WindowState.NORMAL);
}
catch (IllegalArgumentException e)
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties 2007-02-14 13:07:21 UTC (rev 6267)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties 2007-02-14 13:39:58 UTC (rev 6268)
@@ -178,7 +178,7 @@
NAMENOTAVAILABLE=N/A
# Registration
-REGISER_NOT_LOGGED_IN=You are currently not logged in.
+REGISTER_NOT_LOGGED_IN=You are currently not logged in.
REGISTER_REGISTER=You can create an account.
REGISTER_REGISTER_LINK=create one
REGISTER_REGISTER_ADMIN_LINK=Create User account
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_es.properties
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_es.properties 2007-02-14 13:07:21 UTC (rev 6267)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_es.properties 2007-02-14 13:39:58 UTC (rev 6268)
@@ -177,14 +177,9 @@
NAMENOTAVAILABLE=N/A
# Registration
-REGISER_NOT_LOGGED_IN=
REGISTER_REGISTER=Puedes crear una cuenta.
REGISTER_REGISTER_LINK=crear una
REGISTER_REGISTER_ADMIN_LINK=Crear una cuenta
-REGISTER_TY=
-REGISTER_BASICINFO=
-REGISTER_IM=
-REGISTER_ADDITIONAL=
REGISTER_NEWUSER=Registro de nuevo usuario
REGISTER_PASSWORDAGAIN=Confirme su clave
REGISTER_REALEMAIL=E-mail real
@@ -246,16 +241,12 @@
LIST_USERNAMECONTAINS=Usuario contiene
LIST_FULLNAME=Nombre completo
LIST_USERNAME=Nombre de usuario
-LIST_FIRSTNAME=
-LIST_LASTNAME=
LIST_ROLES=Roles
LIST_ACTIONS=Acciones
LIST_ACTIONSSHOWPROFILE=Perfil
LIST_ACTIONADDROLESTOUSER=Roles
LIST_ACTIONEDITROLES=Editar Roles
LIST_ACTIONDELETEUSER=Borrar el usario
-LIST_SEARCHRESULTS=
-LIST_MATCHING=
FILTER=Filtro
NEXTPAGE=P�gina siguiente
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_fr.properties
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_fr.properties 2007-02-14 13:07:21 UTC (rev 6267)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/classes/Resource_fr.properties 2007-02-14 13:39:58 UTC (rev 6268)
@@ -155,7 +155,7 @@
NAMENOTAVAILABLE=N/D
# Registration
-REGISER_NOT_LOGGED_IN=
+REGISTER_NOT_LOGGED_IN=Vous n'\u00EAtes pas connect\u00E9
REGISTER_REGISTER=Cr\u00E9er un compte
REGISTER_REGISTER_ADMIN_LINK=Cr\u00E9er un compte
REGISTER_NEWUSER=Enregistrement d'un nouvel utilisateur
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/login.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/login.jsp 2007-02-14 13:07:21 UTC (rev 6267)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/login.jsp 2007-02-14 13:39:58 UTC (rev 6268)
@@ -10,7 +10,7 @@
<tr>
<td colspan="1">
<span class="portlet-text">
- ${n:i18n("REGISER_NOT_LOGGED_IN")}
+ ${n:i18n("REGISTER_NOT_LOGGED_IN")}
<br/><br/>
<a id="register"
href="<portlet:renderURL windowState="maximized"><portlet:param name="op" value="showRegister"/></portlet:renderURL>">${n:i18n("REGISTER_REGISTER")}</a></span>
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/register_ty.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/register_ty.jsp 2007-02-14 13:07:21 UTC (rev 6267)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/user/register_ty.jsp 2007-02-14 13:39:58 UTC (rev 6268)
@@ -5,48 +5,15 @@
<%@ page isELIgnored="false" %>
<portlet:defineObjects/>
-<span class="portlet-font"><a
- href="<portlet:renderURL windowState="normal"><portlet:param name="op" value="showMenu"/></portlet:renderURL>">${n:i18n("REGISTER_SHOWMENU")}</a></span>
-<br/>
<div class="box" align="center">
- <%
- String auth = null;
- String url = (String) renderRequest.getAttribute("URL");
- if (url != null) {
- auth = url;
- } else {
- String contextPath = (String) renderRequest.getAttribute(CoreConstants.REQ_ATT_CONTEXT_PATH);
- String servletPath = (String) renderRequest.getAttribute(CoreConstants.REQ_ATT_SERVLET_PATH);
- auth = contextPath + servletPath + "/auth/";
- }
- // SSL
- String secureAuth = null;
- String secureURL = (String) renderRequest.getAttribute("secureURL");
- if (secureURL != null) {
- secureAuth = secureURL;
- } else {
- String contextPath = (String) renderRequest.getAttribute(CoreConstants.REQ_ATT_CONTEXT_PATH);
- String servletPath = (String) renderRequest.getAttribute(CoreConstants.REQ_ATT_SERVLET_PATH);
- secureAuth = contextPath + servletPath + "/authsec/";
- }
- %>
<table border="0" class="portlet-font" cellspacing="0" cellpadding="2">
<tr>
<td align="center">${n:i18n("REGISTER_TY")}</td>
</tr>
- <tr>
- <td colspan="1" align="center">
- <a id="standardlogin" href="<%= auth %>">Standard ${n:i18n("LOGIN")}</a>
- <%
- if (secureURL != null) {
- %>
- |
- <a id="securelogin" href="<%= secureAuth %>">Secured ${n:i18n("LOGIN")}</a>
- <%
- }
- %>
- </td>
- </tr>
</table>
-</div>
\ No newline at end of file
+</div>
+<br/>
+<br/>
+<span class="portlet-font"><a
+ href="<portlet:renderURL windowState="normal"><portlet:param name="op" value="showMenu"/></portlet:renderURL>">${n:i18n("REGISTER_SHOWMENU")}</a></span>
19 years, 2 months
JBoss Portal SVN: r6267 - trunk/build/ide/intellij/idea60/modules/tools.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-02-14 08:07:21 -0500 (Wed, 14 Feb 2007)
New Revision: 6267
Modified:
trunk/build/ide/intellij/idea60/modules/tools/tools.iml
Log:
added source dir in tools module
Modified: trunk/build/ide/intellij/idea60/modules/tools/tools.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/tools/tools.iml 2007-02-14 06:52:37 UTC (rev 6266)
+++ trunk/build/ide/intellij/idea60/modules/tools/tools.iml 2007-02-14 13:07:21 UTC (rev 6267)
@@ -4,7 +4,9 @@
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../../../../../tools/classes" />
<exclude-output />
- <content url="file://$MODULE_DIR$/../../../../../../tools" />
+ <content url="file://$MODULE_DIR$/../../../../../../tools">
+ <sourceFolder url="file://$MODULE_DIR$/../../../../../../tools/src/main" isTestSource="false" />
+ </content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntryProperties />
19 years, 2 months
JBoss Portal SVN: r6266 - in trunk/wsrp: src/main/org/jboss/portal/test/wsrp/framework/support and 7 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-14 01:52:37 -0500 (Wed, 14 Feb 2007)
New Revision: 6266
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ReleaseSessionsSessionListener.java
Modified:
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/web.xml
Log:
- Added minimal releaseSessions implementation (still need to hook the session listener in web.xml and test).
- Adapted ProducerSessionInformation to accomodate support of releaseSessions (in particular, now references the associated consumer).
- Updated test cases.
- Minor other improvements.
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/build.xml 2007-02-14 06:52:37 UTC (rev 6266)
@@ -359,6 +359,7 @@
<target name="package-other-test" description="Generates the test artifacts" depends="compile">
<jar jarfile="${build.lib.test}/test-other-lib.jar">
<fileset dir="${build.classes}/">
+ <include name="org/jboss/portal/test/wsrp/framework/support/*.class"/>
<include name="org/jboss/portal/test/wsrp/other/*TestCase.class"/>
<include name="org/jboss/portal/test/wsrp/handler/*.class"/>
</fileset>
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -0,0 +1,145 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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.test.wsrp.framework.support;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+import org.jboss.portal.wsrp.services.ServiceFactory;
+
+import javax.servlet.http.HttpSession;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class MockWSRPConsumer implements WSRPConsumer
+{
+ public String getProducerId()
+ {
+ return null;
+ }
+
+ public void setServiceFactory(ServiceFactory serviceFactory)
+ {
+ }
+
+ public ServiceFactory getServiceFactory()
+ {
+ return null;
+ }
+
+ public ProducerSessionInformation getProducerSessionInformationFrom(PortletInvocation invocation)
+ {
+ return null;
+ }
+
+ public ProducerSessionInformation getProducerSessionInformationFrom(HttpSession session)
+ {
+ return null;
+ }
+
+ public ProducerInfo getProducerInfo()
+ {
+ return null;
+ }
+
+ public void setProducerInfo(ProducerInfo producerInfo)
+ {
+ }
+
+ public void refreshProducerInfo() throws PortletInvokerException
+ {
+ }
+
+ public void releaseSession(String sessionId) throws PortletInvokerException
+ {
+ }
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ return null;
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
+ {
+ return null;
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
+ {
+ return null;
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public void create() throws Exception
+ {
+ }
+
+ public void start() throws Exception
+ {
+ }
+
+ public void stop()
+ {
+ }
+
+ public void destroy()
+ {
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -25,6 +25,7 @@
import junit.framework.TestCase;
import org.apache.commons.httpclient.Cookie;
+import org.jboss.portal.test.wsrp.framework.support.MockWSRPConsumer;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
@@ -42,6 +43,7 @@
protected void setUp() throws Exception
{
info = new ProducerSessionInformation();
+ info.setAssociatedConsumer(new MockWSRPConsumer());
}
public void testUserCookie() throws Exception
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -157,6 +157,12 @@
ExtendedAssert.assertNotNull(sessionInfo.getUserCookie());
}
+ public void testImplicitCloning() throws Exception
+ {
+// ActionInvocation action = createActionInvocation()
+
+ }
+
private FragmentResponse checkRenderResult(PortletInvocationResponse response, String markup)
{
ExtendedAssert.assertNotNull(response);
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestCase.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/ServiceDescriptionTestCase.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -51,6 +51,7 @@
super.setUp();
// override default service description behavior to make sure we have the correct state
producer.getBehaviorRegistry().setServiceDescriptionBehavior(new BasicServiceDescriptionBehavior());
+ consumer.refreshProducerInfo();
}
public void testGetportlets() throws Exception
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -96,4 +96,12 @@
* @since 2.6
*/
void refreshProducerInfo() throws PortletInvokerException;
+
+ /**
+ * Instructs the associated producer to release the specified session.
+ *
+ * @param sessionId the session id to be released
+ * @since 2.6
+ */
+ void releaseSession(String sessionId) throws PortletInvokerException;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPTypeFactory.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -62,6 +62,7 @@
import org.jboss.portal.wsrp.core.PropertyList;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.core.ReleaseSessions;
import org.jboss.portal.wsrp.core.ResetProperty;
import org.jboss.portal.wsrp.core.RuntimeContext;
import org.jboss.portal.wsrp.core.ServiceDescription;
@@ -856,4 +857,17 @@
return new ResetProperty(name);
}
+
+ /**
+ * registrationContext(RegistrationContext)?, sessionIDs(xsd:string)*
+ *
+ * @return
+ * @since 2.6
+ */
+ public static ReleaseSessions createReleaseSessions(RegistrationContext registrationContext, String[] sessionIDs)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(sessionIDs, "Session IDs");
+
+ return new ReleaseSessions(registrationContext, sessionIDs);
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -27,7 +27,9 @@
import org.jboss.logging.Logger;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.core.SessionContext;
import java.util.HashMap;
@@ -54,8 +56,19 @@
/** portlet handle -> SessionInfo */
private Map portletSessions;
+ /** session id -> portlet handle */
+ private Map sessionId2PortletHandle;
+
private Cookie[] userCookie;
+ private WSRPConsumer associatedConsumer;
+
+ public void setAssociatedConsumer(WSRPConsumer associatedConsumer)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(associatedConsumer, "Consumer");
+ this.associatedConsumer = associatedConsumer;
+ }
+
public String getUserCookie()
{
if (userCookie == null)
@@ -155,14 +168,17 @@
public void addSessionForPortlet(String portletHandle, SessionContext sessionContext)
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle, "portlet handle", null);
+ // sessionContext is validated in SessionInfo constructor
+ SessionInfo info = new SessionInfo(sessionContext, portletHandle);
if (portletSessions == null)
{
portletSessions = new HashMap();
+ sessionId2PortletHandle = new HashMap();
}
- portletSessions.put(portletHandle, new SessionInfo(sessionContext));
+ portletSessions.put(portletHandle, info);
+ sessionId2PortletHandle.put(sessionContext.getSessionID(), portletHandle);
}
/**
@@ -175,34 +191,43 @@
*/
public String getSessionIdForPortlet(String portletHandle)
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle, "portlet handle", null);
-
- if (portletSessions == null)
+ ProducerSessionInformation.SessionIdResult idResult = internalGetSessionIdForPortlet(portletHandle);
+ if (idResult.expired)
{
return null;
}
- SessionInfo session = (SessionInfo)portletSessions.get(portletHandle);
- if (session != null)
- {
- String id = session.getSessionId();
- // if the returned id is null, the session is invalid so we remove it
- if (id == null)
- {
- portletSessions.remove(portletHandle);
- }
-
- return id;
- }
- return null;
+ return idResult.id;
}
public void removeSessionIdForPortlet(String portletHandle)
{
- if (portletHandle != null && portletSessions != null)
+ ProducerSessionInformation.SessionIdResult result = internalGetSessionIdForPortlet(portletHandle);
+ final String id = result.id;
+
+ // if the session is still valid, release it and remove the associated mappings
+ if (!result.expired)
{
portletSessions.remove(portletHandle);
+ sessionId2PortletHandle.remove(id);
+
+ Runnable releaseSession = new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ associatedConsumer.releaseSession(id);
+ }
+ catch (PortletInvokerException e)
+ {
+ log.debug(e);
+ }
+ }
+ };
+ new Thread(releaseSession).start();
}
+
}
public int getNumberOfSessions()
@@ -217,6 +242,19 @@
}
}
+ public void releaseSession(String id)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(id, "session id");
+
+ String portletHandle = (String)sessionId2PortletHandle.get(id);
+ if (portletHandle == null)
+ {
+ throw new IllegalArgumentException("No such session id: '" + id + "'");
+ }
+
+ removeSessionIdForPortlet(portletHandle);
+ }
+
public void replaceUserCookiesWith(ProducerSessionInformation currentSessionInfo)
{
if (currentSessionInfo != null && currentSessionInfo.userCookie != null && currentSessionInfo.userCookie.length > 0)
@@ -270,17 +308,52 @@
return (Cookie[])cleanCookies.toArray(new Cookie[0]);
}
+ private SessionIdResult internalGetSessionIdForPortlet(String portletHandle)
+ {
+ SessionInfo session = getSessionInfoFor(portletHandle);
+ if (session != null)
+ {
+ String id = session.getSessionId();
+ if (!session.isStillValid())
+ {
+ portletSessions.remove(session.getPortletHandle());
+ sessionId2PortletHandle.remove(session.getSessionId());
+ return new SessionIdResult(id, true);
+ }
+ else
+ {
+ return new SessionIdResult(id, false);
+ }
+ }
+ return new SessionIdResult(null, false);
+ }
+
+ private SessionInfo getSessionInfoFor(String portletHandle)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle, "portlet handle", null);
+
+ if (portletSessions == null)
+ {
+ return null;
+ }
+
+ return (SessionInfo)portletSessions.get(portletHandle);
+ }
+
private class SessionInfo
{
private SessionContext sessionContext;
private long lastInvocationTime;
+ private String portletHandle;
- public SessionInfo(SessionContext sessionContext)
+ public SessionInfo(SessionContext sessionContext, String portletHandle)
{
ParameterValidation.throwIllegalArgExceptionIfNull(sessionContext, "SessionContext");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(sessionContext.getSessionID(), "session id", "SessionContext");
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(portletHandle, "portlet handle", "SessionInfo");
this.sessionContext = sessionContext;
+ this.portletHandle = portletHandle;
lastInvocationTime = System.currentTimeMillis();
}
@@ -307,13 +380,26 @@
return diff > 0;
}
- public String getSessionId()
+ private String getSessionId()
{
- if (isStillValid())
- {
- return sessionContext.getSessionID();
- }
- return null;
+ return sessionContext.getSessionID();
}
+
+ private String getPortletHandle()
+ {
+ return portletHandle;
+ }
}
+
+ private class SessionIdResult
+ {
+ private String id;
+ private boolean expired;
+
+ public SessionIdResult(String id, boolean expired)
+ {
+ this.id = id;
+ this.expired = expired;
+ }
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -234,11 +234,21 @@
ParameterValidation.throwIllegalArgExceptionIfNull(session, "Session");
String producerSessionKey = getProducerSessionInformationKey();
ProducerSessionInformation sessionInformation = (ProducerSessionInformation)session.getAttribute(producerSessionKey);
- if (sessionInformation == null && create)
+
+ if (sessionInformation != null)
{
- sessionInformation = new ProducerSessionInformation();
- session.setAttribute(producerSessionKey, sessionInformation);
+ sessionInformation.setAssociatedConsumer(consumer);
}
+ else
+ {
+ if (create)
+ {
+ sessionInformation = new ProducerSessionInformation();
+ session.setAttribute(producerSessionKey, sessionInformation);
+ sessionInformation.setAssociatedConsumer(consumer);
+ }
+ }
+
return sessionInformation;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -54,10 +54,12 @@
import org.jboss.portal.wsrp.core.DestroyPortlets;
import org.jboss.portal.wsrp.core.DestroyPortletsResponse;
import org.jboss.portal.wsrp.core.GetPortletProperties;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.PropertyList;
import org.jboss.portal.wsrp.core.RegistrationContext;
import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.core.ReleaseSessions;
import org.jboss.portal.wsrp.core.ResetProperty;
import org.jboss.portal.wsrp.core.RuntimeContext;
import org.jboss.portal.wsrp.core.SetPortletProperties;
@@ -556,6 +558,27 @@
sessionHandler.setRequiresInitCookie(producerInfo.getRequiresInitCookie());
}
+ public void releaseSession(String sessionId) throws PortletInvokerException
+ {
+ ReleaseSessions releaseSessions =
+ WSRPTypeFactory.createReleaseSessions(producerInfo.getRegistrationInfo().getRegistrationContext(), new String[]{sessionId});
+
+ try
+ {
+ getMarkupService().releaseSessions(releaseSessions);
+ }
+ catch (InvalidRegistrationFault invalidRegistrationFault)
+ {
+ log.debug("Invalid Registration");
+ handleInvalidRegistrationFault();
+ }
+ catch (Exception e)
+ {
+ log.debug(e);
+ throw new PortletInvokerException("Couldn't release session '" + sessionId + "'.", e);
+ }
+ }
+
// Support methods **************************************************************************************************
private String getUserContextKeyFor(UserContext userContext)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/RegistrationHandler.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -260,6 +260,7 @@
{
throwInvalidRegistrationFault("no registration necessary yet one was provided!");
}
+ RegistrationLocal.setRegistration(null);
return true;
}
}
Added: trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ReleaseSessionsSessionListener.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ReleaseSessionsSessionListener.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ReleaseSessionsSessionListener.java 2007-02-14 06:52:37 UTC (rev 6266)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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.wsrp.servlet;
+
+import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+import org.jboss.portal.wsrp.handler.RequestHeaderClientHandler;
+
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class ReleaseSessionsSessionListener implements HttpSessionListener
+{
+ public void sessionCreated(HttpSessionEvent httpSessionEvent)
+ {
+ // do nothing when the session is created
+ System.out.println("Session created: " + httpSessionEvent.getSession().getId());
+ }
+
+ public void sessionDestroyed(HttpSessionEvent httpSessionEvent)
+ {
+ HttpSession session = httpSessionEvent.getSession();
+ String id = session.getId();
+ System.out.println("Session destroyed: " + id);
+ ProducerSessionInformation producerSessionInfo = RequestHeaderClientHandler.getCurrentProducerSessionInformation();
+ producerSessionInfo.releaseSession(id);
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/wsrp/servlet/ReleaseSessionsSessionListener.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/web.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/web.xml 2007-02-14 06:48:32 UTC (rev 6265)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/web.xml 2007-02-14 06:52:37 UTC (rev 6266)
@@ -45,6 +45,11 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <!--<listener>
+ <description>Listen for session events so that we can call releaseSessions appropriately</description>
+ <listener-class>org.jboss.portal.wsrp.servlet.ReleaseSessionsSessionListener</listener-class>
+ </listener>-->
+
<!-- WSRP Endpoints -->
<servlet>
<servlet-name>ServiceDescriptionService</servlet-name>
19 years, 2 months
JBoss Portal SVN: r6265 - trunk/common/src/main/org/jboss/portal/common/net/jar.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-14 01:48:32 -0500 (Wed, 14 Feb 2007)
New Revision: 6265
Modified:
trunk/common/src/main/org/jboss/portal/common/net/jar/JarURLNavigationProvider.java
Log:
Minor improvement in error message.
Modified: trunk/common/src/main/org/jboss/portal/common/net/jar/JarURLNavigationProvider.java
===================================================================
--- trunk/common/src/main/org/jboss/portal/common/net/jar/JarURLNavigationProvider.java 2007-02-14 06:14:20 UTC (rev 6264)
+++ trunk/common/src/main/org/jboss/portal/common/net/jar/JarURLNavigationProvider.java 2007-02-14 06:48:32 UTC (rev 6265)
@@ -26,17 +26,17 @@
import org.jboss.portal.common.net.URLVisitor;
import org.jboss.portal.common.util.Jar;
-import java.net.URL;
+import java.io.IOException;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
-import java.util.Iterator;
-import java.util.List;
+import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Iterator;
import java.util.LinkedList;
+import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
-import java.io.IOException;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -53,7 +53,7 @@
}
if (!"jar".equals(url.getProtocol()))
{
- throw new IllegalArgumentException("Only jar URL are accepted not " + url.getProtocol());
+ throw new IllegalArgumentException("Only jar URL are accepted, not " + url.getProtocol());
}
JarURLConnection conn = (JarURLConnection)url.openConnection();
visit(conn, visitor);
@@ -80,7 +80,7 @@
entries.add(root);
// Add all the other entries under the root to the list
- for (Iterator i = Jar.iterator(jarFile);i.hasNext();)
+ for (Iterator i = Jar.iterator(jarFile); i.hasNext();)
{
Jar.EntryInfo current = (Jar.EntryInfo)i.next();
if (current.isDescendantOf(root))
@@ -163,27 +163,31 @@
this.root = root;
this.atoms = new LinkedList();
}
+
int size()
{
return atoms.size();
}
+
void push(String atom)
{
atoms.addLast(atom);
}
+
String pop()
{
return (String)atoms.removeLast();
}
+
URL getURL(boolean dir) throws MalformedURLException
{
StringBuffer tmp = new StringBuffer(jarURL.toString()).append("!");
- for (int i = 0;i < root.size() - 1;i++)
+ for (int i = 0; i < root.size() - 1; i++)
{
String atom = root.get(i);
tmp.append("/").append(atom);
}
- for (int i = 0;i < atoms.size();i++)
+ for (int i = 0; i < atoms.size(); i++)
{
String atom = (String)atoms.get(i);
tmp.append("/").append(atom);
@@ -200,6 +204,7 @@
{
final String name;
final ArrayList children;
+
public Node(String name)
{
this.name = name;
19 years, 2 months
JBoss Portal SVN: r6264 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-14 01:14:20 -0500 (Wed, 14 Feb 2007)
New Revision: 6264
Modified:
docs/trunk/referenceGuide/en/modules/configuration.xml
docs/trunk/referenceGuide/en/modules/wsrp.xml
Log:
- Updated documentation on configuring ports, pointing to the Wiki.
- Minor other improvements.
Modified: docs/trunk/referenceGuide/en/modules/configuration.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/configuration.xml 2007-02-14 05:29:16 UTC (rev 6263)
+++ docs/trunk/referenceGuide/en/modules/configuration.xml 2007-02-14 06:14:20 UTC (rev 6264)
@@ -46,19 +46,8 @@
]]>
</programlisting>
</para>
- <para>You also need to change the port number in the following files for WSRP:
- <itemizedlist>
- <listitem>
- <literal>jboss-portal.sar/portal-wsrp.sar/default-wsrp.xml</literal>
- </listitem>
- <listitem>
- <literal>jbossws.sar/META-INF/jboss-service.xml</literal>
- as indicated in
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBWSFAQURLRewriting">JBoss WS' URL rewriting
- FAQ
- </ulink>
- </listitem>
- </itemizedlist>
+ <para>
+ Please refer to <xref linkend="wsrp-ports"/> to update the WSRP after having changed the port.
</para>
<para>Now you can restart JBoss and use the new port that you defined. On systems like Linux,
you need privileges to be able to run a server on a port lower than 1000, starting JBoss on
Modified: docs/trunk/referenceGuide/en/modules/wsrp.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/wsrp.xml 2007-02-14 05:29:16 UTC (rev 6263)
+++ docs/trunk/referenceGuide/en/modules/wsrp.xml 2007-02-14 06:14:20 UTC (rev 6264)
@@ -69,11 +69,19 @@
</para>
</sect2>
+ <sect2 id="wsrp-ports">
+ <title>Considerations to use WSRP when running Portal on a non-default port</title>
+ <para>If you have modified the port number on which Portal runs, you will also need
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPChangePorts">update the port information for WSRP</ulink>
+ as found on <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
+ </para>
+ </sect2>
+
<sect2>
<title>Considerations to use WSRP with SSL</title>
- <para>It is possible to use WSRP over SSL for secure exchanges of data. Please refer to the
- <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPUseSSL">instructions</ulink>. on
- how to do so as found on
+ <para>It is possible to use WSRP over SSL for secure exchange of data. Please refer to the
+ <ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=WSRPUseSSL">instructions</ulink> on
+ how to do so from
<ulink url="http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossPortal">JBoss Portal's wiki</ulink>.
</para>
</sect2>
@@ -145,20 +153,21 @@
<sect1>
<title>Consuming JBoss Portal's WSRP portlets from a remote Consumer</title>
<para>WSRP Consumers vary a lot as far as how they are configured. Most of them require that you either specify
- the URL for the Producer's WSDL definition or the URLs for the individual endpoints.
+ the URL for the Producer's WSDL definition or the URLs for the individual endpoints. Please refer to your
+ Consumer's documentation for specific instructions.
</para>
<para>
JBoss Portal's Producer is automatically set up when you deploy a portal instance with the WSRP service.
- Assuming you're running a
- default configuration (i.e. you haven't changed the server's port number), you can access the WSDL file at
- <literal>http://localhost:8080/portal-wsrp/MarkupService?wsdl</literal>. You can access the endpoint URLs at:
+ You can access the WSDL file at
+ <literal>http://{hostname}:{port}/portal-wsrp/MarkupService?wsdl</literal>. You can access the endpoint URLs at:
<itemizedlist>
- <listitem>http://localhost:8080/portal-wsrp/ServiceDescriptionService</listitem>
- <listitem>http://localhost:8080/portal-wsrp/MarkupService</listitem>
- <listitem>http://localhost:8080/portal-wsrp/RegistrationService</listitem>
- <listitem>http://localhost:8080/portal-wsrp/PortletManagementService</listitem>
+ <listitem><literal>http://{hostname}:{port}/portal-wsrp/ServiceDescriptionService</literal></listitem>
+ <listitem><literal>http://{hostname}:{port}/portal-wsrp/MarkupService</literal></listitem>
+ <listitem><literal>http://{hostname}:{port}/portal-wsrp/RegistrationService</literal></listitem>
+ <listitem><literal>http://{hostname}:{port}/portal-wsrp/PortletManagementService</literal></listitem>
</itemizedlist>
- </para>
+ The default hostname is <literal>localhost</literal> and the default port is 8080.
+ </para>
</sect1>
<sect1>
@@ -463,10 +472,10 @@
and <literal>org.jboss.portal.Registration.policies.RegistrationPropertyValidator</literal> for more details
on what is expected of each method.
</para>
- <para>As far as configuration of the Producer goes, a registration policy is required. This is accomplished
+ <para>Defining a registration policy is required for the producer to be correctly configured. This is accomplished
by specifying the qualified class name of the registration policy via the
<emphasis role="bold"><registration-policy></emphasis> element. Since we anticipate that most users
- will use the default registration policy, it is possible to use
+ will use the default registration policy, it is possible to use the
<emphasis role="bold"><registration-property-validator></emphasis> element and provide the class
name of your custom property validator instead. Since specifying a property validator only makes sense in
the context of the default registration policy, both elements are mutually exclusive.
19 years, 2 months