incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r165068 - in /incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets: AbstractTreePortlet.java tree/CMSTreeLoader.java
Date Wed, 27 Apr 2005 23:47:19 GMT
Author: taylor
Date: Wed Apr 27 16:47:17 2005
New Revision: 165068

URL: http://svn.apache.org/viewcvs?rev=165068&view=rev
Log:
setting the document and folder title needed to be more extensible

Modified:
    incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/AbstractTreePortlet.java
    incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/tree/CMSTreeLoader.java

Modified: incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/AbstractTreePortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/AbstractTreePortlet.java?rev=165068&r1=165067&r2=165068&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/AbstractTreePortlet.java
(original)
+++ incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/AbstractTreePortlet.java
Wed Apr 27 16:47:17 2005
@@ -25,6 +25,8 @@
 import org.apache.portals.bridges.common.GenericServletPortlet;
 import org.apache.portals.graffito.ContentModelService;
 import org.apache.portals.graffito.ContentSearchService;
+import org.apache.portals.graffito.model.Document;
+import org.apache.portals.graffito.model.Folder;
 import org.apache.portals.graffito.portlets.tree.CMSTreeLoader;
 import org.apache.portals.graffito.portlets.util.ServiceAccessor;
 
@@ -183,4 +185,25 @@
     {
         return rootLabel;
     }
+    
+    public String getFolderTitle(Folder folder)
+    {
+        return folder.getName();
+    }
+    
+    public String getDocumentTitle(Document document)
+    {
+        String title = document.getProperty("title");
+        if (title == null)
+        {
+            title = document.getName();
+            int pos = title.lastIndexOf(".");
+            if (pos != -1)
+            {
+                title = title.substring(0, pos);
+            }
+        }                
+        return title;
+    }
+    
 }

Modified: incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/tree/CMSTreeLoader.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/tree/CMSTreeLoader.java?rev=165068&r1=165067&r2=165068&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/tree/CMSTreeLoader.java
(original)
+++ incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/tree/CMSTreeLoader.java
Wed Apr 27 16:47:17 2005
@@ -50,7 +50,7 @@
             new TreeControlNode(
                     folder.getUri(), 
                     portlet.getFolderImage(),  
-                    folder.getName(), 
+                    portlet.getFolderTitle(folder), 
                     null, 
                     null, 
                     false, 
@@ -70,16 +70,7 @@
 	public TreeControlNode createDocumentNode(Document document) throws ContentManagementException
     {
         boolean isText = document.getContentType().equals("text/plain");
-        String title = document.getProperty("title");
-        if (title == null)
-        {
-            title = document.getName();
-            int pos = title.lastIndexOf(".");
-            if (pos != -1)
-            {
-                title = title.substring(0, pos);
-            }
-        }                
+        String title = portlet.getDocumentTitle(document);
         
     	TreeControlNode issueNode = 
             new TreeControlNode(



Mime
View raw message