rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From secoo...@apache.org
Subject svn commit: r1208570 - in /incubator/rave/trunk: rave-components/rave-core/src/main/java/org/apache/rave/portal/model/ rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/ rave-components/rave-core/src/main/java/org/apache/rave/po...
Date Wed, 30 Nov 2011 17:54:57 GMT
Author: secooper
Date: Wed Nov 30 17:54:55 2011
New Revision: 1208570

URL: http://svn.apache.org/viewvc?rev=1208570&view=rev
Log:
RAVE-296 added a view of your own Widgets and added a link to the WidgetStore to see the Widgets
that you created

Modified:
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Widget.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetRepository.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetRepository.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetService.java
    incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetService.java
    incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetRepositoryTest.java
    incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetServiceTest.java
    incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql
    incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java
    incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/WidgetStoreControllerTest.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/webapp/WEB-INF/jsp/views/store.jsp

Modified: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Widget.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Widget.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Widget.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/model/Widget.java
Wed Nov 30 17:54:55 2011
@@ -55,6 +55,11 @@ import org.apache.rave.persistence.Basic
         @NamedQuery(name = Widget.WIDGET_GET_ALL, query = Widget.SELECT_W_FROM_WIDGET_W +
Widget.ORDER_BY_TITLE_ASC),
         @NamedQuery(name = Widget.WIDGET_COUNT_ALL, query = Widget.SELECT_COUNT_W_FROM_WIDGET_W),
 
