01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.jetspeed.page.document.impl;
18:
19: import org.apache.jetspeed.om.page.Document;
20: import org.apache.jetspeed.om.page.impl.SecurityConstraintsImpl;
21:
22: /**
23: * DocumentImpl
24: *
25: * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
26: * @version $Id$
27: */
28: public abstract class DocumentImpl extends NodeImpl implements Document {
29: private String version;
30:
31: private boolean dirty = false;
32:
33: public DocumentImpl(SecurityConstraintsImpl constraints) {
34: super (constraints);
35: }
36:
37: /* (non-Javadoc)
38: * @see org.apache.jetspeed.om.page.BaseElement#getTitle()
39: */
40: public String getTitle() {
41: // default title to document name
42: String title = super .getTitle();
43: if (title == null) {
44: title = defaultTitleFromName();
45: setTitle(title);
46: }
47: return title;
48: }
49:
50: /* (non-Javadoc)
51: * @see org.apache.jetspeed.om.page.Document#setVersion()
52: */
53: public String getVersion() {
54: return version;
55: }
56:
57: /* (non-Javadoc)
58: * @see org.apache.jetspeed.om.page.Document#setVersion(java.lang.String)
59: */
60: public void setVersion(String version) {
61: this .version = version;
62: }
63:
64: public boolean isDirty() {
65: return dirty;
66: }
67:
68: public void setDirty(boolean dirty) {
69: this.dirty = dirty;
70: }
71:
72: }
|