Mercurial > hg > digilib-old
annotate xul/content/rdfds.js @ 293:126684ac4a37
Servlet version 1.5.0b -- the beginning of the next generation :-)
- code restructuring to improve scaleability
- new Initialiser servlet that must be run first
- image transformation work moved to DigilibImageWorker class
- Maximum number of concurrent threads limited by Semaphore
- old JIMI toolkit implementation removed
author | robcast |
---|---|
date | Sun, 24 Oct 2004 20:23:49 +0200 |
parents | bf945fcf9105 |
children |
rev | line source |
---|---|
203
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
2 * The contents of this file are subject to the Mozilla Public |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
3 * License Version 1.1 (the "License"); you may not use this file |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
4 * except in compliance with the License. You may obtain a copy of |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
5 * the License at http://www.mozilla.org/MPL/ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
6 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
7 * Software distributed under the License is distributed on an "AS |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
9 * implied. See the License for the specific language governing |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
10 * rights and limitations under the License. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
11 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
12 * The Original Code is rdfds |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
13 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
14 * The Initial Developer of the Original Code is Neil Deakin |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
15 * Portions created by Neil Deakin are Copyright (C) 2002 Neil Deakin. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
16 * All Rights Reserved. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
17 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
18 * Contributor(s): |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
19 */ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
20 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
21 /* This is a library for easier access to RDF datasources and resources. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
22 * It contains four objects, RDFDataSource, RDFNode, RDFLiteral. and |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
23 * RDFEnumerator. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
24 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
25 * An RDF DataSource is a graph of nodes and literals. The constructor |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
26 * for RDFDataSource takes one argument, a URI of an RDF file to use. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
27 * If the URI exists, the contents of the RDF file are loaded. If it |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
28 * does not exist, resources can be added to it and then written using |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
29 * this save method. If the URL argument is null, a blank datasource |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
30 * is created. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
31 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
32 * This library is designed for convenience not for efficiency. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
33 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
34 * The API is documented at: |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
35 * http://www.xulplanet.com/tutorials/xultu/rdfds/ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
36 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
37 * Example: |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
38 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
39 * var ds=new RDFDataSource("file:///main/mozilla/mimtest.rdf"); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
40 * var node=ds.getNode("urn:xpimaker:packlist"); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
41 * var child=ds.getNode("urn:xpimaker:packlist:appinfo"); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
42 * child=node.addChild(child); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
43 * child.addTarget("http://www.xulplanet.com/rdf/xpimaker#appname","Find Files"); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
44 * ds.save(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
45 * |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
46 */ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
47 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
48 var RDFService = "@mozilla.org/rdf/rdf-service;1"; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
49 RDFService = Components.classes[RDFService].getService(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
50 RDFService = RDFService.QueryInterface(Components.interfaces.nsIRDFService); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
51 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
52 var RDFContainerUtilsService = "@mozilla.org/rdf/container-utils;1"; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
53 RDFContainerUtilsService = Components.classes[RDFContainerUtilsService].getService(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
54 RDFContainerUtilsService = RDFContainerUtilsService.QueryInterface(Components.interfaces.nsIRDFContainerUtils); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
55 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
56 /* RDFLoadObserver |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
57 * this object is necessary to listen to RDF files being loaded. The Init |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
58 * function should be called to initialize the callback when the RDF file is |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
59 * loaded. |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
60 */ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
61 function RDFLoadObserver(){} |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
62 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
63 RDFLoadObserver.prototype = |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
64 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
65 callback: null, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
66 callbackDataSource: null, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
67 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
68 Init: function(c,cDS){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
69 this.callback=c; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
70 this.callbackDataSource=cDS; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
71 }, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
72 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
73 QueryInterface: function(iid){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
74 if (iid.equals(Components.interfaces.nsIRDFXMLSinkObserver)) return this; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
75 else throw Components.results.NS_ERROR_NO_INTERFACE; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
76 }, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
77 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
78 onBeginLoad : function(sink){}, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
79 onInterrupt : function(sink){}, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
80 onResume : function(sink){}, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
81 onError : function(sink,status,msg){}, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
82 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
83 onEndLoad : function(sink){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
84 if (this.callback!=null) this.callback(this.callbackDataSource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
85 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
86 }; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
87 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
88 function RDFDataSource(uri,callbackFn) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
89 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
90 if (uri==null) this.datasource=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
91 else this.load(uri,callbackFn); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
92 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
93 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
94 RDFDataSource.prototype.load= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
95 function(uri,callbackFn) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
96 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
97 if (uri.indexOf(":") == -1){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
98 var docurl=document.location.href; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
99 if (document.location.pathname == null) uri=docurl+"/"+uri; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
100 else uri=docurl.substring(0,docurl.lastIndexOf("/")+1)+uri; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
101 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
102 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
103 if (callbackFn == null){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
104 this.datasource=RDFService.GetDataSourceBlocking(uri); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
105 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
106 else { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
107 this.datasource=RDFService.GetDataSource(uri); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
108 var ds; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
109 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
110 var ds=this.datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
111 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
112 catch (ex){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
113 callbackFn(this); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
114 return; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
115 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
116 if (ds.loaded){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
117 callbackFn(this); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
118 return; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
119 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
120 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
121 var packObserver=new RDFLoadObserver(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
122 packObserver.Init(callbackFn,this); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
123 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
124 var rawsource=this.datasource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
125 rawsource=rawsource.QueryInterface(Components.interfaces.nsIRDFXMLSink); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
126 rawsource.addXMLSinkObserver(packObserver); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
127 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
128 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
129 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
130 RDFDataSource.prototype.Init= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
131 function (dsource) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
132 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
133 this.datasource=dsource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
134 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
135 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
136 RDFDataSource.prototype.parseFromString= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
137 function (str,baseUri) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
138 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
139 if (this.datasource==null) this.makeemptyds(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
140 var ios=Components.classes["@mozilla.org/network/io-service;1"] |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
141 .getService(Components.interfaces.nsIIOService); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
142 baseUri=ios.newURI(baseUri,null,null); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
143 var xmlParser=Components.classes["@mozilla.org/rdf/xml-parser;1"] |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
144 .createInstance(Components.interfaces.nsIRDFXMLParser); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
145 xmlParser.parseString(this.datasource,baseUri,str); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
146 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
147 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
148 RDFDataSource.prototype.serializeToString= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
149 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
150 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
151 var outputStream = { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
152 data: "", |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
153 close : function(){}, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
154 flush : function(){}, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
155 write : function (buffer,count){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
156 this.data += buffer; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
157 return count; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
158 }, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
159 writeFrom : function (stream,count){}, |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
160 isNonBlocking: false |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
161 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
162 this.serializeToStream(outputStream); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
163 return outputStream.data; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
164 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
165 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
166 RDFDataSource.prototype.serializeToStream= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
167 function (outputStream) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
168 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
169 var ser=Components.classes["@mozilla.org/rdf/xml-serializer;1"] |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
170 .createInstance(Components.interfaces.nsIRDFXMLSerializer); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
171 ser.init(this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
172 ser.QueryInterface(Components.interfaces.nsIRDFXMLSource).Serialize(outputStream); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
173 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
174 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
175 RDFDataSource.prototype.makeemptyds= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
176 function (uri) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
177 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
178 this.datasource=Components.classes["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"] |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
179 .createInstance(Components.interfaces.nsIRDFDataSource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
180 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
181 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
182 RDFDataSource.prototype.getAllResources= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
183 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
184 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
185 if (this.datasource==null) return null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
186 return new RDFEnumerator(this.datasource.GetAllResources(),this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
187 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
188 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
189 RDFDataSource.prototype.getRawDataSource= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
190 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
191 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
192 if (this.datasource==null) this.makeemptyds(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
193 return this.datasource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
194 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
195 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
196 RDFDataSource.prototype.getNode= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
197 function (uri) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
198 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
199 if (this.datasource==null) this.makeemptyds(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
200 var node=new RDFNode(uri,this); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
201 return node; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
202 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
203 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
204 RDFDataSource.prototype.getAnonymousNode= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
205 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
206 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
207 if (this.datasource==null) this.makeemptyds(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
208 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
209 var anon=RDFService.GetAnonymousResource(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
210 var node=new RDFNode(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
211 node.Init(anon,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
212 return node; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
213 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
214 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
215 RDFDataSource.prototype.getLiteral= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
216 function (uri) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
217 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
218 if (this.datasource==null) this.makeemptyds(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
219 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
220 return new RDFLiteral(uri,this); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
221 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
222 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
223 RDFDataSource.prototype.refresh= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
224 function (sync) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
225 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
226 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
227 var ds=this.datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
228 ds.Refresh(sync); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
229 return true; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
230 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
231 catch (ex){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
232 return false; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
233 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
234 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
235 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
236 RDFDataSource.prototype.save= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
237 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
238 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
239 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
240 var ds=this.datasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
241 ds.Flush(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
242 return true; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
243 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
244 catch (ex){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
245 return false; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
246 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
247 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
248 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
249 RDFDataSource.prototype.copyAllToDataSource= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
250 function (dsource2) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
251 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
252 if (this.datasource==null) this.makeemptyds(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
253 if (dsource2.datasource==null) dsource2.makeemptyds(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
254 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
255 var dsource1=this.datasource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
256 dsource2=dsource2.datasource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
257 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
258 var sourcelist=dsource1.GetAllResources(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
259 while(sourcelist.hasMoreElements()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
260 var source=sourcelist.getNext(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
261 var props=dsource1.ArcLabelsOut(source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
262 while(props.hasMoreElements()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
263 var prop=props.getNext(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
264 prop=prop.QueryInterface(Components.interfaces.nsIRDFResource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
265 var target=dsource1.GetTarget(source,prop,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
266 if (target!=null) dsource2.Assert(source,prop,target,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
267 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
268 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
269 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
270 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
271 RDFDataSource.prototype.deleteRecursive= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
272 function (val) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
273 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
274 var node; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
275 var dsource=this.datasource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
276 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
277 if (dsource==null) return; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
278 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
279 if (typeof val == "string") node=RDFService.GetResource(val); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
280 else node=val.source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
281 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
282 this.deleteRecursiveH(dsource,node); // remove descendants |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
283 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
284 // remove the node itself |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
285 var props=dsource.ArcLabelsIn(node); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
286 while(props.hasMoreElements()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
287 var prop=props.getNext(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
288 var source=dsource.GetSource(prop,node,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
289 dsource.Unassert(source,prop,node); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
290 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
291 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
292 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
293 RDFDataSource.prototype.deleteRecursiveH= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
294 function (dsource,node) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
295 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
296 var props=dsource.ArcLabelsOut(node); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
297 while(props.hasMoreElements()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
298 var prop=props.getNext(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
299 var target=dsource.GetTarget(node,prop,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
300 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
301 target=target.QueryInterface(Components.interfaces.nsIRDFResource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
302 this.deleteRecursiveH(dsource,target); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
303 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
304 catch (e){} |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
305 dsource.Unassert(node,prop,target) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
306 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
307 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
308 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
309 function RDFNode(uri,dsource) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
310 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
311 if (uri==null) this.source=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
312 else this.source=RDFService.GetResource(uri); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
313 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
314 if (dsource==null) this.datasource=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
315 else this.datasource=dsource.datasource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
316 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
317 this.container=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
318 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
319 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
320 RDFNode.prototype.Init= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
321 function (source,dsource) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
322 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
323 this.source=source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
324 this.datasource=dsource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
325 this.container=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
326 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
327 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
328 RDFNode.prototype.getValue= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
329 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
330 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
331 return this.source.Value; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
332 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
333 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
334 RDFNode.prototype.rlify= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
335 function (val) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
336 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
337 var res=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
338 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
339 if (val!=null){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
340 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
341 val=val.QueryInterface(Components.interfaces.nsIRDFResource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
342 res=new RDFNode(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
343 res.Init(val,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
344 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
345 catch (ex){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
346 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
347 val=val.QueryInterface(Components.interfaces.nsIRDFLiteral); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
348 res=new RDFLiteral(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
349 res.Init(val,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
350 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
351 catch (ex2){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
352 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
353 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
354 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
355 return res; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
356 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
357 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
358 RDFNode.prototype.makeres= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
359 function (val) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
360 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
361 if (typeof val == "string") return RDFService.GetResource(val); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
362 else return val.source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
363 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
364 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
365 RDFNode.prototype.makelit= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
366 function (val) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
367 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
368 if (typeof val == "string") return RDFService.GetLiteral(val); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
369 else return val.source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
370 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
371 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
372 RDFNode.prototype.makecontain= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
373 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
374 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
375 if (this.container!=null) return true; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
376 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
377 var RDFContainer = '@mozilla.org/rdf/container;1'; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
378 RDFContainer = Components.classes[RDFContainer].createInstance(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
379 RDFContainer = RDFContainer.QueryInterface(Components.interfaces.nsIRDFContainer); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
380 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
381 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
382 RDFContainer.Init(this.datasource,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
383 this.container=RDFContainer; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
384 return true; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
385 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
386 catch (ex){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
387 return false; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
388 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
389 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
390 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
391 RDFNode.prototype.addTarget= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
392 function (prop,target) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
393 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
394 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
395 target=this.makelit(target); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
396 this.datasource.Assert(this.source,prop,target,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
397 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
398 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
399 RDFNode.prototype.addTargetOnce= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
400 function (prop,target) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
401 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
402 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
403 target=this.makelit(target); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
404 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
405 var oldtarget=this.datasource.GetTarget(this.source,prop,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
406 if (oldtarget!=null){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
407 this.datasource.Change(this.source,prop,oldtarget,target); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
408 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
409 else { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
410 this.datasource.Assert(this.source,prop,target,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
411 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
412 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
413 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
414 RDFNode.prototype.modifyTarget= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
415 function (prop,oldtarget,newtarget) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
416 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
417 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
418 oldtarget=this.makelit(oldtarget); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
419 newtarget=this.makelit(newtarget); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
420 this.datasource.Change(this.source,prop,oldtarget,newtarget); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
421 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
422 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
423 RDFNode.prototype.modifySource= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
424 function (prop,oldsource,newsource) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
425 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
426 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
427 oldsource=this.makeres(oldsource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
428 newsource=this.makeres(newsource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
429 this.datasource.Move(oldsource,newsource,prop,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
430 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
431 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
432 RDFNode.prototype.targetExists= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
433 function (prop,target) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
434 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
435 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
436 target=this.makelit(target); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
437 return this.datasource.HasAssertion(this.source,prop,target,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
438 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
439 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
440 RDFNode.prototype.removeTarget= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
441 function (prop,target) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
442 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
443 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
444 target=this.makelit(target); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
445 this.datasource.Unassert(this.source,prop,target); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
446 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
447 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
448 RDFNode.prototype.getProperties= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
449 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
450 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
451 return new RDFEnumerator(this.datasource.ArcLabelsOut(this.source),this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
452 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
453 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
454 RDFNode.prototype.getInProperties= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
455 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
456 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
457 return new RDFEnumerator(this.datasource.ArcLabelsIn(this.source),this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
458 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
459 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
460 RDFNode.prototype.propertyExists= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
461 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
462 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
463 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
464 return this.datasource.hasArcOut(this.source,prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
465 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
466 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
467 RDFNode.prototype.inPropertyExists= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
468 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
469 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
470 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
471 return this.datasource.hasArcIn(this.source,prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
472 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
473 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
474 RDFNode.prototype.getTarget= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
475 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
476 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
477 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
478 return this.rlify(this.datasource.GetTarget(this.source,prop,true)); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
479 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
480 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
481 RDFNode.prototype.getSource= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
482 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
483 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
484 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
485 var src=this.datasource.GetSource(prop,this.source,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
486 if (src==null) return null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
487 var res=new RDFNode(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
488 res.Init(src,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
489 return res; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
490 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
491 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
492 RDFNode.prototype.getTargets= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
493 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
494 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
495 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
496 return new RDFEnumerator( |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
497 this.datasource.GetTargets(this.source,prop,true),this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
498 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
499 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
500 RDFNode.prototype.getSources= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
501 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
502 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
503 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
504 return new RDFEnumerator( |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
505 this.datasource.GetSources(prop,this.source,true),this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
506 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
507 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
508 RDFNode.prototype.makeBag= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
509 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
510 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
511 this.container=RDFContainerUtilsService.MakeBag(this.datasource,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
512 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
513 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
514 RDFNode.prototype.makeSeq= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
515 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
516 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
517 this.container=RDFContainerUtilsService.MakeSeq(this.datasource,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
518 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
519 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
520 RDFNode.prototype.makeAlt= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
521 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
522 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
523 this.container=RDFContainerUtilsService.MakeAlt(this.datasource,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
524 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
525 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
526 RDFNode.prototype.isBag= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
527 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
528 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
529 return RDFContainerUtilsService.isBag(this.datasource,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
530 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
531 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
532 RDFNode.prototype.isSeq= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
533 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
534 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
535 return RDFContainerUtilsService.isSeq(this.datasource,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
536 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
537 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
538 RDFNode.prototype.isAlt= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
539 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
540 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
541 return RDFContainerUtilsService.isAlt(dsource,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
542 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
543 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
544 RDFNode.prototype.isContainer= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
545 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
546 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
547 return RDFContainerUtilsService.IsContainer(this.datasource,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
548 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
549 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
550 RDFNode.prototype.getChildCount= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
551 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
552 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
553 if (this.makecontain()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
554 return this.container.GetCount(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
555 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
556 return -1; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
557 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
558 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
559 RDFNode.prototype.getChildren= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
560 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
561 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
562 if (this.makecontain()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
563 return new RDFEnumerator(this.container.GetElements(),this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
564 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
565 else return null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
566 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
567 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
568 RDFNode.prototype.addChild= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
569 function (child,exists) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
570 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
571 if (this.makecontain()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
572 var childres=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
573 if (typeof child == "string"){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
574 childres=RDFService.GetResource(child); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
575 child=new RDFNode(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
576 child.Init(childres,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
577 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
578 else childres=child.source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
579 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
580 if (!exists && this.container.IndexOf(childres)>=0) return child; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
581 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
582 this.container.AppendElement(childres); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
583 return child; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
584 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
585 else return null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
586 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
587 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
588 RDFNode.prototype.addChildAt= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
589 function (child,idx) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
590 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
591 if (this.makecontain()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
592 var childres=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
593 if (typeof child == "string"){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
594 childres=RDFService.GetResource(child); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
595 child=new RDFNode(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
596 child.Init(childres,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
597 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
598 else childres=child.source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
599 this.container.InsertElementAt(childres,idx,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
600 return child; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
601 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
602 else return null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
603 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
604 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
605 RDFNode.prototype.removeChild= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
606 function (child) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
607 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
608 if (this.makecontain()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
609 var childres=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
610 if (typeof child == "string"){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
611 childres=RDFService.GetResource(child); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
612 child=new RDFNode(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
613 child.Init(childres,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
614 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
615 else childres=child.source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
616 this.container.RemoveElement(childres,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
617 return child; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
618 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
619 else return null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
620 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
621 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
622 RDFNode.prototype.removeChildAt= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
623 function (idx) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
624 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
625 if (this.makecontain()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
626 var childres=this.container.RemoveElementAt(idx,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
627 return this.rlify(childres); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
628 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
629 else return null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
630 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
631 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
632 RDFNode.prototype.getChildIndex= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
633 function (child) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
634 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
635 if (this.makecontain()){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
636 return this.container.IndexOf(child.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
637 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
638 else return -1; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
639 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
640 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
641 RDFNode.prototype.type="Node"; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
642 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
643 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
644 function RDFLiteral(val,dsource) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
645 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
646 if (val==null) this.source=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
647 else this.source=RDFService.GetLiteral(val); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
648 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
649 if (dsource==null) this.datasource=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
650 else this.datasource=dsource.datasource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
651 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
652 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
653 RDFLiteral.prototype.Init= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
654 function (source,dsource) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
655 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
656 this.source=source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
657 this.datasource=dsource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
658 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
659 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
660 RDFLiteral.prototype.getValue= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
661 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
662 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
663 return this.source.Value; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
664 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
665 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
666 RDFLiteral.prototype.makeres= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
667 function (val) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
668 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
669 if (typeof val == "string") return RDFService.GetResource(val); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
670 else return val.source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
671 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
672 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
673 RDFLiteral.prototype.makelit= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
674 function (val) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
675 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
676 if (typeof val == "string") return RDFService.GetLiteral(val); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
677 else return val.source; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
678 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
679 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
680 RDFLiteral.prototype.modifySource= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
681 function (prop,oldsource,newsource) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
682 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
683 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
684 oldsource=this.makeres(oldsource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
685 newsource=this.makeres(newsource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
686 this.datasource.Move(oldsource,newsource,prop,this.source); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
687 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
688 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
689 RDFLiteral.prototype.getInProperties= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
690 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
691 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
692 return new RDFEnumerator(this.datasource.ArcLabelsIn(this.source),this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
693 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
694 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
695 RDFLiteral.prototype.inPropertyExists= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
696 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
697 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
698 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
699 return this.datasource.hasArcIn(this.source,prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
700 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
701 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
702 RDFLiteral.prototype.getSource= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
703 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
704 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
705 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
706 var src=this.datasource.GetSource(prop,this.source,true); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
707 if (src==null) return null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
708 var res=new RDFNode(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
709 res.Init(src,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
710 return res; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
711 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
712 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
713 RDFLiteral.prototype.getSources= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
714 function (prop) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
715 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
716 prop=this.makeres(prop); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
717 return new RDFEnumerator( |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
718 this.datasource.GetSources(prop,this.source,true),this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
719 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
720 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
721 RDFLiteral.prototype.type="Literal"; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
722 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
723 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
724 function RDFEnumerator(enumeration,dsource) |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
725 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
726 this.enumeration=enumeration; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
727 this.datasource=dsource; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
728 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
729 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
730 RDFEnumerator.prototype.hasMoreElements= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
731 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
732 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
733 return this.enumeration.hasMoreElements(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
734 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
735 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
736 RDFEnumerator.prototype.getNext= |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
737 function () |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
738 { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
739 var res=null; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
740 var val=this.enumeration.getNext(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
741 |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
742 if (val!=null){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
743 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
744 val=val.QueryInterface(Components.interfaces.nsIRDFResource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
745 res=new RDFNode(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
746 res.Init(val,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
747 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
748 catch (ex){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
749 try { |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
750 val=val.QueryInterface(Components.interfaces.nsIRDFLiteral); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
751 res=new RDFLiteral(); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
752 res.Init(val,this.datasource); |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
753 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
754 catch (ex2){ |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
755 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
756 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
757 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
758 return res; |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
759 } |
bf945fcf9105
restarting with version control of xul sidebar/toolbar
luginbue
parents:
diff
changeset
|
760 |