roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r1601254 [2/4] - in /roller/branches/rome2: ./ app/ app/src/main/java/org/apache/roller/util/ app/src/main/java/org/apache/roller/weblogger/business/ app/src/main/java/org/apache/roller/weblogger/business/jpa/ app/src/main/java/org/apache/r...
Date Sun, 08 Jun 2014 20:23:36 GMT
Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/pojos/wrapper/WeblogWrapper.java Sun Jun  8 20:23:32 2014
@@ -29,7 +29,6 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
-import org.apache.roller.weblogger.pojos.WeblogReferrer;
 
 
 /**
@@ -171,8 +170,12 @@ public final class WeblogWrapper {
     public Boolean getModerateComments() {
         return this.pojo.getModerateComments();
     }
-    
-    
+
+    public String getAnalyticsCode() {
+        return this.pojo.getAnalyticsCode();
+    }
+
+
     public Boolean getEmailComments() {
         return this.pojo.getEmailComments();
     }
@@ -368,20 +371,7 @@ public final class WeblogWrapper {
     public WeblogBookmarkFolderWrapper getBookmarkFolder(String folderName) {
         return WeblogBookmarkFolderWrapper.wrap(this.pojo.getBookmarkFolder(folderName));
     }
-    
-    
-    public List<WeblogReferrerWrapper> getTodaysReferrers() {
-        List<WeblogReferrer> unwrapped = this.pojo.getTodaysReferrers();
-        List<WeblogReferrerWrapper> wrapped = new ArrayList<WeblogReferrerWrapper>(unwrapped.size());
-        int i = 0;
-        for (WeblogReferrer referrer : unwrapped) {
-            wrapped.add(i,WeblogReferrerWrapper.wrap(referrer, urlStrategy));
-            i++;
-        }
-        return wrapped;
-    }
-    
-    
+
     public int getTodaysHits() {
         return this.pojo.getTodaysHits();
     }

Propchange: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/
------------------------------------------------------------------------------
  Merged /roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui:r1588767-1601252

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/security/RollerUserDetailsService.java Sun Jun  8 20:23:32 2014
@@ -53,7 +53,7 @@ public class RollerUserDetailsService im
                 }
                 String name;
                 String password;
-                ArrayList<SimpleGrantedAuthority> authorities;
+                List<SimpleGrantedAuthority> authorities;
                 
                 // We are not throwing UsernameNotFound exception in case of 
                 // openid authentication in order to receive OpenID Simple Registration (SREG)
@@ -81,7 +81,7 @@ public class RollerUserDetailsService im
                 if (userData == null) {
                     throw new UsernameNotFoundException("ERROR no user: " + userName);
                 }
-                ArrayList<SimpleGrantedAuthority> authorities =  getAuthorities(userData, umgr);
+                List<SimpleGrantedAuthority> authorities =  getAuthorities(userData, umgr);
                 return new org.springframework.security.core.userdetails.User(userData.getUserName(), userData.getPassword(),
                         true, true, true, true, authorities);
             }            
@@ -92,9 +92,9 @@ public class RollerUserDetailsService im
 
     }
         
-     private ArrayList<SimpleGrantedAuthority> getAuthorities(User userData, UserManager umgr) throws WebloggerException {
+     private List<SimpleGrantedAuthority> getAuthorities(User userData, UserManager umgr) throws WebloggerException {
          List<String> roles = umgr.getRoles(userData);
-         ArrayList<SimpleGrantedAuthority> authorities = new ArrayList<SimpleGrantedAuthority>(roles.size());
+         List<SimpleGrantedAuthority> authorities = new ArrayList<SimpleGrantedAuthority>(roles.size());
          for (String role : roles) {
              authorities.add(new SimpleGrantedAuthority(role));
          }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/core/util/menu/MenuHelper.java Sun Jun  8 20:23:32 2014
@@ -23,6 +23,7 @@ import java.io.InputStream;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.commons.logging.Log;
@@ -52,10 +53,10 @@ public final class MenuHelper {
 
     private static Log log = LogFactory.getLog(MenuHelper.class);
 
-    private static HashMap<String, ParsedMenu> menus = new HashMap<String, ParsedMenu>();
+    private static Map<String, ParsedMenu> menus = new HashMap<String, ParsedMenu>();
 
     // menu, menuName, tabName action/subaction check
-    private static HashMap<String, HashMap<String, HashSet<String>>> itemMenu = new HashMap<String, HashMap<String, HashSet<String>>>();
+    private static Map<String, HashMap<String, HashSet<String>>> itemMenu = new HashMap<String, HashMap<String, HashSet<String>>>();
 
     private MenuHelper() {
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/ConfigModel.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/ConfigModel.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/ConfigModel.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/ConfigModel.java Sun Jun  8 20:23:32 2014
@@ -64,7 +64,7 @@ public class ConfigModel implements Mode
     public String getRegistrationURL() {
         return getProperty("users.registration.url");
     }
-    
+
     public boolean getFeedHistoryEnabled() {
         return getBooleanProperty("site.newsfeeds.history.enabled");
     }
@@ -120,8 +120,15 @@ public class ConfigModel implements Mode
     public String getRollerBuildUser() {
         return WebloggerFactory.getWeblogger().getBuildUser();
     }
-    
-    
+
+    public String getDefaultAnalyticsTrackingCode() {
+        return getProperty("analytics.default.tracking.code");
+    }
+
+    public boolean getAnalyticsOverrideAllowed() {
+        return getBooleanProperty("analytics.code.override.allowed");
+    }
+
     private String getProperty(String name) {
         return WebloggerRuntimeConfig.getProperty(name);
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/SearchResultsModel.java Sun Jun  8 20:23:32 2014
@@ -66,7 +66,7 @@ public class SearchResultsModel extends 
 	private URLStrategy urlStrategy = null;
 
 	// the actual search results mapped by Day -> Set of entries
-	private TreeMap<Date, TreeSet<WeblogEntryWrapper>> results
+	private Map<Date, TreeSet<WeblogEntryWrapper>> results
             = new TreeMap<Date, TreeSet<WeblogEntryWrapper>>(new ReverseComparator());
 
 	// the pager used by the 3.0+ rendering system
@@ -270,7 +270,7 @@ public class SearchResultsModel extends 
 		return limit;
 	}
 
-	public TreeMap getResults() {
+	public Map getResults() {
 		return results;
 	}
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/UtilitiesModel.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/UtilitiesModel.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/UtilitiesModel.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/model/UtilitiesModel.java Sun Jun  8 20:23:32 2014
@@ -215,6 +215,7 @@ public class UtilitiesModel implements M
     
     //------------------------------------------------------------ String utils
     
+    // isEmpty = empty (size = 0) or null
     public boolean isEmpty(String str) {
         return StringUtils.isEmpty(str);
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java Sun Jun  8 20:23:32 2014
@@ -26,8 +26,6 @@ import org.apache.roller.weblogger.Weblo
 import org.apache.roller.weblogger.business.HitCountQueue;
 import org.apache.roller.weblogger.business.WeblogEntryManager;
 import org.apache.roller.weblogger.business.WebloggerFactory;
-import org.apache.roller.weblogger.business.referrers.IncomingReferrer;
-import org.apache.roller.weblogger.business.referrers.ReferrerQueueManager;
 import org.apache.roller.weblogger.business.themes.ThemeManager;
 import org.apache.roller.weblogger.config.WebloggerConfig;
 import org.apache.roller.weblogger.config.WebloggerRuntimeConfig;
@@ -98,11 +96,11 @@ public class PageServlet extends HttpSer
         // get a reference to the site wide cache
         this.siteWideCache = SiteWideCache.getInstance();
 
-        // see if built-in referrer processing is enabled
+        // see if built-in referrer spam check is enabled
         this.processReferrers = WebloggerConfig
-                .getBooleanProperty("referrers.processing.enabled");
+                .getBooleanProperty("site.blacklist.enable.referrers");
 
-        log.info("Referrer processing enabled = " + this.processReferrers);
+        log.info("Referrer spam check enabled = " + this.processReferrers);
 
         // check for possible robot pattern
         String robotPatternStr = WebloggerConfig
@@ -659,22 +657,6 @@ public class PageServlet extends HttpSer
             }
         }
 
-        // referrer is valid, lets record it
-        try {
-            IncomingReferrer referrer = new IncomingReferrer();
-            referrer.setReferrerUrl(referrerUrl);
-            referrer.setRequestUrl(requestUrl);
-            referrer.setWeblogHandle(pageRequest.getWeblogHandle());
-            referrer.setWeblogAnchor(pageRequest.getWeblogAnchor());
-            referrer.setWeblogDateString(pageRequest.getWeblogDate());
-
-            ReferrerQueueManager refQueue = WebloggerFactory.getWeblogger()
-                    .getReferrerQueueManager();
-            refQueue.processReferrer(referrer);
-        } catch (Exception e) {
-            log.error("Error processing referrer", e);
-        }
-
         return false;
     }
 }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/servlets/TrackbackServlet.java Sun Jun  8 20:23:32 2014
@@ -96,7 +96,6 @@ public class TrackbackServlet extends Ht
         
         WeblogTrackbackRequest trackbackRequest = null;
         if (!WebloggerRuntimeConfig.getBooleanProperty("users.trackbacks.enabled")) {
-            // TODO: i18n
             error = "Trackbacks are disabled for this site";
         } else {
             
@@ -202,10 +201,8 @@ public class TrackbackServlet extends Ht
                 }
                 
             } else if (entry!=null) {
-                // TODO: i18n
-                error = "Comments and Trackbacks are disabled for the entry you specified.";
+                error = "Comments and Trackbacks are disabled for the entry specified.";
             } else {
-                // TODO: i18n
                 error = "Entry not specified.";
             }
             

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/util/cache/SiteWideCache.java Sun Jun  8 20:23:32 2014
@@ -34,7 +34,6 @@ import org.apache.roller.weblogger.confi
 import org.apache.roller.weblogger.pojos.WeblogBookmark;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
 import org.apache.roller.weblogger.pojos.WeblogBookmarkFolder;
-import org.apache.roller.weblogger.pojos.WeblogReferrer;
 import org.apache.roller.weblogger.pojos.User;
 import org.apache.roller.weblogger.pojos.WeblogCategory;
 import org.apache.roller.weblogger.pojos.WeblogEntry;
@@ -52,7 +51,7 @@ import org.apache.roller.weblogger.util.
 /**
  * Cache for site-wide weblog content.
  */
