KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > cofax > TemplateProcessor


1 /*
2  * TemplateProcessor is part of the Cofax content management system library.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Please see http://www.cofax.org for contact information and other related informaion.
19  *
20  * $Header: /cvsroot/cofax/cofax/src/org/cofax/TemplateProcessor.java,v 1.5.2.1 2006/12/11 16:28:43 fxrobin Exp $
21  */

22
23 package org.cofax;
24
25 import java.util.*;
26
27 /**
28  * Cofax's top level template processor class. Cofax compatible Template
29  * processors implement this interface. WysiwygTemplate is one example of a
30  * template processing class. XSLTemplate will be used to process Cofax data
31  * with XSL templates. Other template processors can be plugged in to be used
32  * with other template systems and/or conventions. Custom template handlers
33  * compliant to this API can be easily written to work with a site's legacy
34  * template conventions.
35  *
36  * <p>
37  * <code>TemplateProcessor</code> classes are listed in the configuration and
38  * loaded dynamically.
39  * </p>
40  *
41  * @author Rajiv Pant
42  * @author Karl Martino
43  * @author Sam Cohen
44  * @version 1.9.6
45  *
46  */

47
48 public abstract class TemplateProcessor {
49
50     private CofaxPage page;
51
52     private CofaxPage template;
53
54     private HashMap glossary;
55
56     private DataStore db;
57
58     public abstract void setPage(CofaxPage inPage);
59
60     public abstract void setTemplate(CofaxPage inTemplate);
61
62     public abstract boolean applyTemplate();
63
64     public abstract String JavaDoc applyTemplate(StringBuffer JavaDoc template, HashMap glossary);
65
66     /**
67      * Outputs this class's configuration
68      */

69     public String JavaDoc toString() {
70         return "Instance Of: " + getClass().getName();
71     }
72
73 } // end abstract class TemplateProcessor
74
Popular Tags