Return-Path: Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 30667 invoked by uid 500); 26 Apr 2000 13:49:20 -0000 Delivered-To: apmail-xml-cocoon-cvs@apache.org Received: (qmail 30664 invoked by uid 1010); 26 Apr 2000 13:49:19 -0000 Date: 26 Apr 2000 13:49:19 -0000 Message-ID: <20000426134919.30663.qmail@locus.apache.org> From: stefano@locus.apache.org To: xml-cocoon-cvs@apache.org Subject: cvs commit: xml-cocoon/src/org/apache/cocoon cocoon.properties Engine.java stefano 00/04/26 06:49:19 Modified: src/org/apache/cocoon cocoon.properties Engine.java Log: added SMIL, fixed XHTML problems and fixed problems with multiple engine instances Revision Changes Path 1.26 +11 -4 xml-cocoon/src/org/apache/cocoon/cocoon.properties Index: cocoon.properties =================================================================== RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/cocoon.properties,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- cocoon.properties 2000/04/20 22:17:06 1.25 +++ cocoon.properties 2000/04/26 13:49:19 1.26 @@ -182,6 +182,7 @@ formatter.type.text/plain = org.apache.cocoon.formatter.TextFormatter formatter.type.model/vrml = org.apache.cocoon.formatter.TextFormatter formatter.type.text/xslfo = org.apache.cocoon.formatter.FO2PDFFormatter +formatter.type.application/smil = org.apache.cocoon.formatter.XMLFormatter # You can modify the formatter's behavior by adding the following configurations # for each formatter you want to specifize. Note that even if two formatters @@ -201,8 +202,8 @@ formatter.text/html.doctype-system = http://www.w3.org/TR/REC-html40/strict.dtd # XHTML 1.0 (strict) -formatter.text/html.doctype-public = -//W3C//DTD XHTML 1.0 Strict//EN -formatter.text/html.doctype-system = xhtml1-strict.dtd +formatter.text/xhtml.doctype-public = -//W3C//DTD XHTML 1.0 Strict//EN +formatter.text/xhtml.doctype-system = xhtml1-strict.dtd # WML 1.1 formatter.text/wml.doctype-public = -//WAPFORUM//DTD WML 1.1//EN @@ -225,8 +226,14 @@ formatter.text/html/loose.MIME-type = text/html # XHTML 1.0 (transitional) -formatter.text/html.doctype-public = -//W3C//DTD XHTML 1.0 Transitional//EN -formatter.text/html.doctype-system = xhtml1-transitional.dtd +formatter.text/xhtml/loose.doctype-public = -//W3C//DTD XHTML 1.0 Transitional//EN +formatter.text/xhtml/loose.doctype-system = xhtml1-transitional.dtd + +# SMIL +formatter.application/smil.doctype-public = -//W3C//DTD HTML 4.0//EN +formatter.application/smil.doctype-system = http://www.w3.org/TR/REC-html40/strict.dtd +formatter.application/smil.MIME-type = application/smil + 1.23 +20 -13 xml-cocoon/src/org/apache/cocoon/Engine.java Index: Engine.java =================================================================== RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/Engine.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- Engine.java 2000/04/20 22:29:41 1.22 +++ Engine.java 2000/04/26 13:49:19 1.23 @@ -1,4 +1,4 @@ -/*-- $Id: Engine.java,v 1.22 2000/04/20 22:29:41 stefano Exp $ -- +/*-- $Id: Engine.java,v 1.23 2000/04/26 13:49:19 stefano Exp $ -- ============================================================================ The Apache Software License, Version 1.1 @@ -73,12 +73,12 @@ * This class implements the engine that does all the document processing. * * @author Stefano Mazzocchi - * @version $Revision: 1.22 $ $Date: 2000/04/20 22:29:41 $ + * @version $Revision: 1.23 $ $Date: 2000/04/26 13:49:19 $ */ public class Engine implements Defaults { - private static Engine instance = null; + private static Hashtable engineInstances; Configurations configurations; @@ -105,6 +105,9 @@ */ private Engine(Configurations configurations, Object context) throws Exception { + // Create the engine instance table + engineInstances = new HashTable(1, 0.90); + // Create the object manager which is both Factory and Director // and register it manager = new Manager(); @@ -194,16 +197,17 @@ */ public static Engine getInstance(Configurations confs, Object context) throws Exception { - if (instance == null) { - synchronized (Engine.class) { - if (instance == null) { - instance = new Engine(confs, context); - } - } + Engine engine = (Engine) engineInstances.get(context); + + if (engine == null) { + synchronized (Engine.class) { + engine = new Engine(confs, context); + engineInstances.put(context, engine); + } } - return instance; - } + return engine; + } /** * This is the getInstance() version that should be used by @@ -215,8 +219,11 @@ * @return Engine - instance to operate on */ public static Engine getInstance() throws Exception { - if (instance != null) return instance; - + if (!engineInstances.isEmpty()) { + // return the first engine instance found + return (Engine) engineInstances.elements().nextElement(); + } + throw new Exception("The Cocoon engine has not been initialized!"); }