roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r392804 - in /incubator/roller/branches/roller-newbackend/src/org/roller: business/hibernate/HibernatePersistenceStrategy.java business/hibernate/HibernateUserManagerImpl.java model/UserManager.java
Date Sun, 09 Apr 2006 19:15:19 GMT
Author: agilliland
Date: Sun Apr  9 12:15:16 2006
New Revision: 392804

URL: http://svn.apache.org/viewcvs?rev=392804&view=rev
Log:
cleaning up some TODO comments and removing unused method fixPageLink()


Modified:
    incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernatePersistenceStrategy.java
    incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
    incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernatePersistenceStrategy.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernatePersistenceStrategy.java?rev=392804&r1=392803&r2=392804&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernatePersistenceStrategy.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernatePersistenceStrategy.java
Sun Apr  9 12:15:16 2006
@@ -44,7 +44,7 @@
     
     private static SessionFactory sessionFactory = null;
     
-    private static Log mLogger = LogFactory.getLog(HibernatePersistenceStrategy.class);
+    private static Log log = LogFactory.getLog(HibernatePersistenceStrategy.class);
     
     
     /**
@@ -52,7 +52,7 @@
      */
     public HibernatePersistenceStrategy() throws Exception {
         
-        mLogger.debug("Initializing Hibernate SessionFactory");
+        log.debug("Initializing Hibernate SessionFactory");
         
         Configuration config = new Configuration();
         config.configure("/hibernate.cfg.xml");
@@ -69,7 +69,7 @@
      */
     protected Session getSession() {
         
-        mLogger.debug("Getting hibernate session");
+        log.debug("Getting hibernate session");
         
         return sessionFactory.getCurrentSession();
     }
@@ -85,9 +85,9 @@
         if(session != null) {
             if(session.isOpen()) {
                 
-                mLogger.debug("Closing open hibernate session");
+                log.debug("Closing open hibernate session");
                 
-                // TODO: should we do a rollback() first?
+                // TODO BACKEND: should we do a rollback() first?
                 //session.getTransaction().rollback();
                 
                 session.close();
@@ -123,10 +123,9 @@
         
         Session session = getSession();
         
-        // TODO: this is wacky, we should double check logic here
+        // TODO BACKEND: this is wacky, we should double check logic here
         
-        
-        // TODO: better to use session.saveOrUpdate() here, if possible
+        // TODO BACKEND: better to use session.saveOrUpdate() here, if possible
         if ( obj.getId() == null || obj.getId().trim().equals("") ) {
             // Object has never been written to database, so save it.
             // This makes obj into a persistent instance.
@@ -141,7 +140,7 @@
             vo.setData(obj);
             obj = vo;
             
-            // TODO: do we need to call session.save() here?
+            // TODO BACKEND: do we need to call session.save() here?
         }
         
     }
@@ -167,7 +166,7 @@
             try {
                 getSession().getTransaction().rollback();
             } catch(HibernateException he) {
-                mLogger.error("Error doing rollback", he);
+                log.error("Error doing rollback", he);
             }
             
             release();
@@ -216,7 +215,7 @@
             try {
                 getSession().getTransaction().rollback();
             } catch(HibernateException he) {
-                mLogger.error("Error doing rollback", he);
+                log.error("Error doing rollback", he);
             }
             
             release();
@@ -235,6 +234,8 @@
             throw new HibernateException("Cannot remove null object");
         }
         
+        // TODO BACKEND: can hibernate take care of this check for us?
+        //               what happens if object does not use id?
         // can't remove transient objects
         if (obj.getId() != null) {
             
@@ -265,7 +266,7 @@
             try {
                 getSession().getTransaction().rollback();
             } catch(HibernateException he) {
-                mLogger.error("Error doing rollback", he);
+                log.error("Error doing rollback", he);
             }
             
             release();
@@ -278,7 +279,6 @@
     /**
      * Store hierarchical object.
      *
-     * TODO: this looks complicated.  needs some checking.
      * NOTE: if the object has proper cascade setting then is all this necessary?
      */
     protected void store(HierarchicalPersistentObject obj) 
@@ -293,7 +293,7 @@
         HierarchicalPersistentObject mNewParent = obj.getNewParent();
         boolean fresh = (obj.getId() == null || "".equals(obj.getId()));
         
-        // TODO: saveOrUpdate()?  check if transient?
+        // TODO BACKEND: saveOrUpdate()?  check if transient?
         session.save(obj);
         
         if (fresh) {
@@ -357,7 +357,7 @@
             throw new HibernateException("Cannot save null object");
         }
         
-        // TODO: double check that this is okay
+        // TODO BACKEND: double check that this is okay
         getSession().saveOrUpdate(assoc);
         
     }
@@ -366,7 +366,6 @@
     /**
      * Remove hierarchical object.
      *
-     * TODO: this is complicated.  needs some checking.
      * NOTE: if the object has proper cascade setting then is all this necessary?
      */
     protected void remove(HierarchicalPersistentObject obj) throws RollerException {
@@ -420,7 +419,7 @@
             throw new HibernateException("Cannot save null object");
         }
         
-        // TODO: double check that this is okay
+        // TODO BACKEND: double check that this is okay
         getSession().delete(assoc);
         
     }

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java?rev=392804&r1=392803&r2=392804&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateUserManagerImpl.java
Sun Apr  9 12:15:16 2006
@@ -130,7 +130,7 @@
     /**
      * convenience method for removing contents of a weblog.
      *
-     * TODO: we may be able to do this faster using Hibernate delete statements.
+     * TODO BACKEND: we may be able to do this faster using Hibernate delete statements.
      */
     private void removeWebsiteContents(WebsiteData website) 
             throws HibernateException, RollerException {
@@ -140,7 +140,7 @@
         BookmarkManager bmgr = RollerFactory.getRoller().getBookmarkManager();
         WeblogManager wmgr = RollerFactory.getRoller().getWeblogManager();
         
-//        // TODO: backend refactoring, tidy up ping removals
+//        // TODO BACKEND: backend refactoring, tidy up ping removals
 //        // Remove the website's ping queue entries
 //        PingQueueManager pingQueueMgr = RollerFactory.getRoller().getPingQueueManager();
 //        pingQueueMgr.removeQueueEntriesByWebsite(website);
@@ -192,7 +192,6 @@
             Iterator allFolders = bmgr.getAllFolders(website).iterator();
             while (allFolders.hasNext()) {
                 FolderData aFolder = (FolderData)allFolders.next();
-                // TODO: backend refactoring, how do we do this?
                 bmgr.deleteFolderContents(aFolder);
                 this.strategy.remove(aFolder);
             }
@@ -246,23 +245,9 @@
     
     
     /**
-     * TODO: EOL this method?  doesn't seem to be used
-     */
-    public String fixPageLink(WeblogTemplate data) throws RollerException {
-        String link = Utilities.removeHTML(data.getName());
-        link = Utilities.removeNonAlphanumeric(link);
-        
-        data.setLink(link);
-        this.strategy.storeAndCommit(data);
-        
-        return link;
-    }
-    
-    
-    /**
      * Add a new Roller user.
      *
-     * TODO: do we really need this method?  probably better if roles are added
+     * TODO BACKEND: do we really need this method?  probably better if roles are added
      *       elsewhere and then we just use storeUser().
      */
     public void addUser(UserData ud) throws RollerException {
@@ -272,7 +257,7 @@
             throw new RollerException("error.add.user.userNameInUse");
         }
         
-        // TODO: we must do this in a better fashion, like getUserCnt()?
+        // TODO BACKEND: we must do this in a better fashion, like getUserCnt()?
         boolean adminUser = false;
         List users = this.getUsers();
         if (users.size() == 0) {
@@ -447,7 +432,7 @@
     /**
      * Creates and stores a pending PermissionsData for user and website specified.
      *
-     * TODO: do we really need this?  can't we just use storePermissions()?
+     * TODO BACKEND: do we really need this?  can't we just use storePermissions()?
      */
     public PermissionsData inviteUser(WebsiteData website,
             UserData user, short mask) throws RollerException {
@@ -467,6 +452,8 @@
     
     /**
      * Remove user permissions from a website.
+     *
+     * TODO BACKEND: EOL this method?  we can just use storePermission()
      */
     public void retireUser(WebsiteData website, UserData user) throws RollerException {
         

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java?rev=392804&r1=392803&r2=392804&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java (original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/model/UserManager.java Sun
Apr  9 12:15:16 2006
@@ -211,8 +211,6 @@
     /** Get user's page by link */
     public WeblogTemplate getPageByLink(WebsiteData w, String p) throws RollerException;
     
-    /** Fix page link using page name */
-    public String fixPageLink(WeblogTemplate data) throws RollerException;
     
     /** Get users pages */
     public List getPages(WebsiteData w) throws RollerException;



Mime
View raw message