idrs-commit Mailing List for Internet Document and Report Server
Brought to you by:
bigman921
You can subscribe to this list here.
| 2002 |
Jan
(113) |
Feb
(34) |
Mar
(38) |
Apr
(63) |
May
|
Jun
|
Jul
|
Aug
(40) |
Sep
(26) |
Oct
(4) |
Nov
(5) |
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(13) |
Feb
(15) |
Mar
(21) |
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(71) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
|
From: Marc B. <big...@us...> - 2004-09-11 20:08:49
|
Update of /cvsroot/idrs/Idrs/dev/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19267/lib Modified Files: idrs.jar Log Message: Added a "while" tag that allows a condition for looping : <while condition="value < x"> . . . </while> Previosly a script block had to be used to do while loops. The condition is in the form of whatever the scriptcontext uses Index: idrs.jar =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/lib/idrs.jar,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 Binary files /tmp/cvsDgkY6Y and /tmp/cvsGGqyNE differ |
|
From: Marc B. <big...@us...> - 2004-09-11 20:08:48
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19267/src/net/sourceforge/idrs/core/report Added Files: WhileLine.java Log Message: Added a "while" tag that allows a condition for looping : <while condition="value < x"> . . . </while> Previosly a script block had to be used to do while loops. The condition is in the form of whatever the scriptcontext uses --- NEW FILE: WhileLine.java --- /* Copyright (C) 2002-2004 Marc Boorshtein The contents of this file are subject to the Mozilla Public License Version 1.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. */ package net.sourceforge.idrs.core.report; import java.io.Serializable; import java.util.ArrayList; import java.util.Vector; import org.apache.log4j.Logger; import org.w3c.dom.Document; import org.w3c.dom.Element; /** * @author mlb * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class WhileLine extends Line implements Chunk, Serializable { /** The condintion to continue the loop */ String condition; static Logger logger = Logger.getLogger(WhileLine.class.getName()); private Vector vlines; private Line[] lines; /** * @param arg0 */ public WhileLine(String condition) { this.condition = condition; } /** * Sets the vector constaing the lines for the containor @param line Line to add */ public void addLine(Line line) { vlines.add(line); } /** * Sets the vector constaing the lines for the containor *@param lines Lines being used */ public void setLines(Vector lines) { this.vlines = lines; } /* (non-Javadoc) * @see net.sourceforge.idrs.core.report.Chunk#toString(net.sourceforge.idrs.core.report.IDRSHead) */ public String toString(IDRSHead head) throws Exception { // TODO Auto-generated method stub return ""; } /** * "Seals" the report head into static data structures from dynamic ones */ public void seal() { if (! sealed) { ArrayList llines = new ArrayList(); int i=0; for (i=0;i<vlines.size();i++) { Line l = (Line) (Line) vlines.get(i); if (l != null) { //((Line) lines[i]).seal(); } else { lines[i] = new Line(); ((Line) lines[i]).addChunk(new TextChunk("")); ((Line) lines[i]).seal(); } llines.add(l); } lines = new Line[llines.size()]; System.arraycopy(llines.toArray(),0,lines,0,lines.length); sealed = true; vlines.removeAllElements(); } } /** Public method to retrieve the information about the all of the Chunks stored in the Line @param head IDRSHead of report @param buffer Buffered output of report */ public String toString(IDRSHead head, StringBuffer buffer) throws Exception { StringBuffer tmp = new StringBuffer(100); String conditionRes = head.getScriptContext().eval(condition); while (conditionRes.equalsIgnoreCase("true") || conditionRes.equals("1")) { int i = 0; while (i < this.lines.length) { Line line = lines[i]; String ln = line.toString(head,tmp); //if (ln != null) if (tmp.charAt(tmp.length()-1)!='\n') { tmp.append("\n"); } i++; } i=0; tmp.deleteCharAt(tmp.length()-1); conditionRes = head.getScriptContext().eval(condition); } buffer.append(tmp); return null; } public void toDOM(IDRSHead head, Document doc, Element root) throws Exception { StringBuffer tmp = new StringBuffer(100); String conditionRes = head.getScriptContext().eval(condition); while (conditionRes.equalsIgnoreCase("true") || conditionRes.equals("1")) { int i = 0; while (i < this.lines.length) { Line line = lines[i]; line.toDOM(head,doc,root); i++; } i=0; conditionRes = head.getScriptContext().eval(condition); } } } |
|
From: Marc B. <big...@us...> - 2004-09-11 20:08:48
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19267/src/net/sourceforge/idrs/deploy/compile/units Added Files: While.java Log Message: Added a "while" tag that allows a condition for looping : <while condition="value < x"> . . . </while> Previosly a script block had to be used to do while loops. The condition is in the form of whatever the scriptcontext uses --- NEW FILE: While.java --- /* Copyright (C) 2002-2004 Marc Boorshtein The contents of this file are subject to the Mozilla Public License Version 1.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. */ package net.sourceforge.idrs.deploy.compile.units; import java.util.Vector; import net.sourceforge.idrs.core.report.TagLine; import net.sourceforge.idrs.core.report.WhileLine; import net.sourceforge.idrs.deploy.compile.CompilerState; import org.xml.sax.Attributes; /** * @author mlb * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class While extends Body { String condition; private WhileLine whileLine; /** *allows for a compiler to use the attributes of the calling tag */ public void setAttributes(Attributes atts) throws Exception { this.atts = atts; condition = atts.getValue("condition"); this.whileLine = new WhileLine(condition); } /** *allows for the compiler to work with the current state of the page compilation */ public void setState(CompilerState state) throws Exception { this.state = state; state.sealLine(); state.pushLines(); //state.addRepeatLine(id,color1,color2); } /** *Retrieves the current repeat line */ public WhileLine getWhileLine() { return this.whileLine; } /** * allows for the execution of any wrap-up code at the hitting of the end tag */ public void seal() throws Exception { //if (state.getCurrentLine() != null) state.sealLine(); Vector lines = state.popLines(); //System.out.println("num lines repeat : " + lines.size()); whileLine.setLines(lines); state.setLine(whileLine); state.sealLine(); } } |
|
From: Marc B. <big...@us...> - 2004-09-11 20:08:48
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19267/src/net/sourceforge/idrs/deploy/macro Modified Files: MacroToXML.java Log Message: Added a "while" tag that allows a condition for looping : <while condition="value < x"> . . . </while> Previosly a script block had to be used to do while loops. The condition is in the form of whatever the scriptcontext uses Index: MacroToXML.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro/MacroToXML.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MacroToXML.java 30 Aug 2004 00:56:07 -0000 1.21 --- MacroToXML.java 11 Sep 2004 20:08:39 -0000 1.22 *************** *** 360,363 **** --- 360,377 ---- + private int findChar(char look,int begin) { + boolean inQuote = false; + for (int i=begin,m=rmlSrc.length();i<m;i++) { + if (rmlSrc.charAt(i) == '"' && rmlSrc.charAt(i-1) != '\\') { + inQuote = ! inQuote; + } else if (! inQuote && rmlSrc.charAt(i) == look) { + return i; + } + } + return -1; + } + + + /** *Reads rmlSrc for position of the end of the current tag *************** *** 366,371 **** protected int readTag(int begin) { int indexGT, indexLT; ! indexGT = rmlSrc.indexOf(">", begin); ! indexLT = rmlSrc.indexOf("<", begin+1); if (indexLT == -1 || indexGT < indexLT) { return indexGT + 1; --- 380,385 ---- protected int readTag(int begin) { int indexGT, indexLT; ! indexGT = findChar('>', begin); ! indexLT = findChar('<', begin+1); if (indexLT == -1 || indexGT < indexLT) { return indexGT + 1; *************** *** 463,466 **** --- 477,492 ---- } + + private int findChar(char look,String str) { + boolean inQuote = false; + for (int i=0,m=str.length();i<m;i++) { + if (str.charAt(i) == '"' && str.charAt(i-1) != '\\') { + inQuote = ! inQuote; + } else if (! inQuote && str.charAt(i) == look) { + return i; + } + } + return -1; + } /** *Writes the RML tag as full XML 1.0 tag *************** *** 473,476 **** --- 499,503 ---- }*/ + int begin=0, end=0,tmp,retEnd; int tokBegin, tokEnd; *************** *** 489,493 **** begin = end; ! end = tag.indexOf(">"); begin = tag.indexOf(tagName) + tagName.length(); --- 516,520 ---- begin = end; ! end = findChar('>',tag); begin = tag.indexOf(tagName) + tagName.length(); |
|
From: Marc B. <big...@us...> - 2004-08-30 03:00:05
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29424/src/net/sourceforge/idrs/deploy/compile/units Modified Files: Tag.java Log Message: * Added getXMLObjects to idrsshell * Added an "ns" attribute to the "tag" tag so a namespace can be specified Index: Tag.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Tag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Tag.java 29 Aug 2004 05:01:38 -0000 1.3 --- Tag.java 30 Aug 2004 02:59:54 -0000 1.4 *************** *** 36,40 **** this.atts = atts; name = atts.getValue("name"); ! this.tagLine = new TagLine(name,true); } --- 36,40 ---- this.atts = atts; name = atts.getValue("name"); ! this.tagLine = new TagLine(name,true,atts.getValue("ns")); } |
|
From: Marc B. <big...@us...> - 2004-08-30 03:00:05
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29424/src/net/sourceforge/idrs/core/report Modified Files: IDRSCompiler.java TagLine.java Log Message: * Added getXMLObjects to idrsshell * Added an "ns" attribute to the "tag" tag so a namespace can be specified Index: IDRSCompiler.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSCompiler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IDRSCompiler.java 29 Aug 2004 05:01:39 -0000 1.8 --- IDRSCompiler.java 30 Aug 2004 02:59:54 -0000 1.9 *************** *** 1147,1151 **** } ! tagLine = new TagLine(tagName,trim); currentLine = tagLine; Vector lines = new Vector(); --- 1147,1151 ---- } ! tagLine = new TagLine(tagName,trim,null); currentLine = tagLine; Vector lines = new Vector(); Index: TagLine.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/TagLine.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TagLine.java 30 Aug 2004 00:56:08 -0000 1.4 --- TagLine.java 30 Aug 2004 02:59:54 -0000 1.5 *************** *** 33,41 **** private AttributeLine[] attribs; boolean trim; ! public TagLine(String name,boolean trim) { this.tagName = name; vlines = new Vector(); this.trim = trim; } --- 33,43 ---- private AttributeLine[] attribs; boolean trim; + String xmlns; ! public TagLine(String name,boolean trim,String xmlns) { this.tagName = name; vlines = new Vector(); this.trim = trim; + this.xmlns = xmlns; } *************** *** 129,132 **** --- 131,138 ---- } + if (this.xmlns != null) { + buffer.append(" xmlns=\"").append(this.xmlns).append("\" "); + } + buffer.append(">\n"); i = 0; *************** *** 180,183 **** --- 186,194 ---- Element element = doc.createElement(tagName); + + if (this.xmlns != null) { + element.setAttribute("xmlns",this.xmlns); + } + if (root == null) { doc.appendChild(element); |
|
From: Marc B. <big...@us...> - 2004-08-30 03:00:03
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/embedable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29424/src/net/sourceforge/idrs/script/embedable Modified Files: IDRSShell.java Log Message: * Added getXMLObjects to idrsshell * Added an "ns" attribute to the "tag" tag so a namespace can be specified Index: IDRSShell.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/embedable/IDRSShell.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IDRSShell.java 29 Aug 2004 05:01:40 -0000 1.8 --- IDRSShell.java 30 Aug 2004 02:59:54 -0000 1.9 *************** *** 17,20 **** --- 17,22 ---- import javax.servlet.*; import java.io.PrintWriter; + import java.util.ArrayList; + import net.sourceforge.idrs.core.servlet.MultiPartRequest; import net.sourceforge.idrs.utils.Application; *************** *** 194,196 **** --- 196,202 ---- } + public ArrayList getXMLObjects() { + return idrs.getXMLObjects(); + } + } |
|
From: Marc B. <big...@us...> - 2004-08-30 01:43:24
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19734/src/net/sourceforge/idrs/axis Modified Files: IdrsHandler.java IdrsResourceMgr.java IdrsProvider.java Log Message: changes to RML pages are detected every 5 seconds allowing for hot reload Index: IdrsHandler.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/IdrsHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IdrsHandler.java 30 Aug 2004 00:56:10 -0000 1.4 --- IdrsHandler.java 30 Aug 2004 01:43:11 -0000 1.5 *************** *** 46,50 **** public static final String CONFIG_PARSE_OPTION = "parseClass"; ! ConfigInfo config; IdrsResourceMgr mgr; --- 46,50 ---- public static final String CONFIG_PARSE_OPTION = "parseClass"; ! public ConfigInfo config; IdrsResourceMgr mgr; *************** *** 113,116 **** --- 113,118 ---- buildScriptContexts(); logger.info("Created Script Contexts"); + + mgr.config = this.config; } catch (Exception e) { logger.error("Could not initiate handler",e); Index: IdrsResourceMgr.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/IdrsResourceMgr.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IdrsResourceMgr.java 29 Aug 2004 05:01:40 -0000 1.3 --- IdrsResourceMgr.java 30 Aug 2004 01:43:11 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- import java.util.HashMap; + import net.sourceforge.idrs.core.servlet.ConfigInfo; import net.sourceforge.idrs.pool.ScriptPool; import net.sourceforge.idrs.utils.Application; *************** *** 28,30 **** --- 29,32 ---- public HashMap dbs; public ScriptPool scriptPool; + public ConfigInfo config; } Index: IdrsProvider.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/IdrsProvider.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IdrsProvider.java 30 Aug 2004 00:56:10 -0000 1.5 --- IdrsProvider.java 30 Aug 2004 01:43:11 -0000 1.6 *************** *** 18,22 **** --- 18,25 ---- import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; + import java.io.File; + import java.io.FileNotFoundException; import java.io.FileReader; + import java.io.IOException; import java.io.ObjectOutputStream; import java.io.OutputStreamWriter; *************** *** 35,40 **** --- 38,45 ---- import net.sourceforge.idrs.core.report.IDRSRep; + import net.sourceforge.idrs.core.servlet.Init; import net.sourceforge.idrs.deploy.compile.RmlCompiler; import net.sourceforge.idrs.pool.DbPool; + import net.sourceforge.idrs.pool.RepPool; import net.sourceforge.idrs.script.embedable.IDRSScriptLanguage; import net.sourceforge.idrs.utils.Application; *************** *** 71,82 **** public static final String CONFIG_IDRS_RML_PATH = "rml"; public static final String CONFIG_IDRS_BASE_PACKAGE = "basePackage"; ! String rmlSrcPath; String basePackage; ! private IDRSRep report; ! static int count; private boolean doneinit; HashMap nameSpaces; /* (non-Javadoc) --- 76,90 ---- public static final String CONFIG_IDRS_RML_PATH = "rml"; public static final String CONFIG_IDRS_BASE_PACKAGE = "basePackage"; ! IdrsResourceMgr mgr; String rmlSrcPath; String basePackage; ! RepPool pool; static int count; private boolean doneinit; HashMap nameSpaces; + private String rmlSchema; + private String rmlTrans; + private String parseClass; + long lastModified; /* (non-Javadoc) *************** *** 95,106 **** Document doc = null; ! IdrsResourceMgr mgr = (IdrsResourceMgr) msgContext.getProperty(IdrsHandler.IDRS_RESOURCES); HashMap dbs = new HashMap(); IDRSScriptLanguage script = null; String buffer = null; try { ! ! List dbnames = this.report.getHead().getRequiredDBs(); Iterator it = dbnames.iterator(); while (it.hasNext()) { --- 103,115 ---- Document doc = null; ! //IdrsResourceMgr mgr = (IdrsResourceMgr) msgContext.getProperty(IdrsHandler.IDRS_RESOURCES); HashMap dbs = new HashMap(); IDRSScriptLanguage script = null; String buffer = null; + IDRSRep report = null; try { ! report = this.pool.getReport(); ! List dbnames = report.getHead().getRequiredDBs(); Iterator it = dbnames.iterator(); while (it.hasNext()) { *************** *** 145,149 **** ! this.report.getHead().init(dbs, 0, 0, --- 154,158 ---- ! report.getHead().init(dbs, 0, 0, *************** *** 168,171 **** --- 177,187 ---- logger.error("Could not process report",e1); } finally { + if (report != null) { + try { + pool.returnReport(report); + } catch (Exception e) { + logger.error("Could not return report",e); + } + } if (script != null) { try { *************** *** 253,256 **** --- 269,274 ---- private void firstinit(MessageContext ctx) { try { + mgr = (IdrsResourceMgr) ctx.getProperty(IdrsHandler.IDRS_RESOURCES); + // get needed info //System.out.println(ctx.getService().getOptions()); *************** *** 263,274 **** ! String rmlTrans = webinf + "/rmlTrans.xml"; ! String rmlSchema = webinf + "/rmlSchema.xml"; ! ! String parseClass = "org.apache.xerces.parsers.SAXParser"; ! rmlSrcPath = servlet.getServletContext().getRealPath(rmlSrcPath); - this.basePackage = (String) ctx.getService().getOption(IdrsProvider.CONFIG_IDRS_BASE_PACKAGE); Hashtable options = ctx.getService().getOptions(); --- 281,289 ---- ! rmlTrans = webinf + "/rmlTrans.xml"; ! rmlSchema = webinf + "/rmlSchema.xml"; ! parseClass = "org.apache.xerces.parsers.SAXParser"; rmlSrcPath = servlet.getServletContext().getRealPath(rmlSrcPath); Hashtable options = ctx.getService().getOptions(); *************** *** 284,289 **** --- 299,323 ---- } + File rml = new File(rmlSrcPath); + this.lastModified = rml.lastModified(); + + + + loadRML(); + } catch (Exception e) { + logger.error("Could not compile page",e); + } + new LookForRML(this).start(); + this.doneinit = true; + } + + /** + * @throws FileNotFoundException + * @throws IOException + * @throws Exception + */ + protected void loadRML() throws FileNotFoundException, IOException, Exception { StringBuffer buf = new StringBuffer(); BufferedReader in = new BufferedReader(new FileReader(rmlSrcPath)); *************** *** 295,311 **** ! this.compilePage(buf.toString(),new PrintWriter(new OutputStreamWriter(System.out)),parseClass,rmlTrans,true,rmlSchema); ! } catch (Exception e) { ! logger.error("Could not compile page",e); ! } ! ! ! ! this.doneinit = true; } ! public void compilePage ( String src, - PrintWriter logger, String parseClass, String rmlTrans, --- 329,337 ---- ! this.compilePage(buf.toString(),parseClass,rmlTrans,true,rmlSchema); } ! public void compilePage ( String src, String parseClass, String rmlTrans, *************** *** 326,335 **** rmlSchema); ! report = compiler.getReport(); ! } catch (Exception e) { ! e.printStackTrace(logger); --- 352,368 ---- rmlSchema); ! IDRSRep report = compiler.getReport(); + pool = createReportPool(); + pool.build( + 10, + 50, + report, + 2000L, + null, + 10); } catch (Exception e) { ! logger.error("Could not compile report",e); *************** *** 338,340 **** --- 371,415 ---- } + + private RepPool createReportPool() throws Exception { + String reportPool = this.mgr.config.getReportPoolClass(); + reportPool = (reportPool != null) ? reportPool : Init.DEFAULT_REPORT_POOL; + return (RepPool) Class.forName(reportPool).newInstance(); + } + } + + class LookForRML extends Thread { + IdrsProvider provider; + static Logger logger = Logger.getLogger(LookForRML.class.getName()); + + public LookForRML(IdrsProvider provider) { + this.provider = provider; + this.setPriority(Thread.MIN_PRIORITY); + } + + public void run() { + while (true) { + File rml = new File(provider.rmlSrcPath); + if (rml.lastModified() > provider.lastModified) { + logger.info("Found new RML, loading"); + try { + provider.loadRML(); + provider.lastModified = rml.lastModified(); + logger.info("Loaded new RML"); + } catch (FileNotFoundException e) { + logger.error("Could not load RML",e); + } catch (IOException e) { + logger.error("Could not load RML",e); + } catch (Exception e) { + logger.error("Could not load RML",e); + } + } + + try { + this.sleep(5000); + } catch (InterruptedException e) { + return; + } + } + } } |
|
From: Marc B. <big...@us...> - 2004-08-30 01:43:24
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19734/src/net/sourceforge/idrs/core/servlet Modified Files: Init.java Log Message: changes to RML pages are detected every 5 seconds allowing for hot reload Index: Init.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/Init.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Init.java 30 Aug 2004 00:56:07 -0000 1.14 --- Init.java 30 Aug 2004 01:43:11 -0000 1.15 *************** *** 38,45 **** */ public class Init { ! static final String DEFAULT_DB_POOL = "net.sourceforge.idrs.pool.JDBCPool"; ! static final String DEFAULT_REPORT_POOL = "net.sourceforge.idrs.pool.IDRSRepPool"; ! static final String DEFAULT_SCRIPT_POOL = "net.sourceforge.idrs.pool.ScriptContextPool"; --- 38,45 ---- */ public class Init { ! public static final String DEFAULT_DB_POOL = "net.sourceforge.idrs.pool.JDBCPool"; ! public static final String DEFAULT_REPORT_POOL = "net.sourceforge.idrs.pool.IDRSRepPool"; ! public static final String DEFAULT_SCRIPT_POOL = "net.sourceforge.idrs.pool.ScriptContextPool"; |
|
From: Marc B. <big...@us...> - 2004-08-30 00:57:03
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/pool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/utils/pool Modified Files: ObjectPool.java Log Message: Added log4j support. cleaned up the logs Index: ObjectPool.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/pool/ObjectPool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ObjectPool.java 29 Aug 2004 05:01:40 -0000 1.4 --- ObjectPool.java 30 Aug 2004 00:56:09 -0000 1.5 *************** *** 18,21 **** --- 18,23 ---- import java.io.*; + import org.apache.log4j.Logger; + /** *************** *** 25,30 **** */ public abstract class ObjectPool implements Serializable { ! ! protected PrintStream out; //Used for logging pool activity protected int maxTrys; protected long daysOpen; //How many days a pooled object will stay open before being rebuilt --- 27,32 ---- */ public abstract class ObjectPool implements Serializable { ! static Logger logger = Logger.getLogger(ObjectPool.class.getName()); ! protected int maxTrys; protected long daysOpen; //How many days a pooled object will stay open before being rebuilt *************** *** 77,81 **** //added Marc Boorshtein - 8/31/00 ! this.out = new PrintStream(new FileOutputStream(path,false)); this.maxTrys = trys; this.daysOpen = daysOpen; --- 79,83 ---- //added Marc Boorshtein - 8/31/00 ! this.maxTrys = trys; this.daysOpen = daysOpen; *************** *** 127,132 **** PooledObject obj = null; int i; ! System.out.println("MaxTrys:" + maxTrys); ! System.out.println("Num:" + num); if (num <= this.maxTrys) { if (count > 0) { --- 129,133 ---- PooledObject obj = null; int i; ! if (num <= this.maxTrys) { if (count > 0) { *************** *** 135,139 **** for (i=0;i<count;i++) { ! System.out.println("Count : " + count + "," + i); synchronized(pool) { if ((pool[i] != null) && (pool[i].isFree())) { --- 136,140 ---- for (i=0;i<count;i++) { ! synchronized(pool) { if ((pool[i] != null) && (pool[i].isFree())) { *************** *** 143,147 **** reset(i); } ! System.out.println("Got Connection"); pool[i].isFree(false); --- 144,148 ---- reset(i); } ! logger.debug("Got Connection"); pool[i].isFree(false); *************** *** 150,157 **** else { // object failed validation ! System.out.println("Object not valid"); synchronized (this) { java.util.Date dnow = new java.util.Date(System.currentTimeMillis()); ! System.out.println("Output : " + out); reset(i); --- 151,158 ---- else { // object failed validation ! logger.error("Object not valid"); synchronized (this) { java.util.Date dnow = new java.util.Date(System.currentTimeMillis()); ! reset(i); *************** *** 194,202 **** } catch(InterruptedException e) { ! System.out.println("ERROR: Failed while waiting for an object:"); ! System.out.println(e); } //changed Marc Boorshtein - 8/31/00 ! out.println("---------> All Connections Exhausted, waiting in loop " + num); return checkOut(num + 1); } --- 195,203 ---- } catch(InterruptedException e) { ! logger.error("ERROR: Failed while waiting for an object:",e); ! } //changed Marc Boorshtein - 8/31/00 ! logger.debug("---------> All Connections Exhausted, waiting in loop " + num); return checkOut(num + 1); } *************** *** 243,247 **** } else { ! System.out.println("Lost Connection"); } --- 244,248 ---- } else { ! logger.warn("Lost Connection"); } *************** *** 254,258 **** PooledObject obj; if (pos == -1) { ! System.out.println("Lost : " + DBName); } else { --- 255,259 ---- PooledObject obj; if (pos == -1) { ! logger.warn("Lost : " + DBName); } else { *************** *** 261,265 **** } else { ! out.println("-------> Connection " + pos + " lost, rebuilding"); synchronized (pool) { int tmpCount = count; --- 262,266 ---- } else { ! logger.debug("-------> Connection " + pos + " lost, rebuilding"); synchronized (pool) { int tmpCount = count; *************** *** 277,281 **** PooledObject obj; if (pos == -1) { ! System.out.println("Lost : " + pos); } else { --- 278,282 ---- PooledObject obj; if (pos == -1) { ! logger.warn("Lost : " + pos); } else { *************** *** 284,288 **** } else { ! out.println("-------> Connection " + pos + " lost, rebuilding"); synchronized (pool) { int tmpCount = count; --- 285,289 ---- } else { ! logger.debug("-------> Connection " + pos + " lost, rebuilding"); synchronized (pool) { int tmpCount = count; |
|
From: Marc B. <big...@us...> - 2004-08-30 00:57:03
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jndi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/jndi Modified Files: JndiConnection.java JdbcJndiDriver.java Log Message: Added log4j support. cleaned up the logs Index: JndiConnection.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jndi/JndiConnection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JndiConnection.java 29 Aug 2004 05:01:41 -0000 1.3 --- JndiConnection.java 30 Aug 2004 00:56:08 -0000 1.4 *************** *** 25,28 **** --- 25,30 ---- import javax.servlet.http.*; + import org.apache.log4j.Logger; + /** * Wraps a Jndi Connection to an EJB server *************** *** 34,37 **** --- 36,40 ---- + static Logger logger = Logger.getLogger(JndiConnection.class.getName()); HashMap homes; *************** *** 78,83 **** } catch (NamingException e) { ! e.printStackTrace(); ! e.printStackTrace(System.out); throw new SQLNamingException(e); } --- 81,85 ---- } catch (NamingException e) { ! logger.error("Error creating context",e); throw new SQLNamingException(e); } Index: JdbcJndiDriver.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jndi/JdbcJndiDriver.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JdbcJndiDriver.java 29 Aug 2004 05:01:41 -0000 1.2 --- JdbcJndiDriver.java 30 Aug 2004 00:56:09 -0000 1.3 *************** *** 18,21 **** --- 18,23 ---- import javax.naming.*; + import org.apache.log4j.Logger; + /** * Establishes a JNDI connection to an EJB Server. URLs are in the form :<br> *************** *** 24,27 **** --- 26,30 ---- */ public class JdbcJndiDriver implements java.sql.Driver { + static Logger logger = Logger.getLogger(JdbcJndiDriver.class.getName()); /** Identifies the URL prefix */ public static final String URL_ID = "jdbc:ejb:"; *************** *** 40,49 **** try { ! System.out.println("in static"); DriverManager.registerDriver( new net.sourceforge.idrs.jndi.JdbcJndiDriver()); } catch (SQLException e) { ! e.printStackTrace(System.out); } --- 43,52 ---- try { ! DriverManager.registerDriver( new net.sourceforge.idrs.jndi.JdbcJndiDriver()); } catch (SQLException e) { ! logger.error("Could not register driver",e); } *************** *** 68,72 **** java.util.Properties properties) throws java.sql.SQLException { ! System.out.println("in connection"); String props; StringTokenizer toker; --- 71,75 ---- java.util.Properties properties) throws java.sql.SQLException { ! String props; StringTokenizer toker; *************** *** 110,114 **** } ! System.out.println("loading props"); String user = properties.getProperty("user"); if (user != null) { --- 113,117 ---- } ! if (logger.isDebugEnabled()) logger.debug("loading props"); String user = properties.getProperty("user"); if (user != null) { *************** *** 124,128 **** ! System.out.println("loaded props"); Connection con = new JndiConnection(str.substring(beginUrl + 1), properties); --- 127,131 ---- ! if (logger.isDebugEnabled()) logger.debug("loaded props"); Connection con = new JndiConnection(str.substring(beginUrl + 1), properties); |
|
From: Marc B. <big...@us...> - 2004-08-30 00:57:03
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/core Modified Files: ScriptPool.java IDRSPool.java Log Message: Added log4j support. cleaned up the logs Index: ScriptPool.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/ScriptPool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ScriptPool.java 29 Aug 2004 05:01:39 -0000 1.4 --- ScriptPool.java 30 Aug 2004 00:56:08 -0000 1.5 *************** *** 14,17 **** --- 14,18 ---- package net.sourceforge.idrs.core; + import java.io.PrintWriter; import java.util.*; import net.sourceforge.idrs.utils.pool.ObjectPool; *************** *** 28,32 **** public class ScriptPool extends ObjectPool { String scriptClass; ! /** Constructor, initiates a pool with a set of boundaries and a log file. --- 29,33 ---- public class ScriptPool extends ObjectPool { String scriptClass; ! PrintWriter out = null; /** Constructor, initiates a pool with a set of boundaries and a log file. Index: IDRSPool.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/IDRSPool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IDRSPool.java 29 Aug 2004 05:01:39 -0000 1.4 --- IDRSPool.java 30 Aug 2004 00:56:08 -0000 1.5 *************** *** 13,16 **** --- 13,17 ---- package net.sourceforge.idrs.core; + import java.io.PrintWriter; import java.util.*; import net.sourceforge.idrs.utils.pool.ObjectPool; *************** *** 28,32 **** protected String scriptClass; protected IDRSRep rep; ! protected IDRSHead head; --- 29,33 ---- protected String scriptClass; protected IDRSRep rep; ! PrintWriter out = null; protected IDRSHead head; *************** *** 42,46 **** public IDRSPool(int objectMin, int objectLimit, IDRSRep rep, long sleepTime, String path,int trys) throws Exception { super(objectMin, objectLimit, -1,sleepTime,path,trys); ! this.scriptClass = scriptClass; this.rep = rep; --- 43,47 ---- public IDRSPool(int objectMin, int objectLimit, IDRSRep rep, long sleepTime, String path,int trys) throws Exception { super(objectMin, objectLimit, -1,sleepTime,path,trys); ! this.scriptClass = scriptClass; this.rep = rep; |
|
From: Marc B. <big...@us...> - 2004-08-30 00:57:03
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/deploy/macro Modified Files: MacroToXML.java MacroToXMLHandler.java Log Message: Added log4j support. cleaned up the logs Index: MacroToXML.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro/MacroToXML.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MacroToXML.java 29 Aug 2004 05:01:40 -0000 1.20 --- MacroToXML.java 30 Aug 2004 00:56:07 -0000 1.21 *************** *** 13,16 **** --- 13,17 ---- package net.sourceforge.idrs.deploy.macro; + import org.apache.log4j.Logger; import org.xml.sax.*; import org.xml.sax.helpers.*; *************** *** 25,29 **** String errWord; int line; ! String rmlSrc; --- 26,30 ---- String errWord; int line; ! static Logger logger = Logger.getLogger(MacroToXML.class.getName()); String rmlSrc; *************** *** 133,137 **** textBuff.setLength(0); tagEnd = outScript(end); ! System.out.println("After Script Left : \n" + rmlSrc.substring(tagEnd) + "\n End Script Left"); } else { --- 134,138 ---- textBuff.setLength(0); tagEnd = outScript(end); ! logger.debug("After Script Left : \n" + rmlSrc.substring(tagEnd) + "\n End Script Left"); } else { *************** *** 141,145 **** tag = rmlSrc.substring(end, tagEnd); ! System.out.print("tag : " + tag); if (isRMLTag(tag)) { --- 142,146 ---- tag = rmlSrc.substring(end, tagEnd); ! //System.out.print("tag : " + tag); if (isRMLTag(tag)) { *************** *** 222,230 **** int ecr = txt.lastIndexOf('\n'); ! System.out.println("Begin Out Text"); ! System.out.println("Parent, name = " + tg.name + " , isSimple= " + tg.isSimple + ", isClose=" + tg.isClose + ", ownLine=" + tg.ownLine + " , hits=" + tg.hits); ! System.out.println("Current, name = " + tgCurr.name + " , isSimple= " + tgCurr.isSimple + ", isClose=" + tgCurr.isClose + ", ownLine=" + tgCurr.ownLine + " , hits=" + tgCurr.hits); ! System.out.println("Text to print:"); ! System.out.println(txt); --- 223,231 ---- int ecr = txt.lastIndexOf('\n'); ! logger.debug("Begin Out Text"); ! logger.debug("Parent, name = " + tg.name + " , isSimple= " + tg.isSimple + ", isClose=" + tg.isClose + ", ownLine=" + tg.ownLine + " , hits=" + tg.hits); ! logger.debug("Current, name = " + tgCurr.name + " , isSimple= " + tgCurr.isSimple + ", isClose=" + tgCurr.isClose + ", ownLine=" + tgCurr.ownLine + " , hits=" + tgCurr.hits); ! logger.debug("Text to print:"); ! logger.debug(txt); *************** *** 355,359 **** out.write(beginTag + text + endTag); tg.hits++; ! System.out.println("End Out Text"); } --- 356,360 ---- out.write(beginTag + text + endTag); tg.hits++; ! logger.debug("End Out Text"); } Index: MacroToXMLHandler.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro/MacroToXMLHandler.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MacroToXMLHandler.java 29 Aug 2004 05:01:40 -0000 1.10 --- MacroToXMLHandler.java 30 Aug 2004 00:56:07 -0000 1.11 *************** *** 13,16 **** --- 13,17 ---- package net.sourceforge.idrs.deploy.macro; + import org.apache.log4j.Logger; import org.xml.sax.*; import org.xml.sax.helpers.*; *************** *** 23,26 **** --- 24,28 ---- */ public class MacroToXMLHandler extends DefaultHandler { + static Logger logger = Logger.getLogger(MacroToXMLHandler.class.getName()); static final String RML = "rml", TEXT_TAG = "texttag", *************** *** 70,74 **** if (name.equals(RML)) { ! System.out.println("Found Tag : " + currBuff.toString().trim().toLowerCase()); rep = atts.getValue(REPRESENT); --- 72,76 ---- if (name.equals(RML)) { ! logger.debug("Found Tag : " + currBuff.toString().trim().toLowerCase()); rep = atts.getValue(REPRESENT); *************** *** 151,155 **** */ public boolean isRMLTag(String tag) { ! System.out.println("is a rml tag? : " + tag); return rmlTags.get(tag.toLowerCase().trim()) != null; } --- 153,157 ---- */ public boolean isRMLTag(String tag) { ! return rmlTags.get(tag.toLowerCase().trim()) != null; } *************** *** 168,172 **** */ public boolean isTagSimple(String tag) { ! System.out.println("tag " + tag + " exits " + isRMLTag(tag)); return ((Tag) rmlTags.get(tag.toLowerCase().trim())).isSimple; } --- 170,174 ---- */ public boolean isTagSimple(String tag) { ! logger.debug("tag " + tag + " exits " + isRMLTag(tag)); return ((Tag) rmlTags.get(tag.toLowerCase().trim())).isSimple; } *************** *** 177,181 **** */ public boolean isTagOwnLine(String tag) { ! System.out.println("tag " + tag + " exits " + isRMLTag(tag)); return ((Tag) rmlTags.get(tag.toLowerCase().trim())).ownLine; } --- 179,183 ---- */ public boolean isTagOwnLine(String tag) { ! logger.debug("tag " + tag + " exits " + isRMLTag(tag)); return ((Tag) rmlTags.get(tag.toLowerCase().trim())).ownLine; } |
|
From: Marc B. <big...@us...> - 2004-08-30 00:57:03
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/test Modified Files: IDRSTester.java Log Message: Added log4j support. cleaned up the logs Index: IDRSTester.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/test/IDRSTester.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** IDRSTester.java 29 Aug 2004 05:01:42 -0000 1.6 --- IDRSTester.java 30 Aug 2004 00:56:06 -0000 1.7 *************** *** 66,70 **** public String loadPage(String rmlPath,String docName, int docID) throws Exception { StringWriter out = new StringWriter(); ! RmlCompiler compiler = new RmlCompiler(new PrintWriter(out),rmlPath,xmlParser,schemaSrc,false,rmlNS); rep = compiler.getReport(); --- 66,70 ---- public String loadPage(String rmlPath,String docName, int docID) throws Exception { StringWriter out = new StringWriter(); ! RmlCompiler compiler = new RmlCompiler(rmlPath,xmlParser,schemaSrc,false,rmlNS); rep = compiler.getReport(); |
|
From: Marc B. <big...@us...> - 2004-08-30 00:57:02
|
Update of /cvsroot/idrs/Idrs/dev/net/sourceforge/idrs/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/net/sourceforge/idrs/core Modified Files: IDRSServlet.java IDRSParams.java Log Message: Added log4j support. cleaned up the logs Index: IDRSServlet.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/net/sourceforge/idrs/core/IDRSServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IDRSServlet.java 5 Dec 2000 16:33:39 -0000 1.2 --- IDRSServlet.java 30 Aug 2004 00:56:07 -0000 1.3 *************** *** 8,11 **** --- 8,13 ---- import javax.servlet.http.*; import javax.servlet.*; + + import org.apache.log4j.Logger; //import IDRSSecurity; //import IDRSReport; *************** *** 40,43 **** --- 42,46 ---- private IDRSPool idrss; protected Application app; + static Logger logger = Logger.getLogger(IDRSServlet.class.getName()); /** Creates new IDRSServlet */ public IDRSServlet() { *************** *** 87,92 **** catch (Exception e) { try { ! System.out.println(e); ! e.printStackTrace(); } catch (Exception e2) {} --- 90,94 ---- catch (Exception e) { try { ! logger.error("Could retrieve pool",e); } catch (Exception e2) {} *************** *** 177,181 **** } catch (Exception poole) { ! try {poole.printStackTrace(System.out);}catch (Exception ee){} } --- 179,183 ---- } catch (Exception poole) { ! logger.error("Could not load pool",poole); } *************** *** 191,196 **** } catch (Exception e) { ! System.out.println(e + "\n" + e.getMessage() + "\n" ); ! e.printStackTrace(); } } --- 193,197 ---- } catch (Exception e) { ! logger.error("Could not generate report"); } } *************** *** 201,206 **** } catch (Exception e) { ! System.out.println(e + "\n" + e.getMessage() + "\n" ); ! e.printStackTrace(); } } --- 202,206 ---- } catch (Exception e) { ! logger.error("Could not process report",e); } } *************** *** 227,231 **** if (tmpCon == null) { //there are no more connections to use and waiting has timed out ! System.out.println("No Conns!"); connsGotten = conns.keys(); while (connsGotten.hasMoreElements()) { --- 227,231 ---- if (tmpCon == null) { //there are no more connections to use and waiting has timed out ! logger.warn("No connections available"); connsGotten = conns.keys(); while (connsGotten.hasMoreElements()) { Index: IDRSParams.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/net/sourceforge/idrs/core/IDRSParams.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IDRSParams.java 1 Dec 2000 20:04:44 -0000 1.1 --- IDRSParams.java 30 Aug 2004 00:56:07 -0000 1.2 *************** *** 8,11 **** --- 8,13 ---- import javax.servlet.http.*; import javax.servlet.*; + + import org.apache.log4j.Logger; //import IDRSSecurity; import java.io.*; *************** *** 20,24 **** * @version */ ! public class IDRSParams extends HttpServlet { private String dbName, dbDriver, --- 22,27 ---- * @version */ ! public class IDRSParams extends HttpServlet { ! Logger logger = Logger.getLogger(IDRSParams.class.getName()); private String dbName, dbDriver, *************** *** 65,73 **** } catch (Exception e) { ! try { ! //System.out.println(e); ! e.printStackTrace(); ! } ! catch (Exception e2) {} } IDRSPath = svg.getInitParameter("whereIsIDRS"); --- 68,74 ---- } catch (Exception e) { ! ! logger.error("Could not create connection pool",e); ! } IDRSPath = svg.getInitParameter("whereIsIDRS"); |
|
From: Marc B. <big...@us...> - 2004-08-30 00:57:01
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/core/servlet Modified Files: ConfigInfo.java Init.java IdrsConfigHandler.java IdrsController.java Log Message: Added log4j support. cleaned up the logs Index: ConfigInfo.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/ConfigInfo.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConfigInfo.java 29 Aug 2004 05:01:39 -0000 1.4 --- ConfigInfo.java 30 Aug 2004 00:56:07 -0000 1.5 *************** *** 65,68 **** --- 65,71 ---- String securityImp; + String loglevel; + + /** * Constructor for ConfigInfo. *************** *** 505,507 **** --- 508,525 ---- } + public String getLogLevel() { + if (loglevel == null || loglevel.trim().length() == 0) { + return "INFO"; + } else { + return loglevel.toUpperCase(); + } + } + + /** + * @param val + */ + public void setLogLevel(String val) { + this.loglevel = val; + + } } Index: Init.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/Init.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Init.java 29 Aug 2004 05:01:38 -0000 1.13 --- Init.java 30 Aug 2004 00:56:07 -0000 1.14 *************** *** 14,17 **** --- 14,19 ---- package net.sourceforge.idrs.core.servlet; + import org.apache.log4j.Logger; + import org.apache.log4j.Priority; import javax.servlet.http.*; import javax.servlet.*; *************** *** 42,48 **** "net.sourceforge.idrs.pool.ScriptContextPool"; SimpleDateFormat formatter; ! PrintStream log; ! PrintStream errorLog; ServletConfig svg; //JDBCInfo appDB; --- 44,52 ---- "net.sourceforge.idrs.pool.ScriptContextPool"; + + static Logger logger = (Logger) Logger.getInstance(Init.class.getName()); SimpleDateFormat formatter; ! //PrintStream log; ! //PrintStream errorLog; ServletConfig svg; //JDBCInfo appDB; *************** *** 230,234 **** scriptPooler != null ? scriptPooler : DEFAULT_SCRIPT_POOL; ! log.println("Building ScriptContextPools"); try { scriptPool = --- 234,238 ---- scriptPooler != null ? scriptPooler : DEFAULT_SCRIPT_POOL; ! logger.info("Building ScriptContextPools"); try { scriptPool = *************** *** 248,252 **** 10); } catch (Exception e) { ! e.printStackTrace(log); } } --- 252,256 ---- 10); } catch (Exception e) { ! logger.error("Could not load contexts",e); } } *************** *** 268,283 **** idrslogPath = cfg.getReportLogPath(); ! log = ! new PrintStream( ! new FileOutputStream(new File(idrslogPath + "/startup.log"))); this.svg = svg; ! log.println("Starting idrs"); ! log.println( "Date : " + (new java.sql.Date(System.currentTimeMillis())).toString()); ! log.println("-------------------------------------------------------"); ! log.println("Starting Error Log"); buildLog(); --- 272,285 ---- idrslogPath = cfg.getReportLogPath(); ! this.svg = svg; ! logger.info("Starting idrs"); ! logger.info( "Date : " + (new java.sql.Date(System.currentTimeMillis())).toString()); ! ! logger.info("Starting Error Log"); buildLog(); *************** *** 285,296 **** app = buildApplication(); ! log.println("-------------------------------------------------------"); getAppDB(); ! log.println("-------------------------------------------------------"); retrieveDocDBs(); ! log.println("-------------------------------------------------------"); //first load appDB info --- 287,298 ---- app = buildApplication(); ! getAppDB(); ! retrieveDocDBs(); ! //first load appDB info *************** *** 311,320 **** //now load all of the docs loadDocs(); ! log.println("-------------------------------------------------------"); ! log.println("-------------------------------------------------------"); //build script contexts buildScriptContexts(); ! log.println("-------------------------------------------------------"); this.digestType = cfg.getDigestType(); --- 313,322 ---- //now load all of the docs loadDocs(); ! ! //build script contexts buildScriptContexts(); ! this.digestType = cfg.getDigestType(); *************** *** 322,326 **** // System.out.println("digest pass : " + digestPass); // System.out.println("digest type: " + this.digestType); ! log.close(); } --- 324,328 ---- // System.out.println("digest pass : " + digestPass); // System.out.println("digest type: " + this.digestType); ! } *************** *** 332,340 **** int i; //temporary ! log.println("Create Application Object"); try { app = new Application(cfg.getVars()); } catch (Exception te) { ! te.printStackTrace(log); } --- 334,342 ---- int i; //temporary ! logger.info("Create Application Object"); try { app = new Application(cfg.getVars()); } catch (Exception te) { ! logger.error("Could not create application object"); } *************** *** 391,395 **** protected void loadDocs() throws Exception { net.sourceforge.idrs.pool.RepPool pool; ! log.println("Loading Docs"); String name = ""; //String reportPool; --- 393,397 ---- protected void loadDocs() throws Exception { net.sourceforge.idrs.pool.RepPool pool; ! logger.info("Loading Docs"); String name = ""; //String reportPool; *************** *** 463,468 **** docsID.put(rs.getString(docid), repstr); } catch (Exception edoc) { ! log.println("DocName : " + name); ! edoc.printStackTrace(log); } } --- 465,469 ---- docsID.put(rs.getString(docid), repstr); } catch (Exception edoc) { ! logger.error("Could not load document " + docname,edoc); } } *************** *** 471,476 **** con.close(); } catch (Exception e99) { ! log.println("DocName : " + name); ! e99.printStackTrace(log); } } --- 472,476 ---- con.close(); } catch (Exception e99) { ! logger.error("Could not load document " + name,e99); } } *************** *** 480,484 **** */ public void retrieveDocDBs() throws Exception { ! log.println("Retrieving Doc Dbs"); Connection con; String dbPool; --- 480,484 ---- */ public void retrieveDocDBs() throws Exception { ! logger.info("Retrieving Doc Dbs"); Connection con; String dbPool; *************** *** 538,543 **** //tmpDB.returnConnection(con); } catch (Exception e) { ! e.printStackTrace(System.out); ! e.printStackTrace(log); } --- 538,542 ---- //tmpDB.returnConnection(con); } catch (Exception e) { ! logger.error("Could not load DBs",e); } *************** *** 549,570 **** protected void buildLog() throws Exception { ! formatter = new SimpleDateFormat("yyyy.MMMMM.dd hh::mm aaaa"); ! errorLog = ! new PrintStream(new FileOutputStream(new File(cfg.getErrorLog()))); ! String now = ! formatter.format(new java.util.Date(System.currentTimeMillis())); ! errorLog.println("[Log Begining " + now + "]"); } public void logEvent(String type, Exception mess) throws Exception { ! String now = ! formatter.format(new java.util.Date(System.currentTimeMillis())); ! errorLog.println("[Begin Event " + type + " " + now + "]"); ! mess.printStackTrace(errorLog); ! errorLog.println("[End Event " + type + " " + now + "]"); } public void close() throws Exception { ! errorLog.close(); } --- 548,561 ---- protected void buildLog() throws Exception { ! } public void logEvent(String type, Exception mess) throws Exception { ! logger.error(type,mess); ! } public void close() throws Exception { ! } Index: IdrsConfigHandler.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IdrsConfigHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IdrsConfigHandler.java 29 Aug 2004 05:01:38 -0000 1.3 --- IdrsConfigHandler.java 30 Aug 2004 00:56:07 -0000 1.4 *************** *** 57,60 **** --- 57,61 ---- public static final String var = "var"; public static final String securityImp = "securityImp"; + public static final String logLevel = "logLevel"; //public static final int scriptPoolMax = "scriptPoolMax".hashCode(); *************** *** 171,174 **** --- 172,177 ---- else if (localName.equalsIgnoreCase(this.securityImp)) { cfg.setSecurityImp(val); + } else if (localName.equalsIgnoreCase(this.logLevel)) { + cfg.setLogLevel(val); } Index: IdrsController.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IdrsController.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** IdrsController.java 29 Aug 2004 05:01:38 -0000 1.7 --- IdrsController.java 30 Aug 2004 00:56:07 -0000 1.8 *************** *** 15,18 **** --- 15,20 ---- import javax.servlet.http.*; import javax.servlet.*; + + import org.apache.log4j.Logger; //import IDRSSecurity; //import IDRSReport; *************** *** 60,63 **** --- 62,66 ---- protected ServletContext servletContext; + static Logger logger = Logger.getLogger(IdrsController.class.getName()); /** * Constructor for IdrsController. *************** *** 154,159 **** req.setAttribute("fetchAddr", null); } catch (Exception e) { ! System.out.println(e + "\n" + e.getMessage() + "\n"); ! e.printStackTrace(); } } --- 157,161 ---- req.setAttribute("fetchAddr", null); } catch (Exception e) { ! logger.error("Could not return resources",e); } } *************** *** 311,315 **** for (int i = 0; i < Params.length; i++) { param = (String) Params[i]; ! System.out.println("Param : " + param); //determine what area of the header "db" is being added to db = param.substring(0, param.indexOf("_")); --- 313,317 ---- for (int i = 0; i < Params.length; i++) { param = (String) Params[i]; ! if (logger.isDebugEnabled()) logger.debug("Parameter : " + param); //determine what area of the header "db" is being added to db = param.substring(0, param.indexOf("_")); *************** *** 336,340 **** dbCache.remove(db); } ! ignore.printStackTrace(System.out); } } else if (param.indexOf("PageSize") != -1) { --- 338,342 ---- dbCache.remove(db); } ! logger.error("Could not reset document",ignore); } } else if (param.indexOf("PageSize") != -1) { *************** *** 450,457 **** try { isSecure = secure.checkOK(); ! System.out.println("Secure : " + isSecure); } catch (Exception securException) { //user is not authentic, deny access ! securException.printStackTrace(System.out); secure.close(); accessDenied(req, resp); --- 452,459 ---- try { isSecure = secure.checkOK(); ! if (logger.isDebugEnabled()) logger.debug("Secure : " + isSecure); } catch (Exception securException) { //user is not authentic, deny access ! logger.error("Error durring authentication",securException); secure.close(); accessDenied(req, resp); *************** *** 644,649 **** } catch (Exception e) { ! System.out.println("Error in parsing multi/part request"); ! e.printStackTrace(System.out); } --- 646,651 ---- } catch (Exception e) { ! logger.error("Error in parsing multi/part request",e); ! } |
|
From: Marc B. <big...@us...> - 2004-08-30 00:57:01
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/deploy Modified Files: DocReset.java HotDeploy.java RMLDeploy.java Log Message: Added log4j support. cleaned up the logs Index: DocReset.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/DocReset.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DocReset.java 29 Aug 2004 05:01:42 -0000 1.5 --- DocReset.java 30 Aug 2004 00:56:07 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- import java.util.*; import java.sql.*; + + import org.apache.log4j.Logger; + import net.sourceforge.idrs.pool.*; *************** *** 26,29 **** --- 29,33 ---- */ public final class DocReset extends Thread { + static Logger logger = Logger.getLogger(DocReset.class.getName()); String allowedHost; int port; *************** *** 63,67 **** .equals(allowedHost))) { ! System.out.println("Validation Succeeded"); in = new BufferedReader( --- 67,71 ---- .equals(allowedHost))) { ! logger.info("Validation Succeeded"); in = new BufferedReader( *************** *** 69,76 **** input = in.readLine(); in.close(); ! System.out.println( ! "id : " + input.substring(0, input.indexOf(":"))); ! System.out.println( ! "name : " + input.substring(input.indexOf(":") + 1)); redeploy( input.substring(0, input.indexOf(":")), --- 73,77 ---- input = in.readLine(); in.close(); ! redeploy( input.substring(0, input.indexOf(":")), *************** *** 78,89 **** } ! System.out.println("closing connection"); client.close(); } } catch (Exception e) { ! try { ! e.printStackTrace(System.out); ! } catch (Exception ee) { ! } } } --- 79,87 ---- } ! client.close(); } } catch (Exception e) { ! logger.error("Could not reset document",e); } } Index: HotDeploy.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/HotDeploy.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HotDeploy.java 29 Aug 2004 05:01:42 -0000 1.6 --- HotDeploy.java 30 Aug 2004 00:56:07 -0000 1.7 *************** *** 16,19 **** --- 16,22 ---- import javax.servlet.http.*; import javax.servlet.*; + + import org.apache.log4j.Logger; + import java.io.*; import java.util.*; *************** *** 26,29 **** --- 29,33 ---- */ public final class HotDeploy extends HttpServlet { + static Logger logger = Logger.getLogger(HotDeploy.class.getName()); String user, pass, url, className,parseClass,schemaLocation,rmlTrans; String[] servers; *************** *** 79,90 **** out = new PrintStream(new FileOutputStream(new File(logPath))); String now = formatter.format(new java.util.Date(System.currentTimeMillis())); ! out.println("[Log Begining " + now + "]"); } catch (Exception e) { ! try { ! System.out.println("Logging could not occurr, " + logPath + " not found"); ! } ! catch (Exception ee) { ! } } --- 83,92 ---- out = new PrintStream(new FileOutputStream(new File(logPath))); String now = formatter.format(new java.util.Date(System.currentTimeMillis())); ! logger.info("[Log Begining " + now + "]"); } catch (Exception e) { ! ! logger.error("Logging could not occurr, " + logPath + " not found",e); ! } *************** *** 122,128 **** dep = new RMLDeploy(con); ! if (dep == null) System.out.println("dep null"); ! if (req.getParameter("update") == null) System.out.println("Update null"); dep.setUpdate(req.getParameter("update").equals("1")); --- 124,130 ---- dep = new RMLDeploy(con); ! if (dep == null) logger.warn("dep null"); ! if (req.getParameter("update") == null) logger.warn("Update null"); dep.setUpdate(req.getParameter("update").equals("1")); *************** *** 186,194 **** } catch (Exception e) { ! try { ! e.printStackTrace(System.out); ! } ! catch (Exception ee) { ! } } } --- 188,192 ---- } catch (Exception e) { ! logger.error("Could not deploy",e); } } Index: RMLDeploy.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/RMLDeploy.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RMLDeploy.java 29 Aug 2004 05:01:42 -0000 1.7 --- RMLDeploy.java 30 Aug 2004 00:56:07 -0000 1.8 *************** *** 192,196 **** this.compiler = new RmlCompiler( ! logger, src, parseClass, --- 192,196 ---- this.compiler = new RmlCompiler( ! src, parseClass, *************** *** 297,301 **** for (i = 0, m = names.length; i < m; i++) { snames += (String) names[i] + "=? ,"; ! System.out.println(names[i]); } --- 297,301 ---- for (i = 0, m = names.length; i < m; i++) { snames += (String) names[i] + "=? ,"; ! } *************** *** 332,336 **** snames += (String) names[i] + " ,"; svals += "? , "; ! System.out.println(names[i]); } --- 332,336 ---- snames += (String) names[i] + " ,"; svals += "? , "; ! } |
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:59
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/core/report Modified Files: GenTag.java IDRSHead.java IDRSRep.java TagLine.java Log Message: Added log4j support. cleaned up the logs Index: GenTag.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/GenTag.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GenTag.java 29 Aug 2004 05:01:39 -0000 1.7 --- GenTag.java 30 Aug 2004 00:56:08 -0000 1.8 *************** *** 180,184 **** sval = head.getRequest().getParameter(name); if (sval == null) { ! System.out.println("Getting db value " + owner + "." + src + " : " + head.getFieldData(owner,src)); return (sval = head.getFieldData(owner,src)) != null ? sval : ""; } --- 180,184 ---- sval = head.getRequest().getParameter(name); if (sval == null) { ! return (sval = head.getFieldData(owner,src)) != null ? sval : ""; } *************** *** 188,192 **** } else { ! System.out.println("Getting db value " + owner + "." + src + " : " + head.getFieldData(owner,src)); return (sval = head.getFieldData(owner,src)) != null ? sval : ""; } --- 188,192 ---- } else { ! return (sval = head.getFieldData(owner,src)) != null ? sval : ""; } *************** *** 246,250 **** sval = head.getRequest().getParameter(name); if (sval == null) { ! System.out.println(owner +"." + src + " is " + head.getFieldData(owner,src)); return (sval = head.getFieldData(owner,src)) != null ? sval.equals("1") : false; } --- 246,250 ---- sval = head.getRequest().getParameter(name); if (sval == null) { ! return (sval = head.getFieldData(owner,src)) != null ? sval.equals("1") : false; } *************** *** 254,258 **** } else { ! System.out.println(owner +"." + src + " is " + head.getFieldData(owner,src)); return (sval = head.getFieldData(owner,src)) != null ? sval.equals("1") : false; } --- 254,258 ---- } else { ! return (sval = head.getFieldData(owner,src)) != null ? sval.equals("1") : false; } Index: IDRSHead.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSHead.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** IDRSHead.java 29 Aug 2004 05:01:39 -0000 1.20 --- IDRSHead.java 30 Aug 2004 00:56:08 -0000 1.21 *************** *** 28,31 **** --- 28,32 ---- import javax.naming.*; + import org.apache.log4j.Logger; import org.w3c.dom.Element; *************** *** 33,36 **** --- 34,38 ---- public final class IDRSHead implements Serializable, IDRSScript { + static transient Logger logger = Logger.getLogger(IDRSHead.class.getName()); protected String header; protected String text; *************** *** 639,643 **** catch (Exception e) { try { ! e.printStackTrace(System.out); } catch (Exception ee) {} --- 641,645 ---- catch (Exception e) { try { ! logger.error("Error while cloning",e); } catch (Exception ee) {} *************** *** 711,715 **** public void createError(String err) { ! System.out.println("Error 1: " + err); request.setAttribute(ERR_NAME,err); // System.out.println("Error 2: " + request.getAttribute(ERR_NAME)); --- 713,717 ---- public void createError(String err) { ! request.setAttribute(ERR_NAME,err); // System.out.println("Error 2: " + request.getAttribute(ERR_NAME)); Index: IDRSRep.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSRep.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** IDRSRep.java 29 Aug 2004 05:01:39 -0000 1.5 --- IDRSRep.java 30 Aug 2004 00:56:08 -0000 1.6 *************** *** 15,18 **** --- 15,19 ---- import java.io.*; + import org.apache.log4j.Logger; import org.w3c.dom.Document; *************** *** 25,28 **** --- 26,30 ---- protected IDRSHead head; static final long serialVersionUID = 8480452640177071542L; + static transient Logger logger = Logger.getLogger(IDRSRep.class.getName()); /** *************** *** 99,103 **** catch (Exception e) { try { ! e.printStackTrace(System.out); } catch (Exception ee) {} --- 101,105 ---- catch (Exception e) { try { ! logger.error("Error while cloning",e); } catch (Exception ee) {} Index: TagLine.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/TagLine.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TagLine.java 29 Aug 2004 05:01:39 -0000 1.3 --- TagLine.java 30 Aug 2004 00:56:08 -0000 1.4 *************** *** 177,181 **** //StringBuffer output = new StringBuffer(""); ! System.out.println("tagname : " + tagName); Element element = doc.createElement(tagName); --- 177,181 ---- //StringBuffer output = new StringBuffer(""); ! Element element = doc.createElement(tagName); |
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:50
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/utils Modified Files: ObjectStore.java DB.java UserInfo.java Log Message: Added log4j support. cleaned up the logs Index: ObjectStore.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/ObjectStore.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ObjectStore.java 29 Aug 2004 05:01:41 -0000 1.12 --- ObjectStore.java 30 Aug 2004 00:56:08 -0000 1.13 *************** *** 442,446 **** */ public void importDOM(Element root,Object obj,String basePackage) throws Exception { ! System.out.println("Entering importDOM"); Method[] meths = obj.getClass().getMethods(); --- 442,446 ---- */ public void importDOM(Element root,Object obj,String basePackage) throws Exception { ! Method[] meths = obj.getClass().getMethods(); *************** *** 479,483 **** NodeList children = elem.getChildNodes(); if (elem.getAttributes().getLength() == 0 && children.getLength() == 1 && children.item(0).getNodeType() == Node.TEXT_NODE) { ! System.out.println("Seting property : " + name); // convert the name into a java property, setXXXX name = "set" + new String(new char[]{name.toUpperCase().charAt(0)}) + name.substring(1); --- 479,483 ---- NodeList children = elem.getChildNodes(); if (elem.getAttributes().getLength() == 0 && children.getLength() == 1 && children.item(0).getNodeType() == Node.TEXT_NODE) { ! // convert the name into a java property, setXXXX name = "set" + new String(new char[]{name.toUpperCase().charAt(0)}) + name.substring(1); *************** *** 494,498 **** String className = (basePackage != null && basePackage.trim().length() > 0 ? basePackage + "." : "") + name; ! System.out.println("Creating object : " + className); Object newobj = Class.forName(className).newInstance(); --- 494,498 ---- String className = (basePackage != null && basePackage.trim().length() > 0 ? basePackage + "." : "") + name; ! Object newobj = Class.forName(className).newInstance(); Index: DB.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/DB.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** DB.java 29 Aug 2004 05:01:41 -0000 1.18 --- DB.java 30 Aug 2004 00:56:08 -0000 1.19 *************** *** 18,21 **** --- 18,23 ---- import net.sourceforge.idrs.core.report.IDRSHead; import java.io.*; + + import org.apache.log4j.Logger; /** *Class DB *************** *** 27,31 **** --- 29,35 ---- */ + public class DB implements Serializable { + static transient Logger logger = Logger.getLogger(DB.class.getName()); //public fields public static final int SERVER = 1; *************** *** 783,787 **** HashMap caches = null; ! System.out.println("Client Cursor : " + (this.cursur == DB.CLIENT)); if (this.cursur == DB.CLIENT) { caches = ((HashMap) idrs.getSession().getAttribute("IDRS_DB_CACHE")); --- 787,791 ---- HashMap caches = null; ! if (logger.isDebugEnabled()) logger.debug("Client Cursor : " + (this.cursur == DB.CLIENT)); if (this.cursur == DB.CLIENT) { caches = ((HashMap) idrs.getSession().getAttribute("IDRS_DB_CACHE")); *************** *** 791,796 **** } this.wasCached = (caches.get(this.ID) != null); ! System.out.println("Cached : " + this.wasCached); ! System.out.println("Cache : " + caches.get(this.name)); } --- 795,800 ---- } this.wasCached = (caches.get(this.ID) != null); ! logger.debug("Cached : " + this.wasCached); ! logger.debug("Cache : " + caches.get(this.name)); } *************** *** 804,810 **** ! System.out.println("is cached? : " + this.wasCached); if (! this.wasCached || caches.get(this.name) == null) { ! System.out.println("in here"); if (! idrs.isError()) { if (type == METHOD) { --- 808,814 ---- ! logger.debug("is cached? : " + this.wasCached); if (! this.wasCached || caches.get(this.name) == null) { ! if (! idrs.isError()) { if (type == METHOD) { Index: UserInfo.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/UserInfo.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UserInfo.java 29 Aug 2004 05:01:41 -0000 1.5 --- UserInfo.java 30 Aug 2004 00:56:08 -0000 1.6 *************** *** 36,40 **** userName=name; userID=id; ! System.out.println("GROUPS: " + groups); StringTokenizer tok = new StringTokenizer(groups,",",false); this.groups = new int[tok.countTokens()]; --- 36,40 ---- userName=name; userID=id; ! StringTokenizer tok = new StringTokenizer(groups,",",false); this.groups = new int[tok.countTokens()]; *************** *** 43,47 **** while (tok.hasMoreTokens()) { this.groups[i++] = Integer.parseInt(tok.nextToken().trim()); ! System.out.println(this.groups[i-1]); } } --- 43,47 ---- while (tok.hasMoreTokens()) { this.groups[i++] = Integer.parseInt(tok.nextToken().trim()); ! } } |
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:28
|
Update of /cvsroot/idrs/Idrs/dev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162 Modified Files: build.xml Log Message: Added log4j support. cleaned up the logs Index: build.xml =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/build.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** build.xml 29 Aug 2004 04:50:30 -0000 1.13 --- build.xml 30 Aug 2004 00:56:11 -0000 1.14 *************** *** 34,37 **** --- 34,38 ---- <pathelement location="${lib}/jaxb-impl.jar"/> <pathelement location="${lib}/jaxb-api.jar"/> + <pathelement location="${lib}/log4j-1.2.8.jar"/> </classpath> </javac> |
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:28
|
Update of /cvsroot/idrs/Idrs/dev/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/lib Added Files: log4j-1.2.8.jar Log Message: Added log4j support. cleaned up the logs --- NEW FILE: log4j-1.2.8.jar --- PK 1à>w×'ñDAÒ`¡b¿½3#·"¾½1XZÃÌì!º'gÌKÑVÍ8ÛdB+×O#º.W]¤bKÕrÆÙò ¡ªöiXÜ4g»0z ¨´É#_Uðkr®V8Úh>©§dÛt¶f÷PK3`W øÅ½qéÛW´»Ê~¡¥U£lÕ¶½¼iâU×ây6Ñ"Ê©ß{ÊXÍ´+¨u¥=H,:K¡ùrû0n\d`È!9Õ<Ù#(Z(¬`Ó°a Ã&¶·±cØBÛp{ûèPÃÝ9t?PKr«¯K ßâ8qRfñ§r3üîó"fE\ñ²*ÏêeKÀº¬n2rIÎYFÕÛ'3Yûj·°&O3ì¤<#gTY+d-CÑ t³3ºÐ¾RÇ1CÑ Å%Inµ¼ÊW %%3P%D xÉùjqHG0ĹæÂ¬¨Kª¼Æèe¢)Ö^uÝ=') zjÊ*;ZgÆ y\µCÔs²zR6þî¢b:Ü_*1-Ïá)¦2K×È&9g)3²ÅJ¢kÉy/d÷]Cà¾Å4vÎA¶ ØZÕªÃÀÓ,-åT&lG'MV<سU`KwÏ=Õ FÈ%6ÕÂxEh´¥ ÓpxÖeY{ÜãHGmª%¹ ¹,å¼!V¤ÔÔm@ºãò¢¹»î©³©a.KÞÝ@òña½lä+õS½Ûh el[¡¨ÈÔ03¤©³CZU'átKèÅ6 =HIH#%â ¯"% ÕïûþòÄÏ\ûAÊt]g|0å§$ìÄE q?%îLKñ×1"á d$t¢KÂlñ¦·pD@_¿e±éE ,ÝUɹ`ãmxG»xOÂapïsÓ»¤Gõr²(ϰ$9íh¤t'å¤VVÕ¤=ù¶øÉ½0" óÇæJ6Æ'Yê0]Ür&GÁö»ô/õì<Yé "Ñ#§6Dö¨¥;'4!jþ©òl¼Ìw;ÓAóÚ¯Y1Æ©1d-Ë*oCÍ üù»üâ³Ú`ëG¿#ÿ#ySø'áÞ-±'|N6´p'}Y7Ò|æ,£¯|3ÑÞpöN·w⻽§ÝöÞH´>HoPGO@KêÔ F¯¡ná-õótÂC´6°ÁVÒxÞ$G°vzJÓö;ý* "öÁ¾* à# phïJ]Eä&S©ôØÄDæèå*Äô¢)ZÄæVÔÓz2ò4Ö"KNRflK6×zr!ülÛ»=§wmîWC*%¸F+Fâ¶¢íùª¼öxjIò»4¹[áùQNãEHt¶¶D#-hºNA-bµ?b)! êi¿VÉ´gò ìuMrÓü®Ô?÷¥üb¸ÞïÃà|9 'tüZf¿8ïKNe¶ Np¼¸aÇË¡Ïϰ"ñyÃòXýxÚqãÞ_ëkqϧÙò3ôø[¼§cÃ:Nâk:Na\ÇøDRñüN*ó¦{ÖMù=ú¤5=ÉÕ²àæj(s_Êõû[µDÕøFq½r7¶!v9Ò}¸7©açj7YÙå:͸¦V!Æç¡ÞdÒÉ]Ôи¡¸sF#÷´i/EçkÚ´¾}ÍãÉ©YsBRL wn âç¿Rt骽L(Y!vg^R¬2¶òý l·:'}&:oäûærC Ûg¥e¢ú-;XhÖ±liê®ë°Üaö'ÕTÒÐÊONh80ùáàü|Wà>JÞpÈ/ªyÕÈK¯Æ#jÜÆ3lóé%Tq<Ò¾ýϨØ+˨¼P;E0×#Ë^G5§±öO¸»ëÐ9ÕP»¨@§¼Qå2D`õÒDwÐáº|.ó÷5ô¢[<nô Ò,- 8î¡íê¡¿ÊбºÎD;W}¶Hv`'µvÒÃÎÀ{½:ÙÃÝ$íeú·FîÓ¢ïMf½ÜáKý8Qô«í£N÷.ÓÙ¶ÓÛEì ûª«rZZ'¢tÈl hæ4|z!fª~סh$Îú¦Ø½Ê¢^óµÿþCf4²§¸Òr±âì+v$Ô¹ÒbdØÏ"w1¦VG<¿½ ÂíWô1~%¡ÃØÅ³_ç>Åóã´p?ÃÌO0ÖÇ1o²ÉpÇÀ·0 ¤à KȨÅ!_]ÆWxï 쥷Ǹ«Iôkô9Ñ~²}bP ´÷*Â+}R§¡ÎÏ丳8ÄP;TßÚywI^4!Eh%¡»i®¡È¸-j\ME1ô©115p©í¡¼Dͧ©ûµ%û#'ÐH KôÃK ZUÁpØ ý ÎøA5*⩸ªpwÇÊÇ*Eºí¤õv%©S§^æî+\}µÞ½ùð½LûônZOïý++rûÜ®WlÞ¥ÆR7¯ÉW?W_/ «)¨ZY0¢x=1ßaB=wLþ(0Vo ÐòUå~Úâ¢ÚyÏFïà¨pT}Åûu&ÀÑé㨨ÜhãýmgýÂ4¯+̽kD[ôkÓ@¥iØÐ>àîLàGdÕïK5Î&oÕ~Ü~ûYäîØ~þHûlÒ~VÓïý¶Ý¾ßeîÞ ß?Ñï§ø]¥Ç7Ø~û··°ß¯5òZý¬ø[p`+Ì6rXÙ:'|[Ý%l µ,áàFsÿäÛá_0Æð:Å+R4w¿Ïh±S¶oäÍ¿KJ JRZæÿ ÍÓªµqë°F¸%p)ïJ °³Ñ8GîoÒynÏãT[¹Wô"Ô'LãO»¡hìb_sv*qå_PKÍõð [...1280 lines suppressed...] Æ (q 1² ö |
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:28
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/deploy/compile Modified Files: RmlCompiler.java CompilerState.java RMLHandler.java Log Message: Added log4j support. cleaned up the logs Index: RmlCompiler.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/RmlCompiler.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RmlCompiler.java 29 Aug 2004 05:01:39 -0000 1.6 --- RmlCompiler.java 30 Aug 2004 00:56:09 -0000 1.7 *************** *** 20,23 **** --- 20,25 ---- import java.util.*; import java.io.*; + + import org.apache.log4j.Logger; import org.xml.sax.*; import org.xml.sax.helpers.*; *************** *** 30,33 **** --- 32,36 ---- */ public class RmlCompiler { + static Logger logger = Logger.getLogger(RmlCompiler.class.getName()); IDRSRep rep; String xmlsrc; *************** *** 38,42 **** /** Creates new RmlCompiler */ public RmlCompiler( ! PrintWriter log, String rml, String xmlParser, --- 41,45 ---- /** Creates new RmlCompiler */ public RmlCompiler( ! String rml, String xmlParser, *************** *** 55,59 **** MacroToXML trans = new MacroToXML(xmlParser, schemaSrc, isFile, rmlNS); ! log.println("Transformation : "); try { --- 58,62 ---- MacroToXML trans = new MacroToXML(xmlParser, schemaSrc, isFile, rmlNS); ! logger.debug("Transformation : "); try { *************** *** 64,68 **** fail = false; } catch (Exception e) { ! e.printStackTrace(System.out); fail = true; this.xmlsrc = rml; --- 67,71 ---- fail = false; } catch (Exception e) { ! logger.error("Could not compile rml",e); fail = true; this.xmlsrc = rml; *************** *** 70,83 **** this.errLine = trans.getLine(); this.errorWord = trans.getErrWord(); ! log.println(rml); ! log.println("ERROR : " + err); ! log.println("Error Word : " + this.errorWord); ! log.println("Line : " + this.errLine); return; } ! System.out.println("here"); ! log.println(transformOut.getBuffer()); ! log.flush(); --- 73,86 ---- this.errLine = trans.getLine(); this.errorWord = trans.getErrWord(); ! logger.debug(rml); ! logger.error("ERROR : " + err); ! logger.error("Error Word : " + this.errorWord); ! logger.error("Line : " + this.errLine); return; } ! ! logger.debug(transformOut.getBuffer()); ! *************** *** 90,94 **** XMLReader parser = XMLReaderFactory.createXMLReader(xmlParser); RMLHandler rmlHandler = new RMLHandler(comp); ! rmlHandler.setOut(log); rmlHandler.setDocumentLocator(locator); RmlErrorHandler err = new RmlErrorHandler(); --- 93,97 ---- XMLReader parser = XMLReaderFactory.createXMLReader(xmlParser); RMLHandler rmlHandler = new RMLHandler(comp); ! //rmlHandler.setOut(log); rmlHandler.setDocumentLocator(locator); RmlErrorHandler err = new RmlErrorHandler(); *************** *** 100,104 **** parser.parse(in); } catch (Exception e) { ! e.printStackTrace(System.out); String msg = e.toString(); msg = msg.substring(msg.indexOf("###") + 3); --- 103,107 ---- parser.parse(in); } catch (Exception e) { ! logger.error("Could not parse RML",e); String msg = e.toString(); msg = msg.substring(msg.indexOf("###") + 3); *************** *** 107,114 **** this.errorWord = comp.getErrorWord(); ! log.println("ERROR : " + msg /*+ " - Line : " +err.getException().getLineNumber()*/ ); ! log.println("Error Word : " + comp.getErrorWord()); /*if (locator.getLineNumber() != -1 && comp.getErrorWord() != null) { String tmp = transformOut.getBuffer().toString(); --- 110,117 ---- this.errorWord = comp.getErrorWord(); ! logger.error("ERROR : " + msg,e /*+ " - Line : " +err.getException().getLineNumber()*/ ); ! logger.error("Error Word : " + comp.getErrorWord()); /*if (locator.getLineNumber() != -1 && comp.getErrorWord() != null) { String tmp = transformOut.getBuffer().toString(); *************** *** 126,130 **** else {*/ int lineNum = err.getLineNumber() == -1 ? rmlHandler.getLastLineNum() : err.getLineNumber(); ! log.println("Line: " + lineNum) ; this.errLine = lineNum; //} --- 129,133 ---- else {*/ int lineNum = err.getLineNumber() == -1 ? rmlHandler.getLastLineNum() : err.getLineNumber(); ! logger.error("Line: " + lineNum) ; this.errLine = lineNum; //} *************** *** 135,142 **** if (fail) { ! log.println("Compilation Failed"); return; } ! log.flush(); rep = comp.getReport(); --- 138,145 ---- if (fail) { ! logger.error("Compilation Failed"); return; } ! rep = comp.getReport(); Index: CompilerState.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/CompilerState.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CompilerState.java 29 Aug 2004 05:01:39 -0000 1.7 --- CompilerState.java 30 Aug 2004 00:56:09 -0000 1.8 *************** *** 14,17 **** --- 14,20 ---- import java.util.*; + + import org.apache.log4j.Logger; + import net.sourceforge.idrs.core.report.*; import net.sourceforge.idrs.utils.*; *************** *** 26,30 **** */ public class CompilerState { ! java.util.Stack nodes; Line currentLine; --- 29,33 ---- */ public class CompilerState { ! static Logger logger = Logger.getLogger(CompilerState.class.getName()); java.util.Stack nodes; Line currentLine; *************** *** 49,53 **** public void pushLines() throws Exception { lines.push(new Vector()); ! System.out.println("Stack size : " + lines.size()); } --- 52,56 ---- public void pushLines() throws Exception { lines.push(new Vector()); ! logger.debug("Stack size : " + lines.size()); } *************** *** 59,65 **** Enumeration e = vec.elements(); while (e.hasMoreElements()) { ! System.out.println(e.nextElement()); } ! System.out.println("Stack size : " + lines.size()); return vec; } --- 62,68 ---- Enumeration e = vec.elements(); while (e.hasMoreElements()) { ! logger.debug(e.nextElement()); } ! logger.debug("Stack size : " + lines.size()); return vec; } Index: RMLHandler.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/RMLHandler.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RMLHandler.java 29 Aug 2004 05:01:39 -0000 1.8 --- RMLHandler.java 30 Aug 2004 00:56:09 -0000 1.9 *************** *** 14,17 **** --- 14,18 ---- package net.sourceforge.idrs.deploy.compile; + import org.apache.log4j.Logger; import org.xml.sax.*; import org.xml.sax.helpers.*; *************** *** 37,41 **** PrintWriter out; protected int lastLineNum; ! Locator locator; public static String BASE_PACKAGE = "net.sourceforge.idrs.deploy.compile.units"; --- 38,42 ---- PrintWriter out; protected int lastLineNum; ! static Logger logger = Logger.getLogger(RMLHandler.class.getName()); Locator locator; public static String BASE_PACKAGE = "net.sourceforge.idrs.deploy.compile.units"; *************** *** 103,107 **** } catch (Exception e) { ! e.printStackTrace(System.out); } --- 104,108 ---- } catch (Exception e) { ! logger.error("Could not compile rml page",e); } *************** *** 182,186 **** } catch (Exception e) { ! e.printStackTrace(System.out); throw new SAXParseException(e.toString(),this.locator); } --- 183,187 ---- } catch (Exception e) { ! logger.error("Could not seal chunk",e); throw new SAXParseException(e.toString(),this.locator); } |
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:28
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jdbc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/jdbc Modified Files: JDBCPool.java Log Message: Added log4j support. cleaned up the logs Index: JDBCPool.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jdbc/JDBCPool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JDBCPool.java 29 Aug 2004 05:01:41 -0000 1.3 --- JDBCPool.java 30 Aug 2004 00:56:11 -0000 1.4 *************** *** 19,22 **** --- 19,25 ---- import java.util.*; import java.io.*; + + import org.apache.log4j.Logger; + import net.sourceforge.idrs.utils.pool.*; //import JDBCInfo; *************** *** 26,30 **** */ public class JDBCPool extends ObjectPool { ! protected JDBCInfo info; /*removed Marc Boorshtein - 8/31/00 --- 29,33 ---- */ public class JDBCPool extends ObjectPool { ! static org.apache.log4j.Logger logger = Logger.getLogger(JDBCPool.class.getName()); protected JDBCInfo info; /*removed Marc Boorshtein - 8/31/00 *************** *** 69,86 **** protected void logHeader() throws Exception { ! if (this.info == null) { ! System.out.println("No INFO!"); ! } ! if (out == null) ! out = System.out; ! out.println("Starting Poolman, IDRS Version"); ! out.println("dbDriver = " + this.info.getDrivername()); ! out.println("dbServer = " + this.info.getUrl()); ! out.println("dbLogin = " + this.info.getUsername()); ! out.println("log file = " + logPath); ! out.println("minconnections = " + Integer.toString(minn)); ! out.println("maxconnections = " + Integer.toString(limit)); ! out.println("Total refresh intervel = " + Long.toString(daysOpen) + " days"); ! out.println("-----------------------------------------"); } --- 72,85 ---- protected void logHeader() throws Exception { ! ! logger.info("Starting Poolman, IDRS Version"); ! logger.info("dbDriver = " + this.info.getDrivername()); ! logger.info("dbServer = " + this.info.getUrl()); ! logger.info("dbLogin = " + this.info.getUsername()); ! logger.info("log file = " + logPath); ! logger.info("minconnections = " + Integer.toString(minn)); ! logger.info("maxconnections = " + Integer.toString(limit)); ! logger.info("Total refresh intervel = " + Long.toString(daysOpen) + " days"); ! } *************** *** 122,126 **** java.util.Date now = new java.util.Date(System.currentTimeMillis()); ! out.println(now.toString() + " Opening connection " + count + " " + con.toString()); /* OLD CODE Class.forName(info.getDrivername()).newInstance(); --- 121,125 ---- java.util.Date now = new java.util.Date(System.currentTimeMillis()); ! logger.info(now.toString() + " Opening connection " + count + " " + con.toString()); /* OLD CODE Class.forName(info.getDrivername()).newInstance(); *************** *** 138,143 **** } catch (ClassNotFoundException cnfex) { ! out.println("Looks like the driver was not found..."); ! out.println("Be sure it is in your CLASSPATH and listed properly in the properties file."); } catch (SQLException sqlex) { --- 137,142 ---- } catch (ClassNotFoundException cnfex) { ! logger.error("Looks like the driver was not found..."); ! logger.error("Be sure it is in your CLASSPATH and listed properly in the properties file."); } catch (SQLException sqlex) { *************** *** 146,161 **** info.getUrl() + ". Please check your username, password " + "and other connectivity info.");*/ ! out.println(sqlex); } catch(RuntimeException e) { ! out.println(e); //e.printStackTrace(); } catch(Exception e) { ! out.println(e); //e.printStackTrace(); } catch(Throwable t) { ! out.println(t); //t.printStackTrace(); } --- 145,160 ---- info.getUrl() + ". Please check your username, password " + "and other connectivity info.");*/ ! logger.error("Could not load driver",sqlex); } catch(RuntimeException e) { ! logger.error("Could not load driver",e); //e.printStackTrace(); } catch(Exception e) { ! logger.error("Could not load driver",e); //e.printStackTrace(); } catch(Throwable t) { ! logger.error("Could not load driver",t); //t.printStackTrace(); } *************** *** 179,183 **** return ((conn != null) && (! conn.isClosed())); } catch(SQLException e) { ! out.println(e); } return false; --- 178,182 ---- return ((conn != null) && (! conn.isClosed())); } catch(SQLException e) { ! logger.error("Could not validate connection",e); } return false; *************** *** 204,208 **** } catch (Exception e) { ! out.println(e); } } --- 203,207 ---- } catch (Exception e) { ! logger.error("Could not expire connection",e); } } *************** *** 218,224 **** throw new SQLException(sqle.getMessage()); } catch(Exception e) { ! out.print("A non-SQL error occurred when requesting a connection:"); ! out.println(e); ! e.printStackTrace(out); //e.printStackTrace(); } --- 217,222 ---- throw new SQLException(sqle.getMessage()); } catch(Exception e) { ! logger.error("A non-SQL error occurred when requesting a connection:",e); ! //e.printStackTrace(); } *************** *** 320,324 **** expire(pool[index]); pool[index] = null; ! out.println("----->Resetting connection " + index + " ..."); int tmpCount = count; count = index; --- 318,322 ---- expire(pool[index]); pool[index] = null; ! logger.debug("----->Resetting connection " + index + " ..."); int tmpCount = count; count = index; *************** *** 327,331 **** } catch (Exception e) { ! out.println(e); } } --- 325,329 ---- } catch (Exception e) { ! logger.error("Could not reset connection",e); } } |
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:27
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/axis Modified Files: IdrsHandler.java IdrsProvider.java Log Message: Added log4j support. cleaned up the logs Index: IdrsHandler.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/IdrsHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IdrsHandler.java 29 Aug 2004 05:01:40 -0000 1.3 --- IdrsHandler.java 30 Aug 2004 00:56:10 -0000 1.4 *************** *** 16,19 **** --- 16,20 ---- import java.util.HashMap; import java.util.Iterator; + import java.util.Properties; import net.sourceforge.idrs.core.servlet.ConfigInfo; *************** *** 26,29 **** --- 27,32 ---- import org.apache.axis.MessageContext; import org.apache.axis.handlers.BasicHandler; + import org.apache.log4j.Logger; + import org.apache.log4j.PropertyConfigurator; /** *************** *** 34,38 **** */ public class IdrsHandler extends BasicHandler { ! static final String DEFAULT_DB_POOL = "net.sourceforge.idrs.pool.JDBCPool"; static final String DEFAULT_REPORT_POOL = "net.sourceforge.idrs.pool.IDRSRepPool"; --- 37,41 ---- */ public class IdrsHandler extends BasicHandler { ! static Logger logger = Logger.getLogger(IdrsHandler.class.getName()); static final String DEFAULT_DB_POOL = "net.sourceforge.idrs.pool.JDBCPool"; static final String DEFAULT_REPORT_POOL = "net.sourceforge.idrs.pool.IDRSRepPool"; *************** *** 53,60 **** public void invoke(MessageContext ctx) throws AxisFault { if (! ctx.getPastPivot()) { ! System.out.println("inbound : " + this); ctx.setProperty(IDRS_RESOURCES,this.mgr); } else { ! System.out.println("outbound : " + this); } --- 56,63 ---- public void invoke(MessageContext ctx) throws AxisFault { if (! ctx.getPastPivot()) { ! ctx.setProperty(IDRS_RESOURCES,this.mgr); } else { ! } *************** *** 67,70 **** --- 70,81 ---- public void init() { super.init(); + Properties def = new Properties(); + def.put("log4j.logger.net.sourceforge.idrs","INFO, stdout"); + def.put("log4j.appender.stdout","org.apache.log4j.ConsoleAppender"); + def.put("log4j.appender.stdout.layout","org.apache.log4j.PatternLayout"); + def.put("log4j.appender.stdout.layout.ConversionPattern","[%d] %-5p - %c{1}: %m [%t]%n"); + + PropertyConfigurator.configure(def); + // retrieve the configuration and servlet context String location = (String) this.getOption(CONFIG_LOCATION_OPTION); *************** *** 77,94 **** try { config.loadFromConfigPath(location,parseClass); - System.out.println("Completed config! " + config.getVars()); //create the application object this.mgr.app = new Application(config.getVars()); ! //load database pools retrieveDocDBs(); ! //load script contexts buildScriptContexts(); } catch (Exception e) { ! // TODO Auto-generated catch block ! e.printStackTrace(System.out); } --- 88,118 ---- try { config.loadFromConfigPath(location,parseClass); + def = new Properties(); + def.put("log4j.logger.net.sourceforge.idrs",config.getLogLevel() + ", logfile"); + def.put("log4j.appender.logfile","org.apache.log4j.RollingFileAppender"); + def.put("log4j.appender.logfile.File",config.getErrorLog()); + def.put("log4j.appender.logfile.MaxFileSize","1MB"); + def.put("log4j.appender.logfile.MaxBackupIndex","15"); + + def.put("log4j.appender.logfile.layout","org.apache.log4j.PatternLayout"); + def.put("log4j.appender.logfile.layout.ConversionPattern","[%d] %-5p - %c{1}: %m [%t]%n"); + + PropertyConfigurator.configure(def); + + logger.info("Internet Document And Report Server"); + logger.info("Axis Integration\nCopyright (C) 2002-2004 Marc Boorshtein\nThe contents of this file are subject to the Mozilla Public License Version 1.0 (the License);\nyou may not use this file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.mozilla.org/MPL/\n\nSoftware distributed under the License is distributed on an \"AS IS\" basis,\nWITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific\nlanguage governing rights and limitations under the License."); //create the application object this.mgr.app = new Application(config.getVars()); ! logger.info("Created Application Object"); //load database pools retrieveDocDBs(); ! logger.info("Created Connection Pools"); //load script contexts buildScriptContexts(); + logger.info("Created Script Contexts"); } catch (Exception e) { ! logger.error("Could not initiate handler",e); } *************** *** 181,185 **** //tmpDB.returnConnection(con); } catch (Exception e) { ! e.printStackTrace(System.out); } --- 205,209 ---- //tmpDB.returnConnection(con); } catch (Exception e) { ! logger.error("Could not load databases",e); } Index: IdrsProvider.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/axis/IdrsProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IdrsProvider.java 29 Aug 2004 05:01:40 -0000 1.4 --- IdrsProvider.java 30 Aug 2004 00:56:10 -0000 1.5 *************** *** 50,55 **** --- 50,60 ---- import org.apache.axis.transport.http.AxisServlet; import org.apache.axis.transport.http.HTTPConstants; + import org.apache.log4j.Logger; + import org.apache.log4j.PropertyConfigurator; import org.w3c.dom.Document; import org.w3c.dom.Element; + + + import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; *************** *** 63,67 **** */ public class IdrsProvider extends BasicProvider { ! public static final String CONFIG_IDRS_RML_PATH = "rml"; public static final String CONFIG_IDRS_BASE_PACKAGE = "basePackage"; --- 68,72 ---- */ public class IdrsProvider extends BasicProvider { ! static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(IdrsProvider.class.getName()); public static final String CONFIG_IDRS_RML_PATH = "rml"; public static final String CONFIG_IDRS_BASE_PACKAGE = "basePackage"; *************** *** 123,127 **** bodyDoc = bodypart.getAsDocument(); String ns = bodyDoc.getDocumentElement().getNamespaceURI(); ! System.out.println("namespace : " + ns); String packageName = (String) this.nameSpaces.get(ns); JAXBContext jc = JAXBContext.newInstance(packageName); --- 128,132 ---- bodyDoc = bodypart.getAsDocument(); String ns = bodyDoc.getDocumentElement().getNamespaceURI(); ! String packageName = (String) this.nameSpaces.get(ns); JAXBContext jc = JAXBContext.newInstance(packageName); *************** *** 131,135 **** } catch (Exception e) { ! e.printStackTrace(System.out); throw AxisFault.makeFault(e); } --- 136,140 ---- } catch (Exception e) { ! logger.error("could not create report",e); throw AxisFault.makeFault(e); } *************** *** 139,143 **** ! System.out.println("Base Package : " + basePackage); this.report.getHead().init(dbs, 0, --- 144,148 ---- ! this.report.getHead().init(dbs, 0, *************** *** 161,166 **** } catch (Throwable e1) { ! // TODO Auto-generated catch block ! e1.printStackTrace(System.out); } finally { if (script != null) { --- 166,170 ---- } catch (Throwable e1) { ! logger.error("Could not process report",e1); } finally { if (script != null) { *************** *** 179,184 **** ((DbPool) mgr.dbs.get(name)).returnConnection(con); } catch (Exception e3) { ! // TODO Auto-generated catch block ! e3.printStackTrace(System.out); } } --- 183,187 ---- ((DbPool) mgr.dbs.get(name)).returnConnection(con); } catch (Exception e3) { ! logger.error("Could not return connections",e3); } } *************** *** 235,240 **** public void init() { ! System.out.println("in init"); ! System.out.println(); //get needed info --- 238,242 ---- public void init() { ! logger.info("Initializing provider"); //get needed info *************** *** 246,250 **** String webinf = servlet.getServletContext().getRealPath("WEB-INF"); ! System.out.println("webinf directory : " + webinf); } --- 248,252 ---- String webinf = servlet.getServletContext().getRealPath("WEB-INF"); ! logger.info("Completed initialization"); } *************** *** 259,263 **** String webinf = servlet.getServletContext().getRealPath("WEB-INF"); ! System.out.println("webinf directory" + webinf); String rmlTrans = webinf + "/rmlTrans.xml"; --- 261,265 ---- String webinf = servlet.getServletContext().getRealPath("WEB-INF"); ! String rmlTrans = webinf + "/rmlTrans.xml"; *************** *** 267,271 **** rmlSrcPath = servlet.getServletContext().getRealPath(rmlSrcPath); ! System.out.println("rmlSrcPath : " + rmlSrcPath); this.basePackage = (String) ctx.getService().getOption(IdrsProvider.CONFIG_IDRS_BASE_PACKAGE); --- 269,273 ---- rmlSrcPath = servlet.getServletContext().getRealPath(rmlSrcPath); ! this.basePackage = (String) ctx.getService().getOption(IdrsProvider.CONFIG_IDRS_BASE_PACKAGE); *************** *** 295,302 **** this.compilePage(buf.toString(),new PrintWriter(new OutputStreamWriter(System.out)),parseClass,rmlTrans,true,rmlSchema); } catch (Exception e) { ! // TODO Auto-generated catch block ! e.printStackTrace(System.out); } this.doneinit = true; } --- 297,305 ---- this.compilePage(buf.toString(),new PrintWriter(new OutputStreamWriter(System.out)),parseClass,rmlTrans,true,rmlSchema); } catch (Exception e) { ! logger.error("Could not compile page",e); } + + this.doneinit = true; } *************** *** 316,320 **** compiler = new RmlCompiler( ! logger, src, parseClass, --- 319,323 ---- compiler = new RmlCompiler( ! src, parseClass, |
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:27
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/src/net/sourceforge/idrs/deploy/compile/units Modified Files: Rml.java Head.java Body.java Log Message: Added log4j support. cleaned up the logs Index: Rml.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Rml.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Rml.java 29 Aug 2004 05:01:38 -0000 1.4 --- Rml.java 30 Aug 2004 00:56:10 -0000 1.5 *************** *** 45,49 **** public void isHtml(String val, Attributes atts) throws Exception { this.state.getReport().getBody().isHTML(Boolean.valueOf(val).booleanValue()); ! System.out.println("Set HTML"); } --- 45,49 ---- public void isHtml(String val, Attributes atts) throws Exception { this.state.getReport().getBody().isHTML(Boolean.valueOf(val).booleanValue()); ! } Index: Head.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Head.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Head.java 29 Aug 2004 05:01:38 -0000 1.4 --- Head.java 30 Aug 2004 00:56:10 -0000 1.5 *************** *** 17,20 **** --- 17,21 ---- package net.sourceforge.idrs.deploy.compile.units; + import org.apache.log4j.Logger; import org.xml.sax.*; import org.xml.sax.helpers.*; *************** *** 27,31 **** public class Head extends net.sourceforge.idrs.deploy.compile.Compiler { ! /** Creates new Head */ public Head() { --- 28,32 ---- public class Head extends net.sourceforge.idrs.deploy.compile.Compiler { ! static Logger logger = Logger.getLogger(Head.class.getName()); /** Creates new Head */ public Head() { *************** *** 54,62 **** int i; ! if (this.state==null) System.out.println("state null"); IDRSRep rep = this.state.getReport(); ! if (rep == null) System.out.println("Rep Null"); IDRSBody body = rep.getBody(); ! if (body == null) System.out.println("Body Null"); boolean ishtml = body.isHTML(); --- 55,63 ---- int i; ! if (this.state==null) logger.debug("state null"); IDRSRep rep = this.state.getReport(); ! if (rep == null) logger.debug("Rep Null"); IDRSBody body = rep.getBody(); ! if (body == null) logger.debug("Body Null"); boolean ishtml = body.isHTML(); Index: Body.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Body.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Body.java 29 Aug 2004 05:01:38 -0000 1.14 --- Body.java 30 Aug 2004 00:56:10 -0000 1.15 *************** *** 58,62 **** } bodyTag += ">"; ! System.out.println("Body tag : " + bodyTag); line.addChunk(new TextChunk(bodyTag)); state.sealLine(); --- 58,62 ---- } bodyTag += ">"; ! //.out.println("Body tag : " + bodyTag); line.addChunk(new TextChunk(bodyTag)); state.sealLine(); |