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: import java.util.Map;
023:
024: import org.w3c.dom.Document;
025:
026: import de.schlund.pfixcore.editor2.core.exception.EditorIOException;
027: import de.schlund.pfixcore.editor2.core.exception.EditorParsingException;
028:
029: /**
030: * Represents target objects generated by the Pustefix generator
031: *
032: * @author Sebastian Marsching <sebastian.marsching@1und1.de>
033: */
034: public interface Target {
035: /**
036: * Returns a String identifying this Target. Each name is unique within a
037: * specific project (but not within all projects)
038: *
039: * @return Name of this Target
040: */
041: String getName();
042:
043: /**
044: * Returns the type of this target. Type is either TARGET_XML or TARGET_XSL
045: *
046: * @return TARGET_XML or TARGET_XSL
047: * @see TargetType#TARGET_XML
048: * @see TargetType#TARGET_XSL
049: */
050: TargetType getType();
051:
052: /**
053: * Indicates whether this Target is a leaf target. Leaf targets do not have
054: * parents but a represented by physical files instead.
055: *
056: * @return <code>true</code> if this Target does not have any parents,
057: * <code>false</code> otherwise
058: */
059: boolean isLeafTarget();
060:
061: /**
062: * Returns XML DOM tree of this Target
063: *
064: * @return DOM Document representing the content of this Target
065: * @throws EditorIOException
066: * @throws EditorParsingException
067: */
068: Document getContentXML() throws EditorIOException,
069: EditorParsingException;
070:
071: /**
072: * Returns parent Target that provides XML for generation of this Target.
073: * Each Target (except leaf targets) has a XML parent.
074: *
075: * @return XML parent Target or <code>null</code> if this is a leaf target
076: */
077: Target getParentXML();
078:
079: /**
080: * Returns parent Target that provides XSL for generation of this Target.
081: * Each Target (except leaf targets) has a XSL parent.
082: *
083: * @return XSL parent Target or <code>null</code> if this is a leaf target
084: */
085: Target getParentXSL();
086:
087: /**
088: * Returns all auxilliary targets this Target is depending on. This list
089: * does not include the XML and XSL parent, but only those targets whose
090: * dependency is defined manually.
091: *
092: * @return All auxilliary parent targets
093: */
094: Collection<Target> getAuxDependencies();
095:
096: /**
097: * Returns all include parts this Target is depending on. The returned
098: * objects are actually of type IncludePartThemeVariant.
099: *
100: * @param recursive
101: * If set to <code>true</code> all dependendencies, including
102: * those which are dependencies of other dependencies themselves
103: * are included in the returned list
104: * @return All dependend include parts
105: * @throws EditorParsingException
106: * @see IncludePart
107: * @see IncludePartThemeVariant
108: */
109: Collection<IncludePartThemeVariant> getIncludeDependencies(
110: boolean recursive) throws EditorParsingException;
111:
112: /**
113: * Returns all images this Target is depending on.
114: *
115: * @param recursive
116: * If set to <code>true</code> all dependendencies, including
117: * those which are dependencies of other dependencies themselves
118: * are included in the returned list
119: * @return All dependend images
120: * @throws EditorParsingException
121: * @see Image
122: */
123: Collection<Image> getImageDependencies(boolean recursive)
124: throws EditorParsingException;
125:
126: /**
127: * Returns Enumeration containing all Page objects which are affected by
128: * this Target. This list is allways recursive, which means all pages which
129: * are directly or indirectly depending on this Target are returned.
130: *
131: * @return All affected pages of this Target
132: * @see Page
133: */
134: Collection<Page> getAffectedPages();
135:
136: /**
137: * Returns parameters used during generation. Map keys are parameter names,
138: * values their corresponding contents.
139: *
140: * @return Parameters used by the XSL processor
141: */
142: Map<String, Object> getParameters();
143:
144: /**
145: * Returns a list representing the themes used by this target
146: *
147: * @return List of themes used by this target
148: */
149: ThemeList getThemeList();
150:
151: /**
152: * Returns project this Target belongs to
153: *
154: * @return Project this Target is part of
155: */
156: Project getProject();
157: }
|