[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units Body.class,NONE,1.1 Head.j
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2002-11-22 07:16:27
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units
In directory sc8-pr-cvs1:/tmp/cvs-serv9439/net/sourceforge/idrs/deploy/compile/units
Modified Files:
Body.java
Added Files:
Body.class Head.java~ Portal.java Repeat.class Rml.class
Log Message:
added portal and selectInput tags
--- NEW FILE: Body.class ---
Êþº¾
Exceptions
echoScript
SourceFile
*+·
M,»
:»
:»
N-»
»
»
¶
:»
»
--- NEW FILE: Head.java~ ---
/*
Head.java
Copyright (C) 2002 Marc Boorshtein
The contents of this file are subject to the Mozilla Public License Version 1.0 (the License);
you may not use this file except in compliance with the License. You may obtain a copy of the
License at http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
*/
/**
*Implements Head tag
*/
package net.sourceforge.idrs.deploy.compile.units;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.*;
import java.util.*;
import net.sourceforge.idrs.core.report.*;
import net.sourceforge.idrs.deploy.compile.Compiler;
import net.sourceforge.idrs.deploy.compile.CompilerState;
public class Head extends net.sourceforge.idrs.deploy.compile.Compiler {
/** Creates new Head */
public Head() {
}
/**
* allows for the execution of any wrap-up code at the hitting of the end tag
*/
public void seal() throws Exception {
if (this.state.getReport().getBody().isHTML()) {
this.state.getReport().getHead().addText("</HEAD>");
}
this.state.getReport().getHead().seal();
}
/**
* allows for a compiler to use the attributes of the calling tag
*/
public void setAttributes(Attributes atts) throws Exception {
String tag;
int i;
if (this.state==null) System.out.println("state null");
IDRSRep rep = this.state.getReport();
if (rep == null) System.out.println("Rep Null");
IDRSBody body = rep.getBody();
if (body == null) System.out.println("Body Null");
boolean ishtml = body.isHTML();
if (ishtml) {
tag = "<HEAD ";
for (i=0; i < atts.getLength(); i++) {
tag += atts.getLocalName(i) + "=\"" + atts.getValue(i) + "\" ";
}
tag += ">";
this.state.getReport().getHead().addText(tag);
}
}
public void text(java.lang.String val, Attributes atts) throws Exception {
this.state.getReport().getHead().addText(val);
}
}
--- NEW FILE: Portal.java ---
/*
Portal.java
Copyright (C) 2002 Marc Boorshtein
The contents of this file are subject to the Mozilla Public License Version 1.0 (the License);
you may not use this file except in compliance with the License. You may obtain a copy of the
License at http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific
language governing rights and limitations under the License.
*/
/**
*Implements repeat tag
*/
package net.sourceforge.idrs.deploy.compile.units;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import javax.xml.parsers.*;
import java.util.*;
import net.sourceforge.idrs.core.report.*;
import net.sourceforge.idrs.deploy.compile.Compiler;
import net.sourceforge.idrs.deploy.compile.CompilerState;
import net.sourceforge.idrs.utils.ObjectStore;
public class Portal extends net.sourceforge.idrs.deploy.compile.units.Body {
String groups;
PortalChunk portal;
/** Creates new portal */
public Portal() {
}
/**
*allows for a compiler to use the attributes of the calling tag
*/
public void setAttributes(Attributes atts) throws Exception {
this.groups = atts.getValue("groups");
portal = new PortalChunk(groups);
}
/**
*allows for the compiler to work with the current state of the page compilation
*/
public void setState(CompilerState state) throws Exception {
this.state = state;
state.sealLine();
state.pushLines();
//state.addRepeatLine(id,color1,color2);
}
/**
*Retrieves the current repeat line
*/
public PortalChunk getPortalLine() {
return this.portal;
}
/**
* allows for the execution of any wrap-up code at the hitting of the end tag
*/
public void seal() throws Exception {
//if (state.getCurrentLine() != null)
state.sealLine();
Vector lines = state.popLines();
System.out.println("num lines repeat : " + lines.size());
portal.setLines(lines);
state.setLine(portal);
state.sealLine();
}
}
--- NEW FILE: Repeat.class ---
Êþº¾
Exceptions
SourceFile
*»
·
*+·
--- NEW FILE: Rml.class ---
Êþº¾
SourceFile
Index: Body.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/compile/units/Body.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Body.java 16 Sep 2002 15:19:42 -0000 1.6
--- Body.java 22 Nov 2002 07:16:24 -0000 1.7
***************
*** 106,109 ****
--- 106,110 ----
public void text(String val,Attributes atts) throws Exception {
System.out.println("val = \"" + val + "\"");
+ System.out.println("this is : " + this);
/*if (val.indexOf('\n') != -1) {
StringTokenizer tok = new StringTokenizer(val,"\n",false);
***************
*** 157,165 ****
state.getCurrentLine().addChunk(new NavNextChunk(val));
}
!
public void navPrev(String val, Attributes atts) throws Exception {
state.getCurrentLine().addChunk(new NavPrevChunk(val));
}
!
/**
* Handles the formInput tag
--- 158,166 ----
state.getCurrentLine().addChunk(new NavNextChunk(val));
}
!
public void navPrev(String val, Attributes atts) throws Exception {
state.getCurrentLine().addChunk(new NavPrevChunk(val));
}
!
/**
* Handles the formInput tag
***************
*** 169,183 ****
int isrcType,isingle,itype=-1;
boolean paramFirst;
!
paramFirst = atts.getValue("paramFirst") != null ? atts.getValue("paramFirst").equalsIgnoreCase("true") : false;
System.out.println("Param First : " + paramFirst);
!
value = atts.getValue("value");
!
value = value != null ? value : "";
!
name = atts.getValue("name");
type = atts.getValue("type");
!
itype = type.equalsIgnoreCase("hidden") ? InputChunk.INPUT_HIDDEN : itype;
itype = type.equalsIgnoreCase("text") ? InputChunk.INPUT_TEXT : itype;
--- 170,184 ----
int isrcType,isingle,itype=-1;
boolean paramFirst;
!
paramFirst = atts.getValue("paramFirst") != null ? atts.getValue("paramFirst").equalsIgnoreCase("true") : false;
System.out.println("Param First : " + paramFirst);
!
value = atts.getValue("value");
!
value = value != null ? value : "";
!
name = atts.getValue("name");
type = atts.getValue("type");
!
itype = type.equalsIgnoreCase("hidden") ? InputChunk.INPUT_HIDDEN : itype;
itype = type.equalsIgnoreCase("text") ? InputChunk.INPUT_TEXT : itype;
***************
*** 186,201 ****
itype = type.equalsIgnoreCase("radio") ? InputChunk.INPUT_RADIO : itype;
itype = type.equalsIgnoreCase("textarea") ? InputChunk.INPUT_TEXTAREA : itype;
!
!
attribs = atts.getValue("atts");
attribs = (attribs != null) ? attribs : "";
!
srcType = atts.getValue("srcType");
if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
else isrcType = YesNo.SRC_PROP;
!
state.getCurrentLine().addChunk(new InputChunk(name,itype,isrcType,val,value,attribs,paramFirst));
!
}
--- 187,240 ----
itype = type.equalsIgnoreCase("radio") ? InputChunk.INPUT_RADIO : itype;
itype = type.equalsIgnoreCase("textarea") ? InputChunk.INPUT_TEXTAREA : itype;
!
!
attribs = atts.getValue("atts");
attribs = (attribs != null) ? attribs : "";
!
srcType = atts.getValue("srcType");
if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
else isrcType = YesNo.SRC_PROP;
!
state.getCurrentLine().addChunk(new InputChunk(name,itype,isrcType,val,value,attribs,paramFirst));
!
! }
!
! /**
! * Handles the formInput tag
! */
! public void fromSelect(String val, Attributes atts) throws Exception {
! String name,srcType,type, attribs,value,srcDB,lstId,lstVal;
! int isrcType,isingle,itype=-1;
! boolean paramFirst;
!
! paramFirst = atts.getValue("paramFirst") != null ? atts.getValue("paramFirst").equalsIgnoreCase("true") : false;
! //System.out.println("Param First : " + paramFirst);
!
! value = atts.getValue("value");
!
! value = value != null ? value : "";
!
! name = atts.getValue("name");
! type = atts.getValue("type");
!
!
!
! attribs = atts.getValue("atts");
! attribs = (attribs != null) ? attribs : "";
!
! srcType = atts.getValue("srcType");
! if (srcType.equalsIgnoreCase("param")) isrcType = YesNo.SRC_PARAM;
! else if (srcType.equalsIgnoreCase("db")) isrcType = YesNo.SRC_DB;
! else isrcType = YesNo.SRC_PROP;
!
! srcDB = atts.getValue("srcDB");
! lstId = atts.getValue("srcID");
! lstVal = atts.getValue("srcVal");
!
!
!
! state.getCurrentLine().addChunk(new SelectChunk(name,itype,isrcType,val,value,attribs,paramFirst,srcDB,lstId,lstVal));
!
}
|