<%@ page isThreadSafe="false" %><%@ include file="globalPaths.jsp" %><%@ include file="globalDefinitions.jsp" %><% String artist = request.getParameter("artist"); if (artist == null) { session.setAttribute("404.errorDescription", "Incorrect parameter value"); response.sendError(response.SC_NOT_FOUND); return; } %><% Cookie[] cookies; cookies = request.getCookies(); String cookieArtist = ""; for (int icook = 0; cookies != null && icook < cookies.length; icook++) { Cookie cookie = cookies[icook]; if ((cookie.getName()).equals("galleryArtistID")) { cookieArtist = cookie.getValue(); } } String remoteIP = "UndefinedIP"; if (request.getRemoteAddr() != null) { remoteIP = request.getRemoteAddr(); } %><% String query = ""; Connection connection = null; Statement statement = null; ResultSet resultSet = null; %><% String pack = ""; String artistFirstName = null; String snapshot = ""; String firstlastName = ""; String bio = ""; String timestampBio = ""; String company = ""; String temp = null; boolean needCaching = true; String portfolio = null; String version = null; %><% String wtype = null; String wcategory = null; Vector wtypes = new Vector(); Vector fineartCategories = new Vector(); Vector craftCategories = new Vector(); Vector commercialartCategories = new Vector(); %><% // Determine Artist's package and redirect to corresponding page for packages 0,2,3 // or to error page in case of inactive account, // otherwise load Artist's personal data. try { connection = openConnection(); statement = connection.createStatement(); query = "SELECT A.package,A.activeflag,A.showStudio,A.ipLastLoggedFrom," + " A.firstname, A.lastname, A.snapshot, A.biography, A.package, A.company," + " A.portfolio, A.version, A.timestamp," + " W.id FROM" + " galleryArtist A LEFT JOIN galleryArtwork W ON A.id=W.artist WHERE" + " (W.activeflag='Y' OR W.activeflag='L' or W.activeflag IS NULL) " + " AND A.activeflag!='F' AND A.id=" + quoteString(artist); resultSet = statement.executeQuery(query); if (resultSet.next()) { String af = resultSet.getString("A.activeflag"); if (!"Y".equals(af)) { needCaching = false; } if (!"admin".equals((String)session.getValue("admin.logged")) && !remoteIP.equals(resultSet.getString("A.ipLastLoggedFrom")) && !artist.equals(cookieArtist)) { if ("N".equals(af)) { throw new UserInputException("The pages you are trying to view belong" + " to an account that is not currently activated." + " If this is a new account, the artist needs to " + "complete the setup process before the artwork will be" + " available on the Internet"); } if ("P".equals(af)) { throw new UserInputException("The pages you are trying to view belong" + " to an account that has been closed. Please update " + "your bookmark"); } } portfolio = resultSet.getString("A.portfolio"); version = resultSet.getString("A.version"); pack = resultSet.getString("A.package"); if ("0".equals(pack)) { String wid = resultSet.getString("W.id"); if (wid != null) { sendRedirect(globalSite + "/artwork.jsp?artwork=" + URLEncoder.encode(wid)); return; } else throw new UserInputException("This lobby artist has no info or artworks"); } // Redirect to appropriate page at Artist Gallery // and Gallery Package account // Exception: Do not redirect if version is 0, which indicates // really old artist gallery (Mikhail Gorshunov) which uses // the same artwork.jsp as portfolio, so redirecting in such case // would result in an infinite loop. if ("2".equals(pack) && Double.valueOf(version) == 0.0) pack = "1"; if ("2".equals(pack)) { String biographyURL = portfolio + "/biogaphy.jsp"; if (!(biographyURL.startsWith("http:") || biographyURL.startsWith("https:"))) biographyURL = globalSite + "/" + biographyURL; sendRedirect(biographyURL); return; } if ("3".equals(pack)) { sendRedirect(globalSite + "/biographyps.jsp?artist=" + URLEncoder.encode(artist)); return; } if (! ("1".equals(pack) || "5".equals(pack))) { throw new Exception("Unknown package"); } if (resultSet.getString("A.firstName").equals("")) { firstlastName = toUpperCaseFirstLetter(resultSet.getString("A.lastName")); artistFirstName = firstlastName; } else { firstlastName = toUpperCaseFirstLetter(resultSet.getString("A.firstName")) + " " + toUpperCaseFirstLetter(resultSet.getString("A.lastName")); artistFirstName = toUpperCaseFirstLetter(resultSet.getString("A.firstName")); } snapshot = resultSet.getString("A.snapshot"); bio = resultSet.getString("A.biography"); try { if (resultSet.getTimestamp("A.timestamp")!=null); { timestampBio = resultSet.getString("A.timestamp"); timestampBio = substituteTokens(timestampBio,":",""); timestampBio = substituteTokens(timestampBio,"-",""); timestampBio = substituteTokens(timestampBio," ",""); } } catch (Exception e) { timestampBio = "00000000000000"; } company = resultSet.getString("A.company"); if (company == null || "none".equals(company)) company = ""; } else { throw new UserInputException("Artist not found"); } resultSet.close(); %><%@ include file="cacheBegin.jsp" %><% // Determine art types and categories // which happen for the current artist query = "SELECT DISTINCT type, category FROM galleryArtwork " + " WHERE (activeflag='Y' OR activeflag='L') AND artist=" + quoteString(artist); resultSet = statement.executeQuery(query); while (resultSet.next()) { wtype=resultSet.getString("type"); wcategory=resultSet.getString("category"); wtypes.addElement(wtype); if (wtype.equals("fineart")) { fineartCategories.addElement(wcategory); } if (wtype.equals("craft")) { craftCategories.addElement(wcategory); } if (wtype.equals("commercialart")) { commercialartCategories.addElement(wcategory); } } resultSet.close(); query = "SELECT DISTINCT OS.name FROM galleryOpenStudio OS " + "LEFT JOIN galleryOpenStudioArtist OSA ON OSA.openStudioId = OS.id " + "WHERE OSA.artist = " + quoteString(artist) + " GROUP BY OS.name"; resultSet = statement.executeQuery(query); while (resultSet.next()) { String oName=resultSet.getString("OS.name"); if ("Silicon Valley OPS".equals(oName)) { temp = "" + "Silicon Valley OPS
"; } if ("East Bay Open Studios (Pro Arts)".equals(oName)) { temp = "" + "Pro Arts East Bay
Open Studios

