You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(89) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(9) |
Feb
(6) |
Mar
(22) |
Apr
(34) |
May
(43) |
Jun
(48) |
Jul
(96) |
Aug
(64) |
Sep
(30) |
Oct
(12) |
Nov
(17) |
Dec
(21) |
2007 |
Jan
(61) |
Feb
(24) |
Mar
(51) |
Apr
(54) |
May
(41) |
Jun
(57) |
Jul
(16) |
Aug
(12) |
Sep
(29) |
Oct
(143) |
Nov
(57) |
Dec
(193) |
2008 |
Jan
(92) |
Feb
(54) |
Mar
(34) |
Apr
(50) |
May
(71) |
Jun
(3) |
Jul
(16) |
Aug
(16) |
Sep
(11) |
Oct
(13) |
Nov
(8) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
(9) |
Apr
(36) |
May
(10) |
Jun
(2) |
Jul
(13) |
Aug
(15) |
Sep
(5) |
Oct
(2) |
Nov
(13) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(2) |
Mar
(6) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(24) |
Sep
(14) |
Oct
(8) |
Nov
(4) |
Dec
(9) |
2011 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
From: Eric P. <th...@us...> - 2010-06-01 22:17:57
|
Update of /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv31034 Modified Files: XMLSerializerGenerator.java Log Message: Fixed fastHTMLDecode handling of triplet encoded characters and added some comments. Should read Japanese better now. Index: XMLSerializerGenerator.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator/XMLSerializerGenerator.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** XMLSerializerGenerator.java 1 Mar 2010 16:09:09 -0000 1.23 --- XMLSerializerGenerator.java 1 Jun 2010 22:17:49 -0000 1.24 *************** *** 1512,1518 **** out.println(""); out.println(" /**"); ! out.println(" * Write the x-www-form-urlencoded form of the character using UTF-8 encoding."); out.println(" */"); ! out.println(" protected static final void writeUnicodeChar(StringBuffer buf, char c) {"); out.println(" if (c < 0x80) {"); out.println(" writeByte(buf, (byte) c);"); --- 1512,1520 ---- out.println(""); out.println(" /**"); ! out.println(" * Write the x-www-form-urlencoded form of the character using"); ! out.println(" * UTF-8 encoding. Characters below 127 map directly to ascii."); out.println(" */"); ! out.println(" protected static final void writeUnicodeChar(StringBuffer buf, char c)"); ! out.println(" {"); out.println(" if (c < 0x80) {"); out.println(" writeByte(buf, (byte) c);"); *************** *** 1568,1580 **** out.println(" for(int i=0;i<len;i++) {"); out.println(" char c=text.charAt(i);"); ! out.println(" if(c=='+') {"); out.println(" buf.append(' '); }"); ! out.println(" else if((c=='%')&&(i+2<len)) {"); out.println(" char uc=readUnicodeChar(text.charAt(i+1),"); out.println(" text.charAt(i+2));"); out.println(" if((uc>=0xE0)&&(i+8<len)&&(text.charAt(i+3)=='%')&&"); out.println(" (text.charAt(i+6)=='%')) {"); out.println(" int val=uc ^ 0xE0; //mask off added 0xE0"); ! out.println(" val=val << 12; //restore highest char val pos"); out.println(" uc=readUnicodeChar(text.charAt(i+4),"); out.println(" text.charAt(i+5));"); --- 1570,1586 ---- out.println(" for(int i=0;i<len;i++) {"); out.println(" char c=text.charAt(i);"); ! out.println(" if(c=='+') { //converted space character"); out.println(" buf.append(' '); }"); ! out.println(" else if(c!='%') { //unescaped ascii character"); ! out.println(" buf.append(c); }"); ! out.println(" else { //escaped sequence of the form %xx..."); out.println(" char uc=readUnicodeChar(text.charAt(i+1),"); out.println(" text.charAt(i+2));"); + out.println(" // i12345678"); + out.println(" //triple: xx%xx%xx..."); out.println(" if((uc>=0xE0)&&(i+8<len)&&(text.charAt(i+3)=='%')&&"); out.println(" (text.charAt(i+6)=='%')) {"); out.println(" int val=uc ^ 0xE0; //mask off added 0xE0"); ! out.println(" val=val << 6; //12 total, next 6 below..."); out.println(" uc=readUnicodeChar(text.charAt(i+4),"); out.println(" text.charAt(i+5));"); *************** *** 1586,1589 **** --- 1592,1597 ---- out.println(" buf.appendCodePoint(val);"); out.println(" i+=8; }"); + out.println(" // i12345"); + out.println(" //double: xx%xx"); out.println(" else if((uc>=0xC0)&&(i+5<len)&&(text.charAt(i+3)=='%')) {"); out.println(" int val=uc ^ 0xC0; //mask off added 0xC0"); *************** *** 1594,1602 **** out.println(" buf.appendCodePoint(val);"); out.println(" i+=5; }"); out.println(" else {"); out.println(" buf.append(uc);"); ! out.println(" i+=2; } }"); ! out.println(" else {"); ! out.println(" buf.append(c); } }"); out.println(" return buf.toString();"); out.println(" }"); --- 1602,1609 ---- out.println(" buf.appendCodePoint(val);"); out.println(" i+=5; }"); + out.println(" //single: xx"); out.println(" else {"); out.println(" buf.append(uc);"); ! out.println(" i+=2; } } }"); out.println(" return buf.toString();"); out.println(" }"); |
From: Eric P. <th...@us...> - 2010-04-21 04:13:37
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv14866 Modified Files: MatchUtil.java Log Message: Protect against an invalid long value in eval(long,String,index) Index: MatchUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/MatchUtil.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MatchUtil.java 14 Sep 2009 00:00:54 -0000 1.9 --- MatchUtil.java 21 Apr 2010 04:13:26 -0000 1.10 *************** *** 104,107 **** --- 104,109 ---- String oper=expr[index]; String compstr=expr[index+1]; + if(!StringUtil.convertsToLong(compstr)) { + return false; } //invalid numeric value, no match. long compval=(Long.decode(compstr)).longValue(); boolean retval=false; |
From: Eric P. <th...@us...> - 2010-03-08 23:14:00
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv3632 Modified Files: UIFormContext.java Log Message: Cleaned up some debug output to reduce log noise. Index: UIFormContext.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/UIFormContext.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** UIFormContext.java 6 Aug 2009 20:51:59 -0000 1.25 --- UIFormContext.java 8 Mar 2010 23:13:53 -0000 1.26 *************** *** 694,698 **** else { ei.setText(XMLTextProcessing.convertToXML(text,true,true,true)); } ! debugout("UIFormContext.addOutput: " + ei); addOutputText(ei); } --- 694,699 ---- else { ei.setText(XMLTextProcessing.convertToXML(text,true,true,true)); } ! //this can get insanely verbose, use only as needed. ! //debugout("UIFormContext.addOutput: " + ei); addOutputText(ei); } |
From: Eric P. <th...@us...> - 2010-03-08 23:13:07
|
Update of /cvsroot/sandev/sand/platform/tools/src/org/sandev/tools/UIProcessor In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv3177 Modified Files: XHTMLSandUIServlet.java Log Message: Cleaned up the action test debug output, logs were getting pretty verbose. Index: XHTMLSandUIServlet.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/src/org/sandev/tools/UIProcessor/XHTMLSandUIServlet.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** XHTMLSandUIServlet.java 5 Oct 2009 01:42:19 -0000 1.37 --- XHTMLSandUIServlet.java 8 Mar 2010 23:12:58 -0000 1.38 *************** *** 1,5 **** /* * SAND development/deployment environment ! * Copyright (C) 2003-2009 SAND Services Inc. * * This library is free software; you can redistribute it and/or --- 1,5 ---- /* * SAND development/deployment environment ! * Copyright (C) 2003-2010 SAND Services Inc. * * This library is free software; you can redistribute it and/or *************** *** 850,869 **** " *** processScreen custom action: " + customAction); } ////do the action, cascading tests allow for chaining ! debug("test custom action, uifc.action: " + uifc.getAction() + ! ", uifc.outputText: " + uifc.dumpOutputText()); if(uifc.getAction()==UIFormContext.ACTION_CUSTOM) { debug("do custom action"); uifc=getFormOwner().doAction(customAction,uifc,uwl); } ! debug("test standard action, uifc.action: " + uifc.actionValueToLabel(uifc.getAction()) + ! ", uifc.outputText: " + uifc.dumpOutputText()); if((uifc.isFormManagerAction())&& //form action and (!uifc.hasErrorOutput())) { //no load errors ! debug("do standard action " + uifc.actionValueToLabel(uifc.getAction())); if(getFormManager().processForm(uifc,getFormOwner())) { globalChangeFormIndex=i; } } ! debug("test init action, uifc.action: " + ! uifc.actionValueToLabel(uifc.getAction()) + ! ", user: " + uifc.getUserID() + ! ", uifc.outputText: " + uifc.dumpOutputText()); if(uifc.getAction()==UIFormContext.ACTION_INIT) { debug("do init action"); --- 850,865 ---- " *** processScreen custom action: " + customAction); } ////do the action, cascading tests allow for chaining ! debugActionTest("custom",uifc); if(uifc.getAction()==UIFormContext.ACTION_CUSTOM) { debug("do custom action"); uifc=getFormOwner().doAction(customAction,uifc,uwl); } ! debugActionTest("standard",uifc); if((uifc.isFormManagerAction())&& //form action and (!uifc.hasErrorOutput())) { //no load errors ! debug("do standard action " + ! uifc.actionValueToLabel(uifc.getAction())); if(getFormManager().processForm(uifc,getFormOwner())) { globalChangeFormIndex=i; } } ! debugActionTest("init",uifc); if(uifc.getAction()==UIFormContext.ACTION_INIT) { debug("do init action"); *************** *** 2058,2062 **** protected void debug(String text) { ! getFormOwner().log(Logger.LOGLEVEL_DEBUG,text); } --- 2054,2067 ---- protected void debug(String text) { ! getFormOwner().log(Logger.LOGLEVEL_DEBUG,"XHTMLSandUIServlet " + text); ! } ! ! ! protected void debugActionTest(String test,UIFormContext uifc) ! { ! //debug("test " + test + " action, uifc.action: " + uifc.getAction() + ! // " (" + uifc.actionValueToLabel(uifc.getAction()) + ")" + ! // ", user: " + uifc.getUserID() + ! // ", uifc.outputText: " + uifc.dumpOutputText()); } |
From: Eric P. <th...@us...> - 2010-03-08 23:11:43
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv2789 Modified Files: StringUtil.java Log Message: Added sameText comparison utility. Index: StringUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/StringUtil.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** StringUtil.java 1 Mar 2010 19:10:17 -0000 1.39 --- StringUtil.java 8 Mar 2010 23:11:33 -0000 1.40 *************** *** 1397,1400 **** --- 1397,1416 ---- /** + * Return true if both strings are null, or if they are both not + * null and the trimmed values are equivalent ignoring case. + */ + public static boolean sameText(String str1,String str2) + { + if((str1==null)&&(str2==null)) { + return true; } + else if((str1==null)||(str2==null)) { + return false; } + else if(str1.trim().equalsIgnoreCase(str2.trim())) { + return true; } + return false; + } + + + /** * Returns true if the given string is a valid java identifier, false * otherwise. |
From: Eric P. <th...@us...> - 2010-03-01 19:10:27
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv22460 Modified Files: StringUtil.java Log Message: Added multiContains and multiStartsWith utilities. Found I needed this and seemed like they might be generally useful. Index: StringUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/StringUtil.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** StringUtil.java 27 Jan 2010 23:33:06 -0000 1.38 --- StringUtil.java 1 Mar 2010 19:10:17 -0000 1.39 *************** *** 1452,1455 **** --- 1452,1492 ---- } + + /** + * Return true if one of the candidate tokens exist in the source + * string, false otherwise. If delimeter is not null, then only + * test subparts of the source beginning with the delimiter. + */ + public static boolean multiContains(String src,String[] tokens, + Character delimiter) + { + boolean justReadDelimiter=(delimiter==null); + int srclen=src.length(); + for(int i=0;i<srclen;i++) { + if(delimiter!=null) { + if((src.charAt(i)==delimiter.charValue())&&((i+1)<srclen)) { + if(multiStartsWith(src.substring(i),tokens)) { + return true; } } + continue; } + else { //null delimiter + if(multiStartsWith(src.substring(i),tokens)) { + return true; } } } + return false; + } + + + /** + * Return true if the given source string starts with one of the + * given tokens, false otherwise. + */ + public static boolean multiStartsWith(String src,String[] tokens) + { + for(int i=0;i<tokens.length;i++) { + if(src.startsWith(tokens[i])) { + return true; } } + return false; + } + + } |
From: Eric P. <th...@us...> - 2010-03-01 16:12:56
|
Update of /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv5439 Modified Files: JDBCPersisterGenerator.java Log Message: In doImport, it's possible to encounter null object instances in the array of values we are updating from. For example if we are importing from an XML file that references to a deleted struct type, then we would have null placeholders where those references were. doImport now skips nulls. Index: JDBCPersisterGenerator.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator/JDBCPersisterGenerator.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** JDBCPersisterGenerator.java 2 Apr 2009 23:55:25 -0000 1.12 --- JDBCPersisterGenerator.java 1 Mar 2010 16:12:41 -0000 1.13 *************** *** 1,5 **** /* * SAND development/deployment environment ! * Copyright (C) 2005,2007 SAND Services Inc. * * This library is free software; you can redistribute it and/or --- 1,5 ---- /* * SAND development/deployment environment ! * Copyright (C) 2005,2007,2010 SAND Services Inc. * * This library is free software; you can redistribute it and/or *************** *** 756,759 **** --- 756,761 ---- out.println(" for(int i=0;i<instances.length;i++) {"); out.println(" SandPersistMessage impinst=(SandPersistMessage)instances[i];"); + out.println(" if(impinst==null) { //no object was read"); + out.println(" continue; } //so no update"); out.println(" SandPersistMessage dbinst=null;"); out.println(" SandUpdateMessage sum=impinst.getUpdateMessage();"); |
From: Eric P. <th...@us...> - 2010-03-01 16:09:22
|
Update of /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv5179 Modified Files: XMLSerializerGenerator.java Log Message: If you delete a struct, then previously saved info would crash trying to read any instances of that struct. This now spits a message and ignores the old value instead. More useful that way. Index: XMLSerializerGenerator.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator/XMLSerializerGenerator.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** XMLSerializerGenerator.java 1 May 2009 17:34:17 -0000 1.22 --- XMLSerializerGenerator.java 1 Mar 2010 16:09:09 -0000 1.23 *************** *** 1,5 **** /* * SAND development/deployment environment ! * Copyright (C) 2003-2009 SAND Services Inc. * * This library is free software; you can redistribute it and/or --- 1,5 ---- /* * SAND development/deployment environment ! * Copyright (C) 2003-2010 SAND Services Inc. * * This library is free software; you can redistribute it and/or *************** *** 868,871 **** --- 868,875 ---- out.println(" readArray(classLabel,st);"); out.println(" return null; }"); + out.println(" else if((classLabel.startsWith(\"<\"))&&(classLabel.length()>2)) {"); + out.println(" info(\"Returning null element for class label name: \" + classLabel);"); + out.println(" skipToClose(classLabel,st);"); + out.println(" return null; }"); out.println(" throw new IOException(\"Unknown class label name: \" + classLabel);"); out.println(" }"); *************** *** 1285,1288 **** --- 1289,1329 ---- protected void writeTokenUtilityMethods(PrintStream out) { out.println(" /**"); + out.println(" * Skip to the closing label matching the given open label."); + out.println(" */"); + out.println(" protected static void skipToClose(String open,StreamTokenizer st)"); + out.println(" throws IOException"); + out.println(" {"); + out.println(" StringBuffer sbuf=new StringBuffer(open);"); + out.println(" String tagname=open.substring(1).trim();"); + out.println(" boolean justReadLT=false;"); + out.println(" boolean justReadLTS=false;"); + out.println(" boolean done=false;"); + out.println(" int tokType=st.nextToken();"); + out.println(" while((!done)&&(tokType!=StreamTokenizer.TT_EOF)) {"); + out.println(" switch(tokType) {"); + out.println(" case StreamTokenizer.TT_WORD:"); + out.println(" if((justReadLTS)&&(tagname.equalsIgnoreCase(st.sval))) {"); + out.println(" done=true; }"); + out.println(" else {"); + out.println(" justReadLT=justReadLTS=false; }"); + out.println(" sbuf.append(\" \" + st.sval);"); + out.println(" break;"); + out.println(" case '<': "); + out.println(" justReadLT=true; "); + out.println(" sbuf.append(\"<\");"); + out.println(" break;"); + out.println(" case '/': "); + out.println(" if(justReadLT) {"); + out.println(" justReadLTS=true; }"); + out.println(" justReadLT=false;"); + out.println(" sbuf.append(\"/\");"); + out.println(" break; }"); + out.println(" if(!done) {"); + out.println(" tokType=st.nextToken(); } }"); + out.println(" //info(\"skipToClose skipped \" + sbuf.toString());"); + out.println(" }"); + out.println(""); + out.println(""); + out.println(" /**"); out.println(" * Read a token corresponding to an element. Examples return values"); out.println(" * would be \"<Configuration\" or \"<NodeInstanceArray\" or \"</Configuration>\"."); |
From: Eric P. <th...@us...> - 2010-02-15 03:34:00
|
Update of /cvsroot/sandev/sand/apps/basics/build/generate/org/sandev/generator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv9260 Modified Files: MessageClassGenerator.java Log Message: Added insertElement method for SandCollectionMessage interface def. Index: MessageClassGenerator.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/build/generate/org/sandev/generator/MessageClassGenerator.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** MessageClassGenerator.java 14 Apr 2009 22:12:59 -0000 1.34 --- MessageClassGenerator.java 15 Feb 2010 03:33:50 -0000 1.35 *************** *** 1,5 **** /* * SAND development/deployment environment ! * Copyright (C) 2003-2009 SAND Services Inc. * * This library is free software; you can redistribute it and/or --- 1,5 ---- /* * SAND development/deployment environment ! * Copyright (C) 2003-2010 SAND Services Inc. * * This library is free software; you can redistribute it and/or *************** *** 856,859 **** --- 856,868 ---- out.println(" * Specified by SandCollectionMessage interface"); out.println(" */"); + out.println(" public void insertElement(int index,SandInstanceMessage elem)"); + out.println(" {"); + out.println(" insert" + capElems + "(index,(" + basename + ")elem);"); + out.println(" }"); + out.println(""); + out.println(""); + out.println(" /**"); + out.println(" * Specified by SandCollectionMessage interface"); + out.println(" */"); out.println(" public boolean removeElement(SandInstanceMessage elem)"); out.println(" {"); |
From: Eric P. <th...@us...> - 2010-02-14 20:02:37
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/structs In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv23028 Modified Files: SandCollectionMessage.java Log Message: Added insertElement to this general interface since it is occasionally useful Index: SandCollectionMessage.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/structs/SandCollectionMessage.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SandCollectionMessage.java 3 Apr 2009 00:02:44 -0000 1.5 --- SandCollectionMessage.java 14 Feb 2010 20:02:27 -0000 1.6 *************** *** 104,107 **** --- 104,115 ---- /** + * Insert the specified element at the specified index. If the + * specified index is greater than the index of the last element, + * then the specified element is appended. + */ + public void insertElement(int index,SandInstanceMessage elem); + + + /** * Remove this element from the collection. Return true if the element * was found, false otherwise. The given element is downcast as needed. |
From: Eric P. <th...@us...> - 2010-01-31 19:34:05
|
Update of /cvsroot/sandev/sand/platform/tools/src/org/sandev/tools/HTTP In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv32511 Modified Files: AbstractXHTMLFormAdaptor.java Log Message: Added rule to downgrade UNRESTRICTEDNODISP down to READONLYNODISP rather than just READONLY in the case of instance or class write restrictions since it is non-intuitive to have the fields suddenly show up in the display in that case. Index: AbstractXHTMLFormAdaptor.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/src/org/sandev/tools/HTTP/AbstractXHTMLFormAdaptor.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** AbstractXHTMLFormAdaptor.java 20 Nov 2009 22:30:46 -0000 1.80 --- AbstractXHTMLFormAdaptor.java 31 Jan 2010 19:33:56 -0000 1.81 *************** *** 3833,3837 **** if(access>AuthFilter.AUTH_NOACCESS) { int fieldAcc=filter.messageFieldAccess(user,msg,fieldname); ! access=Math.min(access,fieldAcc); } return access; } catch(SandException e) { --- 3833,3841 ---- if(access>AuthFilter.AUTH_NOACCESS) { int fieldAcc=filter.messageFieldAccess(user,msg,fieldname); ! if((fieldAcc==AuthFilter.AUTH_UNRESTRICTEDNODISP)&& ! (access==AuthFilter.AUTH_READONLY)) { ! access=AuthFilter.AUTH_READONLYNODISP; } ! else { ! access=Math.min(access,fieldAcc); } } return access; } catch(SandException e) { |
From: Eric P. <th...@us...> - 2010-01-27 23:35:21
|
Update of /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv18476 Modified Files: XMLPersisterGenerator.java Log Message: Additional debug line in case of opening a file not properly closed before. Index: XMLPersisterGenerator.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator/XMLPersisterGenerator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** XMLPersisterGenerator.java 12 Dec 2009 16:49:51 -0000 1.8 --- XMLPersisterGenerator.java 27 Jan 2010 23:35:11 -0000 1.9 *************** *** 561,564 **** --- 561,566 ---- out.println(" throws PersisterException"); out.println(" {"); + out.println(" if(br!=null) {"); + out.println(" info(\"XMLPersister.openFile found br!=null, probable bad close\"); }"); out.println(" closeFile();"); out.println(" try {"); |
From: Eric P. <th...@us...> - 2010-01-27 23:33:16
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv18179 Modified Files: StringUtil.java Log Message: Made this fully thread safe I believe. Also some comments and bulletproofing. Index: StringUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/StringUtil.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** StringUtil.java 8 Dec 2009 14:55:11 -0000 1.37 --- StringUtil.java 27 Jan 2010 23:33:06 -0000 1.38 *************** *** 55,95 **** /** ! * Our NumberFormat instance so we don't have to keep retrieving this ! * on repeated calls. ! */ ! protected static NumberFormat numberFormat=null; ! ! ! /** ! * Initializing accessor for numberFormat. */ public static NumberFormat getNumberFormat() { ! if(numberFormat==null) { ! numberFormat=NumberFormat.getInstance(); } ! return numberFormat; } /** ! * Our DateFormat instance so we don't have to keep retrieving ! * a new one for every date field translation call. ! */ ! protected static DateFormat dateFormat=null; ! ! ! /** ! * Initializing accessor for dateFormat. Not setting the lenient ! * flag in the DateFormat because it causes unpredictable results ! * like rolling over 14:30 into 2:30 AM the next day rather than ! * just reading the 24 hour time spec. */ public static DateFormat getDateFormat() { ! if(dateFormat==null) { ! dateFormat=DateFormat.getDateTimeInstance(); ! //dateFormat.setLenient(true); ! } ! return dateFormat; } --- 55,80 ---- /** ! * Return a NumberFormat for use in translation. */ public static NumberFormat getNumberFormat() { ! return NumberFormat.getInstance(); } /** ! * Return a DateFormat for use in translation. Not setting the ! * lenient flag in the DateFormat, because it causes unpredictable ! * results like rolling over 14:30 into 2:30 AM the next day ! * rather than just reading the 24 hour time spec. ! * ! * While it would be slightly faster to keep a static reference to ! * the DateFormat rather than retrieving it each time, that would ! * not be thread safe and *will* die with an ugly and difficult to ! * trace ArrayIndexOutOfBoundsException given enough load. */ public static DateFormat getDateFormat() { ! return DateFormat.getDateTimeInstance(); } *************** *** 374,385 **** public static String dateToString(Date date,String format,String tzid) { ! if(date==null) { ! return ""; } ! if((format==null)||(format.trim().equals(""))) { ! return getDateFormat().format(date); } ! SimpleDateFormat sdf=new SimpleDateFormat(format); ! if((tzid!=null)&&(!tzid.trim().equals(""))) { ! sdf.setTimeZone(TimeZone.getTimeZone(tzid)); } ! return sdf.format(date); } --- 359,379 ---- public static String dateToString(Date date,String format,String tzid) { ! String retval=""; ! try { ! if(date==null) { ! retval=""; } ! else if((format==null)||(format.trim().equals(""))) { ! retval=getDateFormat().format(date); } ! else { ! SimpleDateFormat sdf=new SimpleDateFormat(format); ! if((tzid!=null)&&(!tzid.trim().equals(""))) { ! sdf.setTimeZone(TimeZone.getTimeZone(tzid)); } ! retval=sdf.format(date); } ! } catch(Throwable e) { ! debugout("dateToString date: " + date + ", format: " + format + ! ", tzid: " + tzid); ! e.printStackTrace(); ! } ! return retval; } |
From: Eric P. <th...@us...> - 2010-01-24 21:01:47
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv386 Modified Files: FileUtil.java Log Message: Factored and fixed for heavy load usage. Index: FileUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/FileUtil.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FileUtil.java 30 Nov 2005 04:10:27 -0000 1.1.1.1 --- FileUtil.java 24 Jan 2010 21:01:37 -0000 1.2 *************** *** 1,5 **** /* * SAND development/deployment environment ! * Copyright (C) 2005 SAND Services Inc. * * This library is free software; you can redistribute it and/or --- 1,5 ---- /* * SAND development/deployment environment ! * Copyright (C) 2005,2010 SAND Services Inc. * * This library is free software; you can redistribute it and/or *************** *** 43,63 **** throws IOException { OutputStream fileOut=null; InputStream fileIn=null; try { - File newdir=new File(newpath); - if(!newdir.exists()) { - newdir.mkdirs(); } - File srcfile=new File(currpath,filename); if(!srcfile.exists()) { throw new IOException( "copyfile srcfile " + srcfile + " not found."); } fileIn=new BufferedInputStream(new FileInputStream(srcfile)); - File outfile=new File(newpath,filename); fileOut=new BufferedOutputStream(new FileOutputStream(outfile)); byte[] buf=new byte[8*1024]; ! int bytesread=buf.length; ! while(bytesread==buf.length) { ! bytesread=fileIn.read(buf,0,buf.length); fileOut.write(buf,0,bytesread); } } finally { --- 43,72 ---- throws IOException { + File newdir=new File(newpath); + if(!newdir.exists()) { + newdir.mkdirs(); } + File srcfile=new File(currpath,filename); + File outfile=new File(newpath,filename); + copyfile(srcfile,outfile); + } + + + /** + * Copy the specified file srcfile to outfile + */ + public static void copyfile(File srcfile,File outfile) + throws IOException + { OutputStream fileOut=null; InputStream fileIn=null; try { if(!srcfile.exists()) { throw new IOException( "copyfile srcfile " + srcfile + " not found."); } fileIn=new BufferedInputStream(new FileInputStream(srcfile)); fileOut=new BufferedOutputStream(new FileOutputStream(outfile)); byte[] buf=new byte[8*1024]; ! int bytesread; ! while((bytesread=fileIn.read(buf))>0) { fileOut.write(buf,0,bytesread); } } finally { |
From: Eric P. <th...@us...> - 2010-01-06 18:09:54
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv32081 Modified Files: AbstractFormManager.java Log Message: Fixed doActionEdit so it only pushes the UPDATING mode if we are not already in that mode. If a button switches us to editing, then we don't need to push the mode again. Otherwise we end up with a mode stack of LISTING.UPDATING.UPDATING which breaks both cancel and save button processing. Index: AbstractFormManager.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/AbstractFormManager.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** AbstractFormManager.java 6 Aug 2009 20:50:11 -0000 1.43 --- AbstractFormManager.java 6 Jan 2010 18:09:43 -0000 1.44 *************** *** 467,471 **** { trace(0,"AbstractFormManager:doActionEdit"); ! uifc.pushModeStack(UIFormInitializer.MODESTACK_UPDATING); SandInstanceMessage sim=uifc.getCurrInst(); //// let the app handle this, see method comments. --- 467,473 ---- { trace(0,"AbstractFormManager:doActionEdit"); ! //switch to edit mode if not already done. ! if(uifc.getMode()!=UIFormInitializer.MODESTACK_UPDATING) { ! uifc.pushModeStack(UIFormInitializer.MODESTACK_UPDATING); } SandInstanceMessage sim=uifc.getCurrInst(); //// let the app handle this, see method comments. |
From: Eric P. <th...@us...> - 2009-12-18 23:28:40
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/structs In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv10477 Added Files: ProcessingStatusStruct.java Log Message: A status message for updates on long running processes. --- NEW FILE: ProcessingStatusStruct.java --- /* * SAND development/deployment environment * Copyright (C) 2008 SAND Services Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.sandev.basics.structs; /** * A status update on the progress of a long running operation. There is * no query form of this message since the matching required for reporting * purposes on the listening side is minimal (normally just checking the * name/identifier). * * @sand.structmessage transmit * @sand.summaryfields name identifier percentComplete status note * @sand.help * A status update on the progress of a long running operation. */ public class ProcessingStatusStruct { /** * A name identifying what kind of status is being sent. There * are no semantics associated with the name, it just provides * additional identifying information that may be useful. * * @sand.invalid "INVALID_NAME" * @sand.stringlength 30 80 * @sand.help * A name identifying what kind of status is being sent. */ protected String name; /** * An identifier of the job being reported on. Typically this is * the thread jobId. * * @sand.range >= 0 * @sand.help * The identifier of the job being reported on. */ protected long identifier; /** * The percentage complete for the job. This is typically a * number between 0 and 100, a negative value represents an * unknown percentage and is used for reporting status on a * job of indeterminate length. A job will typically return * an indeterminte status while it figures out how much work * it needs to do, then return percentages as progress is made * after that. * * @sand.range <= 100 * @sand.printname "percent complete" * @sand.help * The percentage complete for the job. This is typically a * number between 0 and 100, a negative value represents an * unknown percentage and is used for reporting status on a * job of indeterminate length. A job will typically return * an indeterminte status while it figures out how much work * it needs to do, then return percentages as progress is made * after that. */ protected int percentComplete; /** * A status note from the ongoing processing. It is recommended * that this text be in a translatable template form. * * @sand.invalid "INVALID_STATUSMESSAGE" * @sand.stringlength 60 512 * @sand.help * A status message from the ongoing processing. */ protected String note; /** * The current status of the job. * * @sand.enumint UNKNOWN 0 "Unknown" * @sand.enumint PROCESSING 1 "Processing" * @sand.enumint COMPLETE 2 "Complete" * @sand.enumint CANCELLED 3 "Cancelled" * @sand.enumint ERROR 4 "Error" * * @sand.invalid -1 * @sand.default UNKNOWN * @sand.help * The current status of the job. */ protected int status; } |
From: Eric P. <th...@us...> - 2009-12-12 16:50:06
|
Update of /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv1548 Modified Files: XMLPersisterGenerator.java Log Message: Dump stack traces if init fails. Better info message if nothing read on init Index: XMLPersisterGenerator.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator/XMLPersisterGenerator.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** XMLPersisterGenerator.java 3 Dec 2009 14:55:51 -0000 1.7 --- XMLPersisterGenerator.java 12 Dec 2009 16:49:51 -0000 1.8 *************** *** 213,216 **** --- 213,217 ---- out.println(" initProcessDataFile();"); out.println(" } catch(Exception e) {"); + out.println(" e.printStackTrace();"); out.println(" info(\"initial file read failed, retrying...\");"); out.println(" if((e instanceof PersisterException)&&"); *************** *** 300,303 **** --- 301,305 ---- out.println(" closeFile();"); out.println(" } catch(Exception e) {"); + out.println(" e.printStackTrace();"); out.println(" throw new PersisterException(FILECORRUPTED + \": \" + e,e);"); out.println(" }"); *************** *** 337,341 **** out.println(" throws PersisterException"); out.println(" {"); ! out.println(" info(\"XMLPersister init successful lastID: \" + lastID);"); out.println(" }"); out.println(""); --- 339,346 ---- out.println(" throws PersisterException"); out.println(" {"); ! out.println(" if(lastID==Persister.TEMPIDTHRESHOLD+1) {"); ! out.println(" info(\"XMLPersister no items read.\"); }"); ! out.println(" else {"); ! out.println(" info(\"XMLPersister init successful lastID: \" + lastID); }"); out.println(" }"); out.println(""); |
From: Eric P. <th...@us...> - 2009-12-08 14:55:23
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv25151 Modified Files: StringUtil.java Log Message: Added bulletproofing to isJustNumbers utility method. Index: StringUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/StringUtil.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** StringUtil.java 19 Nov 2009 01:57:52 -0000 1.36 --- StringUtil.java 8 Dec 2009 14:55:11 -0000 1.37 *************** *** 1424,1427 **** --- 1424,1432 ---- public static boolean isJustNumbers(String str) { + if(str==null) { + return false; } + str=str.trim(); + if(str.equals("")) { + return false; } for(int i=0;i<str.length();i++) { if(!Character.isDigit(str.charAt(i))) { |
From: Eric P. <th...@us...> - 2009-12-03 14:56:02
|
Update of /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv4560 Modified Files: XMLPersisterGenerator.java Log Message: Check for incomplete XML to trap corrupted files and recover from the .bak on init. Provide override points during initialization to allow extending classes to do additional work at startup. Index: XMLPersisterGenerator.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/build/generate/org/sandev/generator/XMLPersisterGenerator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** XMLPersisterGenerator.java 20 Nov 2008 23:13:37 -0000 1.6 --- XMLPersisterGenerator.java 3 Dec 2009 14:55:51 -0000 1.7 *************** *** 162,166 **** { out.println(" /**"); ! out.println(" * The name of the file we are persisting to."); out.println(" */"); out.println(" protected String fileName=\"localdata.xml\";"); --- 162,169 ---- { out.println(" /**"); ! out.println(" * The name of the file we are persisting to. This data member is"); ! out.println(" * NEVER accessed directly in this file, so the name of the file"); ! out.println(" * can be changed either via setFileName, or through overriding"); ! out.println(" * the getFileName method."); out.println(" */"); out.println(" protected String fileName=\"localdata.xml\";"); *************** *** 196,199 **** --- 199,207 ---- out.println(""); out.println(" /**"); + out.println(" * Error text prefix for any exception that should trigger a restore"); + out.println(" * from backup."); + out.println(" */"); + out.println(" public final static String FILECORRUPTED=\"File Corrupted\";"); + out.println(" /**"); out.println(" * Initialize ourselves to be ready for work."); out.println(" */"); *************** *** 202,217 **** out.println(" {"); out.println(" dm=node;"); - out.println(" lastID=Persister.TEMPIDTHRESHOLD+1;"); out.println(" try {"); ! out.println(" openFile(false);"); ! out.println(" if(br!=null) {"); ! out.println(" String line=null;"); ! out.println(" while((line=br.readLine())!=null) {"); ! out.println(" lastID=Math.max(lastID,idExtract(line)); } }"); ! out.println(" closeFile();"); out.println(" } catch(Exception e) {"); ! out.println(" throw new PersisterException(\"init failed: \" + e,e);"); out.println(" }"); - out.println(" info(\"XMLPersister init successful lastID: \" + lastID);"); out.println(" }"); out.println(""); --- 210,222 ---- out.println(" {"); out.println(" dm=node;"); out.println(" try {"); ! out.println(" initProcessDataFile();"); out.println(" } catch(Exception e) {"); ! out.println(" info(\"initial file read failed, retrying...\");"); ! out.println(" if((e instanceof PersisterException)&&"); ! out.println(" (e.getMessage().startsWith(FILECORRUPTED))) {"); ! out.println(" copyBakToXML();"); ! out.println(" initProcessDataFile(); }"); out.println(" }"); out.println(" }"); out.println(""); *************** *** 249,252 **** --- 254,345 ---- out.println(""); out.println(" /**"); + out.println(" * Overwrite the current file contents with the contents of the"); + out.println(" * backup file."); + out.println(" */"); + out.println(" protected void copyBakToXML()"); + out.println(" throws PersisterException"); + out.println(" {"); + out.println(" info(\"copying \" + getBackupFileName() + \" to \" + getFileName());"); + out.println(" closeFile(); //clear any remaining handles"); + out.println(" try {"); + out.println(" File readfile=new File(getBackupFileName());"); + out.println(" if(!readfile.exists()) {"); + out.println(" throw new PersisterException(\"Backup file \" + "); + out.println(" getBackupFileName() + \"not found\"); }"); + out.println(" FileReader fr=new FileReader(readfile);"); + out.println(" BufferedReader br=new BufferedReader(fr);"); + out.println(" File writefile=new File(getFileName());"); + out.println(" FileWriter fw=new FileWriter(writefile); //rewrite"); + out.println(" PrintWriter pw=new PrintWriter(fw);"); + out.println(" String line=null;"); + out.println(" while((line=br.readLine())!=null) { //eats ending newline"); + out.println(" pw.println(line); }"); + out.println(" pw.close();"); + out.println(" br.close();"); + out.println(" } catch(Exception e) {"); + out.println(" throw new PersisterException(\"Backup copy failed: \" + e,e);"); + out.println(" }"); + out.println(" }"); + out.println(""); + out.println(""); + out.println(" /**"); + out.println(" * Read the data file to ensure integrity and init our ID counter."); + out.println(" * The retry parameter is an indicator of whether this is a second"); + out.println(" * call attempting to restore after the first call failed."); + out.println(" */"); + out.println(" protected void initProcessDataFile()"); + out.println(" throws PersisterException"); + out.println(" {"); + out.println(" info(\"initProcessDataFile calling initPreFileOpen..\");"); + out.println(" initPreFileOpen();"); + out.println(" try {"); + out.println(" openFile(false);"); + out.println(" info(\"initProcessDataFile starting read loop\");"); + out.println(" while(readNextItem()) {"); + out.println(" initProcessItem(); }"); + out.println(" closeFile();"); + out.println(" } catch(Exception e) {"); + out.println(" throw new PersisterException(FILECORRUPTED + \": \" + e,e);"); + out.println(" }"); + out.println(" initPostFileClose();"); + out.println(" }"); + out.println(""); + out.println(""); + out.println(" /**"); + out.println(" * Do whatever needs to happen for initialization before we open"); + out.println(" * the file and walk through all the items to calculate the"); + out.println(" * current max ID."); + out.println(" */"); + out.println(" protected void initPreFileOpen()"); + out.println(" throws PersisterException"); + out.println(" {"); + out.println(" lastID=Persister.TEMPIDTHRESHOLD+1;"); + out.println(" }"); + out.println(""); + out.println(""); + out.println(" /**"); + out.println(" * Do whatever needs to happen with the information from the"); + out.println(" * current item as we walk through all the items in the file."); + out.println(" */"); + out.println(" protected void initProcessItem()"); + out.println(" throws PersisterException"); + out.println(" {"); + out.println(" lastID=Math.max(lastID,getInstID());"); + out.println(" }"); + out.println(""); + out.println(""); + out.println(" /**"); + out.println(" * Do whatever needs to happen for initialization after we have"); + out.println(" * successfully finished walking through all the items in the"); + out.println(" * file."); + out.println(" */"); + out.println(" protected void initPostFileClose()"); + out.println(" throws PersisterException"); + out.println(" {"); + out.println(" info(\"XMLPersister init successful lastID: \" + lastID);"); + out.println(" }"); + out.println(""); + out.println(""); + out.println(" /**"); out.println(" * A synchronized method to process the given message and return"); out.println(" * the result message. Since we are dealing with a single file"); *************** *** 585,590 **** out.println(" }"); out.println(" if(instxml!=null) {"); ! out.println(" return true; }"); ! out.println(" return false;"); out.println(" }"); out.println(""); --- 678,686 ---- out.println(" }"); out.println(" if(instxml!=null) {"); ! out.println(" return true; } //full xml item read"); ! out.println(" if((instbuf.indexOf(\"<\")>=0)&&(!haveBufXMLClosure())) {"); ! out.println(" info(\"readNextItem incomplete item read: \" + instbuf);"); ! out.println(" throw new PersisterException(\"Incomplete item read\"); }"); ! out.println(" return false; //no xml left to read, not even partial."); out.println(" }"); out.println(""); |
From: Eric P. <th...@us...> - 2009-11-30 14:08:15
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv14477 Modified Files: XMLTextProcessing.java Log Message: Added doubleEscape utility method. Index: XMLTextProcessing.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/XMLTextProcessing.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** XMLTextProcessing.java 20 Apr 2009 20:13:43 -0000 1.7 --- XMLTextProcessing.java 30 Nov 2009 14:08:03 -0000 1.8 *************** *** 360,362 **** --- 360,382 ---- } + + /** + * Replace any XML escape sequences with their doubly escaped html + * encoded values. This basically returns what the TextEncoder + * would have given you for each of the special characters we deal + * with here. The resulting text may look like it has the + * characters in it but they won't be recognized by browser + * processing as active. + */ + public static String doubleEscape(String text) + { + String retval=text; + retval=StringUtil.replaceAll(retval,"&","%26"); + retval=StringUtil.replaceAll(retval,"'","%27"); + retval=StringUtil.replaceAll(retval,""","%22"); + retval=StringUtil.replaceAll(retval,"<","%3C"); + retval=StringUtil.replaceAll(retval,">","%3E"); + return retval; + } + } |
From: Eric P. <th...@us...> - 2009-11-25 05:02:19
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv8144 Modified Files: DateUtil.java Log Message: Added wrappers and options for getShortFileDate. Index: DateUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/DateUtil.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** DateUtil.java 19 Sep 2009 03:49:23 -0000 1.19 --- DateUtil.java 25 Nov 2009 05:02:02 -0000 1.20 *************** *** 182,197 **** ! /** ! * Convenience wrapper which gets a new Calendar instance for the given ! * date before calling through to the calendar version of the same ! * method. ! */ public static String getShortFileDate(Date date) { Calendar cal=Calendar.getInstance(); cal.setTime(date); ! return getShortFileDate(cal); } - - /** * Return a short date identifier useful for naming a file. This is --- 182,201 ---- ! /** Convenience wrapper */ public static String getShortFileDate(Date date) { + return getShortFileDate(date,"_"); + } + /** Convenience wrapper */ + public static String getShortFileDate(Date date,String sep) + { Calendar cal=Calendar.getInstance(); cal.setTime(date); ! return getShortFileDate(cal,sep); ! } ! /** Convenience wrapper */ ! public static String getShortfileDate(Calendar cal) ! { ! return getShortFileDate(cal,"_"); } /** * Return a short date identifier useful for naming a file. This is *************** *** 199,207 **** * files will be ordered correctly via directory access. */ ! public static String getShortFileDate(Calendar cal) { StringBuffer buf=new StringBuffer(); int year=cal.get(Calendar.YEAR); buf.append(year); ! buf.append("_"); int month=cal.get(Calendar.MONTH); month++; //jan is zero --- 203,211 ---- * files will be ordered correctly via directory access. */ ! public static String getShortFileDate(Calendar cal,String sep) { StringBuffer buf=new StringBuffer(); int year=cal.get(Calendar.YEAR); buf.append(year); ! buf.append(sep); int month=cal.get(Calendar.MONTH); month++; //jan is zero *************** *** 209,213 **** buf.append("0"); } buf.append(month); ! buf.append("_"); int day=cal.get(Calendar.DAY_OF_MONTH); if(day<10) { --- 213,217 ---- buf.append("0"); } buf.append(month); ! buf.append(sep); int day=cal.get(Calendar.DAY_OF_MONTH); if(day<10) { |
From: Eric P. <th...@us...> - 2009-11-20 22:30:58
|
Update of /cvsroot/sandev/sand/platform/tools/src/org/sandev/tools/HTTP In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17580 Modified Files: AbstractXHTMLFormAdaptor.java Log Message: Let text marked as encoded through as encoded XML. Index: AbstractXHTMLFormAdaptor.java =================================================================== RCS file: /cvsroot/sandev/sand/platform/tools/src/org/sandev/tools/HTTP/AbstractXHTMLFormAdaptor.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** AbstractXHTMLFormAdaptor.java 12 Nov 2009 21:53:02 -0000 1.79 --- AbstractXHTMLFormAdaptor.java 20 Nov 2009 22:30:46 -0000 1.80 *************** *** 2529,2533 **** protected boolean isXHTML(String text) { ! if((text.startsWith("<img "))||(text.indexOf("</ul>")>=0)) { return true; } return false; --- 2529,2535 ---- protected boolean isXHTML(String text) { ! if((text.startsWith("<img "))|| ! (text.indexOf("</ul>")>=0)|| ! (text.startsWith(TEXTENCODED))) { return true; } return false; |
From: Eric P. <th...@us...> - 2009-11-19 01:59:09
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7526 Modified Files: AuthFilterBase.java Log Message: Added missing integration call to allowPersistenceFunction. Index: AuthFilterBase.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/AuthFilterBase.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AuthFilterBase.java 23 Aug 2009 19:03:00 -0000 1.8 --- AuthFilterBase.java 19 Nov 2009 01:58:59 -0000 1.9 *************** *** 22,25 **** --- 22,26 ---- import org.sandev.basics.structs.SandException; import org.sandev.basics.structs.SandMessage; + import org.sandev.basics.structs.SandQueryMessage; import org.sandev.basics.structs.SandPersistMessage; import org.sandev.basics.structs.SandUpdateMessage; *************** *** 280,283 **** --- 281,286 ---- return AuthFilter.AUTH_READONLY; } } return AuthFilter.AUTH_UNRESTRICTED; } + else if(isDisallowedQuery(user,msg)) { //illegal custom function etc + return AuthFilter.AUTH_NOACCESS; } String className=msg.getShortName(); debug("messageInstanceAccess " + className + ", " + getUserDump(user)); *************** *** 487,490 **** --- 490,516 ---- + /** + * Return true if this query should be disallowed due to illegal + * custom functions or similar problematic constructions. + */ + protected boolean isDisallowedQuery(AuthUser user,SandMessage msg) + throws SandException + { + if(!(msg instanceof SandQueryMessage)) { + return false; } + SandQueryMessage sqm=(SandQueryMessage)msg; + SandAttrVal[] matchInfo=sqm.getMatchInfo(); + for(int i=0;i<matchInfo.length;i++) { + String attr=matchInfo[i].getAttr(); + if(attr.startsWith(sqm.PERSISTFUNCTION)) { + String className=msg.getShortName(); + attr=attr.substring(sqm.PERSISTFUNCTION.length()); + String val=matchInfo[i].getVal(); + if(!allowPersistenceFunction(className,attr,val)) { + return true; } } } + return false; //nothing bad found in there + } + + //////////////////////////////////////// // utility methods |
From: Eric P. <th...@us...> - 2009-11-19 01:58:09
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7399 Modified Files: StringUtil.java Log Message: Added ordinal and isJustNumbers utility methods. Index: StringUtil.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/util/StringUtil.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** StringUtil.java 3 Nov 2009 20:56:53 -0000 1.35 --- StringUtil.java 19 Nov 2009 01:57:52 -0000 1.36 *************** *** 182,185 **** --- 182,207 ---- + /** + * Returns the standard ordinal value 1st, 2nd, 3rd etc for the given + * value. + */ + public static String ordinal(int val) + { + switch(val) { + case 11: return "11th"; + case 12: return "12th"; + case 13: return "13th"; + default: { + String valstr="" + val; + if(valstr.endsWith("1")) { + return valstr + "st"; } + if(valstr.endsWith("2")) { + return valstr + "nd"; } + if(valstr.endsWith("3")) { + return valstr + "rd"; } + return valstr + "th"; } } + } + + //////////////////////////////////////// // Long conversion methods. *************** *** 1397,1400 **** --- 1419,1435 ---- /** + * Return true if the given string consists only of numbers, false + * otherwise. + */ + public static boolean isJustNumbers(String str) + { + for(int i=0;i<str.length();i++) { + if(!Character.isDigit(str.charAt(i))) { + return false; } } + return true; + } + + + /** * Wrap the given string so there are no more than maxCharsPerLine * without a terminating newline string. |
From: Eric P. <th...@us...> - 2009-11-19 01:56:57
|
Update of /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/structs In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7304 Modified Files: SandQueryMessage.java Log Message: Added custom value and custom aggregate function integration decls.. Index: SandQueryMessage.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/basics/src/org/sandev/basics/structs/SandQueryMessage.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SandQueryMessage.java 14 Aug 2009 21:41:22 -0000 1.8 --- SandQueryMessage.java 19 Nov 2009 01:56:45 -0000 1.9 *************** *** 181,185 **** /** ! * Specified that this query should return the total value of each * of the fields specified in the operationFields. If no fields are * specified, then the resulting collection will have be STATUS_APPERROR --- 181,185 ---- /** ! * Specifies that this query should return the total value of each * of the fields specified in the operationFields. If no fields are * specified, then the resulting collection will have be STATUS_APPERROR *************** *** 195,198 **** --- 195,230 ---- /** + * Indicates the start of the range of custom aggregate functions. + * Custom aggregate functions are analagous to the standard + * COUNT/AVG/MAX/MIN/SUM functions in how they are called. They + * are added to the system by + * 1. defining the function in the persistent store + * 2. declaring the mapping of the ID to the function name in the + * sandpersist declaration for the build. e.g. + * customAggregates="1001:CustomAggFunc,1002:AnotherAggFunc" + * The persistency generators read the mapping to make the call. + * + * At the time of this writing, custom aggregate functions are not + * supported since there hasn't been a need. This spec serves as + * a placeholder should a driving business case be found. + */ + public final static int FUNCTION_CUSTOMAGGREGATESTART = 1000; + public final static int FUNCTION_CUSTOMAGGREGATEEND = 5000; + + + /** + * Specifies this query is actually a call to a custom function + * returning a single value. Processing reads the first + * SandAttrVal from getMatchInfo where the attr is the name of the + * function (with the PERSISTFUNCTION prefix), and the val is a + * CSV of parameters for the call. + * + * NB: Use of custom value functions is a security risk if not + * properly authorized. See PERSISTFUNCTION notes. + */ + public final static int FUNCTION_CUSTOMVALUE = 9000; + + + /** * Special attribute signifying an extended expression operator. * Used as a flag to signal that the value part of a SandAttrVal *************** *** 392,396 **** /** ! * Set the field name or CSV of field names which the speicifed * function should be applied to. */ --- 424,428 ---- /** ! * Set the field name or CSV of field names which the specified * function should be applied to. */ |