-public class SiteWideCache implements CacheHandler {
+public final class SiteWideCache implements CacheHandler {
     
     private static Log log = LogFactory.getLog(SiteWideCache.class);
     
@@ -66,8 +65,7 @@ public class SiteWideCache implements Ca
     
     // keep a cached version of last expired time
     private ExpiringCacheEntry lastUpdateTime = null;
-    private long timeout = RollerConstants.FIFTEEN_MIN_IN_MS;
-    
+
     // reference to our singleton instance
     private static SiteWideCache singletonInstance = new SiteWideCache();
     
@@ -169,7 +167,7 @@ public class SiteWideCache implements Ca
         // still null, we need to get a fresh value
         if(lastModified == null) {
             lastModified = new Date();
-            this.lastUpdateTime = new ExpiringCacheEntry(lastModified, this.timeout);
+            this.lastUpdateTime = new ExpiringCacheEntry(lastModified, RollerConstants.FIFTEEN_MIN_IN_MS);
         }
         
         return lastModified;
@@ -287,7 +285,7 @@ public class SiteWideCache implements Ca
         
         StringBuilder key = new StringBuilder();
         
-        key.append(this.CACHE_ID).append(":");
+        key.append(CACHE_ID).append(":");
         key.append("feed/");
         key.append(feedRequest.getWeblogHandle());
         
@@ -386,14 +384,6 @@ public class SiteWideCache implements Ca
     
     
     /**
-     * A referer has changed.
-     */
-    public void invalidate(WeblogReferrer referer) {
-        // ignored
-    }
-    
-    
-    /**
      * A user profile has changed.
      */
     public void invalidate(User user) {

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/WebappResourceLoader.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/WebappResourceLoader.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/WebappResourceLoader.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/rendering/velocity/WebappResourceLoader.java Sun Jun  8 20:23:32 2014
@@ -21,6 +21,7 @@ package org.apache.roller.weblogger.ui.r
 import java.io.File;
 import java.io.InputStream;
 import java.util.HashMap;
+import java.util.Map;
 
 import javax.servlet.ServletContext;
 
@@ -62,7 +63,7 @@ public class WebappResourceLoader extend
 
 	// The root paths for templates (relative to webapp's root).
 	protected String[] paths = null;
-	protected HashMap<String, String> templatePaths = null;
+	protected Map<String, String> templatePaths = null;
 	protected ServletContext servletContext = null;
 
 	/**
@@ -148,21 +149,16 @@ public class WebappResourceLoader extend
 		}
 
 		if (result == null) {
-
-			for (int i = 0; i < paths.length; i++) {
-
-				String path = paths[i] + split[0];
-
+            for (String pathSegment : paths) {
+				String path = pathSegment + split[0];
 				try {
-
 					result = servletContext.getResourceAsStream(path);
 
 					// save the path and exit the loop if we found the template
 					if (result != null) {
-						templatePaths.put(name, paths[i]);
+						templatePaths.put(name, pathSegment);
 						break;
 					}
-
 				} catch (NullPointerException npe) {
 					// no servletContext was set, whine about it!
 					throw npe;
@@ -255,8 +251,8 @@ public class WebappResourceLoader extend
 		 * found in the previously saved path
 		 */
 		File currentFile = null;
-		for (int i = 0; i < paths.length; i++) {
-			currentFile = new File(rootPath + paths[i], fileName);
+		for (String path : paths) {
+			currentFile = new File(rootPath + path, fileName);
 			if (currentFile.canRead()) {
 				/*
 				 * stop at the first resource found (just like in

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/CreateUser.java Sun Jun  8 20:23:32 2014
@@ -113,16 +113,13 @@ public class CreateUser extends UIAction
                 mgr.addUser(newUser);
                 WebloggerFactory.getWeblogger().flush();
 
-                // TODO: i18n
-                addMessage("User " + getBean().getUserName() + " created.  If desired, create another new user below or" +
-                        " select Cancel to return to User Administration.");
+                addMessage("createUser.add.success", getBean().getUserName());
                 setBean(new CreateUserBean());
                 initializeBean();
                 return INPUT;
             } catch (WebloggerException e) {
                 log.error("Error adding new user", e);
-                // TODO: i18n
-                addError("Error creating user");
+                addError("Error creating user -- see Roller logs for more details");
             }
         }
         

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/admin/GlobalConfig.java Sun Jun  8 20:23:32 2014
@@ -102,7 +102,6 @@ public class GlobalConfig extends UIActi
             setProperties(mgr.getProperties());
         } catch (WebloggerException ex) {
             log.error("Error getting runtime properties map", ex);
-            // TODO: i18n
             addError("Unexpected error accessing Roller properties");
         }
         
@@ -206,7 +205,6 @@ public class GlobalConfig extends UIActi
             
         } catch (WebloggerException ex) {
             log.error("Error saving roller properties", ex);
-            // TODO: i18n
             addError("error.update.rollerConfig");
         }
                 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetAddBase.java Sun Jun  8 20:23:32 2014
@@ -71,8 +71,7 @@ public abstract class PingTargetAddBase 
 
             } catch (WebloggerException ex) {
                 getLogger().error("Error adding ping target", ex);
-                // TODO: i18n
-                addError("Error adding ping target.");
+                addError("pingTarget.saved.error");
             }
         }
         
@@ -98,7 +97,6 @@ public abstract class PingTargetAddBase 
             }
         } catch (WebloggerException ex) {
             getLogger().error("Error validating ping target", ex);
-            // TODO: i18n
             addError("Error doing ping target validation");
         }
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/common/PingTargetEditBase.java Sun Jun  8 20:23:32 2014
@@ -110,8 +110,7 @@ public abstract class PingTargetEditBase
                 addMessage("pingTarget.saved");
             } catch (WebloggerException ex) {
                 getLogger().error("Error saving ping target", ex);
-                // TODO: i18n
-                addError("Error saving ping target.");
+                addError("pingTarget.saved.error");
             }
         }
         
@@ -137,8 +136,7 @@ public abstract class PingTargetEditBase
             }
         } catch (WebloggerException ex) {
             getLogger().error("Error validating ping target", ex);
-            // TODO: i18n
-            addError("Error doing ping target validation");
+            addError("pingTarget.saved.error");
         }
     }
     

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/CreateWeblog.java Sun Jun  8 20:23:32 2014
@@ -71,8 +71,7 @@ public class CreateWeblog extends UIActi
                 if (permissions.size() > 0) {
                     // sneaky user trying to get around 1 blog limit that applies
                     // only when group blogging is disabled
-                    // TODO: i18n
-                    addError("Sorry, you are only allowed to have 1 weblog.");
+                    addError("createWebsite.oneBlogLimit");
                     return "menu";
                 }
             }
@@ -99,8 +98,7 @@ public class CreateWeblog extends UIActi
                 if (permissions.size() > 0) {
                     // sneaky user trying to get around 1 blog limit that applies
                     // only when group blogging is disabled
-                    // TODO: i18n
-                    addError("Sorry, you are only allowed to have 1 weblog.");
+                    addError("createWebsite.oneBlogLimit");
                     return "menu";
                 }
             }
@@ -176,8 +174,7 @@ public class CreateWeblog extends UIActi
                 }
             } catch (WebloggerException ex) {
                 log.error("error checking for weblog", ex);
-                // TODO: i18n
-                addError("unexpected error");
+                addError("Unexpected error validating weblog -- check Roller logs");
             }
         }
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Profile.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Profile.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Profile.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Profile.java Sun Jun  8 20:23:32 2014
@@ -126,16 +126,13 @@ public class Profile extends UIAction {
                 // save the updated profile
                 mgr.saveUser(existingUser);
                 WebloggerFactory.getWeblogger().flush();
-
-                // TODO: i18n
-                addMessage("profile updated.");
+                addMessage("yourProfile.saved");
 
                 return SUCCESS;
 
             } catch (WebloggerException ex) {
                 log.error("ERROR in action", ex);
-                // TODO: i18n
-                addError("unexpected error doing profile save");
+                addError("Unexpected error doing profile save");
             }
 
         }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Register.java Sun Jun  8 20:23:32 2014
@@ -267,7 +267,6 @@ public class Register extends UIAction i
 
             } catch (WebloggerException ex) {
                 log.error("Error adding new user", ex);
-                // TODO: i18n
                 addError("Error adding new user");
             }
         }
@@ -388,8 +387,7 @@ public class Register extends UIAction i
                 }
             } catch (WebloggerException ex) {
                 log.error("error checking for user", ex);
-                // TODO: i18n
-                addError("unexpected error");
+                addError("Unexpected error checking user -- check Roller logs");
             }
         }
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkAdd.java Sun Jun  8 20:23:32 2014
@@ -82,7 +82,6 @@ public class BookmarkAdd extends UIActio
     public String execute() {
         
         if(getFolder() == null) {
-            // TODO: i18n
             addError("Cannot add bookmark to null folder");
             return ERROR;
         }
@@ -94,7 +93,6 @@ public class BookmarkAdd extends UIActio
     public String save() {
         
         if(getFolder() == null) {
-            // TODO: i18n
             addError("Cannot add bookmark to null folder");
             return ERROR;
         }
@@ -126,8 +124,7 @@ public class BookmarkAdd extends UIActio
 
             } catch(Exception ex) {
                 log.error("Error saving new bookmark", ex);
-                // TODO: i18n
-                addError("Error saving new bookmark");
+                addError("bookmarkForm.error.saving");
             }
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkEdit.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkEdit.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarkEdit.java Sun Jun  8 20:23:32 2014
@@ -81,7 +81,6 @@ public class BookmarkEdit extends UIActi
     public String execute() {
         
         if(getBookmark() == null) {
-            // TODO: i18n
             addError("Cannot edit null bookmark");
             return ERROR;
         }
@@ -96,7 +95,6 @@ public class BookmarkEdit extends UIActi
     public String save() {
         
         if(getBookmark() == null) {
-            // TODO: i18n
             addError("Cannot edit null bookmark");
             return ERROR;
         }
@@ -118,8 +116,7 @@ public class BookmarkEdit extends UIActi
 
             } catch(Exception ex) {
                 log.error("Error saving bookmark", ex);
-                // TODO: i18n
-                addError("Error saving bookmark");
+                addError("bookmarkForm.error.saving");
             }
         }
         

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/BookmarksImport.java Sun Jun  8 20:23:32 2014
@@ -131,7 +131,6 @@ public final class BookmarksImport exten
                 }
             } catch (Exception ex) {
                 log.error("ERROR: importing bookmarks", ex);
-                // TODO: i18n
                 addError("bookmarksImport.error", ex.toString());
             } finally {
                 if (stream != null) {

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryAdd.java Sun Jun  8 20:23:32 2014
@@ -92,8 +92,7 @@ public class CategoryAdd extends UIActio
 
             } catch(Exception ex) {
                 log.error("Error saving new category", ex);
-                // TODO: i18n
-                addError("Error saving new category");
+                addError("categoryForm.error.saving");
             }
         }
         

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryEdit.java Sun Jun  8 20:23:32 2014
@@ -79,7 +79,6 @@ public class CategoryEdit extends UIActi
     public String execute() {
         
         if (getCategory() == null) {
-            // TODO: i18n
             addError("Cannot edit null category");
             return ERROR;
         }
@@ -97,7 +96,6 @@ public class CategoryEdit extends UIActi
     public String save() {
         
         if(getCategory() == null) {
-            // TODO: i18n
             addError("Cannot edit null category");
             return ERROR;
         }
@@ -122,8 +120,7 @@ public class CategoryEdit extends UIActi
 
             } catch(Exception ex) {
                 log.error("Error saving category", ex);
-                // TODO: i18n
-                addError("Error saving category");
+                addError("categoryForm.error.saving");
             }
         }
         

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/CategoryRemove.java Sun Jun  8 20:23:32 2014
@@ -127,7 +127,6 @@ public class CategoryRemove extends UIAc
 
             } catch(Exception ex) {
                 log.error("Error removing category - "+getRemoveId(), ex);
-                // TODO: i18n
                 addError("Error removing category");
             }
         }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Comments.java Sun Jun  8 20:23:32 2014
@@ -128,7 +128,6 @@ public class Comments extends UIAction {
             }
         } catch (WebloggerException ex) {
             log.error("Error looking up comments", ex);
-            // TODO: i18n
             addError("Error looking up comments");
         }
 
@@ -211,7 +210,6 @@ public class Comments extends UIAction {
 
         } catch (WebloggerException ex) {
             log.error("Error looking up comments", ex);
-            // TODO: i18n
             addError("Error looking up comments");
         }
 
@@ -270,7 +268,6 @@ public class Comments extends UIAction {
 
         } catch (WebloggerException ex) {
             log.error("Error doing bulk delete", ex);
-            // TODO: i18n
             addError("Bulk delete failed due to unexpected error");
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Entries.java Sun Jun  8 20:23:32 2014
@@ -113,7 +113,6 @@ public class Entries extends UIAction {
             }
         } catch (WebloggerException ex) {
             log.error("Error looking up entries", ex);
-            // TODO: i18n
             addError("Error looking up entries");
         }
         

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryAdd.java Sun Jun  8 20:23:32 2014
@@ -217,8 +217,7 @@ public final class EntryAdd extends Entr
 
             } catch (Exception e) {
                 log.error("Error saving new entry", e);
-                // TODO: i18n
-                addError("Error saving new entry");
+                addError("weblogEdit.error.saving");
             }
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryEdit.java Sun Jun  8 20:23:32 2014
@@ -247,8 +247,7 @@ public final class EntryEdit extends Ent
 
             } catch (Exception e) {
                 log.error("Error saving new entry", e);
-                // TODO: i18n
-                addError("Error saving new entry");
+                addError("weblogEdit.error.saving");
             }
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/EntryRemove.java Sun Jun  8 20:23:32 2014
@@ -107,7 +107,6 @@ public class EntryRemove extends EntryBa
 
 			} catch (Exception e) {
 				log.error("Error removing entry " + getRemoveId(), e);
-				// TODO: i18n
 				addError("Error removing entry");
 			}
         } else {

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderAdd.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderAdd.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderAdd.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderAdd.java Sun Jun  8 20:23:32 2014
@@ -82,8 +82,7 @@ public class FolderAdd extends UIAction 
                 // notify caches
                 CacheManager.invalidate(newFolder);
 
-                // TODO: i18n
-                addMessage("folder added");
+                addMessage("folderForm.add.success");
 
                 // Set for next action
                 getBean().setId(newFolder.getId());

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/FolderEdit.java Sun Jun  8 20:23:32 2014
@@ -123,8 +123,7 @@ public class FolderEdit extends UIAction
                 // notify caches
                 CacheManager.invalidate(getFolder());
 
-                // TODO: i18n
-                addMessage("folder updated");
+                addMessage("folderForm.update.success");
 
             } catch(Exception ex) {
                 log.error("Error saving folder", ex);

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Maintenance.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Maintenance.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Maintenance.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Maintenance.java Sun Jun  8 20:23:32 2014
@@ -69,8 +69,7 @@ public class Maintenance extends UIActio
             addMessage("maintenance.message.indexed");
         } catch (Exception ex) {
             log.error("Error doing index rebuild", ex);
-            // TODO: i18n
-            addError("Error rebuilding search index");
+            addError("maintenance.message.indexed.failure");
         }
         
         return SUCCESS;
@@ -98,7 +97,6 @@ public class Maintenance extends UIActio
             
         } catch (Exception ex) {
             log.error("Error saving weblog - "+getActionWeblog().getHandle(), ex);
-            // TODO: i18n
             addError("Error flushing page cache");
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileAdd.java Sun Jun  8 20:23:32 2014
@@ -61,7 +61,7 @@ public class MediaFileAdd extends MediaF
 
     private List<MediaFile> newFiles = new ArrayList<MediaFile>();
 
-    private String directoryPath = null;
+    private String directoryName = null;
 
     public MediaFileAdd() {
         this.actionName = "mediaFileAdd";
@@ -81,19 +81,19 @@ public class MediaFileAdd extends MediaF
             if (!StringUtils.isEmpty(bean.getDirectoryId())) {
                 setDirectory(mgr.getMediaFileDirectory(bean.getDirectoryId()));
 
-            } else if (StringUtils.isNotEmpty(directoryPath)) {
-                setDirectory(mgr.getMediaFileDirectoryByPath(getActionWeblog(),
-                        directoryPath));
+            } else if (StringUtils.isNotEmpty(directoryName)) {
+                setDirectory(mgr.getMediaFileDirectoryByName(getActionWeblog(),
+                        directoryName));
 
             } else {
                 MediaFileDirectory root = mgr
-                        .getMediaFileRootDirectory(getActionWeblog());
+                        .getDefaultMediaFileDirectory(getActionWeblog());
                 if (root == null) {
-                    root = mgr.createRootMediaFileDirectory(getActionWeblog());
+                    root = mgr.createDefaultMediaFileDirectory(getActionWeblog());
                 }
                 setDirectory(root);
             }
-            directoryPath = getDirectory().getPath();
+            directoryName = getDirectory().getName();
             bean.setDirectoryId(getDirectory().getId());
 
         } catch (WebloggerException ex) {
@@ -207,7 +207,6 @@ public class MediaFileAdd extends MediaF
 
                     } catch (Exception e) {
                         log.error("Error uploading media file", e);
-                        // TODO: i18n
                         addError("mediaFileAdd.errorUploading", bean.getName());
                     }
                 }
@@ -321,17 +320,17 @@ public class MediaFileAdd extends MediaF
     }
 
     /**
-     * @return the directoryPath
+     * @return the directoryName
      */
-    public String getDirectoryPath() {
-        return directoryPath;
+    public String getDirectoryName() {
+        return directoryName;
     }
 
     /**
-     * @param directoryPath
-     *            the directoryPath to set
+     * @param directoryName
+     *            the directoryName to set
      */
-    public void setDirectoryPath(String directoryPath) {
-        this.directoryPath = directoryPath;
+    public void setDirectoryName(String directoryName) {
+        this.directoryName = directoryName;
     }
 }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileBase.java Sun Jun  8 20:23:32 2014
@@ -112,20 +112,6 @@ public class MediaFileBase extends UIAct
                 }
             }
 
-            if (dirIds != null && dirIds.length > 0) {
-                log.debug("Processing delete of " + dirIds.length
-                        + " media directories.");
-                manager = WebloggerFactory.getWeblogger().getMediaFileManager();
-                for (String dirId : dirIds) {
-                    log.debug("Deleting media file directory - " + dirId);
-                    MediaFileDirectory mediaFileDir = manager.getMediaFileDirectory(dirId);
-                    if (mediaFileDir != null) {
-                        mediaFileDir.getParent().removeChildDirectory(mediaFileDir);
-                        manager.removeMediaFileDirectory(mediaFileDir);
-                    }
-                }
-                refreshAllDirectories();
-            }
             WebloggerFactory.getWeblogger().getWeblogManager()
                     .saveWeblog(this.getActionWeblog());
 
@@ -167,34 +153,11 @@ public class MediaFileBase extends UIAct
                 }
             }
 
-            int movedDirs = 0;
-            if (dirIds != null && dirIds.length > 0) {
-                log.debug("Processing move of " + dirIds.length
-                        + " media files directories.");
-                MediaFileDirectory targetDirectory = manager
-                        .getMediaFileDirectory(this.selectedDirectory);
-                for (String dirId : dirIds) {
-                    log.debug("Moving media file - " + dirId
-                            + " to directory - " + this.selectedDirectory);
-                    MediaFileDirectory mediaFileDir = manager
-                            .getMediaFileDirectory(dirId);
-                    if (mediaFileDir != null
-                            && !mediaFileDir.getId().equals(targetDirectory.getId())
-                            && !mediaFileDir.getParent().getId().equals(targetDirectory.getId())) {
-                        manager.moveMediaFileDirectory(mediaFileDir,targetDirectory);
-                        movedDirs++;
-                    }
-                }
-            }
-
             // flush changes
             WebloggerFactory.getWeblogger().flush();
             WebloggerFactory.getWeblogger().release();
-            if (movedFiles > 0 || movedDirs > 0) {
+            if (movedFiles > 0) {
                 addMessage("mediaFile.move.success");
-                if (movedDirs > 0) {
-                    refreshAllDirectories();
-                }
             }
 
         } catch (WebloggerException e) {
@@ -214,7 +177,7 @@ public class MediaFileBase extends UIAct
             List<MediaFileDirectory> sortedDirList = new ArrayList<MediaFileDirectory>();
             sortedDirList.addAll(directories);
             Collections.sort(sortedDirList, new MediaFileDirectoryComparator(
-                    DirectoryComparatorType.PATH));
+                    DirectoryComparatorType.NAME));
             setAllDirectories(sortedDirList);
         } catch (WebloggerException ex) {
             log.error("Error looking up media file directories", ex);

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileImageChooser.java Sun Jun  8 20:23:32 2014
@@ -43,11 +43,11 @@ public class MediaFileImageChooser exten
     private static Log log = LogFactory.getLog(MediaFileImageChooser.class);
 
     private String directoryId;
-    private String directoryPath;
+    private String directoryName;
 
     private List<MediaFile>          childFiles;
     private MediaFileDirectory       currentDirectory;
-    private List<MediaFileDirectory> childDirectories;
+
 
     public MediaFileImageChooser() {
         this.actionName = "mediaFileImageChooser";
@@ -75,17 +75,14 @@ public class MediaFileImageChooser exten
             MediaFileDirectory directory;
             if (this.directoryId != null) {
                 directory = manager.getMediaFileDirectory(this.directoryId);
-            } else if (this.directoryPath != null) {
-                directory = manager.getMediaFileDirectoryByPath(getActionWeblog(), this.directoryPath);
+            } else if (this.directoryName != null) {
+                directory = manager.getMediaFileDirectoryByName(getActionWeblog(), this.directoryName);
                 this.directoryId = directory.getId();
             } else {
-                directory = manager.getMediaFileRootDirectory(getActionWeblog());
+                directory = manager.getDefaultMediaFileDirectory(getActionWeblog());
                 this.directoryId = directory.getId();
             }
 
-            this.childDirectories = new ArrayList<MediaFileDirectory>();
-            this.childDirectories.addAll(directory.getChildDirectories());
-
             this.childFiles = new ArrayList<MediaFile>();
 
             // only add image files
@@ -95,8 +92,6 @@ public class MediaFileImageChooser exten
                 }
             }
 
-            Collections.sort(this.childDirectories,
-                    new MediaFileDirectoryComparator(DirectoryComparatorType.NAME));
             Collections.sort(this.childFiles,
                     new MediaFileComparator(MediaFileComparatorType.NAME));
 
@@ -122,8 +117,7 @@ public class MediaFileImageChooser exten
     public List<KeyValueObject> getCurrentDirectoryHierarchy() {
         List<KeyValueObject> directoryHierarchy = new ArrayList<KeyValueObject>();
 
-        directoryHierarchy.add(new KeyValueObject("/", "root"));
-        String fullPath = this.currentDirectory.getPath();
+        String fullPath = "/" + this.currentDirectory.getName();
         if (fullPath.length() > 1) {
             String[] directoryNames = fullPath.substring(1).split("/");
             String dirPath = "";
@@ -150,17 +144,17 @@ public class MediaFileImageChooser exten
     }
 
     /**
-     * @return the directoryPath
+     * @return the directory name
      */
-    public String getDirectoryPath() {
-        return directoryPath;
+    public String getDirectoryName() {
+        return directoryName;
     }
 
     /**
-     * @param directoryPath the directoryPath to set
+     * @param directoryName the directoryName to set
      */
-    public void setDirectoryPath(String directoryPath) {
-        this.directoryPath = directoryPath;
+    public void setDirectoryName(String directoryName) {
+        this.directoryName = directoryName;
     }
 
     /**
@@ -191,17 +185,4 @@ public class MediaFileImageChooser exten
         this.currentDirectory = currentDirectory;
     }
 
-    /**
-     * @return the childDirectories
-     */
-    public List<MediaFileDirectory> getChildDirectories() {
-        return childDirectories;
-    }
-
-    /**
-     * @param childDirectories the childDirectories to set
-     */
-    public void setChildDirectories(List<MediaFileDirectory> childDirectories) {
-        this.childDirectories = childDirectories;
-    }
 }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MediaFileView.java Sun Jun  8 20:23:32 2014
@@ -38,6 +38,7 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.pojos.MediaFileFilter;
 import org.apache.roller.weblogger.ui.struts2.pagers.MediaFilePager;
 import org.apache.roller.weblogger.ui.struts2.util.KeyValueObject;
+import org.apache.roller.weblogger.util.cache.CacheManager;
 import org.apache.struts2.interceptor.validation.SkipValidation;
 
 /**
@@ -49,14 +50,13 @@ public class MediaFileView extends Media
     private static Log log = LogFactory.getLog(MediaFileView.class);
 
     private String directoryId;
-    private String directoryPath;
+    private String directoryName;
     private String sortBy;
     private String newDirectoryName;
     
     private List<MediaFile>          childFiles;
     private MediaFileDirectory       currentDirectory;
-    private List<MediaFileDirectory> childDirectories;
-    
+
 
     // Search criteria - drop-down for file type
     private static List<KeyValueObject> FILE_TYPES = null;
@@ -76,6 +76,9 @@ public class MediaFileView extends Media
     // Path of new directory to be created.
     private String newDirectoryPath;
 
+    // a new directory the user wishes to view
+    private String viewDirectoryId = null;
+
     private MediaFileSearchBean bean = new MediaFileSearchBean();
 
 
@@ -120,7 +123,7 @@ public class MediaFileView extends Media
     }
 
     /**
-     * Create a new directory by name under current directory
+     * Create a new directory by name.  All folders placed at the root.
      */
     public String createNewDirectory() {
         boolean dirCreated = false;
@@ -132,16 +135,14 @@ public class MediaFileView extends Media
             try {
                 log.debug("Creating new directory - " + this.newDirectoryName);
                 MediaFileManager manager = WebloggerFactory.getWeblogger().getMediaFileManager();
-                MediaFileDirectory parentDirectory = manager.getMediaFileDirectory(this.directoryId);
-                manager.createMediaFileDirectory(parentDirectory, this.newDirectoryName);
+                manager.createMediaFileDirectory(getActionWeblog(), this.newDirectoryName);
                 // flush changes
                 WebloggerFactory.getWeblogger().flush();
                 addMessage("mediaFile.directoryCreate.success");
                 dirCreated = true;
             } catch (WebloggerException e) {
-                log.error("Error creating new directory by path", e);
-                // TODO: i18n
-                addError("Error creating new directory by path");
+                log.error("Error creating new directory", e);
+                addError("Error creating new directory");
             }
         }
 
@@ -176,17 +177,14 @@ public class MediaFileView extends Media
             if (StringUtils.isNotEmpty(this.directoryId)) {
                 directory = manager.getMediaFileDirectory(this.directoryId);
 
-            } else if (StringUtils.isNotEmpty(this.directoryPath)) {
-                directory = manager.getMediaFileDirectoryByPath(getActionWeblog(), this.directoryPath);
+            } else if (StringUtils.isNotEmpty(this.directoryName)) {
+                directory = manager.getMediaFileDirectoryByName(getActionWeblog(), this.directoryName);
 
             } else {
-                directory = manager.getMediaFileRootDirectory(getActionWeblog());
+                directory = manager.getDefaultMediaFileDirectory(getActionWeblog());
             }
             this.directoryId = directory.getId();
-            this.directoryPath = directory.getPath();
-
-            this.childDirectories = new ArrayList<MediaFileDirectory>();
-            this.childDirectories.addAll(directory.getChildDirectories());
+            this.directoryName = directory.getName();
 
             this.childFiles = new ArrayList<MediaFile>();
             this.childFiles.addAll(directory.getMediaFiles());
@@ -202,8 +200,6 @@ public class MediaFileView extends Media
             } else {
                 // default to sort by name
                 sortBy = "name";
-                Collections.sort(this.childDirectories,
-                    new MediaFileDirectoryComparator(DirectoryComparatorType.NAME));
                 Collections.sort(this.childFiles,
                     new MediaFileComparator(MediaFileComparatorType.NAME));
             }
@@ -223,6 +219,22 @@ public class MediaFileView extends Media
     }
 
     /**
+     * View the contents of another Media folder.
+     */
+    public String view() {
+        try {
+            MediaFileManager manager = WebloggerFactory.getWeblogger().getMediaFileManager();
+            if (!StringUtils.isEmpty(viewDirectoryId)) {
+                setDirectoryId(viewDirectoryId);
+                setCurrentDirectory(manager.getMediaFileDirectory(viewDirectoryId));
+            }
+        } catch (WebloggerException ex) {
+            log.error("Error looking up directory", ex);
+        }
+        return execute();
+    }
+
+    /**
      * Save a media file.
      *
      * @return String The result of the action.
@@ -249,8 +261,7 @@ public class MediaFileView extends Media
                 
             } catch (Exception e) {
                 log.error("Error applying search criteria", e);
-                // TODO: i18n
-                addError("Error applying search criteria");
+                addError("Error applying search criteria - check Roller logs");
             }
 
         }
@@ -259,26 +270,6 @@ public class MediaFileView extends Media
     }
 
     /**
-     * Returns the hierarchy of the current directory. This is useful in
-     * displaying path information as breadcrumb.
-     */
-    public List<KeyValueObject> getCurrentDirectoryHierarchy() {
-        List<KeyValueObject> directoryHierarchy = new ArrayList<KeyValueObject>();
-
-        directoryHierarchy.add(new KeyValueObject("/", "root"));
-        String fullPath = this.currentDirectory.getPath();
-        String dpath = "";
-        if (fullPath.length() > 1) {
-            String[] directoryNames = fullPath.substring(1).split("/");
-            for (String directoryName : directoryNames) {
-                dpath = dpath + "/" + directoryName;
-                directoryHierarchy.add(new KeyValueObject(dpath, directoryName));
-            }
-        }
-        return directoryHierarchy;
-    }
-
-    /**
      * Delete selected media files.
      * 
      */
@@ -297,6 +288,42 @@ public class MediaFileView extends Media
     }
 
     /**
+     * Delete folder
+     */
+    public String deleteFolder() {
+
+        try {
+            MediaFileManager manager = WebloggerFactory.getWeblogger().getMediaFileManager();
+            if (directoryId != null) {
+                log.debug("Deleting media file folder - " + directoryId + " (" + directoryName + ")");
+                MediaFileDirectory mediaFileDir = manager.getMediaFileDirectory(directoryId);
+                manager.removeMediaFileDirectory(mediaFileDir);
+                refreshAllDirectories();
+                WebloggerFactory.getWeblogger().getWeblogManager().saveWeblog(this.getActionWeblog());
+
+                // flush changes
+                WebloggerFactory.getWeblogger().flush();
+                WebloggerFactory.getWeblogger().release();
+                addMessage("mediaFile.deleteFolder.success");
+
+                // notify caches
+                CacheManager.invalidate(getActionWeblog());
+
+                // re-route to default folder
+                mediaFileDir = manager.getDefaultMediaFileDirectory(getActionWeblog());
+                setDirectoryId(mediaFileDir.getId());
+                setDirectoryName(mediaFileDir.getName());
+            } else {
+                log.error("(System error) No directory ID provided for media file folder delete.");
+            }
+        } catch (WebloggerException ex) {
+            log.error("Error deleting folder", ex);
+        }
+        return execute();
+    }
+
+
+    /**
      * Include selected media file in gallery
      * 
      */
