roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1552224 - in /roller/trunk/app/src: main/java/org/apache/roller/weblogger/business/ main/java/org/apache/roller/weblogger/business/jpa/ main/java/org/apache/roller/weblogger/ui/struts2/editor/ main/resources/ test/java/org/apache/roller/we...
Date Thu, 19 Dec 2013 04:03:30 GMT
Author: gmazza
Date: Thu Dec 19 04:03:29 2013
New Revision: 1552224

URL: http://svn.apache.org/r1552224
Log:
Removed code no longer needed as a result of getting rid of subcategories.

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java
    roller/trunk/app/src/main/resources/ApplicationResources.properties
    roller/trunk/app/src/main/resources/ApplicationResources_da.properties
    roller/trunk/app/src/main/resources/ApplicationResources_de.properties
    roller/trunk/app/src/main/resources/ApplicationResources_es.properties
    roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties
    roller/trunk/app/src/main/resources/ApplicationResources_ru.properties
    roller/trunk/app/src/main/resources/ApplicationResources_sl.properties
    roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties
    roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/WeblogEntryManager.java
Thu Dec 19 04:03:29 2013
@@ -229,15 +229,6 @@ public interface WeblogEntryManager {
     
     
     /**
-     * Move a category under another category.
-     *
-     * This moves the src category itself and all children and associated entries.
-     */
-    void moveWeblogCategory(WeblogCategory src, WeblogCategory dest)
-            throws WebloggerException;
-    
-    
-    /**
      * Recategorize all entries with one category to another.
      */
     void moveWeblogCategoryContents(WeblogCategory srcCat, WeblogCategory destCat)

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/business/jpa/JPAWeblogEntryManagerImpl.java
Thu Dec 19 04:03:29 2013
@@ -152,43 +152,7 @@ public class JPAWeblogEntryManagerImpl i
         roller.getWeblogManager().saveWeblog(
                 cat.getWebsite());
     }
-    
-    /**
-     * @inheritDoc
-     */
-    public void moveWeblogCategory(WeblogCategory srcCat, WeblogCategory destCat)
-    throws WebloggerException {
-        
-        // TODO: this check should be made before calling this method?
-        if (destCat.descendentOf(srcCat)) {
-            throw new WebloggerException(
-                    "ERROR cannot move parent category into it's own child");
-        }
-        
-        log.debug("Moving category "+srcCat.getPath() +
-                " under "+destCat.getPath());
-        
-        
-        WeblogCategory oldParent = srcCat.getParent();
-        if(oldParent != null) {
-            oldParent.getWeblogCategories().remove(srcCat);
-        }
-        srcCat.setParent(destCat);
-        destCat.getWeblogCategories().add(srcCat);
-        
-        if("/".equals(destCat.getPath())) {
-            srcCat.setPath("/"+srcCat.getName());
-        } else {
-            srcCat.setPath(destCat.getPath() + "/" + srcCat.getName());
-        }
-        saveWeblogCategory(srcCat);
-        
-        // the main work to be done for a category move is to update the
-        // path attribute of the category and all descendent categories
-        updatePathTree(srcCat);
-    }
-    
-    
+
     // updates the paths of all descendents of the given category
     private void updatePathTree(WeblogCategory cat)
     throws WebloggerException {

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Categories.java
Thu Dec 19 04:03:29 2013
@@ -130,41 +130,7 @@ public class Categories extends UIAction
 	}
 
 	public String move() {
-
-		try {
-			WeblogEntryManager wmgr = WebloggerFactory.getWeblogger()
-					.getWeblogEntryManager();
-
-			log.debug("Moving categories to category - "
-					+ getTargetCategoryId());
-
-			// Move subCategories to new category.
-			String[] cats = getSelectedCategories();
-			WeblogCategory parent = wmgr
-					.getWeblogCategory(getTargetCategoryId());
-			if (cats != null) {
-				for (int i = 0; i < cats.length; i++) {
-					WeblogCategory cd = wmgr.getWeblogCategory(cats[i]);
-
-					// Don't move category into itself.
-					if (!cd.getId().equals(parent.getId())
-							&& !parent.descendentOf(cd)) {
-						wmgr.moveWeblogCategory(cd, parent);
-					} else {
-						addMessage("categoriesForm.warn.notMoving",
-								cd.getName());
-					}
-				}
-
-				// flush changes
-				WebloggerFactory.getWeblogger().flush();
-			}
-
-		} catch (WebloggerException ex) {
-			log.error("Error moving categories", ex);
-			addError("categoriesForm.error.move");
-		}
-
+        // no-op today as subcategories no longer supported
 		return execute();
 	}
 

