From: Egon W. <eg...@us...> - 2002-06-08 20:12:44
|
Update of /cvsroot/woc/woc/source/wocjava In directory usw-pr-cvs1:/tmp/cvs-serv16294 Added Files: .cvsignore Changelog Makefile repository_def.xml woclist.pl woclist.sh Log Message: Adding java source code for generating website. --- NEW FILE: .cvsignore --- woclist.xml --- NEW FILE: Changelog --- 2002-02-12 ---------- * spaanse, italiaanse, franse en friese vertalingen worden nu ook gegeven --- NEW FILE: Makefile --- JAVAC=/usr/lib/j2sdk1.3/bin/javac JAR=/usr/lib/j2sdk1.3/bin/jar JAVA=/usr/lib/j2sdk1.3/bin/java JARS="jars/dadml.jar:jars/jgl.jar:jars/xt2.jar:jars/xalan.jar:jars/xerces.jar:jars/wocjava.jar:jars/wocutil.jar:build" OPTIONS=-R /home/egonw/data/Projects/Woc/wocjava/repository_def.xml all: jar classes: ${JAVAC} -classpath ${JARS} -d build -O `find source/com -name "*.java"` clean: cd build; rm -fR * jar: classes cd build; ${JAR} cvf ../jars/wocjava.jar com/* items: ${JAVA} -cp ${JARS} com.egonw.woc.tools.MaakLosseItems ${OPTIONS} woord: ${JAVA} -cp ${JARS} com.egonw.woc.tools.Woord ${OPTIONS} groups: ${JAVA} -cp ${JARS} com.egonw.woc.tools.GroupFiles ${OPTIONS} --- NEW FILE: repository_def.xml --- <repositories> <!-- definitions of repositories consist mostly of directory names --> <general> <path id="PhysicalRoot">/home/egonw/data/Projects/Woc/</path> <!-- definition of DADML dirs --> <path id="DADMLSubDir">wocdata/dadml/</path> <path id="MolSubDir">mol/</path> <path id="PdbSubDir">pdb/</path> <path id="XyzSubDir">xyz/</path> <path id="CmlSubDir">cml/</path> <path id="PhysPropSubDir">fysisch/cml/</path> <path id="GifSubDir">gifgalary/</path> <!-- website --> <path id="HtmlRoot">http://www.sci.kun.nl/woc/</path> <path id="CgiBinRoot">http://www.sci.kun.nl/cgi-bin-woc/</path> <path id="JavaSubDir">java/</path> <!-- other --> <path id="BronnenFile">woc_bron.html</path> <path id="DatabasesFile">super.xml</path> </general> <specific repository="woc"> <!-- source --> <path id="DataSubDir">wocdata/</path> <path id="WMLSubDir">wml</path> <path id="PictureSubDir">wocdata/pictures/</path> <path id="ModelsSubDir">wocdata/compounds/</path> <!-- website --> <path id="LetterFileSubDir">gui/letters/</path> <path id="ItemFileSubDir">gui/items/</path> <path id="GroupFileSubDir">gui/groups/</path> <path id="IndexFileSubDir">gui/index/</path> <path id="CSSSubDir">gui/styles/</path> <path id="LocatieSubDir">gui/locatie/</path> <path id="JavascriptSubDir">gui/javascript/</path> </specific> <specific repository="iupac"> <!-- source --> <path id="DataSubDir">iupac/data/</path> <path id="WMLSubDir">iupac/data/wml</path> <path id="PictureSubDir">iupac/data/pictures/</path> <path id="ModelsSubDir">iupac/data/compounds/</path> <!-- website --> <path id="LetterFileSubDir">iupac/gui/letters/</path> <path id="ItemFileSubDir">iupac/gui/items/</path> <path id="GroupFileSubDir">iupac/gui/groups/</path> <path id="IndexFileSubDir">iupac/gui/index/</path> <path id="CSSSubDir">iupac/gui/styles/</path> <path id="LocatieSubDir">iupac/gui/locatie/</path> <path id="JavascriptSubDir">iupac/gui/javascript/</path> </specific> </repositories> --- NEW FILE: woclist.pl --- # hulp-script gebruikt door wocml.sh my $cmldir="/home/egonw/data/woc/dadml/fysisch/cml"; my $infile; my $outfile; if (@ARGV >= 2) { $infile = shift; $outfile = shift; } else { $infile = "woclist.tmp2.xml"; $outfile = "woclist.xml"; } open (INFILE, "$infile"); open (OUTFILE, ">$outfile"); #print eerste regel alvast $_ = <INFILE>; print OUTFILE; while (<INFILE>) { my $file; if (/ITEM.*?CODE=/i) { s/CODE/FILE/i; print OUTFILE; } elsif (/\<\?xml.*\?\>/i) { s/\<\?xml.*\?\>//i; print OUTFILE; } else { print OUTFILE; } } # zoals in Convert.java sub NAMELikeToANCHORLike { # heeft 1 parameter my $param = shift @_; $param =~ s/^\s*(.*?)\s*$/$1/ig; $param =~ s/\ /\_/g; $param =~ s/[,|.|<|>]//g; $param =~ tr/[A-Z]/[a-z]/; return $param; } --- NEW FILE: woclist.sh --- #! /bin/sh -e # The below three things should be customized dtddir="/home/egonw/data/Projects/Woc/dtd" name="woclist" wmldir="/home/egonw/data/Projects/Woc/wocdata/wml" ext=".xml" temp=".tmp" temp2=".tmp2" # cmldir is in perl-stukje gedefinieerd cat $wmldir/*.xml > $name$temp echo '<?xml version="1.0" encoding="ISO-8859-1"?>' > $name$temp2 echo '<!DOCTYPE '$name' SYSTEM "'$dtddir/$name'.dtd">' >> $name$temp2 echo '<'$name' xmlns:xsl="http://www.w3.org/1999/XSL/Transform"' >> $name$temp2 echo ' xmlns:import="http://www.sci.kun.nl/woc/import"' >> $name$temp2 echo ' xmlns:xlink="http://www.sci.kun.nl/woc/topicmap">' >> $name$temp2 awk "/\<ITEM/,/\<\/ITEM/{print}" $name$temp >> $name$temp2 echo '</'$name'>' >> $name$temp2 perl $name.pl $name$temp2 $name$ext rm $name$temp $name$temp2 # chgrp www-woc $name$ext chmod 664 $name$ext |