@@ -322,14 +349,6 @@ public class MediaFileView extends Media
         this.directoryId = id;
     }
 
-    public List<MediaFileDirectory> getChildDirectories() {
-        return childDirectories;
-    }
-
-    public void setChildDirectories(List<MediaFileDirectory> directories) {
-        this.childDirectories = directories;
-    }
-
     public List<MediaFile> getChildFiles() {
         return childFiles;
     }
@@ -354,12 +373,12 @@ public class MediaFileView extends Media
         this.currentDirectory = currentDirectory;
     }
 
-    public String getDirectoryPath() {
-        return directoryPath;
+    public String getDirectoryName() {
+        return directoryName;
     }
 
-    public void setDirectoryPath(String path) {
-        this.directoryPath = path;
+    public void setDirectoryName(String path) {
+        this.directoryName = path;
     }
 
     public String getSortBy() {
@@ -420,4 +439,13 @@ public class MediaFileView extends Media
     public void setNewDirectoryPath(String newDirectoryPath) {
         this.newDirectoryPath = newDirectoryPath;
     }
+
+    public String getViewDirectoryId() {
+        return viewDirectoryId;
+    }
+
+    public void setViewDirectoryId(String viewDirectoryId) {
+        this.viewDirectoryId = viewDirectoryId;
+    }
+
 }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MemberResign.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MemberResign.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MemberResign.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MemberResign.java Sun Jun  8 20:23:32 2014
@@ -69,8 +69,7 @@ public class MemberResign extends UIActi
             addMessage("yourWebsites.resigned", getWeblog());
         } catch (WebloggerException ex) {
             log.error("Error doing weblog resign - " + getActionWeblog().getHandle(), ex);
-            // TODO: i18n
-            addError("Resignation failed.");
+            addError("Resignation failed - check system logs");
         }
         return SUCCESS;
     }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MembersInvite.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MembersInvite.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MembersInvite.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/MembersInvite.java Sun Jun  8 20:23:32 2014
