<%@ page session="false" %> <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %> <%@ page import="java.sql.*" %> <%@ page import="java.net.*" %> <%@ page import="java.util.*" %> <%@ page import="java.text.*" %> <%@ page import="org.opencms.loader.*, org.opencms.jsp.*, org.opencms.file.*, org.opencms.util.*" %> <%! boolean checkvalidurl(String urlstr) { if(urlstr == null){ return false; } try { URL url = new URL(urlstr); } catch (Exception ex){ return false; } return true; } %> <% CmsJspActionElement cmsact = new CmsJspActionElement(pageContext, request, response); CmsObject cms = cmsact.getCmsObject(); String connectionURL = "jdbc:mysql://wwww:3306/www-data"; Properties auth = new Properties(); auth.setProperty("user", "webuser"); auth.setProperty("password", ""); Connection connection = null; Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection(connectionURL, auth); Statement statement = connection.createStatement(); String query = "SELECT DISTINCT LEFT(year, 4) AS yronly " + "FROM preprints WHERE deleted=0 ORDER BY year DESC"; ResultSet rs = statement.executeQuery(query); ArrayList allyears = new ArrayList(); while(rs.next()){ String year = rs.getString("yronly"); allyears.add(year); } %>

 

 

<%! public String makeMenu(ArrayList all, String year, HttpServletRequest req) throws SQLException { String yearReq = req.getParameter("year"); if(yearReq != null && yearReq.length() > 0){ return ""; } String yearMenu = ""; boolean first = true; for(int pos=0; pos" + yearItem + "\n"; } return yearMenu; } %> <% out.println("

Stuttgarter Mathematische Berichte

"); %>

 

 

<% statement = connection.createStatement(); query = "SELECT preprints.*, authors.*, LEFT(year, 4) AS yronly "; query += "FROM preprints, authors, authxprep "; query += "WHERE "; query += "preprints.deleted = 0 AND "; query += "preprints.id = authxprep.prepid AND authxprep.aid = authors.aid "; String yearReq = request.getParameter("year"); if(yearReq != null && yearReq.length() > 0 && yearReq.matches("\\A\\d{4}\\Z")){ query += " AND year = \"" + yearReq + "\""; } query += " ORDER BY year DESC, number DESC, pos ASC"; rs = statement.executeQuery(query); String curYear = "initializer"; int count = 0; class AuthInfo { public String firstname; public String lastname; public String webhome; }; while (rs.next()) { ArrayList authors = new ArrayList(); String year = rs.getString("yronly"); String number = rs.getString("number"); String abstype = rs.getString("abstype"); do{ AuthInfo inf = new AuthInfo(); inf.firstname = rs.getString("firstname"); inf.lastname = rs.getString("lastname"); inf.webhome = rs.getString("webhome"); authors.add(inf); if(rs.isLast()){ break; } rs.next(); if(!rs.getString("yronly").equals(year) || !rs.getString("number").equals(number)){ rs.previous(); break; } } while(true); if(!year.equals(curYear)){ if(!curYear.equals("initializer")){ out.println("\n"); } curYear = year; out.println("

 

" + "

" + year + "

 

\n"); out.println("Top • "); out.println(makeMenu(allyears, year, request) + "

 

\n"); out.println("\n"); out.println("" + "\n"); } count++; out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); out.println(""); } if(count>0){ out.println("
NummerAutor(en)TitelAbstractPDF
" + year + "-" + number + ""); for(int pos=0; pos" + authItem.lastname + ", " + authItem.firstname + "
"); } else{ out.println(authItem.lastname + ", " + authItem.firstname + "
"); } } out.println("
" + rs.getString("title") + "\n" + "Abstract\n" + "PDF
\n"); } else{ out.println("Keine Einträge gefunden.\n"); } rs.close(); %>