Modified: roller/trunk/app/src/main/resources/ApplicationResources.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources.properties?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources.properties Thu Dec 19 04:03:29
2013
@@ -172,9 +172,6 @@ These are your top-level weblog categori
 category to be defined. \
 Categories are used to organize your weblog entries and your readers can \
 choose to subscribe to separate newsfeeds for each of your categories.
-categoriesForm.categoryPrompt=\
-You can add sub-categories here, but many of the Roller macros display \
-only top-level categories.
 categoriesForm.addCategory=Add Category
 categoriesForm.checkAll=Check All
 categoriesForm.checkNone=Check None

Modified: roller/trunk/app/src/main/resources/ApplicationResources_da.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_da.properties?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_da.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_da.properties Thu Dec 19 04:03:29
2013
@@ -165,9 +165,6 @@ categoriesForm.rootPrompt=\
 Dette er top-niveau af kategorier i din weblog. \
 Du kan bruge kategorier til at organisere dine weblog indl�g og dine l�sere kan
\
 v�lge at abonnere p� nyhedsfeeds h�rende til hver af dine kategorier.
-categoriesForm.categoryPrompt=\
-Du kan tilf�je underordnede kategorier her, men mange af Roller makroer viser \
-kun top-niveau kategori.
 categoriesForm.addCategory=Tilf�j kategori
 categoriesForm.checkAll=V�lg alle
 categoriesForm.checkNone=V�lg ingen

Modified: roller/trunk/app/src/main/resources/ApplicationResources_de.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_de.properties?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_de.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_de.properties Thu Dec 19 04:03:29
2013
@@ -155,7 +155,6 @@ calendar.prev=Voriger
 calendar.summary=Blog Archiv Kalender
 calendar.today=Heute
 categoriesForm.addCategory=Kategorie hinzuf\u00FCgen
-categoriesForm.categoryPrompt=Sie k\u00F6nnen hier Unterkategorien hinzuf\u00FCgen, aber
viele der Roller Makros werden nur die Kategorien auf der obersten Ebene anzeigen
 categoriesForm.checkAll=Alle markieren
 categoriesForm.checkNone=Keine markieren
 categoriesForm.delete=L\u00F6schen

Modified: roller/trunk/app/src/main/resources/ApplicationResources_es.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_es.properties?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_es.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_es.properties Thu Dec 19 04:03:29
2013
@@ -66,7 +66,6 @@ categoriesForm.edit = Editar
 categoriesForm.root = ra\u00EDz
 categoriesForm.rootTitle = Categor\u00EDas
 categoriesForm.rootPrompt = Estas son sus categor\u00EDas weblog de nivel superior. Puede
usar categor\u00EDas para organizar sus entradas de weblog y sus lectores pueden elegir suscribirse
cada una de sus categor\u00EDas.
-categoriesForm.categoryPrompt = Puede a\u00F1adir subcategor\u00EDas aqu\u00ED, 
 categoriesForm.addCategory = A\u00F1adir categor\u00EDa
 categoriesForm.checkAll = Chequear todo
 categoriesForm.checkNone = No chequear nada

Modified: roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_ja_JP.properties Thu Dec 19 04:03:29
2013
@@ -136,9 +136,6 @@ categoriesForm.rootPrompt=\
 \u30D6\u30ED\u30B0\u30A8\u30F3\u30C8\u30EA\u3092\u5206\u985E\u3057\u3001\u8AAD\u8005\u306B\u7279\u5B9A\u306E\u5206\u91CE\u306B\u7279\u5316\u3057\u305F\u30A8\u30F3\u30C8\u30EA\u7FA4\u3092\u8AAD\u307E\u305B\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\
 \u3053\u308C\u306F\u30D5\u30A3\u30FC\u30C9\u306B\u3082\u5F71\u97FF\u3057\u307E\u3059\u3002Roller\u306F\u7279\u5B9A\u30AB\u30C6\u30B4\u30EA\u306E\u30D5\u30A3\u30FC\u30C9\u3092\u53D6\u5F97\u3055\u305B\u308B\u3053\u3068\u3082\u3067\u304D\u307E\u3059\u3002\
 