@@ -66,8 +66,7 @@ public class MembersInvite extends UIAct
         
         // if group blogging is disabled then you can't change permissions
         if (!WebloggerConfig.getBooleanProperty("groupblogging.enabled")) {
-            // TODO: i18n
-            addError("invitations disabled");
+            addError("inviteMember.disabled");
             return SUCCESS;
         }
         
@@ -84,8 +83,7 @@ public class MembersInvite extends UIAct
         
         // if group blogging is disabled then you can't change permissions
         if (!WebloggerConfig.getBooleanProperty("groupblogging.enabled")) {
-            // TODO: i18n
-            addError("invitations disabled");
+            addError("inviteMember.disabled");
             return SUCCESS;
         }
         
@@ -102,7 +100,6 @@ public class MembersInvite extends UIAct
             }
         } catch(WebloggerException ex) {
             log.error("Error looking up user by id - "+getUserName(), ex);
-            // TODO: i18n
             addError("Error looking up invitee");
         }
         
@@ -123,7 +120,6 @@ public class MembersInvite extends UIAct
             
         } catch (WebloggerException ex) {
             log.error("Error looking up permissions for weblog - "+getActionWeblog().getHandle(), ex);
-            // TODO: i18n
             addError("Error checking existing permissions");
         }
         
@@ -153,8 +149,7 @@ public class MembersInvite extends UIAct
 
             } catch (Exception ex) {
                 log.error("Error creating user invitation", ex);
-                // TODO: i18n
-                addError("Error creating user invitation");
+                addError("Error creating user invitation - check Roller logs");
             }
         }
         

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Pings.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Pings.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Pings.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Pings.java Sun Jun  8 20:23:32 2014
@@ -91,7 +91,6 @@ public class Pings extends UIAction {
             setCommonPingTargets(pingTargetMgr.getCommonPingTargets());
         } catch (WebloggerException ex) {
             log.error("Error loading ping target lists for weblog - "+getActionWeblog().getHandle(), ex);
-            // TODO: i18n
             addError("Error loading ping targets");
         }
     }
