incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r159087 - in incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets: SearchPortlet.java TreePortlet.java
Date Sat, 26 Mar 2005 01:07:42 GMT
Author: taylor
Date: Fri Mar 25 17:07:41 2005
New Revision: 159087

URL: http://svn.apache.org/viewcvs?view=rev&rev=159087
Log:
bad practice: don't initialize associated objects  in static initalize

Modified:
    incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/SearchPortlet.java
    incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/TreePortlet.java

Modified: incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/SearchPortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/SearchPortlet.java?view=diff&r1=159086&r2=159087
==============================================================================
--- incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/SearchPortlet.java
(original)
+++ incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/SearchPortlet.java
Fri Mar 25 17:07:41 2005
@@ -28,6 +28,7 @@
 import javax.portlet.RenderResponse;
 
 import org.apache.portals.bridges.common.GenericServletPortlet;
+import org.apache.portals.graffito.ContentModelService;
 import org.apache.portals.graffito.ContentSearchService;
 import org.apache.portals.graffito.exception.ContentManagementException;
 import org.apache.portals.graffito.model.Document;
@@ -61,7 +62,8 @@
     private static final String NOT_FOUND = "No matching documents found for search criteria.";
 
     private ContentSearchService search = null;
-    private CMSTreeLoader loader = new CMSTreeLoader();
+    private ContentModelService cms = null;
+    private CMSTreeLoader loader ;
         
     //TODO: config via portlet.xml
     private int perPage = 10;
@@ -342,6 +344,13 @@
         {
             throw new PortletException("Failed to load CMS Search service");
         }
+        cms = ServiceAccessor.getModelService();
+        if (cms == null)
+        {
+            throw new PortletException("Failed to load CMS service");
+        }
+        
+        loader = new CMSTreeLoader(cms);
     }
     
 }

Modified: incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/TreePortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/TreePortlet.java?view=diff&r1=159086&r2=159087
==============================================================================
--- incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/TreePortlet.java
(original)
+++ incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/TreePortlet.java
Fri Mar 25 17:07:41 2005
@@ -245,14 +245,14 @@
     public void init(PortletConfig config) throws PortletException
     {
         super.init(config);
-        
-        loader = new CMSTreeLoader();
-        
+                
         cms = ServiceAccessor.getModelService();
         if (cms == null)
         {
             throw new PortletException("Failed to load CMS service");
         }
+        loader = new CMSTreeLoader(cms);
+
     }
 
                  



Mime
View raw message