Mercurial > hg > digilib-old
comparison client/src/main/webapp/dirInfo-xml.jsp @ 892:ba1eb2d821a2 mvnify
rearrange sources to maven directory standard
author | robcast |
---|---|
date | Tue, 19 Apr 2011 18:44:25 +0200 |
parents | client/digitallibrary/dirInfo-xml.jsp@a667d2952aab |
children |
comparison
equal
deleted
inserted
replaced
891:6584af320296 | 892:ba1eb2d821a2 |
---|---|
1 <%@page import="digilib.io.FileOps"%><%@ page language="java" %><%! | |
2 // create DocumentBean instance for all JSP requests | |
3 digilib.servlet.DocumentBean docBean = new digilib.servlet.DocumentBean(); | |
4 | |
5 // initialize DocumentBean instance in JSP init | |
6 public void jspInit() { | |
7 try { | |
8 // set servlet init-parameter | |
9 docBean.setConfig(getServletConfig()); | |
10 } catch (javax.servlet.ServletException e) { | |
11 System.out.println(e); | |
12 } | |
13 } | |
14 %><?xml version="1.0" encoding="UTF-8" ?> | |
15 <% | |
16 // process request | |
17 // get digilib config | |
18 digilib.servlet.DigilibConfiguration dlConfig = docBean.getDlConfig(); | |
19 // parsing the query | |
20 digilib.servlet.DigilibRequest dlRequest = new digilib.servlet.DigilibRequest(request); | |
21 // dir cache | |
22 digilib.io.DocuDirCache dirCache = (digilib.io.DocuDirCache) dlConfig.getValue("servlet.dir.cache"); | |
23 // get directory | |
24 digilib.io.DocuDirectory dir = dirCache.getDirectory(dlRequest.getFilePath()); | |
25 FileOps.FileClass fc = FileOps.FileClass.IMAGE; | |
26 int dirSize = dir.size(fc); | |
27 | |
28 %><!-- Automatically generated XML snippet with directory info --> | |
29 <dir><% if (dir != null) { %> | |
30 <size><%= dirSize %></size> | |
31 <name><%= dir.getDirName() %></name> | |
32 <fsname><%= dir.getDir().getPath() %></fsname> | |
33 <% | |
34 if (!dlRequest.hasOption("mo", "dir")) { | |
35 for (int i = 0; i < dirSize; i++) { | |
36 digilib.io.DocuDirent f = dir.get(i, fc); | |
37 String fn = (f != null) ? f.getName() : "null"; | |
38 %> <file> | |
39 <index><%= i+1 %></index> | |
40 <name><%= digilib.io.FileOps.basename(fn) %></name> | |
41 <fsname><%= fn %></fsname> | |
42 </file> | |
43 <% | |
44 } // for | |
45 } // if not dironly | |
46 } // if dir | |
47 %></dir> |