@@ -122,7 +121,6 @@ public class Pings extends UIAction {
                 WebloggerFactory.getWeblogger().flush();
             } catch(Exception ex) {
                 log.error("Error saving auto ping for target - "+getPingTargetId(), ex);
-                // TODO: i18n
                 addError("Error enabling auto ping");
             }
         }
@@ -143,7 +141,6 @@ public class Pings extends UIAction {
                 WebloggerFactory.getWeblogger().flush();
             } catch (Exception ex) {
                 log.error("Error removing auto ping for target - "+getPingTargetId(), ex);
-                // TODO: i18n
                 addError("Error disabling auto ping");
             }
         }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/StylesheetEdit.java Sun Jun  8 20:23:32 2014
@@ -201,8 +201,7 @@ public class StylesheetEdit extends UIAc
     public String save() {
 
         if (getTemplate() == null) {
-            // TODO: i18n
-            addError("Unable to locate stylesheet template");
+            addError("stylesheetEdit.error.cannotFind");
             return ERROR;
         }
 
@@ -260,8 +259,7 @@ public class StylesheetEdit extends UIAc
             } catch (WebloggerException ex) {
                 log.error("Error updating stylesheet template for weblog - "
                         + getActionWeblog().getHandle(), ex);
-                // TODO: i18n
-                addError("Error saving template");
+                addError("Error saving template - check Roller logs");
             }
         }
 
