KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > rm > publishing > Publishable


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19
20 package org.openharmonise.rm.publishing;
21
22
23 import org.openharmonise.rm.PopulateException;
24 import org.openharmonise.rm.resources.publishing.Template;
25 import org.w3c.dom.Element JavaDoc;
26
27
28 /**
29  * Interface to be implemented by objects which can be published
30  * by <code>WebPageEngine</code> using a HaRP representation.
31  *
32  * @author Michael Bell
33  * @version $Revision: 1.4 $
34  *
35  */

36 public interface Publishable {
37     
38     public final static String JavaDoc TAG_ERROR = "Error";
39     public static final String JavaDoc TAG_AVAILABLEOPTIONS = "AvailableOptions";
40     
41     /**
42      * Publish the object to an XML element based on the template and the state.
43      *
44      * @param template Template for publish
45      * @param output Owner XML document for the resultant element
46      * @param state State/context for this publish operation
47      * @return
48      * @throws PublishException
49      */

50     public Element JavaDoc publish(Template template, HarmoniseOutput output,
51                                     State state) throws PublishException;
52
53     /**
54      * Publish the object to an XML element based on the element argument and the state.
55      *
56      * @param topEl Element to be used as a template for the publish operation
57      * @param output Owner XML document for the resultant element
58      * @param state State/context for this publish operation
59      * @return
60      * @throws PublishException
61      */

62     public Element JavaDoc publish(Element JavaDoc topEl, HarmoniseOutput output,
63                                     State state) throws PublishException;
64
65     /**
66      * Populates the object using data conatined in XML element in the context of the state.
67      *
68      * @param xmlElement XML element containing data to populate the object with
69      * @param state State/context of the population operation
70      * @throws PublishException
71      */

72     public void populate(Element JavaDoc xmlElement, State state)
73                             throws PopulateException;
74                             
75     /**
76      * Returns the element tag name for the object.
77      * @return
78      */

79     public String JavaDoc getTagName();
80
81 }
Popular Tags