01: /*
02: * This file is part of PFIXCORE.
03: *
04: * PFIXCORE is free software; you can redistribute it and/or modify
05: * it under the terms of the GNU Lesser General Public License as published by
06: * the Free Software Foundation; either version 2 of the License, or
07: * (at your option) any later version.
08: *
09: * PFIXCORE is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public License
15: * along with PFIXCORE; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: */
19:
20: package de.schlund.pfixcore.util.basicapp.projectdom;
21:
22: import org.w3c.dom.Document;
23:
24: import de.schlund.pfixcore.util.basicapp.helper.AppValues;
25: import de.schlund.pfixcore.util.basicapp.helper.XmlUtils;
26: import de.schlund.pfixcore.util.basicapp.objects.Project;
27:
28: /**
29: * Represents the dom of the pages to be displayed
30: *
31: * @author <a href="mailto:rapude@schlund.de">Ralf Rapude</a>
32: * @version $Id: PageXmlDom.java 3302 2007-11-30 16:56:16Z jenstl $
33: */
34: public final class PageXmlDom {
35: /** The current dom */
36: private Document domDoc = null;
37: /** defines the current pagename and is a suffix for home*/
38: private int counter;
39:
40: /**
41: * Constructor initializes the Page Object
42: * and the dom for the current document
43: * @param project The current project
44: * @param domDoc the current Dom given by HandleXmlFiles
45: */
46: public PageXmlDom(Project project, Document domDoc, int counter) {
47: this .domDoc = domDoc;
48: this .counter = counter;
49: preparePage();
50: }
51:
52: private void preparePage() {
53: String pageName = AppValues.PAGEDEFAULT + counter;
54: // setting the current path
55: domDoc = XmlUtils.changeTextValues(domDoc, "theme", "Page: "
56: + pageName, false);
57: }
58:
59: /**
60: * Gives the current dom back to
61: * HandleXmlFiles
62: * @return Document The current dom
63: */
64: public Document getDom() {
65: return domDoc;
66: }
67: }
|