@@ -274,15 +272,13 @@ public class StylesheetEdit extends UIAc
     public String revert() {
 
         if (getTemplate() == null) {
-            // TODO: i18n
-            addError("Unable to locate stylesheet template");
+            addError("stylesheetEdit.error.cannotFind");
             return ERROR;
         }
 
         // make sure we are still using a shared theme so that reverting is
         // possible
         if (WeblogTheme.CUSTOM.equals(getActionWeblog().getEditorTheme())) {
-            // TODO: i18n
             addError("stylesheetEdit.error.customTheme");
         }
 
@@ -336,8 +332,7 @@ public class StylesheetEdit extends UIAc
             } catch (WebloggerException ex) {
                 log.error("Error updating stylesheet template for weblog - "
                         + getActionWeblog().getHandle(), ex);
-                // TODO: i18n
-                addError("Error saving template");
+                addError("stylesheetEdit.revert.failure");
             }
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/TemplateEdit.java Sun Jun  8 20:23:32 2014
@@ -79,7 +79,6 @@ public class TemplateEdit extends UIActi
     public String execute() {
         try {
             if (getTemplate() == null) {
-                // TODO: i18n
                 addError("Unable to locate specified template");
                 return LIST;
             }
@@ -96,8 +95,7 @@ public class TemplateEdit extends UIActi
 
         } catch (WebloggerException ex) {
            log.error("Error updating page - " + getBean().getId(), ex);
-           // TODO: i18n
-           addError("Error saving template");
+           addError("Error saving template - check Roller logs");
         }
 
         return INPUT;
@@ -110,7 +108,6 @@ public class TemplateEdit extends UIActi
         log.debug("Entering save()");
 
         if (getTemplate() == null) {
-            // TODO: i18n
             addError("Unable to locate specified template");
             return LIST;
         }
@@ -148,8 +145,7 @@ public class TemplateEdit extends UIActi
 
             } catch (Exception ex) {
                 log.error("Error updating page - " + getBean().getId(), ex);
-                // TODO: i18n
-                addError("Error saving template");
+                addError("Error updating template - check Roller logs");
             }
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/Templates.java Sun Jun  8 20:23:32 2014
@@ -123,8 +123,7 @@ public class Templates extends UIAction 
 		} catch (WebloggerException ex) {
 			log.error("Error getting templates for weblog - "
 					+ getActionWeblog().getHandle(), ex);
-			// TODO: i18n
-			addError("Error getting template list");
+			addError("Error getting template list - check Roller logs");
 		}
 
 		return LIST;
