KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opencms > template > I_CmsXmlContent


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/template/I_CmsXmlContent.java,v $
3 * Date : $Date: 2005/05/17 13:47:32 $
4 * Version: $Revision: 1.1 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2001 The OpenCms Group
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * For further information about OpenCms, please see the
22 * OpenCms Website: http://www.opencms.org
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */

28
29
30 package com.opencms.template;
31
32 import org.opencms.file.CmsFile;
33 import org.opencms.file.CmsObject;
34 import org.opencms.main.CmsException;
35
36 import java.io.Writer JavaDoc;
37
38 import org.w3c.dom.Document JavaDoc;
39 import org.w3c.dom.Node JavaDoc;
40
41 /**
42  * Common interface for OpenCms XML content classes.
43  * Classes for each customized content type have to be implemtented.
44  *
45  * @author Alexander Lucas
46  * @version $Revision: 1.1 $ $Date: 2005/05/17 13:47:32 $
47  *
48  * @deprecated Will not be supported past the OpenCms 6 release.
49  */

50 public interface I_CmsXmlContent extends I_CmsContent {
51     
52     /**
53      * Creates a clone of this object.
54      * @return cloned object
55      * @throws CloneNotSupportedException
56      */

57     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc;
58     
59     /**
60      * Gets the absolute filename of the XML file represented by this content class
61      * @return Absolute filename
62      */

63     public String JavaDoc getAbsoluteFilename();
64     
65     /**
66      * Gets a short filename (without path) of the XML file represented by this content class
67      * of the template file.
68      * @return filename
69      */

70     public String JavaDoc getFilename();
71     
72     /**
73      * Prints the XML parsed content to a String
74      * @return String with XML content
75      */

76     public String JavaDoc getXmlText();
77     
78     /**
79      * Prints the XML parsed content of this template file
80      * to the given Writer.
81      *
82      * @param out Writer to print to.
83      */

84     public void getXmlText(Writer JavaDoc out);
85     
86     /**
87      * Prints the XML parsed content of the given Node and
88      * its subnodes to the given Writer.
89      *
90      * @param out Writer to print to.
91      * @param n Node that should be printed.
92      */

93     public void getXmlText(Writer JavaDoc out, Node JavaDoc n);
94     
95     /**
96      * Prints the XML parsed content of a given node and
97      * its subnodes to a String
98      * @param n Node that should be printed.
99      * @return String with XML content
100      */

101     public String JavaDoc getXmlText(Node JavaDoc n);
102     
103     /**
104      * Initialize the XML content class.
105      * Load and parse the content of the given CmsFile object.
106      * @param cms CmsObject Object for accessing resources.
107      * @param file CmsFile object of the file to be loaded and parsed.
108      * @throws CmsException
109      */

110     public void init(CmsObject cms, CmsFile file) throws CmsException;
111     
112     /**
113      * Initialize the XML content class.
114      * Load and parse the file given by filename,
115      * @param cms CmsObject Object for accessing resources.
116      * @param filename Filename of the file to be loaded.
117      * @throws CmsException
118      */

119     public void init(CmsObject cms, String JavaDoc filename) throws CmsException;
120     
121     /**
122      * Initialize the class with the given parsed XML DOM document.
123      * @param cms CmsObject Object for accessing system resources.
124      * @param document DOM document object containing the parsed XML file.
125      * @param filename OpenCms filename of the XML file.
126      * @throws CmsException
127      */

128     public void init(CmsObject cms, Document JavaDoc content, String JavaDoc filename) throws CmsException;
129     
130     /**
131      * Parses the given file and stores it in the internal list of included files and
132      * appends the relevant data structures of the new file to its own structures.
133      *
134      * @param include Filename of the XML file to be included
135      * @throws CmsException
136      */

137     public A_CmsXmlContent readIncludeFile(String JavaDoc filename) throws CmsException;
138     
139     /**
140      * Writes the XML document back to the OpenCms system.
141      * @throws CmsException
142      */

143     public void write() throws CmsException;
144 }
145
Popular Tags