You can subscribe to this list here.
| 2002 |
Jan
(11) |
Feb
(32) |
Mar
(18) |
Apr
(17) |
May
(52) |
Jun
(1) |
Jul
|
Aug
(9) |
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: G?nther B. <br...@us...> - 2002-05-13 06:24:00
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple
In directory usw-pr-cvs1:/tmp/cvs-serv6327/transitions/simple
Modified Files:
StoreListItemTransition.java
Log Message:
example CV
Index: StoreListItemTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple/StoreListItemTransition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** StoreListItemTransition.java 6 May 2002 06:38:28 -0000 1.1
--- StoreListItemTransition.java 13 May 2002 06:23:57 -0000 1.2
***************
*** 60,64 ****
XMLElement new_item = (XMLElement)data.getXMLElement();
String value = new_item.getValue();
! String caption = new_item.getAttributes().getType("caption");
Vector list_items = (Vector)data.getObject("list items");
String[] list_item = new String[]{ caption, value };
--- 60,64 ----
XMLElement new_item = (XMLElement)data.getXMLElement();
String value = new_item.getValue();
! String caption = new_item.getAttributes().getValue("caption");
Vector list_items = (Vector)data.getObject("list items");
String[] list_item = new String[]{ caption, value };
|
|
From: G?nther B. <br...@us...> - 2002-05-13 06:24:00
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvlatex
In directory usw-pr-cvs1:/tmp/cvs-serv6327/transitions/cvlatex
Modified Files:
WriteGeneralFooterTransition.java
Log Message:
example CV
Index: WriteGeneralFooterTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvlatex/WriteGeneralFooterTransition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WriteGeneralFooterTransition.java 4 May 2002 17:07:54 -0000 1.1
--- WriteGeneralFooterTransition.java 13 May 2002 06:23:57 -0000 1.2
***************
*** 29,32 ****
--- 29,33 ----
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLInput;
+ import edu.iicm.xpg.statemachine.XMLElement;
import edu.iicm.xpg.statemachine.DataObject;
import edu.iicm.xpg.statemachine.Const;
***************
*** 57,61 ****
{
StringBuffer document = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
! String place = (String)data.getObject("place");
document.append("\\noindent "+ place + ", \\today\n"+
"\\end{document}");
--- 58,62 ----
{
StringBuffer document = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
! String place = ((XMLElement)data.getObject("place")).getValue();
document.append("\\noindent "+ place + ", \\today\n"+
"\\end{document}");
|
|
From: G?nther B. <br...@us...> - 2002-05-13 06:24:00
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg
In directory usw-pr-cvs1:/tmp/cvs-serv6327
Modified Files:
cv.xsd cv_config.xml cv_guenther.xml test2.xml
Log Message:
example CV
Index: cv.xsd
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/cv.xsd,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** cv.xsd 4 May 2002 17:06:20 -0000 1.1
--- cv.xsd 13 May 2002 06:23:57 -0000 1.2
***************
*** 4,9 ****
<xsd:element name="curriculum">
<xsd:complexType>
! <xsd:attribute name="title" type="xsd:string"/>
! <xsd:attribute name="lang" type="Lang" default="en"/>
<xsd:sequence>
<xsd:element name="personal" type="Personal" />
--- 4,9 ----
<xsd:element name="curriculum">
<xsd:complexType>
! <!-- xsd:attribute name="title" type="xsd:string"/>
! <xsd:attribute name="lang" type="Lang" default="en"/ -->
<xsd:sequence>
<xsd:element name="personal" type="Personal" />
***************
*** 37,41 ****
--- 37,43 ----
<xsd:element name="title" type="xsd:string" minOccurs="0"/>
<xsd:element name="item" type="xsd:string" maxOccurs="unbounded">
+ <xsd:complexType>
<xsd:attribute name="caption" type="xsd:string" />
+ </xsd:complexType>
</xsd:element>
</xsd:sequence>
Index: cv_config.xml
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/cv_config.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** cv_config.xml 4 May 2002 17:06:20 -0000 1.1
--- cv_config.xml 13 May 2002 06:23:57 -0000 1.2
***************
*** 24,27 ****
--- 24,28 ----
<state>listtitle</state>
<state>listitem</state>
+ <state>finished</state>
</states>
***************
*** 30,34 ****
<beginstate>file top</beginstate>
<nextstate>doc top</nextstate>
! <element type="start">document</element>
<classname>WriteGeneralHeaderTransition</classname>
</transition>
--- 31,35 ----
<beginstate>file top</beginstate>
<nextstate>doc top</nextstate>
! <element type="start">curriculum</element>
<classname>WriteGeneralHeaderTransition</classname>
</transition>
***************
*** 48,52 ****
<beginstate>doc top</beginstate>
<nextstate>file top</nextstate>
! <element type="end">document</element>
<classname>WriteGeneralFooterTransition</classname>
</transition>
--- 49,53 ----
<beginstate>doc top</beginstate>
<nextstate>file top</nextstate>
! <element type="end">curriculum</element>
<classname>WriteGeneralFooterTransition</classname>
</transition>
Index: cv_guenther.xml
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/cv_guenther.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** cv_guenther.xml 4 May 2002 17:06:20 -0000 1.1
--- cv_guenther.xml 13 May 2002 06:23:57 -0000 1.2
***************
*** 1,3 ****
! <curriculum title="" lang="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="cv.xsd">
<personal>
--- 1,5 ----
! <?xml version="1.0" standalone="no"?>
!
! <curriculum xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="cv.xsd">
<personal>
Index: test2.xml
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/test2.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** test2.xml 16 Apr 2002 06:55:01 -0000 1.1
--- test2.xml 13 May 2002 06:23:57 -0000 1.2
***************
*** 1,7 ****
<?xml version="1.0" standalone="no"?>
! <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
! xsi:noNamespaceSchemaLocation="Test1.xsd">
<docinfo>
<title>TEST 2</title>
--- 1,8 ----
<?xml version="1.0" standalone="no"?>
! <!-- document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
! xsi:noNamespaceSchemaLocation="Test1.xsd" -->
+ <document>
<docinfo>
<title>TEST 2</title>
|
|
From: G?nther B. <br...@us...> - 2002-05-08 15:08:02
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvhtml In directory usw-pr-cvs1:/tmp/cvs-serv20297/transitions/cvhtml Modified Files: WriteGeneralFooterTransition.java WriteGeneralHeaderTransition.java Log Message: transitions for CV example Index: WriteGeneralFooterTransition.java =================================================================== RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvhtml/WriteGeneralFooterTransition.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WriteGeneralFooterTransition.java 6 May 2002 20:22:34 -0000 1.1 --- WriteGeneralFooterTransition.java 8 May 2002 15:07:33 -0000 1.2 *************** *** 33,37 **** import java.util.Date; ! import java.util.DateFormat; //---------------------------------------------------------------------- --- 33,38 ---- import java.util.Date; ! import java.util.Locale; ! import java.text.DateFormat; //---------------------------------------------------------------------- Index: WriteGeneralHeaderTransition.java =================================================================== RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvhtml/WriteGeneralHeaderTransition.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** WriteGeneralHeaderTransition.java 6 May 2002 06:38:28 -0000 1.1 --- WriteGeneralHeaderTransition.java 8 May 2002 15:07:33 -0000 1.2 *************** *** 30,33 **** --- 30,34 ---- import edu.iicm.xpg.statemachine.XMLInput; import edu.iicm.xpg.statemachine.DataObject; + import edu.iicm.xpg.statemachine.Const; //---------------------------------------------------------------------- |
|
From: G?nther B. <br...@us...> - 2002-05-06 20:22:37
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvhtml
In directory usw-pr-cvs1:/tmp/cvs-serv18758/transitions/cvhtml
Added Files:
WriteGeneralFooterTransition.java
Log Message:
transition for CV example
--- NEW FILE: WriteGeneralFooterTransition.java ---
/***********************************************************************
* @(#)$RCSfile: WriteGeneralFooterTransition.java,v $ $Revision: 1.1 $ $Date: 2002/05/06 20:22:34 $
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.cvhtml;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLInput;
import edu.iicm.xpg.statemachine.DataObject;
import edu.iicm.xpg.statemachine.Const;
import java.util.Date;
import java.util.DateFormat;
//----------------------------------------------------------------------
/**
* @author Guenther Brand
* @version $Revision: 1.1 $
*/
public class WriteGeneralFooterTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
StringBuffer document = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
String place = (String)data.getObject("place");
Date today = new Date();
DateFormat dateFormatter =
DateFormat.getDateInstance(DateFormat.DEFAULT, new Locale("de","DE"));
String dateOut = dateFormatter.format(today);
document.append("\n" + place + ", " + dateOut +
"\n\n</body>\n</html>");
System.out.println(document.toString());
return(null);
}
}
|
|
From: G?nther B. <br...@us...> - 2002-05-06 06:38:31
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvhtml
In directory usw-pr-cvs1:/tmp/cvs-serv19944/transitions/cvhtml
Added Files:
WriteGeneralHeaderTransition.java
Log Message:
new transitions for CV example
--- NEW FILE: WriteGeneralHeaderTransition.java ---
/***********************************************************************
* @(#)$RCSfile: WriteGeneralHeaderTransition.java,v $ $Revision: 1.1 $ $Date: 2002/05/06 06:38:28 $
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.cvhtml;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLInput;
import edu.iicm.xpg.statemachine.DataObject;
//----------------------------------------------------------------------
/**
* @author Guenther Brand
* @version $Revision: 1.1 $
*/
public class WriteGeneralHeaderTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
StringBuffer document = new StringBuffer();
document.append("<html>\n<head>\n" +
"<title>Curriculum Vitae</title>" +
"</head>\n<body>\n");
data.putObject(Const.RESULT_BUFFER, document);
return(null);
}
}
|
|
From: G?nther B. <br...@us...> - 2002-05-06 06:38:31
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple
In directory usw-pr-cvs1:/tmp/cvs-serv19944/transitions/simple
Added Files:
StoreListItemTransition.java
Log Message:
new transitions for CV example
--- NEW FILE: StoreListItemTransition.java ---
/***********************************************************************
* @(#)$RCSfile: StoreListItemTransition.java,v $ $Revision: 1.1 $ $Date: 2002/05/06 06:38:28 $
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.simple;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLElement;
import edu.iicm.xpg.statemachine.DataObject;
import java.util.Vector;
//----------------------------------------------------------------------
/**
* @author Klaus Schmaranz
* @author Guenther Brand
* @version $Revision: 1.1 $
*/
public class StoreListItemTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
XMLElement new_item = (XMLElement)data.getXMLElement();
String value = new_item.getValue();
String caption = new_item.getAttributes().getType("caption");
Vector list_items = (Vector)data.getObject("list items");
String[] list_item = new String[]{ caption, value };
if (list_items == null)
{
list_items = new Vector();
list_items.add(list_item);
data.putObject("list items", list_items);
return(null);
}
list_items.add(list_item);
return(null);
}
}
|
|
From: G?nther B. <br...@us...> - 2002-05-06 06:36:31
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvhtml In directory usw-pr-cvs1:/tmp/cvs-serv19377/transitions/cvhtml Log Message: Directory /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvhtml added to the repository |
|
From: Edmund H. <so...@us...> - 2002-05-04 17:08:02
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvlatex In directory usw-pr-cvs1:/tmp/cvs-serv15115/cvlatex Log Message: Directory /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvlatex added to the repository |
|
From: Edmund H. <so...@us...> - 2002-05-04 17:07:57
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/cvlatex
In directory usw-pr-cvs1:/tmp/cvs-serv16510
Added Files:
WriteGeneralFooterTransition.java
WriteGeneralHeaderTransition.java
Log Message:
lebenslauf transitionen fuer latex
--- NEW FILE: WriteGeneralFooterTransition.java ---
/***********************************************************************
* @(#)$RCSfile: WriteGeneralFooterTransition.java,v $ $Revision: 1.1 $ $Date: 2002/05/04 17:07:54 $
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.cvlatex;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLInput;
import edu.iicm.xpg.statemachine.DataObject;
import edu.iicm.xpg.statemachine.Const;
//----------------------------------------------------------------------
/**
* @author Klaus Schmaranz
* @author Günther Brand
* @version $Revision: 1.1 $
*/
public class WriteGeneralFooterTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
StringBuffer document = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
String place = (String)data.getObject("place");
document.append("\\noindent "+ place + ", \\today\n"+
"\\end{document}");
System.out.println(document.toString());
return(null);
}
}
--- NEW FILE: WriteGeneralHeaderTransition.java ---
/***********************************************************************
* @(#)$RCSfile: WriteGeneralHeaderTransition.java,v $ $Revision: 1.1 $ $Date: 2002/05/04 17:07:54 $
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.cvlatex;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLInput;
import edu.iicm.xpg.statemachine.DataObject;
import edu.iicm.xpg.statemachine.Const;
//----------------------------------------------------------------------
/**
* @author Klaus Schmaranz
* @version $Revision: 1.1 $
*/
public class WriteGeneralHeaderTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
StringBuffer document = new StringBuffer();
document.append("\\documentclass[a4paper]{article}\n\n"+
"\\usepackage{tabularx}\n"+
"\\usepackage{german}\n"+
"\\usepackage{isolatin1}\n\n"+
"\\usepackage{ae}\n"+
"\\usepackage[T1]{fontenc}\n"+
"\\usepackage{CV}\n\n"+
"\\begin{document}\n\n"+
"\\pagestyle{empty}\n\n");
data.putObject(Const.RESULT_BUFFER, document);
return(null);
}
}
|
|
From: Edmund H. <so...@us...> - 2002-05-04 17:06:28
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg In directory usw-pr-cvs1:/tmp/cvs-serv16013/iicm/xpg Added Files: cv.xml cv.xsd cv_config.xml cv_guenther.xml Log Message: ein neues beispiel: lebenslauf --- NEW FILE: cv.xml --- <curriculum title="" lang="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="cv.xsd"> <personal> <name></name> <birthdate></birthdate> <birthplace></birthplace> <marital status=""/> <address></address> <country></country> <phone></phone> <mobile></mobile> <email></email> <homepage></homepage> <place></place> </personal> <list> <title></title> <item caption=""></item> </list> </curriculum> --- NEW FILE: cv.xsd --- <?xml version="1.0" standalone="no"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="curriculum"> <xsd:complexType> <xsd:attribute name="title" type="xsd:string"/> <xsd:attribute name="lang" type="Lang" default="en"/> <xsd:sequence> <xsd:element name="personal" type="Personal" /> <xsd:element name="list" type="List" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="Personal"> <xsd:sequence> <xsd:element name="name" type="xsd:string" /> <xsd:element name="birthdate" type="xsd:date" /> <xsd:element name="birthplace" type="xsd:string" /> <xsd:element name="marital" minOccurs="0"> <xsd:complexType> <xsd:attribute name="status" type="Maritalstatus" use="required"/> </xsd:complexType> </xsd:element> <xsd:element name="address" type="xsd:string"/> <xsd:element name="country" type="xsd:string" minOccurs="0"/> <xsd:element name="phone" type="xsd:string" minOccurs="0"/> <xsd:element name="mobile" type="xsd:string" minOccurs="0"/> <xsd:element name="email" type="xsd:string" minOccurs="0"/> <xsd:element name="homepage" type="xsd:string" minOccurs="0"/> <xsd:element name="place" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="List"> <xsd:sequence> <xsd:element name="title" type="xsd:string" minOccurs="0"/> <xsd:element name="item" type="xsd:string" maxOccurs="unbounded"> <xsd:attribute name="caption" type="xsd:string" /> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:simpleType name="Maritalstatus" > <xsd:restriction base="xsd:string"> <xsd:enumeration value="single"/> <xsd:enumeration value="married"/> <xsd:enumeration value="divorced"/> </xsd:restriction> </xsd:simpleType> <xsd:simpleType name="Lang" > <xsd:restriction base="xsd:string"> <xsd:enumeration value="en"/> <xsd:enumeration value="de"/> </xsd:restriction> </xsd:simpleType> </xsd:schema> --- NEW FILE: cv_config.xml --- <?xml version="1.0" standalone="no"?> <statemachine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="StateMachineConfig.xsd"> <path>edu.iicm.xpg.transitions.cvlatex</path> <path>edu.iicm.xpg.transitions.simple</path> <states> <startstate>file top</startstate> <state>doc top</state> <state>personal</state> <state>list</state> <state>name</state> <state>birthdate</state> <state>birthplace</state> <state>marital</state> <state>address</state> <state>country</state> <state>phone</state> <state>mobile</state> <state>email</state> <state>homepage</state> <state>place</state> <state>listtitle</state> <state>listitem</state> </states> <transitions> <transition> <beginstate>file top</beginstate> <nextstate>doc top</nextstate> <element type="start">document</element> <classname>WriteGeneralHeaderTransition</classname> </transition> <transition> <beginstate>file top</beginstate> <nextstate>finished</nextstate> <element type="enddoc" /> <classname>StopMachineTransition</classname> </transition> <transition> <beginstate>file top</beginstate> <nextstate>file top</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>doc top</beginstate> <nextstate>file top</nextstate> <element type="end">document</element> <classname>WriteGeneralFooterTransition</classname> </transition> <transition> <beginstate>doc top</beginstate> <nextstate>personal</nextstate> <element type="start">personal</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>doc top</beginstate> <nextstate>list</nextstate> <element type="start">list</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>doc top</beginstate> <nextstate>doc top</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>doc top</nextstate> <element type="end">personal</element> <classname>WritePersonalTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>name</nextstate> <element type="start">name</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>birthdate</nextstate> <element type="start">birthdate</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>birthplace</nextstate> <element type="start">birthplace</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>marital</nextstate> <element type="start">marital</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>address</nextstate> <element type="start">address</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>country</nextstate> <element type="start">country</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>phone</nextstate> <element type="start">phone</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>mobile</nextstate> <element type="start">mobile</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>email</nextstate> <element type="start">email</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>homepage</nextstate> <element type="start">homepage</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>place</nextstate> <element type="start">place</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>personal</beginstate> <nextstate>personal</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>name</beginstate> <nextstate>personal</nextstate> <element type="end">name</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>name</beginstate> <nextstate>name</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>birthdate</beginstate> <nextstate>personal</nextstate> <element type="end">birthdate</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>birthdate</beginstate> <nextstate>birthdate</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>birthplace</beginstate> <nextstate>personal</nextstate> <element type="end">birthplace</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>birthplace</beginstate> <nextstate>birthplace</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>marital</beginstate> <nextstate>personal</nextstate> <element type="end">marital</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>marital</beginstate> <nextstate>marital</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>address</beginstate> <nextstate>personal</nextstate> <element type="end">address</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>address</beginstate> <nextstate>address</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>country</beginstate> <nextstate>personal</nextstate> <element type="end">country</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>country</beginstate> <nextstate>country</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>phone</beginstate> <nextstate>personal</nextstate> <element type="end">phone</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>phone</beginstate> <nextstate>phone</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>mobile</beginstate> <nextstate>personal</nextstate> <element type="end">mobile</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>mobile</beginstate> <nextstate>mobile</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>email</beginstate> <nextstate>personal</nextstate> <element type="end">email</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>email</beginstate> <nextstate>email</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>homepage</beginstate> <nextstate>personal</nextstate> <element type="end">homepage</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>homepage</beginstate> <nextstate>homepage</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>place</beginstate> <nextstate>personal</nextstate> <element type="end">place</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>place</beginstate> <nextstate>place</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>list</beginstate> <nextstate>doc top</nextstate> <element type="end">list</element> <classname>WriteListTransition</classname> </transition> <transition> <beginstate>list</beginstate> <nextstate>listtitle</nextstate> <element type="start">title</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>list</beginstate> <nextstate>listitem</nextstate> <element type="start">item</element> <classname>PrimitiveTransition</classname> </transition> <transition> <beginstate>list</beginstate> <nextstate>list</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>listtitle</beginstate> <nextstate>list</nextstate> <element type="end">title</element> <classname>StoreXMLElementTransition</classname> </transition> <transition> <beginstate>listtitle</beginstate> <nextstate>listtitle</nextstate> <classname>IgnoreCharsTransition</classname> </transition> <transition> <beginstate>listitem</beginstate> <nextstate>list</nextstate> <element type="end">item</element> <classname>StoreListItemTransition</classname> </transition> <transition> <beginstate>listitem</beginstate> <nextstate>listitem</nextstate> <classname>IgnoreCharsTransition</classname> </transition> </transitions> </statemachine > --- NEW FILE: cv_guenther.xml --- <curriculum title="" lang="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="cv.xsd"> <personal> <name>Günther Brand</name> <birthdate>1975-08-27</birthdate> <birthplace>Wolfsberg</birthplace> <marital status="single"/> <address>Elisabethstraße 85 W220, 8010 Graz</address> <country>Austria</country> <phone>phone</phone> <mobile>mobile</mobile> <email>email</email> <homepage>homepage</homepage> <place>Graz</place> </personal> <list> <title>Schulausbildung</title> <item caption="09/1981-07/1985">Volksschule</item> <item caption="09/1985-07/1989">AHS St. Paul</item> </list> <list> <title>Studium</title> <item caption="seit 03/1995">Telematik TU-Graz</item> </list> </curriculum> |
|
From: Edmund H. <so...@us...> - 2002-05-04 17:06:28
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple
In directory usw-pr-cvs1:/tmp/cvs-serv16013/iicm/xpg/transitions/simple
Added Files:
StoreXMLElementTransition.java
Log Message:
ein neues beispiel: lebenslauf
--- NEW FILE: StoreXMLElementTransition.java ---
/***********************************************************************
* @(#)$RCSfile: StoreXMLElementTransition.java,v $ $Revision: 1.1 $ $Date: 2002/05/04 17:06:20 $
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.simple;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
//import edu.iicm.xpg.statemachine.XMLInput;
import edu.iicm.xpg.statemachine.XMLElement;
import edu.iicm.xpg.statemachine.DataObject;
//----------------------------------------------------------------------
/**
* @author Klaus Schmaranz
* @author Günther Brand
* @version $Revision: 1.1 $
*/
public class StoreXMLElementTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
XMLElement xml_element = (XMLElement)data.getXMLElement();
String key = xml_element.getName();
data.putObject(key, xml_element);
return(null);
}
}
|
|
From: Stefan T. <th...@us...> - 2002-04-16 09:33:46
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/latex
In directory usw-pr-cvs1:/tmp/cvs-serv28064
Modified Files:
WriteListTransition.java WriteItemTransition.java
Log Message:
wrong package fixed
Index: WriteListTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/latex/WriteListTransition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WriteListTransition.java 16 Apr 2002 06:55:02 -0000 1.1
--- WriteListTransition.java 16 Apr 2002 09:33:42 -0000 1.2
***************
*** 21,25 ****
! package edu.iicm.xpg.transitions.simple;
import edu.iicm.xpg.statemachine.Transition;
--- 21,25 ----
! package edu.iicm.xpg.transitions.latex;
import edu.iicm.xpg.statemachine.Transition;
Index: WriteItemTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/latex/WriteItemTransition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WriteItemTransition.java 16 Apr 2002 06:55:02 -0000 1.1
--- WriteItemTransition.java 16 Apr 2002 09:33:42 -0000 1.2
***************
*** 21,25 ****
! package edu.iicm.xpg.transitions.simple;
import edu.iicm.xpg.statemachine.Transition;
--- 21,25 ----
! package edu.iicm.xpg.transitions.latex;
import edu.iicm.xpg.statemachine.Transition;
***************
*** 76,77 ****
--- 76,79 ----
}
}
+
+
|
|
From: G?nther B. <br...@us...> - 2002-04-16 06:55:06
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg In directory usw-pr-cvs1:/tmp/cvs-serv29299 Modified Files: Test1.xsd statemachine1.xml test1.xml test1a.xml Added Files: test2.xml Log Message: another little example added --- NEW FILE: test2.xml --- <?xml version="1.0" standalone="no"?> <document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Test1.xsd"> <docinfo> <title>TEST 2</title> <author>Guenther Brand</author> </docinfo> <sect title="einfache Rechenbeispiele"> <para> normale Liste ohne Berechnungen: </para> <list> <item>Hier</item> <item>kann</item> <item>jegliche</item> <item>Aufzählung</item> <item>erfolgen</item> </list> <para> Liste mit Summe: </para> <list eval="sum"> <item>3.7</item> <item>2.8</item> <item>13.2</item> </list> <para> Liste mit Durchschnitt: </para> <list eval="avg"> <item>5</item> <item>2.8</item> <item>13.2</item> </list> <para> Liste mit illegaler Summe: </para> <list eval="sum"> <item>3.7</item> <item>2.8</item> <item>13.2</item> <item>illegal</item> </list> </sect> </document> Index: Test1.xsd =================================================================== RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/Test1.xsd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Test1.xsd 18 Mar 2002 06:45:54 -0000 1.1 --- Test1.xsd 16 Apr 2002 06:55:01 -0000 1.2 *************** *** 23,30 **** <xsd:complexType name="Sect"> <xsd:sequence> ! <xsd:element name="para" type="xsd:string" minOccurs="0" /> <xsd:element name="sect" type="Sect" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> ! <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> --- 23,40 ---- <xsd:complexType name="Sect"> <xsd:sequence> ! <xsd:choice minOccurs="0" maxOccurs="unbounded"> ! <xsd:element name="para" type="xsd:string" /> ! <xsd:element name="list" type="List" /> ! </xsd:choice> <xsd:element name="sect" type="Sect" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> ! <xsd:attribute name="title" type="xsd:string" use="required" /> ! </xsd:complexType> ! ! <xsd:complexType name="List"> ! <xsd:sequence> ! <xsd:element name="item" maxOccurs="unbounded" /> ! </xsd:sequence> ! <xsd:attribute name="eval" type="xsd:string" /> </xsd:complexType> Index: statemachine1.xml =================================================================== RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/statemachine1.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** statemachine1.xml 18 Mar 2002 06:45:54 -0000 1.1 --- statemachine1.xml 16 Apr 2002 06:55:01 -0000 1.2 *************** *** 17,20 **** --- 17,22 ---- <state>para</state> <state>sub para</state> + <state>list def</state> + <state>list item</state> <state>finished</state> </states> *************** *** 137,140 **** --- 139,148 ---- <transition> <beginstate>sect def</beginstate> + <nextstate>list def</nextstate> + <element type="start">list</element> + <classname>WriteListHeaderTransition</classname> + </transition> + <transition> + <beginstate>sect def</beginstate> <nextstate>sub sect def</nextstate> <element type="start">sect</element> *************** *** 183,186 **** --- 191,222 ---- <beginstate>sub para</beginstate> <nextstate>sub para</nextstate> + <classname>PrimitiveTransition</classname> + </transition> + <transition> + <beginstate>list def</beginstate> + <nextstate>sect def</nextstate> + <element type="end">list</element> + <classname>WriteListTransition</classname> + </transition> + <transition> + <beginstate>list def</beginstate> + <nextstate>list item</nextstate> + <element type="start">item</element> + <classname>PrimitiveTransition</classname> + </transition> + <transition> + <beginstate>list def</beginstate> + <nextstate>list def</nextstate> + <classname>PrimitiveTransition</classname> + </transition> + <transition> + <beginstate>list item</beginstate> + <nextstate>list def</nextstate> + <element type="end">item</element> + <classname>WriteItemTransition</classname> + </transition> + <transition> + <beginstate>list item</beginstate> + <nextstate>list item</nextstate> <classname>PrimitiveTransition</classname> </transition> Index: test1.xml =================================================================== RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/test1.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test1.xml 18 Mar 2002 06:45:54 -0000 1.1 --- test1.xml 16 Apr 2002 06:55:01 -0000 1.2 *************** *** 9,13 **** </docinfo> ! <sect name="erstes Kapitel"> <para> Der erste Abschnitt. --- 9,13 ---- </docinfo> ! <sect title="erstes Kapitel"> <para> Der erste Abschnitt. *************** *** 15,19 **** </sect> ! <sect name="zweites Kapitel"> <para> Der zweite Abschnitt. --- 15,19 ---- </sect> ! <sect title="zweites Kapitel"> <para> Der zweite Abschnitt. Index: test1a.xml =================================================================== RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/test1a.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test1a.xml 18 Mar 2002 06:45:54 -0000 1.1 --- test1a.xml 16 Apr 2002 06:55:01 -0000 1.2 *************** *** 9,18 **** </docinfo> ! <sect name="erstes Kapitel"> <para> Der erste Abschnitt. </para> ! <sect name="zweites Kapitel"> <para> Der zweite Abschnitt. --- 9,18 ---- </docinfo> ! <sect title="erstes Kapitel"> <para> Der erste Abschnitt. </para> ! <sect title="zweites Kapitel"> <para> Der zweite Abschnitt. |
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/latex
In directory usw-pr-cvs1:/tmp/cvs-serv29299/transitions/latex
Modified Files:
WriteHeaderTransition.java WriteSectHeaderTransition.java
Added Files:
WriteItemTransition.java WriteListHeaderTransition.java
WriteListTransition.java
Log Message:
another little example added
--- NEW FILE: WriteItemTransition.java ---
/***********************************************************************
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.simple;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLInput;
import edu.iicm.xpg.statemachine.DataObject;
import edu.iicm.xpg.statemachine.Const;
import edu.iicm.xpg.util.Debug;
import java.util.Vector;
import java.util.Enumeration;
//----------------------------------------------------------------------
/**
* @author Guenther Brand
* @version $Revision: 1.1 $
*/
public class WriteItemTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
StringBuffer result = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
String item = data.getXMLElement().getValue().trim();
Vector list_items = (Vector)data.getObject("list_items");
if (list_items == null)
{
list_items = new Vector();
data.putObject("list_items", list_items);
}
list_items.add(item);
result.append("\\item " + item + "\n");
return(null);
}
}
--- NEW FILE: WriteListHeaderTransition.java ---
/***********************************************************************
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.latex;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLInput;
import edu.iicm.xpg.statemachine.DataObject;
import edu.iicm.xpg.statemachine.Const;
import edu.iicm.xpg.util.Debug;
import java.util.Vector;
import java.util.Enumeration;
//----------------------------------------------------------------------
/**
* @author Guenther Brand
* @version $Revision: 1.1 $
*/
public class WriteListHeaderTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
StringBuffer result = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
Vector list_items = new Vector();
data.putObject("list_items", list_items);
result.append("\n\\begin{itemize}\n");
return(null);
}
}
--- NEW FILE: WriteListTransition.java ---
/***********************************************************************
*
* Copyright (c) 2001 IICM, Graz University of Technology
* Schiesstattgasse 4a, A-8010 Graz, Austria.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.transitions.simple;
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.State;
import edu.iicm.xpg.statemachine.StateMachine;
import edu.iicm.xpg.statemachine.Input;
import edu.iicm.xpg.statemachine.XMLInput;
import edu.iicm.xpg.statemachine.DataObject;
import edu.iicm.xpg.statemachine.Const;
import edu.iicm.xpg.util.Debug;
import java.util.Vector;
import java.util.Enumeration;
//----------------------------------------------------------------------
/**
* @author Guenther Brand
* @version $Revision: 1.1 $
*/
public class WriteListTransition implements Transition
{
//----------------------------------------------------------------------
/**
* @param input the input that triggered this transition
* @param from_state the start state for this transition
* @param to_state the destination state for this transition
* @param machine the state machine that this transition belongs to
* @param data user defined data
* @return
* @exception Exception whatever an implementation can throw
*/
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
throws Exception
{
StringBuffer result = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
Vector list_items = (Vector)data.removeObject("list_items");
String eval_attrib = data.getXMLElement().getAttributes().getValue("eval");
if (eval_attrib != null)
if (eval_attrib.equals("sum")) addListSum(result, list_items);
else if (eval_attrib.equals("avg")) addListAvg(result, list_items);
result.append("\\end{itemize}\n");
return(null);
}
protected void addListSum(StringBuffer result, Vector list_items)
{
try
{
float sum = 0;
for (int item=0; item < list_items.size(); item++)
{
float item_value =
(new Float((String)list_items.get(item))).floatValue();
sum += item_value;
}
result.append("\\item {\\b sum: " + sum + "}\n");
}
catch (NumberFormatException exc)
{
result.append("\\item {\\b sum: list contains no number item(s)}\n");
}
}
protected void addListAvg(StringBuffer result, Vector list_items)
{
try
{
float sum = 0;
for (int item=0; item < list_items.size(); item++)
{
float item_value =
(new Float((String)list_items.get(item))).floatValue();
sum += item_value;
}
result.append("\\item {\\b avg: " + sum / list_items.size() + "}\n");
}
catch (NumberFormatException exc)
{
result.append("\\item {\\b avg: list contains no number item(s)}\n");
}
}
}
Index: WriteHeaderTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/latex/WriteHeaderTransition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** WriteHeaderTransition.java 18 Mar 2002 06:45:54 -0000 1.1
--- WriteHeaderTransition.java 16 Apr 2002 06:55:02 -0000 1.2
***************
*** 31,34 ****
--- 31,36 ----
import edu.iicm.xpg.statemachine.Const;
+ import edu.iicm.xpg.util.Debug;
+
//----------------------------------------------------------------------
/**
***************
*** 61,66 ****
if (doc_title == null)
! System.err.println("Error (printing to form): document has no title");
!
html_form.append("\n\\title{" + doc_title + "}\n");
--- 63,72 ----
if (doc_title == null)
! {
! if (Debug.DEBUG)
! Debug.println(Debug.TRANSITION_LEVEL,
! "Error (printing to form): document has no title");
!
! }
html_form.append("\n\\title{" + doc_title + "}\n");
Index: WriteSectHeaderTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/latex/WriteSectHeaderTransition.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** WriteSectHeaderTransition.java 21 Mar 2002 08:10:17 -0000 1.2
--- WriteSectHeaderTransition.java 16 Apr 2002 06:55:02 -0000 1.3
***************
*** 32,35 ****
--- 32,37 ----
import edu.iicm.xpg.statemachine.Const;
+ import edu.iicm.xpg.util.Debug;
+
import java.util.Vector;
import java.util.Enumeration;
***************
*** 37,41 ****
//----------------------------------------------------------------------
/**
! * @author Günther Brand
* @version $Revision$
*/
--- 39,43 ----
//----------------------------------------------------------------------
/**
! * @author Guenther Brand
* @version $Revision$
*/
***************
*** 61,75 ****
StringBuffer result = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
String section_name =
! data.getXMLElement().getAttributes().getValue("name");
Integer sect_depth_obj = (Integer)data.removeObject("sect_depth");
int sect_depth;
if ( sect_depth_obj == null )
sect_depth = 0;
! else sect_depth= sect_depth_obj.intValue();
result.append("\n\\");
! for ( int depth = 0; depth < sect_depth; depth++ )
! result.append("sub");
! result.append("section{" + section_name + "}\n");
data.putObject("sect_depth", new Integer(++sect_depth) );
--- 63,90 ----
StringBuffer result = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
String section_name =
! data.getXMLElement().getAttributes().getValue("title");
Integer sect_depth_obj = (Integer)data.removeObject("sect_depth");
int sect_depth;
if ( sect_depth_obj == null )
sect_depth = 0;
! else sect_depth = sect_depth_obj.intValue();
result.append("\n\\");
! String sect;
! switch (sect_depth)
! {
! case 0 : sect = "section"; break;
! case 1 : sect = "subsection"; break;
! case 2 : sect = "subsubsection"; break;
! case 3 : sect = "paragraph"; break;
! case 4 : sect = "subparagraph"; break;
! case 5 : sect = "subsubparagraph"; break;
! default:
! if (Debug.DEBUG)
! Debug.println(Debug.WARNING_LEVEL,
! "WriteSectHeaderTransition: illegal section depth!");
! return null;
! }
! result.append(sect + "{" + section_name + "}\n");
data.putObject("sect_depth", new Integer(++sect_depth) );
|
|
From: G?nther B. <br...@us...> - 2002-04-16 06:55:05
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions
In directory usw-pr-cvs1:/tmp/cvs-serv29299/transitions
Modified Files:
ClassLoaderTransition.java StoreDataTransition.java
Log Message:
another little example added
Index: ClassLoaderTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/ClassLoaderTransition.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ClassLoaderTransition.java 8 Apr 2002 14:14:34 -0000 1.4
--- ClassLoaderTransition.java 16 Apr 2002 06:55:01 -0000 1.5
***************
*** 46,50 ****
--- 46,56 ----
// FIXXME ??
public ClassLoaderTransition( Factory transition_factory, String classname )
+ throws IllegalArgumentException
{
+ if (transition_factory == null || classname == null)
+ {
+ throw (new IllegalArgumentException
+ ("Factory or classname in ClassLoaderTransition is null!"));
+ }
classname_ = classname;
transition_factory_ = transition_factory;
Index: StoreDataTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/StoreDataTransition.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** StoreDataTransition.java 8 Apr 2002 14:13:16 -0000 1.9
--- StoreDataTransition.java 16 Apr 2002 06:55:01 -0000 1.10
***************
*** 50,56 ****
private int data_type_;
public StoreDataTransition(int type)
{
! data_type_ = type;
}
--- 50,69 ----
private int data_type_;
+ //----------------------------------------------------------------------
+ /**
+ * @param type the type of the data that should be stored
+ * @exception IllegalArgumentException is thrown if a unknown type
+ * ( < 1 or > 4 ) should be stored
+ */
public StoreDataTransition(int type)
+ throws IllegalArgumentException
{
! if ( type < 1 || type > 4 )
! {
! throw (new IllegalArgumentException
! ("illegal type of StoreDataTransition: " + type));
! }
!
! data_type_ = type;
}
***************
*** 92,99 ****
break;
default:
! {
! if (Debug.DEBUG)
! Debug.println(Debug.WARNING_LEVEL,"StoreDataTransition: illegal datatype!");
! }
}
--- 105,110 ----
break;
default:
! if (Debug.DEBUG)
! Debug.println(Debug.WARNING_LEVEL,"StoreDataTransition: illegal datatype!");
}
|
|
From: G?nther B. <br...@us...> - 2002-04-16 06:55:05
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple
In directory usw-pr-cvs1:/tmp/cvs-serv29299/transitions/simple
Modified Files:
SectEndTransition.java WriteDocContentTransition.java
Log Message:
another little example added
Index: SectEndTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple/SectEndTransition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SectEndTransition.java 18 Mar 2002 06:45:55 -0000 1.1
--- SectEndTransition.java 16 Apr 2002 06:55:02 -0000 1.2
***************
*** 59,64 ****
throws Exception
{
! data.putObject( "sect_depth",
! new Integer(((Integer)data.removeObject("sect_depth")).intValue() - 1) );
return(null);
--- 59,69 ----
throws Exception
{
! int sect_depth = ((Integer)data.removeObject("sect_depth")).intValue();
! if (sect_depth <= 0)
! {
! throw (new IllegalStateException("illegal section depth: "
! + sect_depth));
! }
! data.putObject( "sect_depth", new Integer(--sect_depth) );
return(null);
Index: WriteDocContentTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple/WriteDocContentTransition.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** WriteDocContentTransition.java 8 Apr 2002 14:13:16 -0000 1.3
--- WriteDocContentTransition.java 16 Apr 2002 06:55:02 -0000 1.4
***************
*** 37,45 ****
import java.util.Enumeration;
-
-
//----------------------------------------------------------------------
/**
! * @author Günther Brand
* @version $Revision$
*/
--- 37,43 ----
import java.util.Enumeration;
//----------------------------------------------------------------------
/**
! * @author Guenther Brand
* @version $Revision$
*/
***************
*** 47,75 ****
public class WriteDocContentTransition implements Transition
{
- protected int field_counter_;
- protected static int coll_counter_;
-
- // don't use underlines in the labels, only at the end!
- protected final static String COLL_LABEL = "collection_";
- protected final static String COURSE_LABEL = "course_";
- protected final static String TITLE_NEW_LABEL = "newTitle_";
- protected final static String TITLE_OLD_LABEL = "oldTitle_";
- protected final static String TITLE_ANY_LABEL = "anyTitle_";
- protected final static String TYPE_NEW_LABEL = "newType_";
- protected final static String TYPE_OLD_LABEL = "oldType_";
- protected final static String TYPE_ANY_LABEL = "anyType_";
- protected final static String HOURS_NEW_LABEL = "newHours_";
- protected final static String HOURS_OLD_LABEL = "oldHours_";
- protected final static String HOURS_ANY_LABEL = "anyHours_";
- protected final static String MARK_NEW_LABEL = "newMark_";
- protected final static String MARK_OLD_LABEL = "oldMark_";
- protected final static String MARK_ANY_LABEL = "anyMark_";
- protected final static String REMARK_NEW_LABEL = "newRemark_";
- protected final static String REMARK_OLD_LABEL = "oldRemark_";
- protected final static String REMARK_ANY_LABEL = "anyRemark_";
- protected final static String DATE_NEW_LABEL = "newDate_";
- protected final static String DATE_OLD_LABEL = "oldDate_";
- protected final static String DATE_ANY_LABEL = "anyDate_";
-
//----------------------------------------------------------------------
/**
--- 45,48 ----
***************
*** 97,261 ****
Debug.println(Debug.TRANSITION_LEVEL,"Error (printing to form): document has no content");
}
- // writeCourseList(html_form,collection.getCourses());
return(null);
}
-
- //----------------------------------------------------------------------
- /**
- * @param html_form the form to write to
- * @param course_list the list of courses
- * @return
- */
-
- /* protected synchronized void writeCourseList(StringBuffer html_form,Vector course_list)
- {
- if (course_list == null)
- {
- System.err.println("Error (printing to form): collection has no courses");
- return;
- }
- html_form.append("<table border=\"1\" cellspacing=\"2\">\n");
-
- field_counter_ = 0;
- Enumeration courses = course_list.elements();
-
- while(courses.hasMoreElements())
- {
- CourseEquivalence course = (CourseEquivalence)courses.nextElement();
- writeCourse(html_form,course);
- }
- html_form.append("</table>\n");
- } */
-
- //----------------------------------------------------------------------
- /**
- * @param html_form the form to write to
- * @param course the course to write
- * @return
- */
-
- /* protected void writeCourse(StringBuffer html_form,CourseEquivalence course)
- {
- field_counter_++;
- int alternative_counter = 0;
- boolean groupwise = false;
-
- Vector entries = course.getAllNew();
-
- // ------------------------------ "any" Course
- if (entries.isEmpty())
- {
- html_form.append("<tr>\n");
- html_form.append(" <td><input type=\"hidden\" name=\"" + COURSE_LABEL + coll_counter_ +
- "_" + field_counter_ + "_1" +
- "\">\n<input type=\"text\" size=\"20\" maxlength=\"60\" name=\"" + TITLE_ANY_LABEL +
- coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
- html_form.append("<td>Typ: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"" +
- TYPE_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
- html_form.append("<td>Std: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"" +
- HOURS_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
- html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
- DATE_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
- html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
- MARK_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
- html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
- REMARK_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
- html_form.append("</tr>\n");
- return;
- }
-
- // ------------------------------ new course
- Enumeration entry_enum = entries.elements();
- if (entries.size() > 1) // multiple alternatives
- {
- groupwise = true;
- html_form.append("<tr><td colspan=\"6\" align=\"center\"><strong><i>" +
- "Folgende Veranstaltungen werden gruppenweise angerechnet</i></strong></td></tr>");
- }
- while(entry_enum.hasMoreElements())
- {
- CourseEntry entry = (CourseEntry)entry_enum.nextElement();
- alternative_counter++;
-
- html_form.append("<tr>\n");
- html_form.append(" <td><input type=\"hidden\" name=\"" + COURSE_LABEL + coll_counter_ +
- "_" + field_counter_ + "_" + alternative_counter + "\">\n<strong>");
- html_form.append(entry.getTitle());
- html_form.append("<input type=\"hidden\" name=\"" + TITLE_NEW_LABEL + coll_counter_ +
- "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
- entry.getTitle() + "\">\n");
- html_form.append("</strong></td><td>");
- html_form.append("Typ: ");
- html_form.append(entry.getType());
- html_form.append("<input type=\"hidden\" name=\"" + TYPE_NEW_LABEL + coll_counter_ +
- "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
- entry.getType() + "\">\n");
- html_form.append("</td><td>");
- html_form.append("Std: ");
- html_form.append(entry.getHours());
- html_form.append("<input type=\"hidden\" name=\"" + HOURS_NEW_LABEL + coll_counter_ +
- "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
- entry.getHours() + "\">\n");
- html_form.append("</td>");
- html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
- DATE_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
- alternative_counter + "\"></td>\n");
- html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
- MARK_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
- alternative_counter + "\"></td>\n");
- html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
- REMARK_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
- alternative_counter + "\"></td>\n");
- html_form.append("</tr>\n");
- }
-
- // ------------------------------ old course
- alternative_counter = 0;
- entries = course.getAllOld();
- if (entries.isEmpty())
- return;
- entry_enum = entries.elements();
- while(entry_enum.hasMoreElements())
- {
- CourseEntry entry = (CourseEntry)entry_enum.nextElement();
- alternative_counter++;
-
- html_form.append("<tr>\n");
- html_form.append(" <td> <i>");
- html_form.append(entry.getTitle());
- html_form.append("<input type=\"hidden\" name=\"" + TITLE_OLD_LABEL + coll_counter_ +
- "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
- entry.getTitle() + "\">\n");
- html_form.append("</i></td><td>");
- html_form.append("Typ: ");
- html_form.append(entry.getType());
- html_form.append("<input type=\"hidden\" name=\"" + TYPE_OLD_LABEL + coll_counter_ +
- "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
- entry.getType() + "\">\n");
- html_form.append("</td><td>");
- html_form.append("Std: ");
- html_form.append(entry.getHours());
- html_form.append("<input type=\"hidden\" name=\"" + HOURS_OLD_LABEL + coll_counter_ +
- "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
- entry.getHours() + "\">\n");
- html_form.append("</td>");
- html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
- DATE_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
- alternative_counter + "\"></td>\n");
- html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
- MARK_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
- alternative_counter + "\"></td>\n");
- html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
- REMARK_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
- alternative_counter + "\"></td>\n");
- html_form.append("</tr>\n");
- }
- if (groupwise) // multiple alternatives
- {
- html_form.append("<tr><td colspan=\"6\" align=\"center\"><strong><i>" +
- "Ende der Anrechnungsgruppe</i></strong></td></tr>");
- }
-
- } */
}
--- 70,75 ----
|
|
From: Stefan T. <th...@us...> - 2002-04-08 17:06:27
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/util
In directory usw-pr-cvs1:/tmp/cvs-serv25379
Added Files:
Debug.java Factory.java
Log Message:
new util classes
--- NEW FILE: Debug.java ---
/***********************************************************************
* @(#)$RCSfile: Debug.java,v $ $Revision: 1.1 $ $Date: 2002/04/08 13:08:49 $
*
* Copyright (c) 2002 stefan thalauer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.util;
// import org.dinopolis.util.Debug;
public class Debug extends org.dinopolis.util.Debug
{
static final public String WARNING_LEVEL="Warning";
static final public String VERBOSE_LEVEL="Verbose";
static final public String PARSER_LEVEL="Parser";
static final public String TRANSITION_LEVEL="Transition";
static final public String TEST_LEVEL="Test";
}
--- NEW FILE: Factory.java ---
/***********************************************************************
* @(#)$RCSfile: Factory.java,v $ $Revision: 1.1 $ $Date: 2002/04/08 13:08:49 $
*
* Copyright (c) 2002 stefan thalauer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL)
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***********************************************************************/
package edu.iicm.xpg.util;
import java.io.IOException;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.Hashtable;
import java.util.HashSet;
import java.util.Vector;
//----------------------------------------------------------------------
/**
* This is a simple factory implementation.
* DFactory consists of a search method for looking up a Class Object
* within a given SearchPath. The search method returns a new Instance of
* the requested class.
* Furthermore there is a method getSearchPath and setSearchPath to get
* and set the class search path, wich consists of a stringarray of
* packagenames.
*
* @author Peter Grundner
* @author Stefan Thalauer
* @version $Revision: 1.1 $
*/
public class Factory
{
/** String Array for the class search path */
private String[] path_;
/** class cache Hashtable */
private Hashtable cache_;
//----------------------------------------------------------------------
/**
* The default constructor
*/
public Factory()
{
cache_ = new Hashtable();
}
//----------------------------------------------------------------------
/**
* Another constructor with the search path as argument.
*
* @param path the search path
*/
public Factory(String[] path)
{
this();
setSearchPath(path);
}
//----------------------------------------------------------------------
/**
* This method sets the seach Path and clears the class cache
* to prevent the returnation of Objects from the wrong packages
*
* @param path represents the SearchPath
* @return void
* @exception IllegalArgumentException thrown if path is null
* or has length 0
*/
public void setSearchPath(String[] path)
throws IllegalArgumentException
{
if (path == null)
throw new IllegalArgumentException("SearchPath must not be <null>");
if (path.length == 0)
throw new IllegalArgumentException("the length of SearchPath must not be 0");
Vector vector = new Vector();
HashSet set= new HashSet();
for(int count=0;count<path.length;count++)
{
if (set.add(path[count]))
{
vector.add(path[count]);
}
}
path_ = new String[vector.size()];
vector.toArray(path_);
clearClassCache();
}
//----------------------------------------------------------------------
/**
* This method returns the current search path and throws an
* IllegalStateException if the search path is null
*
* @return returns the current search path as an array of strings. Each
* string represents on a single package, and packages do never hav a
* trailing '.'
* @exception IllegalStateException thrown if no path has been
* set before
*/
public String[] getSearchPath()
throws IllegalStateException
{
/** check if the class search path has been set before
or throw an exception */
if (path_==null)
{
throw new IllegalStateException();
}
return path_;
}
//----------------------------------------------------------------------
/**
* getInstance(String partly_qualified_classname) tries to find an object a
* in one of the packagenames within the search path and returns
* a new Instance of the found object or throws a ClassNotFoundException.
*
* @param partly_qualified_classname here can be a classname with or
* without any sub-package information
* @return an instance of the class defined by the parameter
* @exception ClassNotFoundException requested class is not
* found in the path
* @exception LinkageError thrown if class dependencies could
* not be resolved
* @exception ExceptionInInitializerError thrown if the default
* constructor could not be called, eiher because it does not exist or
* because it is not accessible (e.g. private)
* @exception IllegalArgumentException thrown if
* partly_qualified_classname was null
* @exception IllegalStateException thrown if no path has been
* set before
* @exception IOException something went wrong during reading
* the class code
*/
public Object getInstance(String partly_qualified_classname)
throws ClassNotFoundException, LinkageError,
ExceptionInInitializerError, IllegalArgumentException,
IllegalStateException, IOException
{
// search within cache
Class ret_class = (Class)(cache_.get(partly_qualified_classname));
if (Debug.DEBUG)
Debug.println(Debug.VERBOSE_LEVEL," return class = "+ret_class);
try
{
if (ret_class != null)
return(ret_class.newInstance());
// walk through the whole class search path
for (int count = 0; count < path_.length; count++)
{
StringBuffer buf = new StringBuffer();
if (Debug.DEBUG)
Debug.println(Debug.VERBOSE_LEVEL," path__ = "+path_[count]);
buf.append(path_[count]);
buf.append('.');
buf.append(partly_qualified_classname);
String full_class_name = buf.toString();
if (Debug.DEBUG)
Debug.println(Debug.VERBOSE_LEVEL," full_class_name = "+full_class_name);
try
{
ret_class = Class.forName(full_class_name);
if (Debug.DEBUG)
Debug.println(Debug.VERBOSE_LEVEL," ret_class = "+ret_class);
cache_.put(partly_qualified_classname, ret_class);
Object obj = ret_class.newInstance();
if (obj == null)
{
if (Debug.DEBUG)
Debug.println(Debug.WARNING_LEVEL," Object is null!");
}
else
if (Debug.DEBUG)
Debug.println(Debug.VERBOSE_LEVEL," object = "+obj);
return(ret_class.newInstance());
}
catch (ClassNotFoundException e)
{
}
}
throw(new ClassNotFoundException(partly_qualified_classname));
}
catch (InstantiationException e)
{
// FIXXME
// an InstantiationException should be declared in the
// signature of this method
throw new ExceptionInInitializerError();
}
catch (IllegalAccessException e)
{
// FIXXME
// an IllegalAccessException should be declared in the
// signature of this method
throw new ExceptionInInitializerError();
}
}
//----------------------------------------------------------------------
/**
* Just for clearing the cache...
*
* @return
*/
public void clearClassCache()
{
cache_.clear();
}
// FIXXME (Stefan Thalauer, Apr 4 2002 15:12) -> searchpath methodes
//----------------------------------------------------------------------
/**
* This method returns the position the path
*
* @param path
* @return returns the index if the new path allready exists in the search
* path, -1 if not
* @exception IllegalStateException thrown if no path has been
* set before
*/
public int getSearchPathIndex(String path)
throws IllegalStateException
{
if (path_==null)
{
throw new IllegalStateException();
}
for(int count=0; count < path_.length ; count++)
{
if ( path_[count].equals(path) )
return count;
}
return -1;
}
//----------------------------------------------------------------------
/**
* This method checks if a path is in the current SearchPath
*
* @param path
* @return returns true if the new path allready exists in the search
* path
* @exception IllegalStateException thrown if no path has been
* set before
*/
public boolean isSearchPathRegistered(String path)
throws IllegalStateException
{
if (getSearchPathIndex(path) == -1)
return false;
else
return true;
}
//----------------------------------------------------------------------
/**
* This method appends a path to the current SearchPath.
*
* @param path
* @exception IllegalArgumentException
*/
public void appendSearchPath(String path)
throws IllegalStateException,IllegalArgumentException
{
if (path_==null)
throw new IllegalStateException();
if (path == null)
throw new IllegalArgumentException("The Path must not be <null>");
insertPath(path,path_.length);
}
//----------------------------------------------------------------------
/**
* This method inserts the path at the position in the current SearchPath.
*
* @param path
* @param position
* @exception IllegalStateException thrown if no path has been
* set before
* @exception IllegalArgumentException
*/
public void insertSearchPath(String path,int position)
throws IllegalStateException,IllegalArgumentException
{
if (path_==null)
throw new IllegalStateException();
if (path == null)
throw new IllegalArgumentException("The Path must not be <null>");
if ( position < 0 | position > path_.length)
throw new IllegalArgumentException("The Position is out of the Path boundary");
insertPath(path,position);
clearClassCache();
}
//----------------------------------------------------------------------
/**
* This method inserts the path at the position in the current SearchPath.
*
* @param path
* @param position
* @exception IllegalStateException thrown if no path has been
* set before
* @exception IllegalArgumentException
*/
protected void insertPath(String path,int position)
throws IllegalStateException,IllegalArgumentException
{
if (isSearchPathRegistered(path))
{
if (Debug.DEBUG)
Debug.println(Debug.WARNING_LEVEL,"Path: \"" + path +"\" allready registered in the Search Path");
}
else
{
String[] new_path = new String [path_.length + 1];
for (int count = 0; count< position;count++)
{
new_path[count]=path_[count];
}
new_path[position]=path;
for (int count = position; count< path_.length;count++)
{
new_path[count+1]=path_[count];
}
path_ = new_path;
}
}
//----------------------------------------------------------------------
/**
* This method removes the path to the SearchPath.
*
* @param path
* @exception IllegalStateException thrown if no path has been
* set before
* @exception IllegalArgumentException
*/
public void removeSearchPath(String path)
throws IllegalStateException,IllegalStateException
{
if (path == null)
throw new IllegalArgumentException("The Path must not be <null>");
int position = getSearchPathIndex(path);
if (position < 0)
{
if (Debug.DEBUG)
Debug.println(Debug.WARNING_LEVEL,"Path: \"" + path +"\" is not registered in the Search Path ");
}
else
{
removeSearchPath(position);
}
}
//----------------------------------------------------------------------
/**
* This method removes the last path of the SearchPath.
*
* @exception IllegalStateException thrown if no path has been
* set before
* @exception IllegalArgumentException
*/
public void removeLastSearchPath()
throws IllegalStateException
{
if (path_==null)
throw new IllegalStateException();
removeSearchPath(path_.length-1);
}
//----------------------------------------------------------------------
/**
* This method removes the path on a specified position of the SearchPath.
*
* @param position
* @exception IllegalStateException thrown if no path has been
* set before
* @exception IllegalArgumentException
*/
public void removeSearchPath(int position)
throws IllegalStateException,IllegalArgumentException
{
if (path_==null)
throw new IllegalStateException();
if ( path_.length == 0)
{
if (Debug.DEBUG)
Debug.println(Debug.WARNING_LEVEL,"There are no Path in the Search Path");
}
else
{
if ( position < 0 | position > path_.length)
throw new IllegalArgumentException("The Position is out of the Path boundary");
String[] new_path = new String [path_.length -1];
for (int count = 0; count< position;count++)
{
new_path[count]=path_[count];
}
for (int count = position; count< new_path.length;count++)
{
new_path[count]=path_[count+1];
}
path_ = new_path;
clearClassCache();
}
}
//----------------------------------------------------------------------
/**
* This method reverse the strings in the string array.
*
* @exception IllegalStateException thrown if no path has been
* set before
*/
public void reverseSearchPath()
throws IllegalStateException
{
if (path_==null)
throw new IllegalStateException();
String[] new_path = new String [path_.length];
for(int count = 0;count < path_.length;count++)
{
new_path[count]=path_[path_.length - 1 - count];
}
path_=new_path;
clearClassCache();
}
// END FIXXME (Stefan Thalauer, Feb14 2002 22:32)
}
|
|
From: Stefan T. <th...@us...> - 2002-04-08 16:45:14
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/statemachine
In directory usw-pr-cvs1:/tmp/cvs-serv15599/statemachine
Modified Files:
XMLHandler.java PrimitiveStateMachine.java Parser.java
DataObject.java
Log Message:
Debug Messages
Index: XMLHandler.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/statemachine/XMLHandler.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** XMLHandler.java 4 Apr 2002 05:42:24 -0000 1.7
--- XMLHandler.java 8 Apr 2002 14:13:15 -0000 1.8
***************
*** 26,31 ****
import org.xml.sax.helpers.DefaultHandler;
! import org.dinopolis.util.DFactory;
!
//----------------------------------------------------------------------
--- 26,30 ----
import org.xml.sax.helpers.DefaultHandler;
! import edu.iicm.xpg.util.Debug;
//----------------------------------------------------------------------
***************
*** 53,57 ****
public XMLHandler(PrimitiveStateMachine state_machine,DataObject data)
! throws IllegalArgumentException
{
super();
--- 52,56 ----
public XMLHandler(PrimitiveStateMachine state_machine,DataObject data)
! throws IllegalArgumentException
{
super();
***************
*** 59,64 ****
if (state_machine == null || data == null)
{
! throw (new IllegalArgumentException
! ("initialize XMLHandler with statemachine or data equal null!"));
}
state_machine_=state_machine;
--- 58,63 ----
if (state_machine == null || data == null)
{
! throw (new IllegalArgumentException
! ("initialize XMLHandler with statemachine or data equal null!"));
}
state_machine_=state_machine;
***************
*** 108,122 ****
try
{
! if (length > 0)
! {
! data_.getXMLElement().setValue(new String(chars, start, length));
! }
! state_machine_.input(new XMLInput(Const.XML_CHARS,chars,start,length));
}
catch(Exception exc)
{
! // FIXXME: think of better exception handling; no system.exit?
! exc.printStackTrace();
! System.exit(1);
}
}
--- 107,121 ----
try
{
! if (length > 0)
! {
! data_.getXMLElement().setValue(new String(chars, start, length));
! }
! state_machine_.input(new XMLInput(Const.XML_CHARS,chars,start,length));
}
catch(Exception exc)
{
! // FIXXME: think of better exception handling; no system.exit?
! exc.printStackTrace();
! System.exit(1);
}
}
***************
*** 140,144 ****
if (attributes != null)
{
! xml_element.setAttributes(attributes);
}
data_.getXMLElementStack().push(xml_element);
--- 139,143 ----
if (attributes != null)
{
! xml_element.setAttributes(attributes);
}
data_.getXMLElementStack().push(xml_element);
***************
*** 195,202 ****
public void error(SAXParseException exc)
{
! System.err.println("SAX Error: "
! + ", line " + exc.getLineNumber()
! + "\n, uri " + exc.getSystemId());
! System.err.println(" " + exc.getMessage());
}
--- 194,202 ----
public void error(SAXParseException exc)
{
! if (Debug.DEBUG)
! Debug.println(Debug.PARSER_LEVEL,"SAX Error: "
! + ", line " + exc.getLineNumber()
! + "\n, uri " + exc.getSystemId());
! exc.printStackTrace();
}
***************
*** 210,219 ****
public void fatalError(SAXParseException exc)
{
! System.err.println("SAX Fatal Error: "
! + ", line " + exc.getLineNumber()
! + "\n, uri " + exc.getSystemId());
! System.err.println(" " + exc.getMessage());
exc.printStackTrace();
- System.exit(-2);
}
--- 210,218 ----
public void fatalError(SAXParseException exc)
{
! if (Debug.DEBUG)
! Debug.println(Debug.PARSER_LEVEL,"SAX Fatal Error: "
! + ", line " + exc.getLineNumber()
! + "\n, uri " + exc.getSystemId());
exc.printStackTrace();
}
***************
*** 227,237 ****
public void warning(SAXParseException exc)
{
! System.err.println("SAX Warning: "
! + ", line " + exc.getLineNumber()
! + "\n, uri " + exc.getSystemId());
! System.err.println(" " + exc.getMessage());
exc.printStackTrace();
}
}
--- 226,244 ----
public void warning(SAXParseException exc)
{
! if (Debug.DEBUG)
! Debug.println(Debug.PARSER_LEVEL,"SAX Warning: "
! + ", line " + exc.getLineNumber()
! + "\n, uri " + exc.getSystemId());
exc.printStackTrace();
}
}
+
+
+
+
+
+
+
+
Index: PrimitiveStateMachine.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/statemachine/PrimitiveStateMachine.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PrimitiveStateMachine.java 7 Feb 2002 09:38:12 -0000 1.2
--- PrimitiveStateMachine.java 8 Apr 2002 14:13:15 -0000 1.3
***************
*** 1,291 ****
! /***********************************************************************
! * @(#)$RCSfile$ $Revision$ $Date$
! *
! * Copyright (c) 2001 IICM, Graz University of Technology
! * Schiesstattgasse 4a, A-8010 Graz, Austria.
! *
! * This program is free software; you can redistribute it and/or modify
! * it under the terms of the GNU Lesser General Public License (LGPL)
! * as published by the Free Software Foundation; either version 2.1 of
! * the License, or (at your option) any later version.
! *
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this program; if not, write to the
! * Free Software Foundation, Inc.,
! * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! ***********************************************************************/
!
!
! package edu.iicm.xpg.statemachine;
!
! import java.util.HashMap;
! import java.util.Set;
!
! //----------------------------------------------------------------------
! /**
! * @author Klaus Schmaranz
! * @version $revision$
! */
!
! public class PrimitiveStateMachine implements StateMachine
! {
! protected HashMap states_;
! protected State start_state_;
! protected State current_state_;
! protected DataObject user_data_;
! protected int status_;
!
! protected final static int RUNNING = 0x00000001;
! protected final static int STOPPED = 0x00000002;
! protected final static int INITIALIZED = 0x00000004;
!
! //----------------------------------------------------------------------
! /**
! */
!
! public PrimitiveStateMachine()
! {
! states_ = new HashMap();
! }
!
!
! //----------------------------------------------------------------------
! /**
! * @param start_state_id the id of the start state of this machine
! * @return
! * @exception IllegalArgumentException thrown if the state is invalid
! */
!
! public void setStartState(String start_state_id)
! throws IllegalArgumentException
! {
! if (start_state_id == null)
! throw(new IllegalArgumentException("start_state_id is null"));
! State new_start_state = (State)states_.get(start_state_id);
! if (new_start_state == null)
! throw(new IllegalArgumentException("start_state_id not registered"));
! start_state_ = new_start_state;
! }
!
! //----------------------------------------------------------------------
! /**
! * @param state the state to be registered
! * @param state_id the id under which the state is registered
! * @return
! * @exception IllegalArgumentException thrown if state is not valid
! */
!
! public void registerState(State state,String state_id)
! throws IllegalArgumentException
! {
! if (states_.containsKey(state_id))
! throw(new IllegalArgumentException("duplicate id"));
! states_.put(state_id,state);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param state_id the id of the state to be unregistered
! * @return
! * @exception IllegalArgumentException thrown if state is not valid or not registered
! */
!
! public void unregisterState(String state_id)
! throws IllegalArgumentException
! {
! if (!states_.containsKey(state_id))
! throw(new IllegalArgumentException("state not registered"));
! states_.remove(state_id);
! }
!
! //----------------------------------------------------------------------
! /**
! * @return all registered states
! */
!
! public Set getRegisteredStates()
! {
! return(states_.keySet());
! }
!
! //----------------------------------------------------------------------
! /**
! * @param state_id the Id of a state
! * @return true if a state with the given id is registered, false otherwise
! * @exception IllegalArgumentException thrown if id is not valid
! */
!
! public boolean isStateRegistered(String state_id)
! throws IllegalArgumentException
! {
! return(states_.containsKey(state_id));
! }
!
! //----------------------------------------------------------------------
! /**
! * @return the current state of this machine
! */
!
! public State getCurrentState()
! {
! return(current_state_);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param state_id the Id of a state
! * @return a set of all registered transisitons for the given state
! * @exception IllegalArgumentException thrown if Id is not valid
! */
!
! public Set getRegisteredTransitions(String state_id)
! throws IllegalArgumentException
! {
! if (!states_.containsKey(state_id))
! throw(new IllegalArgumentException("state not registered"));
! State state = (State)states_.get(state_id);
! return(state.getRegisteredTransitions());
! }
!
!
! //----------------------------------------------------------------------
! /**
! * @param transition the transition object to be registered
! * @param input the input that leads to this transition
! * @param from_state_id starting point of the transition
! * @param to_state_id end point of the transition
! * @return
! * @exception IllegalArgumentException thrown if one of the parameters is not valid
! */
!
! public void registerTransition(Input input,Transition transition,
! String from_state_id,String to_state_id)
! throws IllegalArgumentException, DuplicateStateException
! {
! State from_state = (State)states_.get(from_state_id);
! State to_state = (State)states_.get(to_state_id);
! if ((from_state == null) || (to_state == null) ||
! (input == null) || (transition == null))
! throw(new IllegalArgumentException());
! from_state.registerTransition(input,transition,to_state);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param transition the transition object to be registered
! * @param from_state_id starting point of the transition
! * @param to_state_id end point of the transition
! * @return
! * @exception IllegalArgumentException thrown if one of the parameters is not valid
! */
!
! public void registerDefaultTransition(Transition transition,
! String from_state_id,String to_state_id)
! throws IllegalArgumentException
! {
! State from_state = (State)states_.get(from_state_id);
! State to_state = (State)states_.get(to_state_id);
! if ((from_state == null) || (to_state == null) || (transition == null))
! throw(new IllegalArgumentException());
! from_state.registerDefaultTransition(transition,to_state);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param input the input that leads to the transition
! * @param from_state_id
! * @return
! * @exception IllegalArgumentException
! */
!
! public void unregisterTransition(Input input,String from_state_id)
! throws IllegalArgumentException
! {
! State from_state = (State)states_.get(from_state_id);
! if ((from_state == null) || (input == null))
! throw(new IllegalArgumentException());
! from_state.unregisterTransition(input);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param data the user-defined data object that is passed as a parameter
! * @return
! */
!
! public void setUserDefinedDataObject(DataObject data)
! {
! user_data_ = data;
! }
!
! //----------------------------------------------------------------------
! /**
! * @param input the input that leads to a transision
! * @return
! * @exception Exception whatever exception can be thrown by the transition
! */
!
! public void input(Input input)
! throws Exception
! {
! if ((status_ & (RUNNING | INITIALIZED)) == 0)
! throw(new IllegalStateException());
! if ((status_ & RUNNING) != 0)
! {
! status_ &= ~INITIALIZED;
! status_ |= RUNNING;
! }
! Transition transition = current_state_.getTransition(input);
! if (transition == null)
! throw(new IllegalArgumentException("no transition for this input"));
!
! State default_new_state = current_state_.getTransitionDestination(input);
! System.err.println("********Input: " + ((XMLInput)input).getValue());
!
! // System.out.println(" PSM.input: " + input + ", state: " + current_state_);
!
! String desired_state = transition.transitionTriggered(input,current_state_,
! default_new_state,this,user_data_);
! if (desired_state != null) // overriding the default state
! {
! if (!states_.containsKey(desired_state))
! throw(new IllegalArgumentException("desired state not existing"));
! current_state_ = (State)states_.get(desired_state);
! return;
! }
! current_state_ = default_new_state;
! }
!
! //----------------------------------------------------------------------
! /**
! * @return
! */
!
! public void stopMachine()
! {
! current_state_ = null;
! status_ = STOPPED;
! }
!
! //----------------------------------------------------------------------
! /**
! * @return
! */
!
! public void initializeMachine()
! {
! current_state_ = start_state_;
! if (current_state_ != null)
! status_ = INITIALIZED;
! else
! status_ = 0;
! }
!
! }
!
!
--- 1,294 ----
! /***********************************************************************
! * @(#)$RCSfile$ $Revision$ $Date$
! *
! * Copyright (c) 2001 IICM, Graz University of Technology
! * Schiesstattgasse 4a, A-8010 Graz, Austria.
! *
! * This program is free software; you can redistribute it and/or modify
! * it under the terms of the GNU Lesser General Public License (LGPL)
! * as published by the Free Software Foundation; either version 2.1 of
! * the License, or (at your option) any later version.
! *
! * This program is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! * GNU Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this program; if not, write to the
! * Free Software Foundation, Inc.,
! * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! ***********************************************************************/
!
!
! package edu.iicm.xpg.statemachine;
!
! import java.util.HashMap;
! import java.util.Set;
!
! import edu.iicm.xpg.util.Debug;
!
! //----------------------------------------------------------------------
! /**
! * @author Klaus Schmaranz
! * @version $revision$
! */
!
! public class PrimitiveStateMachine implements StateMachine
! {
! protected HashMap states_;
! protected State start_state_;
! protected State current_state_;
! protected DataObject user_data_;
! protected int status_;
!
! protected final static int RUNNING = 0x00000001;
! protected final static int STOPPED = 0x00000002;
! protected final static int INITIALIZED = 0x00000004;
!
! //----------------------------------------------------------------------
! /**
! */
!
! public PrimitiveStateMachine()
! {
! states_ = new HashMap();
! }
!
!
! //----------------------------------------------------------------------
! /**
! * @param start_state_id the id of the start state of this machine
! * @return
! * @exception IllegalArgumentException thrown if the state is invalid
! */
!
! public void setStartState(String start_state_id)
! throws IllegalArgumentException
! {
! if (start_state_id == null)
! throw(new IllegalArgumentException("start_state_id is null"));
! State new_start_state = (State)states_.get(start_state_id);
! if (new_start_state == null)
! throw(new IllegalArgumentException("start_state_id not registered"));
! start_state_ = new_start_state;
! }
!
! //----------------------------------------------------------------------
! /**
! * @param state the state to be registered
! * @param state_id the id under which the state is registered
! * @return
! * @exception IllegalArgumentException thrown if state is not valid
! */
!
! public void registerState(State state,String state_id)
! throws IllegalArgumentException
! {
! if (states_.containsKey(state_id))
! throw(new IllegalArgumentException("duplicate id"));
! states_.put(state_id,state);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param state_id the id of the state to be unregistered
! * @return
! * @exception IllegalArgumentException thrown if state is not valid or not registered
! */
!
! public void unregisterState(String state_id)
! throws IllegalArgumentException
! {
! if (!states_.containsKey(state_id))
! throw(new IllegalArgumentException("state not registered"));
! states_.remove(state_id);
! }
!
! //----------------------------------------------------------------------
! /**
! * @return all registered states
! */
!
! public Set getRegisteredStates()
! {
! return(states_.keySet());
! }
!
! //----------------------------------------------------------------------
! /**
! * @param state_id the Id of a state
! * @return true if a state with the given id is registered, false otherwise
! * @exception IllegalArgumentException thrown if id is not valid
! */
!
! public boolean isStateRegistered(String state_id)
! throws IllegalArgumentException
! {
! return(states_.containsKey(state_id));
! }
!
! //----------------------------------------------------------------------
! /**
! * @return the current state of this machine
! */
!
! public State getCurrentState()
! {
! return(current_state_);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param state_id the Id of a state
! * @return a set of all registered transisitons for the given state
! * @exception IllegalArgumentException thrown if Id is not valid
! */
!
! public Set getRegisteredTransitions(String state_id)
! throws IllegalArgumentException
! {
! if (!states_.containsKey(state_id))
! throw(new IllegalArgumentException("state not registered"));
! State state = (State)states_.get(state_id);
! return(state.getRegisteredTransitions());
! }
!
!
! //----------------------------------------------------------------------
! /**
! * @param transition the transition object to be registered
! * @param input the input that leads to this transition
! * @param from_state_id starting point of the transition
! * @param to_state_id end point of the transition
! * @return
! * @exception IllegalArgumentException thrown if one of the parameters is not valid
! */
!
! public void registerTransition(Input input,Transition transition,
! String from_state_id,String to_state_id)
! throws IllegalArgumentException, DuplicateStateException
! {
! State from_state = (State)states_.get(from_state_id);
! State to_state = (State)states_.get(to_state_id);
! if ((from_state == null) || (to_state == null) ||
! (input == null) || (transition == null))
! throw(new IllegalArgumentException());
! from_state.registerTransition(input,transition,to_state);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param transition the transition object to be registered
! * @param from_state_id starting point of the transition
! * @param to_state_id end point of the transition
! * @return
! * @exception IllegalArgumentException thrown if one of the parameters is not valid
! */
!
! public void registerDefaultTransition(Transition transition,
! String from_state_id,String to_state_id)
! throws IllegalArgumentException
! {
! State from_state = (State)states_.get(from_state_id);
! State to_state = (State)states_.get(to_state_id);
! if ((from_state == null) || (to_state == null) || (transition == null))
! throw(new IllegalArgumentException());
! from_state.registerDefaultTransition(transition,to_state);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param input the input that leads to the transition
! * @param from_state_id
! * @return
! * @exception IllegalArgumentException
! */
!
! public void unregisterTransition(Input input,String from_state_id)
! throws IllegalArgumentException
! {
! State from_state = (State)states_.get(from_state_id);
! if ((from_state == null) || (input == null))
! throw(new IllegalArgumentException());
! from_state.unregisterTransition(input);
! }
!
! //----------------------------------------------------------------------
! /**
! * @param data the user-defined data object that is passed as a parameter
! * @return
! */
!
! public void setUserDefinedDataObject(DataObject data)
! {
! user_data_ = data;
! }
!
! //----------------------------------------------------------------------
! /**
! * @param input the input that leads to a transision
! * @return
! * @exception Exception whatever exception can be thrown by the transition
! */
!
! public void input(Input input)
! throws Exception
! {
! if ((status_ & (RUNNING | INITIALIZED)) == 0)
! throw(new IllegalStateException());
! if ((status_ & RUNNING) != 0)
! {
! status_ &= ~INITIALIZED;
! status_ |= RUNNING;
! }
! Transition transition = current_state_.getTransition(input);
! if (transition == null)
! throw(new IllegalArgumentException("no transition for this input"));
!
! State default_new_state = current_state_.getTransitionDestination(input);
! if (Debug.DEBUG)
! Debug.println(Debug.VERBOSE_LEVEL,"********Input: " + ((XMLInput)input).getValue());
!
! // System.out.println(" PSM.input: " + input + ", state: " + current_state_);
!
! String desired_state = transition.transitionTriggered(input,current_state_,
! default_new_state,this,user_data_);
! if (desired_state != null) // overriding the default state
! {
! if (!states_.containsKey(desired_state))
! throw(new IllegalArgumentException("desired state not existing"));
! current_state_ = (State)states_.get(desired_state);
! return;
! }
! current_state_ = default_new_state;
! }
!
! //----------------------------------------------------------------------
! /**
! * @return
! */
!
! public void stopMachine()
! {
! current_state_ = null;
! status_ = STOPPED;
! }
!
! //----------------------------------------------------------------------
! /**
! * @return
! */
!
! public void initializeMachine()
! {
! current_state_ = start_state_;
! if (current_state_ != null)
! status_ = INITIALIZED;
! else
! status_ = 0;
! }
!
! }
!
!
Index: Parser.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/statemachine/Parser.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Parser.java 4 Apr 2002 05:42:24 -0000 1.6
--- Parser.java 8 Apr 2002 14:13:15 -0000 1.7
***************
*** 29,32 ****
--- 29,34 ----
import org.xml.sax.helpers.XMLReaderFactory;
+ import edu.iicm.xpg.util.Debug;
+
//----------------------------------------------------------------------
/**
***************
*** 66,70 ****
catch (SAXException exc)
{
! // FIXXME: maybe think of a better exception handling here!
exc.printStackTrace();
}
--- 68,72 ----
catch (SAXException exc)
{
! // FIXXME: maybe think of a better exception handling here!
exc.printStackTrace();
}
***************
*** 83,93 ****
if (!input_file.exists())
{
! // FIXXME: better exception handling is needed here!
! System.err.println("Parser: File " + filename + " not existing");
System.exit(-1);
}
try
{
! System.err.println("Begin Parsing");
FileReader file_reader = new FileReader(input_file);
reader_.parse(new InputSource(file_reader));
--- 85,97 ----
if (!input_file.exists())
{
! // FIXXME: better exception handling is needed here!
! if (Debug.DEBUG)
! Debug.println(Debug.PARSER_LEVEL," File " + filename + " not existing");
System.exit(-1);
}
try
{
! if (Debug.DEBUG)
! Debug.println(Debug.VERBOSE_LEVEL,"Begin Parsing");
FileReader file_reader = new FileReader(input_file);
reader_.parse(new InputSource(file_reader));
***************
*** 95,99 ****
catch (Exception exc)
{
! // FIXXME: System.exit ??
exc.printStackTrace();
System.exit(1);
--- 99,103 ----
catch (Exception exc)
{
! // FIXXME: System.exit ??
exc.printStackTrace();
System.exit(1);
***************
*** 110,123 ****
public void setHandlers(XMLHandler handler)
! throws IllegalArgumentException
{
! if (handler == null)
! {
! throw (new IllegalArgumentException
("handler in setHandlers is null!"));
! }
! reader_.setContentHandler(handler);
! reader_.setErrorHandler(handler);
! reader_.setDTDHandler(handler);
}
--- 114,127 ----
public void setHandlers(XMLHandler handler)
! throws IllegalArgumentException
{
! if (handler == null)
! {
! throw (new IllegalArgumentException
("handler in setHandlers is null!"));
! }
! reader_.setContentHandler(handler);
! reader_.setErrorHandler(handler);
! reader_.setDTDHandler(handler);
}
***************
*** 149,153 ****
catch (SAXException e)
{
! System.err.println("Cannot activate validation.");
}
try
--- 153,159 ----
catch (SAXException e)
{
! if (Debug.DEBUG)
! Debug.println(Debug.PARSER_LEVEL,"Cannot activate validation.");
!
}
try
***************
*** 157,161 ****
catch (SAXException e)
{
! System.err.println("Cannot activate Dynamic validation.");
}
try
--- 163,168 ----
catch (SAXException e)
{
! if (Debug.DEBUG)
! Debug.println(Debug.PARSER_LEVEL,"Cannot activate Dynamic validation.");
}
try
***************
*** 165,169 ****
catch (SAXException e)
{
! System.err.println("Cannot activate SCHEMA validation.");
}
}
--- 172,177 ----
catch (SAXException e)
{
! if (Debug.DEBUG)
! Debug.println(Debug.PARSER_LEVEL,"Cannot activate SCHEMA validation.");
}
}
Index: DataObject.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/statemachine/DataObject.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DataObject.java 4 Apr 2002 05:42:24 -0000 1.7
--- DataObject.java 8 Apr 2002 14:13:15 -0000 1.8
***************
*** 28,31 ****
--- 28,33 ----
import java.util.EmptyStackException;
+ import edu.iicm.xpg.util.Debug;
+
//----------------------------------------------------------------------
***************
*** 54,59 ****
* @return the top xml element
*/
! // FIXXME: should this function throw an exception if the stack is empty
! // (but no EmptyStackException!) ?
public XMLElement getXMLElement()
{
--- 56,61 ----
* @return the top xml element
*/
! // FIXXME: should this function throw an exception if the stack is empty
! // (but no EmptyStackException!) ?
public XMLElement getXMLElement()
{
***************
*** 76,80 ****
protected Stack getXMLElementStack()
{
! return xml_element_stack_;
}
--- 78,82 ----
protected Stack getXMLElementStack()
{
! return xml_element_stack_;
}
***************
*** 87,105 ****
*/
public void putObject(String key, Object value)
! throws IllegalArgumentException
{
! if (key == null || value == null)
! {
! throw (new IllegalArgumentException
("put object into data object with key or value equal null!"));
! }
! // FIXXME: there should be a possibility storing multiple data with
! // the same key; possibly a stack for each data object will be used
! if ( data_map_.containsKey(key) )
! {
! System.err.println("\"" + key + "\" allready exists inDataObject");
! return;
! }
! data_map_.put(key, value);
}
--- 89,109 ----
*/
public void putObject(String key, Object value)
! throws IllegalArgumentException
{
! if (key == null || value == null)
! {
! throw (new IllegalArgumentException
("put object into data object with key or value equal null!"));
! }
! // FIXXME: there should be a possibility storing multiple data with
! // the same key; possibly a stack for each data object will be used
! if ( data_map_.containsKey(key) )
! {
! if (Debug.DEBUG)
! Debug.println(Debug.WARNING_LEVEL,"\"" + key + "\" allready exists inDataObject");
!
! return;
! }
! data_map_.put(key, value);
}
***************
*** 112,123 ****
*/
public Object getObject(String key)
! throws IllegalArgumentException
{
! if (key == null)
! {
! throw (new IllegalArgumentException
("get object with key equal null!"));
! }
! return data_map_.get(key);
}
--- 116,127 ----
*/
public Object getObject(String key)
! throws IllegalArgumentException
{
! if (key == null)
! {
! throw (new IllegalArgumentException
("get object with key equal null!"));
! }
! return data_map_.get(key);
}
***************
*** 130,141 ****
*/
public Object removeObject(String key)
! throws IllegalArgumentException
{
! if (key == null)
! {
! throw (new IllegalArgumentException
("remove object with key equal null!"));
! }
! return data_map_.remove(key);
}
}
--- 134,145 ----
*/
public Object removeObject(String key)
! throws IllegalArgumentException
{
! if (key == null)
! {
! throw (new IllegalArgumentException
("remove object with key equal null!"));
! }
! return data_map_.remove(key);
}
}
|
|
From: Stefan T. <th...@us...> - 2002-04-08 16:44:32
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/util In directory usw-pr-cvs1:/tmp/cvs-serv24942/util Log Message: Directory /cvsroot/xpg-xml/edu/iicm/xpg/util added to the repository |
|
From: Stefan T. <th...@us...> - 2002-04-08 16:44:27
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions
In directory usw-pr-cvs1:/tmp/cvs-serv15599/transitions
Modified Files:
StoreDataTransition.java
Log Message:
Debug Messages
Index: StoreDataTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/StoreDataTransition.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** StoreDataTransition.java 4 Apr 2002 05:42:24 -0000 1.8
--- StoreDataTransition.java 8 Apr 2002 14:13:16 -0000 1.9
***************
*** 31,34 ****
--- 31,37 ----
import edu.iicm.xpg.statemachine.XMLElement;
+ import edu.iicm.xpg.util.Debug;
+
+
//----------------------------------------------------------------------
/**
***************
*** 72,92 ****
switch (data_type_)
{
! case BEGINSTATE:
! data.putObject("beginstate", element_value);
! break;
! case NEXTSTATE:
! data.putObject("nextstate", element_value);
! break;
! case ELEMENT:
! if (element_value != null)
! {
! data.putObject("element", element_value);
! }
! data.putObject("type", element.getAttributes().getValue("type"));
! break;
! case CLASSNAME:
! data.putObject("classname", element_value);
! break;
! default: System.err.println("StoreDataTransition: illegal datatype!");
}
--- 75,99 ----
switch (data_type_)
{
! case BEGINSTATE:
! data.putObject("beginstate", element_value);
! break;
! case NEXTSTATE:
! data.putObject("nextstate", element_value);
! break;
! case ELEMENT:
! if (element_value != null)
! {
! data.putObject("element", element_value);
! }
! data.putObject("type", element.getAttributes().getValue("type"));
! break;
! case CLASSNAME:
! data.putObject("classname", element_value);
! break;
! default:
! {
! if (Debug.DEBUG)
! Debug.println(Debug.WARNING_LEVEL,"StoreDataTransition: illegal datatype!");
! }
}
|
|
From: Stefan T. <th...@us...> - 2002-04-08 16:44:27
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple
In directory usw-pr-cvs1:/tmp/cvs-serv15599/transitions/simple
Modified Files:
WriteDocContentTransition.java WriteHeaderTransition.java
WriteParaTransition.java
Log Message:
Debug Messages
Index: WriteDocContentTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple/WriteDocContentTransition.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** WriteDocContentTransition.java 28 Feb 2002 06:37:30 -0000 1.2
--- WriteDocContentTransition.java 8 Apr 2002 14:13:16 -0000 1.3
***************
*** 32,38 ****
--- 32,42 ----
import edu.iicm.xpg.statemachine.Const;
+ import edu.iicm.xpg.util.Debug;
+
import java.util.Vector;
import java.util.Enumeration;
+
+
//----------------------------------------------------------------------
/**
***************
*** 89,96 ****
html_form.append(content);
else
! System.err.println("Error (printing to form): document has no content");
!
! // writeCourseList(html_form,collection.getCourses());
!
return(null);
}
--- 93,101 ----
html_form.append(content);
else
! {
! if (Debug.DEBUG)
! Debug.println(Debug.TRANSITION_LEVEL,"Error (printing to form): document has no content");
! }
! // writeCourseList(html_form,collection.getCourses());
return(null);
}
***************
*** 103,125 ****
*/
! /* protected synchronized void writeCourseList(StringBuffer html_form,Vector course_list)
! {
! if (course_list == null)
! {
! System.err.println("Error (printing to form): collection has no courses");
! return;
! }
! html_form.append("<table border=\"1\" cellspacing=\"2\">\n");
! field_counter_ = 0;
! Enumeration courses = course_list.elements();
! while(courses.hasMoreElements())
! {
! CourseEquivalence course = (CourseEquivalence)courses.nextElement();
! writeCourse(html_form,course);
! }
! html_form.append("</table>\n");
! } */
//----------------------------------------------------------------------
--- 108,130 ----
*/
! /* protected synchronized void writeCourseList(StringBuffer html_form,Vector course_list)
! {
! if (course_list == null)
! {
! System.err.println("Error (printing to form): collection has no courses");
! return;
! }
! html_form.append("<table border=\"1\" cellspacing=\"2\">\n");
! field_counter_ = 0;
! Enumeration courses = course_list.elements();
! while(courses.hasMoreElements())
! {
! CourseEquivalence course = (CourseEquivalence)courses.nextElement();
! writeCourse(html_form,course);
! }
! html_form.append("</table>\n");
! } */
//----------------------------------------------------------------------
***************
*** 130,256 ****
*/
! /* protected void writeCourse(StringBuffer html_form,CourseEquivalence course)
! {
! field_counter_++;
! int alternative_counter = 0;
! boolean groupwise = false;
! Vector entries = course.getAllNew();
! // ------------------------------ "any" Course
! if (entries.isEmpty())
! {
! html_form.append("<tr>\n");
! html_form.append(" <td><input type=\"hidden\" name=\"" + COURSE_LABEL + coll_counter_ +
! "_" + field_counter_ + "_1" +
! "\">\n<input type=\"text\" size=\"20\" maxlength=\"60\" name=\"" + TITLE_ANY_LABEL +
! coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Typ: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"" +
! TYPE_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Std: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"" +
! HOURS_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
! DATE_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
! MARK_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
! REMARK_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("</tr>\n");
! return;
! }
! // ------------------------------ new course
! Enumeration entry_enum = entries.elements();
! if (entries.size() > 1) // multiple alternatives
! {
! groupwise = true;
! html_form.append("<tr><td colspan=\"6\" align=\"center\"><strong><i>" +
! "Folgende Veranstaltungen werden gruppenweise angerechnet</i></strong></td></tr>");
! }
! while(entry_enum.hasMoreElements())
! {
! CourseEntry entry = (CourseEntry)entry_enum.nextElement();
! alternative_counter++;
! html_form.append("<tr>\n");
! html_form.append(" <td><input type=\"hidden\" name=\"" + COURSE_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\">\n<strong>");
! html_form.append(entry.getTitle());
! html_form.append("<input type=\"hidden\" name=\"" + TITLE_NEW_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getTitle() + "\">\n");
! html_form.append("</strong></td><td>");
! html_form.append("Typ: ");
! html_form.append(entry.getType());
! html_form.append("<input type=\"hidden\" name=\"" + TYPE_NEW_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getType() + "\">\n");
! html_form.append("</td><td>");
! html_form.append("Std: ");
! html_form.append(entry.getHours());
! html_form.append("<input type=\"hidden\" name=\"" + HOURS_NEW_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getHours() + "\">\n");
! html_form.append("</td>");
! html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
! DATE_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
! MARK_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
! REMARK_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("</tr>\n");
! }
! // ------------------------------ old course
! alternative_counter = 0;
! entries = course.getAllOld();
! if (entries.isEmpty())
! return;
! entry_enum = entries.elements();
! while(entry_enum.hasMoreElements())
! {
! CourseEntry entry = (CourseEntry)entry_enum.nextElement();
! alternative_counter++;
! html_form.append("<tr>\n");
! html_form.append(" <td> <i>");
! html_form.append(entry.getTitle());
! html_form.append("<input type=\"hidden\" name=\"" + TITLE_OLD_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getTitle() + "\">\n");
! html_form.append("</i></td><td>");
! html_form.append("Typ: ");
! html_form.append(entry.getType());
! html_form.append("<input type=\"hidden\" name=\"" + TYPE_OLD_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getType() + "\">\n");
! html_form.append("</td><td>");
! html_form.append("Std: ");
! html_form.append(entry.getHours());
! html_form.append("<input type=\"hidden\" name=\"" + HOURS_OLD_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getHours() + "\">\n");
! html_form.append("</td>");
! html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
! DATE_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
! MARK_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
! REMARK_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("</tr>\n");
! }
! if (groupwise) // multiple alternatives
! {
! html_form.append("<tr><td colspan=\"6\" align=\"center\"><strong><i>" +
! "Ende der Anrechnungsgruppe</i></strong></td></tr>");
! }
! } */
}
--- 135,261 ----
*/
! /* protected void writeCourse(StringBuffer html_form,CourseEquivalence course)
! {
! field_counter_++;
! int alternative_counter = 0;
! boolean groupwise = false;
! Vector entries = course.getAllNew();
! // ------------------------------ "any" Course
! if (entries.isEmpty())
! {
! html_form.append("<tr>\n");
! html_form.append(" <td><input type=\"hidden\" name=\"" + COURSE_LABEL + coll_counter_ +
! "_" + field_counter_ + "_1" +
! "\">\n<input type=\"text\" size=\"20\" maxlength=\"60\" name=\"" + TITLE_ANY_LABEL +
! coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Typ: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"" +
! TYPE_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Std: <input type=\"text\" size=\"4\" maxlength=\"4\" name=\"" +
! HOURS_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
! DATE_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
! MARK_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
! REMARK_ANY_LABEL + coll_counter_ + "_" + field_counter_ + "_1" + "\"></td>\n");
! html_form.append("</tr>\n");
! return;
! }
! // ------------------------------ new course
! Enumeration entry_enum = entries.elements();
! if (entries.size() > 1) // multiple alternatives
! {
! groupwise = true;
! html_form.append("<tr><td colspan=\"6\" align=\"center\"><strong><i>" +
! "Folgende Veranstaltungen werden gruppenweise angerechnet</i></strong></td></tr>");
! }
! while(entry_enum.hasMoreElements())
! {
! CourseEntry entry = (CourseEntry)entry_enum.nextElement();
! alternative_counter++;
! html_form.append("<tr>\n");
! html_form.append(" <td><input type=\"hidden\" name=\"" + COURSE_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\">\n<strong>");
! html_form.append(entry.getTitle());
! html_form.append("<input type=\"hidden\" name=\"" + TITLE_NEW_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getTitle() + "\">\n");
! html_form.append("</strong></td><td>");
! html_form.append("Typ: ");
! html_form.append(entry.getType());
! html_form.append("<input type=\"hidden\" name=\"" + TYPE_NEW_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getType() + "\">\n");
! html_form.append("</td><td>");
! html_form.append("Std: ");
! html_form.append(entry.getHours());
! html_form.append("<input type=\"hidden\" name=\"" + HOURS_NEW_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getHours() + "\">\n");
! html_form.append("</td>");
! html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
! DATE_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
! MARK_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
! REMARK_NEW_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("</tr>\n");
! }
! // ------------------------------ old course
! alternative_counter = 0;
! entries = course.getAllOld();
! if (entries.isEmpty())
! return;
! entry_enum = entries.elements();
! while(entry_enum.hasMoreElements())
! {
! CourseEntry entry = (CourseEntry)entry_enum.nextElement();
! alternative_counter++;
! html_form.append("<tr>\n");
! html_form.append(" <td> <i>");
! html_form.append(entry.getTitle());
! html_form.append("<input type=\"hidden\" name=\"" + TITLE_OLD_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getTitle() + "\">\n");
! html_form.append("</i></td><td>");
! html_form.append("Typ: ");
! html_form.append(entry.getType());
! html_form.append("<input type=\"hidden\" name=\"" + TYPE_OLD_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getType() + "\">\n");
! html_form.append("</td><td>");
! html_form.append("Std: ");
! html_form.append(entry.getHours());
! html_form.append("<input type=\"hidden\" name=\"" + HOURS_OLD_LABEL + coll_counter_ +
! "_" + field_counter_ + "_" + alternative_counter + "\" value=\"" +
! entry.getHours() + "\">\n");
! html_form.append("</td>");
! html_form.append("<td>Dat: <input type=\"text\" size=\"10\" maxlength=\"10\" name=\"" +
! DATE_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("<td>Note: <input type=\"text\" size=\"2\" maxlength=\"1\" name=\"" +
! MARK_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("<td>Bem.: <input type=\"text\" size=\"13\" maxlength=\"200\" name=\"" +
! REMARK_OLD_LABEL + coll_counter_ + "_" + field_counter_ + "_" +
! alternative_counter + "\"></td>\n");
! html_form.append("</tr>\n");
! }
! if (groupwise) // multiple alternatives
! {
! html_form.append("<tr><td colspan=\"6\" align=\"center\"><strong><i>" +
! "Ende der Anrechnungsgruppe</i></strong></td></tr>");
! }
! } */
}
Index: WriteHeaderTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple/WriteHeaderTransition.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** WriteHeaderTransition.java 28 Feb 2002 06:37:30 -0000 1.2
--- WriteHeaderTransition.java 8 Apr 2002 14:13:16 -0000 1.3
***************
*** 31,34 ****
--- 31,37 ----
import edu.iicm.xpg.statemachine.Const;
+ import edu.iicm.xpg.util.Debug;
+
+
//----------------------------------------------------------------------
/**
***************
*** 54,58 ****
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
! throws Exception
{
StringBuffer html_form = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
--- 57,61 ----
public String transitionTriggered(Input input,State from_state,State to_state,
StateMachine machine,DataObject data)
! throws Exception
{
StringBuffer html_form = (StringBuffer)data.getObject(Const.RESULT_BUFFER);
***************
*** 61,66 ****
if (doc_title == null)
! System.err.println("Error (printing to form): document has no title");
!
html_form.append("<title>" + doc_title + "</title>\n");
--- 64,72 ----
if (doc_title == null)
! {
! if (Debug.DEBUG)
! Debug.println(Debug.TRANSITION_LEVEL,"Error (printing to form): document has no title");
!
! }
html_form.append("<title>" + doc_title + "</title>\n");
Index: WriteParaTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/simple/WriteParaTransition.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** WriteParaTransition.java 21 Mar 2002 08:10:17 -0000 1.2
--- WriteParaTransition.java 8 Apr 2002 14:13:16 -0000 1.3
***************
*** 32,35 ****
--- 32,37 ----
import edu.iicm.xpg.statemachine.Const;
+ import edu.iicm.xpg.util.Debug;
+
import java.util.Vector;
import java.util.Enumeration;
***************
*** 65,70 ****
result.append("\n" + para + "\n");
else
! System.err.println("Error (printing to result): sect has no para");
!
return(null);
}
--- 67,74 ----
result.append("\n" + para + "\n");
else
! {
! if (Debug.DEBUG)
! Debug.println(Debug.TRANSITION_LEVEL,"Error (printing to result): sect has no para");
! }
return(null);
}
|
|
From: Stefan T. <th...@us...> - 2002-04-08 16:40:03
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/generator
In directory usw-pr-cvs1:/tmp/cvs-serv15599/generator
Modified Files:
Generator.java DocumentGenerator.java
Log Message:
Debug Messages
Index: Generator.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/generator/Generator.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Generator.java 4 Apr 2002 05:42:24 -0000 1.9
--- Generator.java 8 Apr 2002 14:13:15 -0000 1.10
***************
*** 29,32 ****
--- 29,34 ----
import edu.iicm.xpg.statemachine.Const;
+ import edu.iicm.xpg.util.Debug;
+
//----------------------------------------------------------------------
/**
***************
*** 52,57 ****
super();
! // set up the statemachine
! System.err.println("Setting up State Machine");
initializer_ = new InitParser(config_file);
initializer_.initialize(state_machine_);
--- 54,60 ----
super();
! // set up the statemachine
! if (Debug.DEBUG)
! Debug.println(Debug.VERBOSE_LEVEL,"Setting up State Machine");
initializer_ = new InitParser(config_file);
initializer_.initialize(state_machine_);
Index: DocumentGenerator.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/generator/DocumentGenerator.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** DocumentGenerator.java 4 Apr 2002 05:42:24 -0000 1.7
--- DocumentGenerator.java 8 Apr 2002 14:13:15 -0000 1.8
***************
*** 27,30 ****
--- 27,33 ----
import java.io.IOException;
+ import edu.iicm.xpg.util.Debug;
+
+
//----------------------------------------------------------------------
/**
***************
*** 52,55 ****
--- 55,65 ----
System.exit(-1);
}
+ if (Debug.DEBUG)
+ {
+ Debug.setWriterToFile("./debug.log");
+ Debug.setMessageFormat("DEBUG %level%: \"%message%\"");
+ Debug.addLevelsToPrint(Debug.WARNING_LEVEL+" "+ Debug.TRANSITION_LEVEL+" "+Debug.PARSER_LEVEL +" "+Debug.VERBOSE_LEVEL );
+ }
+
Generator generator = new Generator( args[0] );
|
|
From: Stefan T. <th...@us...> - 2002-04-08 15:38:29
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/statemachine
In directory usw-pr-cvs1:/tmp/cvs-serv16573/statemachine
Modified Files:
InitParser.java
Log Message:
Factory updated
Index: InitParser.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/statemachine/InitParser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** InitParser.java 4 Apr 2002 05:42:24 -0000 1.4
--- InitParser.java 8 Apr 2002 14:14:34 -0000 1.5
***************
*** 26,30 ****
import org.xml.sax.SAXException;
! import org.dinopolis.util.DFactory;
--- 26,31 ----
import org.xml.sax.SAXException;
!
! import edu.iicm.xpg.util.Factory;
***************
*** 60,64 ****
("configfile of InitParser is null!"));
}
! DFactory transition_factory = new DFactory(DEFAULT_SEARCH_PATH);
data_.putObject(TRANSITION_FATORY, transition_factory);
config_file_= config_file;
--- 61,65 ----
("configfile of InitParser is null!"));
}
! Factory transition_factory = new Factory(DEFAULT_SEARCH_PATH);
data_.putObject(TRANSITION_FATORY, transition_factory);
config_file_= config_file;
|
|
From: Stefan T. <th...@us...> - 2002-04-08 15:38:18
|
Update of /cvsroot/xpg-xml/edu/iicm/xpg/transitions
In directory usw-pr-cvs1:/tmp/cvs-serv16573/transitions
Modified Files:
ClassLoaderTransition.java RegisterTransitionTransition.java
SetSearchPathTransition.java
Log Message:
Factory updated
Index: ClassLoaderTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/ClassLoaderTransition.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ClassLoaderTransition.java 7 Feb 2002 09:51:58 -0000 1.3
--- ClassLoaderTransition.java 8 Apr 2002 14:14:34 -0000 1.4
***************
*** 24,29 ****
package edu.iicm.xpg.transitions;
- import org.dinopolis.util.DFactory;
-
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.StateMachine;
--- 24,27 ----
***************
*** 32,35 ****
--- 30,36 ----
import edu.iicm.xpg.statemachine.DataObject;
+ import edu.iicm.xpg.util.Factory;
+
+
//----------------------------------------------------------------------
/**
***************
*** 40,48 ****
public class ClassLoaderTransition implements Transition
{
! protected DFactory transition_factory_;
protected String classname_;
// FIXXME ??
! public ClassLoaderTransition( DFactory transition_factory, String classname )
{
classname_ = classname;
--- 41,49 ----
public class ClassLoaderTransition implements Transition
{
! protected Factory transition_factory_;
protected String classname_;
// FIXXME ??
! public ClassLoaderTransition( Factory transition_factory, String classname )
{
classname_ = classname;
Index: RegisterTransitionTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/RegisterTransitionTransition.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** RegisterTransitionTransition.java 8 Mar 2002 19:04:38 -0000 1.6
--- RegisterTransitionTransition.java 8 Apr 2002 14:14:34 -0000 1.7
***************
*** 26,31 ****
import org.xml.sax.Attributes;
- import org.dinopolis.util.DFactory;
-
import edu.iicm.xpg.statemachine.Const;
import edu.iicm.xpg.statemachine.Transition;
--- 26,29 ----
***************
*** 38,41 ****
--- 36,42 ----
import edu.iicm.xpg.statemachine.DataObject;
+ import edu.iicm.xpg.util.Factory;
+
+
//----------------------------------------------------------------------
/**
***************
*** 71,76 ****
(PrimitiveStateMachine)data.getObject("doc_state_machine");
! DFactory transition_factory =
! (DFactory)data.getObject("transition_factory");
Transition transition =
--- 72,77 ----
(PrimitiveStateMachine)data.getObject("doc_state_machine");
! Factory transition_factory =
! (Factory)data.getObject("transition_factory");
Transition transition =
Index: SetSearchPathTransition.java
===================================================================
RCS file: /cvsroot/xpg-xml/edu/iicm/xpg/transitions/SetSearchPathTransition.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SetSearchPathTransition.java 14 Feb 2002 22:27:15 -0000 1.3
--- SetSearchPathTransition.java 8 Apr 2002 14:14:34 -0000 1.4
***************
*** 23,28 ****
package edu.iicm.xpg.transitions;
- import org.dinopolis.util.DFactory;
-
import edu.iicm.xpg.statemachine.Transition;
import edu.iicm.xpg.statemachine.StateMachine;
--- 23,26 ----
***************
*** 32,35 ****
--- 30,36 ----
import edu.iicm.xpg.statemachine.DataObject;
+ import edu.iicm.xpg.util.Factory;
+
+
//----------------------------------------------------------------------
/**
***************
*** 60,65 ****
String path = ((XMLInput)input).getValue();
! DFactory transition_factory =
! (DFactory)data.getObject("transition_factory");
// FIXXME (Stefan Thalauer, Feb14 2002 22:37) -> new append path
transition_factory.appendSearchPath(path);
--- 61,66 ----
String path = ((XMLInput)input).getValue();
! Factory transition_factory =
! (Factory)data.getObject("transition_factory");
// FIXXME (Stefan Thalauer, Feb14 2002 22:37) -> new append path
transition_factory.appendSearchPath(path);
|