hmath-commits Mailing List for HMath - MathML Wiki/BLOG (Page 5)
Status: Pre-Alpha
Brought to you by:
jsurfer
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(28) |
Mar
(121) |
Apr
(49) |
May
(11) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: Klaus H. <js...@us...> - 2004-03-19 21:09:13
|
Update of /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2css/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv824/src/org/hartmath/tex2css/test Added Files: Parse2CSSTestCase.java Log Message: misc changes --- NEW FILE: Parse2CSSTestCase.java --- package org.hartmath.tex2css.test; import junit.framework.TestCase; //import org.hartmath.core.expression.ExpressionFactory; import org.hartmath.tex2mml.TeXParser; /** * Tests parser funciond for SimpleParserFactory */ public class Parse2CSSTestCase extends TestCase { TeXParser parser; public Parse2CSSTestCase(String name) { super(name); } public void testParser() { tex2mml("\\infty", "∞"); tex2mml("\\sum_{k = 0}^{n}", "<m><SuM><x>n</x><x>k=0</x></SuM></m>"); tex2mml("\\sum^{n}_{k = 0}", "<m><SuM><x>n</x><x>k=0</x></SuM></m>"); tex2mml("\\left { \\right] \\left { \\right]", "<m>{]{]</m>"); tex2mml("\\begin{array}{cc}" + "a & b \\\\" + "c & d \\\\" + "\\end{array}", "<M><r><n>a</n><n>b</n></r><r><n>c</n><n>d</n></r></M>"); tex2mml("\\frac{1}{2}", "<f><r>1</r><r>2</r></f>"); // // tex2mml("\\hat x", "<m:mover><m:mi>x</m:mi><m:mo>^</m:mo></m:mover>"); // tex2mml("\\hat{x}", "<m:mover><m:mi>x</m:mi><m:mo>^</m:mo></m:mover>"); // // tex2mml( // "\\sum_{n=0}^\\infty", // "<m:mrow><m:munderover><m:mo>∑</m:mo><m:mrow><m:mi>n</m:mi><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow><m:mo>∞</m:mo></m:munderover></m:mrow>"); // // tex2mml( // "\\mathbb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}", // "<m:mi>ℂℍℕℙℚℝℤ</m:mi>"); // // tex2mml( // "x 2+\\frac{b}{a}x+\\frac{c}{a}=0", // "<m:mrow><m:mi>x</m:mi><m:mn>2</m:mn><m:mo>+</m:mo><m:mfrac><m:mi>b</m:mi><m:mi>a</m:mi></m:mfrac><m:mi>x</m:mi><m:mo>+</m:mo><m:mfrac><m:mi>c</m:mi><m:mi>a</m:mi></m:mfrac><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow>"); // tex2mml( // "x 2+\\frac{b}{a x}+\\frac{c}{a}=0", // "<m:mrow><m:mi>x</m:mi><m:mn>2</m:mn><m:mo>+</m:mo><m:mfrac><m:mi>b</m:mi><m:mrow><m:mi>a</m:mi><m:mi>x</m:mi></m:mrow></m:mfrac><m:mo>+</m:mo><m:mfrac><m:mi>c</m:mi><m:mi>a</m:mi></m:mfrac><m:mo>=</m:mo><m:mn>0</m:mn></m:mrow>"); // // tex2mml( // "x 2+y_1+z_1234", // "<m:mrow><m:mi>x</m:mi><m:mn>2</m:mn><m:mo>+</m:mo><m:msub><m:mi>y</m:mi><m:mn>1</m:mn></m:msub><m:mo>+</m:mo><m:msub><m:mi>z</m:mi><m:mn>1234</m:mn></m:msub></m:mrow>"); // // tex2mml("\\frac{1}{2}", "<m:mfrac><m:mn>1</m:mn><m:mn>2</m:mn></m:mfrac>"); // tex2mml("a_b", "<m:mrow><m:msub><m:mi>a</m:mi><m:mi>b</m:mi></m:msub></m:mrow>"); // tex2mml("a", "<m:mi>a</m:mi>"); // tex2mml("\\alpha", "<m:mi>α</m:mi>"); } public void tex2mml(String tex, String mml) { StringBuffer buf = new StringBuffer(); parser.initialize(tex); parser.parse2CSS(buf); assertEquals(buf.toString(), mml); } /** * The JUnit setup method */ protected void setUp() { parser = new TeXParser(""); } } |
|
From: Klaus H. <js...@us...> - 2004-03-19 21:08:50
|
Update of /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2css/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv739/src/org/hartmath/tex2css/test Log Message: Directory /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2css/test added to the repository |
|
From: Klaus H. <js...@us...> - 2004-03-19 21:08:50
|
Update of /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv739/src/org/hartmath/tex2css Log Message: Directory /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2css added to the repository |
|
From: Klaus H. <js...@us...> - 2004-03-19 20:29:37
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23782/src/org/hartmath/tex2css/reflection/convert Modified Files: Mathbb.java Mathbf.java Mbox.java Bar.java Mathtt.java Dot.java Sub.java Ddot.java Hat.java Frac.java Sup.java Mathfrak.java Text.java Vec.java Mathcal.java Ul.java Mathsf.java Added Files: Matrix.java Vector.java Log Message: misc changes Index: Mathcal.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Mathcal.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathcal.java 12 Mar 2004 20:47:11 -0000 1.1 --- Mathcal.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,5 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; --- 1,5 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; *************** *** 7,11 **** import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathcal implements IRowConverter { public final static int[] MATHCAL_CODES = { --- 7,11 ---- import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathcal implements IRowCSSConverter { public final static int[] MATHCAL_CODES = { *************** *** 43,47 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { Node temp = row.get(0); --- 43,47 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { Node temp = row.get(0); Index: Hat.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Hat.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Hat.java 12 Mar 2004 20:47:11 -0000 1.1 --- Hat.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Hat implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Hat implements IRowCSSConverter { /* *************** *** 13,24 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { ! // f.tagStart(buf, "mover"); ! row.get(0).convert2CSS(f, buf); ! // f.tagStart(buf, "mo"); ! buf.append(TeX2MathMLFactory.toEntity('\u005E')); // '^' ! // f.tagEnd(buf, "mo"); ! // f.tagEnd(buf, "mover"); return true; } --- 13,28 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { ! // <O> ! // <x>overscript</x> ! // <g>Operator</g> ! // </O> ! ! buf.append("<O><x>"); ! row.get(0).convert2CSS(buf, false); ! buf.append("</x><g>"); ! buf.append(TeX2MathMLFactory.toEntity('\u005E')); ! buf.append("</g></O>"); return true; } Index: Text.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Text.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Text.java 12 Mar 2004 20:47:11 -0000 1.1 --- Text.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; - import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Text implements IRowConverter { /* --- 1,8 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; ! public class Text implements IRowCSSConverter { /* *************** *** 13,17 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mtext"); --- 12,16 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { // f.tagStart(buf, "mtext"); Index: Mathfrak.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Mathfrak.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathfrak.java 12 Mar 2004 20:47:11 -0000 1.1 --- Mathfrak.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,5 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; --- 1,5 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; *************** *** 7,11 **** import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathfrak implements IRowConverter { public final static int[] MATHFRAK_CODES = { --- 7,11 ---- import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathfrak implements IRowCSSConverter { public final static int[] MATHFRAK_CODES = { *************** *** 43,47 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { Node temp = row.get(0); --- 43,47 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { Node temp = row.get(0); Index: Mathtt.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Mathtt.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathtt.java 12 Mar 2004 20:47:11 -0000 1.1 --- Mathtt.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; - import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathtt implements IRowConverter { /* --- 1,8 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; ! public class Mathtt implements IRowCSSConverter { /* *************** *** 13,20 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontfamily=\"monospace\""); ! row.get(0).convert2CSS(f, buf); // f.tagEnd(buf, "mstyle"); return true; --- 12,19 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontfamily=\"monospace\""); ! row.get(0).convert2CSS(buf, false); // f.tagEnd(buf, "mstyle"); return true; Index: Vec.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Vec.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Vec.java 12 Mar 2004 20:47:11 -0000 1.1 --- Vec.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Vec implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Vec implements IRowCSSConverter { /* *************** *** 13,24 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { ! // f.tagStart(buf, "mover"); ! row.get(0).convert2CSS(f, buf); ! // f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u2192')); // '^' ! // f.tagEnd(buf, "mo"); ! // f.tagEnd(buf, "mover"); return true; } --- 13,28 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { ! // <O> ! // <x>overscript</x> ! // <g>Operator</g> ! // </O> ! ! buf.append("<O><x>"); ! row.get(0).convert2CSS(buf, false); ! buf.append("</x><g>"); buf.append(TeX2MathMLFactory.toEntity('\u2192')); // '^' ! buf.append("</g></O>"); return true; } Index: Sup.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Sup.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sup.java 12 Mar 2004 20:47:11 -0000 1.1 --- Sup.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,10 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Sup implements IRowConverter { /* --- 1,10 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Sup implements IRowCSSConverter { /* *************** *** 14,18 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.getTeXSymbol() == "sup" && row.size() == 2) { Node nSup0 = row.get(0); --- 14,18 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.getTeXSymbol() == "sup" && row.size() == 2) { Node nSup0 = row.get(0); *************** *** 23,31 **** Node nSub0 = rowSub0.get(0); if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { ! // f.tagStart(buf, "munderover"); ! nSub0.convert2CSS(f, buf); ! rowSub0.get(1).convert2CSS(f, buf); ! row.get(1).convert2CSS(f, buf); ! // f.tagEnd(buf, "munderover"); return true; } --- 23,50 ---- Node nSub0 = rowSub0.get(0); if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { ! String cssOpen = nSub0.getAttribute(TeX2MathMLFactory.CSS_OPEN); ! String cssClose = nSub0.getAttribute(TeX2MathMLFactory.CSS_CLOSE); ! if (cssOpen!=null&&cssClose!=null) { ! buf.append(cssOpen); ! buf.append("<x>"); ! row.get(1).convert2CSS(buf, true); ! buf.append("</x><x>"); ! rowSub0.get(1).convert2CSS(buf, true); ! buf.append("</x>"); ! buf.append(cssClose); ! return true; ! } ! // <D> ! // <x>overscript</x> ! // <g>Operator</g> ! // <x>underscript</x> ! // </D> ! buf.append("<D><x>"); ! row.get(1).convert2CSS(buf, true); ! buf.append("</x><g>"); ! buf.append(nSub0.toString()); ! buf.append("</g><x>"); ! rowSub0.get(1).convert2CSS(buf, true); ! buf.append("</x></D>"); return true; } *************** *** 33,40 **** } else { if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { ! // f.tagStart(buf, "mover"); ! nSup0.convert2CSS(f, buf); ! row.get(1).convert2CSS(f, buf); ! // f.tagEnd(buf, "mover"); return true; } --- 52,64 ---- } else { if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { ! // <O> ! // <x>overscript</x> ! // <g>Operator</g> ! // </O> ! buf.append("<O><x>"); ! row.get(1).convert2CSS(buf, false); ! buf.append("</x><g>"); ! buf.append(nSup0.toString()); ! buf.append("</g></O>"); return true; } *************** *** 42,48 **** } if (row.size() == 2) { ! row.get(0).convert2CSS(f, buf); buf.append("<t>"); ! row.get(1).convert2CSS(f, buf); buf.append("</t>"); return true; --- 66,72 ---- } if (row.size() == 2) { ! row.get(0).convert2CSS(buf, false); buf.append("<t>"); ! row.get(1).convert2CSS(buf, false); buf.append("</t>"); return true; Index: Mbox.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Mbox.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mbox.java 12 Mar 2004 20:47:11 -0000 1.1 --- Mbox.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; - import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mbox implements IRowConverter { /* --- 1,8 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; ! public class Mbox implements IRowCSSConverter { /* *************** *** 13,20 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mbox"); ! row.get(0).convert2CSS(f, buf); // f.tagEnd(buf, "mbox"); return true; --- 12,19 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { // f.tagStart(buf, "mbox"); ! row.get(0).convert2CSS(buf, false); // f.tagEnd(buf, "mbox"); return true; Index: Ul.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Ul.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Ul.java 12 Mar 2004 20:47:11 -0000 1.1 --- Ul.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Ul implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Ul implements IRowCSSConverter { /* *************** *** 13,24 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { ! // f.tagStart(buf, "munder"); ! row.get(0).convert2CSS(f, buf); ! // f.tagStart(buf, "mo"); ! buf.append(TeX2MathMLFactory.toEntity('\u0332')); // '^' ! // f.tagEnd(buf, "mo"); ! // f.tagEnd(buf, "munder"); return true; } --- 13,27 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { ! // <U> ! // <g>Operator</g> ! // <x>underscript</x> ! // </U> ! buf.append("<U><g>"); ! buf.append(TeX2MathMLFactory.toEntity('\u0332')); ! buf.append("</g><x>"); ! row.get(0).convert2CSS(buf, false); ! buf.append("</x></U>"); return true; } --- NEW FILE: Vector.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; public class Vector implements IRowCSSConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row) { // <V> // <r>a</r> // <r>c</r> // </V> Row oneRow; Node temp; buf.append("<V>"); for (int i=0;i<row.size();i++) { buf.append("<r>"); oneRow = (Row) row.get(i); for (int j=0;j<oneRow.size();j++) { temp = (Node) oneRow.get(j); temp.convert2CSS(buf, false); } buf.append("</r>"); } buf.append("</V>"); return true; } } Index: Mathbf.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Mathbf.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathbf.java 12 Mar 2004 20:47:11 -0000 1.1 --- Mathbf.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; - import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathbf implements IRowConverter { /* --- 1,8 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; ! public class Mathbf implements IRowCSSConverter { /* *************** *** 13,20 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontweight=\"bold\""); ! row.get(0).convert2CSS(f, buf); // f.tagEnd(buf, "mstyle"); return true; --- 12,19 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontweight=\"bold\""); ! row.get(0).convert2CSS(buf, false); // f.tagEnd(buf, "mstyle"); return true; Index: Ddot.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Ddot.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Ddot.java 12 Mar 2004 20:47:11 -0000 1.1 --- Ddot.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; - import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Ddot implements IRowConverter { /* --- 1,8 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; ! public class Ddot implements IRowCSSConverter { /* *************** *** 13,24 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { ! // f.tagStart(buf, "mover"); ! row.get(0).convert2CSS(f, buf); ! // f.tagStart(buf, "mo"); ! buf.append(".."); // '^' ! // f.tagEnd(buf, "mo"); ! // f.tagEnd(buf, "mover"); return true; } --- 12,26 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { ! // <O> ! // <x>overscript</x> ! // <g>Operator</g> ! // </O> ! buf.append("<O><x>"); ! row.get(0).convert2CSS(buf, false); ! buf.append("</x><g>"); ! buf.append(".."); ! buf.append("</g></O>"); return true; } Index: Mathsf.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Mathsf.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathsf.java 12 Mar 2004 20:47:11 -0000 1.1 --- Mathsf.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; - import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathsf implements IRowConverter { /* --- 1,8 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; ! public class Mathsf implements IRowCSSConverter { /* *************** *** 13,20 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontfamily=\"sans-serif\""); ! row.get(0).convert2CSS(f, buf); // f.tagEnd(buf, "mstyle"); return true; --- 12,19 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontfamily=\"sans-serif\""); ! row.get(0).convert2CSS(buf, false); // f.tagEnd(buf, "mstyle"); return true; Index: Frac.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Frac.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Frac.java 12 Mar 2004 20:47:11 -0000 1.1 --- Frac.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; - import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Frac implements IRowConverter { /* --- 1,8 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; ! public class Frac implements IRowCSSConverter { /* *************** *** 13,22 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 2) { buf.append("<f><r>"); ! row.get(0).convert2CSS(f, buf); buf.append("</r><r>"); ! row.get(1).convert2CSS(f, buf); buf.append("</r></f>"); return true; --- 12,21 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 2) { buf.append("<f><r>"); ! row.get(0).convert2CSS(buf, false); buf.append("</r><r>"); ! row.get(1).convert2CSS(buf, false); buf.append("</r></f>"); return true; Index: Dot.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Dot.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Dot.java 12 Mar 2004 20:47:11 -0000 1.1 --- Dot.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; - import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Dot implements IRowConverter { /* --- 1,8 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; ! public class Dot implements IRowCSSConverter { /* *************** *** 13,24 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { ! // f.tagStart(buf, "mover"); ! row.get(0).convert2CSS(f, buf); ! // f.tagStart(buf, "mo"); ! buf.append("."); ! // f.tagEnd(buf, "mo"); ! // f.tagEnd(buf, "mover"); return true; } --- 12,26 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { ! // <O> ! // <x>overscript</x> ! // <g>Operator</g> ! // </O> ! buf.append("<O><x>"); ! row.get(0).convert2CSS(buf, false); ! buf.append("</x><g>"); ! buf.append("."); ! buf.append("</g></O>"); return true; } Index: Bar.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Bar.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Bar.java 12 Mar 2004 20:47:11 -0000 1.1 --- Bar.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Bar implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Bar implements IRowCSSConverter { /* *************** *** 13,24 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { ! // f.tagStart(buf, "mover"); ! row.get(0).convert2CSS(f, buf); ! // f.tagStart(buf, "mo"); ! buf.append(TeX2MathMLFactory.toEntity('\u00AF')); // ! // f.tagEnd(buf, "mo"); ! // f.tagEnd(buf, "mover"); return true; } --- 13,28 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { ! // <O> ! // <x>overscript</x> ! // <g>Operator</g> ! // </O> ! ! buf.append("<O><x>"); ! row.get(0).convert2CSS(buf, false); ! buf.append("</x><g>"); ! buf.append(TeX2MathMLFactory.toEntity('\u00AF')); ! buf.append("</g></O>"); return true; } Index: Sub.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Sub.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sub.java 12 Mar 2004 20:47:11 -0000 1.1 --- Sub.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,10 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Sub implements IRowConverter { /* --- 1,10 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Sub implements IRowCSSConverter { /* *************** *** 14,18 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.getTeXSymbol() == "sub" && row.size() == 2) { Node nSub0 = row.get(0); --- 14,18 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.getTeXSymbol() == "sub" && row.size() == 2) { Node nSub0 = row.get(0); *************** *** 22,30 **** Node nSup0 = rowSup0.get(0); if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { ! // f.tagStart(buf, "munderover"); ! nSup0.convert2CSS(f, buf); ! row.get(1).convert2CSS(f, buf); ! rowSup0.get(1).convert2CSS(f, buf); ! // f.tagEnd(buf, "munderover"); return true; } --- 22,49 ---- Node nSup0 = rowSup0.get(0); if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { ! String cssOpen = nSup0.getAttribute(TeX2MathMLFactory.CSS_OPEN); ! String cssClose = nSup0.getAttribute(TeX2MathMLFactory.CSS_CLOSE); ! if (cssOpen!=null&&cssClose!=null) { ! buf.append(cssOpen); ! buf.append("<x>"); ! rowSup0.get(1).convert2CSS(buf, true); ! buf.append("</x><x>"); ! row.get(1).convert2CSS(buf, true); ! buf.append("</x>"); ! buf.append(cssClose); ! return true; ! } ! // <D> ! // <x>overscript</x> ! // <g>Operator</g> ! // <x>underscript</x> ! // </D> ! buf.append("<D><x>"); ! rowSup0.get(1).convert2CSS(buf, true); ! buf.append("</x><g>"); ! buf.append(nSup0.toString()); ! buf.append("</g><x>"); ! row.get(1).convert2CSS(buf, true); ! buf.append("</x></D>"); return true; } *************** *** 33,44 **** if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { if (!nSub0.getCSSOperator().equals("")) { ! buf.append('<'); ! buf.append(nSub0.getCSSOperator()); ! buf.append('>'); ! ! row.get(1).convert2CSS(f, buf); ! buf.append("</"); ! buf.append(nSub0.getCSSOperator()); ! buf.append('>'); return true; } --- 52,65 ---- if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { if (!nSub0.getCSSOperator().equals("")) { ! // <U> ! // <g>Operator</g> ! // <x>underscript</x> ! // </U> ! buf.append("<U><g>"); ! buf.append(nSub0.toString()); ! buf.append("</g><x>"); ! ! row.get(1).convert2CSS(buf, false); ! buf.append("</x></U>"); return true; } *************** *** 47,53 **** } if (row.size() == 2) { ! row.get(0).convert2CSS(f, buf); buf.append("<l>"); ! row.get(1).convert2CSS(f, buf); buf.append("</l>"); return true; --- 68,74 ---- } if (row.size() == 2) { ! row.get(0).convert2CSS(buf, false); buf.append("<l>"); ! row.get(1).convert2CSS(buf, false); buf.append("</l>"); return true; --- NEW FILE: Matrix.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; public class Matrix implements IRowCSSConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row) { // <M> // <r><n>a</n><n>b</n></r> // <r><n>c</n><n>d</n></r> // </M> Row oneRow; Node temp; buf.append("<M>"); for (int i=0;i<row.size();i++) { buf.append("<r>"); oneRow = (Row) row.get(i); for (int j=0;j<oneRow.size();j++) { buf.append("<n>"); temp = (Node) oneRow.get(j); temp.convert2CSS(buf, false); buf.append("</n>"); } buf.append("</r>"); } buf.append("</M>"); return true; } } Index: Mathbb.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert/Mathbb.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathbb.java 12 Mar 2004 20:47:11 -0000 1.1 --- Mathbb.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,5 **** package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; --- 1,5 ---- package org.hartmath.tex2css.reflection.convert; ! import org.hartmath.tex2mml.IRowCSSConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; *************** *** 7,11 **** import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathbb implements IRowConverter { public final static int[] bbb = { --- 7,11 ---- import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathbb implements IRowCSSConverter { public final static int[] bbb = { *************** *** 43,47 **** * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { Node temp = row.get(0); --- 43,47 ---- * org.hartmath.tex2mml.TeX2MathMLFactory) */ ! public boolean convert(StringBuffer buf, Row row) { if (row.size() == 1) { Node temp = row.get(0); |
|
From: Klaus H. <js...@us...> - 2004-03-19 20:29:14
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23782/src/org/hartmath/tex2mml Modified Files: TeXParser.java Text.java Identifier.java Node.java Scanner.java Row.java TeX2MathMLFactory.java Operator.java Number.java Added Files: IRowMMLConverter.java IRowCSSConverter.java Removed Files: IRowConverter.java Log Message: misc changes Index: Operator.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Operator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Operator.java 12 Mar 2004 20:47:10 -0000 1.2 --- Operator.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 50,54 **** } ! public void convert2CSS(TeX2MathMLFactory f,StringBuffer buf) { buf.append(fOperator.toString()); } --- 50,54 ---- } ! public void convert2CSS(StringBuffer buf,boolean noTags) { buf.append(fOperator.toString()); } Index: Text.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Text.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Text.java 12 Mar 2004 20:47:10 -0000 1.2 --- Text.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 20,24 **** } ! public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) { buf.append(fOutput); } --- 20,24 ---- } ! public void convert2CSS(StringBuffer buf, boolean noTags) { buf.append(fOutput); } --- NEW FILE: IRowCSSConverter.java --- package org.hartmath.tex2mml; public interface IRowCSSConverter { public boolean convert(StringBuffer buffer, Row row); } --- NEW FILE: IRowMMLConverter.java --- package org.hartmath.tex2mml; public interface IRowMMLConverter { public boolean convert(StringBuffer buffer, Row row, TeX2MathMLFactory f); } --- IRowConverter.java DELETED --- Index: Identifier.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Identifier.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Identifier.java 12 Mar 2004 20:47:10 -0000 1.2 --- Identifier.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 20,24 **** } ! public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) { buf.append(fOutput); } --- 20,24 ---- } ! public void convert2CSS(StringBuffer buf, boolean noTags) { buf.append(fOutput); } Index: Node.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Node.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Node.java 12 Mar 2004 20:47:10 -0000 1.2 --- Node.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 37,44 **** } ! public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) { buf.append(fOutput); } /* * (non-Javadoc) --- 37,47 ---- } ! public void convert2CSS(StringBuffer buf, boolean noTags) { buf.append(fOutput); } + public void convert2CSS(StringBuffer buf) { + convert2CSS(buf, false); + } /* * (non-Javadoc) Index: Scanner.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Scanner.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Scanner.java 12 Mar 2004 20:47:10 -0000 1.2 --- Scanner.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 14,17 **** --- 14,18 ---- protected String fOperatorString; + protected String fBackslashSymbol; // row counter for syntax errors: *************** *** 52,55 **** --- 53,63 ---- final static public int TT_OPERATOR = 55; + final static public int TT_DOUBLE_BACKSLASH = 56; + final static public int TT_AMPERSAND = 57; + + final static public int TT_BEGIN = 60; + final static public int TT_END = 61; + final static public int TT_LEFT = 62; + final static public int TT_RIGHT = 63; final static public int TT_ARGUMENTS_OPEN = 126; *************** *** 161,223 **** return; } - // if (ch == '/') { - // if (str.length() > chIndx) { - // if (str.charAt(chIndx) == '/') { - // chIndx++; - // // read comment until end of line: - // while ((str.length() > chIndx) && (str.charAt(chIndx) != '\n')) { - // chIndx++; - // } - // if (str.length() > chIndx) { - // chIndx++; - // } - // continue; - // } - // } - // } - switch (fChar) { case '(' : token = TT_PRECEDENCE_OPEN; - break; case ')' : token = TT_PRECEDENCE_CLOSE; - break; case '{' : token = TT_LIST_OPEN; - break; case '}' : token = TT_LIST_CLOSE; - break; case '[' : token = TT_ARGUMENTS_OPEN; - if (fSourceString.length() > fCurrentPosition) { - if (fSourceString.charAt(fCurrentPosition) == '[') { - fCurrentPosition++; - token = TT_PARTOPEN; - break; - } - } break; case ']' : token = TT_ARGUMENTS_CLOSE; - // if (partCloseExpected) { - // if (str.length() > chIndx) { - // if (str.charAt(chIndx) == ']') { - // chIndx++; - // token = TT_PARTCLOSE; - // break; - // } - // } - // } break; case ',' : ! token = TT_COMMA; ! break; case '!' : --- 169,195 ---- return; } switch (fChar) { case '(' : token = TT_PRECEDENCE_OPEN; break; case ')' : token = TT_PRECEDENCE_CLOSE; break; case '{' : token = TT_LIST_OPEN; break; case '}' : token = TT_LIST_CLOSE; break; case '[' : token = TT_ARGUMENTS_OPEN; break; case ']' : token = TT_ARGUMENTS_CLOSE; break; case ',' : ! token = TT_OPERATOR; ! fOperatorString = ","; break; case '!' : *************** *** 228,257 **** token = TT_OPERATOR; fOperatorString = "_"; - // token = TT_BLANK; - break; case '.' : ! token = TT_DOT; ! if (fSourceString.length() > fCurrentPosition) { ! if (fSourceString.charAt(fCurrentPosition) >= '0' && fSourceString.charAt(fCurrentPosition) <= '9') { ! // don't increment chIndx (see getNumberString()) ! // chIndx++; ! token = TT_DIGIT; // floating-point number ! break; ! } ! } ! break; case '"' : ! token = TT_STRING; ! break; case '%' : ! token = TT_PERCENT; ! break; case ';' : ! token = TT_SEMICOLON; ! break; case '\\' : --- 200,219 ---- token = TT_OPERATOR; fOperatorString = "_"; break; case '.' : ! token = TT_OPERATOR; ! fOperatorString = "."; break; case '"' : ! token = TT_OPERATOR; ! fOperatorString = "\""; break; case '%' : ! token = TT_OPERATOR; ! fOperatorString = "%"; break; case ';' : ! token = TT_OPERATOR; ! fOperatorString = ";"; break; case '\\' : *************** *** 260,264 **** if ((fChar >= 'a' && fChar <= 'z') || (fChar >= 'A' && fChar <= 'Z')) { fCurrentPosition++; ! token = TT_BACKSLASH_SYMBOL; return; } --- 222,231 ---- if ((fChar >= 'a' && fChar <= 'z') || (fChar >= 'A' && fChar <= 'Z')) { fCurrentPosition++; ! getBackslashSymbol(); ! return; ! } ! if (fChar == '\\') { ! fCurrentPosition++; ! token = TT_DOUBLE_BACKSLASH; return; } *************** *** 268,320 **** token = TT_OPERATOR; fOperatorString = "^"; - // - // if (fSourceString.length() > fCurrentPosition) { - // fChar = fSourceString.charAt(fCurrentPosition); - // - // if (fChar == '=') { - // fCurrentPosition++; - // token = TT_UPSET; - // - // break; - // } - // if (fChar == ':') { - // fCurrentPosition++; - // - // if (fSourceString.length() > fCurrentPosition) { - // fChar = fSourceString.charAt(fCurrentPosition); - // - // if (fChar == '=') { - // fCurrentPosition++; - // token = TT_UPSETDELAYED; - // - // break; - // } - // } - // } - // } - break; case '/' : token = TT_OPERATOR; fOperatorString = "/"; - // if (fSourceString.length() > fCurrentPosition) { - // if (fSourceString.charAt(fCurrentPosition) == '.') { - // fCurrentPosition++; - // token = TT_REPLACEALL; - // - // break; - // } - // if (fSourceString.charAt(fCurrentPosition) == '=') { - // fCurrentPosition++; - // token = TT_DIVIDEBY; - // - // break; - // } - // } - break; case '*' : token = TT_OPERATOR; - fOperatorString = "*"; if (fSourceString.length() > fCurrentPosition) { if (fSourceString.charAt(fCurrentPosition) == '*') { --- 235,245 ---- *************** *** 323,435 **** break; } - // if (fSourceString.charAt(fCurrentPosition) == '=') { - // fCurrentPosition++; - // token = TT_TIMESBY; - // - // break; - // } } ! break; case '+' : token = TT_OPERATOR; fOperatorString = "+"; - // if (fSourceString.length() > fCurrentPosition) { - // if (fSourceString.charAt(fCurrentPosition) == '+') { - // fCurrentPosition++; - // token = TT_INCREMENT; - // - // break; - // } - // if (fSourceString.charAt(fCurrentPosition) == '=') { - // fCurrentPosition++; - // token = TT_ADDTO; - // - // break; - // } - // } break; case '-' : token = TT_OPERATOR; fOperatorString = "-"; - // if (fSourceString.length() > fCurrentPosition) { - // if (fSourceString.charAt(fCurrentPosition) == '>') { - // fCurrentPosition++; - // token = TT_RULE; - // - // break; - // } - // if (fSourceString.charAt(fCurrentPosition) == '-') { - // fCurrentPosition++; - // token = TT_DECREMENT; - // - // break; - // } - // if (fSourceString.charAt(fCurrentPosition) == '=') { - // fCurrentPosition++; - // token = TT_SUBTRACTFROM; - // - // break; - // } - // } - break; case '=' : token = TT_OPERATOR; fOperatorString = "="; - // if (fSourceString.length() > fCurrentPosition) { - // fChar = fSourceString.charAt(fCurrentPosition); - // - // if (fChar == '=') { - // fCurrentPosition++; - // token = TT_EQUAL; - // - // break; - // } - // } - break; case '>' : token = TT_OPERATOR; ! fOperatorString = ">"; ! // token = TT_GREATER; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_GREATEREQUAL; ! // ! // break; ! // } ! // } break; case '<' : token = TT_OPERATOR; - fOperatorString = "<"; - // token = TT_LESS; - // - // if (fSourceString.length() > fCurrentPosition) { - // if (fSourceString.charAt(fCurrentPosition) == '=') { - // fCurrentPosition++; - // token = TT_LESSEQUAL; - // - // break; - // } - // } - - break; - case '&' : - token = TT_PUREFUNCTION; if (fSourceString.length() > fCurrentPosition) { ! if (fSourceString.charAt(fCurrentPosition) == '&') { fCurrentPosition++; ! token = TT_AND; ! break; } } ! break; case '|' : --- 248,293 ---- break; } } ! fOperatorString = "*"; break; case '+' : token = TT_OPERATOR; fOperatorString = "+"; break; case '-' : token = TT_OPERATOR; fOperatorString = "-"; break; case '=' : token = TT_OPERATOR; fOperatorString = "="; break; case '>' : token = TT_OPERATOR; ! if (fSourceString.length() > fCurrentPosition) { ! if (fSourceString.charAt(fCurrentPosition) == '=') { ! fCurrentPosition++; ! fOperatorString = "geq"; ! break; ! } ! } + fOperatorString = ">"; break; case '<' : token = TT_OPERATOR; if (fSourceString.length() > fCurrentPosition) { ! if (fSourceString.charAt(fCurrentPosition) == '=') { fCurrentPosition++; ! fOperatorString = "leq"; break; } } ! fOperatorString = "<"; ! break; ! case '&' : ! token = TT_AMPERSAND; ! fOperatorString = "&"; break; case '|' : *************** *** 439,478 **** case ':' : ! if (fSourceString.length() > fCurrentPosition) { ! if (fSourceString.charAt(fCurrentPosition) == '=') { ! fCurrentPosition++; ! token = TT_SETDELAYED; ! ! break; ! } ! if (fSourceString.charAt(fCurrentPosition) == '>') { ! fCurrentPosition++; ! token = TT_RULEDELAYED; ! ! break; ! } ! } ! break; - case '#' : - token = TT_SLOT; - if (fSourceString.length() > fCurrentPosition) { - if (fSourceString.charAt(fCurrentPosition) == '#') { - fCurrentPosition++; - token = TT_SLOTSEQUENCE; - - break; - } - } - break; default : token = TT_CHARACTER; } - // if (token == TT_EOF) { - // throwSyntaxError("token not found"); - // } - return; } --- 297,309 ---- case ':' : ! token = TT_OPERATOR; ! fOperatorString = ":"; break; default : token = TT_CHARACTER; + fOperatorString = String.valueOf(fChar); } return; } *************** *** 484,504 **** } - // protected void throwSyntaxError(String error) { - // - // if (fSourceString.length() < fCurrentPosition) { - // fCurrentPosition--; - // } - // // read until end-of-line - // int eol = fCurrentPosition; - // while (fSourceString.length() > eol) { - // fChar = fSourceString.charAt(eol++); - // if (fChar == '\n') { - // eol--; - // break; - // } - // } - // throw new SyntaxError(rowCount, fCurrentPosition - columnCount, fSourceString.substring(columnCount, eol), error); - // } - public String getIdentifier() { int startPosition = fCurrentPosition - 1; --- 315,318 ---- *************** *** 507,513 **** // special identifiers beginning with "$$" are JSP/servlet specific variables !!! // see org.hmath.servlet.HMTag ! if (fChar == '$') { ! getChar(); ! } while ((fChar >= 'a' && fChar <= 'z') || (fChar >= 'A' && fChar <= 'Z') || (fChar >= '0' && fChar <= '9')) { getChar(); --- 321,327 ---- // special identifiers beginning with "$$" are JSP/servlet specific variables !!! // see org.hmath.servlet.HMTag ! //if (fChar == '$') { ! // getChar(); ! //} while ((fChar >= 'a' && fChar <= 'z') || (fChar >= 'A' && fChar <= 'Z') || (fChar >= '0' && fChar <= '9')) { getChar(); *************** *** 525,535 **** public String getBackslashSymbol() { int startPosition = fCurrentPosition - 1; - getChar(); // special identifiers beginning with "$$" are JSP/servlet specific variables !!! // see org.hmath.servlet.HMTag ! if (fChar == '$') { ! getChar(); ! } while ((fChar >= 'a' && fChar <= 'z') || (fChar >= 'A' && fChar <= 'Z') || (fChar >= '0' && fChar <= '9')) { getChar(); --- 339,348 ---- public String getBackslashSymbol() { int startPosition = fCurrentPosition - 1; getChar(); // special identifiers beginning with "$$" are JSP/servlet specific variables !!! // see org.hmath.servlet.HMTag ! // if (fChar == '$') { ! // getChar(); ! // } while ((fChar >= 'a' && fChar <= 'z') || (fChar >= 'A' && fChar <= 'Z') || (fChar >= '0' && fChar <= '9')) { getChar(); *************** *** 538,546 **** int endPosition = fCurrentPosition--; int length = (--endPosition) - startPosition; ! if (length == 1) { ! return optimizedCurrentTokenSource1(startPosition, endPosition); ! } ! ! return fSourceString.substring(startPosition, endPosition); } --- 351,402 ---- int endPosition = fCurrentPosition--; int length = (--endPosition) - startPosition; ! // if (length == 1) { ! // return optimizedCurrentTokenSource1(startPosition, endPosition); ! // } ! // set default token: ! token = TT_BACKSLASH_SYMBOL; ! fBackslashSymbol = fSourceString.substring(startPosition, endPosition); ! if (fBackslashSymbol.length()>=3 && fBackslashSymbol.length()<=5) { ! int index = startPosition; ! switch(fBackslashSymbol.length()){ ! case 3: // \end ! if (fSourceString.charAt(index)=='e' && ! fSourceString.charAt(++index)=='n' && ! fSourceString.charAt(++index)=='d') { ! token = TT_END; ! return fBackslashSymbol; ! } ! break; ! case 4: // \left ! if (fSourceString.charAt(index)=='l' && ! fSourceString.charAt(++index)=='e' && ! fSourceString.charAt(++index)=='f' && ! fSourceString.charAt(++index)=='t') { ! token = TT_LEFT; ! return fBackslashSymbol; ! } ! break; ! case 5: // \begin \right ! if (fSourceString.charAt(index)=='b' && ! fSourceString.charAt(++index)=='e' && ! fSourceString.charAt(++index)=='g' && ! fSourceString.charAt(++index)=='i' && ! fSourceString.charAt(++index)=='n') { ! token = TT_BEGIN; ! return fBackslashSymbol; ! } ! index = startPosition; ! if (fSourceString.charAt(index)=='r' && ! fSourceString.charAt(++index)=='i' && ! fSourceString.charAt(++index)=='g' && ! fSourceString.charAt(++index)=='h' && ! fSourceString.charAt(++index)=='t') { ! token = TT_RIGHT; ! return fBackslashSymbol; ! } ! break; ! } ! } ! return fBackslashSymbol; } *************** *** 618,663 **** } getChar(); - // if (firstCh == '0') { - // switch (ch) { - // case 'b' : - // numFormat = 2; - // startPosition = chIndx; - // getChar(); - // break; - // case 'B' : - // numFormat = 2; - // startPosition = chIndx; - // getChar(); - // break; - // case 'o' : - // numFormat = 8; - // startPosition = chIndx; - // getChar(); - // break; - // case 'O' : - // numFormat = 8; - // startPosition = chIndx; - // getChar(); - // break; - // case 'x' : - // numFormat = 16; - // startPosition = chIndx; - // getChar(); - // break; - // case 'X' : - // numFormat = 16; - // startPosition = chIndx; - // getChar(); - // break; - // } - // } - - // if (numFormat == 16) { - // while ((ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F')) { - // getChar(); - // } - // } else { - // while ((ch >= '0' && ch <= '9') || (ch == '.') || (ch == 'E') || (ch == 'e')) { while ((fChar >= '0' && fChar <= '9') || (fChar == '.')) { // if ((ch == '.') || (ch == 'E') || (ch == 'e')) { --- 474,478 ---- *************** *** 687,737 **** } - /** - * Method Declaration. - * - */ - // public StringBuffer getStringBuffer() { - // StringBuffer ident = new StringBuffer(); - // - // getChar(); - // - // if ((fChar == '\n') || (token == TT_EOF)) { - // throwSyntaxError("string -" + ident.toString() + "- contains no character."); - // } - // - // while (fChar != '"') { - // if ((fChar == '\\')) { - // getChar(); - // - // switch (fChar) { - // - // case '\\' : - // ident.append(fChar); - // - // break; - // case 'n' : - // ident.append("\n"); - // - // break; - // case 't' : - // ident.append("\t"); - // - // break; - // default : - // throwSyntaxError("string - unknown character after back-slash."); - // } - // - // getChar(); - // } else { - // if ((fChar != '"') && ((fChar == '\n') || (token == TT_EOF))) { - // throwSyntaxError("string -" + ident.toString() + "- not closed."); - // } - // - // ident.append(fChar); - // getChar(); - // } - // } - // - // return ident; - // } } --- 502,504 ---- Index: TeXParser.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/TeXParser.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TeXParser.java 12 Mar 2004 20:47:10 -0000 1.3 --- TeXParser.java 19 Mar 2004 20:19:03 -0000 1.4 *************** *** 178,186 **** getNextToken(); return MML_FACTORY.getIdentifier(str); case TT_BACKSLASH_SYMBOL : ! str = getBackslashSymbol(); getNextToken(); temp = createOperationNode(str, stack); return temp; } return null; --- 178,218 ---- getNextToken(); return MML_FACTORY.getIdentifier(str); + case TT_AMPERSAND : + case TT_CHARACTER : + str = fOperatorString; + getNextToken(); + return MML_FACTORY.getText(str); case TT_BACKSLASH_SYMBOL : ! str = fBackslashSymbol; getNextToken(); temp = createOperationNode(str, stack); return temp; + case TT_BEGIN : + getNextToken(); + return getBegin(); + case TT_LEFT : + getNextToken(); + if (token == TT_LIST_OPEN) { + getNextToken(); + return new Operator("{"); + } else if (token == TT_PRECEDENCE_OPEN) { + getNextToken(); + return new Operator("("); + } else if (token == TT_ARGUMENTS_OPEN) { + getNextToken(); + return new Operator("["); + } + case TT_RIGHT : + getNextToken(); + if (token == TT_LIST_CLOSE) { + getNextToken(); + return new Operator("}"); + } else if (token == TT_PRECEDENCE_CLOSE) { + getNextToken(); + return new Operator(")"); + } else if (token == TT_ARGUMENTS_CLOSE) { + getNextToken(); + return new Operator("]"); + } } return null; *************** *** 231,234 **** } } ! } \ No newline at end of file --- 263,358 ---- } } ! ! private Node getBegin() { ! if (token==TT_LIST_OPEN) { ! getNextToken(); ! } ! String str; ! if (token==TT_IDENTIFIER) { ! str = getIdentifier(); ! getNextToken(); ! if (! str.equals("array")) { ! if (token==TT_LIST_CLOSE) { ! getNextToken(); ! } ! return null; ! } ! } ! if (token==TT_LIST_CLOSE) { ! getNextToken(); ! } ! if (token==TT_LIST_OPEN) { ! getNextToken(); ! } ! int numColumns = 0; ! if (token==TT_IDENTIFIER) { ! str = getIdentifier(); ! numColumns = str.length(); ! getNextToken(); ! } ! if (token==TT_LIST_CLOSE) { ! getNextToken(); ! } ! return createArray(numColumns); ! } ! ! private void getEnd() { ! if (token==TT_LIST_OPEN) { ! getNextToken(); ! } ! if (token==TT_IDENTIFIER) { ! String str = getIdentifier(); ! getNextToken(); ! } ! if (token==TT_LIST_CLOSE) { ! getNextToken(); ! } ! } ! ! public Node createArray(int numColumns) { ! Row rowList; ! if (numColumns==1) { ! rowList = MML_FACTORY.getRow("vector"); ! } else { ! rowList = MML_FACTORY.getRow("matrix"); ! } ! Row list = null; ! Node node1 = null; ! Node node2 = null; ! ! Row colList; ! if (numColumns==1) { ! colList = MML_FACTORY.getRow("vectorrow"); ! } else { ! colList = MML_FACTORY.getRow("matrixrow"); ! } ! while (token != TT_END && token != TT_EOF) { ! if (token!=TT_DOUBLE_BACKSLASH&&token!=TT_AMPERSAND) { ! node1 = createNextNode(null); ! if (node1 != null) { ! colList.add(node1); ! } ! } ! if (token==TT_AMPERSAND) { ! getNextToken(); ! } ! if (token==TT_DOUBLE_BACKSLASH) { ! rowList.add(colList); ! if (numColumns==1) { ! colList = MML_FACTORY.getRow("vectorrow"); ! } else { ! colList = MML_FACTORY.getRow("matrixrow"); ! } ! getNextToken(); ! } ! } ! if (token == TT_END) { ! if (colList.size()!=0) { ! rowList.add(colList); ! } ! getNextToken(); ! getEnd(); ! } ! return rowList; ! } } \ No newline at end of file Index: Number.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Number.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Number.java 12 Mar 2004 20:47:10 -0000 1.2 --- Number.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 20,24 **** } ! public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) { buf.append(fOutput); --- 20,24 ---- } ! public void convert2CSS(StringBuffer buf, boolean noTags) { buf.append(fOutput); Index: Row.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Row.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Row.java 12 Mar 2004 20:47:10 -0000 1.2 --- Row.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 13,17 **** final public static String CSS_CONVERTER_PACKAGE_NAME = "org.hartmath.tex2css.reflection.convert."; final public static HashMap CSS_CONVERTER = new HashMap(199); ! ArrayList fList; int fType; --- 13,17 ---- final public static String CSS_CONVERTER_PACKAGE_NAME = "org.hartmath.tex2css.reflection.convert."; final public static HashMap CSS_CONVERTER = new HashMap(199); ! ArrayList fList; int fType; *************** *** 36,43 **** } ! public static IRowConverter getMMLConverter(String symbol) { Object temp; if ((temp = MML_CONVERTER.get(symbol)) != null) { ! return (IRowConverter) temp; } if (symbol.length() == 0 || MML_CONVERTER.containsKey(symbol)) { --- 36,43 ---- } ! public static IRowMMLConverter getMMLConverter(String symbol) { Object temp; if ((temp = MML_CONVERTER.get(symbol)) != null) { ! return (IRowMMLConverter) temp; } if (symbol.length() == 0 || MML_CONVERTER.containsKey(symbol)) { *************** *** 62,68 **** } ! IRowConverter module; try { ! module = (IRowConverter) clazz.newInstance(); MML_CONVERTER.put(symbol, module); return module; --- 62,68 ---- } ! IRowMMLConverter module; try { ! module = (IRowMMLConverter) clazz.newInstance(); MML_CONVERTER.put(symbol, module); return module; *************** *** 75,79 **** public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { ! IRowConverter converter = getMMLConverter(fTeXSymbol); if (converter != null && converter.convert(buf, this, f)) { --- 75,79 ---- public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { ! IRowMMLConverter converter = getMMLConverter(fTeXSymbol); if (converter != null && converter.convert(buf, this, f)) { *************** *** 88,95 **** } ! public static IRowConverter getCSSConverter(String symbol) { Object temp; if ((temp = CSS_CONVERTER.get(symbol)) != null) { ! return (IRowConverter) temp; } if (symbol.length() == 0 || CSS_CONVERTER.containsKey(symbol)) { --- 88,95 ---- } ! public static IRowCSSConverter getCSSConverter(String symbol) { Object temp; if ((temp = CSS_CONVERTER.get(symbol)) != null) { ! return (IRowCSSConverter) temp; } if (symbol.length() == 0 || CSS_CONVERTER.containsKey(symbol)) { *************** *** 114,120 **** } ! IRowConverter module; try { ! module = (IRowConverter) clazz.newInstance(); CSS_CONVERTER.put(symbol, module); return module; --- 114,120 ---- } ! IRowCSSConverter module; try { ! module = (IRowCSSConverter) clazz.newInstance(); CSS_CONVERTER.put(symbol, module); return module; *************** *** 125,141 **** } ! public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) ! { ! IRowConverter converter = getCSSConverter(fTeXSymbol); ! if (converter != null && converter.convert(buf, this, f)) { return; } ! ! buf.append("<m>"); for (int i = 0; i < fList.size(); i++) { ! ((Node) fList.get(i)).convert2CSS(f, buf); } - buf.append("</m>"); } /** --- 125,143 ---- } ! public void convert2CSS(StringBuffer buf, boolean noTags) { ! IRowCSSConverter converter = getCSSConverter(fTeXSymbol); ! if (converter != null && converter.convert(buf, this)) { return; } ! if (! noTags) { ! buf.append("<m>"); ! } for (int i = 0; i < fList.size(); i++) { ! ((Node) fList.get(i)).convert2CSS(buf, false); ! } ! if (! noTags) { ! buf.append("</m>"); } } /** Index: TeX2MathMLFactory.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/TeX2MathMLFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TeX2MathMLFactory.java 12 Mar 2004 20:47:10 -0000 1.4 --- TeX2MathMLFactory.java 19 Mar 2004 20:19:03 -0000 1.5 *************** *** 17,21 **** public final static String UNDEROVER = "underover"; ! public final static boolean USE_IDENTIFIERS = true; --- 17,23 ---- public final static String UNDEROVER = "underover"; ! public final static String CSS_OPEN = "css_open"; ! public final static String CSS_CLOSE = "css_close"; ! public final static boolean USE_IDENTIFIERS = true; *************** *** 71,75 **** public void convert2CSS(Node node, StringBuffer buf) { ! node.convert2CSS(this, buf); } --- 73,77 ---- public void convert2CSS(Node node, StringBuffer buf) { ! node.convert2CSS(buf, false); } *************** *** 100,105 **** public void tag(StringBuffer buf, String tag, String data) { tagStart(buf, tag); ! // entity(buf, data); ! buf.append(tag); tagEnd(buf, tag); } --- 102,107 ---- public void tag(StringBuffer buf, String tag, String data) { tagStart(buf, tag); ! //entity(buf, data); ! buf.append(data); tagEnd(buf, tag); } *************** *** 196,201 **** //miscellaneous symbols - CONSTANT_SYMBOLS.put("int", new Operator(toEntity('\u222B'), CONSTANT)); - CONSTANT_SYMBOLS.put("oint", new Operator(toEntity('\u222E'), CONSTANT)); CONSTANT_SYMBOLS.put("partial", new Operator(toEntity('\u2202'), CONSTANT)); CONSTANT_SYMBOLS.put("nabla", new Operator(toEntity('\u2207'), CONSTANT)); --- 198,201 ---- *************** *** 291,304 **** ! Map underover = new HashMap(); ! underover.put(UNDEROVER, "true"); ! ! CONSTANT_SYMBOLS.put("sum", new Operator(toEntity('\u2211'), "sum", CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("prod", new Operator(toEntity('\u220F'), "ProD", CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("lim", new Operator("lim", "LiM",CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("bigwedge", new Operator(toEntity('\u22C0'), CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("bigvee", new Operator(toEntity('\u22C1'), CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("bigcap", new Operator(toEntity('\u22C2'), CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("bigcup", new Operator(toEntity('\u22C3'), CONSTANT, underover)); CONSTANT_SYMBOLS.put("+", new Operator("+", CONSTANT)); --- 291,344 ---- ! Map underoverAttr = new HashMap(); ! underoverAttr.put(UNDEROVER, "true"); ! ! Map intAttr = new HashMap(); ! intAttr.put(UNDEROVER, "true"); ! intAttr.put(CSS_OPEN, "<InT>"); ! intAttr.put(CSS_CLOSE, "</InT>"); ! Map ointAttr = new HashMap(); ! ointAttr.put(UNDEROVER, "true"); ! ointAttr.put(CSS_OPEN, "<InT contour=\"+\">"); ! ointAttr.put(CSS_CLOSE, "</InT>"); ! Map sumAttr = new HashMap(); ! sumAttr.put(UNDEROVER, "true"); ! sumAttr.put(CSS_OPEN, "<SuM>"); ! sumAttr.put(CSS_CLOSE, "</SuM>"); ! Map prodAttr = new HashMap(); ! prodAttr.put(UNDEROVER, "true"); ! prodAttr.put(CSS_OPEN, "<ProD>"); ! prodAttr.put(CSS_CLOSE, "</ProD>"); ! Map bigoplusAttr = new HashMap(); ! bigoplusAttr.put(UNDEROVER, "true"); ! bigoplusAttr.put(CSS_OPEN, "<Sum direct= \"+\">"); ! bigoplusAttr.put(CSS_CLOSE, "</Sum>"); ! Map bigotimesAttr = new HashMap(); ! bigotimesAttr.put(UNDEROVER, "true"); ! bigotimesAttr.put(CSS_OPEN, "<Prod direct=\"+\">"); ! bigotimesAttr.put(CSS_CLOSE, "</Prod>"); ! Map limAttr = new HashMap(); ! limAttr.put(UNDEROVER, "true"); ! Map bigcapAttr = new HashMap(); ! bigcapAttr.put(UNDEROVER, "true"); ! bigcapAttr.put(CSS_OPEN, "<CaP>"); ! bigcapAttr.put(CSS_CLOSE, "</CaP>"); ! Map bigcupAttr = new HashMap(); ! bigcupAttr.put(UNDEROVER, "true"); ! bigcupAttr.put(CSS_OPEN, "<CuP>"); ! bigcupAttr.put(CSS_CLOSE, "</CuP>"); ! ! CONSTANT_SYMBOLS.put("int", new Operator(toEntity('\u222B'), CONSTANT, intAttr)); ! CONSTANT_SYMBOLS.put("oint", new Operator(toEntity('\u222E'), CONSTANT, ointAttr)); ! ! CONSTANT_SYMBOLS.put("sum", new Operator(toEntity('\u2211'), CONSTANT, sumAttr)); ! CONSTANT_SYMBOLS.put("prod", new Operator(toEntity('\u220F'), CONSTANT, prodAttr)); ! CONSTANT_SYMBOLS.put("bigoplus", new Operator(toEntity('\u2295'), CONSTANT, bigoplusAttr)); ! CONSTANT_SYMBOLS.put("bigotimes", new Operator(toEntity('\u2297'), CONSTANT, bigotimesAttr)); ! CONSTANT_SYMBOLS.put("lim", new Operator("lim", CONSTANT, limAttr)); ! CONSTANT_SYMBOLS.put("bigwedge", new Operator(toEntity('\u22C0'), CONSTANT, underoverAttr)); ! CONSTANT_SYMBOLS.put("bigvee", new Operator(toEntity('\u22C1'), CONSTANT, underoverAttr)); ! CONSTANT_SYMBOLS.put("bigcap", new Operator(toEntity('\u22C2'), CONSTANT, bigcapAttr)); ! CONSTANT_SYMBOLS.put("bigcup", new Operator(toEntity('\u22C3'), CONSTANT, bigcupAttr)); CONSTANT_SYMBOLS.put("+", new Operator("+", CONSTANT)); |
|
From: Klaus H. <js...@us...> - 2004-03-19 20:29:13
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23782/src/org/hartmath/tex2mml/reflection/convert Modified Files: Dot.java Sub.java Mathcal.java Mbox.java Hat.java Sup.java Vec.java Mathbb.java Mathfrak.java Ul.java Text.java Mathtt.java Bar.java Mathbf.java Mathsf.java Ddot.java Added Files: Sqrt.java Matrix.java Vector.java Root.java Log Message: misc changes Index: Mathcal.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathcal.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathcal.java 15 Feb 2004 14:31:00 -0000 1.1 --- Mathcal.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,5 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; --- 1,5 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; *************** *** 7,11 **** import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathcal implements IRowConverter { public final static int[] MATHCAL_CODES = { --- 7,11 ---- import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathcal implements IRowMMLConverter { public final static int[] MATHCAL_CODES = { Index: Hat.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Hat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Hat.java 12 Mar 2004 20:47:11 -0000 1.2 --- Hat.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Hat implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Hat implements IRowMMLConverter { /* Index: Bar.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Bar.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Bar.java 12 Mar 2004 20:47:11 -0000 1.2 --- Bar.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Bar implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Bar implements IRowMMLConverter { /* Index: Text.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Text.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Text.java 15 Feb 2004 14:31:00 -0000 1.1 --- Text.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Text implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Text implements IRowMMLConverter { /* --- NEW FILE: Matrix.java --- package org.hartmath.tex2mml.reflection.convert; import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Matrix implements IRowMMLConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { // f.tagStart(buf, "mrow"); // f.tag(buf, "mo", "("); f.tagStart(buf, "mtable"); Row oneRow; Node temp; for (int i = 0; i < row.size(); i++) { oneRow = (Row) row.get(i); f.tagStart(buf, "mtr"); for (int j = 0; j < oneRow.size(); j++) { f.tagStart(buf, "mtd"); temp = (Node) oneRow.get(j); temp.convert2MML(f, buf); f.tagEnd(buf, "mtd"); } f.tagEnd(buf, "mtr"); } f.tagEnd(buf, "mtable"); // f.tag(buf, "mo", ")"); // f.tagEnd(buf, "mrow"); return true; } } Index: Mathtt.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathtt.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Mathtt.java 12 Mar 2004 20:47:11 -0000 1.2 --- Mathtt.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathtt implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathtt implements IRowMMLConverter { /* Index: Vec.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Vec.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Vec.java 12 Mar 2004 20:47:11 -0000 1.2 --- Vec.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Vec implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Vec implements IRowMMLConverter { /* Index: Sup.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Sup.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sup.java 12 Mar 2004 20:47:11 -0000 1.2 --- Sup.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,10 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Sup implements IRowConverter { /* --- 1,10 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Sup implements IRowMMLConverter { /* Index: Mbox.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mbox.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Mbox.java 12 Mar 2004 20:47:11 -0000 1.2 --- Mbox.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mbox implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mbox implements IRowMMLConverter { /* Index: Ul.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Ul.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Ul.java 12 Mar 2004 20:47:11 -0000 1.2 --- Ul.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Ul implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Ul implements IRowMMLConverter { /* --- NEW FILE: Vector.java --- package org.hartmath.tex2mml.reflection.convert; import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Vector implements IRowMMLConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { // f.tagStart(buf, "mrow"); // f.tag(buf, "mo", "("); f.tagStart(buf, "mtable"); Row oneRow; Node temp; for (int i = 0; i < row.size(); i++) { oneRow = (Row) row.get(i); f.tagStart(buf, "mtr"); for (int j = 0; j < oneRow.size(); j++) { f.tagStart(buf, "mtd"); temp = (Node) oneRow.get(j); temp.convert2MML(f, buf); f.tagEnd(buf, "mtd"); } f.tagEnd(buf, "mtr"); } f.tagEnd(buf, "mtable"); // f.tag(buf, "mo", ")"); // f.tagEnd(buf, "mrow"); return true; } } Index: Mathbf.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathbf.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Mathbf.java 12 Mar 2004 20:47:11 -0000 1.2 --- Mathbf.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathbf implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathbf implements IRowMMLConverter { /* Index: Dot.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Dot.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Dot.java 12 Mar 2004 20:47:11 -0000 1.2 --- Dot.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Dot implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Dot implements IRowMMLConverter { /* Index: Mathsf.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathsf.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Mathsf.java 12 Mar 2004 20:47:11 -0000 1.2 --- Mathsf.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathsf implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathsf implements IRowMMLConverter { /* Index: Mathfrak.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathfrak.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathfrak.java 15 Feb 2004 14:31:00 -0000 1.1 --- Mathfrak.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,5 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; --- 1,5 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; *************** *** 7,11 **** import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathfrak implements IRowConverter { public final static int[] MATHFRAK_CODES = { --- 7,11 ---- import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathfrak implements IRowMMLConverter { public final static int[] MATHFRAK_CODES = { --- NEW FILE: Sqrt.java --- package org.hartmath.tex2mml.reflection.convert; import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Sqrt implements IRowMMLConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { f.tagStart(buf, "msqrt"); row.get(0).convert2MML(f, buf); f.tagEnd(buf, "msqrt"); return true; } return false; } } Index: Ddot.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Ddot.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Ddot.java 12 Mar 2004 20:47:11 -0000 1.2 --- Ddot.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,9 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Ddot implements IRowConverter { /* --- 1,9 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Ddot implements IRowMMLConverter { /* --- NEW FILE: Root.java --- package org.hartmath.tex2mml.reflection.convert; import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Root implements IRowMMLConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 2) { f.tagStart(buf, "mroot"); row.get(0).convert2MML(f, buf); row.get(1).convert2MML(f, buf); f.tagEnd(buf, "mroot"); return true; } return false; } } Index: Sub.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Sub.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sub.java 12 Mar 2004 20:47:11 -0000 1.2 --- Sub.java 19 Mar 2004 20:19:03 -0000 1.3 *************** *** 1,10 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Sub implements IRowConverter { /* --- 1,10 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Sub implements IRowMMLConverter { /* Index: Mathbb.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathbb.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathbb.java 15 Feb 2004 12:58:34 -0000 1.1 --- Mathbb.java 19 Mar 2004 20:19:03 -0000 1.2 *************** *** 1,5 **** package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; --- 1,5 ---- package org.hartmath.tex2mml.reflection.convert; ! import org.hartmath.tex2mml.IRowMMLConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; *************** *** 7,11 **** import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathbb implements IRowConverter { public final static int[] bbb = { --- 7,11 ---- import org.hartmath.tex2mml.TeX2MathMLFactory; ! public class Mathbb implements IRowMMLConverter { public final static int[] bbb = { |
|
From: <js...@us...> - 2004-03-12 21:32:43
|
Update of /cvsroot/hmath/org.hmath.server/static In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19521/static Added Files: index.html math.css Log Message: misc changes --- NEW FILE: index.html --- <html> <body> Welcome to the <a href="http://snipsnap.org">SnipSnap</a> weblog and wiki software. This is the static directory located at <i>applications/<snipsnap-name>/static</i>. </body> </html> --- NEW FILE: math.css --- /* Designed by George Chavchanidze http://rmi.acnet.ge/~gch/ mailto: se...@op... Version: Silver Owl 118 Last modified on Sun, 5 Feb 2004 */ /* Document Canvas */ root {display:block; font-family:serif; font-size:14pt; line-height:1.5em; text-align:justify;} /* Document Hat */ abs, ads, aut, hat, key, msc, pac, ref {display:block;} abs, ads, key, msc, pac, ref {font-size:0.8em; line-height:1.2em; margin:1mm 0;} hat {margin:1em 3cm 1em 2cm;} /* Document Structure */ b, C, dl, E, e, H, h, ml, nl, P, p, Q, r, rl, S, sl {display:block;} b {font-weight:normal;} c {font-weight:bold;} e {margin:2mm 0 2mm 3cm; line-height:2em; text-align:left;} e[id]:before {content:"(" attr(id) ")"; display:block; margin-bottom:-2em; text-align:right;} H, h {font-size:1.2em; font-weight:bold; text-align:left; margin:1ex 0;} H {font-size:1.4em;} i {display:list-item; font-style:normal;} L {display:block;} m {white-space:nowrap;} o {text-decoration:overline;} P, C, Q {border-bottom:dotted 1px;} p {text-indent:1em; margin:0;} p e, p m {text-indent:0;} rl {margin-left:1cm; text-align:left;} rl i {list-style-type:decimal;} sl i {list-style-type:disc;} S {border:dashed 1px; padding:1mm;} s {font-weight:bold; text-decoration:none;} u {text-decoration:underline;} w {font-style:italic;} /* Inline mathematical expressions */ CaP, CuP, f, InT, ProD, SuM {display:inline-table; display:-moz-inline-box; -moz-box-orient:vertical; line-height:1.5em; margin:0 2px; text-align:center; vertical-align:middle;} /* Fractions */ r {display:block; line-height:1.7em; max-height:1.7em; white-space:nowrap;} r r, l r, t r {max-height:1.2em; line-height:1.2em; font-size:0.7em;} m r {max-height:1.2em; line-height:1.2em; font-size:0.8em;} f r + r {border-top: solid 1px;} /* Indeces */ l {position:relative; top:0.7ex;} l, t, fl, ft {font-size:0.7em;} t {position:relative; top:-1ex;} /* Indexed Operators */ x {display:block; font-size:0.7em; line-height:1em;} x + x:before {display:block; font-size:2.5em; line-height:1.1em;} CaP x + x:before {content:"\2229";} CuP x + x:before {content:"\222A";} InT x + x:before {content:"\222B";} InT[t="d"] x + x:before {content:"\222C";} InT[t="t"] x + x:before {content:"\222D";} InT[t="c"] x + x:before {content:"\222E";} InT[t="dc"] x + x:before {content:"\222F";} InT[t="tc"] x + x:before {content:"\2230";} InT[t="oc"] x + x:before {content:"\2232";} ProD x + x:before {content:"\03A0";} ProD[t="d"] x + x:before {content:"\2297";} SuM x + x:before {content:"\03A3";} SuM[t="d"] x + x:before {content:"\2295";} sum, prod, int, dint, tint, cint, dcint, tcint, ocint {font-size:1.8em; vertical-align:middle;} /* Over and under scripts */ D {display:inline-table; display:-moz-inline-box; -moz-box-orient:vertical; line-height:1.5em; text-align:center; vertical-align:middle;} g {display:block;} /* Linking Extensions */ go[at]:before {content:"(";} go[at]:after {content:")";} go[on] {border:dashed 1px black;} go[to] {border:solid 1px black;} /* Media Groups */ @media screen, projection { c, go, s, h, H {color:maroon;} e, i, m {color:navy;} root {background-color:silver;} } @media print { e, S {page-break-inside:avoid;} root {background-color:white;} } /* Generated Content */ As:before {content:"\2329"} As:after {content:"\232A"} db:before, db:after {content:"\2225"} k:before {content:"{"} k:after {content:"}"} Gamma:before {content:"\0393"} Delta:before {content:"\0394"} Theta:before {content:"\0398"} Lambda:before {content:"\039B"} Xi:before {content:"\039E"} Pi:before {content:"\03A0"} Sigma:before {content:"\03A3"} Phi:before {content:"\03A6"} Psi:before {content:"\03A8"} Omega:before {content:"\03A9"} alpha:before {content:"\03B1"} beta:before {content:"\03B2"} gamma:before {content:"\03B3"} delta:before {content:"\03B4"} epsilon:before {content:"\03B5"} zeta:before {content:"\03B6"} eta:before {content:"\03B7"} theta:before {content:"\03B8"} iota:before {content:"\03B9"} kappa:before {content:"\03BA"} lambda:before {content:"\03BB"} mu:before {content:"\03BC"} nu:before {content:"\03BD"} xi:before {content:"\03BE"} pi:before {content:"\03C0"} rho:before {content:"\03C1"} sigma:before {content:"\03C3"} tau:before {content:"\03C4"} upsilon:before {content:"\03C5"} phi:before {content:"\03C6"} chi:before {content:"\03C7"} psi:before {content:"\03C8"} omega:before {content:"\03C9"} forall:before {content:"\2200"} comp:before {content:"\2201"} part:before {content:"\2202"} exist:before {content:"\2203"} nexist:before {content:"\2204"} empty:before {content:"\2205"} nabla:before {content:"\2207"} in:before {content:"\2208"} notin:before {content:"\2209"} ni:before {content:"\220B"} notni:before {content:"\220C"} prod:before {content:"\03A0"} sum:before {content:"\03A3"} mn:before {content:"\2212"} pm:before {content:"\00B1"} mp:before {content:"\2213"} ast:before {content:"\2217"} radic:before {content:"\221A"} prop:before {content:"\221D"} inf:before {content:"\221E"} mid:before {content:"\2223"} nmid:before {content:"\2224"} par:before {content:"\2225"} npar:before {content:"\2226"} and:before {content:"\2227"} or:before {content:"\2228"} cap:before {content:"\2229"} cup:before {content:"\222A"} int:before {content:"\222B"} dint:before {content:"\222C"} tint:before {content:"\222D"} cint:before {content:"\222E"} dcint:before {content:"\222F"} tcint:before {content:"\2230"} ocint:before {content:"\2232"} sim:before {content:"\223C"} nsim:before {content:"\2241"} sime:before {content:"\2243"} cong:before {content:"\2245"} as:before {content:"\2248"} nas:before {content:"\2249"} ase:before {content:"\224A"} eldot:before {content:"\2252"} erdot:before {content:"\2253"} cole:before {content:"\2254"} ecol:before {content:"\2255"} cire:before {content:"\2257"} ande:before {content:"\2259"} ore:before {content:"\225A"} aste:before {content:"\225B"} trie:before {content:"\225C"} queste:before {content:"\225F"} ne:before {content:"\2260"} eq:before {content:"\2261"} neq:before {content:"\2262"} lt:before {content:"\003C"} gt:before {content:"\003E"} le:before {content:"\2264"} ge:before {content:"\2265"} Le:before {content:"\2266"} Ge:before {content:"\2267"} Lt:before {content:"\226A"} Gt:before {content:"\226B"} nlt:before {content:"\226E"} ngt:before {content:"\226F"} la:before {content:"\2272"} ga:before {content:"\2273"} lg:before {content:"\2276"} gl:before {content:"\2277"} pr:before {content:"\227A"} sc:before {content:"\227B"} prce:before {content:"\227C"} sce:before {content:"\227D"} pra:before {content:"\227E"} sca:before {content:"\227F"} npr:before {content:"\2280"} nsc:before {content:"\2281"} subs:before {content:"\2282"} sups:before {content:"\2283"} nsub:before {content:"\2284"} nsup:before {content:"\2285"} sube:before {content:"\2286"} supe:before {content:"\2287"} cupdot:before {content:"\228D"} cupplus:before {content:"\228E"} Subs:before {content:"\228F"} Sups:before {content:"\2290"} Sube:before {content:"\2291"} Supe:before {content:"\2292"} scap:before {content:"\2293"} scup:before {content:"\2294"} oplus:before {content:"\2295"} otimes:before {content:"\2297"} Star:before {content:"\22C6"} bull:before {content:"\2022"} divide:before {content:"\00F7"} times:before {content:"\00D7"} frasl:before {content:"\2044"} Cmath:before {content:"\2102"} Hmath:before {content:"\210D"} Nmath:before {content:"\2115"} Pmath:before {content:"\2119"} Qmath:before {content:"\211A"} Rmath:before {content:"\211D"} Zmath:before {content:"\2124"} Im:before {content:"\2111"} Re:before {content:"\211C"} hbar:before {content:"\210F"} aleph:before {content:"\2135"} ang:before {content:"\2220"} Ang:before {content:"\2221"} AnG:before {content:"\221F"} lang:before {content:"\2329"} rang:before {content:"\232A"} lceil:before {content:"\2308"} lfloor:before {content:"\230A"} perp:before {content:"\22A5"} vdots:before {content:"\22EE"} hdots:before {content:"\22EF"} rdots:before {content:"\22F0"} ldots:before {content:"\22F1"} cdots:before {content:"\2234"} Dot:before {content:"\22C5"} frac12:before {content:"\00BD"} frac14:before {content:"\00BC"} frac34:before {content:"\00BE"} frac13:before {content:"\2153"} frac23:before {content:"\2154"} frac15:before {content:"\2155"} frac25:before {content:"\2156"} frac35:before {content:"\2157"} frac45:before {content:"\2158"} frac16:before {content:"\2159"} frac56:before {content:"\215A"} frac18:before {content:"\215B"} frac38:before {content:"\215C"} frac58:before {content:"\215D"} frac78:before {content:"\215E"} lar:before {content:"\2190"} uar:before {content:"\2191"} rar:before {content:"\2192"} dar:before {content:"\2193"} har:before {content:"\2194"} tar:before {content:"\2195"} nwar:before {content:"\2196"} near:before {content:"\2197"} sear:before {content:"\2198"} swar:before {content:"\2199"} nlar:before {content:"\219A"} nrar:before {content:"\219B"} LaR:before {content:"\21A4"} UaR:before {content:"\21A5"} RaR:before {content:"\21A6"} DaR:before {content:"\21A7"} clar:before {content:"\21A9"} crar:before {content:"\21AA"} rlar:before {content:"\21C4"} udar:before {content:"\21C5"} lrar:before {content:"\21C6"} llar:before {content:"\21C7"} uuar:before {content:"\21C8"} rrar:before {content:"\21C9"} ddar:before {content:"\21CA"} Nlar:before {content:"\21CD"} Nhar:before {content:"\21CE"} Nrar:before {content:"\21CF"} Lar:before {content:"\21D0"} Uar:before {content:"\21D1"} Rar:before {content:"\21D2"} Dar:before {content:"\21D3"} Har:before {content:"\21D4"} Tar:before {content:"\21D5"} Nwar:before {content:"\21D6"} Near:before {content:"\21D7"} Sear:before {content:"\21D8"} Swar:before {content:"\21D9"} amp:before {content:"\0026"} copy:before {content:"\00A9"} num:before {content:"\2116"} reg:before {content:"\00AE"} sect:before {content:"\00A7"} trade:before {content:"\2122"} deg:before {content:"\00B0"} permil:before {content:"\2030"} dag:before {content:"\2020"} Dag:before {content:"\2021"} md:before {content:"\2014"} nd:before {content:"\2013"} sp:before {content:"\00A0"} Sp:before {content:"\00A0 \00A0 \00A0 \00A0 \00A0"} Aacute:before {content:"\00C1"} Abar:before {content:"\0100"} Acap:before {content:"\0202"} Addot:before {content:"\00C4"} Adot:before {content:"\0226"} Aelig:before {content:"\00C6"} Agrave:before {content:"\00C0"} Ahat:before {content:"\00C2"} Aring:before {content:"\00C5"} Atilde:before {content:"\00C3"} Auml:before {content:"\00C4"} Bdot:before {content:"\1E02"} Ccedil:before {content:"\00C7"} Cdot:before {content:"\010A"} Chat:before {content:"\0108"} Dbar:before {content:"\0110"} Ddot:before {content:"\1E0A"} Eacute:before {content:"\00C9"} Ebar:before {content:"\0112"} Ecap:before {content:"\0206"} Eddot:before {content:"\00CB"} Edot:before {content:"\0116"} Egrave:before {content:"\00C8"} Ehat:before {content:"\00CA"} Etilde:before {content:"\1EBC"} Fdot:before {content:"\1E1E"} Gbar:before {content:"\1E20"} Gdot:before {content:"\0120"} Ghat:before {content:"\011C"} Hddot:before {content:"\1E26"} Hdot:before {content:"\1E22"} Hhat:before {content:"\0124"} Iacute:before {content:"\00CD"} Ibar:before {content:"\012A"} Icap:before {content:"\020A"} Iddot:before {content:"\00CF"} Idot:before {content:"\0130"} Igrave:before {content:"\00CC"} Ihat:before {content:"\00CE"} Itilde:before {content:"\0128"} Jhat:before {content:"\0134"} Mdot:before {content:"\1E40"} Ndot:before {content:"\1E44"} Ntilde:before {content:"\00D1"} Oacute:before {content:"\00D3"} Obar:before {content:"\014C"} Ocap:before {content:"\020E"} Oddot:before {content:"\00D6"} Odot:before {content:"\022E"} Oelig:before {content:"\0152"} Ograve:before {content:"\00D2"} Ohat:before {content:"\00D4"} Oslash:before {content:"\00D8"} Otilde:before {content:"\00D5"} Ouml:before {content:"\00D6"} Pdot:before {content:"\1E56"} Rcap:before {content:"\0212"} Rdot:before {content:"\1E58"} Scaron:before {content:"\0160"} Sdot:before {content:"\1E60"} Shat:before {content:"\015C"} Tdot:before {content:"\1E6A"} Uacute:before {content:"\00DA"} Ubar:before {content:"\016A"} Ucap:before {content:"\0216"} Uddot:before {content:"\00DC"} Ugrave:before {content:"\00D9"} Uhat:before {content:"\00DB"} Uring:before {content:"\016E"} Utilde:before {content:"\0168"} Uuml:before {content:"\00DC"} Vtilde:before {content:"\1E7C"} Wddot:before {content:"\1E84"} Wdot:before {content:"\1E86"} What:before {content:"\0174"} Xddot:before {content:"\1E8C"} Xdot:before {content:"\1E8A"} Yacute:before {content:"\00DD"} Ybar:before {content:"\0232"} Yddot:before {content:"\0178"} Ydot:before {content:"\1E8E"} Yhat:before {content:"\0176"} Ytilde:before {content:"\1EF8"} Zdot:before {content:"\017B"} Zhat:before {content:"\1E90"} aacute:before {content:"\00E1"} abar:before {content:"\0101"} acap:before {content:"\0203"} addot:before {content:"\00E4"} adot:before {content:"\0227"} aelig:before {content:"\00E6"} agrave:before {content:"\00E0"} ahat:before {content:"\00E2"} aring:before {content:"\00E5"} atilde:before {content:"\00E3"} auml:before {content:"\00E4"} ccedil:before {content:"\00E7"} cdot:before {content:"\010B"} chat:before {content:"\0109"} dbar:before {content:"\0111"} eacute:before {content:"\00E9"} ebar:before {content:"\0113"} ecap:before {content:"\0207"} eddot:before {content:"\00EB"} edot:before {content:"\0117"} egrave:before {content:"\00E8"} ehat:before {content:"\00EA"} etilde:before {content:"\1EBD"} fdot:before {content:"\1E1F"} gbar:before {content:"\1E21"} gdot:before {content:"\0121"} ghat:before {content:"\011D"} hddot:before {content:"\1E27"} hdot:before {content:"\1E23"} hhat:before {content:"\0125"} mdot:before {content:"\1E41"} ndot:before {content:"\1E45"} ntilde:before {content:"\00F1"} oacute:before {content:"\00F3"} obar:before {content:"\014D"} ocap:before {content:"\020F"} oddot:before {content:"\00F6"} odot:before {content:"\022F"} oelig:before {content:"\0153"} ograve:before {content:"\00F2"} ohat:before {content:"\00F4"} oslash:before {content:"\00F8"} otilde:before {content:"\00F5"} ouml:before {content:"\00F6"} pdot:before {content:"\1E57"} rcap:before {content:"\0213"} rdot:before {content:"\1E59"} scaron:before {content:"\0161"} sdot:before {content:"\1E61"} shat:before {content:"\015D"} tdot:before {content:"\1E6B"} uacute:before {content:"\00FA"} ubar:before {content:"\016B"} ucap:before {content:"\0217"} uddot:before {content:"\00FC"} uuml:before {content:"\00FC"} ugrave:before {content:"\00F9"} uhat:before {content:"\00FB"} uring:before {content:"\016F"} utilde:before {content:"\0169"} vtilde:before {content:"\1E7D"} wddot:before {content:"\1E85"} wdot:before {content:"\1E87"} what:before {content:"\0175"} xddot:before {content:"\1E8D"} xdot:before {content:"\1E8B"} yacute:before {content:"\00FD"} ybar:before {content:"\0233"} yddot:before {content:"\00FF"} ydot:before {content:"\1E8F"} yhat:before {content:"\0177"} ytilde:before {content:"\1EF9"} zdot:before {content:"\017C"} zhat:before {content:"\1E91"} |
|
From: <js...@us...> - 2004-03-12 21:32:21
|
Update of /cvsroot/hmath/org.hmath.server/static In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19471/static Log Message: Directory /cvsroot/hmath/org.hmath.server/static added to the repository |
|
From: <js...@us...> - 2004-03-12 21:18:31
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/taglib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16283/WEB-INF/src/org/hartmath/server/taglib Modified Files: BrowserTag.java Added Files: BrowserSniffer.java HeaderTag.java Log Message: misc changes --- NEW FILE: BrowserSniffer.java --- package org.hartmath.server.taglib; /* * * Copyright (C) Johannes Lietz, joh...@da... Modified by Klaus Hartlage * * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 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 General Public License for more details. * * You should have received a copy of the GNU 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 * */ import java.io.Serializable; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; /** * Pretty complete detection for browser user agents. * <p> * Provides functionality for detecting the users http client. It has been tested against most browsers that are used today. * <p> * Intended usage in a JSP is: * </p> * * <pre> <%BrowserDetection browser = BrowserDetection.getBrowserDetection(request); %> * * * <% if (browser.isMozilla()) ... else if (browser.isSafari() || browser.isKonqueror()) ... else ... %> * </pre> * * * <p> * Requires J2SE 1.4 because it uses the java.util.regex package * </p> * * @author Johannes Lietz joh...@da... * @version 1.1 (16. Dec. 2003) * * <p> * New in version 1.1: * <ul> * <li>Test for accepted Mimetypes, Charsets and Languages.</li> * <li>Detection if the user has AOL</li> * <li>Detection of the most common search engines and bots</li> * <li>Better naming scheme</li> * </ul> * </p> */ public class BrowserSniffer implements Serializable { static final long serialVersionUID = 7731753920913450421L; public static final String OPERA = "Opera"; public static final String LYNX = "Lynx"; public static final String MSIE = "MSIE"; public static final String MSPIE = "MSPIE"; public static final String NETSCAPE = "Mozilla"; public static final String MOZILLA = "Gecko"; public static final String SAFARI = "Safari"; public static final String KONQUEROR = "Konqueror"; public static final int OPERAID = 1; public static final int LYNXID = 2; public static final int MSIEID = 3; public static final int MSPIEID = 4; public static final int NETSCAPEID = 5; public static final int MOZILLAID = 6; public static final int SAFARIID = 7; public static final int KONQUERORID = 8; public static final int MATHPLAYERID = 9; // MSIE+MathPlayer public static final String WIN = "Win"; public static final String MAC = "Mac"; public static final String UNIX = "Unix"; public static final String WIN_CE = "Windows CE"; public static final String UNKNOWN = "Unknown"; public static final String DEFAULT_SESSION_ATTRIBUTENAME = "org.hartmath.server.taglib.BrowserSniffer"; private String userAgent = null; private int browserId = 0; private String platform = null; private String accept = null; private String acceptLanguage = null; private String acceptCharset = null; private float version = 0; private boolean bot = false; private boolean aol = false; /** * Creates new BrowserDetection from Request(User-Agent). * * @param request */ public BrowserSniffer(HttpServletRequest request) { this.userAgent = request.getHeader("User-Agent"); this.accept = request.getHeader("Accept"); if (this.accept != null) this.accept = this.accept.toLowerCase(); this.acceptLanguage = request.getHeader("Accept-Language"); if (this.acceptLanguage != null) this.acceptLanguage = this.acceptLanguage.toLowerCase(); this.acceptCharset = request.getHeader("Accept-Charset"); if (this.acceptCharset != null) this.acceptCharset = this.acceptCharset.toLowerCase(); detect(); } /** * Creates new BrowserDetection from Request(User-Agent) and adds it to the Session as "attributeName". * * @param request * the HttpServletRequest * @param attributeName * the Name used for the session attribute */ public static void setBrowserDetection(HttpServletRequest request, String attributeName) { if (request.getSession(true).getAttribute(attributeName) == null) getBrowserDetection(request, attributeName); } /** * Creates new BrowserDetection a given User-Agent String * * @param userAgent * the userAgent * @deprecated please use BrowserDetection(HttpServletRequest request) instead */ public BrowserSniffer(String userAgent) { this.userAgent = userAgent; detect(); } /** * Creates new BrowserDetection from Request(User-Agent) and adds it to the Session as DEFAULT_SESSION_ATTRIBUTENAME. * * @param request * the HttpServletRequest */ public static BrowserSniffer getBrowserDetection(HttpServletRequest request) { return getBrowserDetection(request, DEFAULT_SESSION_ATTRIBUTENAME); } /** * Creates new BrowserDetection from Request(User-Agent) and adds it to the Session as "sessionAttributeName". * * @param request * the HttpServletRequest * @param sessionAttributeName * the Name of the Sessionattribute for the BrowserDetection object */ public static BrowserSniffer getBrowserDetection(HttpServletRequest request, String sessionAttributeName) { BrowserSniffer bd = (BrowserSniffer) request.getSession(true).getAttribute(sessionAttributeName); if (bd == null) { bd = new BrowserSniffer(request); request.setAttribute(sessionAttributeName, bd); } return bd; } /** * Standalone Testcode * * @param args */ public static void main(String[] args) { BrowserSniffer bd = new BrowserSniffer( //"Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) // Opera 7.01 [en] "); //"Lynx/2.8.3rel.1 libwww-FM/2.14"); //"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) // Gecko/20030312"); //"Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4.1) // Gecko/20020508 Netscape6/6.2.3"); //"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) "); //"Mozilla/2.0 (compatible; MSIE 3.01; Windows 3.1)"); //"Mozilla/4.75 [en] (Windows NT 5.0; U) "); //"Mozilla/2.0 (Macintosh; U; 68K)"); //"Mozilla/5.0 (Windows; U; Win98; en-US; m18) Gecko/20010131 // Netscape6/6.0"); //"Mozilla/1.1 (compatible; MSPIE 1.1; Windows CE)"); //"Mozilla/4.0 (compatible; MSIE 5.5; Windows 98*)"); //"Mozilla/4.0 (compatible; MSIE 4.0b2; Windows 95)"); //"Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-us) AppleWebKit/60 (like Gecko) Safari/60"); "Mozilla/3.04 (WinNT; U)"); // System.out.println(bd.getBrowser()); System.out.println(bd.getPlatform()); System.out.println(bd.getVersion()); } private void detect() { if (this.userAgent == null) { return; } /////////////////////////////////////////////////// // Search-Engine /////////////////////////////////////////////////// String ua = this.userAgent.toLowerCase(); if (ua.indexOf("bot") != -1 || ua.indexOf("seek") != -1 || ua.indexOf("slurp") != -1 || ua.indexOf("spider") != -1 || ua.indexOf("crawl") != -1 || ua.indexOf("search") != -1 || ua.indexOf("teoma") != -1 || ua.indexOf("sleuth") != -1 || ua.indexOf("search") != -1 || ua.indexOf("find") != -1 || ua.indexOf("fireball") != -1 || ua.indexOf("scooter") != -1 || ua.indexOf("altavista") != -1 || ua.indexOf("netcraft") != -1 || ua.indexOf("gulliver") != -1 || ua.indexOf("ferret") != -1 || ua.indexOf("informant") != -1) { this.bot = true; return; } this.aol = this.userAgent.indexOf("AOL") != -1; /////////////////////////////////////////////////// // Browser und Version feststellen /////////////////////////////////////////////////// if (userAgent.indexOf(OPERA) != -1) { // this.browser = OPERA; this.browserId = OPERAID; this.version = parseVersion(OPERA); } else if (userAgent.indexOf(MSIE) != -1) { // this.browser = MSIE; this.browserId = MSIEID; this.version = parseVersion(MSIE); if (userAgent.indexOf("MathPlayer") != -1) { this.browserId = MATHPLAYERID; } } else if (userAgent.indexOf(SAFARI) != -1) { // this.browser = SAFARI; this.browserId = SAFARIID; this.version = parseVersion(SAFARI); } else if (userAgent.indexOf(MSPIE) != -1) { // this.browser = MSPIE; this.browserId = MSPIEID; this.version = parseVersion(MSPIE); } else if (userAgent.indexOf(KONQUEROR) != -1) { // this.browser = KONQUEROR; this.browserId = KONQUERORID; this.version = parseVersion(KONQUEROR); } else if (userAgent.indexOf(MOZILLA) != -1) { // "Revision builds"/Netscape ab 6.0(???) // this.browser = MOZILLA; this.browserId = MOZILLAID; this.version = parseVersion("rv:"); // "Milestone Builds"/Netscape 6.0, z.B. "m18" if (this.version == 5) this.version = (float) 0.5; } else if (userAgent.indexOf(NETSCAPE) != -1) { // this.browser = NETSCAPE; this.browserId = NETSCAPEID; this.version = parseVersion(NETSCAPE); } else if (userAgent.indexOf(LYNX) != -1) { // this.browser = LYNX; this.browserId = LYNXID; this.version = parseVersion(LYNX); } else { System.out.println("###\n### No Browsername found for:\n### " + this.userAgent + "\n###"); } /////////////////////////////////////////////////// // Platform feststellen /////////////////////////////////////////////////// if (userAgent.indexOf(WIN_CE) != -1) { this.platform = WIN_CE; } else if (userAgent.indexOf(WIN) != -1) { this.platform = WIN; } else if (userAgent.indexOf(MAC) != -1 || userAgent.indexOf("PPC") != -1) { this.platform = MAC; } else if ( userAgent.indexOf(UNIX) != -1 || userAgent.indexOf("Linux") != -1 || userAgent.indexOf("X11") != -1 || userAgent.indexOf("libwww") != -1 || userAgent.indexOf("SunOS") != -1) { this.platform = UNIX; } else { System.out.println("###\n### No Browser-Platform found for:\n### " + this.userAgent + "\n###"); } } private float parseVersion(String searchPattern) { try { String str = this.userAgent.substring(this.userAgent.indexOf(searchPattern) + searchPattern.length()); Pattern pattern = Pattern.compile("[0-9\\.]{2,}"); Matcher matcher = pattern.matcher(str); if (matcher.find()) { String versionString = matcher.group().trim(); if (versionString.indexOf(".") != -1) { String major = versionString.substring(0, versionString.indexOf(".")); Pattern dot = Pattern.compile("\\."); Matcher m = dot.matcher(versionString.substring(versionString.indexOf("."))); StringBuffer sb = new StringBuffer(); boolean result = m.find(); while (result) { m.appendReplacement(sb, ""); result = m.find(); } m.appendTail(sb); return Float.parseFloat(major + "." + sb.toString()); } else { return Float.parseFloat(versionString); } } } catch (Exception e) { e.printStackTrace(); } if (!this.bot) System.out.println("###\n### No Browser-Version found for:\n### " + this.userAgent + "\n###"); return 0; } /** * Tests if a browser explicitely accepts a given mime type. "*.*" is ignored. * * @param mimeType * a RFC mimetype such as "text/html", "application/xhtml+xml" or "image/gif" * @return true if the browser explicitely accepts a given mime type. * @since 1.1 */ public boolean acceptsMimeType(String mimeType) { if (mimeType == null) return false; mimeType = mimeType.toLowerCase(); return this.accept != null && this.accept.indexOf(mimeType) > -1; } /** * Tests if a browser explicitely accepts a given mime type and preferes to receive it over the second one. "*.*" is ignored. <b> * Note</b> that I assume that we do not pay attention to quantity statements such as "application/xhtml+xml;q=0.99" yet but * only the given order. Safari e.g. does not give a special order to its mimetypes, only quantity statement, so it does not work * with Safari! * * @param mimeType1 * a RFC mimetype such as "text/html", "application/xhtml+xml" or "image/gif" * @param mimeType2 * a RFC mimetype such as "text/html", "application/xhtml+xml" or "image/gif" * @return true if the browser explicitely accepts a given mime type. * @since 1.1 */ public int prefersMimeType(String mimeType1, String mimeType2) { if (this.accept == null || (!this.acceptsMimeType(mimeType1) && !this.acceptsMimeType(mimeType2))) return 0; else if ( this.acceptsMimeType(mimeType1) && !this.acceptsMimeType(mimeType2) || this.accept.indexOf(mimeType1) < this.accept.indexOf(mimeType2)) return 1; else return 2; } /** * Tests if a browser explicitely accepts a given language. * * @param language * a ISO language such as "en", "en-us" or "de" * @return true if the browser explicitely accepts a given language. * @since 1.1 */ public boolean acceptsLanguage(String language) { if (language == null) return false; language = language.toLowerCase(); return this.acceptLanguage != null && this.acceptLanguage.indexOf(language) > -1; } /** * Tests if a browser explicitely accepts a given character set. * * @param charset * a ISO language such as "utf-8", "ISO-8859-1" or "windows-1252" * @return true if the browser explicitely accepts a given language. * @since 1.1 */ public boolean acceptsCharset(String charset) { if (charset == null) return false; charset = charset.toLowerCase(); return this.acceptCharset != null && this.acceptCharset.indexOf(charset) > -1; } /** * @return String */ // public String getBrowser() // { // return (browser != null) ? browser : UNKNOWN; // } /** * @return String */ public String getPlatform() { return (platform != null) ? platform : UNKNOWN; } /** * @return String */ public String getUserAgent() { return (userAgent != null) ? userAgent : UNKNOWN; } /** * @return float the version number, e.g. 5.01 or 6.23 */ public float getVersion() { return version; } /** * Tests if the user agent is likely to be a bot. Note that some bots identify themselves as an old Netscape version. Therefore * we also return true for Netscape < 4. * * @return true if the user agent identifies itself as search engine or bot * @since 1.1 */ public boolean isBot() { return bot || (this.isAncientNetscape() && this.getVersion() < 4); } /** * @return boolean isKonqueror */ public boolean isKonqueror() { return (browserId == KONQUERORID); } /** * @return boolean isLynx */ public boolean isLynx() { return (browserId == LYNXID); } /** * true for Nescape >= 6 and all Mozilla versions * * @return boolean isMozilla * @since 1.1 */ public boolean isModernMozilla() { return (browserId == MOZILLAID); } /** * true for Nescape >= 6 and all Mozilla versions * * @return boolean isMozilla * @deprecated use isModernMozilla() instead. */ public boolean isMozilla() { return (browserId == MOZILLAID); } /** * @return boolean isMsie */ public boolean isMsie() { return (browserId == MSIEID); } /** * true for the MSIE mobile ("Pocket") version. * * @return boolean isMspie */ public boolean isMspie() { return (browserId == MSPIEID); } /** * true for Netscape browsers prior Netscape 6 * * @return boolean isNetscape4 * @deprecated use isAncientNetscape() instead */ public boolean isNetscape4() { return isAncientNetscape(); } /** * true for Netscape browsers prior Netscape 6 * * @return boolean isNetscape4 * @since 1.1 */ public boolean isAncientNetscape() { return (browserId == NETSCAPEID); } /** * true for Opera browsers. Note that Opera browsers like to camouflage as MSIE. * * @return boolean isOpera */ public boolean isOpera() { return (browserId == OPERAID); } /** * @return boolean isSafari */ public boolean isSafari() { return (browserId == SAFARIID); } /** * @return boolean isMac */ public boolean isMac() { return (platform != null && platform.equals(MAC)); } /** * @return boolean isUnix */ public boolean isUnix() { return (platform != null && platform.equals(UNIX)); } /** * @return boolean isWin */ public boolean isWin() { return (platform != null && platform.equals(WIN)); } /** * @return boolean isWindowsCE */ public boolean isWindowsCE() { return (platform != null && platform.equals(WIN_CE)); } /** * @return isAol. * @since 1.1 */ public boolean isAol() { return aol; } /** * @return Returns the browserId. */ public int getBrowserId() { return browserId; } } --- NEW FILE: HeaderTag.java --- package org.hartmath.server.taglib; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.BodyContent; import javax.servlet.jsp.tagext.BodyTagSupport; import org.snipsnap.app.Application; /** * Java JSP taglib interface to send browser specific header * */ public class HeaderTag extends BodyTagSupport { public int doStartTag() throws JspException { // log("doPost"); BodyContent body = getBodyContent(); // JspWriter out = body.getEnclosingWriter(); // String bodyData = body.getString(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); BrowserSniffer bd = BrowserSniffer.getBrowserDetection(request); try { switch (bd.getBrowserId()) { case BrowserSniffer.MOZILLAID : case BrowserSniffer.NETSCAPEID : pageContext.getResponse().setContentType( "application/xhtml+xml" + "; charset=" + Application.get().getConfiguration().getEncoding()); request.getRequestDispatcher("gecko_header.jsp").include(request, pageContext.getResponse()); break; case BrowserSniffer.OPERAID : pageContext.getResponse().setContentType( "application/xhtml+xml" + "; charset=" + Application.get().getConfiguration().getEncoding()); request.getRequestDispatcher("opera_header.jsp").include(request, pageContext.getResponse()); break; case BrowserSniffer.MATHPLAYERID : pageContext.getResponse().setContentType("text/html" + "; charset=" + Application.get().getConfiguration().getEncoding()); request.getRequestDispatcher("msie_header.jsp").include(request, pageContext.getResponse()); break; default : pageContext.getResponse().setContentType("text/html" + "; charset=" + Application.get().getConfiguration().getEncoding()); request.getRequestDispatcher("gecko_header.jsp").include(request, pageContext.getResponse()); break; } } catch (ServletException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return SKIP_BODY; } } Index: BrowserTag.java =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/taglib/BrowserTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BrowserTag.java 9 Mar 2004 20:13:09 -0000 1.1 --- BrowserTag.java 12 Mar 2004 20:50:50 -0000 1.2 *************** *** 54,58 **** } } - return version; } --- 54,57 ---- |
|
From: <js...@us...> - 2004-03-12 21:14:53
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15534/src/org/hartmath/tex2mml/reflection/convert Modified Files: Dot.java Sub.java Ul.java Mbox.java Mathtt.java Mathbf.java Hat.java Bar.java Sup.java Mathsf.java Vec.java Ddot.java Log Message: initial version Index: Dot.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Dot.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Dot.java 15 Feb 2004 14:31:00 -0000 1.1 --- Dot.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert(f, buf); f.tagStart(buf, "mo"); buf.append("."); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append("."); // '^' Index: Sub.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Sub.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sub.java 15 Feb 2004 12:58:34 -0000 1.1 --- Sub.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 23,29 **** if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munderover"); ! nSup0.convert(f, buf); ! row.get(1).convert(f, buf); ! rowSup0.get(1).convert(f, buf); f.tagEnd(buf, "munderover"); return true; --- 23,29 ---- if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munderover"); ! nSup0.convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); ! rowSup0.get(1).convert2MML(f, buf); f.tagEnd(buf, "munderover"); return true; *************** *** 33,38 **** if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munder"); ! nSub0.convert(f, buf); ! row.get(1).convert(f, buf); f.tagEnd(buf, "munder"); return true; --- 33,38 ---- if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munder"); ! nSub0.convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); f.tagEnd(buf, "munder"); return true; Index: Ul.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Ul.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Ul.java 15 Feb 2004 14:31:00 -0000 1.1 --- Ul.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "munder"); ! row.get(0).convert(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u0332')); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "munder"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u0332')); // '^' Index: Mbox.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mbox.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mbox.java 15 Feb 2004 14:31:00 -0000 1.1 --- Mbox.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mbox"); ! row.get(0).convert(f, buf); f.tagEnd(buf, "mbox"); return true; --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mbox"); ! row.get(0).convert2MML(f, buf); f.tagEnd(buf, "mbox"); return true; Index: Mathtt.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathtt.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathtt.java 15 Feb 2004 14:31:00 -0000 1.1 --- Mathtt.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontfamily=\"monospace\""); ! row.get(0).convert(f, buf); f.tagEnd(buf, "mstyle"); return true; --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontfamily=\"monospace\""); ! row.get(0).convert2MML(f, buf); f.tagEnd(buf, "mstyle"); return true; Index: Mathbf.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathbf.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathbf.java 15 Feb 2004 14:31:00 -0000 1.1 --- Mathbf.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontweight=\"bold\""); ! row.get(0).convert(f, buf); f.tagEnd(buf, "mstyle"); return true; --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontweight=\"bold\""); ! row.get(0).convert2MML(f, buf); f.tagEnd(buf, "mstyle"); return true; Index: Hat.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Hat.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Hat.java 15 Feb 2004 14:31:00 -0000 1.1 --- Hat.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u005E')); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u005E')); // '^' Index: Bar.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Bar.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Bar.java 15 Feb 2004 14:31:00 -0000 1.1 --- Bar.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u00AF')); // --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u00AF')); // Index: Sup.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Sup.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Sup.java 15 Feb 2004 12:58:34 -0000 1.1 --- Sup.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 24,30 **** if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munderover"); ! nSub0.convert(f, buf); ! rowSub0.get(1).convert(f, buf); ! row.get(1).convert(f, buf); f.tagEnd(buf, "munderover"); return true; --- 24,30 ---- if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munderover"); ! nSub0.convert2MML(f, buf); ! rowSub0.get(1).convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); f.tagEnd(buf, "munderover"); return true; *************** *** 34,39 **** if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "mover"); ! nSup0.convert(f, buf); ! row.get(1).convert(f, buf); f.tagEnd(buf, "mover"); return true; --- 34,39 ---- if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "mover"); ! nSup0.convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); f.tagEnd(buf, "mover"); return true; Index: Mathsf.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathsf.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mathsf.java 15 Feb 2004 14:31:00 -0000 1.1 --- Mathsf.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 2,7 **** import org.hartmath.tex2mml.IRowConverter; - import org.hartmath.tex2mml.Identifier; - import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; --- 2,5 ---- *************** *** 18,22 **** if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontfamily=\"sans-serif\""); ! row.get(0).convert(f, buf); f.tagEnd(buf, "mstyle"); return true; --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontfamily=\"sans-serif\""); ! row.get(0).convert2MML(f, buf); f.tagEnd(buf, "mstyle"); return true; Index: Vec.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Vec.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Vec.java 15 Feb 2004 14:31:00 -0000 1.1 --- Vec.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u2192')); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u2192')); // '^' Index: Ddot.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Ddot.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Ddot.java 15 Feb 2004 14:31:00 -0000 1.1 --- Ddot.java 12 Mar 2004 20:47:11 -0000 1.2 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert(f, buf); f.tagStart(buf, "mo"); buf.append(".."); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(".."); // '^' |
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15534/src/org/hartmath/tex2mml Modified Files: Scanner.java TeXParser.java Row.java TeX2MathMLFactory.java Text.java Identifier.java Operator.java Node.java Number.java Log Message: initial version Index: Scanner.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Scanner.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Scanner.java 15 Feb 2004 12:58:33 -0000 1.1 --- Scanner.java 12 Mar 2004 20:47:10 -0000 1.2 *************** *** 12,16 **** // current token protected int token; ! protected String fOperatorString; --- 12,16 ---- // current token protected int token; ! protected String fOperatorString; *************** *** 28,42 **** final static public int T_NOT = 31; final static public int TT_DOT = 32; ! // final static public int TT_POW = 33; final static public int TT_DIVIDE = 34; ! // final static public int TT_MULTIPLY = 35; ! // final static public int TT_SUBTRACT = 36; ! // final static public int TT_ADD = 37; final static public int TT_EQUAL = 38; final static public int TT_UNEQUAL = 39; ! // final static public int TT_GREATER = 40; ! // final static public int TT_GREATEREQUAL = 41; ! // final static public int TT_LESS = 42; ! // final static public int TT_LESSEQUAL = 43; final static public int TT_AND = 44; final static public int TT_OR = 45; --- 28,42 ---- final static public int T_NOT = 31; final static public int TT_DOT = 32; ! // final static public int TT_POW = 33; final static public int TT_DIVIDE = 34; ! // final static public int TT_MULTIPLY = 35; ! // final static public int TT_SUBTRACT = 36; ! // final static public int TT_ADD = 37; final static public int TT_EQUAL = 38; final static public int TT_UNEQUAL = 39; ! // final static public int TT_GREATER = 40; ! // final static public int TT_GREATEREQUAL = 41; ! // final static public int TT_LESS = 42; ! // final static public int TT_LESSEQUAL = 43; final static public int TT_AND = 44; final static public int TT_OR = 45; *************** *** 44,54 **** final static public int TT_RULEDELAYED = 47; final static public int TT_REPLACEALL = 48; ! // final static public int TT_SET = 49; final static public int TT_SETDELAYED = 50; final static public int TT_UPSET = 51; final static public int TT_UPSETDELAYED = 52; final static public int TT_BACKSLASH_SYMBOL = 53; ! final static public int TT_CHARACTER=54; ! final static public int TT_OPERATOR = 55; --- 44,54 ---- final static public int TT_RULEDELAYED = 47; final static public int TT_REPLACEALL = 48; ! // final static public int TT_SET = 49; final static public int TT_SETDELAYED = 50; final static public int TT_UPSET = 51; final static public int TT_UPSETDELAYED = 52; final static public int TT_BACKSLASH_SYMBOL = 53; ! final static public int TT_CHARACTER = 54; ! final static public int TT_OPERATOR = 55; *************** *** 228,232 **** token = TT_OPERATOR; fOperatorString = "_"; ! // token = TT_BLANK; break; --- 228,232 ---- token = TT_OPERATOR; fOperatorString = "_"; ! // token = TT_BLANK; break; *************** *** 268,296 **** token = TT_OPERATOR; fOperatorString = "^"; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // fChar = fSourceString.charAt(fCurrentPosition); ! // ! // if (fChar == '=') { ! // fCurrentPosition++; ! // token = TT_UPSET; ! // ! // break; ! // } ! // if (fChar == ':') { ! // fCurrentPosition++; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // fChar = fSourceString.charAt(fCurrentPosition); ! // ! // if (fChar == '=') { ! // fCurrentPosition++; ! // token = TT_UPSETDELAYED; ! // ! // break; ! // } ! // } ! // } ! // } break; --- 268,296 ---- token = TT_OPERATOR; fOperatorString = "^"; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // fChar = fSourceString.charAt(fCurrentPosition); ! // ! // if (fChar == '=') { ! // fCurrentPosition++; ! // token = TT_UPSET; ! // ! // break; ! // } ! // if (fChar == ':') { ! // fCurrentPosition++; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // fChar = fSourceString.charAt(fCurrentPosition); ! // ! // if (fChar == '=') { ! // fCurrentPosition++; ! // token = TT_UPSETDELAYED; ! // ! // break; ! // } ! // } ! // } ! // } break; *************** *** 298,315 **** token = TT_OPERATOR; fOperatorString = "/"; ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '.') { ! // fCurrentPosition++; ! // token = TT_REPLACEALL; ! // ! // break; ! // } ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_DIVIDEBY; ! // ! // break; ! // } ! // } break; --- 298,315 ---- token = TT_OPERATOR; fOperatorString = "/"; ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '.') { ! // fCurrentPosition++; ! // token = TT_REPLACEALL; ! // ! // break; ! // } ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_DIVIDEBY; ! // ! // break; ! // } ! // } break; *************** *** 323,332 **** break; } ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_TIMESBY; ! // ! // break; ! // } } --- 323,332 ---- break; } ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_TIMESBY; ! // ! // break; ! // } } *************** *** 335,376 **** token = TT_OPERATOR; fOperatorString = "+"; ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '+') { ! // fCurrentPosition++; ! // token = TT_INCREMENT; ! // ! // break; ! // } ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_ADDTO; ! // ! // break; ! // } ! // } break; case '-' : token = TT_OPERATOR; fOperatorString = "-"; ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '>') { ! // fCurrentPosition++; ! // token = TT_RULE; ! // ! // break; ! // } ! // if (fSourceString.charAt(fCurrentPosition) == '-') { ! // fCurrentPosition++; ! // token = TT_DECREMENT; ! // ! // break; ! // } ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_SUBTRACTFROM; ! // ! // break; ! // } ! // } break; --- 335,376 ---- token = TT_OPERATOR; fOperatorString = "+"; ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '+') { ! // fCurrentPosition++; ! // token = TT_INCREMENT; ! // ! // break; ! // } ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_ADDTO; ! // ! // break; ! // } ! // } break; case '-' : token = TT_OPERATOR; fOperatorString = "-"; ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '>') { ! // fCurrentPosition++; ! // token = TT_RULE; ! // ! // break; ! // } ! // if (fSourceString.charAt(fCurrentPosition) == '-') { ! // fCurrentPosition++; ! // token = TT_DECREMENT; ! // ! // break; ! // } ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_SUBTRACTFROM; ! // ! // break; ! // } ! // } break; *************** *** 378,407 **** token = TT_OPERATOR; fOperatorString = "="; ! // if (fSourceString.length() > fCurrentPosition) { ! // fChar = fSourceString.charAt(fCurrentPosition); ! // ! // if (fChar == '=') { ! // fCurrentPosition++; ! // token = TT_EQUAL; ! // ! // break; ! // } ! // } break; ! case '>' : token = TT_OPERATOR; fOperatorString = ">"; ! // token = TT_GREATER; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_GREATEREQUAL; ! // ! // break; ! // } ! // } break; --- 378,407 ---- token = TT_OPERATOR; fOperatorString = "="; ! // if (fSourceString.length() > fCurrentPosition) { ! // fChar = fSourceString.charAt(fCurrentPosition); ! // ! // if (fChar == '=') { ! // fCurrentPosition++; ! // token = TT_EQUAL; ! // ! // break; ! // } ! // } break; ! case '>' : token = TT_OPERATOR; fOperatorString = ">"; ! // token = TT_GREATER; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_GREATEREQUAL; ! // ! // break; ! // } ! // } break; *************** *** 409,422 **** token = TT_OPERATOR; fOperatorString = "<"; ! // token = TT_LESS; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_LESSEQUAL; ! // ! // break; ! // } ! // } break; --- 409,422 ---- token = TT_OPERATOR; fOperatorString = "<"; ! // token = TT_LESS; ! // ! // if (fSourceString.length() > fCurrentPosition) { ! // if (fSourceString.charAt(fCurrentPosition) == '=') { ! // fCurrentPosition++; ! // token = TT_LESSEQUAL; ! // ! // break; ! // } ! // } break; *************** *** 434,446 **** break; case '|' : ! if (fSourceString.length() > fCurrentPosition) { ! if (fSourceString.charAt(fCurrentPosition++) == '|') { ! token = TT_OR; ! ! break; ! } ! } ! break; case ':' : if (fSourceString.length() > fCurrentPosition) { --- 434,441 ---- break; case '|' : ! token = TT_OPERATOR; ! fOperatorString = "|"; break; + case ':' : if (fSourceString.length() > fCurrentPosition) { *************** *** 476,482 **** } ! // if (token == TT_EOF) { ! // throwSyntaxError("token not found"); ! // } return; --- 471,477 ---- } ! // if (token == TT_EOF) { ! // throwSyntaxError("token not found"); ! // } return; *************** *** 489,508 **** } ! // protected void throwSyntaxError(String error) { ! // ! // if (fSourceString.length() < fCurrentPosition) { ! // fCurrentPosition--; ! // } ! // // read until end-of-line ! // int eol = fCurrentPosition; ! // while (fSourceString.length() > eol) { ! // fChar = fSourceString.charAt(eol++); ! // if (fChar == '\n') { ! // eol--; ! // break; ! // } ! // } ! // throw new SyntaxError(rowCount, fCurrentPosition - columnCount, fSourceString.substring(columnCount, eol), error); ! // } public String getIdentifier() { --- 484,503 ---- } ! // protected void throwSyntaxError(String error) { ! // ! // if (fSourceString.length() < fCurrentPosition) { ! // fCurrentPosition--; ! // } ! // // read until end-of-line ! // int eol = fCurrentPosition; ! // while (fSourceString.length() > eol) { ! // fChar = fSourceString.charAt(eol++); ! // if (fChar == '\n') { ! // eol--; ! // break; ! // } ! // } ! // throw new SyntaxError(rowCount, fCurrentPosition - columnCount, fSourceString.substring(columnCount, eol), error); ! // } public String getIdentifier() { *************** *** 548,553 **** return fSourceString.substring(startPosition, endPosition); ! } ! final String optimizedCurrentTokenSource1(int startPosition, int endPosition) { //return always the same char[] build only once --- 543,548 ---- return fSourceString.substring(startPosition, endPosition); ! } ! final String optimizedCurrentTokenSource1(int startPosition, int endPosition) { //return always the same char[] build only once *************** *** 696,742 **** * */ ! // public StringBuffer getStringBuffer() { ! // StringBuffer ident = new StringBuffer(); ! // ! // getChar(); ! // ! // if ((fChar == '\n') || (token == TT_EOF)) { ! // throwSyntaxError("string -" + ident.toString() + "- contains no character."); ! // } ! // ! // while (fChar != '"') { ! // if ((fChar == '\\')) { ! // getChar(); ! // ! // switch (fChar) { ! // ! // case '\\' : ! // ident.append(fChar); ! // ! // break; ! // case 'n' : ! // ident.append("\n"); ! // ! // break; ! // case 't' : ! // ident.append("\t"); ! // ! // break; ! // default : ! // throwSyntaxError("string - unknown character after back-slash."); ! // } ! // ! // getChar(); ! // } else { ! // if ((fChar != '"') && ((fChar == '\n') || (token == TT_EOF))) { ! // throwSyntaxError("string -" + ident.toString() + "- not closed."); ! // } ! // ! // ident.append(fChar); ! // getChar(); ! // } ! // } ! // ! // return ident; ! // } } --- 691,737 ---- * */ ! // public StringBuffer getStringBuffer() { ! // StringBuffer ident = new StringBuffer(); ! // ! // getChar(); ! // ! // if ((fChar == '\n') || (token == TT_EOF)) { ! // throwSyntaxError("string -" + ident.toString() + "- contains no character."); ! // } ! // ! // while (fChar != '"') { ! // if ((fChar == '\\')) { ! // getChar(); ! // ! // switch (fChar) { ! // ! // case '\\' : ! // ident.append(fChar); ! // ! // break; ! // case 'n' : ! // ident.append("\n"); ! // ! // break; ! // case 't' : ! // ident.append("\t"); ! // ! // break; ! // default : ! // throwSyntaxError("string - unknown character after back-slash."); ! // } ! // ! // getChar(); ! // } else { ! // if ((fChar != '"') && ((fChar == '\n') || (token == TT_EOF))) { ! // throwSyntaxError("string -" + ident.toString() + "- not closed."); ! // } ! // ! // ident.append(fChar); ! // getChar(); ! // } ! // } ! // ! // return ident; ! // } } Index: TeXParser.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/TeXParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TeXParser.java 25 Feb 2004 21:29:59 -0000 1.2 --- TeXParser.java 12 Mar 2004 20:47:10 -0000 1.3 *************** *** 218,226 **** } ! public void start(StringBuffer buffer) { Node node = createNode(); if (node != null) { ! MML_FACTORY.convert(node, buffer); } } } \ No newline at end of file --- 218,234 ---- } ! public void parse2MML(StringBuffer buffer) { Node node = createNode(); if (node != null) { ! MML_FACTORY.convert2MML(node, buffer); ! } ! } ! ! public void parse2CSS(StringBuffer buffer) { ! Node node = createNode(); ! if (node != null) { ! MML_FACTORY.convert2CSS(node, buffer); } } + } \ No newline at end of file Index: Row.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Row.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Row.java 15 Feb 2004 12:58:33 -0000 1.1 --- Row.java 12 Mar 2004 20:47:10 -0000 1.2 *************** *** 9,15 **** public class Row extends Node implements Cloneable { ! final public static String CONVERTER_PACKAGE_NAME = "org.hartmath.tex2mml.reflection.convert."; ! final public static HashMap CONVERTER = new HashMap(199); ! ArrayList fList; int fType; --- 9,17 ---- public class Row extends Node implements Cloneable { ! final public static String MML_CONVERTER_PACKAGE_NAME = "org.hartmath.tex2mml.reflection.convert."; ! final public static HashMap MML_CONVERTER = new HashMap(199); ! final public static String CSS_CONVERTER_PACKAGE_NAME = "org.hartmath.tex2css.reflection.convert."; ! final public static HashMap CSS_CONVERTER = new HashMap(199); ! ArrayList fList; int fType; *************** *** 34,43 **** } ! public static IRowConverter getConverter(String symbol) { Object temp; ! if ((temp = CONVERTER.get(symbol)) != null) { return (IRowConverter) temp; } ! if (symbol.length() == 0 || CONVERTER.containsKey(symbol)) { return null; } --- 36,45 ---- } ! public static IRowConverter getMMLConverter(String symbol) { Object temp; ! if ((temp = MML_CONVERTER.get(symbol)) != null) { return (IRowConverter) temp; } ! if (symbol.length() == 0 || MML_CONVERTER.containsKey(symbol)) { return null; } *************** *** 50,54 **** } ! String longClassName = CONVERTER_PACKAGE_NAME + shortClassName; Class clazz; try { --- 52,56 ---- } ! String longClassName = MML_CONVERTER_PACKAGE_NAME + shortClassName; Class clazz; try { *************** *** 56,60 **** } catch (ClassNotFoundException e) { // not a predefined converter ! CONVERTER.put(symbol, null); return null; } --- 58,62 ---- } catch (ClassNotFoundException e) { // not a predefined converter ! MML_CONVERTER.put(symbol, null); return null; } *************** *** 63,67 **** try { module = (IRowConverter) clazz.newInstance(); ! CONVERTER.put(symbol, module); return module; } catch (Throwable se) { --- 65,69 ---- try { module = (IRowConverter) clazz.newInstance(); ! MML_CONVERTER.put(symbol, module); return module; } catch (Throwable se) { *************** *** 72,77 **** } ! public void convert(TeX2MathMLFactory f, StringBuffer buf) { ! IRowConverter converter = getConverter(fTeXSymbol); if (converter != null && converter.convert(buf, this, f)) { --- 74,79 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { ! IRowConverter converter = getMMLConverter(fTeXSymbol); if (converter != null && converter.convert(buf, this, f)) { *************** *** 81,89 **** f.tagStart(buf, fTag); for (int i = 0; i < fList.size(); i++) { ! ((Node) fList.get(i)).convert(f, buf); } f.tagEnd(buf, fTag); } /** * @param index --- 83,142 ---- f.tagStart(buf, fTag); for (int i = 0; i < fList.size(); i++) { ! ((Node) fList.get(i)).convert2MML(f, buf); } f.tagEnd(buf, fTag); } + public static IRowConverter getCSSConverter(String symbol) { + Object temp; + if ((temp = CSS_CONVERTER.get(symbol)) != null) { + return (IRowConverter) temp; + } + if (symbol.length() == 0 || CSS_CONVERTER.containsKey(symbol)) { + return null; + } + + String shortClassName; + if (symbol.length() == 1) { + shortClassName = "" + Character.toUpperCase(symbol.charAt(0)); + } else { + shortClassName = Character.toUpperCase(symbol.charAt(0)) + symbol.substring(1); + } + + String longClassName = CSS_CONVERTER_PACKAGE_NAME + shortClassName; + Class clazz; + try { + clazz = Class.forName(longClassName); + } catch (ClassNotFoundException e) { + // not a predefined converter + CSS_CONVERTER.put(symbol, null); + return null; + } + + IRowConverter module; + try { + module = (IRowConverter) clazz.newInstance(); + CSS_CONVERTER.put(symbol, module); + return module; + } catch (Throwable se) { + + } + return null; + + } + public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) + { + IRowConverter converter = getCSSConverter(fTeXSymbol); + + if (converter != null && converter.convert(buf, this, f)) { + return; + } + + buf.append("<m>"); + for (int i = 0; i < fList.size(); i++) { + ((Node) fList.get(i)).convert2CSS(f, buf); + } + buf.append("</m>"); + } /** * @param index Index: TeX2MathMLFactory.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/TeX2MathMLFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TeX2MathMLFactory.java 15 Feb 2004 14:31:01 -0000 1.3 --- TeX2MathMLFactory.java 12 Mar 2004 20:47:10 -0000 1.4 *************** *** 66,73 **** } ! public void convert(Node node, StringBuffer buf) { ! node.convert(this, buf); } /** * Constructor for the EMML object --- 66,77 ---- } ! public void convert2MML(Node node, StringBuffer buf) { ! node.convert2MML(this, buf); } + public void convert2CSS(Node node, StringBuffer buf) { + node.convert2CSS(this, buf); + } + /** * Constructor for the EMML object *************** *** 211,215 **** CONSTANT_SYMBOLS.put("lceiling", new Operator(toEntity('\u2308'), CONSTANT)); CONSTANT_SYMBOLS.put("rceiling", new Operator(toEntity('\u2309'), CONSTANT)); ! CONSTANT_SYMBOLS.put("int", new Operator(toEntity('\u222B'), CONSTANT)); CONSTANT_SYMBOLS.put("circ", new Operator("∘", CONSTANT)); --- 215,219 ---- CONSTANT_SYMBOLS.put("lceiling", new Operator(toEntity('\u2308'), CONSTANT)); CONSTANT_SYMBOLS.put("rceiling", new Operator(toEntity('\u2309'), CONSTANT)); ! CONSTANT_SYMBOLS.put("mid", new Operator(toEntity('\u2223'), CONSTANT)); CONSTANT_SYMBOLS.put("circ", new Operator("∘", CONSTANT)); *************** *** 290,296 **** underover.put(UNDEROVER, "true"); ! CONSTANT_SYMBOLS.put("sum", new Operator(toEntity('\u2211'), CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("prod", new Operator(toEntity('\u220F'), CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("lim", new Operator("lim", CONSTANT, underover)); CONSTANT_SYMBOLS.put("bigwedge", new Operator(toEntity('\u22C0'), CONSTANT, underover)); CONSTANT_SYMBOLS.put("bigvee", new Operator(toEntity('\u22C1'), CONSTANT, underover)); --- 294,300 ---- underover.put(UNDEROVER, "true"); ! CONSTANT_SYMBOLS.put("sum", new Operator(toEntity('\u2211'), "sum", CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("prod", new Operator(toEntity('\u220F'), "ProD", CONSTANT, underover)); ! CONSTANT_SYMBOLS.put("lim", new Operator("lim", "LiM",CONSTANT, underover)); CONSTANT_SYMBOLS.put("bigwedge", new Operator(toEntity('\u22C0'), CONSTANT, underover)); CONSTANT_SYMBOLS.put("bigvee", new Operator(toEntity('\u22C1'), CONSTANT, underover)); *************** *** 304,307 **** --- 308,312 ---- CONSTANT_SYMBOLS.put("=", new Operator("=", CONSTANT)); CONSTANT_SYMBOLS.put("!", new Operator("!", CONSTANT)); + CONSTANT_SYMBOLS.put("|", new Operator(toEntity('\u2223'), CONSTANT)); CONSTANT_SYMBOLS.put("sqrt", new Row("sqrt", "msqrt", UNARY)); Index: Text.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Text.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Text.java 15 Feb 2004 12:58:33 -0000 1.1 --- Text.java 12 Mar 2004 20:47:10 -0000 1.2 *************** *** 14,22 **** } ! public void convert(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); f.tagEnd(buf, fTag); } ! } \ No newline at end of file --- 14,25 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); f.tagEnd(buf, fTag); } ! ! public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) { ! buf.append(fOutput); ! } } \ No newline at end of file Index: Identifier.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Identifier.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Identifier.java 15 Feb 2004 12:58:33 -0000 1.1 --- Identifier.java 12 Mar 2004 20:47:10 -0000 1.2 *************** *** 14,22 **** } ! public void convert(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); f.tagEnd(buf, fTag); } } \ No newline at end of file --- 14,26 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); f.tagEnd(buf, fTag); } + + public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) { + buf.append(fOutput); + } } \ No newline at end of file Index: Operator.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Operator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Operator.java 15 Feb 2004 12:58:33 -0000 1.1 --- Operator.java 12 Mar 2004 20:47:10 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- String fOperator; int fType; + String fCSSOperator; Map fAttributes; public Operator(String oper) { *************** *** 15,18 **** --- 16,20 ---- fOperator = oper; fType = type; + fCSSOperator = ""; fAttributes = null; } *************** *** 22,33 **** fOperator = oper; fType = type; fAttributes = attributes; } ! public void convert(TeX2MathMLFactory f,StringBuffer buf) { f.tagStart(buf, "mo"); buf.append(fOperator.toString()); f.tagEnd(buf, "mo"); } /* --- 24,56 ---- fOperator = oper; fType = type; + fCSSOperator = ""; + fAttributes = attributes; + } + + public Operator(String oper, String cssOper, int type) { + super("mo", ""); + fOperator = oper; + fType = type; + fCSSOperator = cssOper; + fAttributes = null; + } + + public Operator(String oper, String cssOper, int type, Map attributes) { + super("mo", ""); + fOperator = oper; + fType = type; + fCSSOperator = cssOper; fAttributes = attributes; } ! public void convert2MML(TeX2MathMLFactory f,StringBuffer buf) { f.tagStart(buf, "mo"); buf.append(fOperator.toString()); f.tagEnd(buf, "mo"); } + + public void convert2CSS(TeX2MathMLFactory f,StringBuffer buf) { + buf.append(fOperator.toString()); + } /* *************** *** 64,67 **** --- 87,104 ---- return (String) fAttributes.get(key); } + + /** + * @return Returns the cSSOperator. + */ + public String getCSSOperator() { + return fCSSOperator; + } + + /** + * @param operator The cSSOperator to set. + */ + public void setCSSOperator(String operator) { + fCSSOperator = operator; + } } \ No newline at end of file Index: Node.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Node.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Node.java 15 Feb 2004 12:58:33 -0000 1.1 --- Node.java 12 Mar 2004 20:47:10 -0000 1.2 *************** *** 31,39 **** } ! public void convert(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); f.tagEnd(buf, fTag); } /* --- 31,43 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); f.tagEnd(buf, fTag); } + + public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) { + buf.append(fOutput); + } /* *************** *** 85,88 **** --- 89,99 ---- return ""; } + + /** + * @return "" as default + */ + public String getCSSOperator() { + return ""; + } /** * @return Returns the output. Index: Number.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Number.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Number.java 15 Feb 2004 12:58:33 -0000 1.1 --- Number.java 12 Mar 2004 20:47:10 -0000 1.2 *************** *** 14,22 **** } ! public void convert(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); f.tagEnd(buf, fTag); } } \ No newline at end of file --- 14,27 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); f.tagEnd(buf, fTag); } + + public void convert2CSS(TeX2MathMLFactory f, StringBuffer buf) + { + buf.append(fOutput); + } } \ No newline at end of file |
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15534/src/org/hartmath/tex2css/reflection/convert Added Files: Hat.java Ddot.java Mathbb.java Frac.java Sup.java Mathfrak.java Text.java Mathbf.java Vec.java Mathcal.java Mbox.java Bar.java Ul.java Mathtt.java Dot.java Sub.java Mathsf.java Log Message: initial version --- NEW FILE: Hat.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Hat implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mover"); row.get(0).convert2CSS(f, buf); // f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u005E')); // '^' // f.tagEnd(buf, "mo"); // f.tagEnd(buf, "mover"); return true; } return false; } } --- NEW FILE: Ddot.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Ddot implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mover"); row.get(0).convert2CSS(f, buf); // f.tagStart(buf, "mo"); buf.append(".."); // '^' // f.tagEnd(buf, "mo"); // f.tagEnd(buf, "mover"); return true; } return false; } } --- NEW FILE: Mathbb.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Mathbb implements IRowConverter { public final static int[] bbb = { 0xEF8C, 0xEF8D, 0x2102, 0xEF8E, 0xEF8F, 0xEF90, 0xEF91, 0x210D, 0xEF92, 0xEF93, 0xEF94, 0xEF95, 0xEF96, 0x2115, 0xEF97, 0x2119, 0x211A, 0x211D, 0xEF98, 0xEF99, 0xEF9A, 0xEF9B, 0xEF9C, 0xEF9D, 0xEF9E, 0x2124 }; /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { Node temp = row.get(0); if (temp instanceof Identifier) { String st = temp.getOutput(); StringBuffer newst = new StringBuffer(); for (int j = 0; j < st.length(); j++) if (st.charAt(j) > 64 && st.charAt(j) < 91) { newst.append(TeX2MathMLFactory.toEntity(bbb[st.charAt(j) - 65])); } else { newst.append(st.charAt(j)); } // f.tagStart(buf, temp.getTag()); buf.append(newst.toString()); // f.tagEnd(buf, temp.getTag()); return true; } } return false; } } --- NEW FILE: Frac.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Frac implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 2) { buf.append("<f><r>"); row.get(0).convert2CSS(f, buf); buf.append("</r><r>"); row.get(1).convert2CSS(f, buf); buf.append("</r></f>"); return true; } return false; } } --- NEW FILE: Sup.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Sup implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.getTeXSymbol() == "sup" && row.size() == 2) { Node nSup0 = row.get(0); if (nSup0.getTeXSymbol() == "sub" && nSup0 instanceof Row) { Row rowSub0 = (Row) nSup0; if (rowSub0.size() == 2) { Node nSub0 = rowSub0.get(0); if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { // f.tagStart(buf, "munderover"); nSub0.convert2CSS(f, buf); rowSub0.get(1).convert2CSS(f, buf); row.get(1).convert2CSS(f, buf); // f.tagEnd(buf, "munderover"); return true; } } } else { if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { // f.tagStart(buf, "mover"); nSup0.convert2CSS(f, buf); row.get(1).convert2CSS(f, buf); // f.tagEnd(buf, "mover"); return true; } } } if (row.size() == 2) { row.get(0).convert2CSS(f, buf); buf.append("<t>"); row.get(1).convert2CSS(f, buf); buf.append("</t>"); return true; } return false; } } --- NEW FILE: Mathfrak.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Mathfrak implements IRowConverter { public final static int[] MATHFRAK_CODES = { 0xEF5D, 0xEF5E, 0x212D, 0xEF5F, 0xEF60, 0xEF61, 0xEF62, 0x210C, 0x2111, 0xEF63, 0xEF64, 0xEF65, 0xEF66, 0xEF67, 0xEF68, 0xEF69, 0xEF6A, 0x211C, 0xEF6B, 0xEF6C, 0xEF6D, 0xEF6E, 0xEF6F, 0xEF70, 0xEF71, 0x2128 }; /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { Node temp = row.get(0); if (temp instanceof Identifier) { String st = temp.getOutput(); StringBuffer newst = new StringBuffer(); for (int j = 0; j < st.length(); j++) if (st.charAt(j) > 64 && st.charAt(j) < 91) { newst.append(TeX2MathMLFactory.toEntity(MATHFRAK_CODES[st.charAt(j) - 65])); } else { newst.append(st.charAt(j)); } // f.tagStart(buf, temp.getTag()); buf.append(newst.toString()); // f.tagEnd(buf, temp.getTag()); return true; } } return false; } } --- NEW FILE: Text.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Text implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mtext"); buf.append(row.get(0).getOutput()); // f.tagEnd(buf, "mtext"); return true; } return false; } } --- NEW FILE: Mathbf.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Mathbf implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontweight=\"bold\""); row.get(0).convert2CSS(f, buf); // f.tagEnd(buf, "mstyle"); return true; } return false; } } --- NEW FILE: Vec.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Vec implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mover"); row.get(0).convert2CSS(f, buf); // f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u2192')); // '^' // f.tagEnd(buf, "mo"); // f.tagEnd(buf, "mover"); return true; } return false; } } --- NEW FILE: Mathcal.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Identifier; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Mathcal implements IRowConverter { public final static int[] MATHCAL_CODES = { 0xEF35, 0x212C, 0xEF36, 0xEF37, 0x2130, 0x2131, 0xEF38, 0x210B, 0x2110, 0xEF39, 0xEF3A, 0x2112, 0x2133, 0xEF3B, 0xEF3C, 0xEF3D, 0xEF3E, 0x211B, 0xEF3F, 0xEF40, 0xEF41, 0xEF42, 0xEF43, 0xEF44, 0xEF45, 0xEF46 }; /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { Node temp = row.get(0); if (temp instanceof Identifier) { String st = temp.getOutput(); StringBuffer newst = new StringBuffer(); for (int j = 0; j < st.length(); j++) if (st.charAt(j) > 64 && st.charAt(j) < 91) { newst.append(TeX2MathMLFactory.toEntity(MATHCAL_CODES[st.charAt(j) - 65])); } else { newst.append(st.charAt(j)); } // f.tagStart(buf, temp.getTag()); buf.append(newst.toString()); // f.tagEnd(buf, temp.getTag()); return true; } } return false; } } --- NEW FILE: Mbox.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Mbox implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mbox"); row.get(0).convert2CSS(f, buf); // f.tagEnd(buf, "mbox"); return true; } return false; } } --- NEW FILE: Bar.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Bar implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mover"); row.get(0).convert2CSS(f, buf); // f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u00AF')); // // f.tagEnd(buf, "mo"); // f.tagEnd(buf, "mover"); return true; } return false; } } --- NEW FILE: Ul.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Ul implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "munder"); row.get(0).convert2CSS(f, buf); // f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u0332')); // '^' // f.tagEnd(buf, "mo"); // f.tagEnd(buf, "munder"); return true; } return false; } } --- NEW FILE: Mathtt.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Mathtt implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontfamily=\"monospace\""); row.get(0).convert2CSS(f, buf); // f.tagEnd(buf, "mstyle"); return true; } return false; } } --- NEW FILE: Dot.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Dot implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mover"); row.get(0).convert2CSS(f, buf); // f.tagStart(buf, "mo"); buf.append("."); // f.tagEnd(buf, "mo"); // f.tagEnd(buf, "mover"); return true; } return false; } } --- NEW FILE: Sub.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Node; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Sub implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.getTeXSymbol() == "sub" && row.size() == 2) { Node nSub0 = row.get(0); if (nSub0.getTeXSymbol() == "sup" && nSub0 instanceof Row) { Row rowSup0 = (Row) nSub0; if (rowSup0.size() == 2) { Node nSup0 = rowSup0.get(0); if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { // f.tagStart(buf, "munderover"); nSup0.convert2CSS(f, buf); row.get(1).convert2CSS(f, buf); rowSup0.get(1).convert2CSS(f, buf); // f.tagEnd(buf, "munderover"); return true; } } } else { if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { if (!nSub0.getCSSOperator().equals("")) { buf.append('<'); buf.append(nSub0.getCSSOperator()); buf.append('>'); row.get(1).convert2CSS(f, buf); buf.append("</"); buf.append(nSub0.getCSSOperator()); buf.append('>'); return true; } } } } if (row.size() == 2) { row.get(0).convert2CSS(f, buf); buf.append("<l>"); row.get(1).convert2CSS(f, buf); buf.append("</l>"); return true; } return false; } } --- NEW FILE: Mathsf.java --- package org.hartmath.tex2css.reflection.convert; import org.hartmath.tex2mml.IRowConverter; import org.hartmath.tex2mml.Row; import org.hartmath.tex2mml.TeX2MathMLFactory; public class Mathsf implements IRowConverter { /* * (non-Javadoc) * * @see org.hartmath.tex2mml.IRowConverter#convert(java.lang.StringBuffer, org.hartmath.tex2mml.Row, * org.hartmath.tex2mml.TeX2MathMLFactory) */ public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { // f.tagStart(buf, "mstyle", "fontfamily=\"sans-serif\""); row.get(0).convert2CSS(f, buf); // f.tagEnd(buf, "mstyle"); return true; } return false; } } |
|
From: <js...@us...> - 2004-03-12 21:14:28
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15449/src/org/hartmath/tex2css/reflection/convert Log Message: Directory /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection/convert added to the repository |
|
From: <js...@us...> - 2004-03-12 21:14:28
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15449/src/org/hartmath/tex2css Log Message: Directory /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css added to the repository |
|
From: <js...@us...> - 2004-03-12 21:14:27
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15449/src/org/hartmath/tex2css/reflection Log Message: Directory /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2css/reflection added to the repository |
|
From: <js...@us...> - 2004-03-12 20:40:48
|
Update of /cvsroot/hmath/org.hmath.server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8402 Modified Files: main.jsp Added Files: msie_header.jsp opera_header.jsp gecko_header.jsp Log Message: initial version --- NEW FILE: msie_header.jsp --- <%-- ** Main layout template. ** @author Matthias L. Jugel ** @version $Id: main.jsp,v 1.73 2004/01/09 15:23:20 leo Exp $ --%> <%@ page import="org.snipsnap.snip.SnipSpace, org.snipsnap.app.Application, org.snipsnap.snip.SnipSpaceFactory, org.snipsnap.container.Components, org.snipsnap.snip.Snip"%> <%@ page pageEncoding="iso-8859-1" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns:m="http://www.w3.org/1999/xhtml" lang="<c:out value='${app.configuration.locale}'/>" xml:lang="<c:out value='${app.configuration.locale}'/>"> <head> <!-- base of this document to make all links relative --> <base href="<c:out value='${app.configuration.url}/'/>"/> <!-- content type and generator --> <meta http-equiv="Content-Type" content="text/html; charset=<c:out value='${app.configuration.encoding}'/>"/> <meta http-equiv="Generator" content="SnipSnap/<c:out value="${app.configuration.version}"/>"/> <!-- dublin core classification and geographic location information --> <s:dublinCore snip="${snip}"/> <s:geoUrl/> <!-- aggregrator related info --> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="<c:out value='${app.configuration.url}/exec/rsd'/>"/> <link rel="alternate" type="application/rss+xml" title="RSS" href="<c:out value='${app.configuration.url}/exec/rss'/>"/> <link rel="index" href="<c:out value='${app.configuration.url}/space/snipsnap-index'/>"/> <!-- icons and stylesheet --> <link rel="shortcut icon" href="<c:out value='${app.configuration.url}/favicon.ico'/>"/> <link rel="icon" href="<c:out value='${app.configuration.url}/favicon.ico'/>"/> <link rel="STYLESHEET" type="text/css" href="<c:out value='${app.configuration.url}/theme/default.css'/>" /> <link rel="STYLESHEET" type="text/css" href="<c:out value='${app.configuration.url}/theme/print.css'/>" media="print" /> <!-- title of this document --> <title><c:out value="${app.configuration.name}" default="SnipSnap"/> :: <c:out value="${snip.name}"/></title> <object id="showEqn" classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987"> <!--comment required to prevent this becoming an empty tag--> </object> <?import NAMESPACE="M" IMPLEMENTATION="#showEqn"?> </head> --- NEW FILE: opera_header.jsp --- <?xml version='1.0' encoding='iso-8859-1'?> <%-- ** Main layout template. ** @author Matthias L. Jugel ** @version $Id: main.jsp,v 1.73 2004/01/09 15:23:20 leo Exp $ --%> <%@ page import="org.snipsnap.snip.SnipSpace, org.snipsnap.app.Application, org.snipsnap.snip.SnipSpaceFactory, org.snipsnap.container.Components, org.snipsnap.snip.Snip"%> <%@ page pageEncoding="iso-8859-1" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> ]> <html xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<c:out value='${app.configuration.locale}'/>"> <head> <!-- base of this document to make all links relative --> <base href="<c:out value='${app.configuration.url}/'/>"/> <!-- content type and generator --> <meta http-equiv="Content-Type" content="text/html; charset=<c:out value='${app.configuration.encoding}'/>"/> <meta http-equiv="Generator" content="SnipSnap/<c:out value="${app.configuration.version}"/>"/> <!-- dublin core classification and geographic location information --> <s:dublinCore snip="${snip}"/> <s:geoUrl/> <!-- aggregrator related info --> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="<c:out value='${app.configuration.url}/exec/rsd'/>"/> <link rel="alternate" type="application/rss+xml" title="RSS" href="<c:out value='${app.configuration.url}/exec/rss'/>"/> <link rel="index" href="<c:out value='${app.configuration.url}/space/snipsnap-index'/>"/> <!-- icons and stylesheet --> <link rel="shortcut icon" href="<c:out value='${app.configuration.url}/favicon.ico'/>"/> <link rel="icon" href="<c:out value='${app.configuration.url}/favicon.ico'/>"/> <link rel="STYLESHEET" type="text/css" href="<c:out value='${app.configuration.url}/theme/default.css'/>" /> <link rel="STYLESHEET" type="text/css" href="<c:out value='${app.configuration.url}/theme/print.css'/>" media="print" /> <link rel="STYLESHEET" type="text/css" href="static/math.css" /> <!-- title of this document --> <title><c:out value="${app.configuration.name}" default="SnipSnap"/> :: <c:out value="${snip.name}"/></title> <object id="showEqn" classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987"> <!--comment required to prevent this becoming an empty tag--> </object> <?import NAMESPACE="M" IMPLEMENTATION="#showEqn"?> </head> --- NEW FILE: gecko_header.jsp --- <?xml version='1.0' encoding='iso-8859-1'?> <%-- ** Main layout template. ** @author Matthias L. Jugel ** @version $Id: main.jsp,v 1.73 2004/01/09 15:23:20 leo Exp $ --%> <%@ page import="org.snipsnap.snip.SnipSpace, org.snipsnap.app.Application, org.snipsnap.snip.SnipSpaceFactory, org.snipsnap.container.Components, org.snipsnap.snip.Snip"%> <%@ page pageEncoding="iso-8859-1" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [ <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> ]> <html xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<c:out value='${app.configuration.locale}'/>"> <head> <!-- base of this document to make all links relative --> <base href="<c:out value='${app.configuration.url}/'/>"/> <!-- content type and generator --> <meta http-equiv="Content-Type" content="text/html; charset=<c:out value='${app.configuration.encoding}'/>"/> <meta http-equiv="Generator" content="SnipSnap/<c:out value="${app.configuration.version}"/>"/> <!-- dublin core classification and geographic location information --> <s:dublinCore snip="${snip}"/> <s:geoUrl/> <!-- aggregrator related info --> <link rel="EditURI" type="application/rsd+xml" title="RSD" href="<c:out value='${app.configuration.url}/exec/rsd'/>"/> <link rel="alternate" type="application/rss+xml" title="RSS" href="<c:out value='${app.configuration.url}/exec/rss'/>"/> <link rel="index" href="<c:out value='${app.configuration.url}/space/snipsnap-index'/>"/> <!-- icons and stylesheet --> <link rel="shortcut icon" href="<c:out value='${app.configuration.url}/favicon.ico'/>"/> <link rel="icon" href="<c:out value='${app.configuration.url}/favicon.ico'/>"/> <link rel="STYLESHEET" type="text/css" href="<c:out value='${app.configuration.url}/theme/default.css'/>" /> <link rel="STYLESHEET" type="text/css" href="<c:out value='${app.configuration.url}/theme/print.css'/>" media="print" /> <!-- title of this document --> <title><c:out value="${app.configuration.name}" default="SnipSnap"/> :: <c:out value="${snip.name}"/></title> <?import NAMESPACE="M" IMPLEMENTATION="#showEqn"?> </head> Index: main.jsp =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/main.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** main.jsp 9 Mar 2004 20:16:02 -0000 1.1 --- main.jsp 12 Mar 2004 20:13:05 -0000 1.2 *************** *** 1,4 **** ! <%@ taglib uri="http://hartmath.org/hartmath" prefix="hm" %><hm:browser type="netscape" content="text/xml"><?xml version="1.0"?></hm:browser> ! <hm:browser type="msie" content="text/html"></hm:browser> <%-- ** Main layout template. --- 1,3 ---- ! <%@ taglib uri="http://hartmath.org/hartmath" prefix="hm" %><hm:header /> <%-- ** Main layout template. *************** *** 15,57 **** <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> - - <hm:browser type="netscape" content="text/xml"> - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" - "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd" [ - <!ENTITY mathml "http://www.w3.org/1998/Math/MathML"> - ]> - <html xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<c:out value='${app.configuration.locale}'/>"> - </hm:browser> - <hm:browser type="msie"> - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - <html xmlns:m="http://www.w3.org/1999/xhtml" lang="<c:out value='${app.configuration.locale}'/>" xml:lang="<c:out value='${app.configuration.locale}'/>"> - </hm:browser> - <head> - <!-- base of this document to make all links relative --> - <base href="<c:out value='${app.configuration.url}/'/>"/> - <!-- content type and generator --> - <meta http-equiv="Content-Type" content="text/html; charset=<c:out value='${app.configuration.encoding}'/>"/> - <meta http-equiv="Generator" content="SnipSnap/<c:out value="${app.configuration.version}"/>"/> - <!-- dublin core classification and geographic location information --> - <s:dublinCore snip="${snip}"/> - <s:geoUrl/> - <!-- aggregrator related info --> - <link rel="EditURI" type="application/rsd+xml" title="RSD" href="<c:out value='${app.configuration.url}/exec/rsd'/>"/> - <link rel="alternate" type="application/rss+xml" title="RSS" href="<c:out value='${app.configuration.url}/exec/rss'/>"/> - <link rel="index" href="<c:out value='${app.configuration.url}/space/snipsnap-index'/>"/> - <!-- icons and stylesheet --> - <link rel="shortcut icon" href="<c:out value='${app.configuration.url}/favicon.ico'/>"/> - <link rel="icon" href="<c:out value='${app.configuration.url}/favicon.ico'/>"/> - <link rel="STYLESHEET" type="text/css" href="<c:out value='${app.configuration.url}/theme/default.css'/>" /> - <link rel="STYLESHEET" type="text/css" href="<c:out value='${app.configuration.url}/theme/print.css'/>" media="print" /> - <!-- title of this document --> - <title><c:out value="${app.configuration.name}" default="SnipSnap"/> :: <c:out value="${snip.name}"/></title> - <object id="showEqn" classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987"> - <!--comment required to prevent this becoming an empty tag--> - </object> - <?import NAMESPACE="M" IMPLEMENTATION="#showEqn"?> - </head> <body> <div id="page-logo"> --- 14,17 ---- |
Update of /cvsroot/hmath/org.hmath.server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23065 Added Files: addlabel.jsp copy.jsp build.xml changepass.jsp login.jsp rss.jsp upload.jsp license.txt versionsnip.jsp new.jsp version.jsp forgot.jsp edit.jsp index.jsp .tomcatplugin favicon.ico showlabels.jsp post.jsp rss2.jsp register.jsp .project .cvsignore history.jsp snip.jsp rsd.jsp main.jsp rdf.jsp comment.jsp diff.jsp .classpath Log Message: initial version --- NEW FILE: addlabel.jsp --- <%-- ** Template for adding Labels ** @author Stephan J. Schmidt ** @version $Id: addlabel.jsp,v 1.7 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <%@ page import="org.radeox.util.Encoder"%> <s:check roles="Authenticated" permission="Edit" snip="${snip}"> <p>Add a label to <b><c:out value="${snip.title}"/></b> (step 2/2)</p> <form name="form" method="post" action="exec/storelabel"> <table border="0" cellpadding="0" cellspacing="2"> <tr><td><c:out value="${label.inputProxy}" escapeXml="false"/></td></tr> <tr><td align="right"> <input value="Add Label" name="save" type="submit"/> <input value="Cancel" name="cancel" type="submit"/> </td></tr> </table> <input name="snipname" type="hidden" value="<c:out value="${snip.name}"/>"/> <input name="referer" type="hidden" value="<%= Encoder.escape(request.getHeader("REFERER")) %>"/> <input name="labeltype" type="hidden" value="<c:out value="${label.type}"/>"/> </form> </s:check> <s:check roles="Authenticated" permission="Edit" snip="${snip}" invert="true"> <a href="exec/login.jsp">Please login!</a> </s:check> --- NEW FILE: copy.jsp --- <%-- ** Template for copying new Snips. ** @author Matthias L. Jugel ** @version $Id: copy.jsp,v 1.3 2004/01/15 21:18:38 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <%@ page import="org.radeox.util.Encoder"%> <div class="snip-wrapper"> <div class="snip-title"> <h1 class="snip-name"> <fmt:message key="snip.copy"> <fmt:param><c:out value="${snip.name}" escapeXml="true" /></fmt:param> </fmt:message> </h1> </div> <form class="form" name="f" method="post" action="exec/copy" enctype="multipart/form-data"> <div class="snip-content"> <s:check roles="Editor"> <div class="snip-input"> <table> <tr> <td> <label for="new"><fmt:message key="snip.copy.name"/></label><br/> <input name="name" value="<c:out value="${name}" escapeXml="true" />" type="text" size="40" tabindex="0"/> </td> </tr> <c:if test="${not empty subsnips}"> <tr> <td> <label for="subsnips"><fmt:message key="snip.copy.subsnips"/></label><br/> <select multiple="multiple" name="subsnips" size="10" tabindex="1"> <c:forEach items="${subsnips}" var="snip"> <option selected="selected" value="<c:out value='${snip.name}' escapeXml='true'/>"><c:out value="${snip.name}" escapeXml="true"/></option> </c:forEach> </select> </td> </tr> </c:if> <tr><td class="form-buttons"> <input value="<fmt:message key="dialog.copy.snip"/>" name="copy" type="submit" tabindex="2"/> <input value="<fmt:message key="dialog.cancel"/>" name="cancel" type="submit" tabindex="3"/> </td></tr> </table> <input name="snip" type="hidden" value="<c:out value='${snip.name}' escapeXml='true'/>"/> <input name="referer" type="hidden" value="<%= Encoder.escape(request.getHeader("REFERER")) %>"/> </div> </s:check> <s:check roles="Authenticated" invert="true"> <fmt:message key="login.please"> <fmt:param><fmt:message key="dialog.copy.snip"/></fmt:param> </fmt:message> </s:check> </div> </form> </div> --- NEW FILE: build.xml --- <?xml version="1.0" encoding="UTF-8"?> <!-- ** @author Matthias L. Jugel ** @version $Id: build.xml,v 1.1 2004/03/09 20:16:01 jsurfer Exp $ --> <project basedir="." default="all" name="SnipSnap"> <property file="conf/build.properties"/> <property file="conf/snipsnap.conf"/> <path id="server.classpath"> <pathelement location="${jar}/javax.servlet.jar"/> <pathelement location="${jar}/org.apache.jasper.jar"/> <pathelement location="${jar}/org.apache.crimson.jar"/> <pathelement location="${jar}/org.mortbay.jetty.jar"/> <pathelement location="${jar}/mckoidb.jar"/> <pathelement location="${jar}/xmlrpc-1.1.jar"/> </path> <!-- the overall class path --> <path id="app.classpath"> <pathelement location="${jar}/asm-1.3.4.jar"/> <pathelement location="${jar}/groovy-1.0-beta-1.jar"/> <pathelement location="${jar}/graph-snipsnap.jar"/> <pathelement location="${jar}/radeox.jar"/> <pathelement location="${jar}/jena.jar"/> <pathelement location="${jar}/commons-logging.jar"/> <pathelement location="${jar}/commons-dbcp-1.1.jar"/> <pathelement location="${jar}/commons-pool-1.1.jar"/> <pathelement location="${jar}/commons-collections.jar"/> <pathelement location="${jar}/xmlrpc-1.1.jar"/> <pathelement location="${jar}/lucene-1.2.jar"/> <pathelement location="${jar}/jython.jar"/> <pathelement location="${jar}/smack.jar"/> <pathelement location="${jar}/aspectjrt.jar"/> <pathelement location="${jar}/dom4j.jar"/> <pathelement location="${src}/apps/default/WEB-INF/lib/jstl.jar"/> <pathelement location="${src}/apps/default/WEB-INF/lib/standard.jar"/> <pathelement location="${jar}/activation.jar"/> <pathelement location="${jar}/mail.jar"/> <pathelement location="${jar}/cvslib.jar"/> <pathelement location="${jar}/j2h.jar"/> <pathelement location="${jar}/junit.jar"/> <pathelement location="${jar}/picocontainer-1.0.jar"/> <pathelement location="${jar}/nanocontainer-1.0.jar"/> <pathelement location="${jar}/nanning.jar"/> </path> <path id="all.classpath"> <path refid="server.classpath"/> <path refid="app.classpath"/> </path> <!-- build distribution --> <target depends="tar-source, tar-binary" name="dist" description="tar complete distribution"/> <!-- build binary distribution package --> <target depends="clean" description="tar source package" name="tar-source"> <tstamp/> <tar destfile="../${appname}-${snipsnap.server.version}-${DSTAMP}-src.tgz" compression="gzip"> <tarfileset dir="." prefix="${appname}-${snipsnap.server.version}" mode="700"> <include name="run.sh"/> <include name="run.bat"/> <include name="db.sh"/> <include name="dbexport.sh"/> <include name="dbimport.sh"/> <include name="dbrepair.sh"/> <include name="exportall.sh"/> <include name="devlinks.sh"/> <include name="renimg.sh"/> </tarfileset> <tarfileset dir="." prefix="${appname}-${snipsnap.server.version}"> <include name="**"/> <exclude name="**/CVS"/> <exclude name="applications"/> <exclude name="run.sh"/> <exclude name="run.bat"/> <exclude name="db.sh"/> <exclude name="dbexport.sh"/> <exclude name="dbimport.sh"/> <exclude name="dbrepair.sh"/> <exclude name="exportall.sh"/> <exclude name="devlinks.sh"/> <exclude name="renimg.sh"/> <exclude name="src/theme/drrockit/"/> <exclude name="src/theme/javangelist/"/> <exclude name="src/theme/sib/"/> </tarfileset> </tar> </target> <target depends="all" description="tar binary package" name="tar-binary"> <tstamp/> <tar destfile="../${appname}-${snipsnap.server.version}-${DSTAMP}.tgz" compression="gzip"> <tarfileset dir="${basedir}" prefix="${appname}-${snipsnap.server.version}" mode="700"> <include name="run.sh"/> <include name="run.bat"/> </tarfileset> <tarfileset dir="${basedir}" prefix="${appname}-${snipsnap.server.version}"> <include name="lib/${appname}.jar"/> <include name="lib/${appname}.war"/> <include name="lib/${appname}-server.jar"/> <!-- <include name="lib/${appname}-theme-*.jar"/>--> <include name="lib/${appname}-installer.war"/> <include name="lib/${appname}-utils.jar"/> <include name="lib/asm-1.3.4.jar"/> <include name="lib/groovy-1.0-beta-1.jar"/> <include name="lib/org.mortbay.jetty.jar"/> <include name="lib/javax.servlet.jar"/> <include name="lib/org.apache.jasper.jar"/> <include name="lib/commons-dbcp-1.1.jar"/> <include name="lib/commons-pool-1.1.jar"/> <include name="lib/commons-collections.jar"/> <include name="lib/mckoidb.jar"/> <include name="lib/mysql-connector.jar"/> <include name="lib/postgres-jdbc.jar"/> <include name="lib/org.apache.crimson.jar"/> <include name="lib/xmlrpc-1.1.jar"/> <include name="conf/jetty.conf"/> <include name="license.txt"/> <include name="validate.xsl"/> <include name="README"/> <exclude name="**/CVS"/> <exclude name="run.sh"/> <exclude name="run.bat"/> <exclude name="db.sh"/> <exclude name="dbrepair.sh"/> <exclude name="exportall.sh"/> <exclude name="devlinks.sh"/> <exclude name="renimg.sh"/> </tarfileset> </tar> </target> <!-- delete compiled class files and created jar/war archives --> <target description="clean up compiled code" name="clean"> <delete failonerror="false" includeEmptyDirs="true"> <fileset dir="${target}" includes="**" excludes="CVS"/> </delete> <delete failonerror="false"> <fileset dir="${jar}" includes="${appname}*.jar"/> <fileset dir="${jar}" includes="${appname}*.war"/> <fileset dir="${src}/apps/default/WEB-INF/lib" includes="${appname}-servlets.jar"/> <fileset dir="${src}/apps/installer/WEB-INF/lib" includes="installer-servlets.jar"/> <fileset dir="${src}/org/snipsnap/config" includes="Options.java"/> </delete> </target> <!-- create all archives --> <target depends="jar-server,jar-util,snipsnap-war" description="create all" name="all"/> <target name="buildtask"> <mkdir dir="${target}/ant"/> <javac deprecation="false" debug="false" srcdir="${src}" destdir="${target}/ant"> <include name="org/snipsnap/util/PropertyConstantBuilder.java"/> </javac> </target> <target depends="buildtask" name="declaretask"> <taskdef name="constants" classname="org.snipsnap.util.PropertyConstantBuilder" classpath="${target}/ant"/> </target> <!-- prepare special generated classes --> <target depends="declaretask" name="generate"> <constants properties="${src}/org/snipsnap/config/defaults.conf" file="${target}/ant/config.stub" prefix="app." /> <loadfile property="config-stub" srcfile="${target}/ant/config.stub" failonerror="false"/> <copy file="${src}/org/snipsnap/config/Configuration.java.tmpl" tofile="${src}/org/snipsnap/config/Configuration.java" filtering="true" overwrite="true" > <filterset> <filter token="DEFAULTS" value="${config-stub}"/> </filterset> </copy> <constants properties="${src}/org/snipsnap/config/globals.conf" file="${target}/ant/globals.stub" prefix="app." /> <loadfile property="globals-stub" srcfile="${target}/ant/globals.stub" failonerror="false"/> <copy file="${src}/org/snipsnap/config/Globals.java.tmpl" tofile="${src}/org/snipsnap/config/Globals.java" filtering="true" overwrite="true" > <filterset> <filter token="DEFAULTS" value="${globals-stub}"/> </filterset> </copy> </target> <!-- create server code --> <target depends="compile-jsp, compile-server,installer-war" description="create server jar" name="jar-server"> <copy file="conf/copyright.txt" tofile="${target}/server/conf/copyright.txt" filtering="true"> <filterset> <filter token="VERSION" value="${snipsnap.server.version}"/> </filterset> </copy> <jar destfile="${jar}/${appname}.jar" excludes="**/CVS" manifest="conf/launcher.manifest"> <fileset dir="${target}/server" includes="org/snipsnap/server/*Launcher*"/> </jar> <jar destfile="${jar}/${appname}-server.jar" excludes="**/CVS, org/snipsnap/server/*Launcher*" manifest="conf/manifest"> <fileset dir="${target}/server" includes="**"/> <fileset dir="."> <include name="conf/snipsnap.conf"/> <include name="conf/jetty.conf"/> </fileset> <fileset dir="${src}" includes="org/snipsnap/config/globals.conf"/> <fileset dir="${src}" includes="org/snipsnap/config/defaults.conf"/> <fileset dir="${src}" includes="org/snipsnap/config/transpose.map"/> </jar> </target> <target depends="generate" description="compile server code" name="compile-server"> <mkdir dir="${target}/server"/> <javac deprecation="${deprecation}" debug="${debug}" srcdir="${src}" destdir="${target}/server" classpathref="server.classpath" includes="org/snipsnap/server/**,org/snipsnap/util/*JDBC*"/> </target> <!-- create utility code --> <target depends="compile-util" description="build util jar" name="jar-util"> <jar destfile="${jar}/${appname}-utils.jar" excludes="**/CVS" manifest="conf/utils.manifest" > <fileset dir="${target}/util" includes="**"/> <fileset dir="." includes="conf/snipsnap.conf"/> <fileset dir="." includes="conf/copyright.txt"/> <fileset dir="${src}" includes="org/snipsnap/config/defaults.conf"/> <fileset dir="${src}" includes="org/snipsnap/config/transpose.map"/> </jar> </target> <target depends="generate" description="compile util code" name="compile-util"> <mkdir dir="${target}/util"/> <javac deprecation="${deprecation}" debug="${debug}" srcdir="${src}" classpathref="all.classpath" destdir="${target}/util"> <include name="org/snipsnap/util/Test*"/> <include name="org/snipsnap/util/*Util.java"/> <include name="org/snipsnap/util/DB*.java"/> <include name="org/snipsnap/util/*JDBC*.java"/> <include name="org/snipsnap/util/mail/**"/> <include name="org/snipsnap/util/*Test.java"/> <include name="org/snipsnap/server/AdminClient.java"/> <include name="org/snipsnap/util/XMLSnipRepair.java"/> </javac> </target> <target name="checkstyle"> <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/> <pmd rulesetfiles="${check_rules}" shortFilenames="true" printToConsole="true"> <!-- <pmd rulesetfiles="rulesets/coupling.xml,rulesets/unusedcode.xml,rulesets/basic.xml,rulesets/imports.xml" shortFilenames="true" printToConsole="true"> --> <formatter type="html" toFile="pmd_report.html"/> <fileset dir="./src"> <include name="**/*.java"/> </fileset> </pmd> </target> <target depends="generate" description="compile test code" name="compile-test"> <mkdir dir="${target}/test"/> <javac deprecation="${deprecation}" debug="${debug}" srcdir="${src}" classpathref="all.classpath" destdir="${target}/test" includes="org/snipsnap/test/**"/> </target> <target depends="generate" description="compile template application code" name="compile-servlets"> <mkdir dir="${target}/default/WEB-INF/classes"/> <javac deprecation="${deprecation}" debug="${debug}" srcdir="${src}" classpathref="all.classpath" destdir="${target}/default/WEB-INF/classes" excludes="org/snipsnap/admin/**, org/snipsnap/server/**"> <src path="${src}"/> <include name="org/snipsnap/**"/> </javac> </target> <target depends="compile-servlets" name="servlets-jar"> <copy todir="${target}/default/WEB-INF/classes" filtering="true" overwrite="true"> <filterset> <filter token="VERSION" value="${snipsnap.server.version}"/> </filterset> <fileset dir="${src}" includes="org/snipsnap/net/dispatcher.conf"/> <fileset dir="${src}" includes="org/snipsnap/config/globals.conf"/> <fileset dir="${src}" includes="org/snipsnap/config/defaults.conf"/> <fileset dir="${src}" includes="org/snipsnap/config/transpose.map"/> <fileset dir="${src}" includes="org/snipsnap/snip/storage/SnipSerializer.properties"/> </copy> <jar destfile="${src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar" excludes="**/CVS"> <fileset dir="${target}/default/WEB-INF/classes" includes="**"/> <fileset dir="${src}" includes="META-INF/**"/> </jar> </target> <target if="precompile.jsp" depends="servlets-jar" name="compile-jsp" description="compile jsp files"> <mkdir dir="${target}/jsp/source"/> <mkdir dir="${target}/jsp/classes"/> <jspc destdir="${target}/jsp/source" verbose="1" srcdir="${src}/apps/default" classpathref="all.classpath" webinc="${target}/jsp/web.inc"> <include name="**/*.jsp" /> <webapp basedir="${src}/apps/default"/> </jspc> <depend srcdir="${target}/jsp/source" destdir="${target}/jsp/classes" cache="${target}/jsp/dependencies" classpathref="all.classpath"/> <javac deprecation="${deprecation}" debug="${debug}" srcdir="${target}/jsp/source" classpath="${src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar" classpathref="all.classpath" destdir="${target}/jsp/classes"> <include name="**"/> </javac> </target> <target if="precompile.jsp" depends="compile-jsp" name="jsp-jar" description="package precompiled jsp files"> <jar destfile="${src}/apps/default/WEB-INF/lib/snipsnap-jsp.jar" excludes="**/CVS"> <fileset dir="${target}/jsp/classes" includes="**"/> </jar> </target> <!-- create web archive of the template application --> <target depends="jsp-jar" description="build template war" name="snipsnap-war"> <mkdir dir="${target}/webapp"/> <copy todir="${target}/webapp"> <fileset dir="${src}/apps/default"> <exclude name="**/CVS"/> <exclude name="**/*.jsp" if="precompile.jsp"/> <exclude name="WEB-INF/web-xml.tmpl"/> </fileset> <!-- <fileset dir="${src}/theme/blue" includes="**" excludes="**/CVS"/>--> </copy> <!-- <mkdir dir="${target}/webapp/WEB-INF/themes"/>--> <!-- <copy todir="${target}/webapp/WEB-INF/themes">--> <!-- <fileset dir="${jar}" includes="${appname}-theme-*.jar"/>--> <!-- </copy>--> <loadfile property="web.inc" srcfile="${target}/jsp/web.inc" failonerror="false"/> <condition property="web.inc" value=""> <not> <isset property="${web.inc}"/> </not> </condition> <!-- copy with filter if web.inc is available --> <copy tofile="${target}/webapp/WEB-INF/web.xml" file="${src}/apps/default/WEB-INF/web-xml.tmpl" overwrite="true"> <filterset> <filter token="VERSION" value="${snipsnap.server.version}"/> <filter token="PRECOMPILED-JSP" value="${web.inc}"/> </filterset> </copy> <copy file="${src}/apps/default/index.jsp" tofile="${target}/webapp/index.jsp"/> <copy file="conf/copyright.txt" filtering="true" todir="${target}/webapp/WEB-INF/classes/defaults"> <filterset> <filter token="VERSION" value="${snipsnap.server.version}"/> </filterset> </copy> <copy todir="${target}/webapp/WEB-INF/lib"> <fileset dir="${jar}"> <include name="asm-1.3.4.jar"/> <include name="groovy-1.0-beta-1.jar"/> <include name="graph-snipsnap.jar"/> <include name="radeox.jar"/> <include name="jena.jar"/> <include name="commons-logging.jar"/> <include name="commons-dbcp-1.1.jar"/> <include name="commons-pool-1.1.jar"/> <include name="commons-collections.jar"/> <include name="lucene-1.2.jar"/> <include name="xmlrpc-1.1.jar"/> <include name="dom4j.jar"/> <include name="smack.jar"/> <include name="aspectjrt.jar"/> <include name="jython.jar"/> <include name="mail.jar"/> <include name="activation.jar"/> <include name="j2h.jar"/> <include name="picocontainer-1.0.jar"/> <include name="nanocontainer-1.0.jar"/> <include name="nanning.jar"/> </fileset> </copy> <jar destfile="${jar}/${appname}.war"> <fileset dir="${target}/webapp" includes="**"/> </jar> </target> <!-- create jar archives of all themes --> <!-- <target description="build theme jar" name="theme-jar">--> <!-- <jar destfile="${jar}/${appname}-theme-blue.jar" excludes="**/CVS">--> <!-- <fileset dir="${src}/theme/blue" includes="**"/>--> <!-- <zipfileset dir="${src}/theme" prefix="WEB-INF">--> <!-- <include name="web.xml"/>--> <!-- </zipfileset>--> <!-- </jar>--> <!-- <jar destfile="${jar}/${appname}-theme-sky.jar" excludes="**/CVS">--> <!-- <fileset dir="${src}/theme/sky" includes="**"/>--> <!-- <zipfileset dir="${src}/theme" prefix="WEB-INF">--> <!-- <include name="web.xml"/>--> <!-- </zipfileset>--> <!-- </jar>--> <!-- <jar destfile="${jar}/${appname}-theme-orange.jar" excludes="**/CVS">--> <!-- <fileset dir="${src}/theme/orange" includes="**"/>--> <!-- <zipfileset dir="${src}/theme" prefix="WEB-INF">--> <!-- <include name="web.xml"/>--> <!-- </zipfileset>--> <!-- </jar>--> <!-- </target>--> <target if="precompile.jsp" depends="installer-servlets-jar" name="compile-installer-jsp" description="compile installer jsp files"> <mkdir dir="${target}/installer/jsp/source"/> <mkdir dir="${target}/installer/jsp/classes"/> <jspc destdir="${target}/installer/jsp/source" verbose="1" classpathref="all.classpath" webinc="${target}/installer/jsp/web.inc"> <include name="**/*.jsp" /> <webapp basedir="${src}/apps/installer"/> </jspc> <depend srcdir="${target}/installer/jsp/source" destdir="${target}/installer/jsp/classes" cache="${target}/installer/jsp/dependencies" classpathref="all.classpath"/> <javac deprecation="${deprecation}" debug="${debug}" srcdir="${target}/installer/jsp/source" classpath="${target}/installer/webapp/WEB-INF/lib/installer-servlets.jar" classpathref="all.classpath" destdir="${target}/installer/jsp/classes"> <include name="**"/> </javac> </target> <target description="compile installer application code" name="compile-installer"> <mkdir dir="${target}/installer/servlets"/> <javac deprecation="${deprecation}" debug="${debug}" srcdir="${src}" classpathref="all.classpath" destdir="${target}/installer/servlets"> <include name="org/snipsnap/admin/AdminInitFilter.java"/> <include name="org/snipsnap/admin/Installer.java"/> </javac> </target> <target if="precompile.jsp" depends="compile-installer-jsp" name="installer-jsp-jar" description="package precompiled installer jsp files"> <mkdir dir="${target}/installer/webapp/WEB-INF/lib"/> <jar destfile="${target}/installer/webapp/WEB-INF/lib/installer-jsp.jar" excludes="**/CVS"> <fileset dir="${target}/installer/jsp/classes" includes="**"/> </jar> </target> <target depends="compile-installer" description="package installer servlets" name="installer-servlets-jar"> <mkdir dir="${target}/installer/webapp/WEB-INF/lib"/> <jar destfile="${target}/installer/webapp/WEB-INF/lib/installer-servlets.jar" excludes="**/CVS"> <fileset dir="${target}/installer/servlets" includes="**"/> <fileset dir="." includes="conf/snipsnap.conf"/> <fileset dir="${src}" includes="org/snipsnap/config/defaults.conf"/> <fileset dir="${src}" includes="org/snipsnap/config/transpose.conf"/> </jar> </target> <!-- create web archive of the installer web application --> <target depends="installer-jsp-jar" description="build installer war" name="installer-war"> <mkdir dir="${target}/installer/webapp"/> <copy todir="${target}/installer/webapp"> <fileset dir="${src}/apps/installer"> <exclude name="**/CVS"/> <exclude name="**/*.jsp" if="precompile.jsp"/> <exclude name="WEB-INF/web-xml.tmpl"/> </fileset> <fileset dir="${src}/apps/default"> <include name="WEB-INF/lib/standard.jar"/> <include name="WEB-INF/lib/jstl.jar"/> </fileset> </copy> <copy file="${src}/apps/default/admin/css/config.css" tofile="${target}/installer/webapp/default.css"/> <copy file="${src}/apps/installer/index.jsp" tofile="${target}/installer/webapp/index.jsp"/> <!-- copy if installer-web.inc is available --> <loadfile property="installer-web.inc" srcfile="${target}/installer/jsp/web.inc" failonerror="false"/> <condition property="installer-web.inc" value=""> <not> <isset property="${installer-web.inc}"/> </not> </condition> <copy tofile="${target}/installer/webapp/WEB-INF/web.xml" file="${src}/apps/installer/WEB-INF/web-xml.tmpl" overwrite="true"> <filterset> <filter token="PRECOMPILED-JSP" value="${installer-web.inc}"/> </filterset> </copy> <jar destfile="${jar}/${appname}-installer.war"> <fileset dir="${target}/installer/webapp" includes="**"/> </jar> </target> <target name="prepare-tests"> <mkdir dir="${target}/test/org/snipsnap/config"/> <copy file="conf/snipsnap.conf" tofile="./cls/test/conf/snipsnap.conf"/> <copy file="src/org/snipsnap/config/defaults.conf" tofile="${target}/test/org/snipsnap/config/defaults.conf"/> <copy file="src/org/snipsnap/config/globals.conf" tofile="${target}/test/org/snipsnap/config/globals.conf"/> <copy file="src/org/snipsnap/config/transpose.map" tofile="${target}/test/org/snipsnap/config/transpose.map"/> </target> <target name="test" depends="snipsnap-war, jar-server, prepare-tests, compile-test"> <junit printsummary="true"> <formatter usefile="false" type="plain"/> <test name="org.snipsnap.test.AllTests"/> <classpath> <pathelement location="${target}/test"/> <pathelement location="${target}"/> <path refid="all.classpath"/> </classpath> </junit> </target> <target name="test-complex" depends="snipsnap-war, jar-server, prepare-tests, compile-test"> <junit printsummary="true"> <formatter usefile="false" type="plain"/> <test name="org.snipsnap.test.AllComplexTests"/> <classpath> <pathelement location="${target}/test"/> <pathelement location="${target}"/> <path refid="all.classpath"/> </classpath> </junit> </target> <target description="generation javadocs" name="javadoc"> <javadoc packagenames="org.snipsnap.*" sourcepath="src" excludepackagenames="org.snipsnap.test.*" defaultexcludes="yes" destdir="docs/api" author="true" version="true" use="true" windowtitle="SnipSnap API"> <doctitle><![CDATA[<h1>SnipSnap</h1>]]></doctitle> <bottom><![CDATA[<i>Copyright © 2001-2004 Matthias L. Jugel, Stephan J. Schmidt. All Rights Reserved .</i>]]></bottom> <!-- <tag name="todo" scope="all" description="To do:" /> <group title="Group 1 Packages" packages="com.dummy.test.a*"/> <group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/> --> <link href="http://java.sun.com/j2se/1.4/docs/api/package-list"/> <link href="http://java.sun.com/j2ee/1.4/docs/api/package-list"/> </javadoc> </target> </project> --- NEW FILE: changepass.jsp --- <%-- ** Template for password changing from a pw key ** @author Stephan J. Schmidt ** @version $Id: changepass.jsp,v 1.5 2004/02/09 13:23:09 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <div class="snip-wrapper"> <div class="snip-title"><h1 class="snip-name"><fmt:message key="user.password.change.title"/></h1></div> <div class="snip-content"> <%-- display error message --%> <c:if test="${error != null}"> <div class="error"><fmt:message key="${error}"/><p/></div> </c:if> <p><fmt:message key="user.password.enter"/></p> <%-- the login form --%> <form class="form" method="post" action="exec/changepass"> <table> <tr><td><label for="password"><fmt:message key="user.password.new"/></label></td><td><input id="password" name="password" type="password" size="20" value="" tabindex="0"/></td></tr> <tr><td><label for="password"><fmt:message key="user.password.verify"/></label></td><td><input id="password2" name="password2" type="password" size="20" value="" tabindex="0"/></td></tr> <tr><td class="form-buttons" colspan="2"> <input value="Change Password" name="ok" type="submit" tabindex="0"/> <input value="Cancel" name="cancel" type="submit" tabindex="0"/> </td></tr> </table> <input name="key" type="hidden" value="<c:out value="${param['key']}"/>"/> </form> </div> </div> --- NEW FILE: login.jsp --- <%-- ** Template for a login screen. ** @author Matthias L. Jugel ** @version $Id: login.jsp,v 1.22 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <div class="snip-wrapper"> <div class="snip-title"><h1 class="snip-name"><fmt:message key="login.title"/></h1></div> <div class="snip-content"> <s:check roles="Authenticated" invert="true"> <%-- display error message --%> <c:if test="${error != null}"> <div class="error"><fmt:message key="login.error"/></div> <div><b><fmt:message key="login.password.forgot"/> <a href="exec/forgot.jsp?login=<c:out value='${tmpLogin}'/>"><fmt:message key="login.password.reset"/></a></b></div> <c:if test="${app.configuration.allowRegister}"> <div><b><fmt:message key="login.not.registered"/> <a href="exec/register.jsp?login=<c:out value='${tmpLogin}'/>"><fmt:message key="login.register.now"/></a></b></div> </c:if> <p/> </c:if> <%-- the login form --%> <form class="form" method="post" action="exec/authenticate"> <table> <tr><td><label for="login"><fmt:message key="login.user.name"/></label></td><td><input id="login" name="login" type="text" size="20" value="<c:out value='${tmpLogin}'/>" tabindex="0"/></td></tr> <tr><td><label for="password"><fmt:message key="login.password"/></label></td><td><input id="password" name="password" type="password" size="20" value="" tabindex="0"/></td></tr> <tr><td class="form-buttons" colspan="2"> <input value="<fmt:message key="login.dialog.login"/>" name="ok" type="submit" tabindex="0"/> <input value="<fmt:message key="dialog.cancel"/>" name="cancel" type="submit" tabindex="0"/> </td></tr> </table> <input name="referer" type="hidden" value="<c:out value='${referer}' default='${header["REFERER"]}'/>"/> </form> </s:check> <s:check roles="Authenticated"> <fmt:message key="login.want.to.logoff"/> </s:check> </div> </div> --- NEW FILE: rss.jsp --- <%@ page pageEncoding="iso-8859-1" %><%-- --%><%@ page contentType="text/xml; charset=UTF-8"%><%-- --%><?xml version="1.0" encoding="utf-8"?> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%-- hack to remove linefeed --%><%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %><%-- --%><!-- name="generator" content="SnipSnap/<c:out value="${config.version}"/> --> <rss version="0.92"> <%-- ** RSS display template. ** @author Stephan J. Schmidt ** @version $Id: rss.jsp,v 1.9 2003/12/15 22:42:07 leo Exp $ --%> <channel> <title><c:out value="${config.name}" escapeXml="true"/></title> <description><c:out value="${config.tagline}" escapeXml="true"/></description> <%-- usually points to "start" --%> <link><c:out value="${url}/${snip.nameEncoded}"/></link> <c:forEach items="${snip.childrenDateOrder}" var="child"> <item> <title><c:out value="${child.name}" escapeXml="true"/></title> <link><c:out value="${url}/${child.nameEncoded}"/></link> </item> </c:forEach> </channel> </rss> --- NEW FILE: upload.jsp --- <%@ page import="org.snipsnap.snip.Snip, java.util.Collection, java.util.Collections"%> <%-- ** Template for editing Snips. ** @author Matthias L. Jugel ** @version $Id: upload.jsp,v 1.9 2003/12/18 16:46:22 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ page import="org.radeox.util.Encoder"%> <div class="snip-wrapper"> <s:check roles="Authenticated" permission="Edit" snip="${snip}"> <div class="snip-title"> <h1 class="snip-name"> <fmt:message key="snip.attachments.title"> <fmt:param><c:out value="${snip_name}" escapeXml="false"/></fmt:param> </fmt:message> </h1> </div> <div class="snip-content"> <c:if test="${error != null}"> <div class="error"><c:out value="${error}"/></div> <p/> </c:if> <div class="snip-input"> <script type="text/javascript" language="Javascript"> <!-- function checkAll(checkbox) { if(checkbox.name == 'allChecked') { <c:forEach items="${snip.attachments.all}" var="attachment" varStatus="status" > document.getElementById("<c:out value="file${status.index}"/>").checked = checkbox.checked </c:forEach> } } --> </script> <form class="form" name="f" method="post" action="exec/upload" enctype="multipart/form-data"> <input name="name" type="hidden" value="<c:out value="${snip_name}"/>"/> <input name="referer" type="hidden" value="<%= Encoder.escape(request.getHeader("REFERER")) %>"/> <table class="wiki-table" border="0" cellpaddin="0" cellspacing="0"> <tr> <s:check roles="Authenticated"><th><input id="all" type="checkbox" name="allChecked" onClick="return checkAll(this);"></th></s:check> <th><fmt:message key="snip.attachments.file.name"/></th> <th><fmt:message key="snip.attachments.file.size"/></th> <th><fmt:message key="snip.attachments.file.date"/></th> <th><fmt:message key="snip.attachments.file.type"/></th> <tr> <c:forEach items="${snip.attachments.all}" var="attachment" varStatus="status" > <tr> <s:check roles="Authenticated"><td><input id="file<c:out value='${status.index}'/>" type="checkbox" name="attfile" value="<c:out value='${attachment.name}' escapeXml="true"/>"/></td></s:check> <td><a href="space/<c:out value='${snip.nameEncoded}/${attachment.nameEncoded}'/>"><c:out value="${attachment.name}" escapeXml="true"/></a></td> <td><c:out value="${attachment.size}"/></td> <td><fmt:formatDate value="${attachment.date}"/></td> <td><c:out value="${attachment.contentType}" escapeXml="true"/></td> </tr> </c:forEach> <c:if test="${empty snip.attachments.all}"> <tr><td colspan="5"><fmt:message key="snip.attachments.nofiles"/></td></tr> </c:if> <tr> <td colspan="5" class="form-buttons"> <s:check roles="Authenticated" permission="Attach" snip="${snip}"> <input name="file" type="file" maxlength="1000000" accept="*/*"/> <fmt:message key="snip.attachments.file.name"/> <input id="filename" name="filename" type="text" value="" length="10" maxlength="256"/> <fmt:message key="snip.attachments.file.type"/> <input id="mimetype" name="mimetype" type="text" value="" length="10" maxlength="256"/> <br/> <input value="<fmt:message key="snip.attachments.upload"/>" name="upload" type="submit"/> <input id="<fmt:message key="snip.attachments.delete"/>" value="Delete File(s)" name="delete" type="submit"/></br> </s:check> <input value="<fmt:message key="dialog.cancel"/>" name="cancel" type="submit"/> </td> </tr> </table> </div> </form> </div> </s:check> <s:check roles="Authenticated" permission="Edit" snip="${snip}" invert="true"> <fmt:message key="login.please"> <fmt:param><fmt:message key="snip.attachments.login"/></fmt:param> </fmt:message> </s:check> </div> --- NEW FILE: license.txt --- GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: * a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. * b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. * c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: * a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, * b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, * c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. one line to give the program's name and an idea of what it does. Copyright (C) 19yy name of author This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. --- NEW FILE: versionsnip.jsp --- <%-- ** Snip version display template. ** @author Stephan J. Schmidt ** @version $Id: versionsnip.jsp,v 1.4 2004/02/11 14:13:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <div class="snip-wrapper"> <%-- include snip header and content --%> <div class="snip-title"> <h1 class="snip-name"> <fmt:message key="snip.version.title"> <fmt:param value="${version}" /> <fmt:param value="${snip.title}" /> </fmt:message> <c:if test="${version > 1}"> <a href="exec/version?name=<c:out value='${snip.nameEncoded}'/>&version=<c:out value="${version-1}"/>">#<c:out value="${version-1}"/></a> < </c:if> <c:if test="${version < maxVersion }"> > <a href="exec/version?name=<c:out value='${snip.nameEncoded}'/>&version=<c:out value="${version+1}"/>">#<c:out value="${version+1}"/></a> </c:if> ... #<c:out value="${maxVersion}"/></h1> <div class="snip-info"> <c:out value="${snip.modified}" escapeXml="false"/>. <fmt:message key="snip.viewed"> <fmt:param value="${snip.access.viewCount}"/> </fmt:message> <fmt:message key="snip.version"> <fmt:param value="${versionSnip.version}"/> </fmt:message> </div> </div> <%-- Snip content --%> <div class="snip-content"> <c:out value="${versionSnip.XMLContent}" escapeXml="false" /> </div> </div> --- NEW FILE: new.jsp --- <%-- ** Template for creating new Snips. ** @author Stephan J. Schmidt ** @version $Id: new.jsp,v 1.7 2004/02/25 10:19:49 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %> <div class="snip-wrapper"> <div class="snip-title"><h1 class="snip-name"><fmt:message key="snip.create"/></h1></div> <form class="form" name="f" method="post" action="exec/store" enctype="multipart/form-data"> <s:check roles="Authenticated"> <div class="snip-title"> <fmt:message key="snip.name"/><br/><input name="name" value="<c:out value="${name}"/>" type="text"/> <c:if test="${error == 'snip.name.empty'}"><span class="error"><fmt:message key="snip.name.empty"/></span></c:if> </div> <fmt:message key="snip.parent"/> <input name="parentBefore" value="<c:out value="${parentBefore}"/>" type="hidden"/> <s:pathSelector parentName="${parentBefore}"/><br/> <fmt:message key="snip.template"/> <select name="template" size="1"> <c:forEach items="${templates}" var="template" > <option><c:out value="${template}"/> </c:forEach> </select> <input value="<fmt:message key="dialog.copy.template"/>" name="copy.template" type="submit"/> <c:if test="${not empty preview}"> <div class="preview"><div class="snip-content"><c:out value="${preview}" escapeXml="false"/></div></div> </c:if> <div class="snip-content"> <div class="snip-input"> <table> <tr><td><textarea name="content" type="text" cols="80" rows="20"><c:out value="${content}" escapeXml="true"/></textarea></td></tr> <tr><td class="form-buttons"> <input value="<fmt:message key="dialog.preview"/>" name="preview" type="submit"/> <input value="<fmt:message key="dialog.save"/>" name="save" type="submit"/> <input value="<fmt:message key="dialog.cancel"/>" name="cancel" type="submit"/> </td></tr> </table> <input name="referer" type="hidden" value="<%= Encoder.escape(request.getHeader("REFERER")) %>"/> </div> </div> </s:check> <s:check roles="Authenticated" invert="true" > <fmt:message key="login.please"> <fmt:param><fmt:message key="snip.create"/></fmt:param> </fmt:message> </s:check> </form> </div> --- NEW FILE: version.jsp --- <%@ page pageEncoding="iso-8859-1" %><%-- --%><%@ page contentType="text/xml; charset=UTF-8"%><%-- --%><%@ page import="org.snipsnap.snip.SnipSpace, org.snipsnap.snip.SnipSpaceFactory"%><%-- --%><% response.setHeader("ETag", SnipSpaceFactory.getInstance().getETag()); %><%-- --%><?xml version="1.0" encoding="UTF-8"?> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %><%-- hack to remove linefeed --%><%@ taglib uri="http://snipsnap.com/snipsnap" prefix="s" %><%-- --%><!-- name="generator" content="SnipSnap/<c:out value="${config.version}"/>" --> <rsv version="0.1"> <%-- ** RSV display template. ** Really simple version protokoll ** @author Stephan J. Schmidt ** @version $Id: version.jsp,v 1.2 2003/02/24 09:00:24 stephan Exp $ --%> <engineName>SnipSnap</engineName> <engineLink>http://snipsnap.org</engineLink> <engineVersion><c:out value="${config.version}"/></engineVersion> </rsv> --- NEW FILE: forgot.jsp --- <%-- ** Forgotten password page template. ** @author Matthias L. Jugel ** @version $Id: forgot.jsp,v 1.4 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <div class="snip-wrapper"> <div class="snip-title"><h1 class="snip-name"><fmt:message key="login.forgot.title"/></h1></div> <p/><fmt:message key="login.forgot.text"/><p/> <%-- display error message --%> <c:if test="${error != null}"> <div class="error"><c:out value="${error}"/><p/></div> </c:if> <div class="snip-content"> <form class="form" method="post" action="exec/mailkey"> <table> <tr <c:if test="${errors['login'] != null}">class="error-position"</c:if>> <td><label for="login"><fmt:message key="login.user.name"/></label></td><td><input id="login" name="login" type="text" size="20" value="<c:out value="${param['... [truncated message content] |
|
From: <js...@us...> - 2004-03-09 20:38:38
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/theme/blue In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21210/WEB-INF/src/theme/blue Added Files: blue.png Log Message: initial version --- NEW FILE: blue.png --- (This appears to be a binary file; contents omitted.) |
|
From: <js...@us...> - 2004-03-09 20:38:38
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21210/WEB-INF/src/META-INF Added Files: MANIFEST.MF Log Message: initial version --- NEW FILE: MANIFEST.MF --- Manifest-Version: 1.0 Ant-Version: Apache Ant 1.5.4 Created-By: 1.4.2_03-b02 (Sun Microsystems Inc.) |
|
From: <js...@us...> - 2004-03-09 20:38:38
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/theme/sky In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21210/WEB-INF/src/theme/sky Added Files: sky.png sky.snip Log Message: initial version --- NEW FILE: sky.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: sky.snip --- <?xml version="1.0" encoding="iso-8859-1" ?> <snipspace> <snip> <name>snipsnap-portlet-2</name> <content> ~~Describe here what your [SnipSnap] is about!~~ __Configure this box!__\\ 1. Login in 1. Click here: [snipsnap-portlet-2] 1. Edit this box </content> <permissions>Edit:Editor</permissions> </snip> </snipspace> |
|
From: <js...@us...> - 2004-03-09 20:38:38
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/theme/orange In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21210/WEB-INF/src/theme/orange Added Files: orange.png Log Message: initial version --- NEW FILE: orange.png --- (This appears to be a binary file; contents omitted.) |
|
From: <js...@us...> - 2004-03-09 20:38:37
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21210/WEB-INF/src/org/hartmath/server Added Files: SnipEvalServlet.java EvalOutputFormServlet.java MathMLPresentation.java Log Message: initial version --- NEW FILE: SnipEvalServlet.java --- /* * This file is part of "SnipSnap Wiki/Weblog". * * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel All Rights Reserved. * * Please visit http://snipsnap.org/ for updates and contact. * * --LICENSE NOTICE-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; either version 2 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 General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. --LICENSE NOTICE-- */ package org.hartmath.server; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.snipsnap.app.Application; import org.snipsnap.config.Configuration; /** * Load a snip to view. * * @author Matthias L. Jugel * @version $Id: SnipEvalServlet.java,v 1.1 2004/03/09 20:13:13 jsurfer Exp $ */ public class SnipEvalServlet extends HttpServlet { public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String query = request.getParameter("expr"); if (query != null && query.length() > 0) { HttpSession session = request.getSession(); session.setAttribute("expr", query); RequestDispatcher dispatcher = request.getRequestDispatcher("/exec/eval.jsp"); dispatcher.forward(request, response); return; } Configuration config = Application.get().getConfiguration(); response.sendRedirect(config.getUrl()); } } --- NEW FILE: EvalOutputFormServlet.java --- /* * This file is part of "SnipSnap Wiki/Weblog". * * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel * All Rights Reserved. * * Please visit http://snipsnap.org/ for updates and contact. * * --LICENSE NOTICE-- * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * --LICENSE NOTICE-- */ package org.hartmath.server; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.hartmath.core.eval.TimeConstrainedEvaluator; import org.radeox.util.StringBufferWriter; /** * Load a snip to edit. Loads the snip into the request context. In case * the snip is newly created put the name into "snip_name". * * @author Matthias L. Jugel * @version $Id: EvalOutputFormServlet.java,v 1.1 2004/03/09 20:13:13 jsurfer Exp $ */ public class EvalOutputFormServlet extends HttpServlet { private static final String EVAL_OUTPUT_FORM_KEY = "eval_output_form_servlet"; public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { doGet(request, response); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // UserManager um = UserManagerFactory.getInstance(); // User user = Application.get().getUser(); // if (um.isAuthenticated(user)) { // user.lastAccess(); // } HttpSession session = request.getSession(); TimeConstrainedEvaluator utility; if (session.isNew()) { //log("new session "+session.toString()); utility = new TimeConstrainedEvaluator(session.getId(), false, 2000); session.setAttribute(EVAL_OUTPUT_FORM_KEY, utility); } else { //log("old session "+session.toString()); utility = (TimeConstrainedEvaluator) session.getAttribute(EVAL_OUTPUT_FORM_KEY); if (utility == null) { utility = new TimeConstrainedEvaluator(session.getId(), false, 2000); session.setAttribute(EVAL_OUTPUT_FORM_KEY, utility); } } // // handle the snip name // String name = request.getPathInfo(); // if (null == name || "/".equals(name)) { // name = "start"; // } else { // name = name.substring(1); // } // name = name.replace('+', ' '); String query = request.getParameter("content"); if (request.getParameter("eval") != null) { } StringBuffer buffer = new StringBuffer(); StringBufferWriter writer = new StringBufferWriter(buffer); utility.constrainedEval(writer, query); // if (result!=null) { // OutputFormFactory.convert(buffer,result); // request.setAttribute("result", buffer.toString()); // } request.setAttribute("result", buffer.toString()); RequestDispatcher dispatcher = request.getRequestDispatcher("/exec/evaloutput.jsp"); dispatcher.forward(request, response); } } --- NEW FILE: MathMLPresentation.java --- /* * Created on 23.09.2003 * */ package org.hartmath.server; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.hartmath.core.eval.MathMLUtilities; /** * Converst a request parameter "expr" into MATHML output * */ public class MathMLPresentation extends HttpServlet { public static final String MATHML_FOOTER = "</body></html>"; public static final String MATHML_HEADER = "<?xml version=\"1.0\"?>" + "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\" " + " \"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd\" [" + " <!ENTITY mathml \"http://www.w3.org/1998/Math/MathML\">" + "]>" + "<html xmlns=\"http://www.w3.org/1999/xhtml\">" + "<head><title></title></head><body>"; public static final String MATHML_HEADER_MSIE = "<html xmlns:m=\"http://www.w3.org/1998/Math/MathML\" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">" + "<head>" + "<title></title>" + "<object id=\"showEqn\" classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\">" + "<!--comment required to prevent this becoming an empty tag-->" + "</object>" + "<?import NAMESPACE=\"M\" IMPLEMENTATION=\"#showEqn\"?>" + "</head><body>"; public static final String MATHML_FOOTER_MSIE = "</body></html>"; private static final String MATHML_UTILITY_KEY = "mathml_utility_servlet"; /** * MS Internet Explorer ActiveX on client side */ private final static boolean MSIE = true; /** * Create a complete HTML page? */ private boolean fShowPage; protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); } public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // log("doPost"); String inputExpression = null; fShowPage = false; PrintWriter out = new PrintWriter(resp.getOutputStream()); MathMLUtilities utility; HttpSession session = req.getSession(true); if (session.isNew()) { //log("new session "+session.toString()); utility = new MathMLUtilities(session.getId(), MSIE); session.setAttribute(MATHML_UTILITY_KEY, utility); } else { //log("old session "+session.toString()); utility = (MathMLUtilities) session.getAttribute(MATHML_UTILITY_KEY); if (utility == null) { utility = new MathMLUtilities(session.getId(), MSIE); session.setAttribute(MATHML_UTILITY_KEY, utility); } } // get request parameters if (req.getParameterValues("expr") != null) { inputExpression = req.getParameterValues("expr")[0]; } if (req.getParameterValues("page") != null) { fShowPage = true; } if (!fShowPage) { resp.setContentType("text/xml"); } resp.setHeader("pragma", "no-cache"); if (fShowPage) { // out.println(MATHML_HEADER); out.println(MATHML_HEADER_MSIE); } utility.toMathML(inputExpression, out); if (fShowPage) { // out.println(MATHML_FOOTER); out.println(MATHML_FOOTER_MSIE); } out.close(); } public String getServletInfo() { return "MathML converter servlet"; } public void init(ServletConfig config) throws ServletException { super.init(config); } // /** Replace all // * '<' with '<', // * '>' with '>', // * '"' with '"' // * '&' with '&'. // */ // public static String htmlSpecialChars(String str) { // StringBuffer htmlString = new StringBuffer(str.length() + 50); // char c; // for (int i = 0; i < str.length(); i++) { // c = str.charAt(i); // switch (c) { // case '<' : // htmlString.append("<"); // break; // case '>' : // htmlString.append(">"); // break; // case '"' : // htmlString.append("""); // break; // case '&' : // htmlString.append("&"); // break; // default : // htmlString.append(c); // } // } // return (htmlString.toString()); // } } |
|
From: <js...@us...> - 2004-03-09 20:38:32
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/theme/hmath In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21210/WEB-INF/src/theme/hmath Added Files: blue.png Log Message: initial version --- NEW FILE: blue.png --- (This appears to be a binary file; contents omitted.) |
|
From: <js...@us...> - 2004-03-09 20:38:32
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/test/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21210/WEB-INF/src/org/hartmath/server/test/filter Added Files: WikipediaFilterTest.java ParserFilterTest.java Log Message: initial version --- NEW FILE: WikipediaFilterTest.java --- /* * This file is part of the "HMath MathML BLOG/Wiki Engine". * * Copyright (c) 2004 Klaus Hartlage All Rights Reserved. * * Please visit http://www.hmath.org/ for updates and contact. * * --LICENSE NOTICE-- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any * later version. * * This library 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 library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE-- */ package org.hartmath.server.test.filter; import junit.framework.Test; import junit.framework.TestSuite; import org.hartmath.server.filter.WikipediaFilter; import org.radeox.test.filter.FilterTestSupport; public class WikipediaFilterTest extends FilterTestSupport { public WikipediaFilterTest(String name) { super(name); } protected void setUp() throws Exception { filter = new WikipediaFilter(); super.setUp(); } public static Test suite() { return new TestSuite(WikipediaFilterTest.class); } public void testParser() { assertEquals( "test <span class=\"nobr\"><a href=\"http://www.hmath.org\">http://www.hmath.org</a></span><br/><span class=\"nobr\"><a href=\"http://www.hmath.org\">http://www.hmath.org</a></span>", filter.filter("test http://www.hmath.org<br/>http://www.hmath.org", context)); assertEquals("asssřzzz", filter.filter("asssřzzz", context)); assertEquals("a>b", filter.filter("a>b", context)); assertEquals("abc&#12345678;fgh", filter.filter("abc�fgh", context)); assertEquals("〹", filter.filter("〹", context)); assertEquals("<h2><a name=\"test_head\"> test head </a></h2>", filter.filter("== test head ==", context)); assertEquals("hhhhw\n<h3><a name=\"test_head_2\"> test head 2 </a></h3>", filter.filter("hhhhw\n=== test head 2 ===", context)); assertEquals( "<em>em test</em> <strong>strong test</strong>", filter.filter("''em test'' '''strong test'''", context)); // no wiki engine instance so give back only the scanned macro in these tests assertEquals("{macro}", filter.filter("{macro}", context)); // no wiki engine instance so give back only the scanned name assertEquals("about wikis", filter.filter("[[about wikis]]", context)); assertEquals("about wikis", filter.filter("[about wikis]", context)); // in these tests we don't handle links an dmacros: assertEquals("snipsnap-help", filter.filter("[snipsnap-help]", context)); assertEquals( "<ol class=\"roman\"><li>one\n<ol class=\"roman\"><li>two</li>\n</ol>\n</li>\n</ol>", filter.filter("i. one\nii. two", context).trim()); assertEquals("<ol><li>red\n</li><li>green</li>\n</ol>", filter.filter("1. red\n1. green", context).trim()); assertEquals( "<ul class=\"star\"><li>l1\n<ul class=\"star\"><li>l2</li>\n</ul>\n</li>\n</ul>", filter.filter("*l1\n**l2", context).trim()); // assertEquals("<strike class=\"strike\">test </strike>", filter.filter("--test --", context)); assertEquals("hello - brave gnu world", filter.filter("hello - brave gnu world", context)); assertEquals("<ul class=\"star\"><li>l1\n</li><li>l2</li>\n</ul>", filter.filter("*l1\n*l2", context).trim()); assertEquals( "<i class=\"italic\">italic <b class=\"bold\">bold <u class=\"underline\">underline</u></b></i>", filter.filter("<i>italic <B>bold <u>underline", context)); assertEquals("<hr class=\"line\"/>\r\n<hr class=\"line\"/>", filter.filter("<Hr>\r\n<hR/>", context)); assertEquals("<br/>\r\n<br/>", filter.filter("<br>\r\n<br/>", context)); assertEquals("<h1 class=\"h1\">hh</h1>", filter.filter("<h1>hh</h1>", context)); assertEquals("<strike class=\"strike\">test </strike>", filter.filter("<strike>test </strike>", context)); assertEquals( "<i class=\"italic\">italic</i> <b class=\"bold\">bold</b> <u class=\"underline\">underline</u>", filter.filter("<i>italic</i> <B>bold</B> <u>underline</u>", context)); assertEquals( "<i class=\"italic\">em test</i> <b class=\"bold\"> strong test</b>", filter.filter("~~em test~~ __ strong test__", context)); assertEquals( "<sub class=\"sub\">subtest</sub> <sup class=\"sup\">suppenTest</sup>", filter.filter("<sub>subtest</sub> <sup>suppenTest</sup>", context)); assertEquals( "<i class=\"italic\">em test</i> <b class=\"bold\"> strong test</b>", filter.filter("<em>em test</em> <strong> strong test</strong>", context)); assertEquals("__ and ~~", filter.filter("\\_\\_ and \\~\\~", context)); ((WikipediaFilter) filter).setContext(context); assertEquals( "field:expr|<expr>|snipsnap-eval|Evaluate", ((WikipediaFilter) filter).parseParameters("field:expr|$expr|snipsnap-eval|Evaluate")); } } //1 Welcome to SnipSnap {anchor:Welcome to SnipSnap}\\ //You can now login and add/edit your first post. There is a __post blog__ link //in the menu bar. For help with formatting your post take a look at //[snipsnap-help]. To create a link to a page on your site surround a word with //\[ and \]. Putting \_\_ around a phrase makes it __bold__ and putting \~\~ //around it makes the phrase ~~italics~~. You can create links to the internet //by just writing the url like http://snipsnap.org or by using \{link:Name|url\}. //So \{link:SnipSnap|\http://snipsnap.org\} produces //{link:SnipSnap|http://snipsnap.org}. Have fun. // //Pinging weblogs.com may be turned on. The //{link:FAQ|http://snipsnap.org/space/FAQ} explains how to turn this on or off. // //<i>italic</i> <b>bold</b> <u>underline</u> //<sub>subtest</sub> <sup>suppenTest</sup> //<h1>Header 1</h1> //<em>em test</em> <strong> strong test</strong> // //{mml}D[Sin[x],x]{mml} // //<br> //<br/> //<hr> //<hr/> --- NEW FILE: ParserFilterTest.java --- /* * This file is part of "SnipSnap Radeox Rendering Engine". * * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel * All Rights Reserved. * * Please visit http://radeox.org/ for updates and contact. * * --LICENSE NOTICE-- * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * --LICENSE NOTICE-- */ package org.hartmath.server.test.filter; import junit.framework.Test; import junit.framework.TestSuite; import org.hartmath.server.filter.ParserFilter; import org.radeox.test.filter.FilterTestSupport; public class ParserFilterTest extends FilterTestSupport { public ParserFilterTest(String name) { super(name); } protected void setUp() throws Exception { filter = new ParserFilter(); super.setUp(); } public static Test suite() { return new TestSuite(ParserFilterTest.class); } public void testParser() { assertEquals("<ol class=\"roman\"><li>one\n<ol class=\"roman\"><li>two</li>\n</ol>\n</li>\n</ol>", filter.filter("i. one\nii. two", context).trim()); assertEquals("<ol><li>red\n</li><li>green</li>\n</ol>", filter.filter("1. red\n1. green", context).trim()); assertEquals("<ul class=\"star\"><li>l1\n<ul class=\"star\"><li>l2</li>\n</ul>\n</li>\n</ul>", filter.filter("* l1\n** l2", context).trim()); assertEquals("<strike class=\"strike\">test </strike>", filter.filter("--test --", context)); assertEquals("hello - brave gnu world", filter.filter("hello - brave gnu world", context)); assertEquals("<ul class=\"star\"><li>l1\n</li><li>l2</li>\n</ul>", filter.filter("* l1\n* l2", context).trim()); assertEquals("<i class=\"italic\">italic <b class=\"bold\">bold <u class=\"underline\">underline</u></b></i>", filter.filter("<i>italic <B>bold <u>underline", context)); assertEquals("<hr class=\"line\"/>\r\n<hr class=\"line\"/>", filter.filter("<Hr>\r\n<hR/>", context)); assertEquals("<br/>\r\n<br/>", filter.filter("<br>\r\n<br/>", context)); assertEquals("<h1 class=\"h1\">hh</h1>", filter.filter("<h1>hh</h1>", context)); assertEquals("<strike class=\"strike\">test </strike>", filter.filter("<strike>test </strike>", context)); assertEquals("<i class=\"italic\">italic</i> <b class=\"bold\">bold</b> <u class=\"underline\">underline</u>", filter.filter("<i>italic</i> <B>bold</B> <u>underline</u>", context)); assertEquals("<i class=\"italic\">em test</i> <b class=\"bold\"> strong test</b>", filter.filter("~~em test~~ __ strong test__", context)); assertEquals("<sub class=\"sub\">subtest</sub> <sup class=\"sup\">suppenTest</sup>", filter.filter("<sub>subtest</sub> <sup>suppenTest</sup>", context)); assertEquals("<i class=\"italic\">em test</i> <b class=\"bold\"> strong test</b>", filter.filter("<em>em test</em> <strong> strong test</strong>", context)); assertEquals("__ and ~~", filter.filter("\\_\\_ and \\~\\~", context)); // in these tests we don't handle links an dmacros: assertEquals("[snipsnap-help]", filter.filter("[snipsnap-help]", context)); assertEquals("{macro}", filter.filter("{macro}", context)); assertEquals("{mml}D[Sin[x],x]{mml}", filter.filter("{mml}D[Sin[x],x]{mml}", context)); ((ParserFilter)filter).setContext(context); assertEquals("field:expr|<expr>|snipsnap-eval|Evaluate", ((ParserFilter)filter).parseParameters("field:expr|$expr|snipsnap-eval|Evaluate") ); } } //1 Welcome to SnipSnap {anchor:Welcome to SnipSnap}\\ //You can now login and add/edit your first post. There is a __post blog__ link //in the menu bar. For help with formatting your post take a look at //[snipsnap-help]. To create a link to a page on your site surround a word with //\[ and \]. Putting \_\_ around a phrase makes it __bold__ and putting \~\~ //around it makes the phrase ~~italics~~. You can create links to the internet //by just writing the url like http://snipsnap.org or by using \{link:Name|url\}. //So \{link:SnipSnap|\http://snipsnap.org\} produces //{link:SnipSnap|http://snipsnap.org}. Have fun. // //Pinging weblogs.com may be turned on. The //{link:FAQ|http://snipsnap.org/space/FAQ} explains how to turn this on or off. // //<i>italic</i> <b>bold</b> <u>underline</u> //<sub>subtest</sub> <sup>suppenTest</sup> //<h1>Header 1</h1> //<em>em test</em> <strong> strong test</strong> // //{mml}D[Sin[x],x]{mml} // //<br> //<br/> //<hr> //<hr/> |
|
From: <js...@us...> - 2004-03-09 20:38:31
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/taglib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21210/WEB-INF/src/org/hartmath/server/taglib Added Files: BrowserTag.java EvalTag.java MathMLTag.java WikiTag.java Log Message: initial version --- NEW FILE: BrowserTag.java --- package org.hartmath.server.taglib; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.BodyContent; import javax.servlet.jsp.tagext.BodyTagSupport; import org.snipsnap.app.Application; /** * Java JSP taglib interface to detect the clients browser type * */ public class BrowserTag extends BodyTagSupport { private String fType; private String fContent = null; public static String MSIE = "msie"; public static String NETSCAPE = "netscape"; /** * Returns "msie" for Internet Explorer; "netscape" otherwise * * @param request * @return */ public static String getBrowserType(HttpServletRequest request) { String userAgentString = request.getHeader("User-Agent"); String browser = new String(""); if (userAgentString != null) { if ((userAgentString.indexOf("MSIE") == -1) && (userAgentString.indexOf("msie") == -1)) { browser = NETSCAPE; } else { browser = MSIE; } } return browser; } private String getBrowserVersion(HttpServletRequest request) { String userAgentString = request.getHeader("User-Agent"); String version = new String(""); if (userAgentString != null) { if ((userAgentString.indexOf("MSIE") == -1) && (userAgentString.indexOf("msie") == -1)) { int verPos = userAgentString.indexOf("/"); if (verPos != -1) version = userAgentString.substring(verPos + 1, verPos + 5); } else { String tempStr = userAgentString.substring(userAgentString.indexOf("MSIE"), userAgentString.length()); version = tempStr.substring(4, tempStr.indexOf(";")); } } return version; } public int doAfterBody() throws JspException { // log("doPost"); BodyContent body = getBodyContent(); JspWriter out = body.getEnclosingWriter(); String bodyData = body.getString(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); // HttpSession session = request.getSession(true); String browserType = getBrowserType(request); // System.out.println(browserType); // System.out.println(fType); if (browserType.equalsIgnoreCase(fType)) { if (fContent != null) { pageContext.getResponse().setContentType(fContent+"; "+Application.get().getConfiguration().getEncoding()); } try { out.print(bodyData); } catch (IOException e) { } } return SKIP_BODY; } /** * @return */ public String getType() { return fType; } /** * @param string */ public void setType(String string) { fType = string; } /** * @return */ public String getContent() { return fContent; } /** * @param string */ public void setContent(String string) { fContent = string; } } --- NEW FILE: EvalTag.java --- package org.hartmath.server.taglib; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.BodyContent; import javax.servlet.jsp.tagext.BodyTagSupport; import org.hartmath.core.eval.EvalUtilities; /** * Java JSP taglib interface for evaluating HartMath expressions * */ public class EvalTag extends BodyTagSupport { private static final String EVAL_UTILITY_KEY = "eval_utility_taglib"; public int doAfterBody() throws JspException { // log("doPost"); BodyContent body = getBodyContent(); JspWriter out = body.getEnclosingWriter(); String inputExpression = body.getString(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); HttpSession session = request.getSession(true); if (inputExpression != null && !inputExpression.equals("")) { EvalUtilities evalUtility; if (session.isNew()) { //log("new session "+session.toString()); evalUtility = new EvalUtilities(session.getId(), true); session.setAttribute(EVAL_UTILITY_KEY, evalUtility); } else { //log("old session "+session.toString()); evalUtility = (EvalUtilities) session.getAttribute(EVAL_UTILITY_KEY); if (evalUtility == null) { evalUtility = new EvalUtilities(session.getId(), true); session.setAttribute(EVAL_UTILITY_KEY, evalUtility); } } evalUtility.toMathML(inputExpression, out); } return SKIP_BODY; } } --- NEW FILE: MathMLTag.java --- package org.hartmath.server.taglib; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.BodyContent; import javax.servlet.jsp.tagext.BodyTagSupport; import org.hartmath.core.eval.MathMLUtilities; /** * Java JSP taglib interface for the HartMath MathML converter * */ public class MathMLTag extends BodyTagSupport { private static final String MATHML_UTILITY_KEY = "mathml_utility_taglib"; public int doAfterBody() throws JspException { // log("doPost"); BodyContent body = getBodyContent(); JspWriter out = body.getEnclosingWriter(); String inputExpression = body.getString(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); HttpSession session = request.getSession(true); if (inputExpression != null && !inputExpression.equals("")) { MathMLUtilities mathmlUtility; if (session.isNew()) { //log("new session "+session.toString()); mathmlUtility = new MathMLUtilities(session.getId(), true); session.setAttribute(MATHML_UTILITY_KEY, mathmlUtility); } else { //log("old session "+session.toString()); mathmlUtility = (MathMLUtilities) session.getAttribute(MATHML_UTILITY_KEY); if (mathmlUtility == null) { mathmlUtility = new MathMLUtilities(session.getId(), true); session.setAttribute(MATHML_UTILITY_KEY, mathmlUtility); } } mathmlUtility.toMathML(inputExpression, out); } return SKIP_BODY; } } --- NEW FILE: WikiTag.java --- package org.hartmath.server.taglib; import java.io.IOException; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.BodyContent; import javax.servlet.jsp.tagext.BodyTagSupport; import org.radeox.api.engine.RenderEngine; import org.radeox.engine.BaseRenderEngine; import org.radeox.engine.context.BaseRenderContext; /** * Java JSP taglib interface for using Wiki syntax * */ public class WikiTag extends BodyTagSupport { private final static RenderEngine RADEOX_RENDER_ENGINE = new BaseRenderEngine(); private final static BaseRenderContext RADEOX_CONTEXT_ENGINE = new BaseRenderContext(); public int doAfterBody() throws JspException { // log("doPost"); BodyContent body = getBodyContent(); JspWriter out = body.getEnclosingWriter(); String inputExpression = body.getString(); if (inputExpression != null && !inputExpression.equals("")) { try { RADEOX_RENDER_ENGINE.render(out, inputExpression, RADEOX_CONTEXT_ENGINE); } catch (IOException e) { throw new JspException("IOException in JSP Wiki tag", e); } } return SKIP_BODY; } } |