tek-cvs Mailing List for TEK
Status: Beta
Brought to you by:
billthies
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(11) |
Oct
(19) |
Nov
(60) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(17) |
Feb
(8) |
Mar
|
Apr
|
May
(6) |
Jun
(17) |
Jul
(4) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(25) |
Jun
(11) |
Jul
(43) |
Aug
(81) |
Sep
|
Oct
(21) |
Nov
(2) |
Dec
(45) |
2006 |
Jan
|
Feb
|
Mar
(1) |
Apr
(8) |
May
|
Jun
(6) |
Jul
(16) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bill T. <bil...@us...> - 2006-07-24 06:02:10
|
Update of /cvsroot/tek/tek/client/proxy/proxymain In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17943/proxymain Modified Files: SocketHandler.java Log Message: Now that we are using a buffered output stream, every operation to the browser must either be a println() or followed by an explicit flush(). Index: SocketHandler.java =================================================================== RCS file: /cvsroot/tek/tek/client/proxy/proxymain/SocketHandler.java,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- SocketHandler.java 24 Jul 2006 02:11:36 -0000 1.72 +++ SocketHandler.java 24 Jul 2006 06:02:07 -0000 1.73 @@ -175,6 +175,7 @@ // If proxy isn't registered, go through registration if (TEKProxy.clientProtocol.getRegistrationStatus() == Client.REGISTRATION_UNSTARTED) { out.println("<SCRIPT>window.location='http://tek/'</SCRIPT>"); + out.flush(); return; } @@ -315,9 +316,11 @@ */ private void handleUncached(URL url, String connectionStatus, InputStream in, URLConnection connection) { - if (connectionStatus.equals("malformed")) //wrong url + if (connectionStatus.equals("malformed")) { //wrong url out.println("<SCRIPT> alert(\"Page does not exist. Please check the URL " - + "and try again.\");window.back(); </SCRIPT>"); + + "and try again.\");window.back(); </SCRIPT>"); + out.flush(); + } else if (!ProxyConstants.USE_DIRECT_CONNECTION || connectionStatus.equals("disconnected")) { //client not // connected @@ -345,6 +348,7 @@ "This link leads to an image. Due to bandwidth\\n" + "limitations, images are not yet supported in TEK." + "\"); window.close(); window.back(); </SCRIPT>"); + out.flush(); } } else { out.println("<SCRIPT>var ans=confirm(\"Would you like to request this page: " @@ -354,6 +358,7 @@ + "&command=makeurlrequest\"; window.close();" + "window.back();; window.close()} else{window.close(); window.back()}" + "</SCRIPT>"); + out.flush(); } } else if (connectionStatus.equals("connected") && // the following test should be redundant, but @@ -380,6 +385,7 @@ String line = ""; while ((line = reader.readLine()) != null) { out.println(line); + out.flush(); } reader.close(); in.close(); @@ -435,6 +441,7 @@ if (newResults) { // if new results, need to flash and replace out.print("<SCRIPT>window.location=\"http://tek/" + pageName + "\"</SCRIPT>"); + out.flush(); } else { // otherwise, can print directly printDocument(ProxyConstants.ProxyDirectory + ProxyConstants.PathSep @@ -479,6 +486,7 @@ if (update == 1) { out.print("<SCRIPT> window.location=\"" + wholeURL + "\"</SCRIPT>"); + out.flush(); // just print out the page as normal } else { @@ -543,6 +551,7 @@ + ProxyConstants.PathSep + "queryloading.html"); out.print(contents); + out.flush(); } catch (Exception e) { } // process results @@ -729,6 +738,7 @@ .print("</TR></table><img src=\"black.gif\" width=775 height=1>" + "<table align=left border=0, cellspacing=0, cellpadding=2 width=775>"); } + out.flush(); } /** @@ -776,6 +786,7 @@ .print("</TR></table><img src=\"black.gif\" width=775 height=1>" + "<table align=left border=0 cellspacing=0 cellpadding=2 width=775>"); } + out.flush(); } /** @@ -787,9 +798,11 @@ private boolean printColor(boolean color) { if (color) { out.print("style=\"background: #EBEBEB ;\"><TD width=2%></TD>"); + out.flush(); return false; } else { out.print("style=\"background: #F7F7F7 ;\"<TD width=2%></TD>"); + out.flush(); return true; } } @@ -829,6 +842,7 @@ .getDate(), query.getDate().getYear()) + " " + "</font></TD></TR>"); } + out.flush(); } /** @@ -857,6 +871,7 @@ .println("</table><img src=\"black.gif\" width=775 height=1><br>"); else if (count == 0) out.println("</table><br>"); + out.flush(); return color; } @@ -892,6 +907,7 @@ .println("</table><img src=\"black.gif\" width=775 height=1><br>"); else if (count == 0) out.println("</table><br>"); + out.flush(); return color; } @@ -932,6 +948,7 @@ .println("</table><img src=\"black.gif\" width=775 height=1><br>"); else if (count == 0) out.println("</table><br>"); + out.flush(); return color; } @@ -961,6 +978,7 @@ + "</font></TD><TD width=4%>"); addOns(URLDecoder.decode(query.getName()), notTerm, "bas"); + out.flush(); return color; } @@ -998,6 +1016,7 @@ out.println("</table>"); if (size + urls.size() != 0) printSubmitToTEK(sending); + out.flush(); return color; } @@ -1061,6 +1080,7 @@ out.print(numofRes + " results </font></a></TD>"); } } + out.flush(); } /** @@ -1083,6 +1103,7 @@ out.print("<TD width=14%><font face=\"verdana\" size=2>No results" + "</font></TD>"); } + out.flush(); } /** @@ -1110,6 +1131,7 @@ + printHidden("command", "refinesearch") + "<INPUT type=\"submit\" value=\"Refine\"></FORM></TD>"); + out.flush(); } /** @@ -1132,6 +1154,7 @@ + "<INPUT type=\"submit\" value=\"Delete\"></FORM></TD>"; out.print(output); + out.flush(); } /** @@ -1204,6 +1227,7 @@ + "</font></TD></TR>"); } + out.flush(); } /** helper function for deletesearch for terms with multiple terms */ @@ -1255,6 +1279,7 @@ + URLEncoder.encode(notTerm) + "\"> Previous result (" + numofRes + ")</a></TD></TR>"); } + out.flush(); } /** @@ -1287,6 +1312,7 @@ } out.println("</CENTER>"); } + out.flush(); } /* 4.25.02 cleaned html code. */ @@ -1377,6 +1403,7 @@ } + out.flush(); } /* * @effects : in response to tek html tag <tekquerysummary>, prints out * the summary of a search query made my the client @@ -1414,6 +1441,7 @@ String image = (String) searchFields.get(QueryFileHandler.IMG); if (image != null && !image.equals("null") && !image.equals("")) out.println(getEntry("Image Option:", image)); + out.flush(); } // helper method for printQuerySummary that returns a string with the value @@ -1453,6 +1481,7 @@ + "'; </SCRIPT>"); } + out.flush(); } /** @@ -1578,6 +1607,7 @@ + " " + "</font></td></tr></table>"); } + out.flush(); } /** @@ -1606,6 +1636,7 @@ printLuceneResults(results, page, terms.replace(" AND ", " "), tnot); printPrevNext(terms, tnot, status, page, results.size()); + out.flush(); return; //for a results page ordered by relevance @@ -1621,6 +1652,7 @@ .equals("normal")))) { out.println("<SCRIPT>alert('Please enter search terms.');" + "window.back();" + "</SCRIPT>"); + out.flush(); return; } else if (newTerms.equals("") && (url == null || url.equals("")) && (type.length() == 3 && type.equals("url"))) { @@ -1629,11 +1661,13 @@ + " For example, http://news.bbc.co.uk/');" + "window.location.replace('http://tek/results.html?main=1');" + "</SCRIPT>"); + out.flush(); return; } // goes to URL search if (newTerms.equals("") && tnot.equals("")) { printURLSearchResults(url.trim()); + out.flush(); return; } Vector results = Local.search(newTerms + notTerm); @@ -1666,6 +1700,7 @@ printNoResult("url", url, ""); out.print(" <SCRIPT> document.other.url.value='" + url + "'; </SCRIPT>"); + out.flush(); return; } } @@ -1692,7 +1727,7 @@ } // goes directly to the page out.print(output); - + out.flush(); } private boolean tryBothURL(String url) { @@ -1778,6 +1813,7 @@ String resStr = ""; if (results.size() == 0) { printNoResult("bas", query, not); + out.flush(); return; } out @@ -1809,6 +1845,7 @@ + "</font></p></td></tr>"); } out.println("</TABLE>"); + out.flush(); } /** @@ -1957,6 +1994,7 @@ if (size > 10) out.println("</table><br>"); } + out.flush(); } /** @@ -2301,6 +2339,7 @@ out.println("<BODY onLoad=\"document.form.main.focus()\">"); else out.println("<BODY onload=\"document.submitquery.tek.focus()\">"); + out.flush(); } /** @return the String form of a month * */ @@ -2342,6 +2381,7 @@ + "<a href=\"http://tek/tekcommand.html?command=logout\"> " + "<img border=0 src=\"logout.gif\"></a></td></tr>"); } + out.flush(); } /** |
From: Bill T. <bil...@us...> - 2006-07-24 06:02:10
|
Update of /cvsroot/tek/tek/client/proxy/proxyutils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17943/proxyutils Modified Files: TEKCommands.java Log Message: Now that we are using a buffered output stream, every operation to the browser must either be a println() or followed by an explicit flush(). Index: TEKCommands.java =================================================================== RCS file: /cvsroot/tek/tek/client/proxy/proxyutils/TEKCommands.java,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- TEKCommands.java 24 Jul 2006 02:11:36 -0000 1.51 +++ TEKCommands.java 24 Jul 2006 06:02:08 -0000 1.52 @@ -640,7 +640,7 @@ */ private static void deleteOutgoingAll(PrintWriter out) { deleteOutgoing(); - out.print("<SCRIPT> window.history.go(-2); </SCRIPT>"); + out.println("<SCRIPT> window.history.go(-2); </SCRIPT>"); } /** @@ -667,7 +667,7 @@ } File f = new File(ClientConstants.OutgoingList); deleteOutgoing(); - out.print("<SCRIPT>" + replace("http://tek") + "</SCRIPT>"); + out.println("<SCRIPT>" + replace("http://tek") + "</SCRIPT>"); } /** command to send the search */ @@ -713,7 +713,7 @@ URLRequestGenerator.delUrl(user, urlsToDelete); output = output + "url," + terms; } - out.print("<SCRIPT>" + out.println("<SCRIPT>" + replace("http://tek/search.html?" + "file=" + output) + " </SCRIPT>"); @@ -742,7 +742,7 @@ } else { output = output + "url," + URLEncoder.encode(query); } - out.print(" <SCRIPT>" + out.println(" <SCRIPT>" + replace("http://tek/search.html?" + "file=" + output) + " </SCRIPT>"); } |
From: Bill T. <bil...@us...> - 2006-07-24 05:49:50
|
Update of /cvsroot/tek/tek/server/protocol/tputils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14799/server/protocol/tputils Modified Files: lib.java Log Message: Don't forget to flush. Index: lib.java =================================================================== RCS file: /cvsroot/tek/tek/server/protocol/tputils/lib.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- lib.java 24 Jul 2006 05:18:29 -0000 1.4 +++ lib.java 24 Jul 2006 05:49:48 -0000 1.5 @@ -94,6 +94,7 @@ // refactor to make it explicit that it's shared tek.client.protocol.utils.ClientConstants.CHARSET)); out.write(str, 0, i); // write all characters of str to the outputFile + out.flush(); out.close(); } else @@ -105,6 +106,7 @@ // refactor to make it explicit that it's shared tek.client.protocol.utils.ClientConstants.CHARSET)); out.write(str, 0, i); // write all characters of str to the outputFile + out.flush(); out.close(); } |
From: Bill T. <bil...@us...> - 2006-07-24 05:49:50
|
Update of /cvsroot/tek/tek/client/protocol/utils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14799/client/protocol/utils Modified Files: lib.java Log Message: Don't forget to flush. Index: lib.java =================================================================== RCS file: /cvsroot/tek/tek/client/protocol/utils/lib.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- lib.java 24 Jul 2006 05:11:12 -0000 1.10 +++ lib.java 24 Jul 2006 05:49:48 -0000 1.11 @@ -114,6 +114,7 @@ // write all characters of str to the outputFile out.write(str, 0, i); + out.flush(); out.close(); } else @@ -129,6 +130,7 @@ new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), ClientConstants.CHARSET)); out.write(str, 0, i); + out.flush(); out.close(); } else @@ -141,6 +143,7 @@ ClientConstants.CHARSET)); // write all characters of str to the outputFile out.write(str, 0, i); + out.flush(); out.close(); } |
From: Bill T. <bil...@us...> - 2006-07-24 05:18:31
|
Update of /cvsroot/tek/tek/server/protocol/tputils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1507/server/protocol/tputils Modified Files: lib.java Log Message: Add Java 1.4 compatibility to ClientConstants (requires extra case). Make the server's file I/O library respect the character set. Index: lib.java =================================================================== RCS file: /cvsroot/tek/tek/server/protocol/tputils/lib.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- lib.java 20 Dec 2001 01:48:15 -0000 1.3 +++ lib.java 24 Jul 2006 05:18:29 -0000 1.4 @@ -37,8 +37,13 @@ // otherwise try to read input from the file { try - { File emailFile = new File(emailFileName); - FileReader emailReader = new FileReader(emailFile); + { + + Reader emailReader = + new BufferedReader(new InputStreamReader(new FileInputStream(emailFileName), + // bad dependence on client, could + // refactor to make it explicit that it's shared + tek.client.protocol.utils.ClientConstants.CHARSET)); while ((c = emailReader.read()) != -1) { ch = (char)c; @@ -83,14 +88,22 @@ if (!(outputFile.exists())) { - FileWriter out = new FileWriter(outputFile); - out.write(str, 0, i); // write all characters of str to the outputFile - out.close(); + Writer out = + new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), + // bad dependence on client, could + // refactor to make it explicit that it's shared + tek.client.protocol.utils.ClientConstants.CHARSET)); + out.write(str, 0, i); // write all characters of str to the outputFile + out.close(); } else { //throw new BadFileNameException(); - FileWriter out = new FileWriter(filename, true); + Writer out = + new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename, true), + // bad dependence on client, could + // refactor to make it explicit that it's shared + tek.client.protocol.utils.ClientConstants.CHARSET)); out.write(str, 0, i); // write all characters of str to the outputFile out.close(); } |
From: Bill T. <bil...@us...> - 2006-07-24 05:18:31
|
Update of /cvsroot/tek/tek/client/protocol/utils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1507/client/protocol/utils Modified Files: ClientConstants.java Log Message: Add Java 1.4 compatibility to ClientConstants (requires extra case). Make the server's file I/O library respect the character set. Index: ClientConstants.java =================================================================== RCS file: /cvsroot/tek/tek/client/protocol/utils/ClientConstants.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- ClientConstants.java 24 Jul 2006 02:11:36 -0000 1.50 +++ ClientConstants.java 24 Jul 2006 05:18:29 -0000 1.51 @@ -67,7 +67,7 @@ /** * Actual charset object for the charset in use. */ - public static final Charset CHARSET = Charset.availableCharsets().get(CHARSET_NAME); + public static final Charset CHARSET = (Charset)Charset.availableCharsets().get(CHARSET_NAME); // the current version of the TEK Client. Append an "L" for // linux. The server currently does a test to see if there is an |
From: Bill T. <bil...@us...> - 2006-07-24 05:11:15
|
Update of /cvsroot/tek/tek/client/protocol/utils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31333/protocol/utils Modified Files: lib.java Log Message: Another bug fix with character encoding. Index: lib.java =================================================================== RCS file: /cvsroot/tek/tek/client/protocol/utils/lib.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- lib.java 24 Jul 2006 05:06:45 -0000 1.9 +++ lib.java 24 Jul 2006 05:11:12 -0000 1.10 @@ -136,7 +136,9 @@ // of the file { //throw new BadFileNameException(); - FileWriter out = new FileWriter(filename, true); + Writer out = + new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename, true), + ClientConstants.CHARSET)); // write all characters of str to the outputFile out.write(str, 0, i); out.close(); |
From: Bill T. <bil...@us...> - 2006-07-24 05:06:47
|
Update of /cvsroot/tek/tek/client/protocol/utils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv28553 Modified Files: lib.java Log Message: Be careful about the character set when reading/writing files. Index: lib.java =================================================================== RCS file: /cvsroot/tek/tek/client/protocol/utils/lib.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- lib.java 7 Jun 2005 19:29:50 -0000 1.8 +++ lib.java 24 Jul 2006 05:06:45 -0000 1.9 @@ -53,11 +53,13 @@ { try { File emailFile = new File(emailFileName); - FileReader emailReader = new FileReader(emailFile); + Reader emailReader = + new BufferedReader(new InputStreamReader(new FileInputStream(emailFileName), + ClientConstants.CHARSET)); while ((c = emailReader.read()) != -1) { ch = (char)c; - out = out.append(ch); + out.append(ch); } emailReader.close(); } @@ -106,7 +108,10 @@ if (!(outputFile.exists())) { - FileWriter out = new FileWriter(outputFile); + Writer out = + new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), + ClientConstants.CHARSET)); + // write all characters of str to the outputFile out.write(str, 0, i); out.close(); @@ -120,8 +125,9 @@ // first delete the old file outputFile.delete(); // now create a new one. - File f = new File(filename); - FileWriter out = new FileWriter(f); + Writer out = + new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), + ClientConstants.CHARSET)); out.write(str, 0, i); out.close(); } |
From: Bill T. <bil...@us...> - 2006-07-24 04:51:50
|
Update of /cvsroot/tek/tek/client/proxy In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21291 Added Files: triangle.gif Log Message: Adding in binary mode. --- NEW FILE: triangle.gif --- (This appears to be a binary file; contents omitted.) |
From: Bill T. <bil...@us...> - 2006-07-24 04:51:24
|
Update of /cvsroot/tek/tek/client/proxy In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21265 Removed Files: triangle.gif Log Message: Removing to fix format error. --- triangle.gif DELETED --- |
From: Bill T. <bil...@us...> - 2006-07-24 02:11:40
|
Update of /cvsroot/tek/tek/client/proxy/proxyutils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22011/proxy/proxyutils Modified Files: TEKCommands.java Log Message: For internationalization, use PrintWriter's configured with the appropriate character set rather then using raw PrintStream's. Index: TEKCommands.java =================================================================== RCS file: /cvsroot/tek/tek/client/proxy/proxyutils/TEKCommands.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- TEKCommands.java 14 Apr 2006 21:33:05 -0000 1.50 +++ TEKCommands.java 24 Jul 2006 02:11:36 -0000 1.51 @@ -18,8 +18,7 @@ package tek.client.proxy.proxyutils; -import java.io.File; -import java.io.PrintStream; +import java.io.*; import java.net.MalformedURLException; import java.net.NetworkInterface; import java.net.URL; @@ -124,7 +123,7 @@ * commands */ public static void executeCommand(String command, Hashtable fields, - PrintStream out, SessionLog log) { + PrintWriter out, SessionLog log) { String user = log.getUser(); if (command.equals(LOGIN)) @@ -214,7 +213,7 @@ return "window.location.replace('" + url + "');"; } - private static void help(String helpSubject, PrintStream out) { + private static void help(String helpSubject, PrintWriter out) { // some help scripts have customization by version if (helpSubject.equals("mainmenu")) { helpSubject = getDirPrefix() + "/" + helpSubject; @@ -241,7 +240,7 @@ String eaddress, String clientorg, String clientcountry, String regopsys, String regmodem, String regmemory, String reglanguage, String smtpserver, String sendquery, - PrintStream out) { + PrintWriter out) { // set some values so that we remember them String message = ""; // if wavemail or manual, put method in place of smtpserver @@ -354,8 +353,8 @@ * @effects : try different prepending strings to email account of client * such as smtp, outgoing, mail, smtpout, smtp.email, smtp.mail */ - private static void smtpPrepend(PrintStream out) { - PrintStream print = new PrintStream(out); + private static void smtpPrepend(PrintWriter out) { + PrintWriter print = new PrintWriter(out); File idFile = new File(ClientConstants.ClientIDFileName); // loads the queryloading.html when waiting to find correct smtp server try { @@ -433,7 +432,7 @@ * unsuccessful login, or redirects to a page if successfull */ private static void login(String user, String password, String mode, - PrintStream out) { + PrintWriter out) { if (password == null) password = ""; String loginStatus = UsersHandler.login(user, password); @@ -457,14 +456,14 @@ Display.internalError("ERROR IN TEKCOMMANDS"); } - private static void logout(SessionLog log, PrintStream out) { + private static void logout(SessionLog log, PrintWriter out) { out.println("<SCRIPT> document.cookie='" + SessionLog.DEFAULT + "';" + replace("http://tek/search.html") + "</SCRIPT>"); } /** command to delete queries that the client specified to delete */ private static void deleteOldQuery(String name, String type, - String dirName, String lastMod, String status, PrintStream out, + String dirName, String lastMod, String status, PrintWriter out, String user) { Display.debugMessage("deleteOldQuery: " + dirName); @@ -484,7 +483,7 @@ * 6.13.05 changed to allow for temp and pending files */ private static void processSearch(String terms, String not, String type, - String mode, Hashtable fields, PrintStream out, String user) { + String mode, Hashtable fields, PrintWriter out, String user) { if (terms != null) terms = terms.trim(); if (not != null) @@ -528,7 +527,7 @@ /** * @effects: creates the outgoing file */ - private static void createoutgoing(PrintStream out) { + private static void createoutgoing(PrintWriter out) { File f = new File(ClientConstants.OutgoingList); if (f.exists()) { f.delete(); @@ -575,7 +574,7 @@ * @effects: makes temp files into pending files. */ - private static int sendAll(PrintStream out, String mail) { + private static int sendAll(PrintWriter out, String mail) { deleteOutgoing(); boolean sent; Display.debugMessage("Set up search"); @@ -639,7 +638,7 @@ /** * deletes the outgoing file and redirects to another page */ - private static void deleteOutgoingAll(PrintStream out) { + private static void deleteOutgoingAll(PrintWriter out) { deleteOutgoing(); out.print("<SCRIPT> window.history.go(-2); </SCRIPT>"); } @@ -647,7 +646,7 @@ /** * @effects : makes all temp file into pending */ - private static void tempToPend(PrintStream out) { + private static void tempToPend(PrintWriter out) { File allUsers = new File(ProxyConstants.UsersDirectory + File.separator); File[] user = allUsers.listFiles(); for (int i = 0; i < user.length; i++) { @@ -672,7 +671,7 @@ } /** command to send the search */ - private static void sendSearch(String terms, PrintStream out, String user, + private static void sendSearch(String terms, PrintWriter out, String user, String notTerms) { QuerySearchHandler.sendSearch(user, terms, notTerms); Display.debugMessage("set up search"); @@ -685,7 +684,7 @@ * @effects: outputs a the editsearch button for temp queries */ - private static void editSearch(String terms, String mode, PrintStream out, + private static void editSearch(String terms, String mode, PrintWriter out, String user) { String output = ""; @@ -724,7 +723,7 @@ /** 6.20.05 changed to different edit mode * */ private static void refineSearch(String query, String type, String dirName, - String mode, PrintStream out, String user) { + String mode, PrintWriter out, String user) { String output = ""; if (mode.equals("bas")) { @@ -749,7 +748,7 @@ } /** command to delete the search */ - private static void deleteSearch(String terms, PrintStream out, String user) { + private static void deleteSearch(String terms, PrintWriter out, String user) { File tempFile = QuerySearchHandler.getSummaryFile(user, terms, true); try { tempFile.createNewFile(); @@ -768,7 +767,7 @@ * search.html */ private static void makeUrlRequest(String url, String from, - PrintStream out, String user) { + PrintWriter out, String user) { if (user == null) user = SessionLog.DEFAULT; @@ -817,9 +816,9 @@ /** command to delete urls */ /** 6.14.05 instead of using checkboxes, use main* */ - //private static void deleteUrls(Hashtable fields, PrintStream out, + //private static void deleteUrls(Hashtable fields, PrintWriter out, // String user) { - private static void deleteUrls(String http, PrintStream out, String user) { + private static void deleteUrls(String http, PrintWriter out, String user) { Vector urlsToDelete = new Vector(); urlsToDelete.add(URLDecoder.decode(http)); @@ -831,7 +830,7 @@ /** command to create a new user */ private static void createUser(String first, String last, String user, - String pass, String pass2, PrintStream out) { + String pass, String pass2, PrintWriter out) { int status = UsersHandler.getCreateUserStatus(first, last, user, pass, pass2); if (status == UsersHandler.SUCCESSFUL) { //if successful @@ -844,7 +843,7 @@ /** method to print the createUser errors */ private static void printUserError(String first, String last, String user, - int error, PrintStream out) { + int error, PrintWriter out) { String alert = ""; //diff types of errors if (error == UsersHandler.BLANK_FIELD) @@ -891,7 +890,7 @@ * goes to the url (in the query results list) and marks it old if it is new */ private static void goToUrl(String type, String mode, String url, - String dirName, PrintStream out, String user, String not) { + String dirName, PrintWriter out, String user, String not) { if (mode.equals("url")) { if (type.equals("new")) { QueryResultsHandler.putOldMarkerInUrl(user, type, url); @@ -938,7 +937,7 @@ * email or cannot find SMTP server; Exception for when cannot find * Network Interface */ - private static boolean adminSend(PrintStream out) { + private static boolean adminSend(PrintWriter out) { boolean sent; // message to user String message = ""; @@ -1024,7 +1023,7 @@ * Network Interface */ private static void SMTPAdminSend(String SMTPusername, String SMTPpassword, - String status, PrintStream out, String user) { + String status, PrintWriter out, String user) { Display.debug("status " + status + "name " + SMTPusername); if (status != null && Integer.parseInt(status) == 2) sendAll(out, "SMTP"); @@ -1076,7 +1075,7 @@ * @effects : deletes the id file so that if cancelled, it would look like * re-registering */ - private static void SMTPcancel(PrintStream out) { + private static void SMTPcancel(PrintWriter out) { File idfile = new File(ClientConstants.ClientIDFileName); idfile.delete(); deleteOutgoing(); @@ -1087,7 +1086,7 @@ * Restarts registration by deleting client id file and pointing browser to * main menu. */ - private static void restartRegister(PrintStream out) { + private static void restartRegister(PrintWriter out) { // File id = new File(ClientConstants.ClientIDFileName); // if (id.exists()) // id.delete(); @@ -1096,7 +1095,7 @@ } /** method to print the createUser errors */ - private static void printRegisterError(int error, PrintStream out) { + private static void printRegisterError(int error, PrintWriter out) { String alert = ""; //diff types of errors Display.debug("error " + error); @@ -1119,7 +1118,7 @@ /** command to register the client 7.21.05 * */ private static void registering(String eaddress, String clientcountry, String smtpserver, String othersmtpserver, String lang, - String sendquery, PrintStream out) { + String sendquery, PrintWriter out) { File id = new File(ClientConstants.ClientIDFileName); if (id.exists()) id.delete(); @@ -1179,7 +1178,7 @@ } - private static void SMTPregister(PrintStream out) { + private static void SMTPregister(PrintWriter out) { if (ClientConstants.UseWaveMail == false) { // get the list of candidate SMTP Servers Display.debugMessage("using SMTP sending message"); @@ -1243,7 +1242,7 @@ * @effects: prints out the language choices depending on if sirus or google * is used */ - private static void teklangchoices(PrintStream out) { + private static void teklangchoices(PrintWriter out) { Display.debugMessage("printing out language choices"); if (ClientConstants.isScirus()) out.println("<OPTION>English " + "<OPTION>Spanish " |
From: Bill T. <bil...@us...> - 2006-07-24 02:11:40
|
Update of /cvsroot/tek/tek/client/proxy/proxymain In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22011/proxy/proxymain Modified Files: SocketHandler.java Log Message: For internationalization, use PrintWriter's configured with the appropriate character set rather then using raw PrintStream's. Index: SocketHandler.java =================================================================== RCS file: /cvsroot/tek/tek/client/proxy/proxymain/SocketHandler.java,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- SocketHandler.java 21 Jul 2006 18:16:43 -0000 1.71 +++ SocketHandler.java 24 Jul 2006 02:11:36 -0000 1.72 @@ -31,16 +31,7 @@ package tek.client.proxy.proxymain; import java.awt.Frame; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; [...4370 lines suppressed...] + * shortened + * @return: the correct length of the term + */ + private String replaceLen(String terms, String type) { + String output = ""; + int i = 42; + int j = 40; + if (type.equals("result")) { + i = 65; + j = 62; } + if (terms.length() > i) + output = terms.substring(0, j) + " " + "<b>...</b>"; + else + output = terms; + + return output; + } } |
From: Bill T. <bil...@us...> - 2006-07-24 02:11:39
|
Update of /cvsroot/tek/tek/client/protocol/utils In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22011/protocol/utils Modified Files: ClientConstants.java Log Message: For internationalization, use PrintWriter's configured with the appropriate character set rather then using raw PrintStream's. Index: ClientConstants.java =================================================================== RCS file: /cvsroot/tek/tek/client/protocol/utils/ClientConstants.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- ClientConstants.java 18 Dec 2005 23:26:04 -0000 1.49 +++ ClientConstants.java 24 Jul 2006 02:11:36 -0000 1.50 @@ -38,6 +38,7 @@ import tek.util.TEKUtil; import java.util.HashMap; // for override() import java.io.File; +import java.nio.charset.Charset; public final class ClientConstants { // ACTUAL CONSTANTS @@ -58,6 +59,16 @@ return true; } + /** + * Name of current charset in use by client when printing strings + * to browser. + */ + public static final String CHARSET_NAME = "windows-1256"; + /** + * Actual charset object for the charset in use. + */ + public static final Charset CHARSET = Charset.availableCharsets().get(CHARSET_NAME); + // the current version of the TEK Client. Append an "L" for // linux. The server currently does a test to see if there is an // L in the version name so that it can adjust to suite linux. Be |
From: Bill T. <bil...@us...> - 2006-07-24 02:11:39
|
Update of /cvsroot/tek/tek/client/protocol/daemon In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv22011/protocol/daemon Modified Files: COutgoingMailDaemon.java SendMail.java Log Message: For internationalization, use PrintWriter's configured with the appropriate character set rather then using raw PrintStream's. Index: COutgoingMailDaemon.java =================================================================== RCS file: /cvsroot/tek/tek/client/protocol/daemon/COutgoingMailDaemon.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- COutgoingMailDaemon.java 17 Aug 2005 00:17:33 -0000 1.28 +++ COutgoingMailDaemon.java 24 Jul 2006 02:11:36 -0000 1.29 @@ -209,8 +209,10 @@ + new java.util.Date().getTime() + ".rfi"; } while (new File(tempFilename).exists() || new File(finalFilename).exists()); - PrintStream out = new PrintStream( - new FileOutputStream(tempFilename)); + + OutputStream outStream = new FileOutputStream(tempFilename); + PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outStream, ClientConstants.CHARSET)), true); + String message = headers + "\n" + body + "\n"; String crlfMessage = TEKUtil.toCRLF(message); out.print(crlfMessage); @@ -229,8 +231,9 @@ String body, String headers, String attach) { // write contents to disk try { - PrintStream out = new PrintStream(new FileOutputStream( - ClientConstants.TEMP_SENDMAIL_FILE())); + OutputStream outStream = new FileOutputStream(ClientConstants.TEMP_SENDMAIL_FILE()); + PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outStream, ClientConstants.CHARSET)), true); + out.println(headers); out.println(body); out.close(); Index: SendMail.java =================================================================== RCS file: /cvsroot/tek/tek/client/protocol/daemon/SendMail.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- SendMail.java 15 Aug 2005 20:34:44 -0000 1.11 +++ SendMail.java 24 Jul 2006 02:11:36 -0000 1.12 @@ -221,8 +221,8 @@ // Making the network connection. SMTPSocket = new Socket(SMTPServer, SMTPPort); - PrintStream ClientSays = new PrintStream(SMTPSocket - .getOutputStream()); + PrintWriter ClientSays = new PrintWriter(new BufferedWriter(new OutputStreamWriter(SMTPSocket.getOutputStream(), ClientConstants.CHARSET)), true); + BufferedReader ServerResponds = new BufferedReader( new InputStreamReader(SMTPSocket.getInputStream())); |
From: Bill T. <bil...@us...> - 2006-07-21 18:16:48
|
Update of /cvsroot/tek/tek/client/proxy/proxymain In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15140 Modified Files: SocketHandler.java Log Message: Write characters to browser in unicode rather than going through a StringBuffer. Also emit windows-1256 charset for local pages. Index: SocketHandler.java =================================================================== RCS file: /cvsroot/tek/tek/client/proxy/proxymain/SocketHandler.java,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- SocketHandler.java 21 Mar 2006 19:15:04 -0000 1.70 +++ SocketHandler.java 21 Jul 2006 18:16:43 -0000 1.71 @@ -2053,6 +2053,8 @@ private void printDocument(String document, PrintStream out) { out.println("<HEAD><META http-equiv=\"Pragma\" content=\"no-cache\">" + // the character set we use for arabic + + "<META content=\"text/html; charset=windows-1256\">" + "<META http-equiv=\"Cache-Control\" content=\"no-cache\">" + "<META http-equiv=\"Expires\" content=\"0\"></HEAD>"); @@ -2076,8 +2078,14 @@ out.print(" "); break; case HTMLTokenizer.HTT_WORD: - out.print(tokenizer.wval); - break; + // for unicode support, we need to + // write characters rather than + // print them + int length = tokenizer.wval.length(); + for (int i=0; i<length; i++) { + out.write(tokenizer.wval.charAt(i)); + } + break; case HTMLTokenizer.HTT_ELEMENT: if (tokenizer.element_id.equalsIgnoreCase("a")) status = inAnchor; |
From: Bill T. <bil...@us...> - 2006-07-04 04:44:25
|
Update of /cvsroot/tek/tek/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27928 Modified Files: TEKUtil.java Log Message: Do not return results of attempted unzipping if the results are empty. Index: TEKUtil.java =================================================================== RCS file: /cvsroot/tek/tek/util/TEKUtil.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- TEKUtil.java 29 Jun 2006 23:28:06 -0000 1.15 +++ TEKUtil.java 4 Jul 2006 04:44:21 -0000 1.16 @@ -41,7 +41,15 @@ input.getNextEntry(); ByteArrayOutputStream output = new ByteArrayOutputStream(); TEKUtil.writeStreamToStream(input, output); - return output.toByteArray(); + // it seems that in some cases we get an output, but its + // length is zero (indicating that it is not, in fact, a + // ZIP stream) + byte[] result = output.toByteArray(); + if (result.length == 0) { + return bytes; + } else { + return result; + } } catch (Exception e) { // it might not work because <bytes> might not represent a // zip file. In this case, just return <bytes>. |
From: Bill T. <bil...@us...> - 2006-06-30 00:27:59
|
Update of /cvsroot/tek/tek/client/protocol/parser In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11100 Modified Files: CParser.java Log Message: Support attachments that are automatically zipped by the ISP (as they are in Sudan). Index: CParser.java =================================================================== RCS file: /cvsroot/tek/tek/client/protocol/parser/CParser.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- CParser.java 8 Jul 2005 20:03:09 -0000 1.11 +++ CParser.java 30 Jun 2006 00:27:56 -0000 1.12 @@ -24,11 +24,9 @@ package tek.client.protocol.parser; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Date; -import java.util.Hashtable; -import java.util.StringTokenizer; +import java.io.*; +import java.util.*; +import java.util.zip.*; import tek.util.*; import tek.client.protocol.message.*; @@ -238,23 +236,27 @@ Message msg; try { + + String emailContents; + // first try unzipping the email, in case the ISP + // automatically zipped it (this happens in Sudan) + try { + emailContents = tryUnzippingFile(email); + } catch (Exception e) { + emailContents = TEKUtil.readFile(email); + } + // store Message object in msg try { // in this version, normal messages come in base 64 - String body = new String(Base64.decode(TEKUtil.readFile(email) + String body = new String(Base64.decode(emailContents .toCharArray())); msg = this.Parse(body); } catch (ParseException e) { - try { - // registration messages still come in normal text, so try - // that one here - String body = new String(TEKUtil.readFile(email)); - msg = this.Parse(body); - } catch (IOException ex) { - throw new ParseException("Error reading email: " + email); - } - } catch (IOException e) { - throw new ParseException("Error reading email: " + email); + // registration messages still come in normal text, so try + // that one here + String body = new String(emailContents); + msg = this.Parse(body); } // update the last rec'd list for that specific @@ -287,7 +289,29 @@ ErrorLog el = new ErrorLog(); el.Log(b, "CParser.Parse()"); } + catch (IOException e) { + throw new ParseException("Error reading email: " + email); + } + } + + /** + * Tries to treat <filename> as a zip file, returning the unzipped + * contents as a String. Assumes there is only 1 zip entry (one + * zipped file) inside the <filename>. If there is any problem in + * unzipping, throws an exception. + */ + private String tryUnzippingFile(String filename) throws Exception { + ZipFile file = new ZipFile(filename); + for (Enumeration e = file.entries(); e.hasMoreElements(); ){ + ZipEntry entry = (ZipEntry)e.nextElement(); + InputStream input = file.getInputStream(entry); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + TEKUtil.writeStreamToStream(input, output); + return new String(output.toByteArray()); } + throw new Exception("Did not find any entries."); + } + /* * effects: parses the body section of the email into a hashtable object |
From: Bill T. <bil...@us...> - 2006-06-30 00:27:21
|
Update of /cvsroot/tek/tek/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv11077 Modified Files: Display.java Log Message: Turn off debug flag. Index: Display.java =================================================================== RCS file: /cvsroot/tek/tek/util/Display.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Display.java 3 Aug 2005 05:57:36 -0000 1.8 +++ Display.java 30 Jun 2006 00:27:19 -0000 1.9 @@ -30,7 +30,7 @@ * deployment) */ private static final boolean DEBUG = false; - private static final boolean DEBUG2 = true; + private static final boolean DEBUG2 = false; /** * Display a message to the user. |
From: Bill T. <bil...@us...> - 2006-06-29 23:28:09
|
Update of /cvsroot/tek/tek/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16179/util Modified Files: TEKUtil.java Log Message: Move "tryToUnzip" function from ParseAttachmet to TEKUtil so that TEK Client can call it too. Index: TEKUtil.java =================================================================== RCS file: /cvsroot/tek/tek/util/TEKUtil.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- TEKUtil.java 29 Jun 2006 23:13:57 -0000 1.14 +++ TEKUtil.java 29 Jun 2006 23:28:06 -0000 1.15 @@ -29,6 +29,27 @@ public static final boolean isLinux() { return ((System.getProperties().getProperty("os.name")).toLowerCase().indexOf("linux")>=0); } /** + * Attempts to treat <bytes> as the content of a zip file (with a + * SINGLE zip entry). If they can be unzipped without error, + * returns the uncompressed bytes of the zip entry. Otherwise + * returns the original bytes. + */ + public static byte[] tryToUnzip(byte[] bytes) { + try { + ZipInputStream input = new ZipInputStream(new ByteArrayInputStream(bytes)); + // advance stream to bytes for next entry + input.getNextEntry(); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + TEKUtil.writeStreamToStream(input, output); + return output.toByteArray(); + } catch (Exception e) { + // it might not work because <bytes> might not represent a + // zip file. In this case, just return <bytes>. + return bytes; + } + } + + /** * Unzips the file named by <filename> to <targetDir>. Overwrites * files that are already there, if there are conflicts. Returns * an array of the names of the files (entries) that were unzipped, |
From: Bill T. <bil...@us...> - 2006-06-29 23:28:09
|
Update of /cvsroot/tek/tek/server/protocol/parser In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv16179/server/protocol/parser Modified Files: ParseAttachment.java Log Message: Move "tryToUnzip" function from ParseAttachmet to TEKUtil so that TEK Client can call it too. Index: ParseAttachment.java =================================================================== RCS file: /cvsroot/tek/tek/server/protocol/parser/ParseAttachment.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ParseAttachment.java 29 Jun 2006 23:14:37 -0000 1.8 +++ ParseAttachment.java 29 Jun 2006 23:28:06 -0000 1.9 @@ -61,7 +61,7 @@ // some ISP's (e.g., in Sudan) automatically zip their // outgoing attachments. In this case we need to unzip // the contents before processing. - bytes = tryToUnzip(bytes); + bytes = TEKUtil.tryToUnzip(bytes); // get to/from // a) will need know who to forward to (e.g., could be tekserv, tek-scirus) @@ -91,27 +91,6 @@ } /** - * Attempts to treat <bytes> as the content of a zip file (with a - * single zip entry). If they can be unzipped without error, - * returns the uncompressed bytes of the zip entry. Otherwise - * returns the original bytes. - */ - private static byte[] tryToUnzip(byte[] bytes) { - try { - ZipInputStream input = new ZipInputStream(new ByteArrayInputStream(bytes)); - // advance stream to bytes for next entry - input.getNextEntry(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - TEKUtil.writeStreamToStream(input, output); - return output.toByteArray(); - } catch (Exception e) { - // it might not work because <bytes> might not represent a - // zip file. In this case, just return <bytes>. - return bytes; - } - } - - /** * Given an email, tries to extract the email that sent it; * otherwise returns a dummy address. */ |
From: Bill T. <bil...@us...> - 2006-06-29 23:14:41
|
Update of /cvsroot/tek/tek/server/protocol/parser In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9779 Modified Files: ParseAttachment.java Log Message: Support zipped attachments from users. (It turns out that an ISP in Sudan automatically zips all attachments in outgoing mail.) Index: ParseAttachment.java =================================================================== RCS file: /cvsroot/tek/tek/server/protocol/parser/ParseAttachment.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ParseAttachment.java 16 Oct 2005 19:06:29 -0000 1.7 +++ ParseAttachment.java 29 Jun 2006 23:14:37 -0000 1.8 @@ -10,7 +10,10 @@ import tek.server.protocol.tputils.*; import tek.server.protocol.daemon.*; +import tek.util.TEKUtil; + import java.util.LinkedList; +import java.util.zip.*; import java.io.*; @@ -55,6 +58,11 @@ } byte[] bytes = serialized.getBytes(); + // some ISP's (e.g., in Sudan) automatically zip their + // outgoing attachments. In this case we need to unzip + // the contents before processing. + bytes = tryToUnzip(bytes); + // get to/from // a) will need know who to forward to (e.g., could be tekserv, tek-scirus) // b) and who sent from (for sake of nice logs) @@ -83,6 +91,27 @@ } /** + * Attempts to treat <bytes> as the content of a zip file (with a + * single zip entry). If they can be unzipped without error, + * returns the uncompressed bytes of the zip entry. Otherwise + * returns the original bytes. + */ + private static byte[] tryToUnzip(byte[] bytes) { + try { + ZipInputStream input = new ZipInputStream(new ByteArrayInputStream(bytes)); + // advance stream to bytes for next entry + input.getNextEntry(); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + TEKUtil.writeStreamToStream(input, output); + return output.toByteArray(); + } catch (Exception e) { + // it might not work because <bytes> might not represent a + // zip file. In this case, just return <bytes>. + return bytes; + } + } + + /** * Given an email, tries to extract the email that sent it; * otherwise returns a dummy address. */ |
From: Bill T. <bil...@us...> - 2006-06-29 23:14:03
|
Update of /cvsroot/tek/tek/util In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9356 Modified Files: TEKUtil.java Log Message: Make a method public. Index: TEKUtil.java =================================================================== RCS file: /cvsroot/tek/tek/util/TEKUtil.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- TEKUtil.java 27 Nov 2003 16:57:30 -0000 1.13 +++ TEKUtil.java 29 Jun 2006 23:13:57 -0000 1.14 @@ -88,8 +88,8 @@ /** * Moves all contents of <input> to <output>, closing <input> (but - * not <output>) before returning. */ - private static void writeStreamToStream(InputStream input, + * not <output>) before returning. */ + public static void writeStreamToStream(InputStream input, OutputStream output) throws IOException { // create buffered reader for <stream> |
From: Bill T. <bil...@us...> - 2006-04-26 03:55:11
|
Update of /cvsroot/tek/tek/server/protocol/tputils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24994/protocol/tputils Modified Files: ServerConstants.java Log Message: Give Spanish reply even for Spanish versions that are receiving their search in any language. Index: ServerConstants.java =================================================================== RCS file: /cvsroot/tek/tek/server/protocol/tputils/ServerConstants.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ServerConstants.java 25 Apr 2006 03:56:59 -0000 1.19 +++ ServerConstants.java 26 Apr 2006 03:55:03 -0000 1.20 @@ -25,7 +25,9 @@ public static final String EMAIL_GREETING(String clientLang) { // right now just support spanish and english if (clientLang.toLowerCase().trim().equals("spanish") || - clientLang.toLowerCase().trim().indexOf("espa")==0) { + (clientLang.toLowerCase().trim().indexOf("espa")==0) || + // if they are using spanish translation of installation + (clientLang.toLowerCase().trim().indexOf("cualquier")==0)) { return "Estimado Cliente,\n" + "\n" + |
From: Bill T. <bil...@us...> - 2006-04-25 03:57:04
|
Update of /cvsroot/tek/tek/server/protocol/tputils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10774/protocol/tputils Modified Files: ServerConstants.java Log Message: If client is searching for Spanish results, send email in Spanish. Index: ServerConstants.java =================================================================== RCS file: /cvsroot/tek/tek/server/protocol/tputils/ServerConstants.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- ServerConstants.java 21 Oct 2005 21:01:02 -0000 1.18 +++ ServerConstants.java 25 Apr 2006 03:56:59 -0000 1.19 @@ -22,13 +22,28 @@ public static final String ATTACHMENT_CONTENT_TYPE = "application/tek"; // the message appearing in the email to clients - public static final String EMAIL_GREETING = - "Dear Client,\n" + - "\n" + - "A message from the TEK Server is attached. Please open the\n" + - "attachment, and the TEK Client will do the rest.\n" + - "\n" + - "Thank you for using TEK!\n"; + public static final String EMAIL_GREETING(String clientLang) { + // right now just support spanish and english + if (clientLang.toLowerCase().trim().equals("spanish") || + clientLang.toLowerCase().trim().indexOf("espa")==0) { + return + "Estimado Cliente,\n" + + "\n" + + "Un mensaje del servidor TEK ha sido adjuntado. Por favor abra\n" + + // TODO: fix hara to have accent mark over second a + "el adjunto, y el cliente TEK hara el resto.\n" + + "\n" + + "Gracias por usar TEK!\n"; + } else { + return + "Dear Client,\n" + + "\n" + + "A message from the TEK Server is attached. Please open the\n" + + "attachment, and the TEK Client will do the rest.\n" + + "\n" + + "Thank you for using TEK!\n"; + } + } // stores the polling interval for the OutgoingMailDaemon public static final int ODPollFreq = 30000; |
From: Bill T. <bil...@us...> - 2006-04-25 03:57:04
|
Update of /cvsroot/tek/tek/server/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10774/database Modified Files: TEKProtocolDB.java Log Message: If client is searching for Spanish results, send email in Spanish. Index: TEKProtocolDB.java =================================================================== RCS file: /cvsroot/tek/tek/server/database/TEKProtocolDB.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- TEKProtocolDB.java 16 Oct 2005 19:06:29 -0000 1.28 +++ TEKProtocolDB.java 25 Apr 2006 03:56:59 -0000 1.29 @@ -797,6 +797,16 @@ msgComponents.add(version.get(0)); } + // get the language used by this client + String query4 = "select SEARCH_LANG from " + + "client_info_table where EADDR = '" + eaddr + "'"; + Vector lang = executeSQLQuery(query4); + if (lang.size()==0) { + msgComponents.add(null); + } else { + msgComponents.add(lang.get(0)); + } + } }catch(SQLException e){ throw new TEKDBFailureException("Can't remove email from Mail_Q\n" + e); |