rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfrank...@apache.org
Subject svn commit: r1162758 - /incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java
Date Mon, 29 Aug 2011 12:27:24 GMT
Author: mfranklin
Date: Mon Aug 29 12:27:23 2011
New Revision: 1162758

URL: http://svn.apache.org/viewvc?rev=1162758&view=rev
Log:
Added TODO comments and fixed minor inconsistencies

Modified:
    incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java

Modified: incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java
URL: http://svn.apache.org/viewvc/incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java?rev=1162758&r1=1162757&r2=1162758&view=diff
==============================================================================
--- incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java
(original)
+++ incubator/rave/trunk/rave-portal/src/main/java/org/apache/rave/portal/service/impl/DefaultPageService.java
Mon Aug 29 12:27:23 2011
@@ -84,13 +84,9 @@ public class DefaultPageService implemen
     public Page getPageFromList(long pageId, List<Page> pages) {
         Page pageToFind = new Page(pageId);
         int index = pages.indexOf(pageToFind);
-        if (index == -1) {
-            return null;
-        } else {
-            return pages.get(index);
-        }        
+        return index == -1 ? null : pages.get(index);
     }
-    
+
     @Override
     @Transactional
     public Page addNewPage(String pageName, String pageLayoutCode) {                    

@@ -115,6 +111,9 @@ public class DefaultPageService implemen
         // first delete the page        
         pageRepository.delete(pageRepository.get(pageId));
         // now re-sequence the page sequence numbers
+
+        //TODO:  We should be able to delete these lines.  If there are gaps in the sequence
numbers, then it will still
+        //TODO:  return values in the correct order.  We only need to update sequences when
there is a change in order
         List<Page> pages = pageRepository.getAllPages(user.getId());
         updatePageRenderSequences(pages);
     }    
@@ -289,4 +288,4 @@ public class DefaultPageService implemen
         }
         throw new IllegalArgumentException("Invalid RegionWidget ID");
     }
-}
\ No newline at end of file
+}



Mime
View raw message