[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units Object.java,1.3,1.4 Repeat
Brought to you by:
bigman921
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units
In directory sc8-pr-cvs1:/tmp/cvs-serv26777/dev/src/net/sourceforge/idrs/deploy/compile/units
Modified Files:
Object.java Repeat.java IfChange.java Portal.java
IfResults.java Db.java Body.java
Log Message:
1. Moved controller code into servlet
2. Added the ability for properties to be arrays of strings
3. Moved config file into it's own xml file
4. Added better compile errors for rml pages
5. removed all debug printings
Index: Object.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Object.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Object.java 23 Mar 2002 04:48:28 -0000 1.3
--- Object.java 6 Feb 2003 20:13:45 -0000 1.4
***************
*** 63,67 ****
--- 63,73 ----
*/
public void className (java.lang.String val, Attributes atts) throws Exception {
+ try {
obj.setClassName(val);
+ }
+ catch (Exception e) {
+ state.setErrorWord(val);
+ throw new Exception(val +" -- " + e.toString());
+ }
}
***************
*** 80,84 ****
*/
public void setProps(String val, Attributes atts) throws Exception {
! System.out.println("In SetProps : " + Boolean.getBoolean(val));
this.obj.retrieveProps(val.equalsIgnoreCase("true"));
}
--- 86,90 ----
*/
public void setProps(String val, Attributes atts) throws Exception {
! // System.out.println("In SetProps : " + Boolean.getBoolean(val));
this.obj.retrieveProps(val.equalsIgnoreCase("true"));
}
Index: Repeat.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Repeat.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Repeat.java 4 Mar 2002 23:05:35 -0000 1.2
--- Repeat.java 6 Feb 2003 20:13:45 -0000 1.3
***************
*** 42,45 ****
--- 42,49 ----
this.atts = atts;
id = atts.getValue("id");
+ if (state.getReport().getHead().getAllDBs().get(id) == null) {
+ state.setErrorWord(id);
+ throw new Exception(id + " is not a valid db");
+ }
color1 = atts.getValue("color1");
color2 = atts.getValue("color2");
***************
*** 72,76 ****
state.sealLine();
Vector lines = state.popLines();
! System.out.println("num lines repeat : " + lines.size());
repLine.setLines(lines);
--- 76,80 ----
state.sealLine();
Vector lines = state.popLines();
! //System.out.println("num lines repeat : " + lines.size());
repLine.setLines(lines);
Index: IfChange.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/IfChange.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IfChange.java 4 Mar 2002 23:05:35 -0000 1.1
--- IfChange.java 6 Feb 2003 20:13:45 -0000 1.2
***************
*** 66,74 ****
public void setAttributes(Attributes atts) throws Exception {
this.atts = atts;
String fieldname = atts.getValue("field");
String dbname = fieldname.substring(0,fieldname.indexOf("."));
! System.out.println("IfChange DbName : " + dbname);
fieldname = fieldname.substring(fieldname.indexOf(".") + 1);
! System.out.println("IfChange FieldName : " + fieldname);
ifck = new IfChangeChunk(dbname,fieldname);
state.getReport().getBody().regIfChange(ifck);
--- 66,91 ----
public void setAttributes(Attributes atts) throws Exception {
this.atts = atts;
+
String fieldname = atts.getValue("field");
+ if (fieldname == null || fieldname.trim().length()==0) {
+ state.setErrorWord("");
+ throw new Exception("Db and Field Name required in ifChange");
+
+ }
+
+ if (fieldname.indexOf(".")==-1) {
+ state.setErrorWord(fieldname);
+ throw new Exception(fieldname + " needs to have a period");
+ }
String dbname = fieldname.substring(0,fieldname.indexOf("."));
! //System.out.println("IfChange DbName : " + dbname);
fieldname = fieldname.substring(fieldname.indexOf(".") + 1);
! //System.out.println("IfChange FieldName : " + fieldname);
!
! if (state.getReport().getHead().getAllDBs().get(dbname) == null) {
! state.setErrorWord(dbname);
! throw new Exception(dbname + " is not a valid Db");
! }
!
ifck = new IfChangeChunk(dbname,fieldname);
state.getReport().getBody().regIfChange(ifck);
Index: Portal.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Portal.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Portal.java 22 Nov 2002 07:16:24 -0000 1.1
--- Portal.java 6 Feb 2003 20:13:45 -0000 1.2
***************
*** 43,48 ****
public void setAttributes(Attributes atts) throws Exception {
this.groups = atts.getValue("groups");
!
! portal = new PortalChunk(groups);
}
--- 43,54 ----
public void setAttributes(Attributes atts) throws Exception {
this.groups = atts.getValue("groups");
!
! try {
! portal = new PortalChunk(groups);
! }
! catch (Exception e) {
! state.setErrorWord(atts.getValue("groups"));
! throw new Exception(atts.getValue("groups") + " -- Must be a list of integers");
! }
}
***************
*** 72,76 ****
state.sealLine();
Vector lines = state.popLines();
! System.out.println("num lines repeat : " + lines.size());
portal.setLines(lines);
--- 78,82 ----
state.sealLine();
Vector lines = state.popLines();
! //System.out.println("num lines repeat : " + lines.size());
portal.setLines(lines);
Index: IfResults.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/IfResults.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IfResults.java 4 Mar 2002 23:05:35 -0000 1.1
--- IfResults.java 6 Feb 2003 20:13:45 -0000 1.2
***************
*** 46,49 ****
--- 46,53 ----
public void setAttributes(Attributes atts) throws Exception {
super.setAttributes(atts);
+ if (state.getReport().getHead().getAllDBs().get(atts.getValue("db") ) == null ) {
+ state.setErrorWord(atts.getValue("db"));
+ throw new Exception(atts.getValue("db") + " is not a valid Db");
+ }
ifrs = new IfResultsChunk(atts.getValue("db"));
}
Index: Db.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Db.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Db.java 16 Sep 2002 15:19:42 -0000 1.6
--- Db.java 6 Feb 2003 20:13:45 -0000 1.7
***************
*** 90,93 ****
--- 90,97 ----
objid = atts.getValue("objid");
obj = this.state.getReport().getHead().getObjectStore(objid);
+ if (obj == null) {
+ state.setErrorWord(objid);
+ throw new Exception(objid + " is not a valid Object");
+ }
db.setType(DB.METHOD);
db.setObjectStore(obj);
***************
*** 112,115 ****
--- 116,123 ----
else if (val.equalsIgnoreCase("complete")) {
db.setTransactionType(DB.TRANS_COMPLETE);
+ }
+ else {
+ state.setErrorWord(val);
+ throw new Exception(val + " must be BEGIN or COMPLETE");
}
}
Index: Body.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Body.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Body.java 22 Nov 2002 07:16:24 -0000 1.7
--- Body.java 6 Feb 2003 20:13:45 -0000 1.8
***************
*** 77,84 ****
--- 77,95 ----
public void field(String val,Attributes atts) throws Exception {
+
+ 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();
***************
*** 92,95 ****
--- 103,110 ----
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));
***************
*** 105,110 ****
public void text(String val,Attributes atts) throws Exception {
! System.out.println("val = \"" + val + "\"");
! System.out.println("this is : " + this);
/*if (val.indexOf('\n') != -1) {
StringTokenizer tok = new StringTokenizer(val,"\n",false);
--- 120,125 ----
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);
***************
*** 131,134 ****
--- 146,159 ----
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");
+ }
+
paramFirst = atts.getValue("paramFirst") != null ? atts.getValue("paramFirst").equalsIgnoreCase("true") : false;
***************
*** 149,153 ****
if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
! else isrcType = YesNo.SRC_PROP;
state.getCurrentLine().addChunk(new YesNo(name,isingle,isrcType,val,attribs,paramFirst));
--- 174,183 ----
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");
! }
!
state.getCurrentLine().addChunk(new YesNo(name,isingle,isrcType,val,attribs,paramFirst));
***************
*** 170,176 ****
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");
--- 200,210 ----
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");
***************
*** 180,183 ****
--- 214,219 ----
name = atts.getValue("name");
type = atts.getValue("type");
+
+
itype = type.equalsIgnoreCase("hidden") ? InputChunk.INPUT_HIDDEN : itype;
***************
*** 187,190 ****
--- 223,233 ----
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");
+ }
+
***************
*** 195,199 ****
if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
! else isrcType = YesNo.SRC_PROP;
state.getCurrentLine().addChunk(new InputChunk(name,itype,isrcType,val,value,attribs,paramFirst));
--- 238,256 ----
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));
***************
*** 204,208 ****
* Handles the formInput tag
*/
! public void fromSelect(String val, Attributes atts) throws Exception {
String name,srcType,type, attribs,value,srcDB,lstId,lstVal;
int isrcType,isingle,itype=-1;
--- 261,265 ----
* 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;
***************
*** 227,233 ****
if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
! else isrcType = YesNo.SRC_PROP;
srcDB = atts.getValue("srcDB");
lstId = atts.getValue("srcID");
lstVal = atts.getValue("srcVal");
--- 284,295 ----
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");
***************
*** 252,256 ****
Vector lines = state.popLines();
! System.out.println("body lines : " + lines.size());
state.getReport().getBody().setLines(lines);
state.getReport().getBody().seal();
--- 314,318 ----
Vector lines = state.popLines();
! // System.out.println("body lines : " + lines.size());
state.getReport().getBody().setLines(lines);
state.getReport().getBody().seal();
|