"; } if ("San Francisco OPS".equals(oName)) { temp = "" + "San Francisco OPS
"; } } resultSet.close(); %><% if (needCaching) { %><%@ include file="cacheLaunch.jsp" %><% } %> Biography: <%= firstlastName %> <%@ include file="bioTop.txt" %> <% if (wtypes.contains("fineart")) { %>   FINE ART: <% String FAtext = ""; if (fineartCategories.contains("painting")) FAtext += ",  Painting"; if (fineartCategories.contains("graphics")) FAtext += ",  Graphics"; if (fineartCategories.contains("printmaking")) FAtext += ",  Printmaking"; if (fineartCategories.contains("photography")) FAtext += ",  Photography"; if (fineartCategories.contains("sculpture")) FAtext += ",  Sculpture"; if (fineartCategories.contains("mixedmedia")) FAtext += ",  Mixed Media"; if (fineartCategories.contains("newmedia")) FAtext += ",  New Media"; if (fineartCategories.contains("installationart")) FAtext += ",  Installation Art"; if (fineartCategories.contains("artbooks")) FAtext += ",  Art Books"; if (FAtext.length() > 7) FAtext = FAtext.substring(7); out.print(FAtext); %> <% } if (wtypes.contains("craft")) { %>   CRAFT: <% String CRtext = ""; if (craftCategories.contains("ceramics")) CRtext += ",  Ceramics"; if (craftCategories.contains("glass")) CRtext += ",  Glass"; if (craftCategories.contains("jewelry")) CRtext += ",  Jewelry"; if (craftCategories.contains("furniture")) CRtext += ",  Furniture"; if (craftCategories.contains("metalart")) CRtext += ",  Fiber Art"; if (craftCategories.contains("wood")) CRtext += ",  Wood"; if (craftCategories.contains("textile")) CRtext += ",  Fiber Art"; if (CRtext.length() > 7) CRtext = CRtext.substring(7); out.print(CRtext); %> <% } if (wtypes.contains("commercialart")) { %>   GRAPHIC DESIGN: <% String CAtext = ""; if (commercialartCategories.contains("booksart")) CAtext += ",  Book Art"; if (commercialartCategories.contains("illustration")) CAtext += ",  Illustration"; if (commercialartCategories.contains("calligraphy")) CAtext += ",  Calligraphy"; if (commercialartCategories.contains("printdesign")) CAtext += ",  Print Design"; if (commercialartCategories.contains("typography")) CAtext += ",  Typography"; if (commercialartCategories.contains("webdesign")) CAtext += ",  Web Design"; if (CAtext.length() > 7) CAtext = CAtext.substring(7); out.print(CAtext); %> <% } %> <%@ include file="bioDown.txt" %>

<% if ("1".equals(pack)) { %> <%= artistFirstName %>'s Calendar

<% } %>
<% if (temp != null) out.print("
" + temp); %>
<% wtypes.removeAllElements(); fineartCategories.removeAllElements(); craftCategories.removeAllElements(); commercialartCategories.removeAllElements(); %><% if (needCaching) { %><%@ include file="cacheEnd.jsp" %><% } %><% } catch (UserInputException uie) { session.setAttribute("404.errorDescription", uie.getMessage()); response.sendError(response.SC_NOT_FOUND); return; } catch(Exception e) { errorLog(e, query); sendRedirect(globalErrorPage + "?errorDescription=" + URLEncoder.encode(e.getMessage() + ".")); return; } finally { if (resultSet != null) resultSet.close(); if (connection != null && !connection.isClosed()) connection.close(); } %><%@ include file="globalFinally.jsp" %>
?<%=timestampBio%> border=0 alt="Inquire" width="139">
  <%=firstlastName%> <% if (!"".equals(company.trim())) { %>

   <%=company%> <% } %>
 
          Artworks
          Biography
          Guest Book
          Contact Info
 

<%=convertHTMLSymbolsToPlainNew(bio)%>