# HG changeset patch # User robcast # Date 1462553411 -7200 # Node ID e6676b78dda770e4e00e059c2b76482b414c403f # Parent 51486c82ed89c5b4142742f0c9666b372adc8874 more cleanup. ImgInfo-*.jsp etc. now only in /api. diff -r 51486c82ed89 -r e6676b78dda7 webapp/src/main/webapp/ImgInfo-json.jsp --- 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 - . - #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() %> -<% } - } -%>} diff -r 51486c82ed89 -r e6676b78dda7 webapp/src/main/webapp/dirInfo-xml.jsp --- 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 - . - #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" %> -<% -// process request -docBean.setRequest(request); -// get directory -DocuDirectory dir = docBean.getDirectory(); -int dirSize = docBean.getNumPages(); - -%> -<% if (dir != null) { %> - <%= dirSize %> - <%= dir.getDirName() %> - <%= dir.getDir().getPath() %> -<% - if (docBean.isUseAuthorization()) { -%> <%= ! docBean.isAuthorized() %> -<% - } - if (!docBean.getRequest().hasOption("dir")) { - for (int i = 0; i < dirSize; i++) { - DocuDirent f = dir.get(i); - String fn = (f != null) ? f.getName() : "null"; -%> - <%= i+1 %> - - - -<% - } // for - } // if not dironly - } // if dir -%> diff -r 51486c82ed89 -r e6676b78dda7 webapp/src/main/webapp/dlContext-xml.jsp --- 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 - . - #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); - } -} -%> -<% -// 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"); -%> - -<% -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 %> - diff -r 51486c82ed89 -r e6676b78dda7 webapp/src/main/webapp/dlInfo-json.jsp --- 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 - . - #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 %>", -<% - } -%> -} diff -r 51486c82ed89 -r e6676b78dda7 webapp/src/main/webapp/dlInfo-xml.jsp --- 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 - . - #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); - } -} -%> -<% -// process request -// parsing the query -DigilibServletRequest dlRequest = new DigilibServletRequest(request); -docBean.setRequest(dlRequest); - -%> - -<% - 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 = ""; - } -%> -<% - } -%>