Mercurial > hg > digilib-old
comparison servlet/src/digilib/servlet/PDFCache.java @ 499:87d2ed21bdec Root_digilibPDF
changed generation of documentID in PDFCache
author | cmielack |
---|---|
date | Fri, 13 Feb 2009 11:08:19 +0100 |
parents | 86b5589f38db |
children |
comparison
equal
deleted
inserted
replaced
498:86b5589f38db | 499:87d2ed21bdec |
---|---|
82 } | 82 } |
83 | 83 |
84 | 84 |
85 public String getDocumentId(HttpServletRequest request){ | 85 public String getDocumentId(HttpServletRequest request){ |
86 // generate an unambiguous ID from the request (this is used for filenames etc) | 86 // generate an unambiguous ID from the request (this is used for filenames etc) |
87 // at this stage, the request-string is used | |
88 String id; | 87 String id; |
89 | 88 |
90 id = request.getQueryString() + ".pdf"; | 89 String fn = request.getParameter("fn"); |
90 String dh = request.getParameter("dh"); | |
91 String pgs = request.getParameter("pgs"); | |
92 | |
93 id = "fn=" + fn + "&dh=" + dh + "&pgs=" + pgs + ".pdf"; | |
91 | 94 |
92 return id; | 95 return id; |
93 } | 96 } |
94 | 97 |
95 | 98 |
110 } | 113 } |
111 } | 114 } |
112 | 115 |
113 else if (status == STATUS_PENDING){ | 116 else if (status == STATUS_PENDING){ |
114 // ... if it is in the works, notify the user about it ... | 117 // ... if it is in the works, notify the user about it ... |
115 String redir_url = "abc.jsp"; | |
116 try { | |
117 response.sendRedirect(redir_url); | |
118 } catch (IOException e) { | |
119 // TODO Auto-generated catch block | |
120 e.printStackTrace(); | |
121 } | |
122 } | 118 } |
123 else if (status == STATUS_NONEXISTENT){ | 119 else if (status == STATUS_NONEXISTENT){ |
124 // ... or else, generate the file and inform the user about the estimated generation-time | 120 // ... or else, generate the file and inform the user about the estimated generation-time |
125 try { | 121 try { |
126 createFile(request, response); | 122 createFile(request, response); |
127 response.sendRedirect(request.getRequestURI()+'?'+request.getQueryString()); // refresh the browser after finishing the file | 123 response.sendRedirect(request.getRequestURI()+'?'+request.getQueryString()+"&done=true"); // refresh the browser after finishing the file |
128 } catch (ServletException e) { | 124 } catch (ServletException e) { |
129 // TODO Auto-generated catch block | 125 // TODO Auto-generated catch block |
130 e.printStackTrace(); | 126 e.printStackTrace(); |
131 } catch (IOException e) { | 127 } catch (IOException e) { |
132 // TODO Auto-generated catch block | 128 // TODO Auto-generated catch block |