changeset 457:4778d8af7913

nicer xml directory listing - size tag for directory - mo=dir outputs only top level directory
author robcast
date Thu, 02 Feb 2006 18:50:33 +0100
parents 2a9d37492997
children eec0d8c9c3c9
files client/digitallibrary/dirInfo-xml.jsp
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/dirInfo-xml.jsp	Wed Feb 01 18:16:21 2006 +0100
+++ b/client/digitallibrary/dirInfo-xml.jsp	Thu Feb 02 18:50:33 2006 +0100
@@ -29,9 +29,10 @@
   <name><%= dir.getDirName() %></name>
   <fsname><%= dir.getDir().getPath() %></fsname> 
 <%
-    int l = dir.size();
-    for (int i = 0; i < l; i++) {
-    		digilib.io.DocuDirent f = dir.get(i);
+    if (!dlRequest.hasOption("mo", "dir")) {
+      int l = dir.size();
+      for (int i = 0; i < l; i++) {
+        digilib.io.DocuDirent f = dir.get(i);
         String fn = (f != null) ? f.getName() : "null";
 %>  <file>
     <index><%= i+1 %></index>
@@ -39,6 +40,7 @@
     <fsname><%= fn %></fsname>
   </file>
 <%
-    } // for 
+      } // for 
+    } // if not dironly
   } // if dir 
 %></dir>