[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/core/report FieldChunk.class,1.4,1.5 IDRSBody.c
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2002-03-04 23:05:37
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report
In directory usw-pr-cvs1:/tmp/cvs-serv28790/src/net/sourceforge/idrs/core/report
Modified Files:
FieldChunk.class IDRSBody.class IDRSBody.java IDRSHead.class
IDRSHead.java IfChangeChunk.class IfChangeChunk.java
IfResultsChunk.java Int.class Line.java RepeatLine.class
RepeatLine.java
Log Message:
Completed initial xml compilation system
Index: FieldChunk.class
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/FieldChunk.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
Binary files /tmp/cvsDL7uYY and /tmp/cvsqZvsFN differ
Index: IDRSBody.class
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSBody.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
Binary files /tmp/cvsxz9Ht0 and /tmp/cvsGrbQPQ differ
Index: IDRSBody.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSBody.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IDRSBody.java 14 Sep 2001 23:46:42 -0000 1.3
--- IDRSBody.java 4 Mar 2002 23:05:34 -0000 1.4
***************
*** 2,14 ****
IDRSBody.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;
--- 2,14 ----
IDRSBody.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;
***************
*** 17,109 ****
/**
! IDRSBody<br>
! Encapsulates presentation logic of the IDRS through an internal list of Line objects
! */
public class IDRSBody implements Serializable{
! protected Vector lines;
! protected Vector ifs;
! protected boolean html;
! protected transient StringBuffer buffer;
! static final long serialVersionUID = 7728346799372058365L;
! /**
! This method preps the body before a report is generated
! */
! public void prepBody() {
! int i;
! IfChangeChunk ifch;
! for (i=0;i<ifs.size();i++) {
! ifch = (IfChangeChunk) ifs.elementAt(i);
! ifch.reset();
! }
! }
!
!
! /**
! Contructor, build internal lists
! */
! public IDRSBody() {
! lines = new Vector();
! ifs = new Vector();
! }
!
! /**
! Used to add Line to internal list
! @param line Line object to be added
! */
! public void addLine(Line line) {
! lines.addElement(line);
! }
!
! /**
! Used to register an "<ifchange>" tag for reset at the beginning of a report
! @param chunk IfChangeChunk to be registered
! */
! public void regIfChange(IfChangeChunk chunk) throws Exception {
! ifs.addElement(chunk);
! }
!
! /**
! Generates the results of a report
! @param head IDRSHead object to be used for business logic
! */
! public String toString(IDRSHead head) throws Exception {
! prepBody();
! buffer = new StringBuffer();
! head.setPrintTarget(buffer);
! int i = 0;
! String output = head.getText(this);
! Line ln;
! for (i=0; i< lines.size(); i++) {
! ln = (Line) lines.elementAt(i);
! if (ln == null) {
! //output += "\n";
! buffer.append("\n");
! }
! else {
! //output += ln.toString(head) + "\n";
! ln.toString(head,buffer);
! buffer.append("\n");
! }
! }
!
!
! return buffer.toString();
!
! }
!
! /**
! Defines wether or not a report is HTML
! */
! public boolean isHTML() {
! return html;
! }
!
!
! /**
! Sets wether or not a report is HTML
! @param html Wether or not report is html
! */
! public void isHTML(boolean html) {
! this.html = html;
! }
}
--- 17,136 ----
/**
! * IDRSBody<br>
! * Encapsulates presentation logic of the IDRS through an internal list of Line objects
! */
public class IDRSBody implements Serializable{
! protected transient Vector vlines;
! protected transient Vector vifs;
!
! protected Line[] lines;
! protected IfChangeChunk ifchgs[];
!
! protected boolean html;
! protected transient StringBuffer buffer;
! static final long serialVersionUID = -1199651006178322632L;
!
! /**
! * This method preps the body before a report is generated
! */
! public void prepBody() {
! int i;
! IfChangeChunk ifch;
! for (i=0;i<ifchgs.length;i++) {
! ifch = ifchgs[i];
! ifch.reset();
! }
! }
!
!
! /**
! * Contructor, build internal lists
! */
! public IDRSBody() {
! vlines = new Vector();
! vifs = new Vector();
! }
!
! /**
! * Used to add Line to internal list
! * @param line Line object to be added
! */
! public void addLine(Line line) {
! vlines.addElement(line);
! }
!
! /**
! * Used to register an "<ifchange>" tag for reset at the beginning of a report
! * @param chunk IfChangeChunk to be registered
! */
! public void regIfChange(IfChangeChunk chunk) throws Exception {
! vifs.addElement(chunk);
! }
!
! /**
! * Generates the results of a report
! * @param head IDRSHead object to be used for business logic
! */
! public String toString(IDRSHead head) throws Exception {
! prepBody();
! buffer = new StringBuffer();
! head.setPrintTarget(buffer);
! int i = 0;
! String output = head.getText(this);
! Line ln;
! System.out.println("lines : " + lines.length);
! for (i=0; i< lines.length; i++) {
! ln = lines[i];
! if (ln == null) {
! //output += "\n";
! if (buffer.charAt(buffer.length()-1)!='\n')
! buffer.append("\n");
!
! }
! else {
! //output += ln.toString(head) + "\n";
! ln.toString(head,buffer);
! if (buffer.charAt(buffer.length()-1)!='\n')
! buffer.append("\n");
! }
! }
!
!
! return buffer.toString();
!
! }
!
! /**
! * Defines wether or not a report is HTML
! */
! public boolean isHTML() {
! return html;
! }
!
!
! /**
! * Sets wether or not a report is HTML
! * @param html Wether or not report is html
! */
! public void isHTML(boolean html) {
! this.html = html;
! }
!
!
! /**
! * Sets the vector constaing the lines for the containor
! *@param lines Lines being used
! */
!
! public void setLines(Vector lines) {
! this.vlines = lines;
! }
!
! public void seal() {
! lines = new Line[vlines.size()];
! System.arraycopy(vlines.toArray(),0,lines,0,lines.length);
!
! ifchgs = new IfChangeChunk[vifs.size()];
! System.arraycopy(this.vifs.toArray(),0,ifchgs,0,ifchgs.length);
! }
}
Index: IDRSHead.class
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSHead.class,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
Binary files /tmp/cvsb3wPa1 and /tmp/cvsCfth0R differ
Index: IDRSHead.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IDRSHead.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** IDRSHead.java 27 Feb 2002 23:56:31 -0000 1.5
--- IDRSHead.java 4 Mar 2002 23:05:34 -0000 1.6
***************
*** 12,620 ****
public final class IDRSHead implements Serializable, IDRSScript {
! protected String header;
! protected String text;
! protected HashMap dbs;
! protected HashMap objects;
! protected String scriptClass;
! protected HashMap vars;
! protected HashMap varNames;
! protected HashMap pos;
[...1187 lines suppressed...]
! return this.send;
! }
!
! public UserInfo getUserInfo() throws Exception {
! return this.userInfo;
! }
!
! public void close() throws Exception {
! DB db;
! for (int i=0,m=dbNames.length;i<m;i++) {
! db = (DB) dbs.get(dbNames[i]);
! db.close();
! }
}
}
class Int implements Serializable {
! int v;
}
Index: IfChangeChunk.class
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IfChangeChunk.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
Binary files /tmp/cvsZtEAz6 and /tmp/cvssSwFV2 differ
Index: IfChangeChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IfChangeChunk.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IfChangeChunk.java 15 Sep 2001 17:33:28 -0000 1.3
--- IfChangeChunk.java 4 Mar 2002 23:05:34 -0000 1.4
***************
*** 28,35 ****
protected String current;
protected transient Vector vlines;
! protected Object[] lines;
protected boolean sealed = false;
! static final long serialVersionUID = -925936481381642752L;
/**
--- 28,35 ----
protected String current;
protected transient Vector vlines;
! protected Line[] lines;
protected boolean sealed = false;
! static final long serialVersionUID = 1456351148807430724L;
/**
***************
*** 65,69 ****
*/
public String toString(IDRSHead head,StringBuffer buffer) throws Exception {
! Line line;
//StringBuffer output = new StringBuffer("");
--- 65,70 ----
*/
public String toString(IDRSHead head,StringBuffer buffer) throws Exception {
!
! Line line;
//StringBuffer output = new StringBuffer("");
***************
*** 77,80 ****
--- 78,82 ----
run = ((! dataVal.equalsIgnoreCase(current)) || (current == null));
+
//we'll update current regardless
current = dataVal;
***************
*** 84,88 ****
int i =0;
while (i < lines.length) {
! line = (Line) lines[i];
//buffer.append( line.toString(head) );
line.toString(head,buffer);
--- 86,90 ----
int i =0;
while (i < lines.length) {
! line = lines[i];
//buffer.append( line.toString(head) );
line.toString(head,buffer);
***************
*** 102,113 ****
public void seal() {
if (! sealed) {
! lines = new Object[vlines.size()];
int i=0;
for (i=0;i<vlines.size();i++) {
! lines[i] = vlines.get(i);
! System.out.println("Line : " + i + " " + lines[i]);
if (lines[i] != null) {
! ((Line) lines[i]).seal();
}
else {
--- 104,115 ----
public void seal() {
if (! sealed) {
! lines = new Line[vlines.size()];
int i=0;
for (i=0;i<vlines.size();i++) {
! lines[i] = (Line) vlines.get(i);
!
if (lines[i] != null) {
! //((Line) lines[i]).seal();
}
else {
***************
*** 128,132 ****
public String toString(IDRSHead head) {
return "";
!
}
}
--- 130,143 ----
public String toString(IDRSHead head) {
return "";
!
}
+
+ /**
+ * Sets the vector constaing the lines for the containor
+ *@param lines Lines being used
+ */
+
+ public void setLines(Vector lines) {
+ this.vlines = lines;
+ }
}
Index: IfResultsChunk.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/IfResultsChunk.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IfResultsChunk.java 15 Sep 2001 17:33:28 -0000 1.3
--- IfResultsChunk.java 4 Mar 2002 23:05:34 -0000 1.4
***************
*** 2,14 ****
IfResultsChunk.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;
--- 2,14 ----
IfResultsChunk.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;
***************
*** 19,147 ****
/**
! Encapsulates the <ifresults> tag
! */
public class IfResultsChunk extends Line implements Chunk, Serializable {
! protected transient Vector velines;
! protected transient Vector vdlines;
! protected Object[] elines;
! protected Object[] dlines;
! protected String dbname;
! boolean sealed=false;
!
! /**
! Initializes the chunk
! @param dbname The name of the DB to retrieve wether there were results
! */
! public IfResultsChunk(String dbname) {
! velines=new Vector();
! vdlines=new Vector();
! this.dbname=dbname;
! }
!
! /**
! Add a line to be executed when there have been results
! @param line Line to be added
! */
! public void addExecuteLine(Line line) {
! velines.add(line);
! }
!
! /**
! Add a line to be executed when there have not been results
! @param line Line to be added
! */
! public void addNoExecuteLine(Line line) {
! vdlines.add(line);
! }
!
! /**
! "Seals" the report head into static data structures from dynamic ones
! */
! public void seal() {
! if (! sealed) {
! this.elines = new Object[velines.size()];
! this.dlines = new Object[vdlines.size()];
! int i=0;
! for (i=0;i<velines.size();i++) {
! this.elines[i] = velines.get(i);
! if (elines[i] != null) {
! ((Line) elines[i]).seal();
! }
! else {
! elines[i] = new Line();
! ((Line) elines[i]).addChunk(new TextChunk(""));
! ((Line) elines[i]).seal();
! }
!
!
!
! }
!
! for (i=0;i<vdlines.size();i++) {
! this.dlines[i] = vdlines.get(i);
! if (dlines[i] != null) {
! ((Line) dlines[i]).seal();
! }
! else {
! dlines[i] = new Line();
! ((Line) dlines[i]).addChunk(new TextChunk(""));
! ((Line) dlines[i]).seal();
! }
!
!
!
! }
! sealed = true;
! velines.removeAllElements();
! vdlines.removeAllElements();
! }
! }
!
! /**
! Method called by parent to generate a string representation of this tag
! @param head The IDRSHead
! @param buffer The StringBuffer being used to buffer the output of the report
! */
! public String toString(IDRSHead head, StringBuffer buffer) throws Exception {
! DB db = head.getDB(dbname);
!
! int i =0;
! Line line;
! String ln;
!
! if (db.hasResults()) {
! while (i < this.elines.length) {
! line = (Line) elines[i];
!
! ln = line.toString(head,buffer);
! //if (ln != null)
! buffer.append("\n");
!
! i++;
! }
! }
! else {
! while (i < this.dlines.length) {
! line = (Line) dlines[i];
!
! ln = line.toString(head,buffer);
! //if (ln != null)
! buffer.append("\n");
!
! i++;
! }
}
- //return output.toString();
- return null;
- }
-
- /**
- Does nothing, fulfills Chunk interface
- */
- public String toString(IDRSHead head) {
- return "";
- }
-
}
--- 19,173 ----
/**
! * Encapsulates the <ifresults> tag
! */
public class IfResultsChunk extends Line implements Chunk, Serializable {
! protected transient boolean setYes;
! protected transient Vector velines;
! protected transient Vector vdlines;
! protected Line[] elines;
! protected Line[] dlines;
! protected String dbname;
! boolean sealed=false;
! static final long serialVersionUID = 5319630905811156732L;
! /**
! * Initializes the chunk
! * @param dbname The name of the DB to retrieve wether there were results
! */
! public IfResultsChunk(String dbname) {
! velines=new Vector();
! vdlines=new Vector();
! setYes = false;
! this.dbname=dbname;
! }
!
! /**
! * Add a line to be executed when there have been results
! * @param line Line to be added
! */
! public void addExecuteLine(Line line) {
! velines.add(line);
! }
!
! /**
! * Add a line to be executed when there have not been results
! * @param line Line to be added
! */
! public void addNoExecuteLine(Line line) {
! vdlines.add(line);
! }
!
! /**
! * "Seals" the report head into static data structures from dynamic ones
! */
! public void seal() {
! if (! sealed) {
! this.elines = new Line[velines.size()];
! this.dlines = new Line[vdlines.size()];
! int i=0;
! for (i=0;i<velines.size();i++) {
! this.elines[i] = (Line) velines.get(i);
! if (elines[i] != null) {
! //((Line) elines[i]).seal();
! }
! else {
! elines[i] = new Line();
! ((Line) elines[i]).addChunk(new TextChunk(""));
! ((Line) elines[i]).seal();
! }
!
!
!
! }
!
! for (i=0;i<vdlines.size();i++) {
! this.dlines[i] = (Line) vdlines.get(i);
! if (dlines[i] != null) {
! //((Line) dlines[i]).seal();
! }
! else {
! dlines[i] = new Line();
! ((Line) dlines[i]).addChunk(new TextChunk(""));
! ((Line) dlines[i]).seal();
! }
!
!
!
! }
! sealed = true;
! velines.removeAllElements();
! vdlines.removeAllElements();
! }
! }
!
! /**
! * Method called by parent to generate a string representation of this tag
! * @param head The IDRSHead
! * @param buffer The StringBuffer being used to buffer the output of the report
! */
! public String toString(IDRSHead head, StringBuffer buffer) throws Exception {
! DB db = head.getDB(dbname);
!
! int i =0;
! Line line;
! String ln;
!
! if (db.hasResults()) {
! while (i < this.elines.length) {
! line = elines[i];
!
! ln = line.toString(head,buffer);
! //if (ln != null)
! if (buffer.charAt(buffer.length()-1)!='\n')
! buffer.append("\n");
!
! i++;
! }
! }
! else {
! while (i < this.dlines.length) {
! line = dlines[i];
!
! ln = line.toString(head,buffer);
! //if (ln != null)
! if (buffer.charAt(buffer.length()-1)!='\n')
! buffer.append("\n");
!
! i++;
! }
! }
!
! buffer.deleteCharAt(buffer.length()-1);
!
!
! //return output.toString();
! return null;
! }
!
! /**
! Does nothing, fulfills Chunk interface
! */
! public String toString(IDRSHead head) {
! return "";
! }
!
! /**
! * Sets the vector constaing the lines for the containor
! *@param lines Lines being used
! */
!
! public void setLines(Vector lines) {
! if (! setYes) {
! this.velines = lines;
! setYes = true;
! System.out.println("Set Yes");
! }
! else {
! this.vdlines = lines;
! System.out.println("Set No");
! }
!
!
}
}
Index: Int.class
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/Int.class,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
Binary files /tmp/cvsTmUuu9 and /tmp/cvs6QljP8 differ
Index: Line.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/Line.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Line.java 15 Sep 2001 17:33:28 -0000 1.3
--- Line.java 4 Mar 2002 23:05:34 -0000 1.4
***************
*** 23,28 ****
public class Line implements Serializable {
protected transient Vector vchunks; //this array holds all of the chuncks for a given line
! protected Object[] chunks;
! static final long serialVersionUID = -8504813097021808175L;
--- 23,28 ----
public class Line implements Serializable {
protected transient Vector vchunks; //this array holds all of the chuncks for a given line
! protected Chunk[] chunks;
! static final long serialVersionUID = 786019973821495030L;
***************
*** 53,57 ****
Chunk ch;
for (int i=0; i<chunks.length;i++) {
! ch = (Chunk) chunks[i];
buffer.append(ch.toString(head));
}
--- 53,57 ----
Chunk ch;
for (int i=0; i<chunks.length;i++) {
! ch = chunks[i];
buffer.append(ch.toString(head));
}
***************
*** 93,101 ****
public void seal() {
! chunks = new Object[vchunks.size()];
int i=0;
for (i=0;i<vchunks.size();i++) {
! chunks[i] = vchunks.get(i);
}
vchunks.removeAllElements();
--- 93,101 ----
public void seal() {
! chunks = new Chunk[vchunks.size()];
int i=0;
for (i=0;i<vchunks.size();i++) {
! chunks[i] = (Chunk) vchunks.get(i);
}
vchunks.removeAllElements();
Index: RepeatLine.class
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/RepeatLine.class,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
Binary files /tmp/cvsjxTsbc and /tmp/cvsAOvwXd differ
Index: RepeatLine.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/report/RepeatLine.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** RepeatLine.java 21 Sep 2001 13:55:38 -0000 1.4
--- RepeatLine.java 4 Mar 2002 23:05:34 -0000 1.5
***************
*** 2,14 ****
RepeatLine.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.
! */
--- 2,14 ----
RepeatLine.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.
! */
***************
*** 20,185 ****
/**
! Encapsulates the <repeat> tag
! */
public class RepeatLine extends Line implements Serializable, Chunk {
! int lineNum;
! String color1;
! String color2;
! String id;
! transient Vector vlines;
! boolean sealed = false;
! Object[] lines;
! static final long serialVersionUID = -7969399508243503007L;
! /**
Initializes the RepeatLine
! @param id ID of DB being iterated through
! @param color1 First forecolor used
! @param color2 First backcolor used
! */
! public RepeatLine(String id, String color1, String color2) {
! //this contructor initializes the size of the line
! this.color1 = color1;
! this.color2 = color2;
! this.id = id;
! vlines = new Vector();
! }
!
! /**
Adds a line to the <repeat>
! @param line Line to add
! */
! public void addLine(Line line) {
! vlines.add(line);
! }
!
! /**
Public method to retrieve the information about the all of the Chunks stored in the Line
! @param head IDRSHead of report
! @param buffer Buffered output of report
! */
! public String toString(IDRSHead head, StringBuffer buffer) throws Exception {
! DB db = head.getDB(id);
! lineNum = 0;
! int i =0;
! Line line;
! String ln;
! //StringBuffer output = new StringBuffer("");
! while (db.next()) {
! while (i < this.lines.length) {
! line = (Line) lines[i];
!
! ln = line.toString(head,buffer);
! //if (ln != null)
! buffer.append("\n");
!
! i++;
! }
! i=0;
! lineNum++;
}
- lineNum=0;
! //return output.toString();
! return null;
! }
!
!
!
! /**
Wether or not the set should has another results
! @param db DB being inspected
! */
! protected boolean rsContinue(DB db) throws Exception {
! boolean ok;
! boolean hasNext;
! if (db.getIsPaged()) {
! //hasNext = db.next();
!
!
!
! return ((db.getNumRecs() > (db.getCurrLocation() - db.getFirstRec())) && db.next());
!
! }
! else {
! return (db.next());
}
! }
!
! /**
Retrieves current forecolor
! */
! public String getForeColor() {
! System.out.println("Line Num : " + lineNum);
! System.out.println("Color1 : " + color1);
! System.out.println("Color2 : " + color2);
! if (lineNum % 2 == 0) {
! return color1;
! }
! else {
! return color2;
! }
! }
!
! /**
Retrieves current backcolor
! */
! public String getBackColor() {
! System.out.println("Line Num : " + lineNum);
! System.out.println("Color1 : " + color1);
! System.out.println("Color2 : " + color2);
! if (lineNum % 2 != 0) {
! return color1;
! }
! else {
! return color2;
! }
! }
!
! /**
Retrieves current line number
! */
! public int getLineNum() {
! return lineNum;
! }
!
/**
! "Seals" the report head into static data structures from dynamic ones
! */
! public void seal() {
! if (! sealed) {
! this.lines = new Object[vlines.size()];
!
! int i=0;
! for (i=0;i<vlines.size();i++) {
! this.lines[i] = vlines.get(i);
! if (lines[i] != null) {
! ((Line) lines[i]).seal();
! }
! else {
! lines[i] = new Line();
! ((Line) lines[i]).addChunk(new TextChunk(""));
! ((Line) lines[i]).seal();
! }
!
!
!
! }
! sealed = true;
! vlines.removeAllElements();
! }
!
!
! }
!
! /**
! Does nothing, fulfills Chunk interface
! */
! public String toString(IDRSHead head) {
! return "";
!
! }
!
}
--- 20,203 ----
/**
! * Encapsulates the <repeat> tag
! */
public class RepeatLine extends Line implements Serializable, Chunk {
! int lineNum;
! String color1;
! String color2;
! String id;
! transient Vector vlines;
! boolean sealed = false;
! Line[] lines;
! static final long serialVersionUID = 45361395890117839L;
! /**
Initializes the RepeatLine
! @param id ID of DB being iterated through
! @param color1 First forecolor used
! @param color2 First backcolor used
! */
! public RepeatLine(String id, String color1, String color2) {
! //this contructor initializes the size of the line
!
! this.color1 = color1;
! this.color2 = color2;
! this.id = id;
! vlines = new Vector();
! }
! /*
Adds a line to the <repeat>
! *@param lines Lines being used
!
!
! public void setLines(Vector lines) {
! this.lines = lines;
! }*/
!
! /**
! * Sets the vector constaing the lines for the containor
! @param line Line to add
! */
! public void addLine(Line line) {
! vlines.add(line);
! }
!
! /**
Public method to retrieve the information about the all of the Chunks stored in the Line
! @param head IDRSHead of report
! @param buffer Buffered output of report
! */
! public String toString(IDRSHead head, StringBuffer buffer) throws Exception {
! DB db = head.getDB(id);
! lineNum = 0;
! int i =0;
! Line line;
! String ln;
! //StringBuffer output = new StringBuffer("");
! while (db.next()) {
! while (i < this.lines.length) {
! line = lines[i];
!
! ln = line.toString(head,buffer);
! //if (ln != null)
! if (buffer.charAt(buffer.length()-1)!='\n')
! buffer.append("\n");
!
! i++;
! }
!
! i=0;
! lineNum++;
! }
! buffer.deleteCharAt(buffer.length()-1);
! lineNum=0;
!
! //return output.toString();
! return null;
}
!
! /**
Wether or not the set should has another results
! @param db DB being inspected
! */
! protected boolean rsContinue(DB db) throws Exception {
! boolean ok;
! boolean hasNext;
! if (db.getIsPaged()) {
! //hasNext = db.next();
!
!
!
! return ((db.getNumRecs() > (db.getCurrLocation() - db.getFirstRec())) && db.next());
!
! }
! else {
! return (db.next());
! }
}
!
! /**
Retrieves current forecolor
! */
! public String getForeColor() {
!
! if (lineNum % 2 == 0) {
! return color1;
! }
! else {
! return color2;
! }
! }
!
! /**
Retrieves current backcolor
! */
! public String getBackColor() {
!
! if (lineNum % 2 != 0) {
! return color1;
! }
! else {
! return color2;
! }
! }
!
! /**
Retrieves current line number
! */
! public int getLineNum() {
! return lineNum;
! }
!
/**
! * "Seals" the report head into static data structures from dynamic ones
! */
! public void seal() {
! if (! sealed) {
!
! this.lines = new Line[vlines.size()];
!
! int i=0;
! for (i=0;i<vlines.size();i++) {
! this.lines[i] = (Line) vlines.get(i);
! if (lines[i] != null) {
! //((Line) lines[i]).seal();
! }
! else {
! lines[i] = new Line();
! ((Line) lines[i]).addChunk(new TextChunk(""));
! ((Line) lines[i]).seal();
! }
!
!
!
! }
! sealed = true;
! vlines.removeAllElements();
! }
!
!
! }
!
! /**
! * Does nothing, fulfills Chunk interface
! */
! public String toString(IDRSHead head) {
!
! System.out.println("in RepeatLine toString()");
! return "";
! }
!
! /**
! * Sets the vector constaing the lines for the containor
! *@param lines Lines being used
! */
!
! public void setLines(Vector lines) {
! this.vlines = lines;
! }
!
}
|