roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r543951 [2/7] - in /roller/trunk/apps/weblogger: src/java/org/apache/roller/weblogger/business/ src/java/org/apache/roller/weblogger/business/hibernate/ src/java/org/apache/roller/weblogger/business/jpa/ src/java/org/apache/roller/weblogger...
Date Sun, 03 Jun 2007 18:16:11 GMT
Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingQueueManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -26,7 +26,7 @@
 import org.hibernate.criterion.Order;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.pojos.AutoPing;
 import org.apache.roller.weblogger.pojos.PingQueueEntry;
 import java.sql.Timestamp;
@@ -53,24 +53,24 @@
     }
     
     
-    public PingQueueEntry getQueueEntry(String id) throws RollerException {
+    public PingQueueEntry getQueueEntry(String id) throws WebloggerException {
         return (PingQueueEntry) strategy.load(id, PingQueueEntry.class);
     }
     
     
-    public void saveQueueEntry(PingQueueEntry pingQueueEntry) throws RollerException {
+    public void saveQueueEntry(PingQueueEntry pingQueueEntry) throws WebloggerException {
         log.debug("Storing ping queue entry: " + pingQueueEntry);
         strategy.store(pingQueueEntry);
     }
     
     
-    public void removeQueueEntry(PingQueueEntry pingQueueEntry) throws RollerException {
+    public void removeQueueEntry(PingQueueEntry pingQueueEntry) throws WebloggerException {
         log.debug("Removing ping queue entry: " + pingQueueEntry);
         strategy.remove(pingQueueEntry);
     }
     
     
-    public void addQueueEntry(AutoPing autoPing) throws RollerException {
+    public void addQueueEntry(AutoPing autoPing) throws WebloggerException {
         log.debug("Creating new ping queue entry for auto ping configuration: " + autoPing);
         
         // First check if there is an existing ping queue entry for the same target and website
@@ -86,7 +86,7 @@
     }
     
     
-    public List getAllQueueEntries() throws RollerException {
+    public List getAllQueueEntries() throws WebloggerException {
         try {
             Session session = ((HibernatePersistenceStrategy) strategy).getSession();
             Criteria criteria = session.createCriteria(PingQueueEntry.class);
@@ -94,13 +94,13 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException("ERROR retrieving queue entries.", e);
+            throw new WebloggerException("ERROR retrieving queue entries.", e);
         }
     }
     
     
     // private helper to determine if an has already been queued for the same website and ping target.
-    private boolean isAlreadyQueued(AutoPing autoPing) throws RollerException {
+    private boolean isAlreadyQueued(AutoPing autoPing) throws WebloggerException {
         try {
             Session session = ((HibernatePersistenceStrategy) strategy).getSession();
             Criteria criteria = session.createCriteria(PingQueueEntry.class);
@@ -108,7 +108,7 @@
             criteria.add(Expression.eq("website", autoPing.getWebsite()));
             return !criteria.list().isEmpty();
         } catch (HibernateException e) {
-            throw new RollerException("ERROR determining if preexisting queue entry is present.",e);
+            throw new WebloggerException("ERROR determining if preexisting queue entry is present.",e);
         }
     }
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePingTargetManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -27,7 +27,7 @@
 import org.hibernate.Session;
 import org.hibernate.criterion.Expression;
 import org.hibernate.criterion.Order;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.pojos.PingTarget;
 import org.apache.roller.weblogger.pojos.Weblog;
 import java.util.Iterator;
@@ -61,7 +61,7 @@
     }
     
     
-    public void removePingTarget(PingTarget pingTarget) throws RollerException {
+    public void removePingTarget(PingTarget pingTarget) throws WebloggerException {
         // remove contents and then target
         this.removePingTargetContents(pingTarget);
         this.strategy.remove(pingTarget);
@@ -73,7 +73,7 @@
      * reference the given ping target.
      */
     private void removePingTargetContents(PingTarget ping) 
-            throws RollerException {
+            throws WebloggerException {
         
         Session session = this.strategy.getSession();
         
@@ -99,7 +99,7 @@
     /**
      * @see org.apache.roller.weblogger.model.PingTargetManager#removeAllCustomPingTargets()
      */
-    public void removeAllCustomPingTargets() throws RollerException {
+    public void removeAllCustomPingTargets() throws WebloggerException {
         
         try {
             Session session = strategy.getSession();
@@ -108,13 +108,13 @@
             List allCustomTargets = criteria.list();
             removeTargets(allCustomTargets);
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
     // Private helper to remove a collection of targets.
-    private void removeTargets(Collection customTargets) throws RollerException {
+    private void removeTargets(Collection customTargets) throws WebloggerException {
         
         // just go through the list and remove each auto ping
         Iterator targets = customTargets.iterator();
@@ -124,17 +124,17 @@
     }
     
     
-    public void savePingTarget(PingTarget pingTarget) throws RollerException {
+    public void savePingTarget(PingTarget pingTarget) throws WebloggerException {
         strategy.store(pingTarget);
     }
     
     
-    public PingTarget getPingTarget(String id) throws RollerException {
+    public PingTarget getPingTarget(String id) throws WebloggerException {
         return (PingTarget) strategy.load(id, PingTarget.class);
     }
 
     
-    public boolean isNameUnique(PingTarget pingTarget) throws RollerException {
+    public boolean isNameUnique(PingTarget pingTarget) throws WebloggerException {
         String name = pingTarget.getName();
         if (name == null || name.trim().length() == 0) return false;
         
@@ -163,7 +163,7 @@
     }
     
     
-    public boolean isUrlWellFormed(PingTarget pingTarget) throws RollerException {
+    public boolean isUrlWellFormed(PingTarget pingTarget) throws WebloggerException {
         String url = pingTarget.getPingUrl();
         if (url == null || url.trim().length() == 0) return false;
         try {
@@ -178,7 +178,7 @@
     }
     
     
-    public boolean isHostnameKnown(PingTarget pingTarget) throws RollerException {
+    public boolean isHostnameKnown(PingTarget pingTarget) throws WebloggerException {
         String url = pingTarget.getPingUrl();
         if (url == null || url.trim().length() == 0) return false;
         try {
@@ -198,7 +198,7 @@
     /**
      * @see org.apache.roller.weblogger.model.PingTargetManager#getCommonPingTargets()
      */
-    public List getCommonPingTargets() throws RollerException {
+    public List getCommonPingTargets() throws WebloggerException {
         try {
             Session session = ((HibernatePersistenceStrategy) strategy).getSession();
             Criteria criteria = session.createCriteria(PingTarget.class);
@@ -206,7 +206,7 @@
             criteria.addOrder(Order.asc("name"));
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         
     }
@@ -215,7 +215,7 @@
     /**
      * @see org.apache.roller.weblogger.model.PingTargetManager#getCustomPingTargets(org.apache.roller.weblogger.pojos.WebsiteData)
      */
-    public List getCustomPingTargets(Weblog website) throws RollerException {
+    public List getCustomPingTargets(Weblog website) throws WebloggerException {
         try {
             Session session = ((HibernatePersistenceStrategy) strategy).getSession();
             Criteria criteria = session.createCriteria(PingTarget.class);
@@ -223,7 +223,7 @@
             criteria.addOrder(Order.asc("name"));
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernatePropertiesManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -27,7 +27,7 @@
 import org.hibernate.Session;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.config.RollerRuntimeConfig;
 import org.apache.roller.weblogger.config.runtime.ConfigDef;
 import org.apache.roller.weblogger.config.runtime.DisplayGroup;
@@ -68,11 +68,11 @@
     /** 
      * Retrieve a single property by name.
      */
-    public RuntimeConfigProperty getProperty(String name) throws RollerException {
+    public RuntimeConfigProperty getProperty(String name) throws WebloggerException {
         try {
             return (RuntimeConfigProperty) strategy.load(name, RuntimeConfigProperty.class);
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
@@ -85,7 +85,7 @@
      * uses the property name as the key and the RuntimeConfigProperty object
      * as the value.
      */
-    public Map getProperties() throws RollerException {
+    public Map getProperties() throws WebloggerException {
         
         HashMap props = new HashMap();
         
@@ -107,7 +107,7 @@
                 props.put(prop.getName(), prop);
             }
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         
         return props;
@@ -117,7 +117,7 @@
     /**
      * Save a single property.
      */
-    public void saveProperty(RuntimeConfigProperty property) throws RollerException {
+    public void saveProperty(RuntimeConfigProperty property) throws WebloggerException {
         
         this.strategy.store(property);
     }
@@ -126,7 +126,7 @@
     /**
      * Save all properties.
      */
-    public void saveProperties(Map properties) throws RollerException {
+    public void saveProperties(Map properties) throws WebloggerException {
         
         // just go through the list and saveProperties each property
         Iterator props = properties.values().iterator();

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRefererManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -35,7 +35,7 @@
 import org.hibernate.criterion.Junction;
 import org.hibernate.criterion.Order;
 import org.hibernate.type.Type;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.config.RollerRuntimeConfig;
 import org.apache.roller.weblogger.business.referrers.RefererManager;
 import org.apache.roller.weblogger.pojos.WeblogReferrer;
@@ -78,11 +78,11 @@
         strategy = strat;
     }
     
-    public void saveReferer(WeblogReferrer referer) throws RollerException {
+    public void saveReferer(WeblogReferrer referer) throws WebloggerException {
         strategy.store(referer);
     }
         
-    public void removeReferer(WeblogReferrer referer) throws RollerException {
+    public void removeReferer(WeblogReferrer referer) throws WebloggerException {
         strategy.remove(referer);
     }
         
@@ -91,7 +91,7 @@
      *
      * TODO: do we really need dialect specific queries?
      */
-    public void clearReferrers() throws RollerException {
+    public void clearReferrers() throws WebloggerException {
         
         if (log.isDebugEnabled()) {
             log.debug("clearReferrers");
@@ -121,7 +121,7 @@
      *
      * TODO: do we really need dialect specific queries?
      */
-    public void clearReferrers(Weblog website) throws RollerException {
+    public void clearReferrers(Weblog website) throws WebloggerException {
         
         if (log.isDebugEnabled()) {
             log.debug("clearReferrers");
@@ -148,7 +148,7 @@
     /**
      * Apply ignoreWord/spam filters to all referers in system.
      */
-    public void applyRefererFilters() throws RollerException {
+    public void applyRefererFilters() throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -174,16 +174,16 @@
             }
 
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
     /**
      * Apply ignoreWord/spam filters to all referers in website.
      */
-    public void applyRefererFilters(Weblog website) throws RollerException {
+    public void applyRefererFilters(Weblog website) throws WebloggerException {
         
-        if (null == website) throw new RollerException("website is null");
+        if (null == website) throw new WebloggerException("website is null");
         if (null == website.getBlacklist()) return;
         
         try {
@@ -207,7 +207,7 @@
             }
             
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }   
     
@@ -215,7 +215,7 @@
      * Use Hibernate directly because Roller's Query API does too much allocation.
      */
     protected List getExistingReferers(Weblog website, String dateString,
-            String permalink) throws RollerException {
+            String permalink) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -227,7 +227,7 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
@@ -235,7 +235,7 @@
      * Use Hibernate directly because Roller's Query API does too much allocation.
      */
     protected List getMatchingReferers(Weblog website, String requestUrl,
-            String refererUrl) throws RollerException {
+            String refererUrl) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -247,7 +247,7 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
        
@@ -255,7 +255,7 @@
      * Returns hot weblogs as StatCount objects, in descending order by today's hits.
      */
     public List getHotWeblogs(int sinceDays, int offset, int length)
-        throws RollerException {
+        throws WebloggerException {
         // TODO: ATLAS getDaysPopularWebsites DONE TESTED
         String msg = "Getting hot weblogs";
         ArrayList result = new ArrayList();
@@ -303,7 +303,7 @@
             
         } catch (Throwable pe) {
             log.error(msg, pe);
-            throw new RollerException(msg, pe);
+            throw new WebloggerException(msg, pe);
         }
     }
     
@@ -311,7 +311,7 @@
     /**
      * Use raw SQL because Hibernate can't handle the query.
      */
-    protected int getHits(Weblog website, String type) throws RollerException {
+    protected int getHits(Weblog website, String type) throws WebloggerException {
         int hits = 0;
         if (log.isDebugEnabled()) {
             log.debug("getHits: " + website.getName());
@@ -334,7 +334,7 @@
             q.setParameters(args, types);
             results = q.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         Object[] resultsArray = (Object[]) results.get(0);
         
@@ -356,9 +356,9 @@
     /**
      * @see org.apache.roller.weblogger.pojos.RefererManager#getReferers(java.lang.String)
      */
-    public List getReferers(Weblog website) throws RollerException {
+    public List getReferers(Weblog website) throws WebloggerException {
         if (website==null )
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -368,16 +368,16 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
     /**
      * @see org.apache.roller.weblogger.pojos.RefererManager#getTodaysReferers(String)
      */
-    public List getTodaysReferers(Weblog website) throws RollerException {
+    public List getTodaysReferers(Weblog website) throws WebloggerException {
         if (website==null )
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -388,7 +388,7 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
        
@@ -399,12 +399,12 @@
      * org.apache.roller.weblogger.pojos.WebsiteData, java.lang.String)
      */
     public List getReferersToDate(Weblog website, String date)
-            throws RollerException {
+            throws WebloggerException {
         if (website==null )
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         
         if (date==null )
-            throw new RollerException("Date is null");
+            throw new WebloggerException("Date is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -416,7 +416,7 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
@@ -424,9 +424,9 @@
      * @see org.apache.roller.weblogger.pojos.RefererManager#getReferersToEntry(
      * java.lang.String, java.lang.String)
      */
-    public List getReferersToEntry(String entryid) throws RollerException {
+    public List getReferersToEntry(String entryid) throws WebloggerException {
         if (null == entryid)
-            throw new RollerException("entryid is null");
+            throw new WebloggerException("entryid is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -441,7 +441,7 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
@@ -449,7 +449,7 @@
      * Query for collection of referers.
      */
     protected List getReferersToWebsite(Weblog website, String refererUrl)
-            throws RollerException {
+            throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -459,7 +459,7 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
@@ -470,7 +470,7 @@
                                             String requestUrl,
                                             String title,
                                             String excerpt)
-            throws RollerException {
+            throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -489,22 +489,22 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
-    public int getDayHits(Weblog website) throws RollerException {
+    public int getDayHits(Weblog website) throws WebloggerException {
         return getHits(website, DAYHITS);
     }
         
-    public int getTotalHits(Weblog website) throws RollerException {
+    public int getTotalHits(Weblog website) throws WebloggerException {
         return getHits(website, TOTALHITS);
     }
         
     /**
      * @see org.apache.roller.weblogger.pojos.RefererManager#retrieveReferer(java.lang.String)
      */
-    public WeblogReferrer getReferer(String id) throws RollerException {
+    public WeblogReferrer getReferer(String id) throws WebloggerException {
         return (WeblogReferrer)strategy.load(id,WeblogReferrer.class);
     }
     
@@ -536,7 +536,7 @@
                 WeblogManager weblogMgr = RollerFactory.getRoller().getWeblogManager();
                 entry = weblogMgr.getWeblogEntryByAnchor(weblog, entryAnchor);
             }
-        } catch (RollerException re) {
+        } catch (WebloggerException re) {
             // problem looking up website, gotta bail
             log.error("Error looking up website object", re);
             return;
@@ -639,7 +639,7 @@
                     saveReferer(ref);
                 }
             }
-        } catch (RollerException pe) {
+        } catch (WebloggerException pe) {
             log.error(pe);
         } catch (NullPointerException npe) {
             log.error(npe);

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateRollerImpl.java Sun Jun  3 11:16:02 2007
@@ -20,7 +20,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.RollerImpl;
 import org.apache.roller.weblogger.config.RollerConfig;
 import org.apache.roller.weblogger.business.BookmarkManager;
@@ -59,7 +59,7 @@
     private ThreadManager     threadManager = null;
     
     
-    protected HibernateRollerImpl() throws RollerException {
+    protected HibernateRollerImpl() throws WebloggerException {
         try {
             String dialect =  
                 RollerConfig.getProperty("hibernate.dialect");
@@ -70,7 +70,7 @@
         } catch(Throwable t) {
             // if this happens then we are screwed
             mLogger.fatal("Error initializing Hibernate", t);
-            throw new RollerException(t);
+            throw new WebloggerException(t);
         }
     }
     
@@ -78,13 +78,13 @@
     /**
      * Instantiates and returns an instance of HibernateRollerImpl.
      */
-    public static Roller instantiate() throws RollerException {
+    public static Roller instantiate() throws WebloggerException {
         mLogger.debug("Instantiating HibernateRollerImpl");
         return new HibernateRollerImpl();
     }
     
     
-    public void flush() throws RollerException {
+    public void flush() throws WebloggerException {
         this.strategy.flush();
     }
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateThreadManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -21,7 +21,7 @@
 import java.util.Date;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.runnable.ThreadManagerImpl;
 import org.apache.roller.weblogger.business.runnable.RollerTask;
 import org.apache.roller.weblogger.business.RollerFactory;
@@ -78,7 +78,7 @@
                 RollerFactory.getRoller().flush();
             }
             
-        } catch (RollerException ex) {
+        } catch (WebloggerException ex) {
             log.warn("Error getting or inserting TaskLock", ex);
             return false;
         }
@@ -134,7 +134,7 @@
                 return false;
             }
             
-        } catch (RollerException ex) {
+        } catch (WebloggerException ex) {
             log.warn("Error getting TaskLock", ex);
             return false;
         }
@@ -166,7 +166,7 @@
     }
     
     
-    private TaskLock getTaskLockByName(String name) throws RollerException {
+    private TaskLock getTaskLockByName(String name) throws WebloggerException {
         
         // do lookup
         try {
@@ -178,12 +178,12 @@
             
             return taskLock;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
-    private void saveTaskLock(TaskLock data) throws RollerException {
+    private void saveTaskLock(TaskLock data) throws WebloggerException {
         this.strategy.store(data);
     }
     

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateUserManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -38,7 +38,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.hibernate.criterion.SimpleExpression;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.config.RollerConfig;
 import org.apache.roller.weblogger.business.pings.AutoPingManager;
 import org.apache.roller.weblogger.business.BookmarkManager;
@@ -88,13 +88,13 @@
     /**
      * Update existing website.
      */
-    public void saveWebsite(Weblog website) throws RollerException {
+    public void saveWebsite(Weblog website) throws WebloggerException {
         
         website.setLastModified(new java.util.Date());
         strategy.store(website);
     }
     
-    public void removeWebsite(Weblog weblog) throws RollerException {
+    public void removeWebsite(Weblog weblog) throws WebloggerException {
         
         // remove contents first, then remove website
         this.removeWebsiteContents(weblog);
@@ -109,7 +109,7 @@
      * TODO BACKEND: use manager methods instead of queries here
      */
     private void removeWebsiteContents(Weblog website)
-    throws HibernateException, RollerException {
+    throws HibernateException, WebloggerException {
         
         Session session = this.strategy.getSession();
         
@@ -207,22 +207,22 @@
         }
     }
         
-    public void saveUser(User data) throws RollerException {
+    public void saveUser(User data) throws WebloggerException {
         this.strategy.store(data);
     }
         
-    public void removeUser(User user) throws RollerException {
+    public void removeUser(User user) throws WebloggerException {
         this.strategy.remove(user);
         
         // remove entry from cache mapping
         this.userNameToIdMap.remove(user.getUserName());
     }
         
-    public void savePermissions(WeblogPermission perms) throws RollerException {
+    public void savePermissions(WeblogPermission perms) throws WebloggerException {
         this.strategy.store(perms);
     }
         
-    public void removePermissions(WeblogPermission perms) throws RollerException {
+    public void removePermissions(WeblogPermission perms) throws WebloggerException {
         
         // make sure associations are broken
         perms.getWebsite().getPermissions().remove(perms);
@@ -234,24 +234,24 @@
     /**
      * @see org.apache.roller.weblogger.model.UserManager#storePage(org.apache.roller.weblogger.pojos.WeblogTemplate)
      */
-    public void savePage(WeblogTemplate page) throws RollerException {
+    public void savePage(WeblogTemplate page) throws WebloggerException {
         this.strategy.store(page);
         
         // update weblog last modified date.  date updated by saveWebsite()
         RollerFactory.getRoller().getUserManager().saveWebsite(page.getWebsite());
     }
         
-    public void removePage(WeblogTemplate page) throws RollerException {
+    public void removePage(WeblogTemplate page) throws WebloggerException {
         this.strategy.remove(page);
         
         // update weblog last modified date.  date updated by saveWebsite()
         RollerFactory.getRoller().getUserManager().saveWebsite(page.getWebsite());
     }
         
-    public void addUser(User newUser) throws RollerException {
+    public void addUser(User newUser) throws WebloggerException {
         
         if(newUser == null)
-            throw new RollerException("cannot add null user");
+            throw new WebloggerException("cannot add null user");
         
         // TODO BACKEND: we must do this in a better fashion, like getUserCnt()?
         boolean adminUser = false;
@@ -263,7 +263,7 @@
         
         if(getUserByUserName(newUser.getUserName()) != null ||
                 getUserByUserName(newUser.getUserName().toLowerCase()) != null) {
-            throw new RollerException("error.add.user.userNameInUse");
+            throw new WebloggerException("error.add.user.userNameInUse");
         }
         
         newUser.grantRole("editor");
@@ -279,13 +279,13 @@
         this.strategy.store(newUser);
     }
         
-    public void addWebsite(Weblog newWeblog) throws RollerException {
+    public void addWebsite(Weblog newWeblog) throws WebloggerException {
         
         this.strategy.store(newWeblog);
         this.addWeblogContents(newWeblog);
     }
         
-    private void addWeblogContents(Weblog newWeblog) throws RollerException {
+    private void addWeblogContents(Weblog newWeblog) throws WebloggerException {
         
         UserManager umgr = RollerFactory.getRoller().getUserManager();
         WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
@@ -378,10 +378,10 @@
      * TODO BACKEND: do we really need this?  can't we just use storePermissions()?
      */
     public WeblogPermission inviteUser(Weblog website,
-            User user, short mask) throws RollerException {
+            User user, short mask) throws WebloggerException {
         
-        if (website == null) throw new RollerException("Website cannot be null");
-        if (user == null) throw new RollerException("User cannot be null");
+        if (website == null) throw new WebloggerException("Website cannot be null");
+        if (user == null) throw new WebloggerException("User cannot be null");
         
         WeblogPermission perms = new WeblogPermission();
         perms.setWebsite(website);
@@ -401,10 +401,10 @@
      *
      * TODO: replace this with a domain model method like weblog.retireUser(user)
      */
-    public void retireUser(Weblog website, User user) throws RollerException {
+    public void retireUser(Weblog website, User user) throws WebloggerException {
         
-        if (website == null) throw new RollerException("Website cannot be null");
-        if (user == null) throw new RollerException("User cannot be null");
+        if (website == null) throw new WebloggerException("Website cannot be null");
+        if (user == null) throw new WebloggerException("User cannot be null");
         
         Iterator perms = website.getPermissions().iterator();
         WeblogPermission target = null;
@@ -415,17 +415,17 @@
                 break;
             }
         }
-        if (target == null) throw new RollerException("User not member of website");
+        if (target == null) throw new WebloggerException("User not member of website");
         
         website.removePermission(target);
         this.strategy.remove(target);
     }
         
-    public Weblog getWebsite(String id) throws RollerException {
+    public Weblog getWebsite(String id) throws WebloggerException {
         return (Weblog) this.strategy.load(id,Weblog.class);
     }
         
-    public Weblog getWebsiteByHandle(String handle) throws RollerException {
+    public Weblog getWebsiteByHandle(String handle) throws WebloggerException {
         return getWebsiteByHandle(handle, Boolean.TRUE);
     }
         
@@ -433,10 +433,10 @@
      * Return website specified by handle.
      */
     public Weblog getWebsiteByHandle(String handle, Boolean enabled)
-    throws RollerException {
+    throws WebloggerException {
         
         if (handle==null )
-            throw new RollerException("Handle cannot be null");
+            throw new WebloggerException("Handle cannot be null");
         
         // check cache first
         // NOTE: if we ever allow changing handles then this needs updating
@@ -478,7 +478,7 @@
             }
             
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
@@ -487,7 +487,7 @@
      */
     public List getWebsites(User user, Boolean enabled, Boolean active, 
                             Date startDate, Date endDate, int offset, int length)  
-            throws RollerException {
+            throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -521,23 +521,23 @@
             return criteria.list();
             
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
-    public User getUser(String id) throws RollerException {
+    public User getUser(String id) throws WebloggerException {
         return (User)this.strategy.load(id,User.class);
     }
         
-    public User getUserByUserName(String userName) throws RollerException {
+    public User getUserByUserName(String userName) throws WebloggerException {
         return getUserByUserName(userName, Boolean.TRUE);
     }
     
     public User getUserByUserName(String userName, Boolean enabled)
-    throws RollerException {
+    throws WebloggerException {
         
         if (userName==null )
-            throw new RollerException("userName cannot be null");
+            throw new WebloggerException("userName cannot be null");
         
         // check cache first
         // NOTE: if we ever allow changing usernames then this needs updating
@@ -582,14 +582,14 @@
             
             return user;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
     public List getUsers(Weblog weblog, Boolean enabled, Date startDate, 
                          Date endDate, int offset, int length) 
-            throws RollerException {
+            throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -626,13 +626,13 @@
             return criteria.list();
             
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
         
     public List getUsersStartingWith(String startsWith, Boolean enabled,
-            int offset, int length) throws RollerException {
+            int offset, int length) throws WebloggerException {
         
         List results = new ArrayList();
         try {
@@ -655,12 +655,12 @@
             }
             results = criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         return results;
     }
     
-    public WeblogTemplate getPage(String id) throws RollerException {
+    public WeblogTemplate getPage(String id) throws WebloggerException {
         // Don't hit database for templates stored on disk
         if (id != null && id.endsWith(".vm")) return null;
         
@@ -671,13 +671,13 @@
      * Use Hibernate directly because Roller's Query API does too much allocation.
      */
     public WeblogTemplate getPageByLink(Weblog website, String pagelink)
-            throws RollerException {
+            throws WebloggerException {
         
         if (website == null)
-            throw new RollerException("userName is null");
+            throw new WebloggerException("userName is null");
         
         if (pagelink == null)
-            throw new RollerException("Pagelink is null");
+            throw new WebloggerException("Pagelink is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -687,7 +687,7 @@
             
             return (WeblogTemplate) criteria.uniqueResult();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
@@ -696,13 +696,13 @@
      * @see org.apache.roller.weblogger.model.UserManager#getPageByAction(WebsiteData, java.lang.String)
      */
     public WeblogTemplate getPageByAction(Weblog website, String action)
-            throws RollerException {
+            throws WebloggerException {
         
         if (website == null)
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         
         if (action == null)
-            throw new RollerException("Action name is null");
+            throw new WebloggerException("Action name is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -712,7 +712,7 @@
             
             return (WeblogTemplate) criteria.uniqueResult();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
@@ -721,13 +721,13 @@
      * @see org.apache.roller.weblogger.model.UserManager#getPageByName(WebsiteData, java.lang.String)
      */
     public WeblogTemplate getPageByName(Weblog website, String pagename)
-            throws RollerException {
+            throws WebloggerException {
         
         if (website == null)
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         
         if (pagename == null)
-            throw new RollerException("Page name is null");
+            throw new WebloggerException("Page name is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -737,17 +737,17 @@
             
             return (WeblogTemplate) criteria.uniqueResult();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     /**
      * @see org.apache.roller.weblogger.model.UserManager#getPages(WebsiteData)
      */
-    public List getPages(Weblog website) throws RollerException {
+    public List getPages(Weblog website) throws WebloggerException {
         
         if (website == null)
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -757,11 +757,11 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
-    public WeblogPermission getPermissions(String inviteId) throws RollerException {
+    public WeblogPermission getPermissions(String inviteId) throws WebloggerException {
         return (WeblogPermission)this.strategy.load(inviteId,WeblogPermission.class);
     }
     
@@ -769,7 +769,7 @@
      * Return permissions for specified user in website
      */
     public WeblogPermission getPermissions(
-            Weblog website, User user) throws RollerException {
+            Weblog website, User user) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -780,14 +780,14 @@
             List list = criteria.list();
             return list.size()!=0 ? (WeblogPermission)list.get(0) : null;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     /**
      * Get pending permissions for user
      */
-    public List getPendingPermissions(User user) throws RollerException {
+    public List getPendingPermissions(User user) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -797,14 +797,14 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     /**
      * Get pending permissions for website
      */
-    public List getPendingPermissions(Weblog website) throws RollerException {
+    public List getPendingPermissions(Weblog website) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -814,14 +814,14 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     /**
      * Get all permissions of a website (pendings not including)
      */
-    public List getAllPermissions(Weblog website) throws RollerException {
+    public List getAllPermissions(Weblog website) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -831,14 +831,14 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     /**
      * Get all permissions of a user.
      */
-    public List getAllPermissions(User user) throws RollerException {
+    public List getAllPermissions(User user) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -848,13 +848,13 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     public void release() {}
     
-    public Map getUserNameLetterMap() throws RollerException {
+    public Map getUserNameLetterMap() throws WebloggerException {
         // TODO: ATLAS getUserNameLetterMap DONE TESTED
         String msg = "Getting username letter map";
         try {      
@@ -872,12 +872,12 @@
             return results;
         } catch (Throwable pe) {
             log.error(msg, pe);
-            throw new RollerException(msg, pe);
+            throw new WebloggerException(msg, pe);
         }
     }
     
     public List getUsersByLetter(char letter, int offset, int length) 
-        throws RollerException { 
+        throws WebloggerException { 
         // TODO: ATLAS getUsersByLetter DONE
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -892,11 +892,11 @@
             }
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
-    public Map getWeblogHandleLetterMap() throws RollerException {
+    public Map getWeblogHandleLetterMap() throws WebloggerException {
         // TODO: ATLAS getWeblogHandleLetterMap DONE
         String msg = "Getting weblog letter map";
         try {      
@@ -914,12 +914,12 @@
             return results;
         } catch (Throwable pe) {
             log.error(msg, pe);
-            throw new RollerException(msg, pe);
+            throw new WebloggerException(msg, pe);
         }
     }
     
     public List getWeblogsByLetter(char letter, int offset, int length) 
-        throws RollerException {
+        throws WebloggerException {
         // TODO: ATLAS getWeblogsByLetter DONE
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -934,12 +934,12 @@
             }
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
         
     public List getMostCommentedWebsites(Date startDate, Date endDate, int offset, int length) 
-        throws RollerException {
+        throws WebloggerException {
         // TODO: ATLAS getMostCommentedWebsites DONE TESTED
         String msg = "Getting most commented websites";
         if (endDate == null) endDate = new Date();
@@ -979,7 +979,7 @@
             return results;
         } catch (Throwable pe) {
             log.error(msg, pe);
-            throw new RollerException(msg, pe);
+            throw new WebloggerException(msg, pe);
         }
     }
     
@@ -987,7 +987,7 @@
     /**
      * Get count of weblogs, active and inactive
      */    
-    public long getWeblogCount() throws RollerException {
+    public long getWeblogCount() throws WebloggerException {
         long ret = 0;
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -995,12 +995,12 @@
             List result = session.createQuery(query).list();
             ret = ((Number)result.get(0)).intValue();
         } catch (Exception e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         return ret;
     }
 
-    public void revokeRole(String roleName, User user) throws RollerException {
+    public void revokeRole(String roleName, User user) throws WebloggerException {
         UserRole removeme = null;
         Collection roles = user.getRoles();
         Iterator iter = roles.iterator();
@@ -1018,7 +1018,7 @@
     /**
      * Get count of users, enabled only
      */    
-    public long getUserCount() throws RollerException {
+    public long getUserCount() throws WebloggerException {
         long ret = 0;
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -1026,7 +1026,7 @@
             List result = session.createQuery(query).list();
             ret = ((Number)result.get(0)).intValue();
         } catch (Exception e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         return ret;
     }
@@ -1040,10 +1040,10 @@
     }
 
 
-	public User getUserByActivationCode(String activationCode) throws RollerException {
+	public User getUserByActivationCode(String activationCode) throws WebloggerException {
 
 		if (activationCode == null)
-			throw new RollerException("activationcode is null");
+			throw new WebloggerException("activationcode is null");
 
 		try {
 			Session session = ((HibernatePersistenceStrategy) this.strategy)
@@ -1056,7 +1056,7 @@
 
 			return user;
 		} catch (HibernateException e) {
-			throw new RollerException(e);
+			throw new WebloggerException(e);
 		}		
 	}
 }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/hibernate/HibernateWeblogManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -35,7 +35,7 @@
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.RollerFactory;
 import org.apache.roller.weblogger.business.WeblogManager;
 import org.apache.roller.weblogger.pojos.WeblogEntryComment;
@@ -88,7 +88,7 @@
     }
     
     
-    public void saveWeblogCategory(WeblogCategory cat) throws RollerException {
+    public void saveWeblogCategory(WeblogCategory cat) throws WebloggerException {
         
         if(cat == null) {
             throw new IllegalArgumentException("Category is null");
@@ -101,10 +101,10 @@
     }
     
     
-    public void removeWeblogCategory(WeblogCategory cat) throws RollerException {
+    public void removeWeblogCategory(WeblogCategory cat) throws WebloggerException {
         
         if(cat.retrieveWeblogEntries(true).size() > 0) {
-            throw new RollerException("Cannot remove category with entries");
+            throw new WebloggerException("Cannot remove category with entries");
         }
         
         // remove cat
@@ -129,11 +129,11 @@
     
     
     public void moveWeblogCategory(WeblogCategory srcCat, WeblogCategory destCat)
-            throws RollerException {
+            throws WebloggerException {
         
         // TODO: this check should be made before calling this method?
         if (destCat.descendentOf(srcCat)) {
-            throw new RollerException(
+            throw new WebloggerException(
                     "ERROR cannot move parent category into it's own child");
         }
         
@@ -154,11 +154,11 @@
     
     
     public void moveWeblogCategoryContents(WeblogCategory srcCat, WeblogCategory destCat)
-            throws RollerException {
+            throws WebloggerException {
                 
         // TODO: this check should be made before calling this method?
         if (destCat.descendentOf(srcCat)) {
-            throw new RollerException(
+            throw new WebloggerException(
                     "ERROR cannot move parent category into it's own child");
         }
         
@@ -192,7 +192,7 @@
     }
     
     
-    public void saveComment(WeblogEntryComment comment) throws RollerException {
+    public void saveComment(WeblogEntryComment comment) throws WebloggerException {
         this.strategy.store(comment);
         
         // update weblog last modified date.  date updated by saveWebsite()
@@ -200,7 +200,7 @@
     }
     
     
-    public void removeComment(WeblogEntryComment comment) throws RollerException {
+    public void removeComment(WeblogEntryComment comment) throws WebloggerException {
         this.strategy.remove(comment);
         
         // update weblog last modified date.  date updated by saveWebsite()
@@ -209,7 +209,7 @@
     
     
     // TODO: perhaps the createAnchor() and queuePings() items should go outside this method?
-    public void saveWeblogEntry(WeblogEntry entry) throws RollerException {
+    public void saveWeblogEntry(WeblogEntry entry) throws WebloggerException {
         
         if (entry.getAnchor() == null || entry.getAnchor().trim().equals("")) {
             entry.setAnchor(this.createAnchor(entry));
@@ -250,7 +250,7 @@
     }
     
     
-    public void removeWeblogEntry(WeblogEntry entry) throws RollerException {
+    public void removeWeblogEntry(WeblogEntry entry) throws WebloggerException {
         
         Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
         
@@ -300,7 +300,7 @@
     }
         
     public void removeWeblogEntryAttribute(String name,WeblogEntry entry)
-             throws RollerException {
+             throws WebloggerException {
         for (Iterator it = entry.getEntryAttributes().iterator(); it.hasNext();) {
             WeblogEntryAttribute entryAttribute = (WeblogEntryAttribute) it.next();
             if (entryAttribute.getName().equals(name)) {
@@ -315,7 +315,7 @@
     }
 
     public void removeWeblogEntryTag(String name,WeblogEntry entry)
-            throws RollerException {
+            throws WebloggerException {
         for (Iterator it = entry.getTags().iterator(); it.hasNext();) {
             WeblogEntryTag tag = (WeblogEntryTag) it.next();
             if (tag.getName().equals(name)) {
@@ -331,7 +331,7 @@
 
     public List getNextPrevEntries(WeblogEntry current, String catName, 
                                    String locale, int maxEntries, boolean next)
-            throws RollerException {
+            throws WebloggerException {
         
         Junction conjunction = Expression.conjunction();
         conjunction.add(Expression.eq("website", current.getWebsite()));
@@ -349,7 +349,7 @@
             if (category != null) {
                 conjunction.add(Expression.eq("category", category));
             } else {
-                throw new RollerException("Cannot find category: "+catName);
+                throw new WebloggerException("Cannot find category: "+catName);
             }
         }
         
@@ -366,14 +366,14 @@
             List results = criteria.list();
             return results;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     public WeblogCategory getRootWeblogCategory(Weblog website)
-    throws RollerException {
+    throws WebloggerException {
         if (website == null)
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -386,16 +386,16 @@
             return (WeblogCategory) criteria.uniqueResult();
             
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
     public List getWeblogCategories(Weblog website, boolean includeRoot)
-            throws RollerException {
+            throws WebloggerException {
         
         if (website == null) {
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         }
         
         try {
@@ -409,7 +409,7 @@
             
             return criteria.list();
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
@@ -427,7 +427,7 @@
             String      sortOrder,
             String      locale,
             int         offset,
-            int         length) throws RollerException {
+            int         length) throws WebloggerException {
         
         WeblogCategory cat = null;
         if (StringUtils.isNotEmpty(catName) && website != null) {
@@ -529,11 +529,11 @@
             
         } catch (HibernateException e) {
             log.error(e);
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
-    public List getWeblogEntriesPinnedToMain(Integer max) throws RollerException {
+    public List getWeblogEntriesPinnedToMain(Integer max) throws WebloggerException {
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
             Criteria criteria = session.createCriteria(WeblogEntry.class);
@@ -546,19 +546,19 @@
             return criteria.list();
         } catch (HibernateException e) {
             log.error(e);
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
     public WeblogEntry getWeblogEntryByAnchor(Weblog website, String anchor) 
-            throws RollerException {
+            throws WebloggerException {
         
         if (website == null)
-            throw new RollerException("Website is null");
+            throw new WebloggerException("Website is null");
         
         if (anchor == null)
-            throw new RollerException("Anchor is null");
+            throw new WebloggerException("Anchor is null");
         
         // mapping key is combo of weblog + anchor
         String mappingKey = website.getHandle()+":"+anchor;
@@ -602,14 +602,14 @@
             
             return entry;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
     // TODO: this method should be removed and it's functionality moved to getWeblogEntries()
     public List getWeblogEntries(WeblogCategory cat, boolean subcats)
-        throws RollerException {
+        throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -630,12 +630,12 @@
             return criteria.list();
             
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         
     }
         
-    public String createAnchor(WeblogEntry entry) throws RollerException {
+    public String createAnchor(WeblogEntry entry) throws WebloggerException {
         try {
             // Check for uniqueness of anchor
             String base = entry.createAnchorBase();
@@ -662,14 +662,14 @@
             }
             return name;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
     // TODO: provide unit test case
     public boolean isDuplicateWeblogCategoryName(WeblogCategory cat)
-            throws RollerException {
+            throws WebloggerException {
         
         // ensure that no sibling categories share the same name
         WeblogCategory parent = cat.getParent();
@@ -682,7 +682,7 @@
     
     
     public boolean isWeblogCategoryInUse(WeblogCategory cat)
-    throws RollerException {
+    throws WebloggerException {
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
             Criteria criteria = session.createCriteria(WeblogEntry.class);
@@ -712,7 +712,7 @@
             
             return false;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
@@ -728,7 +728,7 @@
             int             offset,
             int             length
             
-            ) throws RollerException {
+            ) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)this.strategy).getSession();
@@ -787,7 +787,7 @@
             
         } catch (HibernateException e) {
             log.error(e);
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
@@ -797,7 +797,7 @@
             String  searchString, 
             Date    startDate, 
             Date    endDate, 
-            String status) throws RollerException {
+            String status) throws WebloggerException {
 
         try {
             List comments = getComments( 
@@ -895,13 +895,13 @@
                         
         } catch (HibernateException e) {
             log.error(e);
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
     public WeblogCategory getWeblogCategory(String id)
-    throws RollerException {
+    throws WebloggerException {
         return (WeblogCategory) this.strategy.load(
                 id,
                 WeblogCategory.class);
@@ -911,7 +911,7 @@
     
     public WeblogCategory getWeblogCategoryByPath(Weblog website, 
                                                       String categoryPath) 
-            throws RollerException {
+            throws WebloggerException {
         
         if (categoryPath == null || categoryPath.trim().equals("/")) {
             return getRootWeblogCategory(website);
@@ -934,12 +934,12 @@
     }
     
         
-    public WeblogEntryComment getComment(String id) throws RollerException {
+    public WeblogEntryComment getComment(String id) throws WebloggerException {
         return (WeblogEntryComment) this.strategy.load(id,WeblogEntryComment.class);
     }
         
     public WeblogEntry getWeblogEntry(String id)
-    throws RollerException {
+    throws WebloggerException {
         return (WeblogEntry) this.strategy.load(
                 
                 id,WeblogEntry.class);
@@ -955,7 +955,7 @@
             String  status,
             String  locale,
             int     offset,
-            int     length) throws RollerException {
+            int     length) throws WebloggerException {
         return getWeblogEntryMap(
             website,
             startDate,
@@ -979,7 +979,7 @@
             String  locale,
             int     offset,
             int     length
-            ) throws RollerException {
+            ) throws WebloggerException {
         return getWeblogEntryMap(
             website,
             startDate,
@@ -1005,7 +1005,7 @@
             String  locale,
             int     offset,
             int     length
-            ) throws RollerException {
+            ) throws WebloggerException {
         
         TreeMap map = new TreeMap(reverseComparator);
         
@@ -1050,7 +1050,7 @@
     
     public List getMostCommentedWeblogEntries( 
             Weblog website, Date startDate, Date endDate, int offset, int length) 
-            throws RollerException {
+            throws WebloggerException {
         // TODO: ATLAS getMostCommentedWeblogEntries DONE
         String msg = "Getting most commented weblog entries";
         if (endDate == null) endDate = new Date();
@@ -1111,14 +1111,14 @@
             return results;
         } catch (Throwable pe) {
             log.error(msg, pe);
-            throw new RollerException(msg, pe);
+            throw new WebloggerException(msg, pe);
         }
     }
     
     
     public WeblogEntry getNextEntry(WeblogEntry current, String catName,
                                         String locale)
-            throws RollerException {
+            throws WebloggerException {
         
         WeblogEntry entry = null;
         List entryList = getNextPrevEntries(current, catName, locale, 1, true);
@@ -1131,7 +1131,7 @@
     
     public WeblogEntry getPreviousEntry(WeblogEntry current, String catName,
                                             String locale)
-            throws RollerException {
+            throws WebloggerException {
         
         WeblogEntry entry = null;
         List entryList = getNextPrevEntries(current, catName, locale, 1, false);
@@ -1149,7 +1149,7 @@
      * all existing entries in a website using a single HQL query.
      * @param website Website where comment defaults are from/to be applied.
      */
-    public void applyCommentDefaultsToEntries(Weblog website) throws RollerException {
+    public void applyCommentDefaultsToEntries(Weblog website) throws WebloggerException {
         if (log.isDebugEnabled()) {
             log.debug("applyCommentDefaults");
         }       
@@ -1173,7 +1173,7 @@
      * @see org.apache.roller.weblogger.model.WeblogManager#getPopularTags(org.apache.roller.weblogger.pojos.WebsiteData, java.util.Date, int)
      */
     public List getPopularTags(Weblog website, Date startDate, int limit)
-            throws RollerException {
+            throws WebloggerException {
         try {
             Session session = ((HibernatePersistenceStrategy) strategy)
                     .getSession();
@@ -1237,7 +1237,7 @@
             return results;
 
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
@@ -1247,7 +1247,7 @@
      * @see org.apache.roller.weblogger.model.WeblogManager#getTags(org.apache.roller.weblogger.pojos.WebsiteData,
      *      java.lang.String, java.lang.String, int)
      */
-    public List getTags(Weblog website, String sortBy, String startsWith, int limit) throws RollerException {    
+    public List getTags(Weblog website, String sortBy, String startsWith, int limit) throws WebloggerException {    
         try {
             List results = new ArrayList();
 
@@ -1287,7 +1287,7 @@
             return results;
 
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
 
     }
@@ -1300,7 +1300,7 @@
      * miss and we return false.
      */
     public boolean getTagComboExists(List tags, Weblog weblog) 
-            throws RollerException {
+            throws WebloggerException {
         
         boolean comboExists = false;
         
@@ -1330,24 +1330,24 @@
             comboExists = (results != null && results.size() == tags.size());
             
         } catch (HibernateException ex) {
-            throw new RollerException(ex);
+            throw new WebloggerException(ex);
         }
             
         return comboExists;
     }
     
     
-    public void updateTagCount(String name, Weblog website, int amount) throws RollerException {
+    public void updateTagCount(String name, Weblog website, int amount) throws WebloggerException {
         
         Session session = ((HibernatePersistenceStrategy) strategy)
         .getSession();
         
         if(amount == 0) {
-            throw new RollerException("Tag increment amount cannot be zero.");
+            throw new WebloggerException("Tag increment amount cannot be zero.");
         }
         
         if(website == null) {
-            throw new RollerException("Website cannot be NULL.");
+            throw new WebloggerException("Website cannot be NULL.");
         }
                         
         Junction conjunction = Expression.conjunction();
@@ -1405,7 +1405,7 @@
     }
     
     
-    public WeblogHitCount getHitCount(String id) throws RollerException {
+    public WeblogHitCount getHitCount(String id) throws WebloggerException {
         
         // do lookup
         try {
@@ -1417,12 +1417,12 @@
             
             return hitCount;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     public WeblogHitCount getHitCountByWeblog(Weblog weblog) 
-        throws RollerException {
+        throws WebloggerException {
         
         // do lookup
         try {
@@ -1434,13 +1434,13 @@
             
             return hitCount;
         } catch (HibernateException e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
     public List getHotWeblogs(int sinceDays, int offset, int length) 
-        throws RollerException {
+        throws WebloggerException {
         
         // figure out start date
         Calendar cal = Calendar.getInstance();
@@ -1469,32 +1469,32 @@
             return query.list();
             
         } catch (Throwable pe) {
-            throw new RollerException(pe);
+            throw new WebloggerException(pe);
         }
     }
     
     
-    public void saveHitCount(WeblogHitCount hitCount) throws RollerException {
+    public void saveHitCount(WeblogHitCount hitCount) throws WebloggerException {
         this.strategy.store(hitCount);
     }
     
     
-    public void removeHitCount(WeblogHitCount hitCount) throws RollerException {
+    public void removeHitCount(WeblogHitCount hitCount) throws WebloggerException {
         this.strategy.remove(hitCount);
     }
     
     
     public void incrementHitCount(Weblog weblog, int amount)
-        throws RollerException {
+        throws WebloggerException {
         
         Session session = ((HibernatePersistenceStrategy) strategy).getSession();
         
         if(amount == 0) {
-            throw new RollerException("Tag increment amount cannot be zero.");
+            throw new WebloggerException("Tag increment amount cannot be zero.");
         }
         
         if(weblog == null) {
-            throw new RollerException("Website cannot be NULL.");
+            throw new WebloggerException("Website cannot be NULL.");
         }
         
         Criteria criteria = session.createCriteria(WeblogHitCount.class);
@@ -1516,32 +1516,32 @@
     }
     
     
-    public void resetAllHitCounts() throws RollerException {
+    public void resetAllHitCounts() throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
             session.createQuery("update WeblogHitCount set dailyHits = 0").executeUpdate();
         } catch (Exception e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     
-    public void resetHitCount(Weblog weblog) throws RollerException {
+    public void resetHitCount(Weblog weblog) throws WebloggerException {
         
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
             String query = "update WeblogHitCount set dailyHits = 0 where weblog = ?";
             session.createQuery(query).setParameter(0, weblog).executeUpdate();
         } catch (Exception e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
     }
     
     /**
      * Get site-wide comment count 
      */
-    public long getCommentCount() throws RollerException {
+    public long getCommentCount() throws WebloggerException {
         return getCommentCount(null);
     }
 
@@ -1549,7 +1549,7 @@
     /**
      * Get weblog comment count 
      */    
-    public long getCommentCount(Weblog website) throws RollerException {
+    public long getCommentCount(Weblog website) throws WebloggerException {
         long ret = 0;
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -1567,7 +1567,7 @@
             List result = query.list();
             ret = ((Number)result.get(0)).intValue();
         } catch (Exception e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         return ret;
     }
@@ -1576,7 +1576,7 @@
     /**
      * Get site-wide entry count 
      */    
-    public long getEntryCount() throws RollerException {
+    public long getEntryCount() throws WebloggerException {
         return getEntryCount(null);
     }
 
@@ -1584,7 +1584,7 @@
     /**
      * Get weblog entry count 
      */    
-    public long getEntryCount(Weblog website) throws RollerException {
+    public long getEntryCount(Weblog website) throws WebloggerException {
         long ret = 0;
         try {
             Session session = ((HibernatePersistenceStrategy)strategy).getSession();
@@ -1602,7 +1602,7 @@
             List result = query.list();
             ret = ((Number)result.get(0)).intValue();
         } catch (Exception e) {
-            throw new RollerException(e);
+            throw new WebloggerException(e);
         }
         return ret;
     }

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPAAutoPingManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -20,7 +20,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.RollerFactory;
 import org.apache.roller.weblogger.business.pings.AutoPingManager;
 import org.apache.roller.weblogger.business.pings.PingQueueManager;
@@ -35,7 +35,7 @@
 import java.util.Iterator;
 import java.util.List;
 import javax.persistence.Query;
-import org.apache.roller.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy;
 
 /*
  * JPAAutoPingManagerImpl.java
@@ -61,20 +61,20 @@
         this.strategy = strategy;
     }
 
-    public AutoPing getAutoPing(String id) throws RollerException {
+    public AutoPing getAutoPing(String id) throws WebloggerException {
         return (AutoPing)strategy.load(AutoPing.class, id);
     }
 
-    public void saveAutoPing(AutoPing autoPing) throws RollerException {
+    public void saveAutoPing(AutoPing autoPing) throws WebloggerException {
         strategy.store(autoPing);
     }
 
-    public void removeAutoPing(AutoPing autoPing) throws RollerException {
+    public void removeAutoPing(AutoPing autoPing) throws WebloggerException {
         strategy.remove(autoPing);
     }
 
     public void removeAutoPing(PingTarget pingTarget, Weblog website)
-            throws RollerException {
+            throws WebloggerException {
         Query q = strategy.getNamedUpdate("AutoPing.removeByPingTarget&Website");
         q.setParameter(1, pingTarget);
         q.setParameter(2, website);
@@ -82,18 +82,18 @@
     }
 
     public void removeAutoPings(Collection autopings) 
-            throws RollerException {
+            throws WebloggerException {
         strategy.removeAll(autopings);
     }
 
     public void removeAllAutoPings() 
-            throws RollerException {
+            throws WebloggerException {
         Query q = strategy.getNamedUpdate("AutoPing.getAll");
         removeAutoPings(q.getResultList());
     }
 
     public void queueApplicableAutoPings(WeblogEntry changedWeblogEntry)
-            throws RollerException {
+            throws WebloggerException {
         if (PingConfig.getSuspendPingProcessing()) {
             if (logger.isDebugEnabled())
                 logger.debug("Ping processing is suspended." +
@@ -111,28 +111,28 @@
     }
 
     public List getAutoPingsByWebsite(Weblog website)
-            throws RollerException {
+            throws WebloggerException {
         Query q = strategy.getNamedQuery("AutoPing.getByWebsite");
         q.setParameter(1, website);
         return q.getResultList();
     }
 
     public List getAutoPingsByTarget(PingTarget pingTarget) 
-            throws RollerException {
+            throws WebloggerException {
         Query q = strategy.getNamedQuery("AutoPing.getByPingTarget");
         q.setParameter(1, pingTarget);
         return q.getResultList();
     }
 
     public List getApplicableAutoPings(WeblogEntry changedWeblogEntry) 
-            throws RollerException {
+            throws WebloggerException {
         return getAutoPingsByWebsite(changedWeblogEntry.getWebsite());
         //        return (List)strategy.newQuery(AutoPing.class, "AutoPing.getByWebsite")
         //            .execute(changedWeblogEntry.getWebsite());
     }
 
     public List getCategoryRestrictions(AutoPing autoPing)
-            throws RollerException {
+            throws WebloggerException {
         return Collections.EMPTY_LIST;
     }
 

Modified: roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java?view=diff&rev=543951&r1=543950&r2=543951
==============================================================================
--- roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java (original)
+++ roller/trunk/apps/weblogger/src/java/org/apache/roller/weblogger/business/jpa/JPABookmarkManagerImpl.java Sun Jun  3 11:16:02 2007
@@ -26,8 +26,8 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.business.jpa.JPAPersistenceStrategy;
-import org.apache.roller.RollerException;
+import org.apache.roller.weblogger.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.weblogger.WebloggerException;
 import org.apache.roller.weblogger.business.BookmarkManager;
 import org.apache.roller.weblogger.business.RollerFactory;
 import org.apache.roller.weblogger.pojos.WeblogBookmark;
@@ -63,7 +63,7 @@
         this.strategy = strategy;
     }
 
-    public void saveBookmark(WeblogBookmark bookmark) throws RollerException {
+    public void saveBookmark(WeblogBookmark bookmark) throws WebloggerException {
         boolean exists = getBookmark(bookmark.getId()) != null;        
         if (!exists) {
             // New object make sure that relationship is set on managed copy of other side
@@ -77,11 +77,11 @@
             saveWebsite(bookmark.getWebsite());
     }
 
-    public WeblogBookmark getBookmark(String id) throws RollerException {
+    public WeblogBookmark getBookmark(String id) throws WebloggerException {
         return (WeblogBookmark) strategy.load(WeblogBookmark.class, id);
     }
 
-    public void removeBookmark(WeblogBookmark bookmark) throws RollerException {
+    public void removeBookmark(WeblogBookmark bookmark) throws WebloggerException {
         //Now remove it from database
         this.strategy.remove(bookmark);
         //Remove the bookmark from its parent folder
@@ -91,12 +91,12 @@
                 .saveWebsite(bookmark.getWebsite());
     }
 
-    public void saveFolder(WeblogBookmarkFolder folder) throws RollerException {
+    public void saveFolder(WeblogBookmarkFolder folder) throws WebloggerException {
         
         if(folder.getId() == null || this.getFolder(folder.getId()) == null) {
             // New folder, so make sure name is unique
             if (isDuplicateFolderName(folder)) {
-                throw new RollerException("Duplicate folder name");
+                throw new WebloggerException("Duplicate folder name");
             }
 
             // And If it has a parent, maintain relationship from both sides
@@ -112,7 +112,7 @@
         RollerFactory.getRoller().getUserManager().saveWebsite(folder.getWebsite());
     }
 
-    public void removeFolder(WeblogBookmarkFolder folder) throws RollerException {
+    public void removeFolder(WeblogBookmarkFolder folder) throws WebloggerException {
         this.strategy.remove(folder);
         WeblogBookmarkFolder parent = folder.getParent();
         if (parent != null) {
@@ -125,11 +125,11 @@
     }
     
     public void moveFolder(WeblogBookmarkFolder srcFolder, WeblogBookmarkFolder destFolder)
-            throws RollerException {
+            throws WebloggerException {
         
         // TODO: this check should be made before calling this method?
         if (destFolder.descendentOf(srcFolder)) {
-            throw new RollerException(
+            throw new WebloggerException(
                     "ERROR cannot move parent folder into it's own child");
         }
         
@@ -157,7 +157,7 @@
     }    
 
     // updates the paths of all descendents of the given folder
-    private void updatePathTree(WeblogBookmarkFolder folder) throws RollerException {
+    private void updatePathTree(WeblogBookmarkFolder folder) throws WebloggerException {
         
         log.debug("Updating path tree for folder "+folder.getPath());
         
@@ -188,14 +188,14 @@
     /**
      * Retrieve folder and lazy-load it's sub-folders and bookmarks.
      */
-    public WeblogBookmarkFolder getFolder(String id) throws RollerException {
+    public WeblogBookmarkFolder getFolder(String id) throws WebloggerException {
         return (WeblogBookmarkFolder) strategy.load(WeblogBookmarkFolder.class, id);
     }
 
     
     public void importBookmarks(
             Weblog website, String folderName, String opml)
-            throws RollerException {
+            throws WebloggerException {
         String msg = "importBookmarks";
         try {
             // Build JDOC document OPML string
@@ -220,7 +220,7 @@
             }
 
         } catch (Exception ex) {
-            throw new RollerException(ex);
+            throw new WebloggerException(ex);
         }
     }
 
@@ -229,7 +229,7 @@
     // that is done by importBookmarks()
     private void importOpmlElement(
             Weblog website, Element elem, WeblogBookmarkFolder parent)
-            throws RollerException {
+            throws WebloggerException {
         String text = elem.getAttributeValue("text");
         String title = elem.getAttributeValue("title");
         String desc = elem.getAttributeValue("description");
@@ -285,7 +285,7 @@
 
 
     public WeblogBookmarkFolder getFolder(Weblog website, String path)
-            throws RollerException {
+            throws WebloggerException {
 
         if (path == null || path.trim().equals("/")) {
             return getRootFolder(website);
@@ -314,7 +314,7 @@
      *      org.apache.roller.weblogger.pojos.WeblogBookmarkFolder, boolean)
      */
     public List getBookmarks(WeblogBookmarkFolder folder, boolean subfolders) 
-            throws RollerException {
+            throws WebloggerException {
         Query query = null;
         List results = null;
 
@@ -337,9 +337,9 @@
     }
 
     public WeblogBookmarkFolder getRootFolder(Weblog website)
-            throws RollerException {
+            throws WebloggerException {
         if (website == null)
-            throw new RollerException("website is null");
+            throw new WebloggerException("website is null");
         
         Query q = strategy.getNamedQuery("WeblogBookmarkFolder.getByWebsite&ParentNull");
         q.setParameter(1, website);
@@ -351,9 +351,9 @@
     }
 
     public List getAllFolders(Weblog website)
-            throws RollerException {
+            throws WebloggerException {
         if (website == null)
-            throw new RollerException("Website is null");
+            throw new WebloggerException("Website is null");
         
         Query q = strategy.getNamedQuery("WeblogBookmarkFolder.getByWebsite");
         q.setParameter(1, website);
@@ -365,7 +365,7 @@
      * make sure the given folder doesn't already exist.
      */
     private boolean isDuplicateFolderName(WeblogBookmarkFolder folder) 
-        throws RollerException {
+        throws WebloggerException {
 
         // ensure that no sibling categories share the same name
         WeblogBookmarkFolder parent = folder.getParent();



Mime
View raw message