001: /*
002: * This file is part of PFIXCORE.
003: *
004: * PFIXCORE is free software; you can redistribute it and/or modify
005: * it under the terms of the GNU Lesser General Public License as published by
006: * the Free Software Foundation; either version 2 of the License, or
007: * (at your option) any later version.
008: *
009: * PFIXCORE is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public License
015: * along with PFIXCORE; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: */
018:
019: package de.schlund.pfixcore.editor2.core.dom;
020:
021: import java.util.Collection;
022:
023: import org.w3c.dom.Node;
024:
025: import de.schlund.pfixcore.editor2.core.exception.EditorIOException;
026: import de.schlund.pfixcore.editor2.core.exception.EditorParsingException;
027: import de.schlund.pfixcore.editor2.core.exception.EditorSecurityException;
028:
029: /**
030: * Represents the piece of an include part containing all information
031: * corresponding to a specific theme.
032: *
033: * @author Sebastian Marsching <sebastian.marsching@1und1.de>
034: */
035: public interface IncludePartThemeVariant extends
036: Comparable<IncludePartThemeVariant> {
037: /**
038: * Returns theme of this part
039: *
040: * @return Theme this part is used for
041: */
042: Theme getTheme();
043:
044: /**
045: * Returns the include part this variant belongs to
046: *
047: * @return IncludePart for this theme specific part
048: */
049: IncludePart getIncludePart();
050:
051: /**
052: * Returns the XML Node containing the content of this InlcudePart for the
053: * selected theme
054: *
055: * @return XML Node for the given theme
056: */
057: Node getXML();
058:
059: /**
060: * Sets the content of this IncludePart for the selected theme.
061: * Does the same as {@link #setXML(Node, boolean)} with <code>indent</code>
062: * set to <code>true</code>.
063: *
064: * @param xml
065: * XML Node containing the content to save
066: * @throws EditorIOException
067: * @throws EditorParsingException
068: * @throws EditorSecurityException
069: */
070: void setXML(Node xml) throws EditorIOException,
071: EditorParsingException, EditorSecurityException;
072:
073: /**
074: * Sets the content of this IncludePart for the selected theme
075: *
076: * @param xml XML Node containing the content to save
077: * @param indent if <code>true</code> content will be saved in "pretty"
078: * format.
079: * @throws EditorIOException
080: * @throws EditorParsingException
081: * @throws EditorSecurityException
082: */
083: void setXML(Node xml, boolean indent) throws EditorIOException,
084: EditorParsingException, EditorSecurityException;
085:
086: /**
087: * Returns all include parts this IncludePart is depending on. Actually
088: * IncludePartThemeVariant objects are returned to honor the fact, that this
089: * IncludePart depends on a specific version of another IncludePart. This
090: * method returns all variants of an IncludePart this part is depending on -
091: * not just the variant for a specific ThemeList.
092: *
093: * @param recursive
094: * If set to <code>true</code> all dependendencies, including
095: * those which are dependencies of other dependencies themselves
096: * are included in the returned list
097: * @return All dependend include parts
098: * @throws EditorParsingException
099: */
100: Collection<IncludePartThemeVariant> getIncludeDependencies(
101: boolean recursive) throws EditorParsingException;
102:
103: /**
104: * Returns all images this Include is depending on. This method returns all
105: * variants of an IncludePart this part is depending on - not just the
106: * variant for a specific ThemeList.
107: *
108: * @param recursive
109: * If set to <code>true</code> all dependendencies, including
110: * those which are dependencies of other dependencies themselves
111: * are included in the returned list
112: * @return All dependend images
113: * @throws EditorParsingException
114: * @see Image
115: */
116: Collection<Image> getImageDependencies(boolean recursive)
117: throws EditorParsingException;
118:
119: /**
120: * Returns all include parts this IncludePart is depending on. Actually
121: * IncludePartThemeVariant objects are returned to honor the fact, that this
122: * IncludePart depends on a specific version of another IncludePart.
123: * This list may very depending on the target for which this part is
124: * rendererd.
125: *
126: * @param target
127: * Target to do the lookup for
128: * @param recursive
129: * If set to <code>true</code> all dependendencies, including
130: * those which are dependencies of other dependencies themselves
131: * are included in the returned list
132: * @return All dependend include parts
133: * @throws EditorParsingException
134: */
135: Collection<IncludePartThemeVariant> getIncludeDependencies(
136: Target target, boolean recursive)
137: throws EditorParsingException;
138:
139: /**
140: * Returns all images this Include is depending on.
141: * This list may depend on the given target.
142: *
143: * @param target
144: * Target to do the lookup for
145: * @param recursive
146: * If set to <code>true</code> all dependendencies, including
147: * those which are dependencies of other dependencies themselves
148: * are included in the returned list
149: * @return All dependend images
150: * @throws EditorParsingException
151: * @see Image
152: */
153: Collection<Image> getImageDependencies(Target target,
154: boolean recursive) throws EditorParsingException;
155:
156: /**
157: * Returns pages which are using this IncludePart (directly or inderectly)
158: *
159: * @return All pages depending on this IncludePart
160: * @see Page
161: */
162: Collection<Page> getAffectedPages();
163:
164: /**
165: * Returns projects which are using this IncludePart. These are all projects
166: * which contain at least one page returned by {@link #getAffectedPages()}.
167: *
168: * @return All projects using this IncludePart
169: */
170: Collection<Project> getAffectedProjects();
171:
172: /**
173: * Returns the MD5 checksum of the serialized XML code. This checksum can
174: * for example be used to check, whether the include part has been changed.
175: * If the part does not yet have any content, the special string "0" is
176: * returned.
177: *
178: * @return MD5 checksum for this part
179: */
180: String getMD5();
181: }
|