From: <ki...@us...> - 2003-04-30 23:45:52
|
Update of /cvsroot/pymerase/Docs/linkDB-tutorial In directory sc8-pr-cvs1:/tmp/cvs-serv6976 Modified Files: linkdb-tutorial.tex Log Message: Removed Jython Support Documentation is compatible with new parseXMI module Fixed Minor Errors Added new Driver Program Template Cleaned up code formatting New Running Pymerase Section Added copyright year Index: linkdb-tutorial.tex =================================================================== RCS file: /cvsroot/pymerase/Docs/linkDB-tutorial/linkdb-tutorial.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** linkdb-tutorial.tex 9 Apr 2003 17:32:46 -0000 1.6 --- linkdb-tutorial.tex 30 Apr 2003 23:45:44 -0000 1.7 *************** *** 32,37 **** \title{\cb Pymerase Docs - LinkDB Tutorial} \author{Brandon King \\ ! Copyright \copyright California Institute of Technology} ! \date{Version 0.1.6\\\today} \maketitle \thispagestyle{empty} --- 32,37 ---- \title{\cb Pymerase Docs - LinkDB Tutorial} \author{Brandon King \\ ! Copyright \copyright 2003 California Institute of Technology} ! \date{Version 0.1.7\\\today} \maketitle \thispagestyle{empty} *************** *** 77,90 **** \footnote{http://www.egenix.com/files/python/mxDateTime.html} \item PyGresql\footnote{http://www.druid.net/pygresql/} \item maybe more %FIXME: Needs updating \end{itemize} - \item Jython 2.1\footnote{http://www.jython.org/} or greater - \begin{itemize} - \item Java Xerces 2 Lib - \footnote{http://xml.apache.org/xerces2-j/index.html} - \end{itemize} \item PostgreSQL 7.2\footnote{http://www.postgresql.org/} or greater \item Java 1.3\footnote{http://java.sun.com/} or greater ! \item ArgoUML %FIXME: Need to set version dependancies \end{itemize} --- 77,86 ---- \footnote{http://www.egenix.com/files/python/mxDateTime.html} \item PyGresql\footnote{http://www.druid.net/pygresql/} + \item SMW - Python XMI Parser\footnote{http://www.abo.fi/~iporres/html/smw.html} \item maybe more %FIXME: Needs updating \end{itemize} \item PostgreSQL 7.2\footnote{http://www.postgresql.org/} or greater \item Java 1.3\footnote{http://java.sun.com/} or greater ! \item ArgoUML, Poseidon, or SMW UML Editor %FIXME: Need to set version dependancies \end{itemize} *************** *** 207,221 **** ! \subsection{\cb Driver Program Template}\label{template} If you look at the documentation ''Pymerase Docs - Running Pymerase'', ! you will notice that there are three ways of running ! pymerase. Unfortunately, Pymerase, in it's current state only has one ! method of running pymerase using Jython. If for some reason you do ! not want to use jython or you want to use one of the other method for ! running pymerase, you use the table.dtd XML\footnote{If no ! documentation exist on the table.dtd XML format, please e-mail the ! mailing list mentioned in section \ref{pymdevel}.} ! (parseGenexSchemaXML input module) format to define your schema. Below you will find the Driver Program Template from ''Pymerase Docs - Running Pymerase'' --- 203,221 ---- ! \subsection{\cb Running Pymerase} If you look at the documentation ''Pymerase Docs - Running Pymerase'', ! you will notice that there are four methods of running ! pymerase. At the time this tutorial was written, the only method for ! using UML/XMI with pymerase was to use the Driver Program Template and ! Jython.\footnote{As Jython is no longer needed, support has been ! dropped} For this reason, we use the Driver Program Template for ! this tutorial. If you would like to use one of the other methods for ! running pymerase, feel free. Also note that you can also use the ! table.dtd XML\footnote{If no documentation exist on the table.dtd XML ! format, please e-mail the mailing list mentioned in section ! \ref{pymdevel}.} format (parseGenexSchemaXML input module) to define ! your schema. + \subsection{\cb Driver Program Template}\label{template} Below you will find the Driver Program Template from ''Pymerase Docs - Running Pymerase'' *************** *** 223,279 **** %\pagebreak % BEGIN SNIP FROM 'PYMERASE DOCS - RUNNING PYMERASE' ! ------------Driver Program Template-----------\\ ! \color{red} ! \#!/usr/bin/env python ! \color{black} ! import sys\\ ! import os import pymerase - - \begin{tabbing} - \color{red} - \#In\=\color{red}put module to use (parseGenexSchemaXML.py would be\\ - \color{red} - \# \> \color{red} pymerase.input.parseGenexSchemaXML)\\ - \color{black} - import pymerase.input.\em nameOfInputModule \\ - \\ - \color{red} - \#Output module to use (CreateDBAPI.py would\\ - \color{red}\# \> \color{red} be pymerase.output.CreateDBAPI)\\ - \color{black} - import pymerase.output.\em nameOfOutputModule \\ - \\ - if \_\_name\_\_ == '\_\_main\_\_':\\ - \> \color{red} \#Path to schema\\ - \color{black} - \>schema = os.path.abspath('../path2schema/schema') \\ - \\ - \> \color{red} \#Output Path\\ - \color{black} - \>outputPath = os.path.abspath('./outputPath')\\ - \\ ! \> \color{red} \#Run pymerase\\ ! \color{black} ! \>pymerase.run(\=schema,\\ ! \> \>pymerase.input.\em nameOfInputModule,\\ ! \> \>outputPath,\\ ! \> \>pymerase.output.\em nameOfOutputModule) ! \end{tabbing} --------End Driver Program Template--------- % END SNIP FROM 'PYMERASE DOCS - RUNNING PYMERASE' For this tutorial, all driver programs will be using ! '.../path2schema/linkdb.xmi' for the schema variable and ! 'pymerase.input.parseXMI' for the input module. \subsection{\cb Todo for All Templates} ! For each of the driver programs you will create .py file and paste in ! the template from section \ref{template}. Changed the ! schema path to the path were your .xmi file we extracted in section ! \ref{xmi} and that you replace 'nameOfInputModule' with 'parseXMI'. --- 223,262 ---- %\pagebreak % BEGIN SNIP FROM 'PYMERASE DOCS - RUNNING PYMERASE' ! \begin{verbatim} ! ------------Driver Program Template----------- ! #!/usr/bin/env python + import sys + import os import pymerase ! if __name__ == '__main__': ! #Path to schema ! schema = os.path.abspath('./path2schema/schema') ! ! #Output Path ! outputPath = os.path.abspath('./outputPath') ! ! #Run pymerase ! pymerase.run(schema, ! 'nameOfInputModule', ! outputPath, ! 'nameofOutputModule') ! ! ! \end{verbatim} --------End Driver Program Template--------- % END SNIP FROM 'PYMERASE DOCS - RUNNING PYMERASE' For this tutorial, all driver programs will be using ! '.../path2schema/linkdb\_.xmi' for the schema variable and 'parseXMI' ! for the input module. \subsection{\cb Todo for All Templates} ! For each of the driver programs you will create a .py file and paste ! in the template from section \ref{template}. Changed the schema path ! to the path were your .xmi file we extracted in section \ref{xmi} and ! that you replace 'nameOfInputModule' with 'parseXMI'. *************** *** 382,394 **** \begin{verbatim} ! jython ./createsql.py \end{verbatim} If everything goes well, you should find a file called linkDB.sql in your tutorial directory. If something goes wrong, you probably don't ! have jython and/or pymerase setup correctly. Read the Pymerase ! Installation Documentation\footnote{http://pymerase.sf.net/docs/} or ! e-mail the pymerase-devel mailing list mentioned in section ! \ref{pymdevel}. \subsection{\cb CreateDBAPI}\label{linkapi} --- 365,376 ---- \begin{verbatim} ! python createsql.py \end{verbatim} If everything goes well, you should find a file called linkDB.sql in your tutorial directory. If something goes wrong, you probably don't ! pymerase setup correctly. Read the Pymerase Installation ! Documentation\footnote{http://pymerase.sf.net/docs/} or e-mail the ! pymerase-devel mailing list mentioned in section \ref{pymdevel}. \subsection{\cb CreateDBAPI}\label{linkapi} *************** *** 396,400 **** \begin{verbatim} ! jython ./createapi.py \end{verbatim} --- 378,382 ---- \begin{verbatim} ! python createapi.py \end{verbatim} *************** *** 448,452 **** \begin{verbatim} ! jython ./createpytkwidgets.py \end{verbatim} --- 430,434 ---- \begin{verbatim} ! python createpytkwidgets.py \end{verbatim} *************** *** 495,499 **** \begin{verbatim} ! jython ./createpytkwidgets.py \end{verbatim} --- 477,481 ---- \begin{verbatim} ! python createpytkwidgets.py \end{verbatim} *************** *** 647,651 **** If you decide to use the appendix or example code provided, the python code is commented and should be fairly self explanitory. If you don't ! agree or you run into problems, posts the mailing list mentioned in section \ref{pymdevel} are always welcome. --- 629,633 ---- If you decide to use the appendix or example code provided, the python code is commented and should be fairly self explanitory. If you don't ! agree or you run into problems, post to the mailing list mentioned in section \ref{pymdevel} are always welcome. |