-categoriesForm.categoryPrompt=\
-\u30B5\u30D6\u30AB\u30C6\u30B4\u30EA\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u304C\u3001\
-Roller\u306E\u30DE\u30AF\u30ED\u306F\u30C8\u30C3\u30D7\u30EC\u30D9\u30EB\u30AB\u30C6\u30B4\u30EA\u306E\u307F\u30B5\u30DD\u30FC\u30C8\u3059\u308B\u3082\u306E\u304C\u591A\u3044\u3067\u3059(\u306E\u3067\u304A\u85A6\u3081\u306F\u3057\u307E\u305B\u3093)\u3002
 categoriesForm.addCategory=\u30AB\u30C6\u30B4\u30EA\u8FFD\u52A0
 categoriesForm.checkAll=\u5168\u3066\u9078\u629E
 categoriesForm.checkNone=\u5168\u3066\u5916\u3059

Modified: roller/trunk/app/src/main/resources/ApplicationResources_ru.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_ru.properties?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_ru.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_ru.properties Thu Dec 19 04:03:29
2013
@@ -109,9 +109,6 @@ categoriesForm.rootTitle=\u041a\u0430\u0
 categoriesForm.rootPrompt=\u042D\u0442\u043E \u0433\u043B\u0430\u0432\u043D\u0430\u044F \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F
\u0434\u043D\u0435\u0432\u043D\u0438\u043A\u0430. \
 \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C
\u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438 \u0447\u0442\u043E\u0431\u044B \u0443\u043F\u043E\u0440\u044F\u0434\u043E\u0447\u0438\u0442\u044C
\u0437\u0430\u043F\u0438\u0441\u0438, \u0438 \u0412\u0430\u0448\u0438 \u0447\u0438\u0442\u0430\u0442\u0435\u043B\u0438
\u043C\u043E\u0433\u0443\u0442 \
 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u0442\u044C\u0441\u044F \u043D\u0430 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u0443\u044E
\u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044E \u0412\u0430\u0448\u0435\u0433\u043E
\u0434\u043D\u0435\u0432\u043D\u0438\u043A\u0430.
-categoriesForm.categoryPrompt=\
-\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c
\u043f\u043e\u0434\u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0437\u0434\u0435\u0441\u044c,
\u043d\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u044b
\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \
-\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438
\u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f.
 categoriesForm.addCategory=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e
 categoriesForm.checkAll=\u041e\u0442\u043c\u0435\u0442\u0438\u0442 \u0432\u0441\u0435
 categoriesForm.checkNone=\u0421\u043d\u044f\u0442\u044c \u043e\u0442\u043c\u0435\u0442\u043a\u0438

Modified: roller/trunk/app/src/main/resources/ApplicationResources_sl.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_sl.properties?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_sl.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_sl.properties Thu Dec 19 04:03:29
2013
@@ -167,9 +167,6 @@ categoriesForm.rootTitle=Kategorije
 categoriesForm.rootPrompt=To so va\u0161e weblog kategorije na najvi\u0161jem nivoju. \
 Kategorije lahko uporabite za organizacijo va\u0161ih weblog vnosov v va\u0161e \u010Ditalce
in tako lahko \
 izbirate lo\u010Dene kanale Novic za vsako va\u0161o kategorijo.
-categoriesForm.categoryPrompt=\
-Tukaj lahko dodajate pod-kategorije, vendar ve\u010Dina Roller-jevih makrojev prika\u017Ee
\
-samo kategorije na vrhnjem nivoju.
 categoriesForm.addCategory=Dodaj Kategorijo
 categoriesForm.checkAll=Potrdi Vse
 categoriesForm.checkNone=Ni\u010D ne Potrdi 

Modified: roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties (original)
+++ roller/trunk/app/src/main/resources/ApplicationResources_zh_CN.properties Thu Dec 19 04:03:29
2013
@@ -72,7 +72,6 @@ calendar.prev=\u524d\u9875
 calendar.summary=\u65e5\u5fd7\u5f52\u6863\u65e5\u5386
 calendar.today=\u4eca\u5929
 categoriesForm.addCategory=\u6dfb\u52a0\u5206\u7c7b
-categoriesForm.categoryPrompt=\u60A8\u53EF\u4EE5\u5728\u8FD9\u91CC\u6DFB\u52A0\u4E00\u4E2A\u5B50\u7C7B\uFF0C\u4F46\u662FRoller\u53EA\u63D0\u4F9B\u4E00\u4E9B\u663E\u793A\u9876\u7EA7\u5206\u7C7B\u7684\u5B8F\u3002
 categoriesForm.checkAll=\u5168\u90e8\u9009\u62e9
 categoriesForm.checkNone=\u4e00\u4e2a\u4e0d\u9009
 categoriesForm.delete=\u5220\u9664

