Author: taylor Date: Tue Oct 4 05:13:51 2011 New Revision: 1178685 URL: http://svn.apache.org/viewvc?rev=1178685&view=rev Log: JS2-1264: When logging on to Jetui, users are shown the public space home page. Instead, users should be able to be directly placed in their home space.
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java?rev=1178685&r1=1178684&r2=1178685&view=diff ============================================================================== --- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java (original) +++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java Tue Oct 4 05:13:51 2011 @@ -24,6 +24,8 @@ import javax.servlet.http.HttpServletReq import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import org.apache.jetspeed.administration.PortalConfigurationConstants; +import org.apache.jetspeed.om.folder.Folder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.apache.jetspeed.Jetspeed; @@ -53,9 +55,9 @@ public class LoginServlet extends HttpSe { String destination = (String) session .getAttribute(LoginConstants.DESTINATION); - if (destination == null) - destination = request.getContextPath() + "/"; - + if (destination == null) { + destination = request.getContextPath() + "/"; + } response.sendRedirect(response.encodeURL(destination)); } @@ -67,6 +69,20 @@ public class LoginServlet extends HttpSe RequestContext context = null; try { + String jetuiMode = Jetspeed.getConfiguration().getString(PortalConfigurationConstants.JETUI_CUSTOMIZATION_METHOD, PortalConfigurationConstants.JETUI_CUSTOMIZATION_SERVER); + boolean redirectHomeSpace = Jetspeed.getConfiguration().getBoolean(PortalConfigurationConstants.JETUI_REDIRECT_HOME_SPACE, true); + if (redirectHomeSpace && jetuiMode.equals(PortalConfigurationConstants.JETUI_CUSTOMIZATION_AJAX)) { + String destination = (String)session.getAttribute(LoginConstants.DESTINATION); + if (destination == null) destination = "/"; + String username = (String)session.getAttribute(LoginConstants.USERNAME); + if (username != null) { + + if (!destination.endsWith("/")) + destination += "/"; + destination += (Folder.RESERVED_USER_FOLDER_NAME + "/" + username); + session.setAttribute(LoginConstants.DESTINATION, destination); + } + } contextComponent = (RequestContextComponent) Jetspeed.getComponentManager().getComponent(RequestContextComponent.class); context = contextComponent.create(request, response, getServletConfig()); engine.service(context); Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java?rev=1178685&r1=1178684&r2=1178685&view=diff ============================================================================== --- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java (original) +++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/administration/PortalConfigurationConstants.java Tue Oct 4 05:13:51 2011 @@ -92,7 +92,8 @@ public interface PortalConfigurationCons static final String JETUI_DRAG_YAHOO = "yahoo"; static final String JETUI_STYLE_PORTLET = "jetui.style.portlet"; static final String JETUI_STYLE_LAYOUT = "jetui.style.layout"; - static final String JETUI_STYLE_DRAG_HANDLE = "jetui.style.drag.handle"; + static final String JETUI_STYLE_DRAG_HANDLE = "jetui.style.drag.handle"; + static final String JETUI_REDIRECT_HOME_SPACE = "jetui.redirect.home.space"; /** Portlet Modes, Window States: return string arrays **/ static final String SUPPORTED_WINDOW_STATES = "supported.windowstate"; Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties?rev=1178685&r1=1178684&r2=1178685&view=diff ============================================================================== --- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties (original) +++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/conf/jetspeed/jetspeed.properties Tue Oct 4 05:13:51 2011 @@ -409,4 +409,6 @@ jetui.style.portlet = .portal-layout-cel jetui.style.layout = .portal-layout-column # title or handle of a portlet window to drag from jetui.style.drag.handle = .PTitle +# redirect to home space on login +jetui.redirect.home.space=true --------------------------------------------------------------------- To unsubscribe, e-mail: jetspeed-dev-unsubscr...@portals.apache.org For additional commands, e-mail: jetspeed-dev-h...@portals.apache.org