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: package de.schlund.pfixxml.config.impl;
20:
21: import de.schlund.pfixxml.config.AbstractXMLServletConfig;
22:
23: public class AbstractXMLServletConfigImpl extends
24: ServletManagerConfigImpl implements AbstractXMLServletConfig {
25:
26: private String servletName;
27:
28: private String dependFile;
29:
30: private boolean editMode;
31:
32: private boolean editModeSet = false;
33:
34: public void setServletName(String value) {
35: this .servletName = value;
36: }
37:
38: /* (non-Javadoc)
39: * @see de.schlund.pfixxml.config.IAbstractXMLServletConfig#getServletName()
40: */
41: public String getServletName() {
42: return this .servletName;
43: }
44:
45: public void setDependFile(String value) {
46: this .dependFile = value;
47: }
48:
49: /* (non-Javadoc)
50: * @see de.schlund.pfixxml.config.IAbstractXMLServletConfig#getDependFile()
51: */
52: public String getDependFile() {
53: return this .dependFile;
54: }
55:
56: public void setEditMode(boolean b) {
57: this .editMode = b;
58: this .editModeSet = true;
59: }
60:
61: /* (non-Javadoc)
62: * @see de.schlund.pfixxml.config.IAbstractXMLServletConfig#isEditMode()
63: */
64: public boolean isEditMode() {
65: // We have to take care to handle the case where the editmode is
66: // simply not set for the current servlet. Then we should skip
67: // to reading the central property.
68: if (this .editModeSet) {
69: return this .editMode;
70: } else {
71: String prop = this .getProperties().getProperty(
72: "xmlserver.noeditmodeallowed");
73: if (prop != null && prop.equalsIgnoreCase("false")) {
74: return true;
75: } else {
76: return false;
77: }
78: }
79: }
80:
81: }
|