incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r190850 - in /incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets: AbstractTreePortlet.java DocumentPortlet.java TreePortlet.java util/ServiceAccessor.java
Date Thu, 16 Jun 2005 01:48:21 GMT
Author: taylor
Date: Wed Jun 15 18:48:20 2005
New Revision: 190850

URL: http://svn.apache.org/viewcvs?rev=190850&view=rev
Log:
cleanup formatting of Print link, and View in New Window links at top

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/DocumentPortlet.java
    incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/TreePortlet.java
    incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/util/ServiceAccessor.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=190850&r1=190849&r2=190850&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 Jun 15 18:48:20 2005
@@ -15,6 +15,7 @@
  */
 package org.apache.portals.graffito.portlets;
 
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.StringTokenizer;
@@ -65,7 +66,7 @@
             throw new PortletException("Failed to load CMS service");
         }
         
-        loader = new CMSTreeLoader(cms, this);
+        loader = createTreeLoader(cms);
         
         String extensions = config.getInitParameter("extensions");
         String images = config.getInitParameter("images");
@@ -112,7 +113,17 @@
             imageMap.put(ext[ix], img[ix]);
         }
     }
+    
+    public CMSTreeLoader createTreeLoader(ContentModelService cms)
+    {
+    	return new CMSTreeLoader(cms, this);
+    }
 
+    public Comparator getComparator(String nodeLevel)
+    {
+    	return CMSTreeLoader.cmsComparator;
+    }
+    
     public static final String[] stringToArray(String str, String separators)
     {
         StringTokenizer tokenizer;

Modified: incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/DocumentPortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/DocumentPortlet.java?rev=190850&r1=190849&r2=190850&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/DocumentPortlet.java
(original)
+++ incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/DocumentPortlet.java
Wed Jun 15 18:48:20 2005
@@ -94,7 +94,7 @@
                     String contextPath = request.getContextPath();
                     String linkage = "<a target='_new' href='" + 
                                      contextPath + "/FileServlet?uri=" + currentFile + "'>Print</a>";
                           
-                    String currentDocument = "<b>" + title + "</b>";
+                    String currentDocument = ""; //"<b>" + title + "</b>";
                     if (stylesheet != null)
                     {
                         String styledef = "<link rel='stylesheet' type='text/css' media='all'
href='" + 
@@ -102,10 +102,10 @@
                         response.getPortletOutputStream().write(styledef.getBytes());
                     }
                     String out = "<table width='100%'><tr><td align='left'
style='font-size:9pt'>" 
-                        + currentDocument + "</td><td align='left'>" + linkage
+ "</td></tr></table>";                     
+                        + currentDocument + "</td><td align='right'>" + linkage
+ "</td></tr></table>";                     
                     String anchors = "<hr/>"; //createAnchors(doc);
                     response.getPortletOutputStream().write(out.getBytes());
-                    response.getPortletOutputStream().write(anchors.getBytes());
+                    //response.getPortletOutputStream().write(anchors.getBytes());
 
                     if (useScrollableDiv)
                         response.getPortletOutputStream().write(DIV_START.getBytes());
@@ -129,10 +129,10 @@
 				}
                 else if ((doc.getContentType().indexOf("image/") != -1))
                 {
-                    String currentDocument = "<b>" + title + "</b>"; 
+                    String currentDocument = ""; //"<b>" + title + "</b>"; 
                     String anchors = "<hr/>"; //createAnchors(doc);
                     response.getPortletOutputStream().write(currentDocument.getBytes());
-                    response.getPortletOutputStream().write(anchors.getBytes());
+                    //response.getPortletOutputStream().write(anchors.getBytes());
                     if (useScrollableDiv)
                         response.getPortletOutputStream().write(DIV_START.getBytes());
                     String gif = "<IMG SRC='" + request.getContextPath() + "/FileServlet?uri="
+ doc.getUri() + "'/>";
@@ -166,9 +166,12 @@
             title = doc.getName();
         
         String contextPath = request.getContextPath();
-        String linkage = "<a target='_new' href='" + 
-            contextPath + "/FileServlet?uri=" + currentFile + "'>View in New Window</a>";
       
-        String currentDocument = "<div>Document: <b>" + title + "</b>&nbsp"
+ linkage;
+
+        String linkage = "<table width='100%'><tr><td align='left' style='font-size:9pt'>"

+             + "</td><td align='right'>" + "<a target='_new' href='" + 
+                contextPath + "/FileServlet?uri=" + currentFile + "'>View in New Window</a>"
+ "</td></tr></table>";                     
+
+        String currentDocument = /* "<div>Document: <b>" + title + "</b>&nbsp"
+ */ linkage;
         response.getPortletOutputStream().write(currentDocument.getBytes());
         
         String iframe = "<iframe src=\"" + contextPath + "/FileServlet?uri=" + currentFile
+ "\"";

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?rev=190850&r1=190849&r2=190850&view=diff
==============================================================================
--- 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
Wed Jun 15 18:48:20 2005
@@ -202,7 +202,7 @@
         try
         {            
             Collection topLevel = cms.getFolders(folderRoot);
-            Collections.sort((List)topLevel, CMSTreeLoader.getComparator());
+            Collections.sort((List)topLevel, getComparator("root"));
             Iterator top = topLevel.iterator();
             while (top.hasNext())
             {
@@ -217,7 +217,7 @@
 
             // then get documents
             Collection docLevel = cms.getDocuments(folderRoot);
-            Collections.sort((List)docLevel, CMSTreeLoader.getComparator());
+            Collections.sort((List)docLevel, getComparator("folder"));
             Iterator docs = docLevel.iterator();
             while (docs.hasNext())
             {

Modified: incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/util/ServiceAccessor.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/util/ServiceAccessor.java?rev=190850&r1=190849&r2=190850&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/util/ServiceAccessor.java
(original)
+++ incubator/graffito/trunk/applications/graffito-portlets/src/java/org/apache/portals/graffito/portlets/util/ServiceAccessor.java
Wed Jun 15 18:48:20 2005
@@ -37,7 +37,7 @@
 {
     private static BeanFactory springFactory = null;
     
-    private static boolean useJetspeedServices = true;
+    private static boolean useJetspeedServices = false;
 
     public static ContentModelService getModelService()
     {        



Mime
View raw message