rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ja...@apache.org
Subject svn commit: r1162657 - in /incubator/rave/trunk/rave-portal/src/main: java/org/apache/rave/portal/web/controller/ webapp/WEB-INF/views/
Date Mon, 29 Aug 2011 07:04:47 GMT
Author: jasha
Date: Mon Aug 29 07:04:47 2011
New Revision: 1162657

URL: http://svn.apache.org/viewvc?rev=1162657&view=rev
Log:
RAVE-80 Change the value of this request mapping so that it follows the pattern /store/widget/add
Remove TODOs that are done

Modified:
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/UserProfileController.java
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/addwidget.jsp
    incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/UserProfileController.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/UserProfileController.java?rev=1162657&r1=1162656&r2=1162657&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/UserProfileController.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/UserProfileController.java
Mon Aug 29 07:04:47 2011
@@ -19,8 +19,6 @@
 
 package org.apache.rave.portal.web.controller;
 
-import java.util.List;
-
 import org.apache.rave.portal.model.User;
 import org.apache.rave.portal.service.UserService;
 import org.apache.rave.portal.web.util.ModelKeys;
@@ -33,7 +31,6 @@ import org.springframework.stereotype.Co
 import org.springframework.ui.Model;
 import org.springframework.ui.ModelMap;
 import org.springframework.validation.BindingResult;
-import org.springframework.validation.ObjectError;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -70,7 +67,6 @@ public class UserProfileController {
 		  userProfileValidator.validate(user,results);
 		  if(results.hasErrors()){
 			  logger.error("newaccount.jsp: shows validation errors");
-			  //TODO: change this to a viewname (done)
 			  return ViewNames.USER_PROFILE;
 		  }
 
@@ -79,7 +75,6 @@ public class UserProfileController {
 			    logger.debug("userprofile: passed form validation");
 			    
 			    userService.updateUserProfile(user);
-			    //TODO: change this to a viewname (done)
 				return ViewNames.REDIRECT;
 		  }
 		  
@@ -87,7 +82,6 @@ public class UserProfileController {
 				//This exception is thrown if the account already exists.
 				logger.error("Account creation failed: "+ex.getMessage());
 				results.reject("Account already exists","Unable to create account");
-				//TODO: change this to a viewname (done)
 				return ViewNames.USER_PROFILE;
 				
 		  }
@@ -95,7 +89,6 @@ public class UserProfileController {
 		  catch (Exception ex) {
 				logger.error("Account creation failed: "+ex.getMessage());
 				results.reject("Unable to create account:"+ex.getMessage(),"Unable to create account");
-				//TODO: change this to a viewname (done)
 				return ViewNames.USER_PROFILE;
 		  }
 	 }

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java?rev=1162657&r1=1162656&r2=1162657&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/web/controller/WidgetStoreController.java
Mon Aug 29 07:04:47 2011
@@ -112,8 +112,7 @@ public class WidgetStoreController {
      * @param model {@link Model}
      * @return the view name of the Add new Widget form
      */
-    //TODO:  Change the value of this request mapping so that it follows the pattern /store/widget/add
-    @RequestMapping(method = RequestMethod.GET, value = "addwidget")
+    @RequestMapping(method = RequestMethod.GET, value = "widget/add")
     public String viewAddWidgetForm(Model model) {
         final Widget widget = new Widget();
         model.addAttribute(ModelKeys.WIDGET, widget);
@@ -128,10 +127,7 @@ public class WidgetStoreController {
      * @param model   {@link Model}
      * @return if successful the view name of the widget, otherwise the form
      */
-    /*TODO:  Change the value of this request mapping so that it follows the pattern /store/widget/add
-      TODO:  The value can be the same as the GET action as you are mapping based on method
& name
-     */
-    @RequestMapping(method = RequestMethod.POST, value = "doaddwidget")
+    @RequestMapping(method = RequestMethod.POST, value = "widget/add")
     public String viewAddWidgetResult(@ModelAttribute Widget widget, BindingResult results,
                                       Model model) {
         widgetValidator.validate(widget, results);

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/addwidget.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/addwidget.jsp?rev=1162657&r1=1162656&r2=1162657&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/addwidget.jsp (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/addwidget.jsp Mon Aug 29
07:04:47 2011
@@ -39,8 +39,8 @@
     <div id="content">
         <h2><fmt:message key="page.addwidget.form.header"/></h2>
         <form:errors path="widget" cssClass="error" element="p"/>
-        <form:form id="newWidgetForm" action="doaddwidget" commandName="widget" method="POST">
-            <fieldset>
+        <form:form id="newWidgetForm" action="add" commandName="widget" method="POST">
+          <fieldset>
                 <p><fmt:message key="form.some.fields.required"/></p>
 
                 <p>

Modified: incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp?rev=1162657&r1=1162656&r2=1162657&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp (original)
+++ incubator/rave/trunk/rave-portal/src/main/webapp/WEB-INF/views/store.jsp Mon Aug 29 07:04:47
2011
@@ -32,7 +32,7 @@
     </div>
     <div class="widget-a">
         <span>
-            <a href="<spring:url value="store/addwidget"/>">Add widget</a>
+            <a href="<spring:url value="store/widget/add"/>">Add widget</a>
         </span>
     </div>
     <h1>Widget Store</h1>
@@ -58,7 +58,6 @@
                 <h2>No widgets found</h2>
             </c:when>
             <c:when test="${empty searchTerm}">
-                <%-- TODO: introduce paging here --%>
                 <h2>Showing ${offset + 1} - ${offset + fn:length(widgets.resultSet)}
of ${widgets.totalResults} widgets</h2>
             </c:when>
             <c:when test="${not empty searchTerm and widgets.totalResults eq 0}">



Mime
View raw message