Modified: roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java?rev=1552224&r1=1552223&r2=1552224&view=diff
==============================================================================
--- roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
(original)
+++ roller/trunk/app/src/test/java/org/apache/roller/weblogger/business/WeblogCategoryFunctionalityTest.java
Thu Dec 19 04:03:29 2013
@@ -231,94 +231,7 @@ public class WeblogCategoryFunctionality
         
         log.info("END");
     }
-    
-    
-    /**
-     * Test moving one category into another.
-     */
-    public void testMoveWeblogCategory() throws Exception {
-        log.info("BEGIN");
-        
-        WeblogEntryManager mgr = WebloggerFactory.getWeblogger().getWeblogEntryManager();
-        
-        testWeblog = TestUtils.getManagedWebsite(testWeblog);
-        testUser = TestUtils.getManagedUser(testUser);
-        WeblogCategory root = mgr.getRootWeblogCategory(testWeblog);
-        WeblogEntry e1 = null;
-        WeblogEntry e2 = null; 
-        WeblogEntry e3 = null;
-        WeblogEntry e4 = null;
-
-        try {
-            // add some categories and entries to test with
-            WeblogCategory dest = new WeblogCategory(testWeblog, root, "c0", null, null);
-            mgr.saveWeblogCategory(dest);
-
-            WeblogCategory c1 = new WeblogCategory(testWeblog, root, "c1", null, null);
-            mgr.saveWeblogCategory(c1);
-
-            WeblogCategory c2 = new WeblogCategory(testWeblog, c1, "c2", null, null);
-            mgr.saveWeblogCategory(c2);
-
-            WeblogCategory c3 = new WeblogCategory(testWeblog, c2, "c3", null, null);
-            mgr.saveWeblogCategory(c3);
-
-            TestUtils.endSession(true);
-
-            c1 = mgr.getWeblogCategory(c1.getId());
-            c2 = mgr.getWeblogCategory(c2.getId());
-            c3 = mgr.getWeblogCategory(c3.getId());
-            dest = mgr.getWeblogCategory(dest.getId());
-
-            e1 = TestUtils.setupWeblogEntry("e1", c1, testWeblog, testUser);
-            e2 = TestUtils.setupWeblogEntry("e2", c1, WeblogEntry.DRAFT, testWeblog, testUser);
-            e3 = TestUtils.setupWeblogEntry("e3", c2, testWeblog, testUser);
-            e4 = TestUtils.setupWeblogEntry("e4", c3, testWeblog, testUser);
 
-            TestUtils.endSession(true);
-
-            // need to query for cats again because we closed the session
-            c1 = mgr.getWeblogCategory(c1.getId());
-            c2 = mgr.getWeblogCategory(c2.getId());
-            c3 = mgr.getWeblogCategory(c3.getId());
-            dest = mgr.getWeblogCategory(dest.getId());
-
-            // verify number of entries in each category
-            assertEquals(0, dest.retrieveWeblogEntries(true).size());
-            assertEquals(0, dest.retrieveWeblogEntries(false).size());
-            assertEquals(2, c1.retrieveWeblogEntries(false).size());
-            assertEquals(1, c1.retrieveWeblogEntries(true).size());
-
-            // move contents of source category c1 to destination category dest
-            mgr.moveWeblogCategory(c1, dest);
-            TestUtils.endSession(true);
-
-            // after move, verify number of entries in each category
-            dest = mgr.getWeblogCategory(dest.getId());
-            c1 = mgr.getWeblogCategory(c1.getId());
-            c2 = mgr.getWeblogCategory(c2.getId());
-            c3 = mgr.getWeblogCategory(c3.getId());
-
-            assertEquals(dest, c1.getParent());
-            assertEquals(c1,   c2.getParent());
-            assertEquals(c2,   c3.getParent());
-
-            assertEquals(2, c1.retrieveWeblogEntries(false).size());
-            assertEquals(1, c1.retrieveWeblogEntries(true).size());
-            assertEquals(1, c2.retrieveWeblogEntries(false).size());
-            assertEquals(1, c3.retrieveWeblogEntries(false).size());
-            assertEquals(0, dest.retrieveWeblogEntries(false).size());
-
-        } finally {
-            mgr.removeWeblogEntry(TestUtils.getManagedWeblogEntry(e1));
-            mgr.removeWeblogEntry(TestUtils.getManagedWeblogEntry(e2));
-            mgr.removeWeblogEntry(TestUtils.getManagedWeblogEntry(e3));
-            mgr.removeWeblogEntry(TestUtils.getManagedWeblogEntry(e4));
-        }
-        log.info("END");
-    }
-    
-    
     /**
      * Test moving entries in category to new category.
      */



Mime
View raw message