@@ -209,8 +208,7 @@ public class Templates extends UIAction 
             } catch (WebloggerException ex) {
                 log.error("Error adding new template for weblog - "
                         + getActionWeblog().getHandle(), ex);
-                // TODO: i18n
-                addError("Error adding new template");
+                addError("Error adding new template - check Roller logs");
             }
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/ThemeEdit.java Sun Jun  8 20:23:32 2014
@@ -156,8 +156,7 @@ public class ThemeEdit extends UIAction 
                 } catch (Exception re) {
                     log.error("Error customizing theme for weblog - "
                             + getActionWeblog().getHandle(), re);
-                    // TODO: i18n
-                    addError("Error importing theme");
+                    addError("Error importing theme - check Roller logs");
                 }
 
                 if (!hasActionErrors()) {
@@ -175,9 +174,7 @@ public class ThemeEdit extends UIAction 
                         // change
                         CacheManager.invalidate(weblog);
 
-                        // TODO: i18n
-                        addMessage("Successfully set theme to - "
-                                + WeblogTheme.CUSTOM);
+                        addMessage("themeEditor.setTheme.success", WeblogTheme.CUSTOM);
                         if (t != null) {
                             addMessage("Successfully copied templates from theme - "
                                     + t.getName());
@@ -194,8 +191,7 @@ public class ThemeEdit extends UIAction 
                     }
                 }
             } else {
-                // TODO: i18n
-                addError("Sorry, custom themes are not allowed");
+                addError("themeEditor.customTheme.disallowed");
             }
 
             // we are dealing with a shared theme scenario
