01: /*
02: * The contents of this file are subject to the
03: * Mozilla Public License Version 1.1 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
06: *
07: * Software distributed under the License is distributed on an "AS IS"
08: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
09: * 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: import org.openharmonise.rm.PopulateException;
23: import org.openharmonise.rm.resources.publishing.Template;
24: import org.w3c.dom.Element;
25:
26: /**
27: * Interface to be implemented by objects which can be published
28: * by <code>WebPageEngine</code> using a HaRP representation.
29: *
30: * @author Michael Bell
31: * @version $Revision: 1.4 $
32: *
33: */
34: public interface Publishable {
35:
36: public final static String TAG_ERROR = "Error";
37: public static final String TAG_AVAILABLEOPTIONS = "AvailableOptions";
38:
39: /**
40: * Publish the object to an XML element based on the template and the state.
41: *
42: * @param template Template for publish
43: * @param output Owner XML document for the resultant element
44: * @param state State/context for this publish operation
45: * @return
46: * @throws PublishException
47: */
48: public Element publish(Template template, HarmoniseOutput output,
49: State state) throws PublishException;
50:
51: /**
52: * Publish the object to an XML element based on the element argument and the state.
53: *
54: * @param topEl Element to be used as a template for the publish operation
55: * @param output Owner XML document for the resultant element
56: * @param state State/context for this publish operation
57: * @return
58: * @throws PublishException
59: */
60: public Element publish(Element topEl, HarmoniseOutput output,
61: State state) throws PublishException;
62:
63: /**
64: * Populates the object using data conatined in XML element in the context of the state.
65: *
66: * @param xmlElement XML element containing data to populate the object with
67: * @param state State/context of the population operation
68: * @throws PublishException
69: */
70: public void populate(Element xmlElement, State state)
71: throws PopulateException;
72:
73: /**
74: * Returns the element tag name for the object.
75: * @return
76: */
77: public String getTagName();
78:
79: }
|