+        @NamedQuery(name = Widget.WIDGET_GET_BY_OWNER,
+                query = Widget.SELECT_W_FROM_WIDGET_W + Widget.WHERE_CLAUSE_OWNER + Widget.ORDER_BY_TITLE_ASC),
+        @NamedQuery(name = Widget.WIDGET_COUNT_BY_OWNER,
+                query = Widget.SELECT_COUNT_W_FROM_WIDGET_W + Widget.WHERE_CLAUSE_OWNER),
+
         @NamedQuery(name = Widget.WIDGET_GET_BY_FREE_TEXT,
                 query = Widget.SELECT_W_FROM_WIDGET_W + Widget.WHERE_CLAUSE_FREE_TEXT + Widget.ORDER_BY_TITLE_ASC),
         @NamedQuery(name = Widget.WIDGET_COUNT_BY_FREE_TEXT,
@@ -73,9 +78,12 @@ public class Widget implements BasicEnti
     public static final String PARAM_SEARCH_TERM = "searchTerm";
     public static final String PARAM_STATUS = "widgetStatus";
     public static final String PARAM_URL = "url";
+    public static final String PARAM_OWNER = "owner";
 
     public static final String WIDGET_GET_ALL = "Widget.getAll";
     public static final String WIDGET_COUNT_ALL = "Widget.countAll";
+    public static final String WIDGET_GET_BY_OWNER = "Widget.getByOwner";
+    public static final String WIDGET_COUNT_BY_OWNER = "Widget.countByOwner";
     public static final String WIDGET_GET_BY_FREE_TEXT = "Widget.getByFreeText";
     public static final String WIDGET_COUNT_BY_FREE_TEXT = "Widget.countByFreeText";
     public static final String WIDGET_GET_BY_STATUS = "Widget.getByStatus";
@@ -86,9 +94,10 @@ public class Widget implements BasicEnti
     static final String SELECT_COUNT_W_FROM_WIDGET_W = "SELECT count(w) FROM Widget w ";
 
     static final String WHERE_CLAUSE_FREE_TEXT =
-            " WHERE lower(w.title) LIKE :searchTerm OR w.description LIKE :description";
-    static final String WHERE_CLAUSE_STATUS = " WHERE w.widgetStatus = :widgetStatus";
-    static final String WHERE_CLAUSE_URL = " WHERE w.url = :url";
+            " WHERE lower(w.title) LIKE :"+PARAM_SEARCH_TERM+" OR w.description LIKE :description";
+    static final String WHERE_CLAUSE_STATUS = " WHERE w.widgetStatus = :"+PARAM_STATUS;
+    static final String WHERE_CLAUSE_URL = " WHERE w.url = :"+PARAM_URL;
+    static final String WHERE_CLAUSE_OWNER = " WHERE w.owner = :"+PARAM_OWNER;
     static final String ORDER_BY_TITLE_ASC = " ORDER BY w.title ASC ";
 
     @Id @Column(name="entity_id")

Modified: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetRepository.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetRepository.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetRepository.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/WidgetRepository.java
Wed Nov 30 17:54:55 2011
@@ -19,6 +19,7 @@
 package org.apache.rave.portal.repository;
 
 import org.apache.rave.persistence.Repository;
+import org.apache.rave.portal.model.User;
 import org.apache.rave.portal.model.Widget;
 import org.apache.rave.portal.model.WidgetRating;
 import org.apache.rave.portal.model.WidgetStatus;
@@ -112,6 +113,10 @@ public interface WidgetRepository extend
      */
     int getCountByStatusAndTypeAndFreeText(WidgetStatus widgetStatus, String type, String
searchTerm);
 
+    List<Widget> getByOwner(User owner, int offset, int pageSize);
+
+    int getCountByOwner(User owner, int offset, int pageSize);
+
     /**
      * Searches for a Widget by its url
      *

Modified: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetRepository.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetRepository.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetRepository.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/repository/impl/JpaWidgetRepository.java
Wed Nov 30 17:54:55 2011
@@ -22,6 +22,7 @@ package org.apache.rave.portal.repositor
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.rave.persistence.jpa.AbstractJpaRepository;
+import org.apache.rave.portal.model.User;
 import org.apache.rave.portal.model.Widget;
 import org.apache.rave.portal.model.WidgetRating;
 import org.apache.rave.portal.model.WidgetStatus;
@@ -133,6 +134,21 @@ public class JpaWidgetRepository extends
         return countResult.intValue();
     }
 
+    @Override
+    public List<Widget> getByOwner(User owner, int offset, int pageSize) {
+        TypedQuery<Widget> query = manager.createNamedQuery(Widget.WIDGET_GET_BY_OWNER,
Widget.class);
+        query.setParameter(Widget.PARAM_OWNER, owner);
+        return getPagedResultList(query, offset, pageSize);
+    }
+
+    @Override
+    public int getCountByOwner(User owner, int offset, int pageSize) {
+        Query query = manager.createNamedQuery(Widget.WIDGET_COUNT_BY_OWNER);
+        query.setParameter(Widget.PARAM_OWNER, owner);
+        Number countResult = (Number) query.getSingleResult();
+        return countResult.intValue();
+    }
+
     private Predicate[] getStatusAndTypeAndFreeTextPredicates(CriteriaBuilder cb, Root<Widget>
widgetType,
                                                               WidgetStatus widgetStatus,
String type,
                                                               String searchTerm) {

Modified: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetService.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetService.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetService.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/WidgetService.java
Wed Nov 30 17:54:55 2011
@@ -104,6 +104,8 @@ public interface WidgetService {
     SearchResult<Widget> getWidgetsBySearchCriteria(String searchTerm, String widgetType,
String widgetStatus,
                                                     int offset, int pageSize);
 
+    SearchResult<Widget> getWidgetsByOwner(Long ownerId, int offset, int pageSize);
+
     /**
      * Gets a Widget by its (unique) url
      *

Modified: incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetService.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetService.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetService.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/main/java/org/apache/rave/portal/service/impl/DefaultWidgetService.java
Wed Nov 30 17:54:55 2011
@@ -21,10 +21,12 @@ package org.apache.rave.portal.service.i
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.rave.exception.DuplicateItemException;
+import org.apache.rave.portal.model.User;
 import org.apache.rave.portal.model.Widget;
 import org.apache.rave.portal.model.WidgetStatus;
 import org.apache.rave.portal.model.util.SearchResult;
 import org.apache.rave.portal.model.util.WidgetStatistics;
+import org.apache.rave.portal.repository.UserRepository;
 import org.apache.rave.portal.repository.WidgetRepository;
 import org.apache.rave.portal.service.WidgetService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,10 +40,12 @@ import java.util.Map;
 public class DefaultWidgetService implements WidgetService {
 
     private final WidgetRepository widgetRepository;
+    private final UserRepository userRepository;
 
     @Autowired
-    public DefaultWidgetService(WidgetRepository widgetRepository) {
+    public DefaultWidgetService(WidgetRepository widgetRepository, UserRepository userRepository)
{
         this.widgetRepository = widgetRepository;
+        this.userRepository = userRepository;
     }
 
     @Override
@@ -115,6 +119,17 @@ public class DefaultWidgetService implem
     }
 
     @Override
+    public SearchResult<Widget> getWidgetsByOwner(Long ownerId, int offset, int pageSize)
{
+        final User user = userRepository.get(ownerId);
+        final int count = widgetRepository.getCountByOwner(user, offset, pageSize);
+        final List<Widget> widgets = widgetRepository.getByOwner(user, offset, pageSize);
+        final SearchResult<Widget> searchResult = new SearchResult<Widget>(widgets,
 count);
+        searchResult.setOffset(offset);
+        searchResult.setPageSize(pageSize);
+        return searchResult;
+    }
+
+    @Override
     public Widget getWidgetByUrl(String widgetUrl) {
         return widgetRepository.getByUrl(widgetUrl);
     }

Modified: incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetRepositoryTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetRepositoryTest.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetRepositoryTest.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/repository/impl/JpaWidgetRepositoryTest.java
Wed Nov 30 17:54:55 2011
@@ -19,6 +19,7 @@
 
 package org.apache.rave.portal.repository.impl;
 
+import org.apache.rave.portal.model.User;
 import org.apache.rave.portal.model.Widget;
 import org.apache.rave.portal.model.WidgetRating;
 import org.apache.rave.portal.model.WidgetStatus;
@@ -180,6 +181,19 @@ public class JpaWidgetRepositoryTest {
     }
 
     @Test
+    public void getByOwner() {
+        final User user = new User(2L);
+        List<Widget> widgets = repository.getByOwner(user, 0, 10);
+        assertEquals(1, widgets.size());
+    }
+
+    @Test
+    public void getCountByOwner() {
+        final User user = new User(2L);
+        assertEquals(1, repository.getCountByOwner(user, 0, 10));
+    }
+
+    @Test
     public void saveWidgetWithLongDescription() {
         final String url = "http://example.com/doesnotexistyet";
         final String longDescription = "Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Nunc dictum sodales erat consequat pulvinar. Pellentesque ut massa mi, sit amet imperdiet
diam. Morbi nec magna quis nisi bibendum dignissim. Fusce et rhoncus turpis. Integer mollis
magna sit amet nulla convallis placerat dignissim lorem blandit. Nulla magna justo, cursus
ac semper sed, pulvinar in turpis. Donec ultricies nibh sed nulla congue ullamcorper. Fusce
commodo ultrices nunc, interdum lacinia elit faucibus at. Fusce laoreet ultricies volutpat.
";

Modified: incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetServiceTest.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetServiceTest.java
(original)
+++ incubator/rave/trunk/rave-components/rave-core/src/test/java/org/apache/rave/portal/service/impl/DefaultWidgetServiceTest.java
Wed Nov 30 17:54:55 2011
@@ -20,10 +20,12 @@
 package org.apache.rave.portal.service.impl;
 
 import org.apache.rave.exception.DuplicateItemException;
+import org.apache.rave.portal.model.User;
 import org.apache.rave.portal.model.Widget;
 import org.apache.rave.portal.model.WidgetStatus;
 import org.apache.rave.portal.model.util.SearchResult;
 import org.apache.rave.portal.model.util.WidgetStatistics;
+import org.apache.rave.portal.repository.UserRepository;
 import org.apache.rave.portal.repository.WidgetRepository;
 import org.apache.rave.portal.service.WidgetService;
 import org.junit.Before;
@@ -54,11 +56,13 @@ public class DefaultWidgetServiceTest {
 
     private WidgetService widgetService;
     private WidgetRepository widgetRepository;
+    private UserRepository userRepository;
 
     @Before
     public void setup() {
-        widgetRepository = createMock(WidgetRepository.class);        
-        widgetService = new DefaultWidgetService(widgetRepository);
+        widgetRepository = createMock(WidgetRepository.class);
+        userRepository = createMock(UserRepository.class);
+        widgetService = new DefaultWidgetService(widgetRepository, userRepository);
     }
 
     @Test
@@ -200,6 +204,31 @@ public class DefaultWidgetServiceTest {
         verify(widgetRepository);
     }
 
+    @Test
+    public void getWidgetsByOwner() {
+        final int offset = 0;
+        final int pageSize = 10;
+        final User user = new User(5L);
+        expect(userRepository.get(user.getEntityId())).andReturn(user);
+        replay(userRepository);
+
+        final List<Widget> widgets = new ArrayList();
+        final Widget widget = new Widget(3L, "http://www.widgetsRus.com/");
+        widgets.add(widget);
+
+        expect(widgetRepository.getCountByOwner(user, offset, pageSize)).andReturn(widgets.size());
+        expect(widgetRepository.getByOwner(user, offset, pageSize)).andReturn(widgets);
+        replay(widgetRepository);
+
+        SearchResult<Widget> result = widgetService.getWidgetsByOwner(user.getEntityId(),
offset, pageSize);
+        assertNotNull(result);
+        assertEquals(offset, result.getOffset());
+        assertEquals(pageSize, result.getPageSize());
+        assertEquals(widgets, result.getResultSet());
+
+        verify(userRepository);
+        verify(widgetRepository);
+    }
 
     @Test
     public void getWidget_null() {

Modified: incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql (original)
+++ incubator/rave/trunk/rave-components/rave-core/src/test/resources/test_data.sql Wed Nov
30 17:54:55 2011
@@ -160,7 +160,7 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
 -- wikipedia widget
 set @wikipedia_widget_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name =
@widget_seq);
 insert into widget (entity_id, title, url, type, description, author, widget_status, owner_id)
-values(@wikipedia_widget_id, 'Wikipedia','http://www.widget-dico.com/wikipedia/google/wikipedia.xml',
'OpenSocial', 'A Wikipedia Search and Go widget. Language choice.', 'WidgetMe', 'PUBLISHED',
@user_id_1);
+values(@wikipedia_widget_id, 'Wikipedia','http://www.widget-dico.com/wikipedia/google/wikipedia.xml',
'OpenSocial', 'A Wikipedia Search and Go widget. Language choice.', 'WidgetMe', 'PUBLISHED',
@user_id_2);
 UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_seq;
 
 -- translate widget

Modified: incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java
(original)
+++ incubator/rave/trunk/rave-components/rave-web/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java
Wed Nov 30 17:54:55 2011
@@ -82,6 +82,17 @@ public class WidgetStoreController {
         return ViewNames.STORE;
     }
 
+    @RequestMapping(method = RequestMethod.GET, value="mine")
+    public String viewMine(Model model, @RequestParam long referringPageId,
+                       @RequestParam(required = false, defaultValue = "0") int offset) {
+        User user = userService.getAuthenticatedUser();
+        model.addAttribute(ModelKeys.WIDGETS,
+                widgetService.getWidgetsByOwner(user.getEntityId(), offset, getPageSize()));
+                model.addAttribute(ModelKeys.REFERRING_PAGE_ID, referringPageId);
+        model.addAttribute(ModelKeys.WIDGETS_STATISTICS, widgetService.getAllWidgetStatistics(user.getEntityId()));
+        return ViewNames.STORE;
+    }
+
     /**
      * Views details of the specified widget
      *

Modified: incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/WidgetStoreControllerTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/WidgetStoreControllerTest.java?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/WidgetStoreControllerTest.java
(original)
+++ incubator/rave/trunk/rave-components/rave-web/src/test/java/org/apache/rave/portal/web/controller/WidgetStoreControllerTest.java
Wed Nov 30 17:54:55 2011
@@ -111,6 +111,27 @@ public class WidgetStoreControllerTest {
         verify(widgetService);
         assertThat(view, is(equalTo(ViewNames.STORE)));
         assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
+        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
+        assertThat((Long) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
+        assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
+    }
+
+    @Test
+    public void viewMine() {
+        Model model = new ExtendedModelMap();
+        List<Widget> widgets = new ArrayList<Widget>();
+        SearchResult<Widget> emptyResult = new SearchResult<Widget>(widgets,
0);
+
+        expect(widgetService.getWidgetsByOwner(validUser.getEntityId(), 0, 10)).andReturn(emptyResult);
+        expect(widgetService.getAllWidgetStatistics(validUser.getEntityId())).andReturn(allWidgetStatisticsMap);
+        replay(widgetService);
+
+        String view = controller.viewMine(model, REFERRER_ID, 0);
+
+        verify(widgetService);
+        assertThat(view, is(equalTo(ViewNames.STORE)));
+        assertThat(model.containsAttribute(ModelKeys.WIDGETS), is(true));
+        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
         assertThat((Long) model.asMap().get(ModelKeys.REFERRING_PAGE_ID), is(equalTo(REFERRER_ID)));
         assertThat(widgets, is(sameInstance(emptyResult.getResultSet())));
     }
@@ -129,6 +150,7 @@ public class WidgetStoreControllerTest {
         verify(widgetService);
         assertThat(view, is(equalTo(ViewNames.WIDGET)));
         assertThat(model.containsAttribute(ModelKeys.WIDGET), is(true));
+        assertThat(model.containsAttribute(ModelKeys.WIDGET_STATISTICS), is(true));
         assertThat(((Widget) model.asMap().get(ModelKeys.WIDGET)), is(sameInstance(w)));
         assertNull(model.asMap().get("widgetRating"));
     }
@@ -160,6 +182,7 @@ public class WidgetStoreControllerTest {
         final Map<String, Object> modelMap = model.asMap();
         assertEquals(searchTerm, modelMap.get(ModelKeys.SEARCH_TERM));
         assertTrue(model.containsAttribute(ModelKeys.WIDGETS));
+        assertThat(model.containsAttribute(ModelKeys.WIDGETS_STATISTICS), is(true));
         assertEquals(offset, modelMap.get(ModelKeys.OFFSET));
         assertEquals(result, modelMap.get(ModelKeys.WIDGETS));
     }

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=1208570&r1=1208569&r2=1208570&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 Wed
Nov 30 17:54:55 2011
@@ -101,6 +101,8 @@ page.store.list.noresult=No widgets foun
 page.store.list.result.x.to.y=Showing {0} - {1} of {2} widgets
 page.store.list.search.noresult=No widgets found for ''{0}''
 page.store.list.search.result.x.to.y=Showing {0} - {1} of {2} widgets that match ''{3}''
+page.store.list.widgets.mine=My Widgets
+page.store.list.widgets.all=All Widgets
 
 page.userprofile.title=Update user profile
 page.userprofile.button=Update profile

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=1208570&r1=1208569&r2=1208570&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 Wed
Nov 30 17:54:55 2011
@@ -101,6 +101,8 @@ page.store.list.noresult=Geen widgets ge
 page.store.list.result.x.to.y={0} - {1} van {2} widgets getoond
 page.store.list.search.noresult=Geen widgets gevonden voor ''{0}''
 page.store.list.search.result.x.to.y={0} - {1} van {2} widgets getoond welke overeenkomen
met ''{3}''
+page.store.list.widgets.mine=My Widgets
+page.store.list.widgets.all=All Widgets
 
 page.userprofile.title=Update gebruikersprofiel
 page.userprofile.button=Update profiel

Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp?rev=1208570&r1=1208569&r2=1208570&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
(original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
Wed Nov 30 17:54:55 2011
@@ -83,6 +83,13 @@
                 </p>
             </fieldset>
         </form>
+
+        <div>
+            <a href="<spring:url value="/app/store/mine?referringPageId=${referringPageId}"/>"><fmt:message
key="page.store.list.widgets.mine"/></a>
+        </div>
+        <div>
+            <a href="<spring:url value="/app/store?referringPageId=${referringPageId}"/>"><fmt:message
key="page.store.list.widgets.all"/></a>
+        </div>
     </section>
 
     <section class="storeBox">
@@ -223,7 +230,6 @@
                 </ul>
 
             </c:if>
-
         </c:if>
     </section>
 



Mime
View raw message