idrs-commit Mailing List for Internet Document and Report Server (Page 6)
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...> - 2003-01-08 06:01:40
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units In directory sc8-pr-cvs1:/tmp/cvs-serv32140/dev/src/net/sourceforge/idrs/deploy/compile/units Removed Files: Rml.class Repeat.class Body.class Log Message: Added new validation capabilities, and all idrs object are given access to the idrs script oject without it being passed in as a parameter. Also fixed a security bug and setup for more memory effecient pooling. Finally add a new configuration file to simplify deployments. --- Rml.class DELETED --- --- Repeat.class DELETED --- --- Body.class DELETED --- |
|
From: Marc B. <big...@us...> - 2003-01-08 06:01:39
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core In directory sc8-pr-cvs1:/tmp/cvs-serv32140/dev/src/net/sourceforge/idrs/core Removed Files: IDRSPool.class ScriptPool.class Log Message: Added new validation capabilities, and all idrs object are given access to the idrs script oject without it being passed in as a parameter. Also fixed a security bug and setup for more memory effecient pooling. Finally add a new configuration file to simplify deployments. --- IDRSPool.class DELETED --- --- ScriptPool.class DELETED --- |
|
From: Marc B. <big...@us...> - 2003-01-08 06:01:38
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/embedable In directory sc8-pr-cvs1:/tmp/cvs-serv32140/dev/src/net/sourceforge/idrs/script/embedable Removed Files: IDRSBeanShell.class IDRSJPython.class IDRSScriptLanguage.class IDRSShell.class Log Message: Added new validation capabilities, and all idrs object are given access to the idrs script oject without it being passed in as a parameter. Also fixed a security bug and setup for more memory effecient pooling. Finally add a new configuration file to simplify deployments. --- IDRSBeanShell.class DELETED --- --- IDRSJPython.class DELETED --- --- IDRSScriptLanguage.class DELETED --- --- IDRSShell.class DELETED --- |
|
From: Marc B. <big...@us...> - 2003-01-08 06:01:37
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script In directory sc8-pr-cvs1:/tmp/cvs-serv32140/dev/src/net/sourceforge/idrs/script Removed Files: DBShell.class IdrsDB.class IDRSScript.class Log Message: Added new validation capabilities, and all idrs object are given access to the idrs script oject without it being passed in as a parameter. Also fixed a security bug and setup for more memory effecient pooling. Finally add a new configuration file to simplify deployments. --- DBShell.class DELETED --- --- IdrsDB.class DELETED --- --- IDRSScript.class DELETED --- |
|
From: Marc B. <big...@us...> - 2003-01-08 06:01:22
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/pool In directory sc8-pr-cvs1:/tmp/cvs-serv32140/dev/src/net/sourceforge/idrs/utils/pool Removed Files: PooledObject.class POS.class ObjectPool.class Log Message: Added new validation capabilities, and all idrs object are given access to the idrs script oject without it being passed in as a parameter. Also fixed a security bug and setup for more memory effecient pooling. Finally add a new configuration file to simplify deployments. --- PooledObject.class DELETED --- --- POS.class DELETED --- --- ObjectPool.class DELETED --- |
|
From: Marc B. <big...@us...> - 2003-01-08 06:00:59
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro In directory sc8-pr-cvs1:/tmp/cvs-serv32140/dev/src/net/sourceforge/idrs/deploy/macro Removed Files: MacroToXMLHandler.class MacroToXML.class Log Message: Added new validation capabilities, and all idrs object are given access to the idrs script oject without it being passed in as a parameter. Also fixed a security bug and setup for more memory effecient pooling. Finally add a new configuration file to simplify deployments. --- MacroToXMLHandler.class DELETED --- --- MacroToXML.class DELETED --- |
|
From: Marc B. <big...@us...> - 2002-12-29 04:41:19
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils In directory sc8-pr-cvs1:/tmp/cvs-serv32633 Added Files: DbCache.java Log Message: --- NEW FILE: DbCache.java --- /* * DbCache.java * * Created on March 5, 2002, 7:30 PM */ package net.sourceforge.idrs.utils; import java.util.*; import java.io.*; /** * * @author mlb * @version */ public class DbCache implements Serializable { LinkedList rows; int currentPosition; /** Creates new DbCache */ public DbCache(LinkedList rows) { this.rows = rows; } public LinkedList getRows() { return rows; } public void setRows(LinkedList rows) { this.rows = rows; } public int getPosition() { return this.currentPosition; } public void setPosition(int pos) { this.currentPosition = pos; } } |
|
From: Marc B. <big...@us...> - 2002-12-29 04:39:11
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils
In directory sc8-pr-cvs1:/tmp/cvs-serv32263
Modified Files:
Validators.java
Log Message:
Set CleanUp's superclass to Validators
Index: Validators.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/Validators.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Validators.java 29 Dec 2002 04:01:56 -0000 1.1
--- Validators.java 29 Dec 2002 04:39:08 -0000 1.2
***************
*** 1,3 ****
! package net.sourceforge.idrs.utils.*;
/*
--- 1,3 ----
! package net.sourceforge.idrs.utils;
/*
***************
*** 31,40 ****
}
!
/**
*Must be executed in the reInit() of the subclassed object
*@param idrs The current script context
*/
! public setContext(IDRSScript idrs) {
this.idrs = idrs;
}
--- 31,40 ----
}
!
/**
*Must be executed in the reInit() of the subclassed object
*@param idrs The current script context
*/
! public void setContext(IDRSScript idrs) {
this.idrs = idrs;
}
***************
*** 111,113 ****
return -1;
}
! }
\ No newline at end of file
--- 111,113 ----
return -1;
}
! }
|
|
From: Marc B. <big...@us...> - 2002-12-29 04:02:00
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils
In directory sc8-pr-cvs1:/tmp/cvs-serv25385
Modified Files:
CleanUp.java DB.java
Added Files:
Validators.java
Log Message:
add a validator class
--- NEW FILE: Validators.java ---
package net.sourceforge.idrs.utils.*;
/*
Validators.java
Copyright (C) 2002 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.
*/
import java.sql.*;
import net.sourceforge.idrs.utils.*;
import java.io.*;
import net.sourceforge.idrs.utils.*;
import net.sourceforge.idrs.script.*;
/* Class to store basic form validation */
public class Validators implements Serializable {
protected transient IDRSScript idrs;
public Validators() {
}
/**
*Must be executed in the reInit() of the subclassed object
*@param idrs The current script context
*/
public setContext(IDRSScript idrs) {
this.idrs = idrs;
}
/**
*Function for determining if a value has been given.
*If no value has been given (null or empty) then an error is created.
*@param name The Name of the field
*@param val The value to be tested
*/
protected String requiredVal(String name, String val) {
if (val != null && val.trim().length() != 0) {
return val;
}
else {
idrs.createError("The " + name + " is required");
}
return "";
}
/**
*Function for determining if a value has been given and is an Integer.
*If no value has been given (null or empty), or the value given is not an integer then an error is created.
*@param name The Name of the field
*@param val The value to be tested
*/
protected int requiredValInt(String name, String val) {
try {
if (val != null && val.trim().length() != 0) {
int tmp = Integer.parseInt(val);
if (tmp != 0) {
return tmp;
}
else {
idrs.createError("The " + name + " is required");
}
}
else {
idrs.createError("The " + name + " is required");
}
}
catch (Exception e) {
idrs.createError("The " + name + " " + e.toString());
}
return -1;
}
/**
*Function for determining if a value has been given and is a non zero Integer.
*If no value has been given (null or empty), or the value given is not a non zero integer then an error is created.
*@param name The Name of the field
*@param val The value to be tested
*/
protected int requiredValIntZero(String name, String val) {
try {
if (val != null && val.trim().length() != 0) {
int tmp = Integer.parseInt(val);
return tmp;
}
else {
idrs.createError("The " + name + " is required");
}
}
catch (Exception e) {
idrs.createError("The " + name + " " + e.toString());
}
return -1;
}
}
Index: CleanUp.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/CleanUp.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CleanUp.java 22 Aug 2002 20:06:37 -0000 1.2
--- CleanUp.java 29 Dec 2002 04:01:56 -0000 1.3
***************
*** 4,29 ****
import java.util.*;
! public class CleanUp {
protected transient LinkedList statements;
!
public CleanUp() {
this.statements = new LinkedList();
}
!
public void reset() {
statements.clear();
}
!
public void regStatement(Statement s) throws Exception {
statements.add(s);
}
!
public void cleanUp() throws Exception {
Iterator i = statements.iterator();
while (i.hasNext()) {
! ((Statement) i.next()).close();
}
}
}
--- 4,31 ----
import java.util.*;
! public class CleanUp extends Validators {
protected transient LinkedList statements;
!
public CleanUp() {
this.statements = new LinkedList();
}
!
public void reset() {
statements.clear();
}
!
public void regStatement(Statement s) throws Exception {
statements.add(s);
}
!
public void cleanUp() throws Exception {
Iterator i = statements.iterator();
while (i.hasNext()) {
! ((Statement) i.next()).close();
}
}
+
+
}
Index: DB.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/DB.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** DB.java 13 Oct 2002 15:04:10 -0000 1.12
--- DB.java 29 Dec 2002 04:01:56 -0000 1.13
***************
*** 1,914 ****
! package net.sourceforge.idrs.utils;
! /*
! DB.java
! Copyright (C) 2001 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,
[...1765 lines suppressed...]
! cache.setPosition(this.cursurLocation);
!
! return cache;
! }
!
! public void setCache(DbCache cache) {
! this.cursur = DB.CLIENT;
! this.cache = cache;
! this.cursurLocation = cache.getPosition();
! this.rows = cache.getRows();
! this.beginWith = this.cursurLocation;
! this.wasCached = true;
! }
*/
!
public void setTransactionType(int type) {
! this.transactionType = type;
}
! }
!
|
|
From: Marc B. <big...@us...> - 2002-11-22 07:16:44
|
Update of /cvsroot/idrs/Idrs/dev/xml In directory sc8-pr-cvs1:/tmp/cvs-serv9601 Modified Files: rmlTrans.xml Log Message: added portal and selectInput tags Index: rmlTrans.xml =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/xml/rmlTrans.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** rmlTrans.xml 9 Sep 2002 21:27:44 -0000 1.8 --- rmlTrans.xml 22 Nov 2002 07:16:41 -0000 1.9 *************** *** 38,41 **** --- 38,43 ---- <trans:rml simple="true" ownLine="false" >yesNo</trans:rml> <trans:rml simple="true" ownLine="false" parents="repeat,ifchange,yes,no,body" >formInput</trans:rml> + <trans:rml simple="false" ownLine="false" parents="repeat,ifchange,yes,no,body">portal</trans:rml> + <trans:rml simple="true" ownLine="false" parents="">formSelect</trans:rml> <!-- text tag --> |
|
From: Marc B. <big...@us...> - 2002-11-22 07:16:28
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils
In directory sc8-pr-cvs1:/tmp/cvs-serv9439/net/sourceforge/idrs/utils
Modified Files:
ObjectStore.java
Log Message:
added portal and selectInput tags
Index: ObjectStore.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/ObjectStore.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ObjectStore.java 23 Mar 2002 04:48:28 -0000 1.6
--- ObjectStore.java 22 Nov 2002 07:16:24 -0000 1.7
***************
*** 324,328 ****
if (numArgs == 1) {
argClass = meths[i].getParameterTypes()[0];
! if (name.substring(0,3).equalsIgnoreCase("set") && argClass.equals("".getClass())) {
props.add(meths[i].getName());
}
--- 324,328 ----
if (numArgs == 1) {
argClass = meths[i].getParameterTypes()[0];
! if (name.substring(0,3).equalsIgnoreCase("set") && (argClass.equals("".getClass()) || argClass.equals(String[].class))) {
props.add(meths[i].getName());
}
***************
*** 346,353 ****
StringBuffer buf = new StringBuffer();
String[] args = new String[1];
for (int i=0,m=this.propNames.length;i<m;i++) {
buf.setLength(0);
buf.append(this.id).append('-').append("prop").append('_').append(propNames[i].substring(3));
! args[0] = req.getParameter(buf.toString());
props[i].invoke(this.obj,args);
}
--- 346,363 ----
StringBuffer buf = new StringBuffer();
String[] args = new String[1];
+ String[] vals;
for (int i=0,m=this.propNames.length;i<m;i++) {
buf.setLength(0);
buf.append(this.id).append('-').append("prop").append('_').append(propNames[i].substring(3));
! args[0] = req.getParameter(buf.toString());
!
! /*if (vals == null) {
! args[0] = req.getParameter(buf.toString());
! }
! else {
! args[0] = vals;
! }*/
!
! //args[0] = vals.length==1 ? vals[0] : vals;
props[i].invoke(this.obj,args);
}
|
|
From: Marc B. <big...@us...> - 2002-11-22 07:16:27
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units
In directory sc8-pr-cvs1:/tmp/cvs-serv9439/net/sourceforge/idrs/deploy/compile/units
Modified Files:
Body.java
Added Files:
Body.class Head.java~ Portal.java Repeat.class Rml.class
Log Message:
added portal and selectInput tags
--- NEW FILE: Body.class ---
Êþº¾
Exceptions
echoScript
SourceFile
*+·
M,»
:»
:»
N-»
»
»
¶
:»
»
--- NEW FILE: Head.java~ ---
/*
Head.java
Copyright (C) 2002 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.
*/
/**
*Implements Head tag
*/
package net.sourceforge.idrs.deploy.compile.units;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.*;
import java.util.*;
import net.sourceforge.idrs.core.report.*;
import net.sourceforge.idrs.deploy.compile.Compiler;
import net.sourceforge.idrs.deploy.compile.CompilerState;
public class Head extends net.sourceforge.idrs.deploy.compile.Compiler {
/** Creates new Head */
public Head() {
}
/**
* allows for the execution of any wrap-up code at the hitting of the end tag
*/
public void seal() throws Exception {
if (this.state.getReport().getBody().isHTML()) {
this.state.getReport().getHead().addText("</HEAD>");
}
this.state.getReport().getHead().seal();
}
/**
* allows for a compiler to use the attributes of the calling tag
*/
public void setAttributes(Attributes atts) throws Exception {
String tag;
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();
if (ishtml) {
tag = "<HEAD ";
for (i=0; i < atts.getLength(); i++) {
tag += atts.getLocalName(i) + "=\"" + atts.getValue(i) + "\" ";
}
tag += ">";
this.state.getReport().getHead().addText(tag);
}
}
public void text(java.lang.String val, Attributes atts) throws Exception {
this.state.getReport().getHead().addText(val);
}
}
--- NEW FILE: Portal.java ---
/*
Portal.java
Copyright (C) 2002 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.
*/
/**
*Implements repeat tag
*/
package net.sourceforge.idrs.deploy.compile.units;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.*;
import java.util.*;
import net.sourceforge.idrs.core.report.*;
import net.sourceforge.idrs.deploy.compile.Compiler;
import net.sourceforge.idrs.deploy.compile.CompilerState;
import net.sourceforge.idrs.utils.ObjectStore;
public class Portal extends net.sourceforge.idrs.deploy.compile.units.Body {
String groups;
PortalChunk portal;
/** Creates new portal */
public Portal() {
}
/**
*allows for a compiler to use the attributes of the calling tag
*/
public void setAttributes(Attributes atts) throws Exception {
this.groups = atts.getValue("groups");
portal = new PortalChunk(groups);
}
/**
*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 PortalChunk getPortalLine() {
return this.portal;
}
/**
* 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());
portal.setLines(lines);
state.setLine(portal);
state.sealLine();
}
}
--- NEW FILE: Repeat.class ---
Êþº¾
Exceptions
SourceFile
*»
·
*+·
--- NEW FILE: Rml.class ---
Êþº¾
SourceFile
Index: Body.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Body.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Body.java 16 Sep 2002 15:19:42 -0000 1.6
--- Body.java 22 Nov 2002 07:16:24 -0000 1.7
***************
*** 106,109 ****
--- 106,110 ----
public void text(String val,Attributes atts) throws Exception {
System.out.println("val = \"" + val + "\"");
+ System.out.println("this is : " + this);
/*if (val.indexOf('\n') != -1) {
StringTokenizer tok = new StringTokenizer(val,"\n",false);
***************
*** 157,165 ****
state.getCurrentLine().addChunk(new NavNextChunk(val));
}
!
public void navPrev(String val, Attributes atts) throws Exception {
state.getCurrentLine().addChunk(new NavPrevChunk(val));
}
!
/**
* Handles the formInput tag
--- 158,166 ----
state.getCurrentLine().addChunk(new NavNextChunk(val));
}
!
public void navPrev(String val, Attributes atts) throws Exception {
state.getCurrentLine().addChunk(new NavPrevChunk(val));
}
!
/**
* Handles the formInput tag
***************
*** 169,183 ****
int isrcType,isingle,itype=-1;
boolean paramFirst;
!
paramFirst = atts.getValue("paramFirst") != null ? atts.getValue("paramFirst").equalsIgnoreCase("true") : false;
System.out.println("Param First : " + paramFirst);
!
value = atts.getValue("value");
!
value = value != null ? value : "";
!
name = atts.getValue("name");
type = atts.getValue("type");
!
itype = type.equalsIgnoreCase("hidden") ? InputChunk.INPUT_HIDDEN : itype;
itype = type.equalsIgnoreCase("text") ? InputChunk.INPUT_TEXT : itype;
--- 170,184 ----
int isrcType,isingle,itype=-1;
boolean paramFirst;
!
paramFirst = atts.getValue("paramFirst") != null ? atts.getValue("paramFirst").equalsIgnoreCase("true") : false;
System.out.println("Param First : " + paramFirst);
!
value = atts.getValue("value");
!
value = value != null ? value : "";
!
name = atts.getValue("name");
type = atts.getValue("type");
!
itype = type.equalsIgnoreCase("hidden") ? InputChunk.INPUT_HIDDEN : itype;
itype = type.equalsIgnoreCase("text") ? InputChunk.INPUT_TEXT : itype;
***************
*** 186,201 ****
itype = type.equalsIgnoreCase("radio") ? InputChunk.INPUT_RADIO : itype;
itype = type.equalsIgnoreCase("textarea") ? InputChunk.INPUT_TEXTAREA : itype;
!
!
attribs = atts.getValue("atts");
attribs = (attribs != null) ? attribs : "";
!
srcType = atts.getValue("srcType");
if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
else isrcType = YesNo.SRC_PROP;
!
state.getCurrentLine().addChunk(new InputChunk(name,itype,isrcType,val,value,attribs,paramFirst));
!
}
--- 187,240 ----
itype = type.equalsIgnoreCase("radio") ? InputChunk.INPUT_RADIO : itype;
itype = type.equalsIgnoreCase("textarea") ? InputChunk.INPUT_TEXTAREA : itype;
!
!
attribs = atts.getValue("atts");
attribs = (attribs != null) ? attribs : "";
!
srcType = atts.getValue("srcType");
if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
else isrcType = YesNo.SRC_PROP;
!
state.getCurrentLine().addChunk(new InputChunk(name,itype,isrcType,val,value,attribs,paramFirst));
!
! }
!
! /**
! * Handles the formInput tag
! */
! public void fromSelect(String val, Attributes atts) throws Exception {
! String name,srcType,type, attribs,value,srcDB,lstId,lstVal;
! int isrcType,isingle,itype=-1;
! boolean paramFirst;
!
! paramFirst = atts.getValue("paramFirst") != null ? atts.getValue("paramFirst").equalsIgnoreCase("true") : false;
! //System.out.println("Param First : " + paramFirst);
!
! value = atts.getValue("value");
!
! value = value != null ? value : "";
!
! name = atts.getValue("name");
! type = atts.getValue("type");
!
!
!
! attribs = atts.getValue("atts");
! attribs = (attribs != null) ? attribs : "";
!
! srcType = atts.getValue("srcType");
! if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
! else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
! else isrcType = YesNo.SRC_PROP;
!
! srcDB = atts.getValue("srcDB");
! lstId = atts.getValue("srcID");
! lstVal = atts.getValue("srcVal");
!
!
!
! state.getCurrentLine().addChunk(new SelectChunk(name,itype,isrcType,val,value,attribs,paramFirst,srcDB,lstId,lstVal));
!
}
|
|
From: Marc B. <big...@us...> - 2002-11-22 07:16:27
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/test
In directory sc8-pr-cvs1:/tmp/cvs-serv9439/net/sourceforge/idrs/test
Modified Files:
IDRSTester.java
Log Message:
added portal and selectInput tags
Index: IDRSTester.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/test/IDRSTester.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IDRSTester.java 13 Oct 2002 15:04:59 -0000 1.1
--- IDRSTester.java 22 Nov 2002 07:16:24 -0000 1.2
***************
*** 55,59 ****
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,true,rmlNS);
rep = compiler.getReport();
--- 55,59 ----
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();
|
|
From: Marc B. <big...@us...> - 2002-11-22 07:16:27
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report In directory sc8-pr-cvs1:/tmp/cvs-serv9439/net/sourceforge/idrs/core/report Modified Files: Line.java TextChunk.java Added Files: IDRSHead.java~ PortalChunk.java SelectChunk.java Log Message: added portal and selectInput tags --- NEW FILE: IDRSHead.java~ --- package net.sourceforge.idrs.core.report; import net.sourceforge.idrs.jdbc.*; import net.sourceforge.idrs.utils.*; import net.sourceforge.idrs.script.embedable.*; import net.sourceforge.idrs.script.*; import net.sourceforge.idrs.core.servlet.MultiPartRequest; import java.util.*; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.security.*; public final class IDRSHead implements Serializable, IDRSScript { protected String header; protected String text; protected HashMap dbs; protected HashMap objects; protected String scriptClass; protected HashMap vars; protected HashMap varNames; protected HashMap pos; protected String[] objNames, dbNames; protected transient boolean send = true; static final long serialVersionUID = -4520281654183459125L; transient static final String ERR_NAME = "doc_ERROR"; protected transient HttpSession session; protected transient HttpServletRequest request; protected transient HttpServletResponse response; // protected transient PrintWriter out; protected transient Application app; protected transient HashMap conns; protected transient int userNum; protected transient int docId; protected transient String url; protected transient IDRSScriptLanguage idrs; protected transient IDRSShell me; protected transient HashMap lists; protected transient IDRSPrinter out; protected transient UserInfo userInfo; //recording the names in order is a nessassary step protected transient LinkedList objlNames; protected transient LinkedList dblNames; protected transient HashMap connsInfo; protected transient String digest; /* public void preBuild(HashMap connsInfo) throws Exception { this.connsInfo = connsInfo; Enumeration keys = connsInfo.keys(); String key; conns = new HashMap(); //first get all connections while (keys.hasMoreElements()) { key = (String) keys.nextElement(); conns.put(key,((JDBCInfo) connsInfo.get(key)).build()); } //now put them into the DB's keys = dbs.elements(); DB db; while (keys.hasMoreElements()) { db = (DB) keys.nextElement(); db.setConnection(((Connection) conns.get(db.getDBName()))); } buildScriptContext(); }*/ public Connection getConn(String name) { return (Connection) conns.get(name); } public String getText(IDRSBody body) { String output = text; if (body.isHTML()) { output = header + "</HEAD>\n"; return output; } else { return ""; } } public void addText(String txt) { addText(txt,false); } public void addText(String txt,boolean isHtml) { //System.out.println("TEXTB : " + header); // System.out.println("HEAD : " + txt + ", " + isHtml); if (txt.indexOf("<head") != -1) { if (isHtml) { header = txt; //System.out.println("Is HTML"); } } else if (txt != null && txt.length() != 0) { header += txt; } //System.out.println("TEXTA : " + header); } public IDRSHead() { dbs = new HashMap(); objects = new HashMap(); text = ""; header = ""; vars = new HashMap(); lists = new HashMap(); objlNames=new LinkedList(); dblNames=new LinkedList(); objNames=new String[0]; dbNames=new String[0]; } /** * Used by various chunks */ public int getUserNum() { return userNum; } public int getDocID() { return docId; } public String getURL() { return url; } /** * used to initialize a header object */ public void init(HashMap conns, int userNum, int docID, String url, HttpSession session, HttpServletRequest request,HttpServletResponse response, Application app, IDRSScriptLanguage context,UserInfo userInfo,String digest) throws Exception { this.digest = digest; this.userInfo=userInfo; this.idrs = context; if (conns != null) this.conns = conns; this.userNum = userNum; this.docId = docID; this.url = url; this.session = session; this.request = request; this.response = response; this.app = app; //this.vars = vars; //this.varNames = varNames; //if ((idrs != null) && (scriptClass != null) && (! scriptClass.equals(""))) buildScriptContext(); //build all objects Iterator keys = objects.keySet().iterator(); ObjectStore obj; Object[] vals; String val; String[] varVals; int i; int l,m; Class[] varTypes; //while (keys.hasNext()) { for (l=0,m=objNames.length;l<m;l++){ //obj = (ObjectStore) objects.get((String) keys.next()); obj = (ObjectStore) objects.get(objNames[l]); varTypes = obj.getTypes(); vals = new Object[varTypes.length]; varVals = (String[]) vars.get(obj.getID()); for (i=0;i<varVals.length;i++) { val = varVals[i]; if (val != null) { if (val.equalsIgnoreCase("UserID")) { vals[i] = new Integer(userNum); } if (val.equalsIgnoreCase("Scripter")) { vals[i] = (IDRSScript) this; } else { vals[i] = ObjectStore.getValue((Class) varTypes[i],val,null,(IDRSScript) this); } } } obj.rebuild(vals); if (obj.setProps()) obj.setProps(request); } //initialize all databases //System.out.println("HERE ARE THE DB's"); keys = dbs.keySet().iterator(); // while (keys.hasNext()) { // System.out.println("DB ID : " + keys.next()); // } keys = dbs.keySet().iterator(); Connection con; int place; DB db; String key; //while (keys.hasNext()) { for (l=0,m=dbNames.length;l<m;l++) { //retrieve a connection //key = (String) keys.next(); key = dbNames[l]; System.out.println("KEY : " + key); db = (DB) dbs.get(key); if (conns != null) { con = (Connection) conns.get(db.getDBName()); if (con != null) { db.setConnection(con); } } //initialize the db...vars are added in the servlet //System.out.println("DB ID: " + db.getID()); varVals = (String[]) vars.get(db.getID()); if (varVals != null) { for (i=0;i<varVals.length;i++) { if (varVals[i].equalsIgnoreCase("UserID")) { varVals[i] = Integer.toString(userNum); } } } db.buildDB(varVals,this); } } public void addVarList(String name, Integer size) { lists.put(name,size); } /** * Used by NavTags */ public HashMap getVarNames() { return varNames; } /** * Used by ObjectChunk */ public ObjectStore getObjectStore(String objName) throws Exception { ObjectStore obj = (ObjectStore) objects.get(objName); if (objName == null) throw new Exception(objName + " not a valid object"); return obj; } /** * Used by EvalLongScript, EvalScript */ public IDRSScriptLanguage getScriptContext() { return idrs; } /** * Used by FieldChunck,IfChangeChunck */ public DB getDB(String ID) throws Exception { DB db = (DB) dbs.get(ID); if (db == null) { throw new Exception("DB " + ID + " does not exist"); } return db; } /** * used by NavNext and NavPrev */ public HashMap getAllDBs() { return dbs; } /** * used by NavNext and NavPrev */ public HashMap getAllVars() { return vars; } public void addDB(DB db) throws Exception { dblNames.add(db.getID()); dbs.put(db.getID(),db); } /** * used by ObjectChunck */ public Vector getVarList(String ID) throws Exception { Vector list = (Vector) vars.get(ID); if (list == null) { throw new Exception("Var List " + ID + " does not exist"); } return list; } public void addObject(ObjectStore obj) { objlNames.add(obj.getID()); objects.put(obj.getID(),obj); } /*********************************************************** * This section is the implementation of the IDRSScript object ************************************************************/ /** Used to retrieve a piece of data from a particuler DB with a given format */ public String getFieldData(String db,String field,String format) throws Exception { try { DB Db = (DB) dbs.get(db); if (Db == null) throw new Exception("DB " + db + " not found"); return Db.getFieldData(field.toLowerCase(),format); } catch (Exception e) { throw e; } } /** * Used to retrieve a piece of data from a particuler DB without format */ public String getFieldData(String db,String field) throws Exception { return getFieldData(db,field,null); } /** * Used to move to the next record in a selected db */ public boolean next(String db) throws Exception { DB Db = (DB) dbs.get(db); if (Db == null) throw new Exception("DB " + db + " no found"); return Db.next(); } /** * Used to move to a particuler record */ public boolean moveTo(String db, int record) throws Exception { DB Db = (DB) dbs.get(db); if (Db == null) throw new Exception("DB " + db + " no found"); return Db.moveTo(record); } /** * Used to retrieve a refrence to an object created in an IDRS report */ public Object getObject(String obj) throws Exception { try { ObjectStore objstr = (ObjectStore) objects.get(obj); if (objstr == null) throw new Exception("No Object defined : " + obj); return objstr.getRef(); } catch (Exception e) { throw new Exception("No Object defined : " + obj); } } /** * retrieves printwriter used by the IDRS */ public IDRSPrinter getOut() throws Exception { return out; } /** * Retrieves the session object from webserver */ public HttpSession getSession() throws Exception { return session; } /** * Retrieves request object from webserver */ public HttpServletRequest getRequest() throws Exception { return request; } public HttpServletResponse getResponse() throws Exception { return response; } /** *Retrieves the MultiPartRequest if it exists */ public MultiPartRequest getMultiPartRequest() throws Exception { if (request instanceof MultiPartRequest) { return (MultiPartRequest) request; } else { return null; } } /** * Used to retrieve the results of an update */ public int getInputResults(String db) throws Exception { try { DB Db = (DB) dbs.get(db); if (Db == null) throw new Exception("DB " + db + " no found"); return Db.getUpdateResult(); } catch (Exception e) { throw e; } } public Application getApplication() throws Exception { return this.app; } public void setScriptClass(String scriptClass) { this.scriptClass = scriptClass; } protected void buildScriptContext() throws Exception { if (idrs == null) { try { idrs = (IDRSScriptLanguage) Class.forName(scriptClass).newInstance(); } catch (Exception e1) { throw new Exception(e1.toString() + " : Can't create script object"); } } this.me = new IDRSShell(this); idrs.setVal("idrs",me); if (this.session != null) { idrs.importClass("javax.servlet.http.*"); idrs.importClass("javax.servlet.*"); } idrs.importClass("net.sourceforge.idrs.script.IDRSScript"); idrs.importClass("net.sourceforge.idrs.script.embedable.IDRSShell"); //idrs.importClass("net.sourceforge.idrs.core.IDRSReport"); idrs.importClass("net.sourceforge.idrs.utils.Application"); idrs.importClass("java.io.PrintWriter"); this.out = new IDRSPrinter(); idrs.setVal("out",this.out); idrs.setVal("app",this.app); idrs.setVal("session",this.getSession()); idrs.setVal("request", this.getRequest()); } public void add(String key, String name, String val) { // System.out.println("key : " + key + ", Name:" + name + ", val:" + val); Int i = (Int) pos.get(key); /* if (vars.get(key) == null) { //System.out.println("vars.get(key) is null"); //System.out.println("HERE ARE THE VAR's"); Iterator keys = vars.keySet().iterator(); //while (keys.hasNext()) { // System.out.println("Var ID : " + keys.next()); //} }*/ //System.out.println("i.v:" + i.v); // System.out.println("((Object[]) vars.get(key)).length:" + ((Object[]) vars.get(key)).length); ((Object[]) vars.get(key))[i.v] = val; ((Object[]) varNames.get(key))[i.v] = name; i.v++; } public void seal() throws Exception { pos = new HashMap(); vars = new HashMap(); varNames = new HashMap(); Iterator keys = dbs.keySet().iterator(); String key; DB db; int size; while (keys.hasNext()) { db = (DB) dbs.get((String) keys.next()); size = db.seal(); varNames.put(db.getID(),new String[size]); vars.put(db.getID(),new String[size]); pos.put(db.getID(),new Int()); } ObjectStore obj; keys = objects.keySet().iterator(); while (keys.hasNext()) { key = (String) keys.next(); //System.out.println("Object Key : " + key); obj = (ObjectStore) objects.get(key); size = obj.seal(); //System.out.println("Size : " + size); varNames.put(obj.getID(),new String[size]); vars.put(obj.getID(),new String[size]); pos.put(obj.getID(),new Int()); } Integer sz; keys = lists.keySet().iterator(); while (keys.hasNext()) { key = (String) keys.next(); sz = (Integer) lists.get(key); size = sz.intValue(); varNames.put(key,new String[size]); vars.put(key,new String[size]); pos.put(key,new Int()); } // Re-DO THis when I have it working (SUNDAY) //Now we will load the names into their respective arrays //dbs int i,m; dbNames = new String[dblNames.size()]; for (i=0,m=dblNames.size();i<m;i++) { dbNames[i] = (String) dblNames.get(i); } objNames = new String[objlNames.size()]; for (i=0,m=objlNames.size();i<m;i++) { objNames[i] = (String) objlNames.get(i); } } public void reset() { Iterator e = pos.values().iterator(); while (e.hasNext()) { ((Int) e.next()).v=0; } } public Object clone() { Object deepCopy = null; try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject(this); ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); ObjectInputStream ois = new ObjectInputStream(bais); deepCopy = ois.readObject(); } catch (Exception e) { try { e.printStackTrace(System.out); } catch (Exception ee) {} } return deepCopy; } public void setPrintTarget(StringBuffer s) throws Exception { if (out == null) this.out = new IDRSPrinter(); out.setTarget(s); out.print(header); } public void setSendToClient(boolean send) throws Exception { this.send=send; } public boolean getSendToClient() throws Exception { return this.send; } public UserInfo getUserInfo() throws Exception { return this.userInfo; } public void close() throws Exception { DB db; for (int i=0,m=dbNames.length;i<m;i++) { db = (DB) dbs.get(dbNames[i]); db.close(); } } /** *Tells the type of digest *@param plain Plain Text String */ public String getDigest(String plain) throws Exception { if (! this.digest.equalsIgnoreCase("none")) { MessageDigest md = MessageDigest.getInstance(this.digest); md.update(plain.getBytes()); byte[] digest = md.digest(); return new String(digest); } else { return plain; } } /** *Creates an error in the request *@param err as string */ public void createError(String err) { request.setAttribute(ERR_NAME,err); } /** *Determines if there is an error *@return true if there is an error */ public boolean isError() { return request.getAttribute(ERR_NAME) != null; } /** *Retrieves the error */ public String getError() { return (String) request.getAttribute(ERR_NAME); } } class Int implements Serializable { int v; } --- NEW FILE: PortalChunk.java --- /* PortalChunk.java Copyright (C) 2001 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.*; import net.sourceforge.idrs.utils.*; import net.sourceforge.idrs.core.report.*; /** This interface is the basis for all pieces of data stored inside of a compiled report */ public class PortalChunk extends Line implements Chunk, Serializable { int[] groups; Line[] lines; boolean sealed; transient LinkedList llines; public PortalChunk(String groups) { StringTokenizer tok = new StringTokenizer(groups,","); this.groups = new int[tok.countTokens()]; int i = 0; sealed = false; while (tok.hasMoreTokens()) { this.groups[i++] = Integer.parseInt(tok.nextToken()); } llines = new LinkedList(); } public String toString(IDRSHead head,StringBuffer buff) throws Exception { UserInfo user = head.getUserInfo(); boolean ok = false; for (int i=0,m=groups.length;i<m;i++) { if (user.inGroup(groups[i])) { ok = true; break; } } if (ok) { for (int i=0,m=lines.length;i<m;i++) { lines[i].toString(head,buff); } //buff.append(super.toString(head)); } return ""; } public void setLines(Vector lines) { for (int i=0,m=lines.size();i<m;i++) { llines.add(lines.get(i)); } } public void seal() { Chunk[] c; if (! sealed) { lines = new Line[llines.size()]; for (int i=0,m=llines.size();i<m;i++) { lines[i] = (Line) llines.get(i); lines[i].seal(); if (lines[i] != null) lines[i].seal(); } sealed = true; } } public String toString(IDRSHead head) throws Exception { return ""; } } --- NEW FILE: SelectChunk.java --- /* SelectChunk.java Copyright (C) 2002 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.*; import java.lang.reflect.*; import net.sourceforge.idrs.script.embedable.*; import net.sourceforge.idrs.script.*; /** *Base class for gengeration of html select tags */ public class SelectChunk extends GenTag implements Serializable,Chunk { protected String srcDB; protected String lstId; protected String lstVal; protected int type; public SelectChunk(String name, int type, int srcType, String src, String value, String atts,boolean paramFirst, String listSrc, String lstId, String lstVal) { super(name,srcType,src,atts, paramFirst); this.srcDB = listSrc; this.lstId = lstId; this.lstVal = lstVal; } /** *generate the select statement */ public String toString(IDRSHead idrs) throws Exception { LinkedList list = getList(idrs); HashMap row; String nm, val,lookfor; nm = nameIsScript ? idrs.getScriptContext().eval(name) : name; StringBuffer buff = new StringBuffer(); buff.append("<SELECT name=\"").append(this.name).append("\">\n"); lookfor=getValue(idrs,nm); Iterator it = list.iterator(); while (it.hasNext()) { row = (HashMap) it.next(); val = (String) row.get(lstId); buff.append("<OPTION VALUE=\"").append(val).append("\"").append(val.equals(lookfor) ? "SELECTED" : "").append(">").append(row.get(lstVal)).append("</option>\n"); } buff.append("</SELECT>"); return buff.toString(); } /** *Retrieves the source for the select statement */ protected LinkedList getList(IDRSHead idrs) throws Exception { HashMap row; LinkedList table = (LinkedList) idrs.getRequest().getAttribute("SELECT_" + name); if (table == null) { table = new LinkedList(); while (idrs.next(srcDB)) { row = new HashMap(); row.put(lstId,idrs.getFieldData(srcDB,lstId)); row.put(lstVal,idrs.getFieldData(srcDB,lstVal)); table.add(row); } idrs.getRequest().setAttribute("SELECT_" + name,table); } return table; } } Index: Line.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/Line.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Line.java 4 Mar 2002 23:05:34 -0000 1.4 --- Line.java 22 Nov 2002 07:16:24 -0000 1.5 *************** *** 24,39 **** protected transient Vector vchunks; //this array holds all of the chuncks for a given line protected Chunk[] chunks; static final long serialVersionUID = 786019973821495030L; ! ! /** Initializes a Line */ ! public Line() { //this contructor initializes the size of the line this.vchunks = new Vector(); ! ! } ! /** Adds a Chunk to the Line --- 24,40 ---- protected transient Vector vchunks; //this array holds all of the chuncks for a given line protected Chunk[] chunks; + protected transient boolean sealed; static final long serialVersionUID = 786019973821495030L; ! ! /** Initializes a Line */ ! public Line() { //this contructor initializes the size of the line this.vchunks = new Vector(); ! sealed = false; ! } ! /** Adds a Chunk to the Line *************** *** 41,47 **** */ public void addChunk(Chunk chunk) { ! vchunks.add(chunk); } ! /** Retrieves the information about the all of the Chunks stored in the Line --- 42,48 ---- */ public void addChunk(Chunk chunk) { ! vchunks.add(chunk); } ! /** Retrieves the information about the all of the Chunks stored in the Line *************** *** 52,64 **** //StringBuffer vals = new StringBuffer(""); Chunk ch; ! for (int i=0; i<chunks.length;i++) { ch = chunks[i]; buffer.append(ch.toString(head)); } ! //return (vals.toString()); return null; } ! /** Public method to retrieve the information about the all of the Chunks stored in the Line --- 53,66 ---- //StringBuffer vals = new StringBuffer(""); Chunk ch; ! System.out.println("Number of chunks : " + chunks.length); ! for (int i=0; i<chunks.length;i++) { ch = chunks[i]; buffer.append(ch.toString(head)); } ! //return (vals.toString()); return null; } ! /** Public method to retrieve the information about the all of the Chunks stored in the Line *************** *** 74,78 **** } } ! /** Concatinates current line with passed in line --- 76,80 ---- } } ! /** Concatinates current line with passed in line *************** *** 84,105 **** this.vchunks.addElement(e.nextElement()); } ! return this; } ! /** "Seals" the report head into static data structures from dynamic ones */ public void seal() { ! chunks = new Chunk[vchunks.size()]; ! int i=0; for (i=0;i<vchunks.size();i++) { chunks[i] = (Chunk) vchunks.get(i); } vchunks.removeAllElements(); ! ! } } --- 86,109 ---- this.vchunks.addElement(e.nextElement()); } ! return this; } ! /** "Seals" the report head into static data structures from dynamic ones */ public void seal() { ! if (sealed) return; ! //System.out.println("In Line seal"); chunks = new Chunk[vchunks.size()]; ! sealed = true; int i=0; for (i=0;i<vchunks.size();i++) { chunks[i] = (Chunk) vchunks.get(i); + //System.out.println("chunk : " + chunks[i]); } vchunks.removeAllElements(); ! ! } } Index: TextChunk.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/TextChunk.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TextChunk.java 15 Sep 2001 17:33:28 -0000 1.3 --- TextChunk.java 22 Nov 2002 07:16:24 -0000 1.4 *************** *** 28,31 **** --- 28,32 ---- */ public TextChunk(String text) { + this.text = text; } *************** *** 37,40 **** --- 38,46 ---- */ public String toString(IDRSHead head) throws Exception { + + return this.text; + } + + public String getText() { return this.text; } |
|
From: Marc B. <big...@us...> - 2002-10-13 15:05:02
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/test In directory usw-pr-cvs1:/tmp/cvs-serv2348/net/sourceforge/idrs/test Added Files: IDRSTester.java TestRequest.java TestResponse.java TestSession.java Log Message: added unit testing capabilities --- NEW FILE: IDRSTester.java --- package net.sourceforge.idrs.test; import java.io.*; import java.util.*; import net.sourceforge.idrs.utils.*; import net.sourceforge.idrs.deploy.compile.*; import net.sourceforge.idrs.core.report.*; import net.sourceforge.idrs.script.embedable.*; import net.sourceforge.idrs.script.*; import java.sql.*; import javax.servlet.http.*; import javax.servlet.*; public class IDRSTester { TestSession session; TestRequest request; TestResponse response; Application app; String xmlParser, schemaSrc, rmlNS; IDRSRep rep; String compilerLog; HashMap conns; UserInfo user; String docName; int docID; IDRSScriptLanguage script; String digest; public IDRSTester(String xmlParser, String schemaSrc, String rmlNS,String scriptClass,String digest) throws Exception { this.xmlParser = xmlParser; this.schemaSrc = schemaSrc; this.rmlNS = rmlNS; session = new TestSession(); request = new TestRequest(); response = new TestResponse(); app = new Application(); conns = new HashMap(); script = (IDRSScriptLanguage) Class.forName(scriptClass).newInstance(); this.digest = digest; } 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,true,rmlNS); rep = compiler.getReport(); compilerLog = out.getBuffer().toString(); this.docName = docName; this.docID = docID; return compilerLog; } public Application getApplication() { return app; } public TestSession getSession() { return session; } public TestRequest getRequest() { return request; } public TestResponse getResponse() { return response; } public void addCon(String name, Connection con) { conns.put(name,con); } public void createUserInfo(int id, String user, String groups) { this.user = new UserInfo(groups,id,user); } public void executeHead() throws Exception { rep.getHead().init(conns,user.getUserID(),docID,request.getRequestURL().toString(),(HttpSession) session,(HttpServletRequest) request,(HttpServletResponse) response,app,script,user,digest); } public String executeBody() { return rep.buildReport(); } public IDRSScript getScripter() { return rep.getHead(); } public IDRSHead getHead() { return rep.getHead(); } } --- NEW FILE: TestRequest.java --- /* * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package net.sourceforge.idrs.test; import java.io.IOException; import java.util.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; /** * Wrapper around a <code>javax.servlet.http.HttpServletRequest</code> * that transforms an application request object (which might be the original * one passed to a servlet, or might be based on the 2.3 * <code>javax.servlet.http.HttpServletRequestWrapper</code> class) * back into an internal <code>org.apache.catalina.HttpRequest</code>. * <p> * <strong>WARNING</strong>: Due to Java's lack of support for multiple * inheritance, all of the logic in <code>ApplicationRequest</code> is * duplicated in <code>ApplicationHttpRequest</code>. Make sure that you * keep these two classes in synchronization when making changes! * * @author Craig R. McClanahan * @version $Revision: 1.1 $ $Date: 2002/10/13 15:04:59 $ */ public final class TestRequest implements HttpServletRequest { // ------------------------------------------------------- Static Variables // ----------------------------------------------------------- Constructors public TestRequest() { //super(null); } /** * Construct a new wrapped request around the specified servlet request. * * @param request The servlet request being wrapped */ public TestRequest(HttpServletRequest request) { //super(null); //super(request); //setRequest(request); } // ----------------------------------------------------- Instance Variables /** * The request attributes for this request. This is initialized from the * wrapped request, but updates are allowed. */ protected HashMap attributes = new HashMap(); /** * The context path for this request. */ protected String contextPath = null; /** * Descriptive information about this implementation. */ protected static final String info = "org.apache.catalina.core.ApplicationHttpRequest/1.0"; /** * The request parameters for this request. This is initialized from the * wrapped request, but updates are allowed. */ protected Map parameters = new HashMap(); /** * The path information for this request. */ protected String pathInfo = null; /** * The query string for this request. */ protected String queryString = null; /** * The request URI for this request. */ protected String requestURI = null; /** * The servlet path for this request. */ protected String servletPath = null; // ------------------------------------------------- ServletRequest Methods public void setParameter(String name,String value) throws Exception { parameters.put(name,value); } /** * Override the <code>getAttribute()</code> method of the wrapped request. * * @param name Name of the attribute to retrieve */ public Object getAttribute(String name) { return attributes.get(name); } /** * Override the <code>getAttributeNames()</code> method of the wrapped * request. */ public Enumeration getAttributeNames() { return null; // return ((java.util.Enumeration) new Enumeration(attributes.keySet())); } /** * Override the <code>removeAttribute()</code> method of the * wrapped request. * * @param name Name of the attribute to remove */ public void removeAttribute(String name) { attributes.remove(name); } /** * Override the <code>setAttribute()</code> method of the * wrapped request. * * @param name Name of the attribute to set * @param value Value of the attribute to set */ public void setAttribute(String name, Object value) { attributes.put(name, value); } // --------------------------------------------- HttpServletRequest Methods /** * Override the <code>getContextPath()</code> method of the wrapped * request. */ public String getContextPath() { return (this.contextPath); } /** * Override the <code>getParameter()</code> method of the wrapped request. * * @param name Name of the requested parameter */ public String getParameter(String name) { Object value = parameters.get(name); if (value == null) return (null); else if (value instanceof String[]) return (((String[]) value)[0]); else if (value instanceof String) return ((String) value); else return (value.toString()); } /** * Override the <code>getParameterMap()</code> method of the * wrapped request. */ public Map getParameterMap() { return (parameters); } /** * Override the <code>getParameterNames()</code> method of the * wrapped request. */ public Enumeration getParameterNames() { return null; //return (new Enumerator(parameters.keySet())); } /** * Override the <code>getParameterValues()</code> method of the * wrapped request. * * @param name Name of the requested parameter */ public String[] getParameterValues(String name) { Object value = parameters.get(name); if (value == null) return ((String[]) null); else if (value instanceof String[]) return ((String[]) value); else if (value instanceof String) { String values[] = new String[1]; values[0] = (String) value; return (values); } else { String values[] = new String[1]; values[0] = value.toString(); return (values); } } /** * Override the <code>getPathInfo()</code> method of the wrapped request. */ public String getPathInfo() { return (this.pathInfo); } /** * Override the <code>getQueryString()</code> method of the wrapped * request. */ public String getQueryString() { return (this.queryString); } /** * Override the <code>getRequestURI()</code> method of the wrapped * request. */ public String getRequestURI() { return (this.requestURI); } /** * Override the <code>getServletPath()</code> method of the wrapped * request. */ public String getServletPath() { return (this.servletPath); } // -------------------------------------------------------- Package Methods /** * Return descriptive information about this implementation. */ public String getInfo() { return (this.info); } /** * Perform a shallow copy of the specified Map, and return the result. * * @param orig Origin Map to be copied */ Map copyMap(Map orig) { if (orig == null) return (new HashMap()); HashMap dest = new HashMap(); Iterator keys = orig.keySet().iterator(); while (keys.hasNext()) { String key = (String) keys.next(); dest.put(key, orig.get(key)); } return (dest); } /** * Merge the parameters from the specified query string (if any), and * the parameters already present on this request (if any), such that * the parameter values from the query string show up first if there are * duplicate parameter names. * * @param queryString The query string containing parameters to be merged */ void mergeParameters(String queryString) { //not needed } /** * Set the context path for this request. * * @param contextPath The new context path */ void setContextPath(String contextPath) { this.contextPath = contextPath; } /** * Set the path information for this request. * * @param pathInfo The new path info */ void setPathInfo(String pathInfo) { this.pathInfo = pathInfo; } /** * Set the query string for this request. * * @param queryString The new query string */ void setQueryString(String queryString) { this.queryString = queryString; } /** * Set the request that we are wrapping. * * @param request The new wrapped request */ void setRequest(HttpServletRequest request) { //not needed } /** * Set the request URI for this request. * * @param requestURI The new request URI */ void setRequestURI(String requestURI) { this.requestURI = requestURI; } /** * Set the servlet path for this request. * * @param servletPath The new servlet path */ void setServletPath(String servletPath) { this.servletPath = servletPath; } // ------------------------------------------------------ Protected Methods /** * Merge the two sets of parameter values into a single String array. * * @param values1 First set of values * @param values2 Second set of values */ protected String[] mergeValues(Object values1, Object values2) { return new String[0]; } public java.lang.String getAuthType() {return "";} public javax.servlet.http.Cookie[] getCookies() {return null;} public long getDateHeader(java.lang.String x) {return 0;} public java.lang.String getHeader(java.lang.String x) {return ""; } public java.util.Enumeration getHeaders(java.lang.String x) {return null;} public java.util.Enumeration getHeaderNames() {return null;} public int getIntHeader(java.lang.String x) {return 0;} public java.lang.String getMethod() {return "";} public java.lang.String getPathTranslated() {return "";} public java.lang.String getRemoteUser() {return "";} public javax.servlet.http.HttpSession getSession() {return null;} public boolean isRequestedSessionIdFromUrl() {return false;} public java.lang.String getRemoteHost() {return "";} public boolean isUserInRole(java.lang.String x) {return false;} public java.security.Principal getUserPrincipal() {return null;} public java.lang.String getRequestedSessionId() {return "";} public java.lang.StringBuffer getRequestURL() {return null;} public javax.servlet.http.HttpSession getSession(boolean x) {return null;} public boolean isRequestedSessionIdValid() {return true;} public boolean isRequestedSessionIdFromCookie() {return true;} public boolean isRequestedSessionIdFromURL() {return true;} public java.lang.String getCharacterEncoding() {return "";} public void setCharacterEncoding(java.lang.String x) {} public int getContentLength() {return 0;} public java.lang.String getContentType() {return "";} public javax.servlet.ServletInputStream getInputStream() {return null;} public java.lang.String getProtocol() {return "";} public java.lang.String getScheme() {return "";} public java.lang.String getServerName() {return "";} public int getServerPort() {return 0;} public java.io.BufferedReader getReader() {return null;} public java.lang.String getRemoteAddr() {return "";} public java.util.Locale getLocale() {return null;} public java.util.Enumeration getLocales() {return null;} public boolean isSecure() {return true;} public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String x) {return null;} public java.lang.String getRealPath(java.lang.String x) {return "";} } --- NEW FILE: TestResponse.java --- /* * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact ap...@ap.... * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * * [Additional notices, if required by prior licensing conditions] * */ package net.sourceforge.idrs.test; import java.io.IOException; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; /** * Wrapper around a <code>javax.servlet.http.HttpServletResponse</code> * that transforms an application response object (which might be the original * one passed to a servlet, or might be based on the 2.3 * <code>javax.servlet.http.HttpServletResponseWrapper</code> class) * back into an internal <code>org.apache.catalina.HttpResponse</code>. * <p> * <strong>WARNING</strong>: Due to Java's lack of support for multiple * inheritance, all of the logic in <code>ApplicationResponse</code> is * duplicated in <code>ApplicationHttpResponse</code>. Make sure that you * keep these two classes in synchronization when making changes! * * @author Craig R. McClanahan * @version $Revision: 1.1 $ $Date: 2002/10/13 15:04:59 $ */ public final class TestResponse implements HttpServletResponse { // ----------------------------------------------------------- Constructors public TestResponse() { this(null,false); } /** * Construct a new wrapped response around the specified servlet response. * * @param response The servlet response being wrapped */ public TestResponse(HttpServletResponse response) { this(null, false); } /** * Construct a new wrapped response around the specified servlet response. * * @param response The servlet response being wrapped * @param included <code>true</code> if this response is being processed * by a <code>RequestDispatcher.include()</code> call */ public TestResponse(HttpServletResponse response, boolean included) { setIncluded(included); } // ----------------------------------------------------- Instance Variables /** * Is this wrapped response the subject of an <code>include()</code> * call? */ protected boolean included = false; /** * Descriptive information about this implementation. */ protected static final String info = "org.apache.catalina.core.ApplicationHttpResponse/1.0"; // ------------------------------------------------ ServletResponse Methods /** * Disallow <code>reset()</code> calls on a included response. * * @exception IllegalStateException if the response has already * been committed */ public void reset() { } /** * Disallow <code>setContentLength()</code> calls on an included response. * * @param len The new content length */ public void setContentLength(int len) { } /** * Disallow <code>setContentType()</code> calls on an included response. * * @param type The new content type */ public void setContentType(String type) { } // -------------------------------------------- HttpServletResponse Methods /** * Disallow <code>addCookie()</code> calls on an included response. * * @param cookie The new cookie */ public void addCookie(Cookie cookie) { } /** * Disallow <code>addDateHeader()</code> calls on an included response. * * @param name The new header name * @param value The new header value */ public void addDateHeader(String name, long value) { } /** * Disallow <code>addHeader()</code> calls on an included response. * * @param name The new header name * @param value The new header value */ public void addHeader(String name, String value) { } /** * Disallow <code>addIntHeader()</code> calls on an included response. * * @param name The new header name * @param value The new header value */ public void addIntHeader(String name, int value) { } /** * Disallow <code>sendError()</code> calls on an included response. * * @param sc The new status code * * @exception IOException if an input/output error occurs */ public void sendError(int sc) throws IOException { } /** * Disallow <code>sendError()</code> calls on an included response. * * @param sc The new status code * @param msg The new message * * @exception IOException if an input/output error occurs */ public void sendError(int sc, String msg) throws IOException { } /** * Disallow <code>sendRedirect()</code> calls on an included response. * * @param location The new location * * @exception IOException if an input/output error occurs */ public void sendRedirect(String location) throws IOException { } /** * Disallow <code>setDateHeader()</code> calls on an included response. * * @param name The new header name * @param value The new header value */ public void setDateHeader(String name, long value) { } /** * Disallow <code>setHeader()</code> calls on an included response. * * @param name The new header name * @param value The new header value */ public void setHeader(String name, String value) { } /** * Disallow <code>setIntHeader()</code> calls on an included response. * * @param name The new header name * @param value The new header value */ public void setIntHeader(String name, int value) { } /** * Disallow <code>setStatus()</code> calls on an included response. * * @param sc The new status code */ public void setStatus(int sc) { } /** * Disallow <code>setStatus()</code> calls on an included response. * * @param sc The new status code * @param msg The new message */ public void setStatus(int sc, String msg) { } // -------------------------------------------------------- Package Methods /** * Return descriptive information about this implementation. */ public String getInfo() { return (this.info); } /** * Return the included flag for this response. */ boolean isIncluded() { return (this.included); } /** * Set the included flag for this response. * * @param included The new included flag */ void setIncluded(boolean included) { this.included = included; } /** * Set the response that we are wrapping. * * @param response The new wrapped response */ void setResponse(HttpServletResponse response) { } public boolean containsHeader(java.lang.String x) { return false; } public java.lang.String encodeURL(java.lang.String x){ return ""; } public java.lang.String encodeRedirectURL(java.lang.String x) { return ""; } public java.lang.String encodeUrl(java.lang.String x){ return ""; } public java.lang.String encodeRedirectUrl(java.lang.String x) { return ""; } public java.lang.String getCharacterEncoding() { return ""; } public javax.servlet.ServletOutputStream getOutputStream() { return null; } public java.io.PrintWriter getWriter() { return null; } public void setBufferSize(int x){ } public int getBufferSize() { return 0; } public void flushBuffer(){} public void resetBuffer() {} public boolean isCommitted() {return false;} public void setLocale(java.util.Locale x){} public java.util.Locale getLocale() {return null;} } --- NEW FILE: TestSession.java --- /* * * ==================================================================== * * The Apache Software License, Version 1.1 * * Copyright (c) 1999 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the [...1039 lines suppressed...] /** * Return the <code>HttpSession</code> associated with the * specified session identifier. * * @param id Session identifier for which to look up a session * * @deprecated As of Java Servlet API 2.1 with no replacement. * This method must return null and will be removed in a * future version of the API. */ public HttpSession getSession(String id) { return (null); } } |
|
From: Marc B. <big...@us...> - 2002-10-13 15:04:32
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/test In directory usw-pr-cvs1:/tmp/cvs-serv1932/test Log Message: Directory /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/test added to the repository |
|
From: Marc B. <big...@us...> - 2002-10-13 15:04:13
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils
In directory usw-pr-cvs1:/tmp/cvs-serv1411/net/sourceforge/idrs/utils
Modified Files:
DB.java
Log Message:
added unit testing capabilities
Index: DB.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/DB.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** DB.java 21 Sep 2002 16:13:03 -0000 1.11
--- DB.java 13 Oct 2002 15:04:10 -0000 1.12
***************
*** 50,54 ****
protected String[] varTypes;
protected transient Vector bvarTypes;
! protected transient LinkedList rows;
protected String user, driver, name, pass, ID;
protected boolean closeConn;
--- 50,54 ----
protected String[] varTypes;
protected transient Vector bvarTypes;
! protected transient LinkedList rowCache;
protected String user, driver, name, pass, ID;
protected boolean closeConn;
***************
*** 71,75 ****
protected transient boolean hasResults;
protected transient Statement holdForClean;
!
public boolean hasResults() {
return hasResults;
--- 71,75 ----
protected transient boolean hasResults;
protected transient Statement holdForClean;
! protected transient Object[] rows;
public boolean hasResults() {
return hasResults;
***************
*** 98,102 ****
public int getNumberRows() {
! return rows.size();
}
--- 98,102 ----
public int getNumberRows() {
! return rows.length;
}
***************
*** 155,159 ****
*/
public int getCurrLocation() throws Exception {
! System.out.println("Here : " + cursurLocation);
return this.cursurLocation;
}
--- 155,159 ----
*/
public int getCurrLocation() throws Exception {
! //System.out.println("Here : " + cursurLocation);
return this.cursurLocation;
}
***************
*** 503,507 ****
if (this.cursur == DB.CLIENT) {
//System.out.println("In Client cursor read table");
! rows = new LinkedList();
Iterator it;
while (rs.next()) {
--- 503,507 ----
if (this.cursur == DB.CLIENT) {
//System.out.println("In Client cursor read table");
! rowCache = new LinkedList();
Iterator it;
while (rs.next()) {
***************
*** 513,520 ****
//System.out.println(key + "=" + fields.get(key));
}
! rows.add(this.fields);
}
rs.close();
this.cursurLocation = this.beginWith;
}
else {//cursor is server by default
--- 513,521 ----
//System.out.println(key + "=" + fields.get(key));
}
! rowCache.add(this.fields);
}
rs.close();
this.cursurLocation = this.beginWith;
+ this.rows = rowCache.toArray();
}
else {//cursor is server by default
***************
*** 698,702 ****
public boolean moveTo(int location) throws Exception {
if (this.cursur == DB.CLIENT) {
! if ((location >= 0) && (location < rows.size())) {
this.cursurLocation = location;
return true;
--- 699,703 ----
public boolean moveTo(int location) throws Exception {
if (this.cursur == DB.CLIENT) {
! if ((location >= 0) && (location < rows.length)) {
this.cursurLocation = location;
return true;
***************
*** 729,734 ****
// System.out.println("Cursor client : ");
System.out.println("Location : " + cursurLocation);
! if ((rows.size() > cursurLocation) && (cursurLocation < beginWith + numRecs)) {
! this.fields = (HashMap) rows.get(this.cursurLocation);
cursurLocation++;
hasNext = true;
--- 730,735 ----
// System.out.println("Cursor client : ");
System.out.println("Location : " + cursurLocation);
! if ((rows.length > cursurLocation) && (cursurLocation < beginWith + numRecs)) {
! this.fields = (HashMap) rows[this.cursurLocation];
cursurLocation++;
hasNext = true;
***************
*** 773,777 ****
public boolean getHasNext() throws Exception {
if (this.cursur == DB.CLIENT) {
! return (this.cursurLocation < rows.size());
}
else {
--- 774,778 ----
public boolean getHasNext() throws Exception {
if (this.cursur == DB.CLIENT) {
! return (this.cursurLocation < rows.length);
}
else {
***************
*** 806,812 ****
idrs.getSession().setAttribute("IDRS_DB_CACHE",caches);
}
! this.wasCached = (caches.get(this.name) != null);
! //System.out.println("Cached : " + this.wasCached);
! //System.out.println("Cache : " + caches.get(this.name));
}
--- 807,813 ----
idrs.getSession().setAttribute("IDRS_DB_CACHE",caches);
}
! this.wasCached = (caches.get(this.ID) != null);
! System.out.println("Cached : " + this.wasCached);
! System.out.println("Cache : " + caches.get(this.name));
}
***************
*** 832,840 ****
if (this.cursur == DB.CLIENT) {
! caches.put(this.name,rows);
}
}
else {
! this.rows = ((LinkedList) ((HashMap) idrs.getSession().getAttribute("IDRS_DB_CACHE")).get(this.name));
}
--- 833,841 ----
if (this.cursur == DB.CLIENT) {
! caches.put(this.ID,rows);
}
}
else {
! this.rows = ((Object[]) ((HashMap) idrs.getSession().getAttribute("IDRS_DB_CACHE")).get(this.ID));
}
***************
*** 886,890 ****
}
! public DbCache getCache() {
if (this.cache == null) {
this.cache = new DbCache(rows);
--- 887,891 ----
}
! /*public DbCache getCache() {
if (this.cache == null) {
this.cache = new DbCache(rows);
***************
*** 905,908 ****
--- 906,910 ----
this.wasCached = true;
}
+ */
public void setTransactionType(int type) {
|
|
From: Marc B. <big...@us...> - 2002-10-13 15:04:13
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet
In directory usw-pr-cvs1:/tmp/cvs-serv1411/net/sourceforge/idrs/core/servlet
Modified Files:
IDRSServlet.java
Log Message:
added unit testing capabilities
Index: IDRSServlet.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IDRSServlet.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** IDRSServlet.java 16 Sep 2002 16:22:29 -0000 1.15
--- IDRSServlet.java 13 Oct 2002 15:04:10 -0000 1.16
***************
*** 357,364 ****
! if (param.indexOf("Reset") != -1) {
try {
! if (req.getParameter(param).equalsIgnoreCase("true") && dbCache != null)
! dbCache.remove(db);
}
catch (Exception ignore){
--- 357,368 ----
! if (param.indexOf("_Reset") != -1) {
! System.out.println("reseting the cache");
! System.out.println("db de-caching : " + db);
try {
! if (req.getParameter(param).equalsIgnoreCase("true") && dbCache != null) {
! System.out.println("removed cache");
! dbCache.remove(db);
! }
}
catch (Exception ignore){
|
|
From: Marc B. <big...@us...> - 2002-09-21 16:14:49
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report
In directory usw-pr-cvs1:/tmp/cvs-serv26092/src/net/sourceforge/idrs/core/report
Modified Files:
NavigateChunk.java
Log Message:
completed data paging
Index: NavigateChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavigateChunk.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NavigateChunk.java 21 Sep 2002 16:13:03 -0000 1.2
--- NavigateChunk.java 21 Sep 2002 16:14:46 -0000 1.3
***************
*** 73,77 ****
}
else if (paramName.indexOf("_Reset") != -1) {
! buff.append(paramName).append('=').append(0).append('&');
}
else {
--- 73,77 ----
}
else if (paramName.indexOf("_Reset") != -1) {
! buff.append(paramName).append("=false").append('&');
}
else {
|
|
From: Marc B. <big...@us...> - 2002-09-21 16:13:06
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils
In directory usw-pr-cvs1:/tmp/cvs-serv25478/dev/src/net/sourceforge/idrs/utils
Modified Files:
DB.java
Log Message:
completed data paging
Index: DB.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/DB.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** DB.java 16 Sep 2002 15:19:42 -0000 1.10
--- DB.java 21 Sep 2002 16:13:03 -0000 1.11
***************
*** 155,158 ****
--- 155,159 ----
*/
public int getCurrLocation() throws Exception {
+ System.out.println("Here : " + cursurLocation);
return this.cursurLocation;
}
***************
*** 373,377 ****
*/
public void procMethod(ObjectStore obj,String method,String[] vals,IDRSScript idrs) throws Exception {
! System.out.println("In procmethod");
Object[] finalVals = new Object[vals.length];
Class[] clss = obj.getMethodTypes(method);
--- 374,378 ----
*/
public void procMethod(ObjectStore obj,String method,String[] vals,IDRSScript idrs) throws Exception {
! // System.out.println("In procmethod");
Object[] finalVals = new Object[vals.length];
Class[] clss = obj.getMethodTypes(method);
***************
*** 393,397 ****
}
if (direction == DB.OUTPUT) {
! System.out.println("executing method");
rs = (ResultSet) obj.execMethod(method,finalVals);
--- 394,398 ----
}
if (direction == DB.OUTPUT) {
! // System.out.println("executing method");
rs = (ResultSet) obj.execMethod(method,finalVals);
***************
*** 409,416 ****
public void ProcSQL(String SQL, boolean isProc, String[] vars) throws Exception {
int i;
! System.out.println("SQL : " + SQL);
! System.out.println("isProc : " + isProc);
! System.out.println("Vars : " + vars);
! System.out.println("Direction : " + (this.direction == DB.OUTPUT));
if (isProc) {
SQL = "{call " + SQL + "}";
--- 410,417 ----
public void ProcSQL(String SQL, boolean isProc, String[] vars) throws Exception {
int i;
! // System.out.println("SQL : " + SQL);
! //System.out.println("isProc : " + isProc);
! //System.out.println("Vars : " + vars);
! //System.out.println("Direction : " + (this.direction == DB.OUTPUT));
if (isProc) {
SQL = "{call " + SQL + "}";
***************
*** 499,505 ****
private void readTable() throws Exception {
Object key;
! System.out.println("in read table");
if (this.cursur == DB.CLIENT) {
! System.out.println("In Client cursor read table");
rows = new LinkedList();
Iterator it;
--- 500,506 ----
private void readTable() throws Exception {
Object key;
! //System.out.println("in read table");
if (this.cursur == DB.CLIENT) {
! //System.out.println("In Client cursor read table");
rows = new LinkedList();
Iterator it;
***************
*** 510,514 ****
while (it.hasNext()) {
key = it.next();
! System.out.println(key + "=" + fields.get(key));
}
rows.add(this.fields);
--- 511,515 ----
while (it.hasNext()) {
key = it.next();
! //System.out.println(key + "=" + fields.get(key));
}
rows.add(this.fields);
***************
*** 724,731 ****
*/
public boolean next() throws Exception {
! System.out.println("Cursor client : ");
if (this.cursur == DB.CLIENT) {
! System.out.println("Cursor client : ");
! System.out.println("Location : " + cursurLocation);
if ((rows.size() > cursurLocation) && (cursurLocation < beginWith + numRecs)) {
this.fields = (HashMap) rows.get(this.cursurLocation);
--- 725,732 ----
*/
public boolean next() throws Exception {
! //System.out.println("Cursor client : ");
if (this.cursur == DB.CLIENT) {
! // System.out.println("Cursor client : ");
! System.out.println("Location : " + cursurLocation);
if ((rows.size() > cursurLocation) && (cursurLocation < beginWith + numRecs)) {
this.fields = (HashMap) rows.get(this.cursurLocation);
***************
*** 743,747 ****
if (rs.next()) {
! System.out.println("We have another one");
hasNext = true;
readFields();
--- 744,748 ----
if (rs.next()) {
! // System.out.println("We have another one");
hasNext = true;
readFields();
***************
*** 749,753 ****
}
else {
! System.out.println("No more");
hasNext = false;
return false;
--- 750,754 ----
}
else {
! // System.out.println("No more");
hasNext = false;
return false;
***************
*** 806,812 ****
}
this.wasCached = (caches.get(this.name) != null);
! System.out.println("Cached : " + this.wasCached);
! System.out.println("Cache : " + caches.get(this.name));
}
if (this.transactionType == TRANS_BEGIN || this.transactionType == TRANS_COMPLETE) {
--- 807,816 ----
}
this.wasCached = (caches.get(this.name) != null);
! //System.out.println("Cached : " + this.wasCached);
! //System.out.println("Cache : " + caches.get(this.name));
}
+
+
+
if (this.transactionType == TRANS_BEGIN || this.transactionType == TRANS_COMPLETE) {
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report
In directory usw-pr-cvs1:/tmp/cvs-serv25478/dev/src/net/sourceforge/idrs/core/report
Modified Files:
FieldChunk.java IDRSBody.java NavNextChunk.java
NavPrevChunk.java NavigateChunk.java RepeatLine.java
Log Message:
completed data paging
Index: FieldChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/FieldChunk.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** FieldChunk.java 27 Feb 2002 23:56:31 -0000 1.6
--- FieldChunk.java 21 Sep 2002 16:13:03 -0000 1.7
***************
*** 76,81 ****
*/
public String toString(IDRSHead head) throws Exception {
! System.out.println("Field Type : " + this.fieldType);
! System.out.println("This.Rep : " + rep);
String val;
switch (this.fieldType) {
--- 76,81 ----
*/
public String toString(IDRSHead head) throws Exception {
! // System.out.println("Field Type : " + this.fieldType);
! // System.out.println("This.Rep : " + rep);
String val;
switch (this.fieldType) {
***************
*** 86,90 ****
}
! System.out.println("Val : " + val);
return val;
}
--- 86,90 ----
}
! // System.out.println("Val : " + val);
return val;
}
Index: IDRSBody.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSBody.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** IDRSBody.java 11 Apr 2002 20:37:06 -0000 1.6
--- IDRSBody.java 21 Sep 2002 16:13:03 -0000 1.7
***************
*** 79,83 ****
String output = head.getText(this);
Line ln;
! System.out.println("lines : " + lines.length);
for (i=0; i< lines.length; i++) {
ln = lines[i];
--- 79,83 ----
String output = head.getText(this);
Line ln;
! // System.out.println("lines : " + lines.length);
for (i=0; i< lines.length; i++) {
ln = lines[i];
Index: NavNextChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavNextChunk.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NavNextChunk.java 16 Sep 2002 15:21:04 -0000 1.1
--- NavNextChunk.java 21 Sep 2002 16:13:03 -0000 1.2
***************
*** 30,36 ****
protected int adjustPosition(DB db) throws Exception {
! System.out.println("Curr Location : " + db.getCurrLocation());
! System.out.println("Num Recs : " + db.getNumRecs());
! return db.getCurrLocation();
}
}
--- 30,46 ----
protected int adjustPosition(DB db) throws Exception {
! int currPos = db.getCurrLocation();
!
! /*System.out.println("Name : " + db.getID());
! System.out.println("Current Pos: " + currPos);
! System.out.println("Number Rows : " + db.getNumberRows());
! System.out.println("Num Recs : " + db.getNumRecs());*/
!
! // if (currPos >= db.getNumberRows()) {
! return db.getFirstRec() + db.getNumRecs();
! //}
! //else {
! //return currPos;
! // }
}
}
Index: NavPrevChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavPrevChunk.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NavPrevChunk.java 16 Sep 2002 15:21:04 -0000 1.1
--- NavPrevChunk.java 21 Sep 2002 16:13:03 -0000 1.2
***************
*** 30,34 ****
protected int adjustPosition(DB db) throws Exception {
!
return db.getFirstRec() - db.getNumRecs();
--- 30,34 ----
protected int adjustPosition(DB db) throws Exception {
!
return db.getFirstRec() - db.getNumRecs();
Index: NavigateChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavigateChunk.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** NavigateChunk.java 16 Sep 2002 15:21:04 -0000 1.1
--- NavigateChunk.java 21 Sep 2002 16:13:03 -0000 1.2
***************
*** 67,70 ****
--- 67,71 ----
adjustedPos = adjustPosition(db);
+ System.out.println("Begining : " + adjustedPos);
returnLink = returnLink || ((adjustedPos >= 0) && (adjustedPos <= db.getNumberRows()));
Index: RepeatLine.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/RepeatLine.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** RepeatLine.java 4 Mar 2002 23:05:34 -0000 1.5
--- RepeatLine.java 21 Sep 2002 16:13:03 -0000 1.6
***************
*** 188,192 ****
public String toString(IDRSHead head) {
! System.out.println("in RepeatLine toString()");
return "";
}
--- 188,192 ----
public String toString(IDRSHead head) {
! // System.out.println("in RepeatLine toString()");
return "";
}
|
|
From: Marc B. <big...@us...> - 2002-09-21 16:13:06
|
Update of /cvsroot/idrs/Idrs/dev/lib In directory usw-pr-cvs1:/tmp/cvs-serv25478/dev/lib Modified Files: idrs.jar Log Message: completed data paging Index: idrs.jar =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/lib/idrs.jar,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 Binary files /tmp/cvs3MIhyD and /tmp/cvsOTEIK8 differ |
|
From: Marc B. <big...@us...> - 2002-09-21 16:13:05
|
Update of /cvsroot/idrs/Idrs/dev/bin In directory usw-pr-cvs1:/tmp/cvs-serv25478/dev/bin Modified Files: idrs.jar Log Message: completed data paging Index: idrs.jar =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/bin/idrs.jar,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 Binary files /tmp/cvs0VMeK3 and /tmp/cvsiG9o5Y differ |
|
From: Marc B. <big...@us...> - 2002-09-16 16:22:32
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet
In directory usw-pr-cvs1:/tmp/cvs-serv3376/dev/src/net/sourceforge/idrs/core/servlet
Modified Files:
IDRSServlet.java
Log Message:
Fixed a bug with returning the authentication connection
Index: IDRSServlet.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IDRSServlet.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** IDRSServlet.java 16 Sep 2002 15:19:42 -0000 1.14
--- IDRSServlet.java 16 Sep 2002 16:22:29 -0000 1.15
***************
*** 146,150 ****
init.returnScriptContext(poolInfo.idrss);
if (poolInfo.conns != null)
! returnConns(poolInfo.conns);
}
req.setAttribute("fetchAddr", null);
--- 146,153 ----
init.returnScriptContext(poolInfo.idrss);
if (poolInfo.conns != null)
! returnConns(poolInfo.conns,poolInfo);
! if (poolInfo.authDB != null)
! init.getDBPool(init.getAuthDbName()).returnConnection(poolInfo.authDB);
!
}
req.setAttribute("fetchAddr", null);
***************
*** 202,206 ****
}
! private boolean getConns(Object[] conNames,HashMap conns,Connection authCon) throws Exception {
String conString;
DbPool pool;
--- 205,209 ----
}
! private boolean getConns(Object[] conNames,HashMap conns,Connection authCon,PoolInfo poolInfo) throws Exception {
String conString;
DbPool pool;
***************
*** 216,220 ****
//fatal error has occurred
! returnConns(conns);
throw noMore;
--- 219,223 ----
//fatal error has occurred
! returnConns(conns,poolInfo);
throw noMore;
***************
*** 224,228 ****
if (con == null) {
! returnConns(conns);
return false;
}
--- 227,231 ----
if (con == null) {
! returnConns(conns,poolInfo);
return false;
}
***************
*** 241,253 ****
}
! private void returnConns(HashMap conns) throws Exception {
Iterator it = conns.keySet().iterator();
String key;
Connection con;
DbPool pool;
!
while (it.hasNext()) {
key = (String) it.next();
con = (Connection) conns.get(key);
//if (! key.equals(init.getAuthDbName())) {
pool = init.getDBPool(key);
--- 244,263 ----
}
! private void returnConns(HashMap conns,PoolInfo poolInfo ) throws Exception {
Iterator it = conns.keySet().iterator();
String key;
Connection con;
DbPool pool;
!
!
while (it.hasNext()) {
key = (String) it.next();
+
+
+
con = (Connection) conns.get(key);
+ if (con == poolInfo.authDB)
+ poolInfo.authDB = null;
+
//if (! key.equals(init.getAuthDbName())) {
pool = init.getDBPool(key);
***************
*** 255,258 ****
--- 265,270 ----
//}
}
+
+
}
***************
*** 444,449 ****
--- 456,464 ----
//retrieve the system connection
+ System.out.println("Retrieving AuthDB");
Connection authDB = init.getDBPool(init.getAuthDbName()).getConnection();
if (authDB == null) throw new Exception("Unable to retrieve authentication connection");
+ poolInfo.authDB = authDB;
+ System.out.println("Retrieved AuthDB");
//initialize a security object for retrieving all report information
***************
*** 489,501 ****
poolInfo.conns = new HashMap();
IDRSScriptLanguage idrss = init.getScriptContext();
poolInfo.idrss = idrss;
! if (! getConns(secure.getConns(), poolInfo.conns,authDB )) {
throw new Exception("The Server is Busy, Please Try Again Later");
}
//retrieve report
IDRSRep rep = getReport(docID,docName);
//initialize some information about the report
poolInfo.docName = docName;
--- 504,522 ----
poolInfo.conns = new HashMap();
+ System.out.println("Retrieving ScriptContext");
IDRSScriptLanguage idrss = init.getScriptContext();
+ System.out.println("Retrieved ScriptContext");
poolInfo.idrss = idrss;
! System.out.println("Retrieving Conns");
! if (! getConns(secure.getConns(), poolInfo.conns,authDB,poolInfo )) {
throw new Exception("The Server is Busy, Please Try Again Later");
}
+ System.out.println("Retrieved Conns");
//retrieve report
+ System.out.println("Retrieving Rep");
IDRSRep rep = getReport(docID,docName);
+ System.out.println("Retrieved Rep");
//initialize some information about the report
poolInfo.docName = docName;
***************
*** 506,509 ****
--- 527,531 ----
//lets run the page
//re-init the page
+ System.out.println("Init");
rep.getHead().init(poolInfo.conns, secure.getUserID(), secure.getDocID(), "",req.getSession(), req, resp, init.getApplication(), poolInfo.idrss, new UserInfo(secure.getGroups(), secure.getUserID(), secure.getUserName()), init.digestPassword() ? init.getDigestType() : "NONE");
***************
*** 512,515 ****
--- 534,538 ----
//build the report
+ System.out.println("building");
buffer = rep.buildReport();
***************
*** 614,617 ****
--- 637,641 ----
HashMap conns;
String docName;
+ Connection authDB;
}
|
|
From: Marc B. <big...@us...> - 2002-09-16 16:22:31
|
Update of /cvsroot/idrs/Idrs/dev/bin In directory usw-pr-cvs1:/tmp/cvs-serv3376/dev/bin Modified Files: idrs.jar Log Message: Fixed a bug with returning the authentication connection Index: idrs.jar =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/bin/idrs.jar,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 Binary files /tmp/cvsu5WfXa and /tmp/cvsURNw5a differ |