Author: thomas.heute(a)jboss.com
Date: 2007-05-16 08:14:25 -0400 (Wed, 16 May 2007)
New Revision: 7259
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/core/src/resources/portal-core-sar/conf/config.xml
Log:
Let the user configure which namespace to use. Useful to directly login into the
dashboard.
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-05-16
12:12:21 UTC (rev 7258)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-05-16
12:14:25 UTC (rev 7259)
@@ -53,6 +53,7 @@
import org.jboss.portal.core.model.portal.PortalObjectPath;
import org.jboss.portal.core.model.portal.command.action.ImportPageToDashboardCommand;
import org.jboss.portal.core.model.portal.command.render.RenderPageCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewContextCommand;
import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.core.model.portal.command.view.ViewPortalCommand;
import org.jboss.portal.core.theme.PageRendition;
@@ -62,6 +63,7 @@
import org.jboss.portal.security.PortalSecurityException;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portal.server.config.ServerConfig;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.theme.ThemeConstants;
@@ -95,6 +97,12 @@
/** . */
private String tabsPath;
+
+ /** . */
+ private String loginNamespace;
+
+ /** . */
+ private ServerConfig config;
/** . */
private PortalAuthorizationManagerFactory portalAuthorizationManagerFactory;
@@ -185,7 +193,24 @@
if (user == null)
{
- request.setAttribute("org.jboss.portal.header.LOGIN_URL", new
PortalURLImpl(cc, controllerCtx, Boolean.TRUE, null));
+ PortalURL portalURL = null;
+
+ String configNamespace =
config.getProperty("core.login.namespace");
+ if (loginNamespace == null)
+ {
+ loginNamespace = configNamespace;
+ }
+
+ if (loginNamespace != null && !
loginNamespace.toLowerCase().trim().equals("default"))
+ {
+ ViewContextCommand vcc = new ViewContextCommand(new
PortalObjectId(loginNamespace, new PortalObjectPath()));
+ portalURL = new PortalURLImpl(vcc, controllerCtx, Boolean.TRUE, null);
+ }
+ else
+ {
+ portalURL = new PortalURLImpl(cc, controllerCtx, Boolean.TRUE, null);
+ }
+ request.setAttribute("org.jboss.portal.header.LOGIN_URL",
portalURL);
}
// Edit dashboard page || Copy to dashboard link
@@ -432,4 +457,24 @@
return value;
}
}
+
+ public String getLoginNamespace()
+ {
+ return loginNamespace;
+ }
+
+ public void setLoginNamespace(String loginNamespace)
+ {
+ this.loginNamespace = loginNamespace;
+ }
+
+ public ServerConfig getConfig()
+ {
+ return config;
+ }
+
+ public void setConfig(ServerConfig config)
+ {
+ this.config = config;
+ }
}
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-05-16
12:12:21 UTC (rev 7258)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-05-16
12:14:25 UTC (rev 7259)
@@ -202,7 +202,12 @@
<attribute name="TargetContextPath">/portal-core</attribute>
<attribute
name="HeaderPath">/WEB-INF/jsp/header/header.jsp</attribute>
<attribute
name="TabsPath">/WEB-INF/jsp/header/tabs.jsp</attribute>
+ <!-- Overrides the value of core.login.namespace in config.xml -->
+ <!-- attribute name="LoginNamespace">dashboard</attribute
-->
<depends
+ optional-attribute-name="Config"
+ proxy-type="attribute">portal:service=ServerConfig</depends>
+ <depends
optional-attribute-name="PortalAuthorizationManagerFactory"
proxy-type="attribute">portal:service=PortalAuthorizationManagerFactory</depends>
</mbean>
Modified: trunk/core/src/resources/portal-core-sar/conf/config.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/config.xml 2007-05-16 12:12:21 UTC (rev
7258)
+++ trunk/core/src/resources/portal-core-sar/conf/config.xml 2007-05-16 12:14:25 UTC (rev
7259)
@@ -32,4 +32,6 @@
<entry key="core.render.window_internal_error">show</entry>
<!-- When a window is not found : show or hide values are permitted -->
<entry key="core.render.window_not_found">show</entry>
+ <!-- Namespace to use when logging-in, use "dashboard" to directly log-in
the dashboard otherwise use "default" -->
+ <entry key="core.login.namespace">default</entry>
</properties>