KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > dav > server > property > ranges > DAVURIRange


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * 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 JavaDoc;
26 import org.w3c.dom.Element JavaDoc;
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 JavaDoc davPropEl) throws WebDAVException {
60         super(dsi, new URIRange(),davPropEl);
61     }
62
63     /* (non-Javadoc)
64      * @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)
65      */

66     protected void addRangeDetails(Element JavaDoc rangeEl, Range range, Document JavaDoc doc)
67         throws WebDAVException {
68         Element JavaDoc restrEl =
69             doc.createElementNS(
70             NamespaceType.XML_SCHEMA.getURI(),
71                 TAG_RESTRICTION);
72         restrEl.setPrefix(NamespaceType.XML_SCHEMA.getPrefix());
73
74         restrEl.setAttributeNS(NamespaceType.XML_SCHEMA.getURI(), ATTRIB_PREFIXED_BASE, TYPE_URI);
75         
76         restrEl.setAttribute("xmlns:" + NamespaceType.XML_SCHEMA.getPrefix(), NamespaceType.XML_SCHEMA.getURI());
77
78
79         rangeEl.appendChild(restrEl);
80
81     }
82
83     /* (non-Javadoc)
84      * @see org.openharmonise.dav.server.property.ranges.DAVRange#populate(org.w3c.dom.Element)
85      */

86     public void populate(Element JavaDoc propEl) throws WebDAVException {
87         //nothing to do
88
}
89
90 }
91
Popular Tags