Author: thomas.heute(a)jboss.com
Date: 2007-12-04 12:32:48 -0500 (Tue, 04 Dec 2007)
New Revision: 9286
Added:
tags/JBoss_Portal_2_6_3/core/src/main/org/jboss/portal/core/aspects/server/PortalContextPathInterceptor.java
Modified:
tags/JBoss_Portal_2_6_3/core/src/bin/portal-core-war/layouts/common/modal.jsp
tags/JBoss_Portal_2_6_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
Log:
- Adding a server interceptor to stick the portal context path into the request
- Fix the modal login window so that it works with other portal context path
Modified: tags/JBoss_Portal_2_6_3/core/src/bin/portal-core-war/layouts/common/modal.jsp
===================================================================
---
tags/JBoss_Portal_2_6_3/core/src/bin/portal-core-war/layouts/common/modal.jsp 2007-12-04
17:30:19 UTC (rev 9285)
+++
tags/JBoss_Portal_2_6_3/core/src/bin/portal-core-war/layouts/common/modal.jsp 2007-12-04
17:32:48 UTC (rev 9286)
@@ -1,3 +1,5 @@
+<%@page import="org.jboss.portal.server.ServerURL"%>
+<%@page import="org.jboss.portal.server.AbstractServerURL"%>
<script src="<%=request.getContextPath()%>/js/modal.js"
type="text/javascript"></script>
<link rel="stylesheet"
href="<%=request.getContextPath()%>/css/modal.css"
type="text/css" />
<div id="login-modal" style="display:none">
@@ -3,5 +5,5 @@
<div id="login-modal-msg"
style="display:none;width:257px;height:157px">
<% String loginHeight = "100%"; %>
- <iframe src="/portal/auth/?loginheight=0" frameborder="0"
width="257" height="157" scrolling="no"
marginheight="0" marginwidth="0" name="login-content"
class="login-content"></iframe>
+ <iframe
src="<%=request.getAttribute("org.jboss.portal.PORTAL_CONTEXT_PATH")%>/auth/?loginheight=0"
frameborder="0" width="257" height="157"
scrolling="no" marginheight="0" marginwidth="0"
name="login-content" class="login-content"></iframe>
</div>
</div>
\ No newline at end of file
Copied:
tags/JBoss_Portal_2_6_3/core/src/main/org/jboss/portal/core/aspects/server/PortalContextPathInterceptor.java
(from rev 9285,
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/aspects/server/PortalContextPathInterceptor.java)
===================================================================
---
tags/JBoss_Portal_2_6_3/core/src/main/org/jboss/portal/core/aspects/server/PortalContextPathInterceptor.java
(rev 0)
+++
tags/JBoss_Portal_2_6_3/core/src/main/org/jboss/portal/core/aspects/server/PortalContextPathInterceptor.java 2007-12-04
17:32:48 UTC (rev 9286)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.aspects.server;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.server.ServerInterceptor;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.ServerInvocationContext;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class PortalContextPathInterceptor extends ServerInterceptor
+{
+
+ @Override
+ protected void invoke(ServerInvocation invocation) throws Exception,
InvocationException
+ {
+ ServerInvocationContext serverContext = invocation.getServerContext();
+ String url = serverContext.getPortalContextPath();
+
+ invocation.getServerContext().setAttribute(ServerInvocation.REQUEST_SCOPE,
"org.jboss.portal.PORTAL_CONTEXT_PATH", url);
+
+ invocation.invokeNext();
+
+ }
+
+}
+
Modified:
tags/JBoss_Portal_2_6_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
---
tags/JBoss_Portal_2_6_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-12-04
17:30:19 UTC (rev 9285)
+++
tags/JBoss_Portal_2_6_3/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-12-04
17:32:48 UTC (rev 9286)
@@ -141,6 +141,13 @@
<xmbean/>
</mbean>
<mbean
+ code="org.jboss.portal.core.aspects.server.PortalContextPathInterceptor"
+ name="portal:service=Interceptor,type=Server,name=PortalContextPath"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
code="org.jboss.portal.server.aspects.server.ContentTypeInterceptor"
name="portal:service=Interceptor,type=Server,name=ContentType"
xmbean-dd=""
@@ -160,6 +167,7 @@
<depends-list-element>portal:service=Interceptor,type=Server,name=SessionInvalidator</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Server,name=User</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Server,name=Locale</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Server,name=PortalContextPath</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Server,name=ContentType</depends-list-element>
</depends-list>
</mbean>