JBoss Portal SVN: r6866 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-03-28 10:48:17 -0400 (Wed, 28 Mar 2007)
New Revision: 6866
Modified:
docs/trunk/referenceGuide/en/modules/migration.xml
Log:
small update
Modified: docs/trunk/referenceGuide/en/modules/migration.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/migration.xml 2007-03-28 14:09:08 UTC (rev 6865)
+++ docs/trunk/referenceGuide/en/modules/migration.xml 2007-03-28 14:48:17 UTC (rev 6866)
@@ -57,6 +57,8 @@
</sect2>
<sect2>
<title>Database</title>
+ <note>All things described in this section can be done using AdminPortlet. Treat this directions more as guideline
+ if you need to automate migration for big portal deployment.</note>
<para>
Database schema wasn't changed between 2.4 and 2.6 releases, but still content that is kept in it
changed slightly in few areas. You can easily update the data manually by using tools proper for your
@@ -89,6 +91,7 @@
</listitem>
</itemizedlist>
</para>
+ <note>Instead of editing database you can destroy those instances in AdminPortlet and recreate them.</note>
<para>
<emphasis>NavigationPortlet</emphasis> from JBP 2.4 is not present anymore. Its functionality is now realized by
<emphasis>PageCustomizerInterceptor</emphasis> so all references to <emphasis>NavigationPortlet</emphasis> should
@@ -112,6 +115,7 @@
</listitem>
</itemizedlist>
</para>
+ <note>Instead of editing database you can just remove NavigationPortletInstance using AdminPortlet.</note>
</sect3>
<sect3>
<title>CMS</title>
19 years, 1 month
JBoss Portal SVN: r6865 - trunk/core/src/main/org/jboss/portal/core/servlet/jsp.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-28 10:09:08 -0400 (Wed, 28 Mar 2007)
New Revision: 6865
Modified:
trunk/core/src/main/org/jboss/portal/core/servlet/jsp/PortalJsp.java
Log:
corrected javadoc
Modified: trunk/core/src/main/org/jboss/portal/core/servlet/jsp/PortalJsp.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/servlet/jsp/PortalJsp.java 2007-03-28 14:06:20 UTC (rev 6864)
+++ trunk/core/src/main/org/jboss/portal/core/servlet/jsp/PortalJsp.java 2007-03-28 14:09:08 UTC (rev 6865)
@@ -39,7 +39,7 @@
/**
* Any JSP page using the JBoss library should extend that class. It is done by adding the following line at the top of
- * the JSP <%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.JBossJsp" %>
+ * the JSP <%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
*
* @author <a href="theute(a)jboss.org">Thomas Heute </a> $Revision$
*/
19 years, 1 month
JBoss Portal SVN: r6863 - trunk/portlet/src/main/org/jboss/portal/portlet/spi.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-28 09:54:32 -0400 (Wed, 28 Mar 2007)
New Revision: 6863
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
Log:
minor javadoc for RequestContext interface
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-03-28 13:44:55 UTC (rev 6862)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-03-28 13:54:32 UTC (rev 6863)
@@ -30,23 +30,26 @@
import javax.servlet.ServletContext;
/**
+ * Defines the request context contract. It's usage is related to the Servlet Container operational
+ * environment.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
public interface RequestContext
{
/**
- *
+ * Return the scheme value.
*/
String getScheme();
/**
- *
+ * Return the server name value.
*/
String getServerName();
/**
- *
+ * Return the server port value.
*/
int getServerPort();
19 years, 1 month
JBoss Portal SVN: r6862 - in trunk: portlet/src/main/org/jboss/portal/portlet/aspects/portlet and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-28 09:44:55 -0400 (Wed, 28 Mar 2007)
New Revision: 6862
Modified:
trunk/bridge/src/main/org/jboss/portal/bridge/BridgeRequest.java
trunk/bridge/src/main/org/jboss/portal/bridge/BridgeResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
Log:
- improve request dispatching responsibilities to portlet container
- do not expose client request and client response from RequestContext (because it may be unsafe to use them at some point in the pipeline)
Modified: trunk/bridge/src/main/org/jboss/portal/bridge/BridgeRequest.java
===================================================================
--- trunk/bridge/src/main/org/jboss/portal/bridge/BridgeRequest.java 2007-03-28 12:45:32 UTC (rev 6861)
+++ trunk/bridge/src/main/org/jboss/portal/bridge/BridgeRequest.java 2007-03-28 13:44:55 UTC (rev 6862)
@@ -52,7 +52,7 @@
public BridgeRequest(JBossServletContextProvider.BridgeInfo info)
{
PortletInvocation invocation = info.getInvocation();
- this.hreq = ((AbstractRequestContext)invocation.getRequestContext()).getClientRequest();
+ this.hreq = invocation.getDispatchedRequest();
this.preq = (PortletRequest)hreq.getAttribute("javax.portlet.request");
}
Modified: trunk/bridge/src/main/org/jboss/portal/bridge/BridgeResponse.java
===================================================================
--- trunk/bridge/src/main/org/jboss/portal/bridge/BridgeResponse.java 2007-03-28 12:45:32 UTC (rev 6861)
+++ trunk/bridge/src/main/org/jboss/portal/bridge/BridgeResponse.java 2007-03-28 13:44:55 UTC (rev 6862)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.bridge;
-import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import javax.portlet.PortletResponse;
@@ -43,15 +42,19 @@
public class BridgeResponse implements HttpServletResponse
{
+ /** . */
protected final PortletResponse presp;
+
+ /** . */
protected final PortletInvocation invocation;
+ /** . */
protected ServletOutputStream sos;
public BridgeResponse(JBossServletContextProvider.BridgeInfo info)
{
invocation = info.getInvocation();
- HttpServletRequest hreq = ((AbstractRequestContext)invocation.getRequestContext()).getClientRequest();
+ HttpServletRequest hreq = invocation.getDispatchedRequest();
this.presp = (PortletResponse)hreq.getAttribute("javax.portlet.response");
this.sos = null;
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-28 12:45:32 UTC (rev 6861)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-28 13:44:55 UTC (rev 6862)
@@ -32,7 +32,6 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.spi.RequestContext;
-import org.jboss.portal.portlet.info.PortletInfo;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -69,14 +68,7 @@
PortletApplication portletApplication = container.getApplication();
RequestContext reqCtx = invocation.getRequestContext();
ServletContext targetCtx = portletApplication.getContext().getServletContext();
- HttpServletRequest clientRequest = reqCtx.getClientRequest();
- HttpServletResponse clientResponse = reqCtx.getClientResponse();
- return servletContainerContext.dispatch(
- clientRequest,
- clientResponse,
- targetCtx,
- callback,
- invocation);
+ return reqCtx.dispatch(servletContainerContext, targetCtx, callback, invocation);
}
private static final RequestDispatchCallback callback = new RequestDispatchCallback()
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2007-03-28 12:45:32 UTC (rev 6861)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/spi/AbstractRequestContext.java 2007-03-28 13:44:55 UTC (rev 6862)
@@ -23,9 +23,12 @@
package org.jboss.portal.portlet.impl.spi;
import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.web.spi.ServletContainerContext;
+import org.jboss.portal.web.spi.RequestDispatchCallback;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -34,45 +37,47 @@
public class AbstractRequestContext implements RequestContext
{
+ /** . */
private HttpServletRequest req;
+
+ /** . */
private HttpServletResponse resp;
+ /** . */
+ private String scheme;
+
+ /** . */
+ private String serverName;
+
+ /** . */
+ private int serverPort;
+
public AbstractRequestContext(HttpServletRequest req, HttpServletResponse resp)
{
this.req = req;
this.resp = resp;
+ this.scheme = req.getScheme();
+ this.serverName = req.getServerName();
+ this.serverPort = req.getServerPort();
}
- public HttpServletRequest getClientRequest()
+ public String getScheme()
{
- if (req == null)
- {
- throw new IllegalStateException("No request available");
- }
- return req;
+ return scheme;
}
- public HttpServletResponse getClientResponse()
+ public String getServerName()
{
- if (resp == null)
- {
- throw new IllegalStateException("No response available");
- }
- return resp;
+ return serverName;
}
- public String getScheme()
+ public int getServerPort()
{
- return getClientRequest().getScheme();
+ return serverPort;
}
- public String getServerName()
+ public Object dispatch(ServletContainerContext scc, ServletContext targetCtx, RequestDispatchCallback callback, Object handback) throws Exception
{
- return getClientRequest().getServerName();
+ return scc.dispatch(req, resp, targetCtx, callback, handback);
}
-
- public int getServerPort()
- {
- return getClientRequest().getServerPort();
- }
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-03-28 12:45:32 UTC (rev 6861)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/spi/RequestContext.java 2007-03-28 13:44:55 UTC (rev 6862)
@@ -22,8 +22,12 @@
******************************************************************************/
package org.jboss.portal.portlet.spi;
+import org.jboss.portal.web.spi.ServletContainerContext;
+import org.jboss.portal.web.spi.RequestDispatchCallback;
+
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -47,12 +51,15 @@
int getServerPort();
/**
+ * Delegate to the request context the dispatching to the target servlet context using the specified spi elements.
*
+ * @param servletContainerContext the servlet container spi
+ * @param targetServletContext the target servlet context
+ * @param callback the call back to be done after dispatch
+ * @param handback the hand back object to provide after dispatch to the call back
+ * @return the call back returned object
+ * @throws Exception any exception
*/
- HttpServletRequest getClientRequest();
+ Object dispatch(ServletContainerContext servletContainerContext, ServletContext targetServletContext, RequestDispatchCallback callback, Object handback) throws Exception;
- /**
- *
- */
- HttpServletResponse getClientResponse();
}
19 years, 1 month
JBoss Portal SVN: r6861 - trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-28 08:45:32 -0400 (Wed, 28 Mar 2007)
New Revision: 6861
Modified:
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
Log:
remove useless cast
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-28 12:16:04 UTC (rev 6860)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ContextDispatcherInterceptor.java 2007-03-28 12:45:32 UTC (rev 6861)
@@ -65,7 +65,7 @@
protected Object invoke(PortletInvocation invocation) throws Exception, InvocationException
{
- PortletContainer container = ((ContainerPortletInfo)(PortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
+ PortletContainer container = ((ContainerPortletInfo)invocation.getAttribute(PortletInvocation.INVOCATION_SCOPE, PortletContainerInvoker.PORTLET_CONTAINER_INFO)).getContainer();
PortletApplication portletApplication = container.getApplication();
RequestContext reqCtx = invocation.getRequestContext();
ServletContext targetCtx = portletApplication.getContext().getServletContext();
19 years, 1 month
JBoss Portal SVN: r6860 - in trunk/core-admin/src: resources/portal-admin-war/WEB-INF/jsf and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-28 08:16:04 -0400 (Wed, 28 Mar 2007)
New Revision: 6860
Removed:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/tabTemplate.xhtml
Modified:
trunk/core-admin/src/bin/portal-admin-war/style.css
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
Log:
- removed unused tabTemplate.xhtml
- don't provide a link for selected tab
Modified: trunk/core-admin/src/bin/portal-admin-war/style.css
===================================================================
--- trunk/core-admin/src/bin/portal-admin-war/style.css 2007-03-28 12:00:31 UTC (rev 6859)
+++ trunk/core-admin/src/bin/portal-admin-war/style.css 2007-03-28 12:16:04 UTC (rev 6860)
@@ -55,11 +55,7 @@
list-style-type: none;
display: inline;
margin: 0;
-}
-
-.admin-ui ul.topnav li a {
padding: 3px 0.5em;
- display: inline;
margin-left: 5px;
border: 1px solid #777;
border-bottom: none;
@@ -70,7 +66,7 @@
background-color: #ccf;
}
-.admin-ui ul.topnav li#currentTab a {
+.admin-ui ul.topnav li#currentTab {
background-color: white;
border-bottom: 1px solid white;
}
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-03-28 12:00:31 UTC (rev 6859)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-03-28 12:16:04 UTC (rev 6860)
@@ -10,9 +10,7 @@
<li>
<h:commandLink value="Portal Objects" action="objects" actionListener="#{portalobjectmgr.selectRootObject}"/>
</li>
- <li id="currentTab">
- <h:commandLink value="Portlet Instances" action="instances"/>
- </li>
+ <li id="currentTab">Portlet Instances</li>
<li>
<h:commandLink value="Portlet Definitions" action="portlets"/>
</li>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-03-28 12:00:31 UTC (rev 6859)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-03-28 12:16:04 UTC (rev 6860)
@@ -9,9 +9,7 @@
<!-- Common nav -->
<h:form>
<ul class="topnav">
- <li id="currentTab">
- <h:commandLink value="Portal Objects" action="objects" actionListener="#{portalobjectmgr.selectRootObject}"/>
- </li>
+ <li id="currentTab">Portal Objects</li>
<li>
<h:commandLink value="Portlet Instances" action="instances"/>
</li>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-03-28 12:00:31 UTC (rev 6859)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-03-28 12:16:04 UTC (rev 6860)
@@ -13,9 +13,7 @@
<li>
<h:commandLink value="Portlet Instances" action="instances"/>
</li>
- <li id="currentTab">
- <h:commandLink value="Portlet Definitions" action="portlets"/>
- </li>
+ <li id="currentTab">Portlet Definitions</li>
</ul>
</h:form>
Deleted: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/tabTemplate.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/tabTemplate.xhtml 2007-03-28 12:00:31 UTC (rev 6859)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/tabTemplate.xhtml 2007-03-28 12:16:04 UTC (rev 6860)
@@ -1,19 +0,0 @@
-<div xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
- <h:form>
- <ul class="topnav">
- <li>
- <h:commandLink value="Portal Objects" action="objects" actionListener="#{portalobjectmgr.selectRootObject}"/>
- </li>
- <li id="currentTab">
- <h:commandLink value="Portlet Instances" action="instances"/>
- </li>
- <li>
- <h:commandLink value="Portlet Definitions" action="portlets"/>
- </li>
- </ul>
- </h:form>
-
-</div>
19 years, 1 month
JBoss Portal SVN: r6859 - in trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf: wizard and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-28 08:00:31 -0400 (Wed, 28 Mar 2007)
New Revision: 6859
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
Log:
- Go to wizard -> Switch to wizard
- put the link at the same place on the page (bottom right) in both modes
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml 2007-03-28 11:52:53 UTC (rev 6858)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml 2007-03-28 12:00:31 UTC (rev 6859)
@@ -21,7 +21,7 @@
</c:choose>
<h:form>
- <p style="text-align: right"><h:commandLink action="wizardMode">Go to wizard mode</h:commandLink></p>
+ <p style="text-align: right"><h:commandLink action="wizardMode">Switch to wizard mode</h:commandLink></p>
</h:form>
</div>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2007-03-28 11:52:53 UTC (rev 6858)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2007-03-28 12:00:31 UTC (rev 6859)
@@ -5,112 +5,113 @@
xmlns:c="http://java.sun.com/jstl/core"
class="admin-ui">
-<div class="portlet-section-header">Adding a new Portlet</div>
-<h:form>
- <p style="text-align: right;"><h:commandLink action="advancedMode">Go to advanced mode</h:commandLink></p>
-</h:form>
+ <div class="portlet-section-header">Adding a new Portlet</div>
+
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 0}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 1</p>
-<c:choose>
- <c:when test="#{newWindowWizard.currentStep == 0}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 1</p>
+ <p class="stepText">Select Portlet</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 1</p>
- <p class="stepText">Select Portlet</p>
- </div>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 1</p>
+ <p class="stepText">Select Portlet</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
- <p class="stepText">Select Portlet</p>
- </div>
- </c:otherwise>
-</c:choose>
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 1}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 2</p>
-<c:choose>
- <c:when test="#{newWindowWizard.currentStep == 1}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 2</p>
+ <p class="stepText">Select Portal</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 2</p>
- <p class="stepText">Select Portal</p>
- </div>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 2</p>
+ <p class="stepText">Select Portal</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
- <p class="stepText">Select Portal</p>
- </div>
- </c:otherwise>
-</c:choose>
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 2}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 3</p>
-<c:choose>
- <c:when test="#{newWindowWizard.currentStep == 2}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 3</p>
+ <p class="stepText">Select Page</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 3</p>
- <p class="stepText">Select Page</p>
- </div>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 3</p>
+ <p class="stepText">Select Page</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
- <p class="stepText">Select Page</p>
- </div>
- </c:otherwise>
-</c:choose>
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 3}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 4</p>
-<c:choose>
- <c:when test="#{newWindowWizard.currentStep == 3}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 4</p>
+ <p class="stepText">Select Region</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 4</p>
- <p class="stepText">Select Region</p>
- </div>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 4</p>
+ <p class="stepText">Select Region</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
- <p class="stepText">Select Region</p>
- </div>
- </c:otherwise>
-</c:choose>
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 4}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 5</p>
-<c:choose>
- <c:when test="#{newWindowWizard.currentStep == 4}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 5</p>
+ <p class="stepText">Confirm</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 5</p>
- <p class="stepText">Confirm</p>
- </div>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 5</p>
+ <p class="stepText">Confirm</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
- <p class="stepText">Confirm</p>
- </div>
- </c:otherwise>
-</c:choose>
+ <!-- Status message -->
+ <h:message id="status" for="status"/>
-<!-- Status message -->
-<h:message id="status" for="status"/>
+ <!-- Content -->
+ <div class="wizardContent">
+ <ui:insert name="content">Content</ui:insert>
+ </div>
-<!-- Content -->
-<div class="wizardContent">
- <ui:insert name="content">Content</ui:insert>
-</div>
+ <div class="wizardButtonBox">
+ <h:form>
+ <h:commandButton rendered="#{newWindowWizard.currentStep gt 0}" value="Previous"
+ action="#{newWindowWizard.previous}" styleClass="portlet-form-button"/>
+ <h:commandButton disabled="#{!newWindowWizard.nextEnabled}" rendered="#{newWindowWizard.currentStep lt 4}"
+ value="Next" action="#{newWindowWizard.next}" styleClass="portlet-form-button"/>
+ </h:form>
+ </div>
-<div class="wizardButtonBox">
<h:form>
- <h:commandButton rendered="#{newWindowWizard.currentStep gt 0}" value="Previous"
- action="#{newWindowWizard.previous}" styleClass="portlet-form-button"/>
- <h:commandButton disabled="#{!newWindowWizard.nextEnabled}" rendered="#{newWindowWizard.currentStep lt 4}"
- value="Next" action="#{newWindowWizard.next}" styleClass="portlet-form-button"/>
+ <p style="text-align: right;"><h:commandLink action="advancedMode">Switch to advanced mode</h:commandLink></p>
</h:form>
-</div>
</div>
19 years, 1 month
JBoss Portal SVN: r6858 - trunk/core-samples/src/resources/portal-samples-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-28 07:52:53 -0400 (Wed, 28 Mar 2007)
New Revision: 6858
Modified:
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
Log:
fixed wrong listener id in IPC example
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-03-28 09:57:01 UTC (rev 6857)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-03-28 11:52:53 UTC (rev 6858)
@@ -87,7 +87,7 @@
</window>
<page>
<page-name>event test</page-name>
- <listener>event_listener</listener>
+ <listener>test_listener</listener>
<window>
<window-name>CatalogPortletWindow</window-name>
<instance-ref>CatalogPortletInstance</instance-ref>
19 years, 1 month
JBoss Portal SVN: r6857 - in trunk: theme/src/main/org/jboss/portal/theme and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-03-28 05:57:01 -0400 (Wed, 28 Mar 2007)
New Revision: 6857
Modified:
trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java
trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat6App.java
trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java
Log:
remove the filter integration that is not used anymore
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java 2007-03-28 00:56:31 UTC (rev 6856)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat5App.java 2007-03-28 09:57:01 UTC (rev 6857)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.server.deployment;
-import org.jboss.portal.server.servlet.CommandFilter;
import org.jboss.portal.server.servlet.CommandServlet;
import org.jboss.web.WebApplication;
import org.xml.sax.EntityResolver;
@@ -95,9 +94,6 @@
Object commandServlet = findChildMethod.invoke(standardContext, new Object[]{"CommandServlet"});
if (commandServlet == null)
{
- addFilterDef(cl);
- addFilterMap(cl);
- startFilter(cl);
setRunAsListenerAssociation(webApp.getMetaData());
try
{
@@ -110,16 +106,6 @@
}
}
- private void startFilter(ClassLoader cl) throws Exception
- {
- // Get classes
- Class standardContextClass = cl.loadClass("org.apache.catalina.core.StandardContext");
-
- // Start filters
- Method filterStartMethod = standardContextClass.getMethod("filterStart", new Class[0]);
- filterStartMethod.invoke(standardContext, new Object[0]);
- }
-
private void setRunAsListenerAssociation(Object o)
{
try
@@ -146,49 +132,6 @@
}
}
- private void addFilterMap(ClassLoader cl) throws Exception
- {
- // Get classes
- Class containerItf = cl.loadClass("org.apache.catalina.Container");
- Class standardWrapperClass = cl.loadClass("org.apache.catalina.core.StandardWrapper");
- Class filterMapClass = cl.loadClass("org.apache.catalina.deploy.FilterMap");
- Class standardContextClass = cl.loadClass("org.apache.catalina.core.StandardContext");
-
- // Get all the children
- Method findChildrenMethod = containerItf.getMethod("findChildren", new Class[0]);
- Object[] chilren = (Object[])findChildrenMethod.invoke(standardContext, new Object[0]);
-
- // Iterate
- for (int i = 0; i < chilren.length; i++)
- {
- Object child = chilren[i];
- Class childClass = child.getClass();
- if (childClass.equals(standardWrapperClass))
- {
- // If it is a wrapper we instrument
- Object filterMap = filterMapClass.newInstance();
-
- // Get servlet name
- Method getServletNameMethod = standardWrapperClass.getMethod("getServletName", new Class[0]);
- String servletName = (String)getServletNameMethod.invoke(child, new Object[0]);
-
- // Configure filter map
- Method setDispatcherMethod = filterMapClass.getMethod("setDispatcher", new Class[]{String.class});
- setDispatcherMethod.invoke(filterMap, new Object[]{"INCLUDE"});
- Method FilterMapSetFilterNameMethod = filterMapClass.getMethod("setFilterName", new Class[]{String.class});
- FilterMapSetFilterNameMethod.invoke(filterMap, new Object[]{"CommandFilter"});
- Method setServletNameMethod = filterMapClass.getMethod("setServletName", new Class[]{String.class});
- setServletNameMethod.invoke(filterMap, new Object[]{servletName});
- Method setURLPatternMethod = filterMapClass.getMethod("setURLPattern", new Class[]{String.class});
- setURLPatternMethod.invoke(filterMap, new Object[]{null});
-
- // Add the filter map
- Method addFilterMapMethod = standardContextClass.getMethod("addFilterMap", new Class[]{filterMapClass});
- addFilterMapMethod.invoke(standardContext, new Object[]{filterMap});
- }
- }
- }
-
private void addCommandServlet(ClassLoader cl) throws Exception
{
//
@@ -223,44 +166,6 @@
loadOnStartupMethod.invoke(standardContext, new Object[]{wrapperArray});
}
- private void addFilterDef(ClassLoader cl) throws Exception
- {
- // Get class
- Class standardContextClass = cl.loadClass("org.apache.catalina.core.StandardContext");
- Class filterDefClass = cl.loadClass("org.apache.catalina.deploy.FilterDef");
-
- // Create filter def
- Object filterDef = filterDefClass.newInstance();
-
- //
- Method setDescriptionMethod = filterDefClass.getMethod("setDescription", new Class[]{String.class});
- setDescriptionMethod.invoke(filterDef, new Object[]{""});
-
- //
- Method setDisplayNameMethod = filterDefClass.getMethod("setDisplayName", new Class[]{String.class});
- setDisplayNameMethod.invoke(filterDef, new Object[]{""});
-
- //
- Method setFilterClassMethod = filterDefClass.getMethod("setFilterClass", new Class[]{String.class});
- setFilterClassMethod.invoke(filterDef, new Object[]{CommandFilter.class.getName()});
-
- //
- Method FilterDefSetFilterNameMethod = filterDefClass.getMethod("setFilterName", new Class[]{String.class});
- FilterDefSetFilterNameMethod.invoke(filterDef, new Object[]{"CommandFilter"});
-
- //
- Method setLargeIconMethod = filterDefClass.getMethod("setLargeIcon", new Class[]{String.class});
- setLargeIconMethod.invoke(filterDef, new Object[]{""});
-
- //
- Method setSmallIconMethod = filterDefClass.getMethod("setSmallIcon", new Class[]{String.class});
- setSmallIconMethod.invoke(filterDef, new Object[]{""});
-
- // Finally add the filter def
- Method addFilterDefMethod = standardContextClass.getMethod("addFilterDef", new Class[]{filterDefClass});
- addFilterDefMethod.invoke(standardContext, new Object[]{filterDef});
- }
-
private ClassLoader getClassLoader(MBeanServer server, ObjectName name) throws Exception
{
Object loader = server.getAttribute(name, "loader");
Modified: trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat6App.java
===================================================================
--- trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat6App.java 2007-03-28 00:56:31 UTC (rev 6856)
+++ trunk/server/src/main/org/jboss/portal/server/deployment/PortalWebTomcat6App.java 2007-03-28 09:57:01 UTC (rev 6857)
@@ -24,7 +24,6 @@
import org.jboss.web.WebApplication;
import org.jboss.portal.server.servlet.CommandServlet;
-import org.jboss.portal.server.servlet.CommandFilter;
import org.xml.sax.EntityResolver;
import javax.management.MBeanServer;
@@ -69,7 +68,7 @@
}
catch (Exception e)
{
- CannotCreatePortletWebAppException ex = null;
+ CannotCreatePortletWebAppException ex;
if (e instanceof CannotCreatePortletWebAppException)
{
ex = (CannotCreatePortletWebAppException)e;
@@ -95,9 +94,6 @@
Object commandServlet = findChildMethod.invoke(standardContext, new Object[]{"CommandServlet"});
if (commandServlet == null)
{
- addFilterDef(cl);
- addFilterMap(cl);
- startFilter(cl);
setRunAsListenerAssociation(webApp.getMetaData());
try
{
@@ -110,16 +106,6 @@
}
}
- private void startFilter(ClassLoader cl) throws Exception
- {
- // Get classes
- Class standardContextClass = cl.loadClass("org.apache.catalina.core.StandardContext");
-
- // Start filters
- Method filterStartMethod = standardContextClass.getMethod("filterStart", new Class[0]);
- filterStartMethod.invoke(standardContext, new Object[0]);
- }
-
private void setRunAsListenerAssociation(Object o)
{
try
@@ -146,47 +132,6 @@
}
}
- private void addFilterMap(ClassLoader cl) throws Exception
- {
- // Get classes
- Class containerItf = cl.loadClass("org.apache.catalina.Container");
- Class standardWrapperClass = cl.loadClass("org.apache.catalina.core.StandardWrapper");
- Class filterMapClass = cl.loadClass("org.apache.catalina.deploy.FilterMap");
- Class standardContextClass = cl.loadClass("org.apache.catalina.core.StandardContext");
-
- // Get all the children
- Method findChildrenMethod = containerItf.getMethod("findChildren", new Class[0]);
- Object[] chilren = (Object[])findChildrenMethod.invoke(standardContext, new Object[0]);
-
- // Iterate
- for (int i = 0; i < chilren.length; i++)
- {
- Object child = chilren[i];
- Class childClass = child.getClass();
- if (childClass.equals(standardWrapperClass))
- {
- // If it is a wrapper we instrument
- Object filterMap = filterMapClass.newInstance();
-
- // Get servlet name
- Method getServletNameMethod = standardWrapperClass.getMethod("getServletName", new Class[0]);
- String servletName = (String)getServletNameMethod.invoke(child, new Object[0]);
-
- // Configure filter map
- Method setDispatcherMethod = filterMapClass.getMethod("setDispatcher", new Class[]{String.class});
- setDispatcherMethod.invoke(filterMap, new Object[]{"INCLUDE"});
- Method FilterMapSetFilterNameMethod = filterMapClass.getMethod("setFilterName", new Class[]{String.class});
- FilterMapSetFilterNameMethod.invoke(filterMap, new Object[]{"CommandFilter"});
- Method setServletNameMethod = filterMapClass.getMethod("addServletName", new Class[]{String.class});
- setServletNameMethod.invoke(filterMap, new Object[]{servletName});
-
- // Add the filter map
- Method addFilterMapMethod = standardContextClass.getMethod("addFilterMap", new Class[]{filterMapClass});
- addFilterMapMethod.invoke(standardContext, new Object[]{filterMap});
- }
- }
- }
-
private void addCommandServlet(ClassLoader cl) throws Exception
{
//
@@ -220,45 +165,7 @@
Method loadOnStartupMethod = standardContextClass.getMethod("loadOnStartup", new Class[]{wrapperArray.getClass()});
loadOnStartupMethod.invoke(standardContext, new Object[]{wrapperArray});
}
-
- private void addFilterDef(ClassLoader cl) throws Exception
- {
- // Get class
- Class standardContextClass = cl.loadClass("org.apache.catalina.core.StandardContext");
- Class filterDefClass = cl.loadClass("org.apache.catalina.deploy.FilterDef");
-
- // Create filter def
- Object filterDef = filterDefClass.newInstance();
-
- //
- Method setDescriptionMethod = filterDefClass.getMethod("setDescription", new Class[]{String.class});
- setDescriptionMethod.invoke(filterDef, new Object[]{""});
-
- //
- Method setDisplayNameMethod = filterDefClass.getMethod("setDisplayName", new Class[]{String.class});
- setDisplayNameMethod.invoke(filterDef, new Object[]{""});
-
- //
- Method setFilterClassMethod = filterDefClass.getMethod("setFilterClass", new Class[]{String.class});
- setFilterClassMethod.invoke(filterDef, new Object[]{CommandFilter.class.getName()});
-
- //
- Method FilterDefSetFilterNameMethod = filterDefClass.getMethod("setFilterName", new Class[]{String.class});
- FilterDefSetFilterNameMethod.invoke(filterDef, new Object[]{"CommandFilter"});
-
- //
- Method setLargeIconMethod = filterDefClass.getMethod("setLargeIcon", new Class[]{String.class});
- setLargeIconMethod.invoke(filterDef, new Object[]{""});
-
- //
- Method setSmallIconMethod = filterDefClass.getMethod("setSmallIcon", new Class[]{String.class});
- setSmallIconMethod.invoke(filterDef, new Object[]{""});
-
- // Finally add the filter def
- Method addFilterDefMethod = standardContextClass.getMethod("addFilterDef", new Class[]{filterDefClass});
- addFilterDefMethod.invoke(standardContext, new Object[]{filterDef});
- }
-
+
private ClassLoader getClassLoader(MBeanServer server, ObjectName name) throws Exception
{
Object loader = server.getAttribute(name, "loader");
Modified: trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java 2007-03-28 00:56:31 UTC (rev 6856)
+++ trunk/theme/src/main/org/jboss/portal/theme/LayoutDispatcher.java 2007-03-28 09:57:01 UTC (rev 6857)
@@ -46,7 +46,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision$
*/
-public final class LayoutDispatcher implements FilterCommand
+public final class LayoutDispatcher
{
private static final Logger log = Logger.getLogger(LayoutDispatcher.class);
@@ -92,21 +92,6 @@
this.renderContext = renderContext;
}
- public void execute(HttpServletRequest req, HttpServletResponse resp, FilterChain chain) throws ServletException, IOException
- {
- // This request returns a context path which is the one of the war file in which the target is
- HttpServletRequest wrapper = new HttpServletRequestWrapper(req)
- {
- public String getContextPath()
- {
- return renderContext.getLayoutInfo().getContextPath();
- }
- };
-
- // Execute the target
- chain.doFilter(wrapper, resp);
- }
-
/** Perform the dispatch to the target layout */
// public void include(PortalRequest req, PortalResponse resp) throws IOException, ServletException
public void include() throws IOException, ServletException
@@ -132,8 +117,18 @@
// add the results to the request
request.setAttribute(LayoutConstants.ATTR_PAGE, markupResult);
- dispatcher.include(request, response);
+ // This request returns a context path which is the one of the war file in which the target is
+ HttpServletRequest wrapper = new HttpServletRequestWrapper(request)
+ {
+ public String getContextPath()
+ {
+ return renderContext.getLayoutInfo().getContextPath();
+ }
+ };
+
+ dispatcher.include(wrapper, response);
+
log.debug("done with the layout");
}
else
19 years, 1 month
JBoss Portal SVN: r6856 - in trunk/wsrp/src/main/org/jboss/portal: test/wsrp/other and 3 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-03-27 20:56:31 -0400 (Tue, 27 Mar 2007)
New Revision: 6856
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
Log:
- Added ConsumerRegistry.destroyConsumer method (not tested).
- Improved support for releasing sessions on WSRPConsumer and ProducerSessionInformation. Issue exists to retrieve the appropriate ProducerSessionInformation without an invocation...
- JBPORTAL-715: started adding support for destroying a consumer.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2007-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockConsumerRegistry.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -112,4 +112,9 @@
{
// do nothing
}
+
+ public void destroyConsumer(String id)
+ {
+ // do nothing
+ }
}
Modified: 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 2007-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -91,10 +91,14 @@
{
}
- public void releaseSession(String sessionId) throws PortletInvokerException
+ public void releaseSessions(String[] sessionIds) throws PortletInvokerException
{
}
+ public void releaseSessions()
+ {
+ }
+
public void activate() throws Exception
{
}
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-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerSessionInformationTestCase.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -114,8 +114,8 @@
assertNull(info.getSessionIdForPortlet(handle));
assertEquals(0, info.getNumberOfSessions());
- info.addSessionForPortlet(handle, WSRPTypeFactory.createSessionContext(sid, 1));
- info.addSessionForPortlet(handle2, WSRPTypeFactory.createSessionContext(sid2, 3));
+ addSession(handle, sid, 1);
+ addSession(handle2, sid2, 3);
assertNull(info.getSessionIdForPortlet("unknown"));
@@ -127,7 +127,7 @@
assertEquals(sid2, info.getSessionIdForPortlet(handle2));
assertEquals(1, info.getNumberOfSessions());
- info.removeSessionIdForPortlet(handle2);
+ info.releaseSessionIdForPortlet(handle2);
assertEquals(0, info.getNumberOfSessions());
}
@@ -152,8 +152,26 @@
assertNull(info.getUserCookie());
}
+ public void testReleaseSessions()
+ {
+ addSession("handle", "id", 1);
+ addSession("handle2", "id2", 1);
+ addSession("handle3", "id3", 1);
+
+ assertEquals(3, info.getNumberOfSessions());
+
+ info.releaseSessions();
+
+ assertEquals(0, info.getNumberOfSessions());
+ }
+
private Cookie createCookie(String name, String value, int secondsBeforeExpiration)
{
return new Cookie("domain", name, value, "path", secondsBeforeExpiration, false);
}
+
+ private void addSession(String handle, String sid, int expires)
+ {
+ info.addSessionForPortlet(handle, WSRPTypeFactory.createSessionContext(sid, expires));
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -99,14 +99,33 @@
void refreshProducerInfo() throws PortletInvokerException;
/**
- * Instructs the associated producer to release the specified session.
+ * Instructs the associated producer to release the specified sessions.
*
- * @param sessionId the session id to be released
+ * @param sessionIds
* @since 2.6
*/
- void releaseSession(String sessionId) throws PortletInvokerException;
+ void releaseSessions(String[] sessionIds) throws PortletInvokerException;
+ /**
+ * Releases all the sessions held by this Consumer
+ *
+ * @since 2.6
+ */
+ void releaseSessions();
+
+ /**
+ * Prepares this Consumer to be used: service is started, endpoints are ready.
+ *
+ * @throws Exception
+ * @since 2.6
+ */
void activate() throws Exception;
+ /**
+ * Removes this Consumer from service. It cannot be used before being activated again.
+ *
+ * @throws Exception
+ * @since 2.6
+ */
void deactivate() throws Exception;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerManagerBean.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -149,6 +149,13 @@
public String destroyConsumer()
{
+ if (refreshConsumerId() != null)
+ {
+ registry.destroyConsumer(selectedId);
+ return listConsumers();
+ }
+
+ //todo: error message
return null;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2007-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistry.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -60,4 +60,6 @@
void deactivateConsumerWith(String id) throws ConsumerException;
void registerOrDeregisterConsumerWith(String id, boolean register);
+
+ void destroyConsumer(String id);
}
\ No newline at end of file
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ConsumerRegistryService.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -99,6 +99,30 @@
return createConsumerFrom(info);
}
+ public void destroyConsumer(String id)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(id, "Consumer identifier", "destroyConsumer");
+
+ WSRPConsumer consumer = getConsumer(id);
+ if (consumer != null)
+ {
+ ProducerInfo info = consumer.getProducerInfo();
+
+// consumer.releaseSessions(); // todo: fix, this is called from a different thread than the one that sets the req in ServletAccess
+ registerOrDeregisterConsumerWith(id, false);
+ deactivateConsumerWith(id);
+ consumers.remove(id);
+
+ Session session = sessionFactory.getCurrentSession();
+
+ session.delete(info);
+ }
+ else
+ {
+ throw new ConsumerException(CONSUMER_WITH_ID + id + "' doesn't exist!");
+ }
+ }
+
public void persistConsumer(WSRPConsumer consumer)
{
ParameterValidation.throwIllegalArgExceptionIfNull(consumer, "Consumer");
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java 2007-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerSessionInformation.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -32,7 +32,9 @@
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.core.SessionContext;
+import java.util.ArrayList;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -200,24 +202,35 @@
return idResult.id;
}
- public void removeSessionIdForPortlet(String portletHandle)
+ public void releaseSessionIdForPortlet(String portletHandle)
{
- ProducerSessionInformation.SessionIdResult result = internalGetSessionIdForPortlet(portletHandle);
- final String id = result.id;
+ SessionIdResult result = removeSessionIdForPortlet(portletHandle);
// if the session is still valid, release it and remove the associated mappings
+ final String[] sessionIds;
if (!result.expired)
{
- portletSessions.remove(portletHandle);
- sessionId2PortletHandle.remove(id);
+ sessionIds = new String[]{result.id};
+ }
+ else
+ {
+ sessionIds = null;
+ }
+ releaseSessions(sessionIds);
+ }
+
+ private void releaseSessions(final String[] sessionIds)
+ {
+ if (sessionIds != null && sessionIds.length > 0)
+ {
Runnable releaseSession = new Runnable()
{
public void run()
{
try
{
- associatedConsumer.releaseSession(id);
+ associatedConsumer.releaseSessions(sessionIds);
}
catch (PortletInvokerException e)
{
@@ -227,7 +240,21 @@
};
new Thread(releaseSession).start();
}
+ }
+ private SessionIdResult removeSessionIdForPortlet(String portletHandle)
+ {
+ 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);
+ }
+
+ return result;
}
public int getNumberOfSessions()
@@ -252,9 +279,34 @@
throw new IllegalArgumentException("No such session id: '" + id + "'");
}
- removeSessionIdForPortlet(portletHandle);
+ releaseSessionIdForPortlet(portletHandle);
}
+ public void releaseSessions()
+ {
+ List idsToRelease = new ArrayList(getNumberOfSessions());
+
+ // copy to avoid ConcurrentModificationException
+ List handlesCopy = new ArrayList(portletSessions.keySet());
+
+ for (Iterator handles = handlesCopy.iterator(); handles.hasNext();)
+ {
+ String handle = (String)handles.next();
+ SessionIdResult result = removeSessionIdForPortlet(handle);
+
+ // only release sessions that are still valid
+ if (!result.expired)
+ {
+ idsToRelease.add(result.id);
+ }
+ }
+
+ if (!idsToRelease.isEmpty())
+ {
+ releaseSessions((String[])idsToRelease.toArray(new String[0]));
+ }
+ }
+
public void replaceUserCookiesWith(ProducerSessionInformation currentSessionInfo)
{
if (currentSessionInfo != null && currentSessionInfo.userCookie != null && currentSessionInfo.userCookie.length > 0)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-03-28 00:50:40 UTC (rev 6855)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-03-28 00:56:31 UTC (rev 6856)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.wsrp.consumer;
+import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.common.i18n.LocaleInfo;
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.jems.as.system.AbstractJBossService;
@@ -68,6 +68,7 @@
import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
import org.jboss.portal.wsrp.services.ServiceFactory;
+import org.jboss.portal.wsrp.servlet.ServletAccess;
import org.jboss.portal.wsrp.servlet.UserAccess;
import javax.servlet.http.HttpServletRequest;
@@ -536,10 +537,11 @@
sessionHandler.setRequiresInitCookie(producerInfo.getRequiresInitCookie());
}
- public void releaseSession(String sessionId) throws PortletInvokerException
+ public void releaseSessions(String[] sessionIds) throws PortletInvokerException
{
+ //todo: move to SessionHandler?
ReleaseSessions releaseSessions =
- WSRPTypeFactory.createReleaseSessions(producerInfo.getRegistrationInfo().getRegistrationContext(), new String[]{sessionId});
+ WSRPTypeFactory.createReleaseSessions(producerInfo.getRegistrationInfo().getRegistrationContext(), sessionIds);
try
{
@@ -553,10 +555,24 @@
catch (Exception e)
{
log.debug(e);
- throw new PortletInvokerException("Couldn't release session '" + sessionId + "'.", e);
+ throw new PortletInvokerException("Couldn't release session '" + sessionIds + "'.", e);
}
}
+ public void releaseSessions()
+ {
+ // todo: move to SessionHandler?
+ HttpSession session = ServletAccess.getRequest().getSession(false);
+ if (session != null)
+ {
+ ProducerSessionInformation info = getProducerSessionInformationFrom(session);
+ if (info != null)
+ {
+ info.releaseSessions();
+ }
+ }
+ }
+
// Support methods **************************************************************************************************
private String getUserContextKeyFor(UserContext userContext)
19 years, 1 month