rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlu...@apache.org
Subject svn commit: r1215234 - in /incubator/rave/trunk: rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/ rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/util/ rave-components/rave-web/src/main/java/org...
Date Fri, 16 Dec 2011 17:59:00 GMT
Author: carlucci
Date: Fri Dec 16 17:58:59 2011
New Revision: 1215234

URL: http://svn.apache.org/viewvc?rev=1215234&view=rev
Log:
RAVE-97: Code in support of dynamic page layout templates. Still TODO: un-hardcode the layout picklist items from the dialog box

Added:
    incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ViewNamesTest.java
      - copied, changed from r1214390, incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_1.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2wn.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3_newuser.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn_1_bottom.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_4.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp   (contents, props changed)
      - copied, changed from r1214390, incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region.tag
      - copied, changed from r1214390, incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/header.tag
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/simple_regions.tag
Removed:
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp
Modified:
    incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/PageController.java
    incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/util/ControllerUtils.java
    incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java
    incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java
    incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java
    incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties
    incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties
    incubator/rave/trunk/rave-portal-resources/src/main/resources/portal.properties
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/css/default.css
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js
    incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js
    incubator/rave/trunk/rave-portal/src/test/resources/portal.properties

Modified: incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/PageController.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/PageController.java?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/PageController.java (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/PageController.java Fri Dec 16 17:58:59 2011
@@ -58,9 +58,10 @@ public class PageController {
     @RequestMapping(value = {"/page/view", "/index.html"}, method = RequestMethod.GET)
     public String viewDefault(Model model, HttpServletRequest request) {
         List<Page> pages = getAllPagesForAuthenticatedUser();
-        model.addAttribute(ModelKeys.PAGE, pageService.getDefaultPageFromList(pages));
+        Page page = pageService.getDefaultPageFromList(pages);
+        model.addAttribute(ModelKeys.PAGE, page);
         model.addAttribute(ModelKeys.PAGES, pages);
-        return getDeviceAppropriateView(request);
+        return ControllerUtils.getDeviceAppropriateView(request, ViewNames.getPageView(page.getPageLayout().getCode()), ViewNames.MOBILE_HOME);
     }          
     
     @RequestMapping(value = "/page/view/{pageId}", method = RequestMethod.GET)
@@ -73,7 +74,7 @@ public class PageController {
                
         model.addAttribute(ModelKeys.PAGE, page);
         model.addAttribute(ModelKeys.PAGES, pages);
-        return getDeviceAppropriateView(request);
+        return ControllerUtils.getDeviceAppropriateView(request, ViewNames.getPageView(page.getPageLayout().getCode()), ViewNames.MOBILE_HOME);
     }
     
     private List<Page> getAllPagesForAuthenticatedUser() {
@@ -89,10 +90,4 @@ public class PageController {
         }
         return pages;
     }
-    
-    private String getDeviceAppropriateView(HttpServletRequest request) {
-        // return the appropriate View name based on the request.  It
-        // checks to see if the user is on a mobile device or not
-        return ControllerUtils.isMobileDevice(request) ? ViewNames.MOBILE_HOME : ViewNames.HOME;
-    }
 }
\ No newline at end of file

Modified: incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/util/ControllerUtils.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/util/ControllerUtils.java?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/util/ControllerUtils.java (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/util/ControllerUtils.java Fri Dec 16 17:58:59 2011
@@ -20,9 +20,14 @@
 package org.apache.rave.portal.web.controller.util;
 
 import javax.servlet.http.HttpServletRequest;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.mobile.device.DeviceUtils;
 
 public class ControllerUtils {
+    private static final Logger log = LoggerFactory.getLogger(ControllerUtils.class);
+
     /**
      * Utility function to determine if this HttpServletRequest 
      * is coming from a mobile client 
@@ -32,5 +37,20 @@ public class ControllerUtils {
      */
     public static boolean isMobileDevice(HttpServletRequest request) {
         return DeviceUtils.getCurrentDevice(request).isMobile();
-    }    
+    }
+
+    public static String getDeviceAppropriateView(HttpServletRequest request, String defaultView, String mobileView) {
+        // return the appropriate View name based on the request.  It
+        // checks to see if the user is on a mobile device or not
+        String viewName = null;
+        if (ControllerUtils.isMobileDevice(request)) {
+            log.debug("mobile device detected - viewing default mobile page template");
+            viewName = mobileView;
+        } else {
+            log.debug("non-mobile device detected - viewing regular page layout");
+            viewName = defaultView;
+        }
+        log.debug("viewName: " + viewName);
+        return viewName;
+    }
 }
\ No newline at end of file

Modified: incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/util/ViewNames.java Fri Dec 16 17:58:59 2011
@@ -28,7 +28,7 @@ public class ViewNames {
     private static final String USER_PREFIX = "templates.user.";
     private static final String ADMIN_PREFIX = "templates.admin.";
 
-    public static final String HOME = USER_PREFIX + "home";
+    public static final String PAGE = USER_PREFIX + "page";
     public static final String MOBILE_HOME = USER_PREFIX + "mobile_home";
     public static final String STORE = USER_PREFIX + "store";
     public static final String WIDGET = USER_PREFIX + "widget";
@@ -45,4 +45,8 @@ public class ViewNames {
     public static final String ADMIN_WIDGETDETAIL = ADMIN_PREFIX + "widgetdetail";
 
     public static final String REDIRECT = "redirect:/";
+
+    public static String getPageView(String layoutName) {
+        return new StringBuilder(PAGE).append(".").append(layoutName).toString();
+    }
 }
\ No newline at end of file

Modified: incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/PageControllerTest.java Fri Dec 16 17:58:59 2011
@@ -65,17 +65,19 @@ public class PageControllerTest {
         pageController = new PageController(pageService, userService);
         model = new ExtendedModelMap();
         request = new MockHttpServletRequest();
-                
+
+        validPageLayout = new PageLayout();
+        validPageLayout.setEntityId(33L);
+        validPageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
+
         defaultPage = new Page(DEFAULT_PAGE_ID);
+        defaultPage.setPageLayout(validPageLayout);
         otherPage = new Page(OTHER_PAGE_ID);
+        otherPage.setPageLayout(validPageLayout);
         
         allPages = new ArrayList<Page>();
         allPages.add(defaultPage);   
-        allPages.add(otherPage);            
-        
-        validPageLayout = new PageLayout();
-        validPageLayout.setEntityId(33L);
-        validPageLayout.setCode(VALID_PAGE_LAYOUT_CODE);
+        allPages.add(otherPage);
         
         validUser = new User(USER_ID);
         validUser.setDefaultPageLayout(validPageLayout);
@@ -92,7 +94,7 @@ public class PageControllerTest {
 
         String results = pageController.view(OTHER_PAGE_ID, model, request);
         
-        assertThat(results, equalTo(ViewNames.HOME));
+        assertThat(results, equalTo(ViewNames.getPageView(VALID_PAGE_LAYOUT_CODE)));
         assertThat((Page) model.asMap().get(ModelKeys.PAGE), sameInstance(otherPage));
         assertThat((List<Page>) model.asMap().get(ModelKeys.PAGES), sameInstance(allPages));
         
@@ -131,7 +133,7 @@ public class PageControllerTest {
         
         String results = pageController.view(OTHER_PAGE_ID, model, request);
         
-        assertThat(results, equalTo(ViewNames.HOME));
+        assertThat(results, equalTo(ViewNames.getPageView(VALID_PAGE_LAYOUT_CODE)));
         assertThat((Page) model.asMap().get(ModelKeys.PAGE), sameInstance(defaultPage));
         assertThat((List<Page>) model.asMap().get(ModelKeys.PAGES), sameInstance(pages));
         
@@ -149,7 +151,7 @@ public class PageControllerTest {
 
         String results = pageController.viewDefault(model, request);
         
-        assertThat(results, equalTo(ViewNames.HOME));
+        assertThat(results, equalTo(ViewNames.getPageView(VALID_PAGE_LAYOUT_CODE)));
         assertThat((Page) model.asMap().get(ModelKeys.PAGE), sameInstance(defaultPage));
         assertThat((List<Page>) model.asMap().get(ModelKeys.PAGES), sameInstance(allPages));
         
@@ -170,7 +172,7 @@ public class PageControllerTest {
 
         String results = pageController.viewDefault(model, request);
         
-        assertThat(results, equalTo(ViewNames.HOME));
+        assertThat(results, equalTo(ViewNames.getPageView(VALID_PAGE_LAYOUT_CODE)));
         assertThat((Page) model.asMap().get(ModelKeys.PAGE), sameInstance(defaultPage));
         assertThat((List<Page>) model.asMap().get(ModelKeys.PAGES), sameInstance(pages));
         

Modified: incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java Fri Dec 16 17:58:59 2011
@@ -18,23 +18,24 @@
  */
 package org.apache.rave.portal.web.controller.util;
 
-import org.springframework.mock.web.MockHttpServletRequest;
-import javax.servlet.http.HttpServletRequest;
-import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
-import static org.junit.Assert.*;
-import static org.easymock.EasyMock.*;
-import static org.hamcrest.CoreMatchers.*;
+import org.springframework.mobile.device.DeviceResolver;
+import org.springframework.mobile.device.DeviceUtils;
+import org.springframework.mobile.device.LiteDeviceResolver;
+import org.springframework.mock.web.MockHttpServletRequest;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
 
 public class ControllerUtilsTest {
-    private MockHttpServletRequest request;    
+    private MockHttpServletRequest request;
+    private DeviceResolver deviceResolver;
     
     @Before
     public void setUp() {
         request = new MockHttpServletRequest();
+        deviceResolver = new LiteDeviceResolver();
     }
     
     @Test
@@ -48,4 +49,24 @@ public class ControllerUtilsTest {
         MockHttpUtil.setupRequestAsNonMobileUserAgent(request);        
         assertThat(ControllerUtils.isMobileDevice(request), is(false));       
     }
+
+    @Test
+    public void testGetDeviceAppropriateView_defaultView() {
+        String defaultView = "defaultView";
+        String mobileView = "mobileView";
+
+        request.addHeader("User-Agent", "MSIE");
+        request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, deviceResolver.resolveDevice(request));
+        assertThat(ControllerUtils.getDeviceAppropriateView(request, defaultView, mobileView), is(defaultView));
+    }
+
+    @Test
+    public void testGetDeviceAppropriateView_mobileView() {
+        String defaultView = "defaultView";
+        String mobileView = "mobileView";
+
+        request.addHeader("User-Agent", "Blackberry");
+        request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, deviceResolver.resolveDevice(request));
+        assertThat(ControllerUtils.getDeviceAppropriateView(request, defaultView, mobileView), is(mobileView));
+    }
 }
\ No newline at end of file

Copied: incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ViewNamesTest.java (from r1214390, incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ViewNamesTest.java?p2=incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ViewNamesTest.java&p1=incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java&r1=1214390&r2=1215234&rev=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ControllerUtilsTest.java (original)
+++ incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/util/ViewNamesTest.java Fri Dec 16 17:58:59 2011
@@ -18,34 +18,17 @@
  */
 package org.apache.rave.portal.web.controller.util;
 
-import org.springframework.mock.web.MockHttpServletRequest;
-import javax.servlet.http.HttpServletRequest;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
+import org.apache.rave.portal.web.util.ViewNames;
 import org.junit.Test;
-import static org.junit.Assert.*;
-import static org.easymock.EasyMock.*;
-import static org.hamcrest.CoreMatchers.*;
 
-public class ControllerUtilsTest {
-    private MockHttpServletRequest request;    
-    
-    @Before
-    public void setUp() {
-        request = new MockHttpServletRequest();
-    }
-    
-    @Test
-    public void testIsMobileDevice_mobileClient() {
-        MockHttpUtil.setupRequestAsMobileUserAgent(request);        
-        assertThat(ControllerUtils.isMobileDevice(request), is(true));       
-    }
-    
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ViewNamesTest {
+    private final String LAYOUT_NAME = "columns_1";
+
     @Test
-    public void testIsMobileDevice_nonMobileClient() {
-        MockHttpUtil.setupRequestAsNonMobileUserAgent(request);        
-        assertThat(ControllerUtils.isMobileDevice(request), is(false));       
+    public void getPageView() {
+        assertThat(ViewNames.getPageView(LAYOUT_NAME), is(ViewNames.PAGE + "." + LAYOUT_NAME));
     }
 }
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/resources/messages.properties Fri Dec 16 17:58:59 2011
@@ -67,6 +67,7 @@ page.general.addpage.layout.columns_2=Tw
 page.general.addpage.layout.columns_2wn=Two Columns (wide/narrow)
 page.general.addpage.layout.columns_3=Three Columns
 page.general.addpage.layout.columns_3nwn=Three Columns (narrow/wide/narrow)
+page.general.addpage.layout.columns_3_newuser=Three Columns (new user)
 page.general.addpage.layout.columns_4=Four Columns
 page.general.addpage.layout.columns_3nwn_1_bottom=Four Columns (narrow/wide/narrow/bottom)
 page.general.addpage.selectlayout=Select Page Layout:
@@ -77,6 +78,9 @@ page.home.welcome=Hello {0}, welcome to 
 
 page.menu.title=Page Actions Menu
 
+page.layout.newuser.introtext=This is the default page layout for new users.  We suggest you play with some of the Rave features:<ul><li>Rename this page and change the widget layout</li><li>Add a new page</li><li>Add widgets from the Widget Store</li><li>Edit the preferences for a widget</li><li>Move widgets around on a page</li><li>Collapse and restore a widget</li><li>much more...</li></ul>
+page.layout.newuser.subtitle=We have provided a few sample widgets for you to try out.  Click on the Widget Store link above to add more widgets!
+
 page.login.title=Login
 page.login.createaccount=New User
 page.login.createaccount.label=Register:

Modified: incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/resources/messages_nl.properties Fri Dec 16 17:58:59 2011
@@ -67,6 +67,7 @@ page.general.addpage.layout.columns_2=Tw
 page.general.addpage.layout.columns_2wn=Twee kolommen (breed/smal)
 page.general.addpage.layout.columns_3=Drie kolommen
 page.general.addpage.layout.columns_3nwn=Drie kolommen (smal/breed/smal)
+page.general.addpage.layout.columns_3_newuser=Drie kolommen (nieuwe gebruiker)
 page.general.addpage.layout.columns_4=Vier kolommen
 page.general.addpage.layout.columns_3nwn_1_bottom=Vier kolommen (smal/breed/smal/beneden)
 page.general.addpage.selectlayout=Selecteer de Pagina indeling:
@@ -77,6 +78,9 @@ page.home.welcome=Hallo {0}, welkom bij 
 
 page.menu.title=Pagina Acties Menu
 
+page.layout.newuser.introtext=Dit is de standaard pagina-indeling voor nieuwe gebruikers. Wij raden u aan spelen met een aantal van de Rave kenmerken:<ul><li>Hernoem deze pagina en wijzig de widget layout</li><li>Voeg een nieuwe pagina</li><li>Voeg widgets van de Widget Store</li><li>de voorkeuren bewerken voor een widget</li><li>Ga widgets rond op een pagina</li><li>samenvouwen en herstellen van een widget</li><li>nog veel meer ...</li></ul>
+page.layout.newuser.subtitle=We hebben een paar voorbeeld widgets voor je uit te proberen. Klik op de Widget Store link hierboven om meer widgets toe te voegen!
+
 page.login.title=Inloggen
 page.login.createaccount=Nieuwe gebruiker
 page.login.createaccount.label=Registreer:

Modified: incubator/rave/trunk/rave-portal-resources/src/main/resources/portal.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/resources/portal.properties?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/resources/portal.properties (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/resources/portal.properties Fri Dec 16 17:58:59 2011
@@ -19,7 +19,7 @@
 
 #
 # These properties are used to construct the opensocial engine's URL. See 
-# for example home.jsp. Changing them does not change the actual path configuration
+# for example page.jsp. Changing them does not change the actual path configuration
 # of shindig.
 #
 portal.opensocial_engine.protocol=http

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/db/initial_data.sql Fri Dec 16 17:58:59 2011
@@ -90,6 +90,11 @@ set @fourwn_col_id = (SELECT seq_count F
 insert into page_layout (entity_id, code,  number_of_regions)
 values (@fourwn_col_id, 'columns_3nwn_1_bottom', 4);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @page_layout_seq;
+
+set @newuser_col_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @page_layout_seq);
+insert into page_layout (entity_id, code,  number_of_regions)
+values (@newuser_col_id, 'columns_3_newuser', 3);
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @page_layout_seq;
 --- end page layout data ----
 
   -- ***********************************************************************************
@@ -292,7 +297,7 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
 --- Layout for user_id_1 ---
 set @page_1_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @page_seq);
 INSERT INTO page (entity_id, name, owner_id, render_sequence, page_layout_id)
-values (@page_1_id, 'Main', @user_id_1, 1, @two_col_id);
+values (@page_1_id, 'Main', @user_id_1, 1, @newuser_col_id);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @page_seq;
 
 
@@ -306,6 +311,10 @@ INSERT INTO region(entity_id, page_id, r
 values (@page_1_region_2, @page_1_id, 2);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_seq;
 
+set @page_1_region_3 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_seq);
+INSERT INTO region(entity_id, page_id, render_order)
+values (@page_1_region_3, @page_1_id, 3);
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_seq;
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
@@ -314,17 +323,17 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @translate_widget_id, @page_1_region_1, 1, FALSE);
+values (@next_region_widget, @translate_widget_id, @page_1_region_2, 0, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @nyt_widget_id, @page_1_region_2, 0, FALSE);
+values (@next_region_widget, @nyt_widget_id, @page_1_region_3, 0, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @tabnews_widget_id, @page_1_region_2, 1, FALSE);
+values (@next_region_widget, @tabnews_widget_id, @page_1_region_3, 1, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 
 
@@ -369,7 +378,7 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
 --- Layout for user_id_2 ---
 set @page_1_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @page_seq);
 INSERT INTO page (entity_id, name, owner_id, render_sequence, page_layout_id)
-values (@page_1_id, 'Main', @user_id_2, 1, @two_col_id);
+values (@page_1_id, 'Main', @user_id_2, 1, @newuser_col_id);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @page_seq;
 
 set @page_1_region_1 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_seq);
@@ -382,6 +391,11 @@ INSERT INTO region(entity_id, page_id, r
 values (@page_1_region_2, @page_1_id, 2);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_seq;
 
+set @page_1_region_3 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_seq);
+INSERT INTO region(entity_id, page_id, render_order)
+values (@page_1_region_3, @page_1_id, 3);
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_seq;
+
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
 values (@next_region_widget, @translate_widget_id, @page_1_region_1, 0, FALSE);
@@ -389,24 +403,24 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @wikipedia_widget_id, @page_1_region_1, 1, FALSE);
+values (@next_region_widget, @wikipedia_widget_id, @page_1_region_2, 0, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @nyt_widget_id, @page_1_region_2, 0, FALSE);
+values (@next_region_widget, @nyt_widget_id, @page_1_region_3, 0, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @tabnews_widget_id, @page_1_region_2, 1, FALSE);
+values (@next_region_widget, @tabnews_widget_id, @page_1_region_3, 1, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 --- End john.doe user_id_2 layout ---
 
 --- Layout for user_id_3 ---
 set @page_1_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @page_seq);
 INSERT INTO page (entity_id, name, owner_id, render_sequence, page_layout_id)
-values (@page_1_id, 'Main', @user_id_3, 1, @two_col_id);
+values (@page_1_id, 'Main', @user_id_3, 1, @newuser_col_id);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @page_seq;
 
 set @page_1_region_1 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_seq);
@@ -419,6 +433,11 @@ INSERT INTO region(entity_id, page_id, r
 values (@page_1_region_2, @page_1_id, 2);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_seq;
 
+set @page_1_region_3 = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_seq);
+INSERT INTO region(entity_id, page_id, render_order)
+values (@page_1_region_3, @page_1_id, 3);
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_seq;
+
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
 values (@next_region_widget, @wikipedia_widget_id, @page_1_region_1, 0, FALSE);
@@ -426,17 +445,17 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @translate_widget_id, @page_1_region_1, 1, FALSE);
+values (@next_region_widget, @translate_widget_id, @page_1_region_2, 0, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @hamster_widget_id, @page_1_region_2, 0, FALSE);
+values (@next_region_widget, @hamster_widget_id, @page_1_region_3, 0, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 
 set @next_region_widget = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @region_widget_seq);
 INSERT INTO region_widget(entity_id, widget_id, region_id, render_order, collapsed)
-values (@next_region_widget, @tabnews_widget_id, @page_1_region_2, 1, FALSE);
+values (@next_region_widget, @tabnews_widget_id, @page_1_region_3, 1, FALSE);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @region_widget_seq;
 --- End jane.doe user_id_3 layout ---
 

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/dispatcher-servlet.xml Fri Dec 16 17:58:59 2011
@@ -38,8 +38,8 @@
         <bean class="org.apache.rave.portal.web.interceptors.CommonModelHandlerInterceptor"/>
     </mvc:interceptors>
 
-    <!-- Forwards requests to the "/" resource to the "home" view -->
-    <mvc:view-controller path="/" view-name="home"/>
+    <!-- Forwards requests to the "/" resource to the "page" view -->
+    <mvc:view-controller path="/" view-name="page"/>
 
     <!-- Resolves view names to protected .jsp resources within the /WEB-INF/views directory -->
     <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_1.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_1.jsp?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_1.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_1.jsp Fri Dec 16 17:58:59 2011
@@ -0,0 +1,2 @@
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<rave:simple_regions page="${page}" />
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2.jsp?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2.jsp Fri Dec 16 17:58:59 2011
@@ -0,0 +1,2 @@
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<rave:simple_regions page="${page}" />
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2wn.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2wn.jsp?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2wn.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_2wn.jsp Fri Dec 16 17:58:59 2011
@@ -0,0 +1,2 @@
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<rave:simple_regions page="${page}" />
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3.jsp?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3.jsp Fri Dec 16 17:58:59 2011
@@ -0,0 +1,2 @@
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<rave:simple_regions page="${page}" />
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3_newuser.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3_newuser.jsp?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3_newuser.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3_newuser.jsp Fri Dec 16 17:58:59 2011
@@ -0,0 +1,13 @@
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<fmt:setBundle basename="messages"/>
+<%--@elvariable id="page" type="org.apache.rave.portal.model.Page"--%>
+<div class="columns_3_newuser_static">
+    <fmt:message key="page.layout.newuser.introtext"/>
+</div>
+
+<div class="columns_3_newuser_widgets">
+    <div class="columns_3_newuser_subtitle"><fmt:message key="page.layout.newuser.subtitle"/></div>
+    <rave:region region="${page.regions[0]}" regionIdx="1" />
+    <rave:region region="${page.regions[1]}" regionIdx="2" />
+    <rave:region region="${page.regions[2]}" regionIdx="3" />
+</div>
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn.jsp?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn.jsp Fri Dec 16 17:58:59 2011
@@ -0,0 +1,2 @@
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<rave:simple_regions page="${page}" />
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn_1_bottom.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn_1_bottom.jsp?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn_1_bottom.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_3nwn_1_bottom.jsp Fri Dec 16 17:58:59 2011
@@ -0,0 +1,2 @@
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<rave:simple_regions page="${page}" />
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_4.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_4.jsp?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_4.jsp (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/layouts/columns_4.jsp Fri Dec 16 17:58:59 2011
@@ -0,0 +1,2 @@
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<rave:simple_regions page="${page}" />
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/templates/base_layout.jsp Fri Dec 16 17:58:59 2011
@@ -22,14 +22,26 @@ under the License.
 <fmt:setBundle basename="messages"/>
 <%-- Expose any attributes defined in the tiles-defs.xml to the request scope for use in other tiles --%>
 <tiles:importAttribute scope="request"/>
+<%--@elvariable id="page" type="org.apache.rave.portal.model.Page"--%>
 <!DOCTYPE html>
 <html>
 <head>
     <meta charset="ISO-8859-1"/>
     <meta name="viewport" content="width=device-width" />
-    <title><fmt:message key="${pageTitleKey}"/>
-    <c:if test="${not empty portalSettings and not empty portalSettings['titleSuffix']}">
-        <c:out value="${portalSettings['titleSuffix'].value}"/></c:if></title>
+    <title>
+        <%-- determine if this is a user page, and if so, display the page name in the HTML title --%>
+        <c:choose>
+            <c:when test="${not empty page}">
+                <c:out value="${page.name}" escapeXml="true" />
+            </c:when>
+            <c:otherwise>
+                <fmt:message key="${pageTitleKey}"/>
+            </c:otherwise>
+        </c:choose>
+        <c:if test="${not empty portalSettings and not empty portalSettings['titleSuffix']}">
+            <c:out value="${portalSettings['titleSuffix'].value}"/>
+        </c:if>
+    </title>
     <link rel="stylesheet" href="//ajax.aspnetcdn.com/ajax/jquery.ui/1.8.13/themes/base/jquery-ui.css"/>
     <link rel="stylesheet" href="<c:url value="/css/default.css" />"/>
     <rave:custom_css/>

Copied: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp (from r1214390, incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp?p2=incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp&p1=incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp&r1=1214390&r2=1215234&rev=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/home.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp Fri Dec 16 17:58:59 2011
@@ -98,62 +98,9 @@
         </div>
     </div>
     <div class="regions">
-    <c:forEach var="region" items="${page.regions}" varStatus="status">
-    <%--@elvariable id="region" type="org.apache.rave.portal.model.Region"--%>
-        <div class="region <c:out value="${page.pageLayout.code}"/>_${status.count}" id="region-${region.entityId}-id">
-            <c:forEach var="regionWidget" items="${region.regionWidgets}">
-               <div class="widget-wrapper" id="widget-${regionWidget.entityId}-wrapper">
-                    <div class="widget-title-bar">
-                        <span id="widget-${regionWidget.entityId}-collapse" class="widget-toolbar-toggle-collapse" title="<fmt:message key="widget.chrome.toggle"/>"></span>
-                        <div id="widget-${regionWidget.entityId}-title" class="widget-title">
-                        <c:choose>
-                            <c:when test="${not empty regionWidget.widget.titleUrl}">
-                                <a href="<c:out value="${regionWidget.widget.titleUrl}"/>" rel="external"><c:out value="${regionWidget.widget.title}"/></a>
-                            </c:when>
-                            <c:otherwise>
-                                <c:out value="${regionWidget.widget.title}"/>
-                            </c:otherwise>
-                        </c:choose>
-                        </div>
-                        <%-- These are toolbar buttons --%>
-                        <div id="widget-${regionWidget.entityId}-toolbar" style="float:right;">
-                            <div id="widget-${regionWidget.entityId}-widget-menu-wrapper" class="widget-menu-wrapper">
-                                <span id="widget-${regionWidget.entityId}-menu-button" class="widget-menu-button ui-icon ui-icon-gear" title="<fmt:message key="widget.menu.title"/>"></span>
-                                <div id="widget-${regionWidget.entityId}-menu" class="widget-menu">
-                                    <%--
-                                        By default the edit prefs item is disabled.
-                                        Each provider's widget initialization will be responsible for enabling this item
-                                        if the widget has preferences to be edited
-                                    --%>
-                                    <div id="widget-${regionWidget.entityId}-menu-editprefs-item" class="widget-menu-item widget-menu-item-disabled">
-                                        <fmt:message key="widget.menu.editprefs"/>
-                                    </div>
-                                    <div id="widget-${regionWidget.entityId}-menu-maximize-item" class="widget-menu-item">
-                                        <fmt:message key="widget.menu.maximize"/>
-                                    </div>
-                                    <div id="widget-${regionWidget.entityId}-menu-move-item" class="widget-menu-item<c:if test='${hasOnlyOnePage}'> widget-menu-item-disabled</c:if>">
-                                        <fmt:message key="widget.menu.movetopage"/>
-                                    </div>
-                                    <div id="widget-${regionWidget.entityId}-menu-delete-item" class="widget-menu-item">
-                                        <fmt:message key="widget.menu.delete"/>
-                                    </div>
-                                </div>
-                            </div>
-                            <%-- the minimize widget button, which is hidden by default and only displays in maximized view --%>
-                            <button id="widget-${regionWidget.entityId}-min"
-                                    class="widget-toolbar-btn widget-toolbar-btn-min"></button>
-                        </div>
-                    </div>
-                    <div class="widget-prefs" id="widget-${regionWidget.entityId}-prefs-content"></div>
-                    <div class="widget" id="widget-${regionWidget.entityId}-body">
-                            <portal:render-widget regionWidget="${regionWidget}" />
-                    </div>
-                </div>
-            </c:forEach>
-        </div>
-    </c:forEach>
+        <%-- insert the region layout template --%>
+        <tiles:insertTemplate template="${layout}"/>
     </div>
-
     <div class="clear-float">&nbsp;</div>
 </div>
 <fmt:message key="page.general.addnewpage" var="addNewPageTitle"/>
@@ -171,6 +118,7 @@
                 <option value="columns_2wn" id="columns_2wn_id"><fmt:message key="page.general.addpage.layout.columns_2wn"/></option>
                 <option value="columns_3" id="columns_3_id"><fmt:message key="page.general.addpage.layout.columns_3"/></option>
                 <option value="columns_3nwn" id="columns_3nwn_id"><fmt:message key="page.general.addpage.layout.columns_3nwn"/></option>
+                <option value="columns_3_newuser" id="columns_4_newuser_id"><fmt:message key="page.general.addpage.layout.columns_3_newuser"/></option>
                 <option value="columns_4" id="columns_4_id"><fmt:message key="page.general.addpage.layout.columns_4"/></option>
                 <option value="columns_3nwn_1_bottom" id="columns_3nwn_1_bottom"><fmt:message key="page.general.addpage.layout.columns_3nwn_1_bottom"/></option>
             </select>

Propchange: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/page.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region.tag (from r1214390, incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/header.tag)
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region.tag?p2=incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region.tag&p1=incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/header.tag&r1=1214390&r2=1215234&rev=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/header.tag (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region.tag Fri Dec 16 17:58:59 2011
@@ -16,22 +16,22 @@
   specific language governing permissions and limitations
   under the License.
   --%>
+
+<%--
+Template for rendering a Region on a page
+--%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
-<%@ attribute name="pageTitle" required="false" description="The title of the page" %>
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<%@ attribute name="region" type="org.apache.rave.portal.model.Region" required="true" description="The region object" %>
+<%@ attribute name="regionIdx" required="true" description="The regionIdx" %>
+
 <fmt:setBundle basename="messages"/>
 
-<header>
-    <nav class="topnav">
-        <%--@elvariable id="topnav" type="org.apache.rave.portal.web.model.NavigationMenu"--%>
-        <c:if test="${not empty topnav}">
-            <ul class="horizontal-list">
-                <c:forEach items="${topnav.navigationItems}" var="navItem">
-                    <li><a href="<spring:url value="${navItem.url}"/>"><fmt:message key="${navItem.name}"/></a></li>
-                </c:forEach>
-            </ul>
-        </c:if>
-    </nav>
-    <h1><c:out value="${pageTitle}"/></h1>
-</header>
+<%--@elvariable id="region" type="org.apache.rave.portal.model.Region"--%>
+<div class="region <c:out value="${region.page.pageLayout.code}"/>_${regionIdx}" id="region-${region.entityId}-id">
+    <c:forEach var="regionWidget" items="${region.regionWidgets}">
+        <rave:region_widget regionWidget="${regionWidget}"/>
+    </c:forEach>
+</div>
\ No newline at end of file

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag Fri Dec 16 17:58:59 2011
@@ -0,0 +1,77 @@
+<%--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  --%>
+
+<%--
+Template for rendering a RegionWidget including wrapper chrome, toolbars, menus, etc as well as the widget content
+--%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib prefix="portal" uri="http://www.apache.org/rave/tags" %>
+<%@ attribute name="regionWidget" type="org.apache.rave.portal.model.RegionWidget" required="true" description="The regionWidget object" %>
+
+<fmt:setBundle basename="messages"/>
+<%--@elvariable id="regionWidget" type="org.apache.rave.portal.model.RegionWidget"--%>
+<div class="widget-wrapper" id="widget-${regionWidget.entityId}-wrapper">
+    <div class="widget-title-bar">
+        <span id="widget-${regionWidget.entityId}-collapse" class="widget-toolbar-toggle-collapse" title="<fmt:message key="widget.chrome.toggle"/>"></span>
+        <div id="widget-${regionWidget.entityId}-title" class="widget-title">
+            <c:choose>
+                <c:when test="${not empty regionWidget.widget.titleUrl}">
+                    <a href="<c:out value="${regionWidget.widget.titleUrl}"/>" rel="external"><c:out value="${regionWidget.widget.title}"/></a>
+                </c:when>
+                <c:otherwise>
+                    <c:out value="${regionWidget.widget.title}"/>
+                </c:otherwise>
+            </c:choose>
+        </div>
+        <%-- These are toolbar buttons --%>
+        <div id="widget-${regionWidget.entityId}-toolbar" style="float:right;">
+            <div id="widget-${regionWidget.entityId}-widget-menu-wrapper" class="widget-menu-wrapper">
+                <span id="widget-${regionWidget.entityId}-menu-button" class="widget-menu-button ui-icon ui-icon-gear" title="<fmt:message key="widget.menu.title"/>"></span>
+                <div id="widget-${regionWidget.entityId}-menu" class="widget-menu">
+                    <%--
+                        By default the edit prefs item is disabled.
+                        Each provider's widget initialization will be responsible for enabling this item
+                        if the widget has preferences to be edited
+                    --%>
+                    <div id="widget-${regionWidget.entityId}-menu-editprefs-item" class="widget-menu-item widget-menu-item-disabled">
+                        <fmt:message key="widget.menu.editprefs"/>
+                    </div>
+                    <div id="widget-${regionWidget.entityId}-menu-maximize-item" class="widget-menu-item">
+                        <fmt:message key="widget.menu.maximize"/>
+                    </div>
+                    <div id="widget-${regionWidget.entityId}-menu-move-item" class="widget-menu-item<c:if test='${hasOnlyOnePage}'> widget-menu-item-disabled</c:if>">
+                        <fmt:message key="widget.menu.movetopage"/>
+                    </div>
+                    <div id="widget-${regionWidget.entityId}-menu-delete-item" class="widget-menu-item">
+                        <fmt:message key="widget.menu.delete"/>
+                    </div>
+                </div>
+            </div>
+            <%-- the minimize widget button, which is hidden by default and only displays in maximized view --%>
+            <button id="widget-${regionWidget.entityId}-min"
+                    class="widget-toolbar-btn widget-toolbar-btn-min"></button>
+        </div>
+    </div>
+    <div class="widget-prefs" id="widget-${regionWidget.entityId}-prefs-content"></div>
+    <div class="widget" id="widget-${regionWidget.entityId}-body">
+        <portal:render-widget regionWidget="${regionWidget}" />
+    </div>
+</div>

Added: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/simple_regions.tag
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/simple_regions.tag?rev=1215234&view=auto
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/simple_regions.tag (added)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/simple_regions.tag Fri Dec 16 17:58:59 2011
@@ -0,0 +1,31 @@
+<%--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  --%>
+
+<%--
+Template for rendering all regions for layout templates that don't have a complex layout.  This template will
+simply render each region one after another and rely on CSS to style and position them correctly.
+--%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<%@ attribute name="page" type="org.apache.rave.portal.model.Page" required="true" description="The Page object" %>
+
+<%--@elvariable id="region" type="org.apache.rave.portal.model.Region"--%>
+<c:forEach var="region" items="${page.regions}" varStatus="status">
+    <rave:region region="${region}" regionIdx="${status.count}" />
+</c:forEach>
\ No newline at end of file

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tiles-defs.xml Fri Dec 16 17:58:59 2011
@@ -30,6 +30,11 @@
     </definition>
 
     <!-- USER FACING PAGES -->
+    <definition name="templates.user.page.*" extends="templates.base">
+        <put-attribute name="body" value="/WEB-INF/jsp/views/page.jsp"/>
+        <put-attribute name="layout" value="/WEB-INF/jsp/layouts/{1}.jsp"/>
+    </definition>
+
     <definition name="templates.user.*" extends="templates.base">
         <put-attribute name="pageTitleKey" value="page.{1}.title"/>
         <put-attribute name="body" value="/WEB-INF/jsp/views/{1}.jsp"/>

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/css/default.css
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/css/default.css?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/css/default.css (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/css/default.css Fri Dec 16 17:58:59 2011
@@ -381,6 +381,41 @@ header h1 {
     margin-right: 0;
 }
 
+.columns_3_newuser_1, .columns_3_newuser_2 {
+    width: 46%;
+}
+
+.columns_3_newuser_3 {
+    width: 93%;
+    clear: both;
+}
+
+.columns_3_newuser_static {
+    float: left;
+    height: 100%;
+    margin-right: 5px;
+    width: 30%;
+}
+
+.columns_3_newuser_static ul {
+    margin-top: 15px;
+}
+
+.columns_3_newuser_static ul li {
+    margin-left: 20px;
+}
+
+.columns_3_newuser_widgets {
+    float: left;
+    width: 65%;
+}
+
+.columns_3_newuser_subtitle {
+    display: inline-block;
+    width: 100%;
+    text-align: center;
+}
+
 .storeSearch {
     float: right;
     width: 225px;

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave.js Fri Dec 16 17:58:59 2011
@@ -564,7 +564,7 @@ var rave = rave || (function() {
         //Current providers are rave.wookie and rave.opensocial.
         //Providers register themselves when loaded, so
         //JavaScript library importing order is important.
-        //See home.jsp for example.
+        //See page.jsp for example.
         for (var key in providerMap) {
             providerMap[key].init();
         }

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/script/rave_api.js Fri Dec 16 17:58:59 2011
@@ -183,7 +183,7 @@ rave.api = rave.api || (function() {
             var widgetObjectId = rave.getObjectIdFromDomId(args.widget.id);
             var toRegionObjectId = rave.getObjectIdFromDomId(args.targetRegion.id);
             var fromRegionObjectId = rave.getObjectIdFromDomId(args.currentRegion.id);
-            //Note context must be set outside this library.  See home.jsp for example.
+            //Note context must be set outside this library.  See page.jsp for example.
             $.post(rave.getContext() + path + "page/regionWidget/" + widgetObjectId + "/move",
                 {
                     newPosition: args.targetIndex,

Modified: incubator/rave/trunk/rave-portal/src/test/resources/portal.properties
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/test/resources/portal.properties?rev=1215234&r1=1215233&r2=1215234&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/test/resources/portal.properties (original)
+++ incubator/rave/trunk/rave-portal/src/test/resources/portal.properties Fri Dec 16 17:58:59 2011
@@ -19,7 +19,7 @@
 
 #
 # These properties are used to construct the opensocial engine's URL. See 
-# for example home.jsp. Changing them does not change the actual path configuration
+# for example page.jsp. Changing them does not change the actual path configuration
 # of shindig.
 #
 portal.opensocial_engine.protocol=http



Mime
View raw message