Index: /Users/gsilver/sakai-src/sakai25xxx/content/content-impl/impl/src/java/org/sakaiproject/content/impl/CollectionAccessFormatter.java =================================================================== --- /Users/gsilver/sakai-src/sakai25xxx/content/content-impl/impl/src/java/org/sakaiproject/content/impl/CollectionAccessFormatter.java (revision 55841) +++ /Users/gsilver/sakai-src/sakai25xxx/content/content-impl/impl/src/java/org/sakaiproject/content/impl/CollectionAccessFormatter.java (working copy) @@ -4,17 +4,17 @@ *********************************************************************************** * * Copyright (c) 2006 The Sakai Foundation. - * - * Licensed under the Educational Community License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. + * + * Licensed under the Educational Community License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.opensource.org/licenses/ecl1.php - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and * limitations under the License. * **********************************************************************************/ @@ -55,7 +55,7 @@ public static void format(ContentCollection x, Reference ref, HttpServletRequest req, HttpServletResponse res, String accessPointTrue, String accessPointFalse) { - // do not allow directory listings for /attachments and its subfolders + // do not allow directory listings for /attachments and its subfolders if(ContentHostingService.isAttachmentResource(x.getId())) { try @@ -62,8 +62,8 @@ { res.sendError(HttpServletResponse.SC_NOT_FOUND); return; - } - catch ( java.io.IOException e ) + } + catch ( java.io.IOException e ) { return; } @@ -68,7 +68,7 @@ return; } } - + PrintWriter out = null; // don't set the writer until we verify that // getallresources is going to work. @@ -147,11 +147,14 @@ String webappRoot = ServerConfigurationService.getServerUrl(); out.println(""); - if (basedir != null) + out.println(""); + if (basedir != null) { out.println(""); } @@ -156,19 +159,26 @@ out.println(""); } - out.println(""); + out.println("") ; + + out.println(""); + out.println("
"); // for content listing it's best to use a real title if (basedir != null) - out.println("

Contents of " + access + path + "

"); + out.println("

Contents of " + access + path + "

"); else { - out.println("

" + pl.getProperty(ResourceProperties.PROP_DISPLAY_NAME) + "

"); + out.println("

" + pl.getProperty(ResourceProperties.PROP_DISPLAY_NAME) + "

Show/hide descriptions

"); String desc = pl.getProperty(ResourceProperties.PROP_DESCRIPTION); - if (desc != null && !desc.equals("")) out.println("

" + desc + "

"); + if (desc != null && !desc.equals("")) out.println("
" + desc + "
"); } - - out.println(""); + if (sferyx) + out.println("
"); + else + out.println(""); else if (basedir != null) - out.println(""); + out.println("
  • Up one level
  • "); else - out.println(""); + out.println("
  • Up one level
  • "); } else if (sferyx) out @@ -283,18 +292,19 @@ + Validator.escapeHtml(xs) + ""); else if (basedir != null) - out.println(""); + + Validator.escapeHtml(xs) + ""); else { String desc = properties.getProperty(ResourceProperties.PROP_DESCRIPTION); - if (desc == null) desc = ""; - - out.println(""); + + "" + desc + ""); } } else @@ -315,17 +325,19 @@ + ""); else if (basedir != null) - out.println(""); + out.println("
  •   " + Validator.escapeHtml(xs) + "" + filesize + + ", " + createdBy + ", " + filetype + ", " + modifiedTime + "
  • "); else { String desc = properties.getProperty(ResourceProperties.PROP_DESCRIPTION); - if (desc == null) desc = ""; - - out.println(""); + + "" + desc + ""); } } } @@ -338,12 +350,11 @@ + Validator.escapeHtml(xs) + "\">"); else if (basedir != null) - out.println(""); + out.println("
  •   " + Validator.escapeHtml(xs) + "
  • "); else - out.println(""); + out.println("
  • " + Validator.escapeHtml(xs) + + "
  • "); } } @@ -354,9 +365,12 @@ if (out != null && printedHeader) { - out.println("
    Up one levelFolder" + "" - + "" + "" + "
    Up one level [Folder]
    File Folder 
     " - + Validator.escapeHtml(xs) + "Folder" + "" + "" - + "" + "
    " + if ((desc == null) || desc.equals("")) + desc = ""; + else + desc = "
    " + Validator.escapeHtml(desc) + "
    "; + out.println("
  • " + Validator.escapeHtml(properties.getProperty(ResourceProperties.PROP_DISPLAY_NAME)) - + " [Folder]
  • " + Validator.escapeHtml(desc) + "
      " + modifiedTime + "
      " + Validator.escapeHtml(xs) + "" + filesize - + "" + createdBy + "" + filetype + "" + modifiedTime + "
    " + if ((desc == null) || desc.equals("")) + desc = ""; + else + desc = "
    " + Validator.escapeHtml(desc) + "
    "; + out.println("
  • " + Validator.escapeHtml(properties.getProperty(ResourceProperties.PROP_DISPLAY_NAME)) - + "
  • " + Validator.escapeHtml(desc) + "
       
      " + Validator.escapeHtml(xs) + "" + "" - + "" + "" + "
    " + Validator.escapeHtml(xs) - + "
    "); + if (sferyx) + out.println(""); + else + out.println(""); if (printedDiv) out.println(""); - out.println(""); + out.println(""); } } @@ -388,7 +402,7 @@ { } } - + return null; } }