@@ -204,9 +200,7 @@ public class ThemeEdit extends UIAction 
             // make sure theme is valid and enabled
             Theme newTheme = null;
             if (getThemeId() == null) {
-                // TODO: i18n
                 addError("No theme specified");
-
             } else {
                 try {
                     ThemeManager themeMgr = WebloggerFactory.getWeblogger()
@@ -214,13 +208,11 @@ public class ThemeEdit extends UIAction 
                     newTheme = themeMgr.getTheme(getThemeId());
 
                     if (!newTheme.isEnabled()) {
-                        // TODO: i18n
                         addError("Theme not enabled");
                     }
 
                 } catch (Exception ex) {
                     log.warn(ex);
-                    // TODO: i18n
                     addError("Theme not found");
                 }
             }
@@ -266,7 +258,7 @@ public class ThemeEdit extends UIAction 
 
                     // Theme set to..
                     if (!originalTheme.equals(getThemeId())) {
-                        addMessage("themeEditor.settheme", newTheme.getName());
+                        addMessage("themeEditor.setTheme.success", newTheme.getName());
                     }
 
                 } catch (WebloggerException re) {
@@ -279,7 +271,6 @@ public class ThemeEdit extends UIAction 
             // unknown theme scenario, error
         } else {
             // invalid theme type
-            // TODO: i18n
             addError("no valid theme type submitted");
         }
 

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfig.java Sun Jun  8 20:23:32 2014
@@ -129,6 +129,10 @@ public class WeblogConfig extends UIActi
 
                 Weblog weblog = getActionWeblog();
 
+                if (getBean().getAnalyticsCode() != null) {
+                    getBean().setAnalyticsCode(getBean().getAnalyticsCode().trim());
+                }
+
                 getBean().copyTo(weblog);
 
                 // if blogger category changed then lookup new cat and set it
@@ -158,9 +162,6 @@ public class WeblogConfig extends UIActi
                     wmgr.applyCommentDefaultsToEntries(weblog);
                 }
 
-                // apply referer filters
-                WebloggerFactory.getWeblogger().getRefererManager().applyRefererFilters(weblog);
-
                 // flush
                 WebloggerFactory.getWeblogger().flush();
 
@@ -171,7 +172,6 @@ public class WeblogConfig extends UIActi
 
             } catch (Exception ex) {
                 log.error("Error updating weblog config", ex);
-                // TODO: i18n
                 addError("Error updating configuration");
             }
         }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfigBean.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfigBean.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfigBean.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/editor/WeblogConfigBean.java Sun Jun  8 20:23:32 2014
@@ -51,6 +51,8 @@ public class WeblogConfigBean {
     private String pageModels = null;
     private String icon = null;
     private String about = null;
+
+    private String analyticsCode = null;
     
     private String bloggerCategoryId = null;
     private String[] defaultPluginsArray = null;
@@ -264,8 +266,15 @@ public class WeblogConfigBean {
     public void setActive(boolean active) {
         this.active = active;
     }
-    
-    
+
+    public String getAnalyticsCode() {
+        return analyticsCode;
+    }
+
+    public void setAnalyticsCode(String analyticsCode) {
+        this.analyticsCode = analyticsCode;
+    }
+
     public void copyFrom(Weblog dataHolder) {
         
         this.handle = dataHolder.getHandle();
@@ -290,6 +299,7 @@ public class WeblogConfigBean {
         this.enableMultiLang = dataHolder.isEnableMultiLang();
         this.showAllLangs = dataHolder.isShowAllLangs();
         this.pageModels = dataHolder.getPageModels();
+        this.analyticsCode = dataHolder.getAnalyticsCode();
         setIcon(dataHolder.getIconPath());
         setAbout(dataHolder.getAbout());
         if (dataHolder.getBloggerCategory() != null) {
@@ -325,6 +335,7 @@ public class WeblogConfigBean {
         dataHolder.setPageModels(this.pageModels);
         dataHolder.setIconPath(getIcon());
         dataHolder.setAbout(getAbout());
+        dataHolder.setAnalyticsCode(this.analyticsCode);
         
         dataHolder.setDefaultPlugins( StringUtils.join(this.defaultPluginsArray,",") );
         
@@ -333,4 +344,6 @@ public class WeblogConfigBean {
         dataHolder.setDefaultPlugins(StringUtils.join(this.defaultPluginsArray, ","));
     }
     
+
+
 }

Modified: roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionInterceptor.java
URL: http://svn.apache.org/viewvc/roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionInterceptor.java?rev=1601254&r1=1601253&r2=1601254&view=diff
==============================================================================
--- roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionInterceptor.java (original)
+++ roller/branches/rome2/app/src/main/java/org/apache/roller/weblogger/ui/struts2/util/UIActionInterceptor.java Sun Jun  8 20:23:32 2014
@@ -18,10 +18,8 @@
 
 package org.apache.roller.weblogger.ui.struts2.util;
 
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionInvocation;
-import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
 import javax.servlet.http.HttpServletRequest;
+
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -30,54 +28,64 @@ import org.apache.roller.weblogger.pojos
 import org.apache.roller.weblogger.ui.core.RollerSession;
 import org.apache.struts2.StrutsStatics;
 
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
 
 /**
  * A struts2 interceptor for configuring specifics of the weblogger ui.
  */
-public class UIActionInterceptor extends AbstractInterceptor 
-        implements StrutsStatics {
-    
+public class UIActionInterceptor extends MethodFilterInterceptor implements
+        StrutsStatics {
+
+    private static final long serialVersionUID = -6452966127207525616L;
     private static Log log = LogFactory.getLog(UIActionInterceptor.class);
-    
-    
-    public String intercept(ActionInvocation invocation) throws Exception {
-        
-        log.debug("Entering UIActionInterceptor");
-        
+
+    public String doIntercept(ActionInvocation invocation) throws Exception {
+
+        if (log.isDebugEnabled()) {
+            log.debug("Entering UIActionInterceptor");
+        }
+
         final Object action = invocation.getAction();
         final ActionContext context = invocation.getInvocationContext();
-        
-        HttpServletRequest request = (HttpServletRequest) context.get(HTTP_REQUEST);
-        
+
+        HttpServletRequest request = (HttpServletRequest) context
+                .get(HTTP_REQUEST);
+
         // is this one of our own UIAction classes?
         if (action instanceof UIAction) {
-            
-            log.debug("action is a UIAction, setting relevant attributes");
-            
+
+            if (log.isDebugEnabled()) {
+                log.debug("action is a UIAction, setting relevant attributes");
+            }
+
             UIAction theAction = (UIAction) action;
-            
+
             // extract the authenticated user and set it
             RollerSession rses = RollerSession.getRollerSession(request);
-            if(rses != null) {
+            if (rses != null) {
                 theAction.setAuthenticatedUser(rses.getAuthenticatedUser());
             }
-            
+
             // extract the work weblog and set it
             String weblogHandle = theAction.getWeblog();
-            if(!StringUtils.isEmpty(weblogHandle)) {
+            if (!StringUtils.isEmpty(weblogHandle)) {
                 Weblog weblog = null;
                 try {
-                    weblog = WebloggerFactory.getWeblogger().getWeblogManager().getWeblogByHandle(weblogHandle);
-                    if(weblog != null) {
+                    weblog = WebloggerFactory.getWeblogger().getWeblogManager()
+                            .getWeblogByHandle(weblogHandle);
+                    if (weblog != null) {
                         theAction.setActionWeblog(weblog);
                     }
-                } catch(Exception e) {
-                    log.error("Error looking up action weblog - "+weblogHandle, e);
+                } catch (Exception e) {
+                    log.error("Error looking up action weblog - "
+                            + weblogHandle, e);
                 }
             }
         }
-        
+
         return invocation.invoke();
     }
-    
+
 }



Mime
View raw message