You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by ve...@apache.org on 2012/02/28 18:45:10 UTC
svn commit: r1294746 - in /incubator/rave/trunk:
rave-components/rave-core/src/main/java/org/apache/rave/portal/model/
rave-components/rave-core/src/test/resources/
rave-portal-resources/src/main/resources/
rave-portal-resources/src/main/webapp/WEB-INF...
Author: venkatm
Date: Tue Feb 28 17:45:10 2012
New Revision: 1294746
URL: http://svn.apache.org/viewvc?rev=1294746&view=rev
Log:
RAVE-264: Featured Widgets
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/test/resources/test_data.sql
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/admin/widgetdetail.jsp
incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/store.jsp
incubator/rave/trunk/rave-portal-resources/src/main/webapp/css/default.css
incubator/rave/trunk/rave-portal/src/test/resources/test-data.sql
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=1294746&r1=1294745&r2=1294746&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 Tue Feb 28 17:45:10 2012
@@ -65,7 +65,7 @@ public class Widget implements BasicEnti
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 PARAM_TAG = "keyword";
+ public static final String PARAM_TAG = "keyword";
public static final String WIDGET_GET_ALL = "Widget.getAll";
public static final String WIDGET_COUNT_ALL = "Widget.countAll";
@@ -91,7 +91,7 @@ public class Widget implements BasicEnti
static final String WIDGET_TAG_BY_KEYWORD=" (select t.widgetId from WidgetTag t where lower(t.tag.keyword)=:"+PARAM_TAG+")";
static final String JOIN_TAGS=" WHERE w.entityId in"+WIDGET_TAG_BY_KEYWORD;
- static final String ORDER_BY_TITLE_ASC = " ORDER BY w.title ASC ";
+ static final String ORDER_BY_TITLE_ASC = " ORDER BY w.featured DESC, w.title ASC ";
@Id
@@ -189,6 +189,11 @@ public class Widget implements BasicEnti
@OrderBy("text")
private List<Category> categories;
+ @XmlElement
+ @Basic
+ @Column(name = "featured")
+ private boolean featured;
+
public Widget() {
}
@@ -363,6 +368,14 @@ public class Widget implements BasicEnti
this.categories = categories;
}
+ public boolean isFeatured() {
+ return featured;
+ }
+
+ public void setFeatured(boolean featured) {
+ this.featured = featured;
+ }
+
@Override
public boolean equals(Object obj) {
if (obj == null) {
@@ -398,6 +411,7 @@ public class Widget implements BasicEnti
", description='" + description + '\'' +
", widgetStatus=" + widgetStatus + '\'' +
", owner=" + owner + '\'' +
+ ", featured=" + featured + '\'' +
", disable_rendering=" + disableRendering + '\'' +
", disable_rendering_message=" + disableRenderingMessage +
'}';
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=1294746&r1=1294745&r2=1294746&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 Tue Feb 28 17:45:10 2012
@@ -190,8 +190,8 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
-- nytimes widget
set @nyt_widget_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_seq);
-insert into widget (entity_id, title, url, type, widget_status, owner_id)
-values(@nyt_widget_id, 'NYTimes.com - Top Stories', 'http://widgets.nytimes.com/packages/html/igoogle/topstories.xml', 'OpenSocial', 'PUBLISHED', @user_id_1);
+insert into widget (entity_id, title, url, type, widget_status, owner_id,featured)
+values(@nyt_widget_id, 'NYTimes.com - Top Stories', 'http://widgets.nytimes.com/packages/html/igoogle/topstories.xml', 'OpenSocial', 'PUBLISHED', @user_id_1,true );
UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_seq;
-- google tabbed news widget
@@ -1013,4 +1013,4 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
set @next_person_profile_subpage2_template_widget_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @page_template_widget_seq);
insert into page_template_widget (entity_id, page_template_region_id, render_sequence, widget_id, locked)
values (@next_person_profile_subpage2_template_widget_id, @person_profile_subpage2_template_region_id, 0, @my_activity_widget_id, true);
-UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @page_template_widget_seq;
\ No newline at end of file
+UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @page_template_widget_seq;
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=1294746&r1=1294745&r2=1294746&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 Tue Feb 28 17:45:10 2012
@@ -83,6 +83,7 @@ page.general.addpage.layout.columns_3_ne
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:
+page.general.checkBox.featured=Featured
page.getWidgetMetadata.button=Get widget metadata
page.updateWidgetMetadata.button=Update widget metadata
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=1294746&r1=1294745&r2=1294746&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 Tue Feb 28 17:45:10 2012
@@ -85,6 +85,7 @@ page.general.addpage.layout.columns_3_ne
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 paginaindeling:
+page.general.checkBox.featured=Prominent
page.getWidgetMetadata.button=Haal widget metadata op
page.updateWidgetMetadata.button=Update widget metadata op
Modified: incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp?rev=1294746&r1=1294745&r2=1294746&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp (original)
+++ incubator/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/jsp/views/admin/widgetdetail.jsp Tue Feb 28 17:45:10 2012
@@ -120,13 +120,21 @@
</p>
<p>
- <form:label path="disableRendering">
- <fmt:message key="widget.disableRendering" />
+ <form:label path="featured">
+ <fmt:message key="page.general.checkBox.featured" />
</form:label>
- <form:checkbox path="disableRendering" id="disableRendering" />
- <form:errors path="disableRendering" cssClass="error" />
+ <form:checkbox path="featured" id="featured" />
+ <form:errors path="featured" cssClass="error" />
</p>
+ <p>
+ <form:label path="disableRendering">
+ <fmt:message key="widget.disableRendering" />
+ </form:label>
+ <form:checkbox path="disableRendering" id="disableRendering" />
+ <form:errors path="disableRendering" cssClass="error" />
+ </p>
+
<p>
<form:label path="disableRenderingMessage">
<fmt:message key="widget.disableRenderingMessage" />
@@ -222,4 +230,4 @@
$(function() {
rave.setContext("<spring:url value="/app/" />");
});
-</script>
\ No newline at end of file
+</script>
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=1294746&r1=1294745&r2=1294746&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 Tue Feb 28 17:45:10 2012
@@ -188,9 +188,16 @@
items="${widgets.resultSet}">
<%--@elvariable id="widgetsStatistics" type="org.apache.rave.portal.model.util.WidgetStatistics"--%>
<c:set var="widgetStatistics" value="${widgetsStatistics[widget.entityId]}"/>
- <li class="storeItem">
+ <c:choose>
+ <c:when test='${widget.featured == "true"}' >
+ <li class="storeItem storeItemFeatured">
+ </c:when>
+ <c:otherwise>
+ <li class="storeItem">
+ </c:otherwise>
+ </c:choose>
- <div class="storeItemLeft">
+ <div class="storeItemLeft">
<c:if test="${not empty widget.thumbnailUrl}">
<img class="storeWidgetThumbnail" src="${widget.thumbnailUrl}"
title="<c:out value="${widget.title}"/>" alt=""
@@ -349,4 +356,4 @@
rave.setContext("<spring:url value="/app/" />");
rave.store.init('<c:out value="${referringPageId}"/>');
});
-</script>
\ No newline at end of file
+</script>
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=1294746&r1=1294745&r2=1294746&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 Tue Feb 28 17:45:10 2012
@@ -500,6 +500,10 @@ header h1 {
box-shadow: 2px 2px 2px black;
}
+.storeItemFeatured {
+ background-color: #D5EAF9;
+}
+
.widget-users-dialog {
height: 200px;
}
Modified: incubator/rave/trunk/rave-portal/src/test/resources/test-data.sql
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/test/resources/test-data.sql?rev=1294746&r1=1294745&r2=1294746&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/test/resources/test-data.sql (original)
+++ incubator/rave/trunk/rave-portal/src/test/resources/test-data.sql Tue Feb 28 17:45:10 2012
@@ -163,8 +163,8 @@ UPDATE RAVE_PORTAL_SEQUENCES SET seq_cou
-- nytimes widget
set @nyt_widget_id = (SELECT seq_count FROM RAVE_PORTAL_SEQUENCES WHERE seq_name = @widget_seq);
-insert into widget (entity_id, title, url, type, widget_status, owner_id)
-values(@nyt_widget_id, 'NYTimes.com - Top Stories', 'http://widgets.nytimes.com/packages/html/igoogle/topstories.xml', 'OpenSocial', 'PUBLISHED', @user_id_1);
+insert into widget (entity_id, title, url, type, widget_status, owner_id, featured)
+values(@nyt_widget_id, 'NYTimes.com - Top Stories', 'http://widgets.nytimes.com/packages/html/igoogle/topstories.xml', 'OpenSocial', 'PUBLISHED', @user_id_1, TRUE );
UPDATE RAVE_PORTAL_SEQUENCES SET seq_count = (seq_count + 1) WHERE seq_name = @widget_seq;
-- google tabbed news widget