<%@ page language="java" session="false" import="java.util.Vector, java.util.Iterator, java.util.Random, uk.co.scharlau.prints.Print, javax.xml.transform.*, javax.xml.transform.stream.*" %> A Collection of Antiquarian Maps and Prints by Scharlau Prints and Maps <%@ include file ="scripts/header.txt" %> <% Random random = new Random(); int RandomInt = 0; String intString = "null"; RandomInt = random.nextInt(803); if(RandomInt == 0) { RandomInt = RandomInt + 15; } // RandomInt = RandomInt+2555; System.out.println("random " + RandomInt); Vector items = new Vector(); Print p2 = new Print(); items = p2.getRandomPrints(intString.valueOf(RandomInt)); // items = p2.getPrints("3573"); String abewords = "etching drypoint"; %>
<% Iterator iter = items.iterator(); int rowCount = 0; String []background = {"#FFFFFF", "#cccc99"}; while (iter.hasNext()) { Print p = new Print(); p = (Print) iter.next(); int tempStockID = p.getStockID(); String tempLocName = p.getLocationName(); String tempSubName = p.getSubjectName(); String tempJpegName = p.getJpegName(); if (tempJpegName.endsWith(".jpg")) { int SubstringLength = tempJpegName.length() - 4; tempJpegName = tempJpegName.substring(0, SubstringLength); tempJpegName = tempJpegName + "_small.jpg"; } // end of if String imageSubName = tempSubName; String tempTitle = p.getTitle(); String detailsURL = "http://www.scharlau.co.uk/scharlau.co.uk/Prints?action=details&StockID=" + tempStockID; String engraverURL = "http://www.scharlau.co.uk/scharlau.co.uk/Prints?action=artist&artist=" + p.getEngraverArtist(); String designerURL ="http://www.scharlau.co.uk/scharlau.co.uk/Prints?action=artist&artist=" + p.getDesignerArtist(); // get title for abebooks // check for trailing comma if (tempTitle.endsWith(",")) { System.out.println(tempTitle); tempTitle = tempTitle.substring(0,tempTitle.length()-1); } if (tempTitle.contains(",")) { int z = tempTitle.indexOf(","); System.out.println("has comma: " + tempTitle); String sub_1 = tempTitle.substring(0,z); String sub_2 = tempTitle.substring(z+1,tempTitle.length()); tempTitle = sub_1+sub_2; } tempTitle = tempTitle.replace("'","%27"); abewords = tempTitle.replace(" ","+"); System.out.println(abewords); %>

<%=tempTitle%> <%=tempLocName%> <%=tempSubName%> <%=tempStockID%> <%=tempTitle %> <%=p.getCategoryName()%> by <%=p.getEngraverName()%> after <%= p.getDesignerName()%> <%=p.getDate()%> <%=p.getDimensions()%> <%=p.getNotes()%> Search for items about <%=p.getEngraverName()%> at Abebooks.co.uk

<%} %> <% // need to provide the full path or it looks under jboss/bin String abePrep = ""; String xmlFile = "http://search2.abebooks.com/search?title="+abewords+"¤cy=GBP&outputsize=short&maxresults=5&clientkey=56574367-b3cc-41a8-bf73-19edb5723f83"; // if 0 need to have it go again using author String xslFile = "http://www.scharlau.co.uk/scharlau.co.uk/prints/abebooks.xsl"; %>
<% TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile)); transformer.transform( new StreamSource(xmlFile), new StreamResult(out)); %>

<%@ include file="scripts/bottomMenu.txt" %>