Mercurial > hg > digilib
changeset 1518:e6676b78dda7
more cleanup. ImgInfo-*.jsp etc. now only in /api.
author | robcast |
---|---|
date | Fri, 06 May 2016 18:50:11 +0200 |
parents | 51486c82ed89 |
children | 6f53339a8a39 |
files | webapp/src/main/webapp/ImgInfo-json.jsp webapp/src/main/webapp/dirInfo-xml.jsp webapp/src/main/webapp/dlContext-xml.jsp webapp/src/main/webapp/dlInfo-json.jsp webapp/src/main/webapp/dlInfo-xml.jsp |
diffstat | 5 files changed, 0 insertions(+), 327 deletions(-) [+] |
line wrap: on
line diff
--- a/webapp/src/main/webapp/ImgInfo-json.jsp Fri May 06 18:47:30 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -<%-- - #%L - digilib-webapp - %% - Copyright (C) 2003 - 2016 MPIWG Berlin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public - License along with this program. If not, see - <http://www.gnu.org/licenses/lgpl-3.0.html>. - #L% - Author: Robert Casties (robcast@berlios.de) - --%><%@page language="java" - import="digilib.io.ImageSet, - digilib.io.ImageFile, - digilib.util.ImageSize, - digilib.servlet.DigilibBean" - contentType="application/json"%><%! -// create DocumentBean instance for all JSP requests -DigilibBean docBean = new DigilibBean(); - -// initialize DocumentBean instance in JSP init -public void jspInit() { - try { - // set servlet init-parameter - docBean.setConfig(getServletConfig()); - } catch (javax.servlet.ServletException e) { - System.out.println(e); - } -} -%><% -// parsing the query -docBean.setRequest(request); -// get file -ImageSet imgFile = docBean.getImageSet(); - -%>{<% -if (imgFile != null) { - imgFile.checkMeta(); - ImageFile img = (ImageFile) imgFile.getBiggest(); - ImageSize imgSize = img.getSize(); -%> - "filename" : "<%= img.getName() %>", -<% - if (docBean.isUseAuthorization()) { -%> "auth_required" : <%= !docBean.isAuthorized() %>, -<% - } -%> "aspect" : <%= imgFile.getAspect() %>, - "dpi_x" : <%= imgFile.getResX() %>, - "dpi_y" : <%= imgFile.getResY() %><% - - if (imgSize != null) { -%>, - "width" : <%= imgSize.getWidth() %>, - "height" : <%= imgSize.getHeight() %> -<% } - } -%>}
--- a/webapp/src/main/webapp/dirInfo-xml.jsp Fri May 06 18:47:30 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -<%-- - #%L - digilib-webapp - %% - Copyright (C) 2004 - 2013 MPIWG Berlin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public - License along with this program. If not, see - <http://www.gnu.org/licenses/lgpl-3.0.html>. - #L% - Author: Robert Casties (robcast@users.sourceforge.net) - --%><%@ page language="java" - import="digilib.servlet.DigilibBean, - digilib.conf.DigilibServletConfiguration, - digilib.conf.DigilibServletRequest, - digilib.io.DocuDirectory, - digilib.io.DocuDirent, - digilib.io.FileOps, - java.io.File"%><%! -// create DocumentBean instance for all JSP requests -DigilibBean docBean = new DigilibBean(); - -// initialize DocumentBean instance in JSP init -public void jspInit() { - try { - // set servlet init-parameter - docBean.setConfig(getServletConfig()); - } catch (javax.servlet.ServletException e) { - System.out.println(e); - } -} -%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ page contentType="text/xml" %><?xml version="1.0" encoding="UTF-8" ?> -<% -// process request -docBean.setRequest(request); -// get directory -DocuDirectory dir = docBean.getDirectory(); -int dirSize = docBean.getNumPages(); - -%><!-- Automatically generated XML snippet with directory info --> -<dir><% if (dir != null) { %> - <size><%= dirSize %></size> - <name><%= dir.getDirName() %></name> - <fsname><%= dir.getDir().getPath() %></fsname> -<% - if (docBean.isUseAuthorization()) { -%> <auth-required><%= ! docBean.isAuthorized() %></auth-required> -<% - } - if (!docBean.getRequest().hasOption("dir")) { - for (int i = 0; i < dirSize; i++) { - DocuDirent f = dir.get(i); - String fn = (f != null) ? f.getName() : "null"; -%> <file> - <index><%= i+1 %></index> - <name><c:out value="<%= FileOps.basename(fn) %>"/></name> - <fsname><c:out value="<%= fn %>"/></fsname> - </file> -<% - } // for - } // if not dironly - } // if dir -%></dir>
--- a/webapp/src/main/webapp/dlContext-xml.jsp Fri May 06 18:47:30 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -<%-- - #%L - digilib-webapp - %% - Copyright (C) 2004 - 2013 MPIWG Berlin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public - License along with this program. If not, see - <http://www.gnu.org/licenses/lgpl-3.0.html>. - #L% - Author: Robert Casties (robcast@berlios.de) - --%><%@ page language="java" - import="digilib.servlet.DocumentBean, - digilib.conf.DigilibServletConfiguration, - digilib.conf.DigilibServletRequest, - digilib.io.DocuDirCache, - digilib.io.DocuDirent, - digilib.meta.MetadataMap"%><%! -// create DocumentBean instance for all JSP requests -DocumentBean docBean = new DocumentBean(); - -// initialize DocumentBean instance in JSP init -public void jspInit() { - try { - // set servlet init-parameter - docBean.setConfig(getServletConfig()); - } catch (javax.servlet.ServletException e) { - System.out.println(e); - } -} -%><?xml version="1.0" encoding="UTF-8" ?> -<% -// process request -// get digilib config -DigilibServletConfiguration dlConfig = docBean.getDlConfig(); -// parsing the query -DigilibServletRequest dlRequest = new DigilibServletRequest(request); -// dir cache -DocuDirCache dirCache = (DocuDirCache) dlConfig.getValue("servlet.dir.cache"); -%><!-- Automatically generated XML snippet with document context --> -<result> -<% -int pn = dlRequest.getAsInt("pn"); -String fn = dlRequest.getFilePath(); -String ctx = ""; -DocuDirent f = dirCache.getFile(fn, pn); -if (f != null) { - //ctx = "hasfile:"+f.getName(); - f.checkMeta(); - MetadataMap meta = f.getMeta().getFileMeta(); - if (meta != null) { - //ctx = "JSP:hasmeta!"; - if (meta.containsKey("context")) { - ctx = (String) meta.get("context"); - } - } -} -%><%= ctx %> -</result>
--- a/webapp/src/main/webapp/dlInfo-json.jsp Fri May 06 18:47:30 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -<%-- - #%L - digilib-webapp - %% - Copyright (C) 2004 - 2013 MPIWG Berlin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public - License along with this program. If not, see - <http://www.gnu.org/licenses/lgpl-3.0.html>. - #L% - Author: Robert Casties (robcast@berlios.de) - --%><%@ page language="java" - import="digilib.servlet.DocumentBean, - digilib.conf.DigilibServletRequest"%><%! -// create DocumentBean instance for all JSP requests -DocumentBean docBean = new DocumentBean(); - -// initialize DocumentBean instance in JSP init -public void jspInit() { - try { - // set servlet init-parameter - docBean.setConfig(getServletConfig()); - } catch (javax.servlet.ServletException e) { - System.out.println(e); - } -} -%><% -// parsing the query -DigilibServletRequest dlRequest = new DigilibServletRequest(request); -docBean.setRequest(dlRequest); -%> -// JSON format metadata about request and image -{ -<% - Object[] keys = dlRequest.getParams().keySet().toArray(); - java.util.Arrays.sort(keys); - int l = keys.length; - for (int i = 0; i < l; i++) { - String key = (String) keys[i]; - String val = dlRequest.getAsString(key); - if (val.length() == 0) { - val = ""; - } - %>"<%= key %>" : "<%= val %>", -<% - } -%> -}
--- a/webapp/src/main/webapp/dlInfo-xml.jsp Fri May 06 18:47:30 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -<%-- - #%L - digilib-webapp - %% - Copyright (C) 2004 - 2013 MPIWG Berlin - %% - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Lesser Public License for more details. - - You should have received a copy of the GNU General Lesser Public - License along with this program. If not, see - <http://www.gnu.org/licenses/lgpl-3.0.html>. - #L% - Author: Robert Casties (robcast@berlios.de) - --%><%@ page language="java" - import="digilib.servlet.DocumentBean, - digilib.conf.DigilibServletRequest"%><%! -// create DocumentBean instance for all JSP requests -DocumentBean docBean = new DocumentBean(); - -// initialize DocumentBean instance in JSP init -public void jspInit() { - try { - // set servlet init-parameter - docBean.setConfig(getServletConfig()); - } catch (javax.servlet.ServletException e) { - System.out.println(e); - } -} -%><?xml version="1.0" encoding="UTF-8" ?> -<% -// process request -// parsing the query -DigilibServletRequest dlRequest = new DigilibServletRequest(request); -docBean.setRequest(dlRequest); - -%><!-- Automatically generated XML snippet with document parameters --> -<document-parameters> -<% - Object[] keys = dlRequest.getParams().keySet().toArray(); - java.util.Arrays.sort(keys); - int l = keys.length; - for (int i = 0; i < l; i++) { - String key = (String) keys[i]; - String val = dlRequest.getAsString(key); - if (val.length() == 0) { - val = ""; - } -%> <parameter name="<%= key %>" value="<%= val %>"/> -<% - } -%></document-parameters>