idrs-commit Mailing List for Internet Document and Report Server (Page 4)
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-04-19 03:14:24
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units
In directory sc8-pr-cvs1:/tmp/cvs-serv21774/dev/src/net/sourceforge/idrs/deploy/compile/units
Modified Files:
Body.java
Log Message:
Added ability for IDRS security implementation to assume that if a record is retrieved, the password is ok. This will allow for proprietary password encryption models to be used
Index: Body.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Body.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Body.java 26 Mar 2003 23:03:21 -0000 1.11
--- Body.java 19 Apr 2003 03:13:48 -0000 1.12
***************
*** 193,197 ****
else if (srcType.equalsIgnoreCase("db"))
isrcType = YesNo.SRC_DB;
! else if (srcType.equalsIgnoreCase("db"))
isrcType = YesNo.SRC_PROP;
else {
--- 193,197 ----
else if (srcType.equalsIgnoreCase("db"))
isrcType = YesNo.SRC_DB;
! else if (srcType.equalsIgnoreCase("prop"))
isrcType = YesNo.SRC_PROP;
else {
|
|
From: Marc B. <big...@us...> - 2003-04-19 03:14:23
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils In directory sc8-pr-cvs1:/tmp/cvs-serv21774/dev/src/net/sourceforge/idrs/utils Added Files: RSMetaData.class Log Message: Added ability for IDRS security implementation to assume that if a record is retrieved, the password is ok. This will allow for proprietary password encryption models to be used |
|
From: Marc B. <big...@us...> - 2003-04-19 03:14:02
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/exceptions
In directory sc8-pr-cvs1:/tmp/cvs-serv21774/dev/src/net/sourceforge/idrs/exceptions
Added Files:
SQLNamingException.java
Log Message:
Added ability for IDRS security implementation to assume that if a record is retrieved, the password is ok. This will allow for proprietary password encryption models to be used
--- NEW FILE: SQLNamingException.java ---
/*
* SQLNamingException.java
*
* Created on March 10, 2002, 3:35 PM
*/
package net.sourceforge.idrs.exceptions;
import java.sql.*;
import javax.naming.*;
/**
*
* @author mlb
* @version
*/
public class SQLNamingException extends java.sql.SQLException {
NamingException e;
/** Creates new SQLNamingExcepton */
public SQLNamingException(NamingException e) {
this.e = e;
}
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException {
return super.clone();
}
public boolean equals(java.lang.Object obj) {
return super.equals(obj);
}
public java.lang.Throwable fillInStackTrace() {
return super.fillInStackTrace();
}
public java.lang.Throwable getCause() {
return e.getCause();
}
public java.lang.String getLocalizedMessage() {
return e.getLocalizedMessage();
}
public java.lang.String getMessage() {
return e.getMessage();
}
public java.lang.StackTraceElement[] getStackTrace() {
return e.getStackTrace();
}
public java.lang.Throwable initCause(java.lang.Throwable throwable) {
return e.initCause(throwable);
}
public void printStackTrace() {
e.printStackTrace();
}
public void printStackTrace(java.io.PrintStream printStream) {
e.printStackTrace(printStream);
}
public void printStackTrace(java.io.PrintWriter printWriter) {
e.printStackTrace(printWriter);
}
public void setStackTrace(java.lang.StackTraceElement[] stackTraceElement) {
e.setStackTrace(stackTraceElement);
}
public int getErrorCode() {
return 0;
}
public java.sql.SQLException getNextException() {
return this;
}
public java.lang.String getSQLState() {
return "ERROR";
}
public void setNextException(java.sql.SQLException sQLException) {
}
}
|
|
From: Marc B. <big...@us...> - 2003-04-19 03:14:02
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/rs
In directory sc8-pr-cvs1:/tmp/cvs-serv21774/dev/src/net/sourceforge/idrs/utils/rs
Modified Files:
ObjRsMetaData.java
Log Message:
Added ability for IDRS security implementation to assume that if a record is retrieved, the password is ok. This will allow for proprietary password encryption models to be used
Index: ObjRsMetaData.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/rs/ObjRsMetaData.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ObjRsMetaData.java 17 Mar 2003 14:05:02 -0000 1.2
--- ObjRsMetaData.java 19 Apr 2003 03:13:50 -0000 1.3
***************
*** 23,27 ****
public int getColumnCount() throws java.sql.SQLException
{
! return fieldNames.length ;
}
--- 23,27 ----
public int getColumnCount() throws java.sql.SQLException
{
! return fieldNames != null ? fieldNames.length : 0;
}
|
|
From: Marc B. <big...@us...> - 2003-04-19 03:14:02
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report
In directory sc8-pr-cvs1:/tmp/cvs-serv21774/dev/src/net/sourceforge/idrs/core/report
Modified Files:
NavigateChunk.java IDRSHead.java SelectChunk.java
Log Message:
Added ability for IDRS security implementation to assume that if a record is retrieved, the password is ok. This will allow for proprietary password encryption models to be used
Index: NavigateChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavigateChunk.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** NavigateChunk.java 26 Mar 2003 23:03:22 -0000 1.6
--- NavigateChunk.java 19 Apr 2003 03:13:48 -0000 1.7
***************
*** 69,74 ****
db = (DB) head.dbs.get(it.next());
if (db.getIsPaged()) {
! buff.append(db.getID()).append("_Reset=false").append('&');
! buff.append(db.getID()).append("_PageSize=").append(db.getNumRecs()).append('&');
adjustedPos = adjustPosition(db);
--- 69,74 ----
db = (DB) head.dbs.get(it.next());
if (db.getIsPaged()) {
! if (ignore != null ? ! ignore.contains(db.getID() + "_Reset") : true) buff.append(db.getID()).append("_Reset=false").append('&');
! if (ignore != null ? ! ignore.contains(db.getID() + "_PageSize") : true) buff.append(db.getID()).append("_PageSize=").append(db.getNumRecs()).append('&');
adjustedPos = adjustPosition(db);
***************
*** 76,80 ****
returnLink = returnLink || ((adjustedPos >= 0) && (adjustedPos <= db.getNumberRows()));
! buff.append(db.getID()).append("_FirstRecord=").append(adjustedPos).append('&');
}
}
--- 76,80 ----
returnLink = returnLink || ((adjustedPos >= 0) && (adjustedPos <= db.getNumberRows()));
! if (ignore != null ? ! ignore.contains(db.getID() + "_FirstRecord") : true) buff.append(db.getID()).append("_FirstRecord=").append(adjustedPos).append('&');
}
}
***************
*** 101,105 ****
}
else {*/
! if ((ignore != null ? ! ignore.contains(param) : true) && paramName.indexOf("_Reset") == -1 && paramName.indexOf("_FirstRecord") == -1 && paramName.indexOf("_Reset") == -1) {
buff.append(paramName).append('=').append(URLEncoder.encode(param)).append('&');
}
--- 101,106 ----
}
else {*/
!
! if ((ignore != null ? ! ignore.contains(paramName) : true) && paramName.indexOf("_Reset") == -1 && paramName.indexOf("_FirstRecord") == -1 && paramName.indexOf("_Reset") == -1) {
buff.append(paramName).append('=').append(URLEncoder.encode(param)).append('&');
}
***************
*** 138,142 ****
db = (DB) head.dbs.get(it.next());
if (db.getIsPaged()) {
! if (ignore != null ? ! ignore.contains(db.getID() + "_Reset") : true) buff.append("<INPUT TYPE=\"HIDDEN\" NAME=\"").append(db.getID()).append("_Reset\" VALUE-\"false\">").append('\n');
if (ignore != null ? ! ignore.contains(db.getID() + "_PageSize") : true)buff.append("<INPUT TYPE=\"HIDDEN\" NAME=\"").append(db.getID()).append("_PageSize\" VALUE=\"").append(db.getNumRecs()).append("\">\n");
--- 139,143 ----
db = (DB) head.dbs.get(it.next());
if (db.getIsPaged()) {
! if (ignore != null ? ! ignore.contains(db.getID() + "_Reset") : true) buff.append("<INPUT TYPE=\"HIDDEN\" NAME=\"").append(db.getID()).append("_Reset\" VALUE=\"false\">").append('\n');
if (ignore != null ? ! ignore.contains(db.getID() + "_PageSize") : true)buff.append("<INPUT TYPE=\"HIDDEN\" NAME=\"").append(db.getID()).append("_PageSize\" VALUE=\"").append(db.getNumRecs()).append("\">\n");
Index: IDRSHead.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSHead.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** IDRSHead.java 26 Mar 2003 21:33:06 -0000 1.16
--- IDRSHead.java 19 Apr 2003 03:13:48 -0000 1.17
***************
*** 661,664 ****
--- 661,680 ----
}
+ /**
+ *Tells the type of digest
+ *@param plain Plain Text String
+ */
+ public byte[] getDigestBytes(String plain) throws Exception {
+ if (! this.digest.equalsIgnoreCase("none")) {
+ MessageDigest md = MessageDigest.getInstance(this.digest);
+ md.update(plain.getBytes());
+ byte[] digest = md.digest();
+ return digest;
+ }
+ else {
+ return plain.getBytes();
+ }
+ }
+
/**
Index: SelectChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/SelectChunk.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SelectChunk.java 22 Nov 2002 07:16:24 -0000 1.1
--- SelectChunk.java 19 Apr 2003 03:13:49 -0000 1.2
***************
*** 67,71 ****
protected LinkedList getList(IDRSHead idrs) throws Exception {
HashMap row;
! LinkedList table = (LinkedList) idrs.getRequest().getAttribute("SELECT_" + name);
if (table == null) {
--- 67,71 ----
protected LinkedList getList(IDRSHead idrs) throws Exception {
HashMap row;
! LinkedList table = (LinkedList) idrs.getRequest().getAttribute("SELECT_" + srcDB);
if (table == null) {
***************
*** 78,82 ****
}
! idrs.getRequest().setAttribute("SELECT_" + name,table);
}
--- 78,83 ----
}
!
! idrs.getRequest().setAttribute("SELECT_" + srcDB,table);
}
|
|
From: Marc B. <big...@us...> - 2003-04-19 03:14:01
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet In directory sc8-pr-cvs1:/tmp/cvs-serv21774/dev/src/net/sourceforge/idrs/core/servlet Modified Files: IdrsAuthBase.java IdrsController.java IdrsAuthDefault.java IDRSSecurity.java Added Files: IDRSAuth.java Log Message: Added ability for IDRS security implementation to assume that if a record is retrieved, the password is ok. This will allow for proprietary password encryption models to be used --- NEW FILE: IDRSAuth.java --- package net.sourceforge.idrs.core.servlet; import net.sourceforge.idrs.utils.*; import java.util.*; import java.io.*; import java.sql.*; import java.security.*; /** * @author mlb * * To change this generated comment edit the template variable "typecomment": * Window>Preferences>Java>Templates. * To enable and disable the creation of type comments go to * Window>Preferences>Java>Code Generation. */ public interface IDRSAuth { public abstract boolean loadUser(Connection con, String user, String pass, Application app, boolean toLower, boolean isDisgested) throws Exception ; public String getUserPass(); public void setUserPass(String pass); public void setUserPassBytes(byte[] pass); public byte[] getUserPassBytes(); public String getUserGroups(); public void setUserGroups(String groups); public int getUserId(); public void setUserId(int id); public boolean checkPass(); public void setCheckPass(boolean check); } Index: IdrsAuthBase.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IdrsAuthBase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdrsAuthBase.java 6 Feb 2003 20:13:44 -0000 1.1 --- IdrsAuthBase.java 19 Apr 2003 03:13:49 -0000 1.2 *************** *** 18,21 **** --- 18,23 ---- private int id; private byte[] passBytes; + private boolean check; + /** *************** *** 29,33 **** * @see net.sourceforge.idrs.core.servlet.IDRSAuth#loadUser(Connection, String, Application) */ ! public abstract boolean loadUser(Connection con, String user, Application app, boolean toLower,boolean isDigested) throws Exception ; /** --- 31,35 ---- * @see net.sourceforge.idrs.core.servlet.IDRSAuth#loadUser(Connection, String, Application) */ ! public abstract boolean loadUser(Connection con, String user, String pass, Application app, boolean toLower,boolean isDigested) throws Exception ; /** *************** *** 79,82 **** --- 81,92 ---- return this.passBytes; } + + public boolean checkPass() { + return this.check; + } + public void setCheckPass(boolean check) { + this.check = check; + } + } Index: IdrsController.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IdrsController.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IdrsController.java 26 Mar 2003 21:33:09 -0000 1.3 --- IdrsController.java 19 Apr 2003 03:13:49 -0000 1.4 *************** *** 438,444 **** try { isSecure = secure.checkOK(); ! } catch (Exception securException) { //user is not authentic, deny access secure.close(); accessDenied(req, resp); --- 438,445 ---- try { isSecure = secure.checkOK(); ! System.out.println("Secure : " + isSecure); } catch (Exception securException) { //user is not authentic, deny access + securException.printStackTrace(System.out); secure.close(); accessDenied(req, resp); *************** *** 455,463 **** //store username and password ! req.getSession().putValue("user", user); ! req.getSession().putValue("pass", pass); //if the password isn't ok ! if (!secure.passwordOK()) { try { session.putValue("bad", "1"); --- 456,466 ---- //store username and password ! if (! secure.isAnon()) { ! req.getSession().putValue("user", user); ! req.getSession().putValue("pass", pass); ! } //if the password isn't ok ! if (!secure.passwordOK() && !secure.isAnon()) { try { session.putValue("bad", "1"); Index: IdrsAuthDefault.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IdrsAuthDefault.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IdrsAuthDefault.java 6 Feb 2003 20:13:43 -0000 1.1 --- IdrsAuthDefault.java 19 Apr 2003 03:13:49 -0000 1.2 *************** *** 28,35 **** --- 28,37 ---- Connection con, String user, + String pass, Application app, boolean toLower, boolean isDigested) throws Exception { + this.setCheckPass(true); boolean hasEntry; String sql = "SELECT * FROM tblUser WHERE UserName=?"; *************** *** 68,72 **** this.setUserGroups("-1,"); this.setUserId(-1); ! this.setUserPass("anonamous"); } --- 70,74 ---- this.setUserGroups("-1,"); this.setUserId(-1); ! this.setUserPass("anonymous"); } Index: IDRSSecurity.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IDRSSecurity.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IDRSSecurity.java 6 Feb 2003 20:13:43 -0000 1.8 --- IDRSSecurity.java 19 Apr 2003 03:13:49 -0000 1.9 *************** *** 33,36 **** --- 33,37 ---- private boolean passOK; private boolean toLower; + private boolean checkPass; private PreparedStatement psUser; private ResultSet rsUser; *************** *** 55,58 **** --- 56,60 ---- */ public IDRSSecurity(DocInfo doc,String userName,String password, Connection con,boolean toLower,boolean digestPass,String digest, IDRSAuth imp, Application app) throws Exception { + this.checkPass = true; this.doc = doc; this.userName = userName; *************** *** 68,72 **** this.imp = imp; ! this.hasEntry = imp.loadUser(con,this.userName,app,toLower,digestPass); this.ugroups = imp.getUserGroups(); if (digestPass) { --- 70,74 ---- this.imp = imp; ! this.hasEntry = imp.loadUser(con,this.userName,this.password,app,toLower,digestPass); this.ugroups = imp.getUserGroups(); if (digestPass) { *************** *** 77,81 **** } this.uid = imp.getUserId(); ! --- 79,83 ---- } this.uid = imp.getUserId(); ! this.checkPass = imp.checkPass(); *************** *** 175,183 **** isOK = doc.passGate(this.ugroups); ! if (isOK && hasEntry) { return passwordOK(); } ! else if (isOK) { this.ugroups="-1"; return true; --- 177,189 ---- isOK = doc.passGate(this.ugroups); ! //System.out.println("is ok : " + isOK); ! //System.out.println("has entry : " + hasEntry); ! //System.out.println("is anaon : " + doc.passGate("-1")); if (isOK && hasEntry) { return passwordOK(); } ! ! else if (doc.passGate("-1") ) { ! //System.out.println("is anon"); this.ugroups="-1"; return true; *************** *** 193,196 **** --- 199,206 ---- } + boolean isAnon() { + return doc.passGate("-1"); + } + /** * Determines if a given password is valid *************** *** 198,206 **** public boolean passwordOK() throws Exception { if (! passOK) { ! if (this.digestPass) { ! MessageDigest md = MessageDigest.getInstance(this.digest); md.update(password.getBytes()); --- 208,221 ---- public boolean passwordOK() throws Exception { + if (! this.checkPass) { + return true; + } + if (! passOK) { + if (password == null) return false; ! if (this.digestPass) { ! MessageDigest md = MessageDigest.getInstance(this.digest); md.update(password.getBytes()); |
|
From: Marc B. <big...@us...> - 2003-04-19 03:14:01
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script
In directory sc8-pr-cvs1:/tmp/cvs-serv21774/dev/src/net/sourceforge/idrs/script
Modified Files:
IDRSScript.java
Log Message:
Added ability for IDRS security implementation to assume that if a record is retrieved, the password is ok. This will allow for proprietary password encryption models to be used
Index: IDRSScript.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/IDRSScript.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** IDRSScript.java 17 Mar 2003 14:05:01 -0000 1.11
--- IDRSScript.java 19 Apr 2003 03:13:50 -0000 1.12
***************
*** 121,124 ****
--- 121,130 ----
public String getDigest(String plain) throws Exception ;
+ /**
+ *Tells the type of digest
+ *@param plain Plain Text String
+ */
+ public byte[] getDigestBytes(String plain) throws Exception ;
+
/**
|
|
From: Marc B. <big...@us...> - 2003-03-26 23:04:03
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units
In directory sc8-pr-cvs1:/tmp/cvs-serv6946/dev/src/net/sourceforge/idrs/deploy/compile/units
Modified Files:
Body.java
Log Message:
refactored navigation tags, also added a <navcur> tag that generates a link that will kepp a page it it's current state, minus any specified parameters.
Index: Body.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Body.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Body.java 26 Mar 2003 21:33:04 -0000 1.10
--- Body.java 26 Mar 2003 23:03:21 -0000 1.11
***************
*** 248,251 ****
--- 248,255 ----
state.getCurrentLine().addChunk(new NavCurChunk(val));
}
+
+ public void navCurForm(String val, Attributes atts) throws Exception {
+ state.getCurrentLine().addChunk(new NavCurFormChunk(val));
+ }
/**
|
|
From: Marc B. <big...@us...> - 2003-03-26 23:03:34
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report
In directory sc8-pr-cvs1:/tmp/cvs-serv6946/dev/src/net/sourceforge/idrs/core/report
Modified Files:
NavigateChunk.java
Added Files:
NavCurFormChunk.java
Log Message:
refactored navigation tags, also added a <navcur> tag that generates a link that will kepp a page it it's current state, minus any specified parameters.
--- NEW FILE: NavCurFormChunk.java ---
/*
NavNextChunk.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.*;
import java.util.*;
import java.net.*;
import net.sourceforge.idrs.utils.*;
import javax.servlet.http.*;
/**
Encapsulates any plain text found in an RML page
*/
public final class NavCurFormChunk extends NavigateChunk {
LinkedList ignore;
public NavCurFormChunk(String signore) {
super("");
ignore = new LinkedList();
StringTokenizer tok = new StringTokenizer(signore,",",false);
while (tok.hasMoreTokens()) {
ignore.add(tok.nextToken());
}
}
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();
//}
//else {
//return currPos;
// }
}
public String toString(IDRSHead head) throws Exception {
String params = super.toStringForm(head,ignore);
return params;
}
}
Index: NavigateChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavigateChunk.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** NavigateChunk.java 26 Mar 2003 21:33:06 -0000 1.5
--- NavigateChunk.java 26 Mar 2003 23:03:22 -0000 1.6
***************
*** 117,119 ****
--- 117,186 ----
}
+
+ public String toStringForm(IDRSHead head,LinkedList ignore) throws Exception {
+ buff.setLength(0);
+
+
+ Enumeration paramNames;
+ String paramName;
+ String param;
+ HttpServletRequest request = head.getRequest();;
+ //loop through all parameters
+
+ paramNames = request.getParameterNames();
+ DB db;
+
+ boolean returnLink = false;
+ int adjustedPos;
+
+ Iterator it = head.dbs.keySet().iterator();
+ while (it.hasNext()) {
+ db = (DB) head.dbs.get(it.next());
+ if (db.getIsPaged()) {
+ if (ignore != null ? ! ignore.contains(db.getID() + "_Reset") : true) buff.append("<INPUT TYPE=\"HIDDEN\" NAME=\"").append(db.getID()).append("_Reset\" VALUE-\"false\">").append('\n');
+ if (ignore != null ? ! ignore.contains(db.getID() + "_PageSize") : true)buff.append("<INPUT TYPE=\"HIDDEN\" NAME=\"").append(db.getID()).append("_PageSize\" VALUE=\"").append(db.getNumRecs()).append("\">\n");
+
+ adjustedPos = adjustPosition(db);
+ //System.out.println("Begining : " + adjustedPos);
+ returnLink = returnLink || ((adjustedPos >= 0) && (adjustedPos <= db.getNumberRows()));
+
+ if (ignore != null ? ! ignore.contains(db.getID() + "_Reset") : true) buff.append("<INPUT TYPE=\"HIDDEN\" NAME=\"").append(db.getID()).append("_FirstRecord\" VALUE=\"").append(adjustedPos).append("\">\n");
+ }
+ }
+
+
+
+ while (paramNames.hasMoreElements()) {
+ paramName = (String) paramNames.nextElement();
+ param = request.getParameter(paramName);
+
+
+
+ /*if (paramName.indexOf("_FirstRecord") != -1) {
+ db = head.getDB(paramName.substring(0,paramName.indexOf("_")));
+
+ adjustedPos = adjustPosition(db);
+ //System.out.println("Begining : " + adjustedPos);
+ returnLink = returnLink || ((adjustedPos >= 0) && (adjustedPos <= db.getNumberRows()));
+
+ buff.append(paramName).append('=').append(adjustedPos).append('&');
+ }
+ else if (paramName.indexOf("_Reset") != -1) {
+ buff.append(paramName).append("=false").append('&');
+ }
+ else {*/
+ if ((ignore != null ? ! ignore.contains(param) : true) && paramName.indexOf("_Reset") == -1 && paramName.indexOf("_FirstRecord") == -1 && paramName.indexOf("_Reset") == -1) {
+ buff.append("<INPUT TYPE=\"HIDDEN\" NAME=\"").append(paramName).append("\" VALUE=\"").append(URLEncoder.encode(param)).append("\">\n");
+ }
+ }
+
+
+ buff.deleteCharAt(buff.length()-1);
+ //buff.append("\">").append(text).append("</a>");
+ return buff.toString();
+
+
+ }
+
+
}
|
|
From: Marc B. <big...@us...> - 2003-03-26 21:42:08
|
Update of /cvsroot/idrs/Idrs/dev/xml In directory sc8-pr-cvs1:/tmp/cvs-serv3599/dev/xml Modified Files: rmlTrans.xml web.xml Log Message: refactored navigation tags, also added a <navcur> tag that generates a link that will kepp a page it it's current state, minus any specified parameters. Index: rmlTrans.xml =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/xml/rmlTrans.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** rmlTrans.xml 22 Nov 2002 07:16:41 -0000 1.9 --- rmlTrans.xml 26 Mar 2003 21:41:57 -0000 1.10 *************** *** 1,4 **** <?xml version="1.0" encoding="UTF-8"?> ! <trans:rmlTrans xmlns:trans="rmlTransSchema.xml"> <!-- define valid rml tags --> <trans:rml simple="true" ownLine="true" >rml</trans:rml> --- 1,4 ---- <?xml version="1.0" encoding="UTF-8"?> ! <trans:rmlTrans > <!-- define valid rml tags --> <trans:rml simple="true" ownLine="true" >rml</trans:rml> *************** *** 40,43 **** --- 40,47 ---- <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> + <trans:rml simple="true" ownLine="false" parents="" represent="navPrev">navprev</trans:rml> + <trans:rml simple="true" ownLine="false" parents="" represent="navNext" >navnext</trans:rml> + <trans:rml simple="true" ownLine="false" parents="" represent="pageSize">pagesize</trans:rml> + <trans:rml simple="true" ownLine="false" parents="" represent="navCur">navCur</trans:rml> <!-- text tag --> Index: web.xml =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/xml/web.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** web.xml 23 Aug 2002 00:48:02 -0000 1.1 --- web.xml 26 Mar 2003 21:41:58 -0000 1.2 *************** *** 1,440 **** ! <!DOCTYPE web-app ! PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" ! "http://java.sun.com/dtd/web-app_2_3.dtd"> ! ! <web-app> ! <servlet> ! <servlet-name>idrs</servlet-name> ! <servlet-class>net.sourceforge.idrs.core.servlet.IDRSServlet</servlet-class> ! ! <!-- The following three parameters define what pooling system to use --> ! <init-param> ! <param-name>reportPool</param-name> ! <param-value>net.sourceforge.idrs.pool.IDRSRepPool</param-value> ! </init-param> ! ! <init-param> ! <param-name>scriptPool</param-name> ! <param-value>net.sourceforge.idrs.pool.ScriptContextPool</param-value> ! </init-param> ! ! ! <init-param> ! <param-name>dbPool</param-name> ! <param-value>net.sourceforge.idrs.pool.JDBCPool</param-value> ! </init-param> ! ! ! ! <!-- Where errrors will be logged to --> ! <init-param> ! <param-name>errorLog</param-name> ! <param-value>/var/log/servlet/error.log</param-value> ! </init-param> ! ! <!-- Each RML page will have it's own log file, this is where those logs are stored --> ! <init-param> ! <param-name>reportLogPath</param-name> ! <param-value>/var/log/servlet</param-value> ! </init-param> ! ! <!-- This is the class that is used for embeded scripting. ! This class must implement ! net.sourceforge.idrs.script.embedable.IDRSScriptLanguage --> ! <init-param> ! <param-name>scriptClass</param-name> ! <param-value>net.sourceforge.idrs.script.embedable.IDRSBeanShell</param-value> ! </init-param> ! ! <!-- Minimum Number of Script Conetexts --> ! <init-param> ! <param-name>minReports</param-name> ! <param-value>5</param-value> ! </init-param> ! ! <!-- Maximum number of script contexts --> ! <init-param> ! <param-name>maxReports</param-name> ! <param-value>100</param-value> ! </init-param> ! ! ! <!-- Maximum number of days a context is open before it is re-set --> ! <init-param> ! <param-name>daysReportsOpen</param-name> ! <param-value>7</param-value> ! </init-param> ! ! <!-- The page that will be displayed when a user is denied access to an RML page --> ! <init-param> ! <param-name>accessDeniedPage</param-name> ! <param-value>denied.html</param-value> ! </init-param> ! ! <!-- The page that will be displayed when an Exception occurrs --> ! <init-param> ! <param-name>errorPage</param-name> ! <param-value>error.jsp</param-value> ! </init-param> ! ! <!-- This is the number of variables used in the app. ! These variables are accessale through the Application object --> ! <init-param> ! <param-name>numVars</param-name> ! <param-value>2</param-value> ! </init-param> ! ! <!-- These variables will be used in various tutorials --> ! <init-param> ! <param-name>varName1</param-name> ! <param-value>companyOwnerl</param-value> ! </init-param> ! <init-param> ! <param-name>varVal1</param-name> ! <param-value>Jennifer Jennens</param-value> ! </init-param> ! ! <init-param> ! <param-name>varName2</param-name> ! <param-value>sysAdmin</param-value> ! </init-param> ! <init-param> ! <param-name>varVal2</param-name> ! <param-value>Mack Border</param-value> ! </init-param> ! ! <!-- This the physical directory of the IDRS' web application --> ! <init-param> ! <param-name>contextPath</param-name> ! <param-value>/usr/local/tomcat/webapps/idrs</param-value> ! </init-param> ! ! <!-- This is where you can define any number of database connections. First give numDBs the value of how many connections there are, and then ! repeat the dbDriver,dbName,dbAlias,dbUser,dbPass,minConns, maxConns, logPath and daysOpen with the current db number appended to the ! name. For example, if I was connecting to another MySQL database named "idrs2" I would use the following setup ! . ! . ! . ! <init-param> ! <param-name>dbName1</param-name> ! <param-value>jdbc:mysql://localhost/idrs2</param-value> ! </init-param> ! . ! . ! . ! ! Repeat this process for every connection needed. ! --> ! <init-param> ! <param-name>numDBs</param-name> ! <param-value>3</param-value> ! </init-param> ! ! <!-- The name of the class for the driver --> ! <init-param> ! <param-name>dbDriver1</param-name> ! <param-value>org.gjt.mm.mysql.Driver</param-value> ! </init-param> ! ! <!-- The URL for the database --> ! <init-param> ! <param-name>dbName1</param-name> ! <param-value>jdbc:mysql://localhost/idrs_auth</param-value> ! </init-param> ! ! <!-- Username for the database --> ! <init-param> ! <param-name>dbUser1</param-name> ! <param-value>root</param-value> ! </init-param> ! ! <!-- Password for teh database --> ! <init-param> ! <param-name>dbPass1</param-name> ! <param-value></param-value> ! </init-param> ! ! <!-- The name of the database connection inside of RML pages --> ! <init-param> ! <param-name>dbAlias1</param-name> ! <param-value>idrs-auth</param-value> ! </init-param> ! ! <!-- Minimum number of connections --> ! <init-param> ! <param-name>minConns1</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- Maximum number of connections --> ! <init-param> ! <param-name>maxConns1</param-name> ! <param-value>15</param-value> ! </init-param> ! ! <!-- Where the log file for this Database connection is --> ! <init-param> ! <param-name>logPath1</param-name> ! <param-value>/var/log/servlet/idrs-auth</param-value> ! </init-param> ! ! <!-- Number of days the connection will remain open before being reset --> ! <init-param> ! <param-name>daysOpen1</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- If your database forces all column names to lower case (Postgres) , this is nessassary --> ! <init-param> ! <param-name>toLower1</param-name> ! <param-value>false</param-value> ! </init-param> ! ! <!-- The name of the class for the driver --> ! <init-param> ! <param-name>dbDriver2</param-name> ! <param-value>org.gjt.mm.mysql.Driver</param-value> ! </init-param> ! ! <!-- The URL for the database --> ! <init-param> ! <param-name>dbName2</param-name> ! <param-value>jdbc:mysql://localhost/idrs_docs</param-value> ! </init-param> ! ! <!-- Username for the database --> ! <init-param> ! <param-name>dbUser2</param-name> ! <param-value>root</param-value> ! </init-param> ! ! <!-- Password for teh database --> ! <init-param> ! <param-name>dbPass2</param-name> ! <param-value></param-value> ! </init-param> ! ! <!-- The name of the database connection inside of RML pages --> ! <init-param> ! <param-name>dbAlias2</param-name> ! <param-value>idrs-docs</param-value> ! </init-param> ! ! <!-- Minimum number of connections --> ! <init-param> ! <param-name>minConns2</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- Maximum number of connections --> ! <init-param> ! <param-name>maxConns2</param-name> ! <param-value>15</param-value> ! </init-param> ! ! <!-- Where the log file for this Database connection is --> ! <init-param> ! <param-name>logPath2</param-name> ! <param-value>/var/log/servlet/idrs-docs</param-value> ! </init-param> ! ! <!-- Number of days the connection will remain open before being reset --> ! <init-param> ! <param-name>daysOpen2</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- If your database forces all column names to lower case (Postgres) , this is nessassary --> ! <init-param> ! <param-name>toLower2</param-name> ! <param-value>false</param-value> ! </init-param> ! ! <!-- The name of the class for the driver --> ! <init-param> ! <param-name>dbDriver3</param-name> ! <param-value>org.gjt.mm.mysql.Driver</param-value> ! </init-param> ! ! <!-- The URL for the database --> ! <init-param> ! <param-name>dbName3</param-name> ! <param-value>jdbc:mysql://localhost/idrs_test</param-value> ! </init-param> ! ! <!-- Username for the database --> ! <init-param> ! <param-name>dbUser3</param-name> ! <param-value>root</param-value> ! </init-param> ! ! <!-- Password for teh database --> ! <init-param> ! <param-name>dbPass3</param-name> ! <param-value></param-value> ! </init-param> ! ! <!-- The name of the database connection inside of RML pages --> ! <init-param> ! <param-name>dbAlias3</param-name> ! <param-value>idrs-test</param-value> ! </init-param> ! ! <!-- Minimum number of connections --> ! <init-param> ! <param-name>minConns3</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- Maximum number of connections --> ! <init-param> ! <param-name>maxConns3</param-name> ! <param-value>15</param-value> ! </init-param> ! ! <!-- Where the log file for this Database connection is --> ! <init-param> ! <param-name>logPath3</param-name> ! <param-value>/var/log/servlet/idrs-test</param-value> ! </init-param> ! ! <!-- Number of days the connection will remain open before being reset --> ! <init-param> ! <param-name>daysOpen3</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- If your database forces all column names to lower case (Postgres) , this is nessassary --> ! <init-param> ! <param-name>toLower3</param-name> ! <param-value>false</param-value> ! </init-param> ! ! <!-- Determines the connection defined above which will be used for storing the RML pages --> ! <init-param> ! <param-name>docDB</param-name> ! <param-value>idrs-docs</param-value> ! </init-param> ! ! <!-- Determines which connection will be used for authentication --> ! <init-param> ! <param-name>authDB</param-name> ! <param-value>idrs-auth</param-value> ! </init-param> ! ! ! <!-- Tells the IDRS what port to listen to for reset requests --> ! <init-param> ! <param-name>resetPort</param-name> ! <param-value>8888</param-value> ! </init-param> ! ! <!-- The IDRS allows for reset request to come from only one host, ! This host must be either a host name or an IP address --> ! <init-param> ! <param-name>resetAllowedHost</param-name> ! <param-value>127.0.0.1</param-value> ! </init-param> ! </servlet> ! ! <servlet> ! <servlet-name>idrsDeploy</servlet-name> ! <servlet-class>net.sourceforge.idrs.deploy.HotDeploy</servlet-class> ! ! <!-- The number of servers that need to be reset --> ! <init-param> ! <param-name>numServers</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- Each server should be defined with a server tag and the number of the server. Note ! that each server must accept reset requests from the app's host --> ! <init-param> ! <param-name>server1</param-name> ! <param-value>127.0.0.1</param-value> ! </init-param> ! ! <!-- This tells the deployer what port the IDRS servers are listening to for reset requests --> ! <init-param> ! <param-name>port</param-name> ! <param-value>8888</param-value> ! </init-param> ! ! <!-- Where the log for the deployments is --> ! <init-param> ! <param-name>logPath</param-name> ! <param-value>/var/log/idrs/deploy.log</param-value> ! </init-param> ! ! <!-- The class of the database's driver --> ! <init-param> ! <param-name>dbClass</param-name> ! <param-value>org.gjt.mm.mysql.Driver</param-value> ! </init-param> ! ! <!-- The url of the database --> ! <init-param> ! <param-name>dbUrl</param-name> ! <param-value>jdbc:mysql://localhost/idrs_docs</param-value> ! </init-param> ! ! <!-- The User of the database --> ! <init-param> ! <param-name>dbUser</param-name> ! <param-value>root</param-value> ! </init-param> ! ! <!-- Password for database --> ! <init-param> ! <param-name>dbPass</param-name> ! <param-value></param-value> ! </init-param> ! ! <!-- Macro to XML Parsing Schema --> ! <init-param> ! <param-name>parseClass</param-name> ! <param-value>org.apache.xerces.parsers.SAXParser</param-value> ! </init-param> ! ! <!-- RML Schema --> ! <init-param> ! <param-name>schemaLocation</param-name> ! <param-value>/usr/local/tomcat/webapps/idrs/WEB-INF/rmlSchema.xml</param-value> ! </init-param> ! ! <!-- RML Transofrmation Schema --> ! <init-param> ! <param-name>rmlTrans</param-name> ! <param-value>/usr/local/tomcat/webapps/idrs/WEB-INF/rmlTrans.xml</param-value> ! </init-param> ! ! ! </servlet> ! ! ! <servlet-mapping> ! <servlet-name>idrs</servlet-name> ! <url-pattern>*.rml</url-pattern> ! </servlet-mapping> ! ! <servlet-mapping> ! <servlet-name>idrsDeploy</servlet-name> ! <url-pattern>/idrsDeploy</url-pattern> ! </servlet-mapping> ! ! <mime-mapping> ! <extension> ! rml ! </extension> ! <mime-type> ! text/plain ! </mime-type> ! </mime-mapping> ! ! ! ! ! ! ! </web-app> --- 1,440 ---- ! <!DOCTYPE web-app ! PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" ! "http://java.sun.com/dtd/web-app_2_3.dtd"> ! ! <web-app> ! <servlet> ! <servlet-name>idrs</servlet-name> ! <servlet-class>net.sourceforge.idrs.core.servlet.IDRSServlet</servlet-class> ! ! <!-- The following three parameters define what pooling system to use --> ! <init-param> ! <param-name>reportPool</param-name> ! <param-value>net.sourceforge.idrs.pool.IDRSRepPool</param-value> ! </init-param> ! ! <init-param> ! <param-name>scriptPool</param-name> ! <param-value>net.sourceforge.idrs.pool.ScriptContextPool</param-value> ! </init-param> ! ! ! <init-param> ! <param-name>dbPool</param-name> ! <param-value>net.sourceforge.idrs.pool.JDBCPool</param-value> ! </init-param> ! ! ! ! <!-- Where errrors will be logged to --> ! <init-param> ! <param-name>errorLog</param-name> ! <param-value>/var/log/servlet/error.log</param-value> ! </init-param> ! ! <!-- Each RML page will have it's own log file, this is where those logs are stored --> ! <init-param> ! <param-name>reportLogPath</param-name> ! <param-value>/var/log/servlet</param-value> ! </init-param> ! ! <!-- This is the class that is used for embeded scripting. ! This class must implement ! net.sourceforge.idrs.script.embedable.IDRSScriptLanguage --> ! <init-param> ! <param-name>scriptClass</param-name> ! <param-value>net.sourceforge.idrs.script.embedable.IDRSBeanShell</param-value> ! </init-param> ! ! <!-- Minimum Number of Script Conetexts --> ! <init-param> ! <param-name>minReports</param-name> ! <param-value>5</param-value> ! </init-param> ! ! <!-- Maximum number of script contexts --> ! <init-param> ! <param-name>maxReports</param-name> ! <param-value>100</param-value> ! </init-param> ! ! ! <!-- Maximum number of days a context is open before it is re-set --> ! <init-param> ! <param-name>daysReportsOpen</param-name> ! <param-value>7</param-value> ! </init-param> ! ! <!-- The page that will be displayed when a user is denied access to an RML page --> ! <init-param> ! <param-name>accessDeniedPage</param-name> ! <param-value>denied.html</param-value> ! </init-param> ! ! <!-- The page that will be displayed when an Exception occurrs --> ! <init-param> ! <param-name>errorPage</param-name> ! <param-value>error.jsp</param-value> ! </init-param> ! ! <!-- This is the number of variables used in the app. ! These variables are accessale through the Application object --> ! <init-param> ! <param-name>numVars</param-name> ! <param-value>2</param-value> ! </init-param> ! ! <!-- These variables will be used in various tutorials --> ! <init-param> ! <param-name>varName1</param-name> ! <param-value>companyOwnerl</param-value> ! </init-param> ! <init-param> ! <param-name>varVal1</param-name> ! <param-value>Jennifer Jennens</param-value> ! </init-param> ! ! <init-param> ! <param-name>varName2</param-name> ! <param-value>sysAdmin</param-value> ! </init-param> ! <init-param> ! <param-name>varVal2</param-name> ! <param-value>Mack Border</param-value> ! </init-param> ! ! <!-- This the physical directory of the IDRS' web application --> ! <init-param> ! <param-name>contextPath</param-name> ! <param-value>/usr/local/tomcat/webapps/idrs</param-value> ! </init-param> ! ! <!-- This is where you can define any number of database connections. First give numDBs the value of how many connections there are, and then ! repeat the dbDriver,dbName,dbAlias,dbUser,dbPass,minConns, maxConns, logPath and daysOpen with the current db number appended to the ! name. For example, if I was connecting to another MySQL database named "idrs2" I would use the following setup ! . ! . ! . ! <init-param> ! <param-name>dbName1</param-name> ! <param-value>jdbc:mysql://localhost/idrs2</param-value> ! </init-param> ! . ! . ! . ! ! Repeat this process for every connection needed. ! --> ! <init-param> ! <param-name>numDBs</param-name> ! <param-value>3</param-value> ! </init-param> ! ! <!-- The name of the class for the driver --> ! <init-param> ! <param-name>dbDriver1</param-name> ! <param-value>org.gjt.mm.mysql.Driver</param-value> ! </init-param> ! ! <!-- The URL for the database --> ! <init-param> ! <param-name>dbName1</param-name> ! <param-value>jdbc:mysql://localhost/idrs_auth</param-value> ! </init-param> ! ! <!-- Username for the database --> ! <init-param> ! <param-name>dbUser1</param-name> ! <param-value>root</param-value> ! </init-param> ! ! <!-- Password for teh database --> ! <init-param> ! <param-name>dbPass1</param-name> ! <param-value></param-value> ! </init-param> ! ! <!-- The name of the database connection inside of RML pages --> ! <init-param> ! <param-name>dbAlias1</param-name> ! <param-value>idrs-auth</param-value> ! </init-param> ! ! <!-- Minimum number of connections --> ! <init-param> ! <param-name>minConns1</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- Maximum number of connections --> ! <init-param> ! <param-name>maxConns1</param-name> ! <param-value>15</param-value> ! </init-param> ! ! <!-- Where the log file for this Database connection is --> ! <init-param> ! <param-name>logPath1</param-name> ! <param-value>/var/log/servlet/idrs-auth</param-value> ! </init-param> ! ! <!-- Number of days the connection will remain open before being reset --> ! <init-param> ! <param-name>daysOpen1</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- If your database forces all column names to lower case (Postgres) , this is nessassary --> ! <init-param> ! <param-name>toLower1</param-name> ! <param-value>false</param-value> ! </init-param> ! ! <!-- The name of the class for the driver --> ! <init-param> ! <param-name>dbDriver2</param-name> ! <param-value>org.gjt.mm.mysql.Driver</param-value> ! </init-param> ! ! <!-- The URL for the database --> ! <init-param> ! <param-name>dbName2</param-name> ! <param-value>jdbc:mysql://localhost/idrs_docs</param-value> ! </init-param> ! ! <!-- Username for the database --> ! <init-param> ! <param-name>dbUser2</param-name> ! <param-value>root</param-value> ! </init-param> ! ! <!-- Password for teh database --> ! <init-param> ! <param-name>dbPass2</param-name> ! <param-value></param-value> ! </init-param> ! ! <!-- The name of the database connection inside of RML pages --> ! <init-param> ! <param-name>dbAlias2</param-name> ! <param-value>idrs-docs</param-value> ! </init-param> ! ! <!-- Minimum number of connections --> ! <init-param> ! <param-name>minConns2</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- Maximum number of connections --> ! <init-param> ! <param-name>maxConns2</param-name> ! <param-value>15</param-value> ! </init-param> ! ! <!-- Where the log file for this Database connection is --> ! <init-param> ! <param-name>logPath2</param-name> ! <param-value>/var/log/servlet/idrs-docs</param-value> ! </init-param> ! ! <!-- Number of days the connection will remain open before being reset --> ! <init-param> ! <param-name>daysOpen2</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- If your database forces all column names to lower case (Postgres) , this is nessassary --> ! <init-param> ! <param-name>toLower2</param-name> ! <param-value>false</param-value> ! </init-param> ! ! <!-- The name of the class for the driver --> ! <init-param> ! <param-name>dbDriver3</param-name> ! <param-value>org.gjt.mm.mysql.Driver</param-value> ! </init-param> ! ! <!-- The URL for the database --> ! <init-param> ! <param-name>dbName3</param-name> ! <param-value>jdbc:mysql://localhost/idrs_test</param-value> ! </init-param> ! ! <!-- Username for the database --> ! <init-param> ! <param-name>dbUser3</param-name> ! <param-value>root</param-value> ! </init-param> ! ! <!-- Password for teh database --> ! <init-param> ! <param-name>dbPass3</param-name> ! <param-value></param-value> ! </init-param> ! ! <!-- The name of the database connection inside of RML pages --> ! <init-param> ! <param-name>dbAlias3</param-name> ! <param-value>idrs-test</param-value> ! </init-param> ! ! <!-- Minimum number of connections --> ! <init-param> ! <param-name>minConns3</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- Maximum number of connections --> ! <init-param> ! <param-name>maxConns3</param-name> ! <param-value>15</param-value> ! </init-param> ! ! <!-- Where the log file for this Database connection is --> ! <init-param> ! <param-name>logPath3</param-name> ! <param-value>/var/log/servlet/idrs-test</param-value> ! </init-param> ! ! <!-- Number of days the connection will remain open before being reset --> ! <init-param> ! <param-name>daysOpen3</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- If your database forces all column names to lower case (Postgres) , this is nessassary --> ! <init-param> ! <param-name>toLower3</param-name> ! <param-value>false</param-value> ! </init-param> ! ! <!-- Determines the connection defined above which will be used for storing the RML pages --> ! <init-param> ! <param-name>docDB</param-name> ! <param-value>idrs-docs</param-value> ! </init-param> ! ! <!-- Determines which connection will be used for authentication --> ! <init-param> ! <param-name>authDB</param-name> ! <param-value>idrs-auth</param-value> ! </init-param> ! ! ! <!-- Tells the IDRS what port to listen to for reset requests --> ! <init-param> ! <param-name>resetPort</param-name> ! <param-value>8888</param-value> ! </init-param> ! ! <!-- The IDRS allows for reset request to come from only one host, ! This host must be either a host name or an IP address --> ! <init-param> ! <param-name>resetAllowedHost</param-name> ! <param-value>127.0.0.1</param-value> ! </init-param> ! </servlet> ! ! <servlet> ! <servlet-name>idrsDeploy</servlet-name> ! <servlet-class>net.sourceforge.idrs.deploy.HotDeploy</servlet-class> ! ! <!-- The number of servers that need to be reset --> ! <init-param> ! <param-name>numServers</param-name> ! <param-value>1</param-value> ! </init-param> ! ! <!-- Each server should be defined with a server tag and the number of the server. Note ! that each server must accept reset requests from the app's host --> ! <init-param> ! <param-name>server1</param-name> ! <param-value>127.0.0.1</param-value> ! </init-param> ! ! <!-- This tells the deployer what port the IDRS servers are listening to for reset requests --> ! <init-param> ! <param-name>port</param-name> ! <param-value>8888</param-value> ! </init-param> ! ! <!-- Where the log for the deployments is --> ! <init-param> ! <param-name>logPath</param-name> ! <param-value>/var/log/idrs/deploy.log</param-value> ! </init-param> ! ! <!-- The class of the database's driver --> ! <init-param> ! <param-name>dbClass</param-name> ! <param-value>org.gjt.mm.mysql.Driver</param-value> ! </init-param> ! ! <!-- The url of the database --> ! <init-param> ! <param-name>dbUrl</param-name> ! <param-value>jdbc:mysql://localhost/idrs_docs</param-value> ! </init-param> ! ! <!-- The User of the database --> ! <init-param> ! <param-name>dbUser</param-name> ! <param-value>root</param-value> ! </init-param> ! ! <!-- Password for database --> ! <init-param> ! <param-name>dbPass</param-name> ! <param-value></param-value> ! </init-param> ! ! <!-- Macro to XML Parsing Schema --> ! <init-param> ! <param-name>parseClass</param-name> ! <param-value>org.apache.xerces.parsers.SAXParser</param-value> ! </init-param> ! ! <!-- RML Schema --> ! <init-param> ! <param-name>schemaLocation</param-name> ! <param-value>/usr/local/tomcat/webapps/idrs/WEB-INF/rmlSchema.xml</param-value> ! </init-param> ! ! <!-- RML Transofrmation Schema --> ! <init-param> ! <param-name>rmlTrans</param-name> ! <param-value>/usr/local/tomcat/webapps/idrs/WEB-INF/rmlTrans.xml</param-value> ! </init-param> ! ! ! </servlet> ! ! ! <servlet-mapping> ! <servlet-name>idrs</servlet-name> ! <url-pattern>*.rml</url-pattern> ! </servlet-mapping> ! ! <servlet-mapping> ! <servlet-name>idrsDeploy</servlet-name> ! <url-pattern>/idrsDeploy</url-pattern> ! </servlet-mapping> ! ! <mime-mapping> ! <extension> ! rml ! </extension> ! <mime-type> ! text/plain ! </mime-type> ! </mime-mapping> ! ! ! ! ! ! ! </web-app> |
|
From: Marc B. <big...@us...> - 2003-03-26 21:33:46
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jndi
In directory sc8-pr-cvs1:/tmp/cvs-serv31636/dev/src/net/sourceforge/idrs/jndi
Modified Files:
JndiConnection.java
Log Message:
refactored navigation tags, also added a <navcur> tag that generates a link that will kepp a page it it's current state, minus any specified parameters.
Index: JndiConnection.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jndi/JndiConnection.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** JndiConnection.java 17 Mar 2003 14:05:02 -0000 1.1
--- JndiConnection.java 26 Mar 2003 21:33:12 -0000 1.2
***************
*** 13,16 ****
--- 13,21 ----
import java.util.*;
import net.sourceforge.idrs.exceptions.*;
+ import javax.ejb.*;
+ import javax.rmi.*;
+ import java.lang.reflect.*;
+ import javax.servlet.*;
+ import javax.servlet.http.*;
/**
***************
*** 19,33 ****
*/
public class JndiConnection implements java.sql.Connection {
/** JNDI connection */
Context con;
/**Stores properties for initialization */
- Hashtable env;
/**
*Returns the context used to connect
*/
public Context getContext() {
return this.con;
}
--- 24,48 ----
*/
public class JndiConnection implements java.sql.Connection {
+ public static final String IDRS_STATEFULL_EJB = "IDRS_STATEFULL_EJB";
+ public static final String IDRS_USER_CONTEXT = "IDRS_USER_CONTEXT";
+
+
+
+ HashMap homes;
+ HashMap stateless;
+
/** JNDI connection */
Context con;
/**Stores properties for initialization */
+
+
/**
*Returns the context used to connect
*/
public Context getContext() {
+
return this.con;
}
***************
*** 42,47 ****
--- 57,68 ----
*/
public JndiConnection(String url, Properties props) throws SQLException {
+ homes = new HashMap();
+ stateless = new HashMap();
+
+
props.put(Context.PROVIDER_URL,url);
+
+
try {
//System.out.println("gonna create");
***************
*** 67,72 ****
}
!
--- 88,174 ----
}
+
+ private EJBObject lookup(String name, String home, String remote, boolean stateless) throws Exception {
+ Object obj = con.lookup(name);
+
+ EJBHome hm = (EJBHome) PortableRemoteObject.narrow(obj,Class.forName(home));
+ homes.put(home,hm);
+
+ return lookup(home,hm,name,stateless);
+
+ }
+
+ private EJBObject lookup(String home, EJBHome hm,String name,boolean stateless) throws Exception {
+ EJBObject ejb;
+
+ Method create = Class.forName(home).getMethod("create",new Class[] {});
+ ejb = (EJBObject) create.invoke(hm,new Object[] {});
+ if (stateless) {
+ this.stateless.put(name,ejb);
+ }
+
+ return ejb;
+ }
! public EJBObject getEJB(String name, String home, String remote, boolean stateless,HttpSession session) throws Exception {
!
! EJBObject ejb;
! EJBHome homeInt;
! Handle handle;
! HashMap statefull;
!
! Context ctx = this.con;
!
! if (stateless) {
! ejb = (EJBObject) this.stateless.get(name);
!
! if (ejb != null) return ejb;
!
! homeInt = (EJBHome) this.homes.get(home);
!
! if (homeInt != null) return lookup(name,home,remote,stateless);
!
! Object obj = ctx.lookup(name);
! homeInt = (EJBHome) PortableRemoteObject.narrow(obj,Class.forName(home));
!
!
! return lookup(home,homeInt,name,stateless);
!
! }
! else {
! ejb = null;
! statefull = (HashMap) session.getAttribute(JndiConnection.IDRS_STATEFULL_EJB);
! if (statefull == null) {
! statefull = new HashMap();
! session.setAttribute(JndiConnection.IDRS_STATEFULL_EJB,statefull);
! }
!
! ejb = (EJBObject) statefull.get(name);
!
! if (ejb != null) return ejb;
!
! homeInt = (EJBHome) this.homes.get(home);
!
! if (homeInt != null) {
! return lookup(name,home,remote,stateless);
! }
!
! Object obj = ctx.lookup(name);
! homeInt = (EJBHome) PortableRemoteObject.narrow(obj,Class.forName(home));
!
! return lookup(home,homeInt,name,stateless);
! }
!
!
!
!
! /*Object obj = ctx.lookup(name);
!
! EJBHome hm = (EJBHome) PortableRemoteObject.narrow(obj,Class.forName(home));
!
! Method create = Class.forName(home).getMethod("create",new Class[] {});
! return (EJBObject) create.invoke(hm,new Object[] {});*/
!
! }
|
|
From: Marc B. <big...@us...> - 2003-03-26 21:33:45
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils
In directory sc8-pr-cvs1:/tmp/cvs-serv31636/dev/src/net/sourceforge/idrs/utils
Modified Files:
DB.java
Log Message:
refactored navigation tags, also added a <navcur> tag that generates a link that will kepp a page it it's current state, minus any specified parameters.
Index: DB.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/DB.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** DB.java 17 Mar 2003 14:05:00 -0000 1.14
--- DB.java 26 Mar 2003 21:33:11 -0000 1.15
***************
*** 794,798 ****
System.out.println("is cached? : " + this.wasCached);
! if (! this.wasCached ) {
System.out.println("in here");
if (! idrs.isError()) {
--- 794,798 ----
System.out.println("is cached? : " + this.wasCached);
! if (! this.wasCached || caches.get(this.name) == null) {
System.out.println("in here");
if (! idrs.isError()) {
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report
In directory sc8-pr-cvs1:/tmp/cvs-serv31636/dev/src/net/sourceforge/idrs/core/report
Modified Files:
GenTag.java NavigateChunk.java IDRSHead.java NavPrevChunk.java
YesNo.java NavNextChunk.java
Added Files:
NavCurChunk.java
Log Message:
refactored navigation tags, also added a <navcur> tag that generates a link that will kepp a page it it's current state, minus any specified parameters.
--- NEW FILE: NavCurChunk.java ---
/*
NavNextChunk.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.*;
import java.util.*;
import java.net.*;
import net.sourceforge.idrs.utils.*;
import javax.servlet.http.*;
/**
Encapsulates any plain text found in an RML page
*/
public final class NavCurChunk extends NavigateChunk {
LinkedList ignore;
public NavCurChunk(String signore) {
super("");
ignore = new LinkedList();
StringTokenizer tok = new StringTokenizer(signore,",",false);
while (tok.hasMoreTokens()) {
ignore.add(tok.nextToken());
}
}
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();
//}
//else {
//return currPos;
// }
}
public String toString(IDRSHead head) throws Exception {
String params = super.toString(head,ignore);
return params;
}
}
Index: GenTag.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/GenTag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** GenTag.java 17 Mar 2003 14:04:53 -0000 1.5
--- GenTag.java 26 Mar 2003 21:33:05 -0000 1.6
***************
*** 215,218 ****
--- 215,283 ----
}
}
+
+ /**
+ *Retrieves a value based on what the source is
+ *@param head IDRS
+ *@param name Name of tag
+ *@return value of tag
+ */
+ protected boolean getValueBoolInt(IDRSHead head,String name) throws Exception {
+ String sval;
+ String db,field;
+ switch (srcType) {
+ case SRC_PARAM : return (sval = head.getRequest().getParameter(src)) != null ? Integer.parseInt(sval) == 1 : false;
+ case SRC_DB : return getValDBBoolInt(head,name);
+ case SRC_PROP : return getValObjBoolInt(head,name);
+ default : return false;
+ }
+ }
+
+ /**
+ *Retrieves a value based on what the source is
+ *@param head IDRS
+ *@param name Name of tag
+ *@return value of tag
+ */
+ protected boolean getValDBBoolInt(IDRSHead head,String name) throws Exception {
+ String sval;
+
+ if (this.paramFirst) {
+ sval = head.getRequest().getParameter(name);
+ if (sval == null) {
+ System.out.println(owner +"." + src + " is " + head.getFieldData(owner,src));
+ return (sval = head.getFieldData(owner,src)) != null ? sval.equals("1") : false;
+ }
+ else {
+ return sval.equalsIgnoreCase("1");
+ }
+ }
+ else {
+ System.out.println(owner +"." + src + " is " + head.getFieldData(owner,src));
+ return (sval = head.getFieldData(owner,src)) != null ? sval.equals("1") : false;
+ }
+ }
+
+ /**
+ *Retrieves a value based on what the source is
+ *@param head IDRS
+ *@param name Name of tag
+ *@return value of tag
+ */
+ protected boolean getValObjBoolInt(IDRSHead head, String name) throws Exception {
+ String sval;
+
+ if (this.paramFirst) {
+ sval = head.getRequest().getParameter(name);
+ if (sval == null) {
+ return ((Integer) getPropData(head)).intValue() == 1;
+ }
+ else {
+ return Integer.parseInt(sval) == 1;
+ }
+ }
+ else {
+ return ((Integer) getPropData(head)).intValue() == 1;
+ }
+ }
}
Index: NavigateChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavigateChunk.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** NavigateChunk.java 6 Feb 2003 20:13:45 -0000 1.4
--- NavigateChunk.java 26 Mar 2003 21:33:06 -0000 1.5
***************
*** 24,29 ****
--- 24,32 ----
*/
public abstract class NavigateChunk implements Chunk, Serializable {
+ static final long serialVersionUID = -1693089616757294522L;
String text;
StringBuffer buff;
+
+
/**
Initializes the Chunk
***************
*** 41,45 ****
--- 44,53 ----
@param head IDRSHead for report
*/
+
public String toString(IDRSHead head) throws Exception {
+ return toString(head,null);
+ }
+
+ public String toString(IDRSHead head,LinkedList ignore) throws Exception {
buff.setLength(0);
***************
*** 50,54 ****
HttpServletRequest request = head.getRequest();;
//loop through all parameters
! buff.append("<a href=\"").append(request.getRequestURI()).append('?');
paramNames = request.getParameterNames();
DB db;
--- 58,62 ----
HttpServletRequest request = head.getRequest();;
//loop through all parameters
!
paramNames = request.getParameterNames();
DB db;
***************
*** 57,60 ****
--- 65,85 ----
int adjustedPos;
+ Iterator it = head.dbs.keySet().iterator();
+ while (it.hasNext()) {
+ db = (DB) head.dbs.get(it.next());
+ if (db.getIsPaged()) {
+ buff.append(db.getID()).append("_Reset=false").append('&');
+ buff.append(db.getID()).append("_PageSize=").append(db.getNumRecs()).append('&');
+
+ adjustedPos = adjustPosition(db);
+ //System.out.println("Begining : " + adjustedPos);
+ returnLink = returnLink || ((adjustedPos >= 0) && (adjustedPos <= db.getNumberRows()));
+
+ buff.append(db.getID()).append("_FirstRecord=").append(adjustedPos).append('&');
+ }
+ }
+
+
+
while (paramNames.hasMoreElements()) {
paramName = (String) paramNames.nextElement();
***************
*** 63,67 ****
! if (paramName.indexOf("_FirstRecord") != -1) {
db = head.getDB(paramName.substring(0,paramName.indexOf("_")));
--- 88,92 ----
! /*if (paramName.indexOf("_FirstRecord") != -1) {
db = head.getDB(paramName.substring(0,paramName.indexOf("_")));
***************
*** 75,79 ****
buff.append(paramName).append("=false").append('&');
}
! else {
buff.append(paramName).append('=').append(URLEncoder.encode(param)).append('&');
}
--- 100,105 ----
buff.append(paramName).append("=false").append('&');
}
! else {*/
! if ((ignore != null ? ! ignore.contains(param) : true) && paramName.indexOf("_Reset") == -1 && paramName.indexOf("_FirstRecord") == -1 && paramName.indexOf("_Reset") == -1) {
buff.append(paramName).append('=').append(URLEncoder.encode(param)).append('&');
}
***************
*** 82,86 ****
if (returnLink) {
buff.deleteCharAt(buff.length()-1);
! buff.append("\">").append(text).append("</a>");
return buff.toString();
}
--- 108,112 ----
if (returnLink) {
buff.deleteCharAt(buff.length()-1);
! //buff.append("\">").append(text).append("</a>");
return buff.toString();
}
Index: IDRSHead.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSHead.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** IDRSHead.java 17 Mar 2003 14:04:53 -0000 1.15
--- IDRSHead.java 26 Mar 2003 21:33:06 -0000 1.16
***************
*** 668,672 ****
public void createError(String err) {
! //System.out.println("Error 1: " + err);
request.setAttribute(ERR_NAME,err);
// System.out.println("Error 2: " + request.getAttribute(ERR_NAME));
--- 668,672 ----
public void createError(String err) {
! System.out.println("Error 1: " + err);
request.setAttribute(ERR_NAME,err);
// System.out.println("Error 2: " + request.getAttribute(ERR_NAME));
***************
*** 741,756 ****
}
! public EJBObject getEJB(Connection con, String name, String home, String remote, boolean session) throws Exception {
if (! (con instanceof JndiConnection)) {
throw new Exception("A Connection Must Be an instance of JndiConnection");
}
! Context ctx = ((JndiConnection) con).getContext();
! Object obj = ctx.lookup(name);
!
! EJBHome hm = (EJBHome) PortableRemoteObject.narrow(obj,Class.forName(home));
- Method create = Class.forName(home).getMethod("create",new Class[] {});
- return (EJBObject) create.invoke(hm,new Object[] {});
}
--- 741,751 ----
}
! public EJBObject getEJB(Connection con, String name, String home, String remote, boolean stateless) throws Exception {
if (! (con instanceof JndiConnection)) {
throw new Exception("A Connection Must Be an instance of JndiConnection");
}
! return ((JndiConnection) con).getEJB(name,home,remote,stateless,this.session );
}
Index: NavPrevChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavPrevChunk.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NavPrevChunk.java 21 Sep 2002 16:13:03 -0000 1.2
--- NavPrevChunk.java 26 Mar 2003 21:33:08 -0000 1.3
***************
*** 24,28 ****
*/
public final class NavPrevChunk extends NavigateChunk {
!
public NavPrevChunk(String txt) {
super(txt);
--- 24,28 ----
*/
public final class NavPrevChunk extends NavigateChunk {
! static final long serialVersionUID = 5643589467069312474L;
public NavPrevChunk(String txt) {
super(txt);
***************
*** 33,36 ****
--- 33,49 ----
return db.getFirstRec() - db.getNumRecs();
+ }
+
+ public String toString(IDRSHead head) throws Exception {
+
+ String params = super.toString(head);
+ if (params.trim().length() != 0) {
+ StringBuffer buf = new StringBuffer();
+ buf.append("<a href=\"").append(head.getRequest().getRequestURI()).append('?').append(params).append("\">").append(super.text).append("</a>");
+ return buf.toString();
+ }
+ else {
+ return "";
+ }
}
}
Index: YesNo.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/YesNo.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** YesNo.java 13 Apr 2002 16:06:35 -0000 1.2
--- YesNo.java 26 Mar 2003 21:33:08 -0000 1.3
***************
*** 25,29 ****
public static final int SINGLE_YES=0;
public static final int SINGLE_NO=1;
!
--- 25,30 ----
public static final int SINGLE_YES=0;
public static final int SINGLE_NO=1;
! public static final int BOOL_TF = 0;
! public static final int BOOL_INT = 1;
***************
*** 31,34 ****
--- 32,36 ----
int single;
+ int boolType;
/** Creates new YesNo
***************
*** 40,45 ****
*@param paramFirst Determine if a paramater will be checked first
*/
! public YesNo(String name, int single, int srcType, String src,String atts,boolean paramFirst) {
super(name,srcType,src,atts,paramFirst);
this.single = single;
}
--- 42,48 ----
*@param paramFirst Determine if a paramater will be checked first
*/
! public YesNo(String name, int single, int srcType, String src,String atts,boolean paramFirst,int boolType) {
super(name,srcType,src,atts,paramFirst);
+ this.boolType = boolType;
this.single = single;
}
***************
*** 52,66 ****
public String toString(IDRSHead head) throws Exception {
StringBuffer tag = new StringBuffer();
!
String nm = nameIsScript ? head.getScriptContext().eval(name) : name;
! boolean yes = getValueBool(head,nm);
if (single == NOT_SINGLE || single == SINGLE_YES) {
! tag.append("<INPUT TYPE=\"RADIO\" VALUE=\"true\" NAME=\"").append(nm).append("\" ").append(yes ? "CHECKED" : "").append(atts).append("> Yes ");
}
!
if (single == NOT_SINGLE || single == SINGLE_NO) {
! tag.append("<INPUT TYPE=\"RADIO\" VALUE=\"false\" NAME=\"").append(nm).append("\" ").append(! yes ? "CHECKED" : "").append(atts).append("> No ");
}
!
return tag.toString();
}
--- 55,81 ----
public String toString(IDRSHead head) throws Exception {
StringBuffer tag = new StringBuffer();
!
String nm = nameIsScript ? head.getScriptContext().eval(name) : name;
!
! boolean yes;
!
! if (this.boolType == BOOL_TF) {
! yes = getValueBool(head,nm);
! }
! else {
! yes = getValueBoolInt(head,nm);
! }
!
! String trueVal = boolType == BOOL_INT ? "1" : "true";
! String falseVal = boolType == BOOL_INT ? "0" : "false";
!
if (single == NOT_SINGLE || single == SINGLE_YES) {
! tag.append("<INPUT TYPE=\"RADIO\" VALUE=\"" + trueVal + "\" NAME=\"").append(nm).append("\" ").append(yes ? "CHECKED" : "").append(atts).append("> Yes ");
}
!
if (single == NOT_SINGLE || single == SINGLE_NO) {
! tag.append("<INPUT TYPE=\"RADIO\" VALUE=\"" + falseVal + "\" NAME=\"").append(nm).append("\" ").append(! yes ? "CHECKED" : "").append(atts).append("> No ");
}
!
return tag.toString();
}
Index: NavNextChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/NavNextChunk.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NavNextChunk.java 21 Sep 2002 16:13:03 -0000 1.2
--- NavNextChunk.java 26 Mar 2003 21:33:09 -0000 1.3
***************
*** 24,28 ****
*/
public final class NavNextChunk extends NavigateChunk {
!
public NavNextChunk(String txt) {
super(txt);
--- 24,28 ----
*/
public final class NavNextChunk extends NavigateChunk {
! static final long serialVersionUID = -8801453410311825457L;
public NavNextChunk(String txt) {
super(txt);
***************
*** 43,46 ****
--- 43,59 ----
//return currPos;
// }
+ }
+
+ public String toString(IDRSHead head) throws Exception {
+
+ String params = super.toString(head);
+ if (params.trim().length() != 0) {
+ StringBuffer buf = new StringBuffer();
+ buf.append("<a href=\"").append(head.getRequest().getRequestURI()).append('?').append(params).append("\">").append(super.text).append("</a>");
+ return buf.toString();
+ }
+ else {
+ return "";
+ }
}
}
|
|
From: Marc B. <big...@us...> - 2003-03-26 21:33:44
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv31636/dev/src/net/sourceforge/idrs/core/servlet
Modified Files:
IdrsController.java
Log Message:
refactored navigation tags, also added a <navcur> tag that generates a link that will kepp a page it it's current state, minus any specified parameters.
Index: IdrsController.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IdrsController.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** IdrsController.java 17 Mar 2003 14:05:00 -0000 1.2
--- IdrsController.java 26 Mar 2003 21:33:09 -0000 1.3
***************
*** 62,66 ****
//loads all reports into the pooling system
! System.setOut(
new PrintStream(
new FileOutputStream(
--- 62,66 ----
//loads all reports into the pooling system
! /*System.setOut(
new PrintStream(
new FileOutputStream(
***************
*** 70,74 ****
new FileOutputStream(
new File("/usr/local/tomcat/logs/marc_err.txt"))));
! // System.out.println("in init");
init = new Init(svg);
--- 70,74 ----
new FileOutputStream(
new File("/usr/local/tomcat/logs/marc_err.txt"))));
! System.out.println("in init");*/
init = new Init(svg);
***************
*** 321,325 ****
}
} catch (Exception ignore) {
! dbCache.remove(db);
ignore.printStackTrace(System.out);
}
--- 321,327 ----
}
} catch (Exception ignore) {
! if (dbCache != null && dbCache.containsKey(db)) {
! dbCache.remove(db);
! }
ignore.printStackTrace(System.out);
}
|
|
From: Marc B. <big...@us...> - 2003-03-26 21:33:38
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units
In directory sc8-pr-cvs1:/tmp/cvs-serv31636/dev/src/net/sourceforge/idrs/deploy/compile/units
Modified Files:
Body.java
Log Message:
refactored navigation tags, also added a <navcur> tag that generates a link that will kepp a page it it's current state, minus any specified parameters.
Index: Body.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Body.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Body.java 17 Mar 2003 14:05:00 -0000 1.9
--- Body.java 26 Mar 2003 21:33:04 -0000 1.10
***************
*** 27,335 ****
public class Body extends net.sourceforge.idrs.deploy.compile.Compiler {
! /** Creates new Body */
! public Body() {
! }
! /**
! *allows for the compiler to work with the current state of the page compilation
! */
! public void setState(CompilerState state) throws Exception {
! super.setState(state);
! state.pushLines();
! }
! /**
! *allows for a compiler to use the attributes of the calling tag
! */
! public void setAttributes(Attributes atts) throws Exception {
! super.setAttributes(atts);
! String bodyTag;
! if (state.getReport().getBody().isHTML()) {
! Line line = state.getCurrentLine();
! //line.addChunk(new net.sourceforge.idrs.core.report.TextChunk("<BODY "));
! bodyTag="<BODY ";
! for (int i=0,m=atts.getLength();i<m;i++) {
! bodyTag += atts.getLocalName(i) + "=\"" + atts.getValue(i) + "\" ";
! }
! bodyTag += ">";
! System.out.println("Body tag : " + bodyTag);
! line.addChunk(new TextChunk(bodyTag));
! state.sealLine();
! }
! }
! public void useMethod(String val,Attributes atts) throws Exception {
! String objid = atts.getValue("objid");
! String varlistId = atts.getValue("varlist");
! LinkedList varList = (LinkedList) ((HashMap) state.getAttribute("IDRS_VAR_LISTS")).get(varlistId);
! Line curr = state.getCurrentLine();
! curr.addChunk(new ObjectChunk(val,varList.toArray(),varlistId,objid));
! }
! public void field(String val,Attributes atts) throws Exception {
!
!
! if (val.equalsIgnoreCase("<LineNum>") || val.equalsIgnoreCase("<ForeColor>") || val.equalsIgnoreCase("<BackColor>")) {
! Line line = state.getCurrentLine();
! line.addChunk(new net.sourceforge.idrs.core.report.FieldChunk("",val,"",state.getCurrentRepeatLine()));
! return;
! }
!
! if (val.indexOf(".") == -1) {
! state.setErrorWord(val);
! throw new Exception("No Period Found");
! }
! String format = atts.getValue("format");
! String id, field;
! id = val.substring(0,val.indexOf("."));
!
! field = val.substring(val.indexOf(".")+1);
! if (state.getReport().getHead().getAllDBs().get(id) == null) {
! state.setErrorWord(id);
! throw new Exception(id + " is not a valid DB");
! }
! Line line = state.getCurrentLine();
!
! line.addChunk(new net.sourceforge.idrs.core.report.FieldChunk(id,field,format,state.getCurrentRepeatLine()));
! }
!
! public void error(String val, Attributes atts) throws Exception {
! Line line = state.getCurrentLine();
! line.addChunk(new net.sourceforge.idrs.core.report.ErrorChunk());
! }
! public void inputResults(String val,Attributes atts) throws Exception {
! if (state.getReport().getHead().getAllDBs().get(val) == null) {
! state.setErrorWord(val);
! throw new Exception(val + " is not a valid DB");
! }
! Line line = state.getCurrentLine();
! line.addChunk(new net.sourceforge.idrs.core.report.InputResultsChunk(val));
! }
! public void script(String val, Attributes atts) throws Exception {
! state.getCurrentLine().addChunk(new net.sourceforge.idrs.core.report.ShortScriptChunk(val));
! }
! public void echoScript(String val,Attributes atts) throws Exception {
! state.getCurrentLine().addChunk(new net.sourceforge.idrs.core.report.EvalScriptChunk(val));
! }
! 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);
! Line line;
! while (tok.hasMoreTokens()) {
! line = state.getCurrentLine();
! line.addChunk(new net.sourceforge.idrs.core.report.TextChunk(tok.nextToken()));
! state.sealLine();
! }
! }
! else {
! state.getCurrentLine().addChunk(new TextChunk(val));
! }*/
! state.getCurrentLine().addChunk(new TextChunk(val));
! }
!
! /**
! * Handles the yesNo tag
! */
! public void yesNo(String val, Attributes atts) throws Exception {
! String name,srcType,single, attribs;
! int isrcType,isingle;
! boolean paramFirst = false;
!
! name = atts.getValue("name");
!
!
!
!
!
! paramFirst = atts.getValue("paramFirst") != null ? atts.getValue("paramFirst").equalsIgnoreCase("true") : false;
!
! single = atts.getValue("single");
! if (single == null || single.equalsIgnoreCase("")) {
! isingle = YesNo.NOT_SINGLE;
! }
! else {
! isingle = single.equalsIgnoreCase("yes") ? YesNo.SINGLE_YES : YesNo.SINGLE_NO;
! }
!
!
! 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 if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_PROP;
! else {
! state.setErrorWord(srcType);
! throw new Exception(srcType + " is not a valid source type");
! }
!
! if (isrcType == YesNo.SRC_DB && val.indexOf(".") == -1) {
! state.setErrorWord(val);
! throw new Exception("Not A Valid Source Field");
! }
!
! if (isrcType == YesNo.SRC_DB && state.getReport().getHead().getAllDBs().get(val.substring(0,val.indexOf("."))) == null) {
! state.setErrorWord(val);
! throw new Exception(val.substring(0,val.indexOf(".")) + " is not a valid DB");
! }
!
! state.getCurrentLine().addChunk(new YesNo(name,isingle,isrcType,val,attribs,paramFirst));
!
! }
!
! public void navNext(String val, Attributes atts) throws Exception {
! 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
! */
! public void formInput(String val, Attributes atts) throws Exception {
! String name,srcType,type, attribs,value;
! 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;
! itype = type.equalsIgnoreCase("password") ? InputChunk.INPUT_PASSWORD : itype;
! itype = type.equalsIgnoreCase("checkbox") ? InputChunk.INPUT_CHECKBOX : itype;
! itype = type.equalsIgnoreCase("radio") ? InputChunk.INPUT_RADIO : itype;
! itype = type.equalsIgnoreCase("textarea") ? InputChunk.INPUT_TEXTAREA : itype;
! itype = type.equalsIgnoreCase("file") ? InputChunk.INPUT_FILE : itype;
!
! if (itype != InputChunk.INPUT_TEXTAREA && itype != InputChunk.INPUT_HIDDEN && itype != InputChunk.INPUT_TEXT && itype != InputChunk.INPUT_PASSWORD && itype != InputChunk.INPUT_CHECKBOX && itype != InputChunk.INPUT_RADIO&& itype != InputChunk.INPUT_FILE) {
! state.setErrorWord(type);
! throw new Exception(type + " is not a valid input 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 if (srcType.equalsIgnoreCase("prop")) isrcType = YesNo.SRC_PROP;
! else {
! state.setErrorWord(srcType);
! throw new Exception(srcType + " is not a valid source type");
! }
!
! if (isrcType == YesNo.SRC_DB && val.indexOf(".") == -1) {
! state.setErrorWord("");
! throw new Exception("Not A Valid Source Field");
! }
!
! if (isrcType == YesNo.SRC_DB && state.getReport().getHead().getAllDBs().get(val.substring(0,val.indexOf("."))) == null) {
! state.setErrorWord(val);
! throw new Exception(val.substring(0,val.indexOf(".")) + " is not a valid DB");
! }
! state.getCurrentLine().addChunk(new InputChunk(name,itype,isrcType,val,value,attribs,paramFirst));
! }
!
! /**
! * Handles the formInput tag
! */
! public void formSelect(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 if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_PROP;
! else {
! state.setErrorWord(srcType);
! throw new Exception(srcType + " is not a valid source type");
! }
!
! 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));
! }
! /**
! * 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();
! if (state.getReport().getBody().isHTML()) {
! Line line = state.getCurrentLine();
! line.addChunk(new TextChunk("</BODY>"));
! state.sealLine();
! }
!
! Vector lines = state.popLines();
! // System.out.println("body lines : " + lines.size());
! state.getReport().getBody().setLines(lines);
! state.getReport().getBody().seal();
! }
!
!
!
!
}
--- 27,416 ----
public class Body extends net.sourceforge.idrs.deploy.compile.Compiler {
! /** Creates new Body */
! public Body() {
! }
! /**
! *allows for the compiler to work with the current state of the page compilation
! */
! public void setState(CompilerState state) throws Exception {
! super.setState(state);
! state.pushLines();
! }
! /**
! *allows for a compiler to use the attributes of the calling tag
! */
! public void setAttributes(Attributes atts) throws Exception {
! super.setAttributes(atts);
! String bodyTag;
! if (state.getReport().getBody().isHTML()) {
! Line line = state.getCurrentLine();
! //line.addChunk(new net.sourceforge.idrs.core.report.TextChunk("<BODY "));
! bodyTag = "<BODY ";
! for (int i = 0, m = atts.getLength(); i < m; i++) {
! bodyTag += atts.getLocalName(i)
! + "=\""
! + atts.getValue(i)
! + "\" ";
! }
! bodyTag += ">";
! System.out.println("Body tag : " + bodyTag);
! line.addChunk(new TextChunk(bodyTag));
! state.sealLine();
! }
+ }
! public void useMethod(String val, Attributes atts) throws Exception {
+ String objid = atts.getValue("objid");
+ String varlistId = atts.getValue("varlist");
+ LinkedList varList =
+ (LinkedList) ((HashMap) state.getAttribute("IDRS_VAR_LISTS")).get(
+ varlistId);
+ Line curr = state.getCurrentLine();
+ curr.addChunk(
+ new ObjectChunk(val, varList.toArray(), varlistId, objid));
! }
! public void field(String val, Attributes atts) throws Exception {
! if (val.equalsIgnoreCase("<LineNum>")
! || val.equalsIgnoreCase("<ForeColor>")
! || val.equalsIgnoreCase("<BackColor>")) {
! Line line = state.getCurrentLine();
! line.addChunk(
! new net.sourceforge.idrs.core.report.FieldChunk(
! "",
! val,
! "",
! state.getCurrentRepeatLine()));
! return;
! }
! if (val.indexOf(".") == -1) {
! state.setErrorWord(val);
! throw new Exception("No Period Found");
! }
! String format = atts.getValue("format");
! String id, field;
! id = val.substring(0, val.indexOf("."));
! field = val.substring(val.indexOf(".") + 1);
! if (state.getReport().getHead().getAllDBs().get(id) == null) {
! state.setErrorWord(id);
! throw new Exception(id + " is not a valid DB");
! }
! Line line = state.getCurrentLine();
! line.addChunk(
! new net.sourceforge.idrs.core.report.FieldChunk(
! id,
! field,
! format,
! state.getCurrentRepeatLine()));
! }
! public void error(String val, Attributes atts) throws Exception {
! Line line = state.getCurrentLine();
! line.addChunk(new net.sourceforge.idrs.core.report.ErrorChunk());
! }
! public void inputResults(String val, Attributes atts) throws Exception {
! if (state.getReport().getHead().getAllDBs().get(val) == null) {
! state.setErrorWord(val);
! throw new Exception(val + " is not a valid DB");
! }
! Line line = state.getCurrentLine();
! line.addChunk(
! new net.sourceforge.idrs.core.report.InputResultsChunk(val));
! }
! public void script(String val, Attributes atts) throws Exception {
! state.getCurrentLine().addChunk(
! new net.sourceforge.idrs.core.report.ShortScriptChunk(val));
! }
! public void echoScript(String val, Attributes atts) throws Exception {
! state.getCurrentLine().addChunk(
! new net.sourceforge.idrs.core.report.EvalScriptChunk(val));
! }
! 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);
! Line line;
! while (tok.hasMoreTokens()) {
! line = state.getCurrentLine();
! line.addChunk(new net.sourceforge.idrs.core.report.TextChunk(tok.nextToken()));
! state.sealLine();
! }
! }
! else {
! state.getCurrentLine().addChunk(new TextChunk(val));
! }*/
! state.getCurrentLine().addChunk(new TextChunk(val));
! }
! /**
! * Handles the yesNo tag
! */
! public void yesNo(String val, Attributes atts) throws Exception {
! String name, srcType, single, attribs;
! int isrcType, isingle;
! boolean paramFirst = false;
! name = atts.getValue("name");
! paramFirst =
! atts.getValue("paramFirst") != null
! ? atts.getValue("paramFirst").equalsIgnoreCase("true")
! : false;
! single = atts.getValue("single");
! if (single == null || single.equalsIgnoreCase("")) {
! isingle = YesNo.NOT_SINGLE;
! } else {
! isingle =
! single.equalsIgnoreCase("yes")
! ? YesNo.SINGLE_YES
! : YesNo.SINGLE_NO;
! }
! 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 if (srcType.equalsIgnoreCase("db"))
+ isrcType = YesNo.SRC_PROP;
+ else {
+ state.setErrorWord(srcType);
+ throw new Exception(srcType + " is not a valid source type");
+ }
! if (isrcType == YesNo.SRC_DB && val.indexOf(".") == -1) {
! state.setErrorWord(val);
! throw new Exception("Not A Valid Source Field");
! }
+ if (isrcType == YesNo.SRC_DB
+ && state.getReport().getHead().getAllDBs().get(
+ val.substring(0, val.indexOf(".")))
+ == null) {
+ state.setErrorWord(val);
+ throw new Exception(
+ val.substring(0, val.indexOf(".")) + " is not a valid DB");
+ }
! int iboolType;
! if (atts.getValue("boolType") != null
! && atts.getValue("boolType").length() != 0) {
! iboolType =
! atts.getValue("boolType").equals("int")
! ? YesNo.BOOL_INT
! : YesNo.BOOL_TF;
! } else {
! iboolType = YesNo.BOOL_INT;
! }
! state.getCurrentLine().addChunk(
! new YesNo(
! name,
! isingle,
! isrcType,
! val,
! attribs,
! paramFirst,
! iboolType));
! }
! public void navNext(String val, Attributes atts) throws Exception {
! state.getCurrentLine().addChunk(new NavNextChunk(val));
! }
! public void navPrev(String val, Attributes atts) throws Exception {
! state.getCurrentLine().addChunk(new NavPrevChunk(val));
! }
! public void navCur(String val, Attributes atts) throws Exception {
! state.getCurrentLine().addChunk(new NavCurChunk(val));
! }
! /**
! * Handles the formInput tag
! */
! public void formInput(String val, Attributes atts) throws Exception {
! String name, srcType, type, attribs, value;
! 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;
! itype =
! type.equalsIgnoreCase("password")
! ? InputChunk.INPUT_PASSWORD
! : itype;
! itype =
! type.equalsIgnoreCase("checkbox")
! ? InputChunk.INPUT_CHECKBOX
! : itype;
! itype = type.equalsIgnoreCase("radio") ? InputChunk.INPUT_RADIO : itype;
! itype =
! type.equalsIgnoreCase("textarea")
! ? InputChunk.INPUT_TEXTAREA
! : itype;
! itype = type.equalsIgnoreCase("file") ? InputChunk.INPUT_FILE : itype;
+ if (itype != InputChunk.INPUT_TEXTAREA
+ && itype != InputChunk.INPUT_HIDDEN
+ && itype != InputChunk.INPUT_TEXT
+ && itype != InputChunk.INPUT_PASSWORD
+ && itype != InputChunk.INPUT_CHECKBOX
+ && itype != InputChunk.INPUT_RADIO
+ && itype != InputChunk.INPUT_FILE) {
+ state.setErrorWord(type);
+ throw new Exception(type + " is not a valid input 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 if (srcType.equalsIgnoreCase("prop"))
! isrcType = YesNo.SRC_PROP;
! else {
! state.setErrorWord(srcType);
! throw new Exception(srcType + " is not a valid source type");
! }
! if (isrcType == YesNo.SRC_DB && val.indexOf(".") == -1) {
! state.setErrorWord("");
! throw new Exception("Not A Valid Source Field");
! }
! if (isrcType == YesNo.SRC_DB
! && state.getReport().getHead().getAllDBs().get(
! val.substring(0, val.indexOf(".")))
! == null) {
! state.setErrorWord(val);
! throw new Exception(
! val.substring(0, val.indexOf(".")) + " is not a valid DB");
! }
!
! state.getCurrentLine().addChunk(
! new InputChunk(
! name,
! itype,
! isrcType,
! val,
! value,
! attribs,
! paramFirst));
!
! }
!
! /**
! * Handles the formInput tag
! */
! public void formSelect(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 if (srcType.equalsIgnoreCase("db"))
! isrcType = YesNo.SRC_PROP;
! else {
! state.setErrorWord(srcType);
! throw new Exception(srcType + " is not a valid source type");
! }
!
! 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));
!
! }
!
! /**
! * 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();
! if (state.getReport().getBody().isHTML()) {
! Line line = state.getCurrentLine();
! line.addChunk(new TextChunk("</BODY>"));
! state.sealLine();
! }
!
! Vector lines = state.popLines();
! // System.out.println("body lines : " + lines.size());
! state.getReport().getBody().setLines(lines);
! state.getReport().getBody().seal();
! }
}
|
|
From: Marc B. <big...@us...> - 2003-03-17 14:09:18
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report In directory sc8-pr-cvs1:/tmp/cvs-serv27765/dev/src/net/sourceforge/idrs/core/report Removed Files: NavNextChunk.jav IDRSHead.java~ IDRSBody.java~ #IDRSHead.java# core Log Message: Added Initial EJB Support --- NavNextChunk.jav DELETED --- --- IDRSHead.java~ DELETED --- --- IDRSBody.java~ DELETED --- --- #IDRSHead.java# DELETED --- --- core DELETED --- |
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:36
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jdbc
In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/jdbc
Modified Files:
JDBCInfo.java
Log Message:
Added Initial EJB Support
Index: JDBCInfo.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jdbc/JDBCInfo.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** JDBCInfo.java 8 Jan 2003 06:01:36 -0000 1.5
--- JDBCInfo.java 17 Mar 2003 14:05:01 -0000 1.6
***************
*** 127,134 ****
--- 127,136 ----
*/
public Connection build() throws Exception {
+ //System.out.println("Building " + this.getDrivername());
Driver d = (Driver) (Class.forName(this.getDrivername()).newInstance());
Properties p = new Properties();
p.put("user", this.getUsername());
p.put("password", this.getPassword());
+ //System.out.println("building : " + this.url);
Connection con = d.connect(this.getUrl(), p);
return con;
|
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:36
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/rs
In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/utils/rs
Modified Files:
ObjRsMetaData.java
Log Message:
Added Initial EJB Support
Index: ObjRsMetaData.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/rs/ObjRsMetaData.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ObjRsMetaData.java 13 Mar 2003 20:58:54 -0000 1.1
--- ObjRsMetaData.java 17 Mar 2003 14:05:02 -0000 1.2
***************
*** 23,27 ****
public int getColumnCount() throws java.sql.SQLException
{
! return fieldNames.length;
}
--- 23,27 ----
public int getColumnCount() throws java.sql.SQLException
{
! return fieldNames.length ;
}
***************
*** 38,42 ****
public String getColumnName(int column) throws java.sql.SQLException
{
! return fieldNames[column];
}
--- 38,42 ----
public String getColumnName(int column) throws java.sql.SQLException
{
! return fieldNames[column-1];
}
|
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:35
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/pool
In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/pool
Modified Files:
IDRSPool.java RepPool.java DbPool.java ScriptPool.java
ScriptContextPool.java JDBCPool.java
Log Message:
Added Initial EJB Support
Index: IDRSPool.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/pool/IDRSPool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IDRSPool.java 22 Aug 2002 20:06:36 -0000 1.1
--- IDRSPool.java 17 Mar 2003 14:05:01 -0000 1.2
***************
*** 1,30 ****
! package net.sourceforge.idrs.pool;
! import java.util.*;
!
! /**
! * This interface acts as a connection between the IDRS and a
! * pooling implementation
! */
!
! public interface IDRSPool {
! /**
! *Retrieves an object from the pool, does not define failure condition
! */
! public Object getObj() throws Exception;
!
! /**
! *Returns an object to the pool, does not define failure conditions
! */
!
! public void returnObj(Object obj) throws Exception;
!
!
!
! /**
! *Deinitializes the pool
! */
! public void close() throws Exception;
!
!
!
}
--- 1,30 ----
! package net.sourceforge.idrs.pool;
! import java.util.*;
!
! /**
! * This interface acts as a connection between the IDRS and a
! * pooling implementation
! */
!
! public interface IDRSPool {
! /**
! *Retrieves an object from the pool, does not define failure condition
! */
! public Object getObj() throws Exception;
!
! /**
! *Returns an object to the pool, does not define failure conditions
! */
!
! public void returnObj(Object obj) throws Exception;
!
!
!
! /**
! *Deinitializes the pool
! */
! public void close() throws Exception;
!
!
!
}
Index: RepPool.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/pool/RepPool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RepPool.java 22 Aug 2002 20:06:37 -0000 1.1
--- RepPool.java 17 Mar 2003 14:05:01 -0000 1.2
***************
*** 1,44 ****
! package net.sourceforge.idrs.pool;
!
! import net.sourceforge.idrs.core.report.*;
! import java.sql.*;
!
! /**
! * Defines the basis for a Report pool, must be exteded
! */
! public abstract class RepPool implements IDRSPool {
!
! String poolname;
! int min;
! int limit;
! int idleTime;
! long sleepTime;
! String logPath;
! IDRSRep rep;
!
! public void build(int objectMin, int objectLimit, IDRSRep rep, long sleepTime, String path,int trys) throws Exception {
! this.rep = rep;
! this.min = objectMin;
! this.limit=objectLimit;
! this.sleepTime = sleepTime;
! this.logPath = path;
!
! }
!
! /**
! *Retrieves a Report
! */
! public IDRSRep getReport() throws Exception {
! return (IDRSRep) getObj();
! }
!
! /**
! *Returns a Report
! */
! public void returnReport(IDRSRep rep) throws Exception {
! returnObj(rep);
! }
!
!
!
}
--- 1,44 ----
! package net.sourceforge.idrs.pool;
!
! import net.sourceforge.idrs.core.report.*;
! import java.sql.*;
!
! /**
! * Defines the basis for a Report pool, must be exteded
! */
! public abstract class RepPool implements IDRSPool {
!
! String poolname;
! int min;
! int limit;
! int idleTime;
! long sleepTime;
! String logPath;
! IDRSRep rep;
!
! public void build(int objectMin, int objectLimit, IDRSRep rep, long sleepTime, String path,int trys) throws Exception {
! this.rep = rep;
! this.min = objectMin;
! this.limit=objectLimit;
! this.sleepTime = sleepTime;
! this.logPath = path;
!
! }
!
! /**
! *Retrieves a Report
! */
! public IDRSRep getReport() throws Exception {
! return (IDRSRep) getObj();
! }
!
! /**
! *Returns a Report
! */
! public void returnReport(IDRSRep rep) throws Exception {
! returnObj(rep);
! }
!
!
!
}
Index: DbPool.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/pool/DbPool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** DbPool.java 22 Aug 2002 20:06:36 -0000 1.1
--- DbPool.java 17 Mar 2003 14:05:01 -0000 1.2
***************
*** 1,47 ****
! package net.sourceforge.idrs.pool;
!
! import java.sql.*;
! import net.sourceforge.idrs.jdbc.*;
! /**
! * Defines the basis for a DB pool, must be exteded
! */
! public abstract class DbPool implements IDRSPool {
! JDBCInfo info;
! String poolname;
! int min;
! int limit;
! int idleTime;
! long sleepTime;
! String logpath;
!
!
! public void build(String poolname, String drivername, String url,
! String username, String password, int min, int limit,
! long daysOpen, long sleep, String path) throws Exception {
! info = new JDBCInfo(poolname, drivername, url, username, password);
!
! }
!
! /**
! *Retrieves a connection
! */
! public Connection getConnection() throws Exception {
! return (Connection) getObj();
! }
!
! /**
! *Returns a connection
! */
! public void returnConnection(Connection con) throws Exception {
! returnObj(con);
! }
!
! /**
! *Returns the jdbcinfo object
! */
! public JDBCInfo getInfo() {
! return info;
! }
!
!
}
--- 1,49 ----
! package net.sourceforge.idrs.pool;
!
! import java.sql.*;
! import net.sourceforge.idrs.jdbc.*;
! /**
! * Defines the basis for a DB pool, must be exteded
! */
! public abstract class DbPool implements IDRSPool {
! JDBCInfo info;
! String poolname;
! int min;
! int limit;
! int idleTime;
! long sleepTime;
! String logpath;
!
!
! public void build(String poolname, String drivername, String url,
! String username, String password, int min, int limit,
! long daysOpen, long sleep, String path) throws Exception {
! //System.out.println("building pool " + poolname);
! info = new JDBCInfo(poolname, drivername, url, username, password);
! //System.out.println("built pool " + poolname);
!
! }
!
! /**
! *Retrieves a connection
! */
! public Connection getConnection() throws Exception {
! return (Connection) getObj();
! }
!
! /**
! *Returns a connection
! */
! public void returnConnection(Connection con) throws Exception {
! returnObj(con);
! }
!
! /**
! *Returns the jdbcinfo object
! */
! public JDBCInfo getInfo() {
! return info;
! }
!
!
}
Index: ScriptPool.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/pool/ScriptPool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ScriptPool.java 22 Aug 2002 20:06:37 -0000 1.1
--- ScriptPool.java 17 Mar 2003 14:05:01 -0000 1.2
***************
*** 1,45 ****
! package net.sourceforge.idrs.pool;
!
! import java.sql.*;
! import net.sourceforge.idrs.script.embedable.*;
!
! /**
! * Defines the basis for a Report pool, must be exteded
! */
! public abstract class ScriptPool implements IDRSPool {
!
! String poolname;
! int min;
! int limit;
! int idleTime;
! long sleepTime;
! String logPath;
! String scriptClass;
!
! public void build(int objectMin, int objectLimit, String scriptClass, long sleepTime, String path,int trys) throws Exception {
!
! this.min = objectMin;
! this.limit=objectLimit;
! this.sleepTime = sleepTime;
! this.logPath = path;
! this.scriptClass = scriptClass;
!
! }
!
! /**
! *Retrieves a Conetext
! */
! public IDRSScriptLanguage getContext() throws Exception {
! return (IDRSScriptLanguage) getObj();
! }
!
! /**
! *Returns a Context
! */
! public void returnContext(IDRSScriptLanguage script) throws Exception {
! returnObj(script);
! }
!
!
!
}
--- 1,45 ----
! package net.sourceforge.idrs.pool;
!
! import java.sql.*;
! import net.sourceforge.idrs.script.embedable.*;
!
! /**
! * Defines the basis for a Report pool, must be exteded
! */
! public abstract class ScriptPool implements IDRSPool {
!
! String poolname;
! int min;
! int limit;
! int idleTime;
! long sleepTime;
! String logPath;
! String scriptClass;
!
! public void build(int objectMin, int objectLimit, String scriptClass, long sleepTime, String path,int trys) throws Exception {
!
! this.min = objectMin;
! this.limit=objectLimit;
! this.sleepTime = sleepTime;
! this.logPath = path;
! this.scriptClass = scriptClass;
!
! }
!
! /**
! *Retrieves a Conetext
! */
! public IDRSScriptLanguage getContext() throws Exception {
! return (IDRSScriptLanguage) getObj();
! }
!
! /**
! *Returns a Context
! */
! public void returnContext(IDRSScriptLanguage script) throws Exception {
! returnObj(script);
! }
!
!
!
}
Index: ScriptContextPool.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/pool/ScriptContextPool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ScriptContextPool.java 22 Aug 2002 20:06:37 -0000 1.1
--- ScriptContextPool.java 17 Mar 2003 14:05:01 -0000 1.2
***************
*** 1,66 ****
! package net.sourceforge.idrs.pool;
!
! import org.apache.commons.pool.*;
! import org.apache.commons.*;
! import org.apache.commons.pool.impl.*;
! import org.apache.commons.*;
! import net.sourceforge.idrs.script.embedable.*;
!
!
! public class ScriptContextPool extends ScriptPool {
!
! ObjectPool pool;
!
! public void build(int objectMin, int objectLimit, String scriptClass, long sleepTime, String path,int trys) throws Exception {
! super.build(objectMin,objectLimit,scriptClass,sleepTime,path,trys);
! GenericObjectPool.Config conf = new GenericObjectPool.Config();
!
! conf.maxActive = limit;
! conf.maxWait = sleepTime;
! conf.testOnBorrow = true;
! conf.timeBetweenEvictionRunsMillis = 100000;
! conf.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK;
!
! pool = new GenericObjectPool(new ScriptFactory(scriptClass),conf);
! }
!
! public Object getObj() throws Exception {
! return pool.borrowObject();
! }
!
! public void returnObj(Object obj) throws Exception {
! pool.returnObject(obj);
! }
!
! public void close() throws Exception {
! pool.close();
! }
! }
!
! class ScriptFactory implements PoolableObjectFactory {
! String scriptClass;
!
! public ScriptFactory(String scriptClass) {
! this.scriptClass = scriptClass;
! }
!
! public void activateObject(Object obj) throws Exception {
!
! }
!
! public void destroyObject(Object obj) throws Exception {
!
! }
!
! public Object makeObject() throws Exception {
! return Class.forName(scriptClass).newInstance();
! }
!
! public void passivateObject(Object obj) throws Exception {
!
! }
!
! public boolean validateObject(Object obj) {
! return obj != null;
! }
! }
--- 1,66 ----
! package net.sourceforge.idrs.pool;
!
! import org.apache.commons.pool.*;
! import org.apache.commons.*;
! import org.apache.commons.pool.impl.*;
! import org.apache.commons.*;
! import net.sourceforge.idrs.script.embedable.*;
!
!
! public class ScriptContextPool extends ScriptPool {
!
! ObjectPool pool;
!
! public void build(int objectMin, int objectLimit, String scriptClass, long sleepTime, String path,int trys) throws Exception {
! super.build(objectMin,objectLimit,scriptClass,sleepTime,path,trys);
! GenericObjectPool.Config conf = new GenericObjectPool.Config();
!
! conf.maxActive = limit;
! conf.maxWait = sleepTime;
! conf.testOnBorrow = true;
! conf.timeBetweenEvictionRunsMillis = 100000;
! conf.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK;
!
! pool = new GenericObjectPool(new ScriptFactory(scriptClass),conf);
! }
!
! public Object getObj() throws Exception {
! return pool.borrowObject();
! }
!
! public void returnObj(Object obj) throws Exception {
! pool.returnObject(obj);
! }
!
! public void close() throws Exception {
! pool.close();
! }
! }
!
! class ScriptFactory implements PoolableObjectFactory {
! String scriptClass;
!
! public ScriptFactory(String scriptClass) {
! this.scriptClass = scriptClass;
! }
!
! public void activateObject(Object obj) throws Exception {
!
! }
!
! public void destroyObject(Object obj) throws Exception {
!
! }
!
! public Object makeObject() throws Exception {
! return Class.forName(scriptClass).newInstance();
! }
!
! public void passivateObject(Object obj) throws Exception {
!
! }
!
! public boolean validateObject(Object obj) {
! return obj != null;
! }
! }
Index: JDBCPool.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/pool/JDBCPool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** JDBCPool.java 22 Aug 2002 20:06:36 -0000 1.1
--- JDBCPool.java 17 Mar 2003 14:05:01 -0000 1.2
***************
*** 1,72 ****
! package net.sourceforge.idrs.pool;
!
! import org.apache.commons.pool.*;
! import org.apache.commons.pool.impl.*;
! import net.sourceforge.idrs.jdbc.*;
! import java.sql.*;
!
! public class JDBCPool extends DbPool {
! ObjectPool pool;
!
! public void build(String poolname, String drivername, String url,
! String username, String password, int min, int limit,
! long daysOpen, long sleep, String path) throws Exception {
! super.build(poolname,drivername,url,username,password,min,limit,daysOpen,sleep,path);
! GenericObjectPool.Config conf = new GenericObjectPool.Config();
!
! conf.maxActive = limit;
! conf.maxWait = sleepTime;
! conf.testOnBorrow = true;
! conf.timeBetweenEvictionRunsMillis = 100000;
! conf.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK;
!
! pool = new GenericObjectPool(new JDBCFactory(info),conf);
! }
!
! public Object getObj() throws Exception {
! return pool.borrowObject();
! }
!
! public void returnObj(Object obj) throws Exception {
! pool.returnObject(obj);
! }
!
! public void close() throws Exception {
! pool.close();
! }
!
!
! }
!
! class JDBCFactory implements PoolableObjectFactory {
! JDBCInfo jdbcInfo;
!
! public JDBCFactory(JDBCInfo jdbc) {
! this.jdbcInfo = jdbc;
! }
!
! public void activateObject(Object obj) throws Exception {
!
! }
!
! public void destroyObject(Object obj) throws Exception {
! ((Connection) obj).close();
! }
!
! public Object makeObject() throws Exception {
! return jdbcInfo.build();
! }
!
! public void passivateObject(Object obj) throws Exception {
!
! }
!
! public boolean validateObject(Object obj) {
! try {
! return obj != null && ! ((Connection) obj).isClosed();
! }
! catch (Exception e) {
! return false;
! }
! }
! }
--- 1,77 ----
! package net.sourceforge.idrs.pool;
!
! import org.apache.commons.pool.*;
! import org.apache.commons.pool.impl.*;
! import net.sourceforge.idrs.jdbc.*;
! import java.sql.*;
!
! public class JDBCPool extends DbPool {
! ObjectPool pool;
!
! public void build(String poolname, String drivername, String url,
! String username, String password, int min, int limit,
! long daysOpen, long sleep, String path) throws Exception {
! super.build(poolname,drivername,url,username,password,min,limit,daysOpen,sleep,path);
! GenericObjectPool.Config conf = new GenericObjectPool.Config();
!
! conf.maxActive = limit;
! conf.maxWait = sleepTime;
! conf.testOnBorrow = true;
! conf.timeBetweenEvictionRunsMillis = 100000;
! conf.whenExhaustedAction = GenericObjectPool.WHEN_EXHAUSTED_BLOCK;
!
! pool = new GenericObjectPool(new JDBCFactory(info),conf);
! }
!
! public Object getObj() throws Exception {
! return pool.borrowObject();
! }
!
! public void returnObj(Object obj) throws Exception {
! pool.returnObject(obj);
! }
!
! public void close() throws Exception {
! pool.close();
! }
!
!
! }
!
! class JDBCFactory implements PoolableObjectFactory {
! JDBCInfo jdbcInfo;
!
! public JDBCFactory(JDBCInfo jdbc) {
! this.jdbcInfo = jdbc;
! //System.out.println("new factory : " + jdbc.getPoolname());
! }
!
! public void activateObject(Object obj) throws Exception {
!
! }
!
! public void destroyObject(Object obj) throws Exception {
! ((Connection) obj).close();
! }
!
! public Object makeObject() throws Exception {
! //System.out.println("building an instance of " + this.jdbcInfo.getPoolname());
! Connection con = jdbcInfo.build();
! //System.out.println("built an instance of " + this.jdbcInfo.getPoolname());
! return con;
! }
!
! public void passivateObject(Object obj) throws Exception {
!
! }
!
! public boolean validateObject(Object obj) {
! try {
! return obj != null && ! ((Connection) obj).isClosed();
! }
! catch (Exception e) {
! e.printStackTrace();
! return false;
! }
! }
! }
|
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:35
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report
In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/core/report
Modified Files:
GenTag.java IDRSHead.java InputChunk.java core
Log Message:
Added Initial EJB Support
Index: GenTag.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/GenTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** GenTag.java 6 Feb 2003 20:13:44 -0000 1.4
--- GenTag.java 17 Mar 2003 14:04:53 -0000 1.5
***************
*** 180,184 ****
sval = head.getRequest().getParameter(name);
if (sval == null) {
! // System.out.println("Getting db value " + owner + "." + src + " : " + head.getFieldData(owner,src));
return (sval = head.getFieldData(owner,src)) != null ? sval : "";
}
--- 180,184 ----
sval = head.getRequest().getParameter(name);
if (sval == null) {
! System.out.println("Getting db value " + owner + "." + src + " : " + head.getFieldData(owner,src));
return (sval = head.getFieldData(owner,src)) != null ? sval : "";
}
***************
*** 188,192 ****
}
else {
! // System.out.println("Getting db value " + owner + "." + src + " : " + head.getFieldData(owner,src));
return (sval = head.getFieldData(owner,src)) != null ? sval : "";
}
--- 188,192 ----
}
else {
! System.out.println("Getting db value " + owner + "." + src + " : " + head.getFieldData(owner,src));
return (sval = head.getFieldData(owner,src)) != null ? sval : "";
}
Index: IDRSHead.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSHead.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** IDRSHead.java 17 Feb 2003 02:48:48 -0000 1.14
--- IDRSHead.java 17 Mar 2003 14:04:53 -0000 1.15
***************
*** 11,14 ****
--- 11,19 ----
import java.sql.*;
import java.security.*;
+ import javax.ejb.*;
+ import javax.rmi.*;
+ import net.sourceforge.idrs.jndi.*;
+ import javax.naming.*;
+ import java.lang.reflect.*;
public final class IDRSHead implements Serializable, IDRSScript {
***************
*** 736,739 ****
--- 741,758 ----
}
+ public EJBObject getEJB(Connection con, String name, String home, String remote, boolean session) throws Exception {
+ if (! (con instanceof JndiConnection)) {
+ throw new Exception("A Connection Must Be an instance of JndiConnection");
+ }
+
+ Context ctx = ((JndiConnection) con).getContext();
+ Object obj = ctx.lookup(name);
+
+ EJBHome hm = (EJBHome) PortableRemoteObject.narrow(obj,Class.forName(home));
+
+ Method create = Class.forName(home).getMethod("create",new Class[] {});
+ return (EJBObject) create.invoke(hm,new Object[] {});
+
+ }
}
Index: InputChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/InputChunk.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** InputChunk.java 6 Feb 2003 20:13:45 -0000 1.3
--- InputChunk.java 17 Mar 2003 14:04:53 -0000 1.4
***************
*** 41,57 ****
public String toString(IDRSHead head) throws Exception {
! StringBuffer tag = new StringBuffer();
! String nm = nameIsScript ? head.getScriptContext().eval(name) : name;
! switch (type) {
! case INPUT_HIDDEN : getTextTag(nm,"HIDDEN",head,tag); break;
! case INPUT_TEXT : getTextTag(nm,"TEXT",head,tag); break;
! case INPUT_PASSWORD : getTextTag(nm,"PASSWORD",head,tag); break;
! case INPUT_FILE : getTextTag(nm,"FILE",head,tag); break;
! case INPUT_RADIO : getBoolTag(nm,"RADIO",head,tag); break;
! case INPUT_CHECKBOX : getBoolTag(nm,"CHECKBOX",head,tag); break;
! case INPUT_TEXTAREA : tag.append("<TEXTAREA NAME=\"").append(nm).append("\" ").append(atts).append(" >").append(getValue(head,nm)).append("</TEXTAREA>");
! }
!
! return tag.toString();
}
--- 41,62 ----
public String toString(IDRSHead head) throws Exception {
! try {
! StringBuffer tag = new StringBuffer();
! String nm = nameIsScript ? head.getScriptContext().eval(name) : name;
! switch (type) {
! case INPUT_HIDDEN : getTextTag(nm,"HIDDEN",head,tag); break;
! case INPUT_TEXT : getTextTag(nm,"TEXT",head,tag); break;
! case INPUT_PASSWORD : getTextTag(nm,"PASSWORD",head,tag); break;
! case INPUT_FILE : getTextTag(nm,"FILE",head,tag); break;
! case INPUT_RADIO : getBoolTag(nm,"RADIO",head,tag); break;
! case INPUT_CHECKBOX : getBoolTag(nm,"CHECKBOX",head,tag); break;
! case INPUT_TEXTAREA : tag.append("<TEXTAREA NAME=\"").append(nm).append("\" ").append(atts).append(" >").append(getValue(head,nm)).append("</TEXTAREA>");
! }
!
! return tag.toString();
! } catch (Exception e) {
! e.printStackTrace();
! return "ERROR";
! }
}
Index: core
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/core,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
Binary files /tmp/cvswWADTu and /tmp/cvsLpfwqH differ
|
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:35
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/core/servlet
Modified Files:
ConfigInfo.java MultiPartRequest.java IdrsConfigHandler.java
IdrsController.java Init.java
Log Message:
Added Initial EJB Support
Index: ConfigInfo.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/ConfigInfo.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ConfigInfo.java 6 Feb 2003 20:13:43 -0000 1.1
--- ConfigInfo.java 17 Mar 2003 14:05:00 -0000 1.2
***************
*** 48,58 ****
String errorLog;
String reportPoolClass;
!
int resetPort;
String resetAllowedHost;
String securityImp;
-
-
/**
* Constructor for ConfigInfo.
--- 48,56 ----
String errorLog;
String reportPoolClass;
!
int resetPort;
String resetAllowedHost;
String securityImp;
/**
* Constructor for ConfigInfo.
***************
*** 309,319 ****
this.digestType = svg.getInitParameter("digestType");
this.scriptPoolClass = svg.getInitParameter("scriptPool");
! this.scriptPoolMin = Integer.parseInt(svg.getInitParameter("minReports"));
! this.scriptPoolMax = Integer.parseInt(svg.getInitParameter("maxReports"));
! this.scriptDaysOpen = Integer.parseInt(svg.getInitParameter("daysReportsOpen"));
this.errorLog = svg.getInitParameter("errorLog");
this.scriptClass = svg.getInitParameter("scriptClass");
! // System.out.println("getting vars");
this.vars = new HashMap();
int numVars = Integer.parseInt(svg.getInitParameter("numVars"));
--- 307,320 ----
this.digestType = svg.getInitParameter("digestType");
this.scriptPoolClass = svg.getInitParameter("scriptPool");
! this.scriptPoolMin =
! Integer.parseInt(svg.getInitParameter("minReports"));
! this.scriptPoolMax =
! Integer.parseInt(svg.getInitParameter("maxReports"));
! this.scriptDaysOpen =
! Integer.parseInt(svg.getInitParameter("daysReportsOpen"));
this.errorLog = svg.getInitParameter("errorLog");
this.scriptClass = svg.getInitParameter("scriptClass");
! // System.out.println("getting vars");
this.vars = new HashMap();
int numVars = Integer.parseInt(svg.getInitParameter("numVars"));
***************
*** 340,346 ****
this.dbs = new HashMap();
!
! // System.out.println("num dbs : " + numDBs);
!
for (int i = 1; i <= numDBs; i++) {
cur = new JDBCInfo();
--- 341,347 ----
this.dbs = new HashMap();
!
! // System.out.println("num dbs : " + numDBs);
!
for (int i = 1; i <= numDBs; i++) {
cur = new JDBCInfo();
***************
*** 373,386 ****
cur.setLogPath(
svg.getInitParameter("logPath" + Integer.toString(i)));
!
! // System.out.println("in load config : " + cur.getPoolname());
this.dbs.put(cur.getPoolname(), cur);
}
!
this.resetPort = Integer.parseInt(svg.getInitParameter("resetPort"));
this.resetAllowedHost = svg.getInitParameter("resetAllowedHost");
!
}
--- 374,387 ----
cur.setLogPath(
svg.getInitParameter("logPath" + Integer.toString(i)));
!
! // System.out.println("in load config : " + cur.getPoolname());
this.dbs.put(cur.getPoolname(), cur);
}
!
this.resetPort = Integer.parseInt(svg.getInitParameter("resetPort"));
this.resetAllowedHost = svg.getInitParameter("resetAllowedHost");
!
}
***************
*** 432,446 ****
this.resetPort = resetPort;
}
!
! public void loadFromConfigXml(ServletConfig svg) throws Exception {
! String loadFrom = svg.getServletContext().getRealPath("WEB-INF") + "/" + svg.getInitParameter("configFile");
! InputSource in = new InputSource(new FileReader(new File(loadFrom)));
! IdrsConfigHandler handle = new IdrsConfigHandler(this);
! XMLReader parser = XMLReaderFactory.createXMLReader(svg.getInitParameter("parseClass"));
! parser.setContentHandler(handle);
! parser.parse(in);
!
! this.dbs = handle.getDBs();
! this.vars = handle.getVars();
}
--- 433,465 ----
this.resetPort = resetPort;
}
!
! public void loadFromConfigXml(ServletConfig svg) throws Exception {
! String loadFrom =
! svg.getServletContext().getRealPath("WEB-INF")
! + "/"
! + svg.getInitParameter("configFile");
! InputSource in = new InputSource(new FileReader(new File(loadFrom)));
! IdrsConfigHandler handle = new IdrsConfigHandler(this);
! XMLReader parser =
! XMLReaderFactory.createXMLReader(
! svg.getInitParameter("parseClass"));
! parser.setContentHandler(handle);
! parser.parse(in);
!
! this.dbs = handle.getDBs();
! this.vars = handle.getVars();
! }
!
! public void loadFromConfigXmlSrc(String src, String parseClass) throws Exception {
! InputSource in = new InputSource(new StringReader(src));
! IdrsConfigHandler handle = new IdrsConfigHandler(this);
! XMLReader parser =
! XMLReaderFactory.createXMLReader(
! parseClass);
! parser.setContentHandler(handle);
! parser.parse(in);
!
! this.dbs = handle.getDBs();
! this.vars = handle.getVars();
}
Index: MultiPartRequest.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/MultiPartRequest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MultiPartRequest.java 17 Feb 2003 02:48:48 -0000 1.2
--- MultiPartRequest.java 17 Mar 2003 14:05:00 -0000 1.3
***************
*** 333,337 ****
! if (val instanceof String[]) {
sval = ((String[])val)[0];
}
--- 333,340 ----
! if (val == null) {
! return null;
! }
! else if (val instanceof String[]) {
sval = ((String[])val)[0];
}
Index: IdrsConfigHandler.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IdrsConfigHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IdrsConfigHandler.java 6 Feb 2003 20:13:43 -0000 1.1
--- IdrsConfigHandler.java 17 Mar 2003 14:05:00 -0000 1.2
***************
*** 28,31 ****
--- 28,32 ----
public static final String authDB = "authDB";
public static final String dbPoolClass = "dbPoolClass";
+ public static final String reportPoolClass = "reportPoolClass";
public static final String errorLog = "errorLog";
public static final String resetPort = "resetPort";
***************
*** 114,118 ****
} else if (localName.equalsIgnoreCase(this.dbPoolClass)) {
cfg.setDbPoolClass(val);
! } else if (localName.equalsIgnoreCase(this.digestType)) {
cfg.setDigestType(val);
} else if (localName.equalsIgnoreCase(this.docsDB)) {
--- 115,124 ----
} else if (localName.equalsIgnoreCase(this.dbPoolClass)) {
cfg.setDbPoolClass(val);
! }
! else if (localName.equalsIgnoreCase(this.reportPoolClass)) {
! cfg.setReportPoolClass(val) ;
! }
!
! else if (localName.equalsIgnoreCase(this.digestType)) {
cfg.setDigestType(val);
} else if (localName.equalsIgnoreCase(this.docsDB)) {
Index: IdrsController.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IdrsController.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IdrsController.java 6 Feb 2003 20:13:44 -0000 1.1
--- IdrsController.java 17 Mar 2003 14:05:00 -0000 1.2
***************
*** 30,52 ****
*/
public class IdrsController {
private PoolInfo poolInfo;
! private String IDRSName;
! private String dbName, dbDriver, dbUser, dbPass, contextPath, logPath;
!
! private boolean toLower;
!
!
!
[...1194 lines suppressed...]
class PoolInfo implements Cloneable {
! IDRSScriptLanguage idrss;
! IDRSRep rep;
! IDRSSecurity secure;
! HashMap conns;
! String docName;
! Connection authDB;
!
}
--- 672,681 ----
class PoolInfo implements Cloneable {
! IDRSScriptLanguage idrss;
! IDRSRep rep;
! IDRSSecurity secure;
! HashMap conns;
! String docName;
! Connection authDB;
!
}
Index: Init.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/Init.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Init.java 6 Feb 2003 20:13:44 -0000 1.11
--- Init.java 17 Mar 2003 14:05:00 -0000 1.12
***************
*** 183,186 ****
--- 183,187 ----
*/
public DbPool getDBPool(String name) {
+ //System.out.println("getDBPool " + name);
return (DbPool) dbs.get(name);
}
***************
*** 208,211 ****
--- 209,213 ----
*/
protected HashMap getConnsInfo(String conns) throws Exception {
+ //System.out.println("in getConnsInfo " + conns);
StringTokenizer tok = new StringTokenizer(conns, ",", false);
HashMap tmp = new HashMap();
***************
*** 213,216 ****
--- 215,219 ----
while (tok.hasMoreTokens()) {
key = tok.nextToken();
+ //System.out.println("key : " + key);
tmp.put(key, ((DbPool) dbs.get(key)).getInfo());
}
***************
*** 478,481 ****
--- 481,485 ----
public void retrieveDocDBs() throws Exception {
log.println("Retrieving Doc Dbs");
+ Connection con;
String dbPool;
int i;
***************
*** 498,502 ****
while (it.hasNext()) {
tmpAlias = (String) it.next();
! // System.out.println("DB Loaded : " + tmpAlias);
cur = (JDBCInfo) cfg.getDbs().get(tmpAlias);
--- 502,506 ----
while (it.hasNext()) {
tmpAlias = (String) it.next();
! //System.out.println("DB Loaded : " + tmpAlias);
cur = (JDBCInfo) cfg.getDbs().get(tmpAlias);
***************
*** 527,532 ****
2000L,
tmpLog);
! // System.out.println("Adding " + tmpName);
dbs.put(tmpAlias, tmpDB);
} catch (Exception e) {
e.printStackTrace(System.out);
--- 531,540 ----
2000L,
tmpLog);
! //System.out.println("Adding " + tmpName);
! //System.out.println("Adding " + tmpAlias);
dbs.put(tmpAlias, tmpDB);
+ //con = tmpDB.getConnection();
+ //System.out.println(tmpAlias + " " + con);
+ //tmpDB.returnConnection(con);
} catch (Exception e) {
e.printStackTrace(System.out);
|
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:35
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/script Modified Files: DBShell.java IDRSScript.java IdrsDB.java Log Message: Added Initial EJB Support Index: DBShell.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/DBShell.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DBShell.java 18 Sep 2001 03:18:57 -0000 1.3 --- DBShell.java 17 Mar 2003 14:05:01 -0000 1.4 *************** *** 1,83 **** ! /* ! DBShell.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.script; ! ! import net.sourceforge.idrs.utils.DB; ! /** Acts as a protective shell for passing data results to methods */ ! public class DBShell implements IdrsDB { ! private DB db; ! String id; ! /** Creates a new DBShell based on an id and a db @param id ID of DB being encapsulated ! @param db DB to be encapsulated ! */ ! public DBShell(String id,DB db) { ! this.id = id; ! this.db = db; ! } ! ! ! /** ! Retrieves DBShell's db ! */ ! public DB getDB() throws Exception { ! return db; ! } ! ! /** ! Calls db's next() method ! */ ! public boolean next() throws Exception { ! return db.next(); ! } ! ! /** Calls db's getFieldData method @param fieldname NAme of field being rechreaved ! @param format Format string being used, null if none ! */ ! public String getFieldData(String fieldname,String format) throws Exception { ! String data; ! data = db.getFieldData(fieldname,format); ! ! return data; ! } ! ! /** Calls getFieldData with no format @param fieldname NAme of field being rechreaved */ ! public String getFieldData(String fieldname) throws Exception { ! return getFieldData(fieldname,null); ! } ! /** Retrieves the results from an input db */ ! public int getUpdateResult() throws Exception { ! return db.getUpdateResult(); ! } ! ! /** Calls db's moveTo method ! @param location Index of results to move to ! */ ! public boolean moveTo(int location) throws Exception { ! return db.moveTo(location); ! } ! } --- 1,83 ---- ! /* ! DBShell.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.script; ! ! import net.sourceforge.idrs.utils.DB; ! /** Acts as a protective shell for passing data results to methods */ ! public class DBShell implements IdrsDB { ! private DB db; ! String id; ! /** Creates a new DBShell based on an id and a db @param id ID of DB being encapsulated ! @param db DB to be encapsulated ! */ ! public DBShell(String id,DB db) { ! this.id = id; ! this.db = db; ! } ! ! ! /** ! Retrieves DBShell's db ! */ ! public DB getDB() throws Exception { ! return db; ! } ! ! /** ! Calls db's next() method ! */ ! public boolean next() throws Exception { ! return db.next(); ! } ! ! /** Calls db's getFieldData method @param fieldname NAme of field being rechreaved ! @param format Format string being used, null if none ! */ ! public String getFieldData(String fieldname,String format) throws Exception { ! String data; ! data = db.getFieldData(fieldname,format); ! ! return data; ! } ! ! /** Calls getFieldData with no format @param fieldname NAme of field being rechreaved */ ! public String getFieldData(String fieldname) throws Exception { ! return getFieldData(fieldname,null); ! } ! /** Retrieves the results from an input db */ ! public int getUpdateResult() throws Exception { ! return db.getUpdateResult(); ! } ! ! /** Calls db's moveTo method ! @param location Index of results to move to ! */ ! public boolean moveTo(int location) throws Exception { ! return db.moveTo(location); ! } ! } Index: IDRSScript.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/IDRSScript.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** IDRSScript.java 17 Feb 2003 02:48:47 -0000 1.10 --- IDRSScript.java 17 Mar 2003 14:05:01 -0000 1.11 *************** *** 23,26 **** --- 23,28 ---- import net.sourceforge.idrs.utils.UserInfo; import net.sourceforge.idrs.core.servlet.MultiPartRequest; + import java.sql.*; + import javax.ejb.*; public interface IDRSScript { *************** *** 145,147 **** --- 147,151 ---- /** retrieves the name of the last property set */ public String getPropParamName(); + + public EJBObject getEJB(Connection con, String name, String home, String remote, boolean session) throws Exception; } Index: IdrsDB.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/script/IdrsDB.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IdrsDB.java 18 Sep 2001 03:18:57 -0000 1.3 --- IdrsDB.java 17 Mar 2003 14:05:01 -0000 1.4 *************** *** 1,53 **** ! /* ! IdrsDB.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.script; ! /** Interface used by all IDRS Data Stores */ ! public interface IdrsDB { ! /** ! pre:rs is populated<br> ! post:if the there is another record,<br> ! advance a record<br> ! readin the fields<br> ! else return false */ ! public boolean next() throws Exception; ! /** Retrieves data from a perticuler field with a given format @param fieldname Name of field being rechreaved ! @param format Format string being used, null if none ! */ public String getFieldData(String fieldname,String format) throws Exception; ! /** Retrieves data from a perticuler field @param fieldname Name of field being rechreaved ! */ public String getFieldData(String fieldname) throws Exception; /** Retrieves the results from an input db ! */ ! public int getUpdateResult() throws Exception; ! ! /** Moves to a specific record ! @param location Index of results to move to ! */ ! public boolean moveTo(int location) throws Exception; ! } --- 1,53 ---- ! /* ! IdrsDB.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.script; ! /** Interface used by all IDRS Data Stores */ ! public interface IdrsDB { ! /** ! pre:rs is populated<br> ! post:if the there is another record,<br> ! advance a record<br> ! readin the fields<br> ! else return false */ ! public boolean next() throws Exception; ! /** Retrieves data from a perticuler field with a given format @param fieldname Name of field being rechreaved ! @param format Format string being used, null if none ! */ public String getFieldData(String fieldname,String format) throws Exception; ! /** Retrieves data from a perticuler field @param fieldname Name of field being rechreaved ! */ public String getFieldData(String fieldname) throws Exception; /** Retrieves the results from an input db ! */ ! public int getUpdateResult() throws Exception; ! ! /** Moves to a specific record ! @param location Index of results to move to ! */ ! public boolean moveTo(int location) throws Exception; ! } |
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:35
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils
In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/utils
Modified Files:
DB.java CleanUp.java
Log Message:
Added Initial EJB Support
Index: DB.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/DB.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** DB.java 29 Dec 2002 04:01:56 -0000 1.13
--- DB.java 17 Mar 2003 14:05:00 -0000 1.14
***************
*** 40,45 ****
public static final int SQL = 2;
! public static final int TRANS_BEGIN = 0;
! public static final int TRANS_COMPLETE = 1;
--- 40,45 ----
public static final int SQL = 2;
! public static final int TRANS_BEGIN = 1;
! public static final int TRANS_COMPLETE = 2;
***************
*** 133,136 ****
--- 133,138 ----
this.numRecs = recs;
this.cursur = DB.CLIENT;
+
+ //System.out.println("numRecs : " + this.numRecs);
}
***************
*** 701,705 ****
if (this.cursur == DB.CLIENT) {
// System.out.println("Cursor client : ");
! System.out.println("Location : " + cursurLocation);
if ((rows.length > cursurLocation) && (cursurLocation < beginWith + numRecs)) {
this.fields = (HashMap) rows[this.cursurLocation];
--- 703,710 ----
if (this.cursur == DB.CLIENT) {
// System.out.println("Cursor client : ");
! //System.out.println("Location : " + cursurLocation);
! //System.out.println("rows.length : " + rows.length);
! //System.out.println("beginWith : " + beginWith);
! //System.out.println("numRecs : " + numRecs);
if ((rows.length > cursurLocation) && (cursurLocation < beginWith + numRecs)) {
this.fields = (HashMap) rows[this.cursurLocation];
***************
*** 767,770 ****
--- 772,776 ----
HashMap caches = null;
+ System.out.println("Client Cursor : " + (this.cursur == DB.CLIENT));
if (this.cursur == DB.CLIENT) {
caches = ((HashMap) idrs.getSession().getAttribute("IDRS_DB_CACHE"));
***************
*** 787,795 ****
if (! this.wasCached ) {
if (! idrs.isError()) {
if (type == METHOD) {
!
procMethod(obj,methodName,vars,idrs);
--- 793,803 ----
+ System.out.println("is cached? : " + this.wasCached);
if (! this.wasCached ) {
+ System.out.println("in here");
if (! idrs.isError()) {
if (type == METHOD) {
!
procMethod(obj,methodName,vars,idrs);
Index: CleanUp.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/utils/CleanUp.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CleanUp.java 6 Feb 2003 20:13:45 -0000 1.4
--- CleanUp.java 17 Mar 2003 14:05:00 -0000 1.5
***************
*** 33,36 ****
--- 33,40 ----
}
}
+
+ public void regChildStatements(CleanUp obj) {
+ statements.addAll(obj.statements);
+ }
|
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:35
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units
In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/deploy/compile/units
Modified Files:
Body.java
Log Message:
Added Initial EJB Support
Index: Body.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Body.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Body.java 6 Feb 2003 20:13:45 -0000 1.8
--- Body.java 17 Mar 2003 14:05:00 -0000 1.9
***************
*** 78,81 ****
--- 78,88 ----
public void field(String val,Attributes atts) throws Exception {
+
+ if (val.equalsIgnoreCase("<LineNum>") || val.equalsIgnoreCase("<ForeColor>") || val.equalsIgnoreCase("<BackColor>")) {
+ Line line = state.getCurrentLine();
+ line.addChunk(new net.sourceforge.idrs.core.report.FieldChunk("",val,"",state.getCurrentRepeatLine()));
+ return;
+ }
+
if (val.indexOf(".") == -1) {
state.setErrorWord(val);
***************
*** 146,158 ****
name = atts.getValue("name");
- if (val.indexOf(".") == -1) {
- state.setErrorWord(val);
- throw new Exception("Not A Valid Source Field");
- }
! if (state.getReport().getHead().getAllDBs().get(val.substring(0,val.indexOf("."))) == null) {
! state.setErrorWord(val);
! throw new Exception(val.substring(0,val.indexOf(".")) + " is not a valid DB");
! }
--- 153,159 ----
name = atts.getValue("name");
!
!
***************
*** 180,183 ****
--- 181,193 ----
}
+ if (isrcType == YesNo.SRC_DB && val.indexOf(".") == -1) {
+ state.setErrorWord(val);
+ throw new Exception("Not A Valid Source Field");
+ }
+
+ if (isrcType == YesNo.SRC_DB && state.getReport().getHead().getAllDBs().get(val.substring(0,val.indexOf("."))) == null) {
+ state.setErrorWord(val);
+ throw new Exception(val.substring(0,val.indexOf(".")) + " is not a valid DB");
+ }
state.getCurrentLine().addChunk(new YesNo(name,isingle,isrcType,val,attribs,paramFirst));
|
|
From: Marc B. <big...@us...> - 2003-03-17 14:05:05
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/jndi
In directory sc8-pr-cvs1:/tmp/cvs-serv25653/dev/src/net/sourceforge/idrs/jndi
Added Files:
JndiConnection.java JdbcJndiDriver.java
Log Message:
Added Initial EJB Support
--- NEW FILE: JndiConnection.java ---
/*
* JndiLdapConnection.java
*
* Created on March 10, 2002, 3:22 PM
*/
package net.sourceforge.idrs.jndi;
import java.sql.*;
import javax.naming.*;
import javax.naming.directory.*;
import javax.naming.ldap.*;
import java.util.*;
import net.sourceforge.idrs.exceptions.*;
/**
* Wraps a Jndi Connection to an EJB server
*@author Marc Boorshtein
*/
public class JndiConnection implements java.sql.Connection {
/** JNDI connection */
Context con;
/**Stores properties for initialization */
Hashtable env;
/**
*Returns the context used to connect
*/
public Context getContext() {
return this.con;
}
/**
*Initializes the Connection with a set of properties
*@param url URL of the server in the form ldap://server:port/base dn
*@param props Properties correspinding to Conneciton Constants
*/
public JndiConnection(String url, Properties props) throws SQLException {
props.put(Context.PROVIDER_URL,url);
try {
//System.out.println("gonna create");
this.con = new InitialContext(props);
//System.out.println("created");
}
catch (NamingException e) {
e.printStackTrace();
e.printStackTrace(System.out);
throw new SQLNamingException(e);
}
if (this.isClosed()) {
throw new SQLException("Connection Failed");
}
}
public void setTransactionIsolation(int param) throws java.sql.SQLException {
}
public boolean getAutoCommit() throws java.sql.SQLException {
return false;
}
public void close() throws java.sql.SQLException {
try {
con.close();
}
catch (NamingException e) {
throw new SQLNamingException(e);
}
}
public void commit() throws java.sql.SQLException {
}
public boolean isClosed() throws java.sql.SQLException {
return con == null;
}
public void setCatalog(java.lang.String str) throws java.sql.SQLException {
}
public java.sql.Savepoint setSavepoint() throws java.sql.SQLException {
return null;
}
public boolean isReadOnly() throws java.sql.SQLException {
return false;
}
public void setHoldability(int param) throws java.sql.SQLException {
}
public void rollback() throws java.sql.SQLException {
}
public java.lang.String getCatalog() throws java.sql.SQLException {
return null;
}
public java.sql.PreparedStatement prepareStatement(java.lang.String str, int param) throws java.sql.SQLException {
return null;
}
public java.sql.PreparedStatement prepareStatement(java.lang.String str, int param, int param2, int param3) throws java.sql.SQLException {
return null;
}
public java.sql.PreparedStatement prepareStatement(java.lang.String str, int param, int param2) throws java.sql.SQLException {
return null;
}
public void setAutoCommit(boolean param) throws java.sql.SQLException {
}
public java.sql.CallableStatement prepareCall(java.lang.String str) throws java.sql.SQLException {
return null;
}
public java.sql.PreparedStatement prepareStatement(java.lang.String str, int[] values) throws java.sql.SQLException {
return null;
}
public void setTypeMap(java.util.Map map) throws java.sql.SQLException {
}
public int getHoldability() throws java.sql.SQLException {
return -1;
}
public java.sql.Savepoint setSavepoint(java.lang.String str) throws java.sql.SQLException {
return null;
}
public java.sql.Statement createStatement(int param, int param1, int param2) throws java.sql.SQLException {
return null;
}
public java.sql.Statement createStatement(int param, int param1) throws java.sql.SQLException {
return null;
}
public java.sql.Statement createStatement() throws java.sql.SQLException {
return null;
}
public java.lang.String nativeSQL(java.lang.String str) throws java.sql.SQLException {
return null;
}
public java.sql.CallableStatement prepareCall(java.lang.String str, int param, int param2) throws java.sql.SQLException {
return null;
}
public java.sql.CallableStatement prepareCall(java.lang.String str, int param, int param2, int param3) throws java.sql.SQLException {
return null;
}
public java.sql.SQLWarning getWarnings() throws java.sql.SQLException {
return null;
}
public java.sql.PreparedStatement prepareStatement(java.lang.String str) throws java.sql.SQLException {
return null;
}
public void setReadOnly(boolean param) throws java.sql.SQLException {
}
public java.util.Map getTypeMap() throws java.sql.SQLException {
return null;
}
public void releaseSavepoint(java.sql.Savepoint savepoint) throws java.sql.SQLException {
}
public java.sql.PreparedStatement prepareStatement(java.lang.String str, java.lang.String[] str1) throws java.sql.SQLException {
return null;
}
public int getTransactionIsolation() throws java.sql.SQLException {
return -1;
}
public java.sql.DatabaseMetaData getMetaData() throws java.sql.SQLException {
return null;
}
public void clearWarnings() throws java.sql.SQLException {
}
public void rollback(java.sql.Savepoint savepoint) throws java.sql.SQLException {
}
}
--- NEW FILE: JdbcJndiDriver.java ---
/*
* JdbcLdapDriver.java
*
* Created on March 9, 2002, 4:49 PM
*/
package net.sourceforge.idrs.jndi;
import java.sql.*;
import java.lang.reflect.*;
import java.util.*;
import javax.naming.*;
/**
* Establishes a JNDI connection to an EJB Server. URLs are in the form :<br>
*<b>jdbc:ejb:factoryClass?ContextField1=val1:serverUrl</b>
*for any properties the driver accepts.
*/
public class JdbcJndiDriver implements java.sql.Driver {
/** Identifies the URL prefix */
public static final String URL_ID = "jdbc:ejb:";
/**Major Version of driver */
public static final int MAJOR_VERSION = 0;
/**Minor Version of driver */
public static final int MINOR_VERSION = 1;
/**Is JDBC Type IV Driver? */
public static final boolean JDBC_IV = false;
public static final String PARAM_DELIM = "=";
static {
try {
System.out.println("in static");
DriverManager.registerDriver(
new net.sourceforge.idrs.jndi.JdbcJndiDriver());
} catch (SQLException e) {
e.printStackTrace(System.out);
}
}
/** Creates new JdbcLdapDriver */
public JdbcJndiDriver() throws SQLException {
DriverManager.registerDriver(this);
}
/**
*Accepts URLs in the form ldap://host:port/basedn
*/
public boolean acceptsURL(java.lang.String str)
throws java.sql.SQLException {
System.out.println("in accepts url");
return str.substring(0, 9).equalsIgnoreCase(URL_ID);
}
public java.sql.Connection connect(
java.lang.String str,
java.util.Properties properties)
throws java.sql.SQLException {
System.out.println("in connection");
String props;
StringTokenizer toker;
String prop, val, token;
String factoryClass;
int beginUrl = str.indexOf(":", URL_ID.length());
String factory = str.substring(URL_ID.length(), beginUrl);
// System.out.println("factory : " + factory);
int seperator = factory.indexOf('?');
Field f;
if (seperator != -1) {
props = factory.substring(seperator + 1);
//System.out.println("props : " + props);
toker = new StringTokenizer(props, "&", false);
while (toker.hasMoreTokens()) {
token = toker.nextToken();
prop = token.substring(0, token.indexOf(PARAM_DELIM));
val =
token.substring(
token.indexOf(PARAM_DELIM) + PARAM_DELIM.length());
try {
f = Context.class.getField(prop);
if (f != null) {
properties.put(f.get(null), val);
}
} catch (NoSuchFieldException e) {
properties.put(prop, val);
} catch (IllegalAccessException e) {
throw new SQLException(e.toString());
}
}
factoryClass = factory.substring(0, seperator);
properties.put(Context.INITIAL_CONTEXT_FACTORY, factoryClass);
} else {
properties.put(Context.INITIAL_CONTEXT_FACTORY, factory);
}
System.out.println("loading props");
String user = properties.getProperty("user");
if (user != null) {
properties.remove("user");
properties.put(Context.SECURITY_PRINCIPAL, user);
}
String pass = properties.getProperty("password");
if (pass != null) {
properties.remove("password");
properties.put(Context.SECURITY_CREDENTIALS, pass);
}
System.out.println("loaded props");
Connection con = new JndiConnection(str.substring(beginUrl + 1), properties);
return con;
}
public int getMajorVersion() {
return MAJOR_VERSION;
}
public int getMinorVersion() {
return MINOR_VERSION;
}
public java.sql.DriverPropertyInfo[] getPropertyInfo(
java.lang.String str,
java.util.Properties properties)
throws java.sql.SQLException {
return null;
}
public boolean jdbcCompliant() {
return JDBC_IV;
}
}
|