<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ page trimDirectiveWhitespaces="true" %> <%@ page import="org.crosswire.xml.XMLBlock" %> <%@ page import="java.util.List" %> <%@ page import="java.util.Collections" %> <%@ page import="java.util.Arrays" %> <%@ page import="java.util.List" %> <%@ page import="java.util.ArrayList" %> <%@ page import="org.apache.log4j.Logger" %> <%@ page import="org.crosswire.webtools.annotation.*" %> <%@ page import="org.crosswire.webtools.*" %> <%@ page import="org.crosswire.data.DataObject" %> <%@ page import="org.crosswire.utils.HTTPUtils" %> <%! @Description(value = "Perform sanity checks on various parts of the dataset", name = "integritycheck/institution") public static class MyParameters extends Parameters { @Description(value = "Show this usage help", example = "true", defaultValue = "false") public Boolean help = false; // format(html) | xml @Override protected void afterLoad() { } @Override protected void customValidation() { } } %> <% MyParameters params = new MyParameters().loadFromRequest(request, response, false); String format = request.getParameter("format"); if (format == null) ((Parameters)params).format = "html"; if (params.getErrors().size() == 0 && !params.help) { boolean html = "html".equals(params.format); StringBuffer results = new StringBuffer(); String baseURL = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort(); // + request.getContextPath(); DataObject query = new DataObject(); String sql = "select I.INSTITUTIONID, NAME, KLNAME, KLNAMEABBREV, PLACE, COUNTRY, GROUP_CONCAT(distinct DOCUMENTID SEPARATOR ', ') DOCIDS, GROUP_CONCAT(distinct SHELFNUMBER SEPARATOR ', ') SHELFNUMS from INSTITUTION I left join SHELFINSTANCE SI ON I.INSTITUTIONID = SI.INSTITUTIONID left join SHELFINSTANCEPAGES SIP on SIP.SHELFID=SI.SHELFID where NAME is null or NAME = '' or PLACE is null or PLACE = '' or COUNTRY is null or COUNTRY = '' GROUP BY I.INSTITUTIONID"; List rows = query.getDataSet(sql); if (html) { results.append("

Institutions with likely problems

"); results.append(""); } else { results.append(""); } for (DataObject d : rows) { if (html) { results.append(""); results.append(""); results.append(""); results.append(""); results.append(""); results.append(""); results.append(""); results.append(""); results.append(""); results.append(""); https://ntvmr.uni-muenster.de/group/vmr-administration/page-and-image?instID=200 results.append(""); results.append(""); } else { results.append("\n"); } } if (html) results.append("
Inst IDNameKLNameKLNameAbbrevPlaceCountryCountry DEDocIDsShelfNumsFixMeURL
"+d.getStringValue("INSTITUTIONID")+""+d.getStringValue("NAME")+""+d.getStringValue("KLNAME")+""+d.getStringValue("KLNAMEABBREV")+""+d.getStringValue("PLACE")+""+d.getStringValue("COUNTRY")+""+d.getStringValue("COUNTRY_DE")+""+d.getStringValue("DOCIDS")+""+d.getStringValue("SHELFNUMS")+"fix me
"); else results.append(""); if (html) { %> <%=results%> <% } else { response.setContentType("text/xml"); %> <%=results%> <% } return; } ((Parameters)params).format = "html"; Serializer.reportErrors(request, response, out, params, true); %>