01: /*
02: * The contents of this file are subject to the
03: * Mozilla Public License Version 1.1 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
06: *
07: * Software distributed under the License is distributed on an "AS IS"
08: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
09: * See the License for the specific language governing rights and
10: * limitations under the License.
11: *
12: * The Initial Developer of the Original Code is Simulacra Media Ltd.
13: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14: *
15: * All Rights Reserved.
16: *
17: * Contributor(s):
18: */
19:
20: package org.openharmonise.dav.server.property.ranges;
21:
22: import org.openharmonise.commons.dsi.*;
23: import org.openharmonise.commons.xml.namespace.*;
24: import org.openharmonise.rm.resources.metadata.properties.ranges.*;
25: import org.w3c.dom.Document;
26: import org.w3c.dom.Element;
27:
28: import com.ibm.webdav.WebDAVException;
29:
30: /**
31: * A subclass of <code>DAVRange</code> which handles
32: * URI property ranges.
33: *
34: * @author Michael Bell
35: * @version $Revision: 1.2 $
36: * @since November 20, 2003
37: */
38: public class DAVURIRange extends DAVRange {
39:
40: /**
41: * @param dsi
42: */
43: public DAVURIRange(AbstractDataStoreInterface dsi) {
44: super (dsi, new URIRange());
45: }
46:
47: /**
48: * @param dsi
49: * @param range
50: */
51: public DAVURIRange(AbstractDataStoreInterface dsi, Range range) {
52: super (dsi, range);
53: }
54:
55: /**
56: * @param dsi
57: * @param davPropEl
58: */
59: public DAVURIRange(AbstractDataStoreInterface dsi, Element davPropEl)
60: throws WebDAVException {
61: super (dsi, new URIRange(), davPropEl);
62: }
63:
64: /* (non-Javadoc)
65: * @see org.openharmonise.dav.server.property.ranges.DAVRange#addRangeDetails(org.w3c.dom.Element, org.openharmonise.rm.resources.metadata.properties.ranges.Range, org.w3c.dom.Document)
66: */
67: protected void addRangeDetails(Element rangeEl, Range range,
68: Document doc) throws WebDAVException {
69: Element restrEl = doc.createElementNS(NamespaceType.XML_SCHEMA
70: .getURI(), TAG_RESTRICTION);
71: restrEl.setPrefix(NamespaceType.XML_SCHEMA.getPrefix());
72:
73: restrEl.setAttributeNS(NamespaceType.XML_SCHEMA.getURI(),
74: ATTRIB_PREFIXED_BASE, TYPE_URI);
75:
76: restrEl.setAttribute("xmlns:"
77: + NamespaceType.XML_SCHEMA.getPrefix(),
78: NamespaceType.XML_SCHEMA.getURI());
79:
80: rangeEl.appendChild(restrEl);
81:
82: }
83:
84: /* (non-Javadoc)
85: * @see org.openharmonise.dav.server.property.ranges.DAVRange#populate(org.w3c.dom.Element)
86: */
87: public void populate(Element propEl) throws WebDAVException {
88: //nothing to do
89: }
90:
91: }
|