Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 100 lines (94 sloc) 4.948 kb
a7f2e81 added propfind and get handlers
erik authored
1 <?xml version="1.0" encoding="UTF-8"?>
2 <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
3 <meta>
4 <author>Erik Eldridge</author>
5 <description>
6 </description>
7 <sampleQuery></sampleQuery>
8 </meta>
9 <bindings>
10 <select produces="XML">
11 <inputs></inputs>
12 <execute><![CDATA[
13 response.object = function () {
14
15 //fetch 'files'
16 var query = 'select * from yql.storage where name="store://FOUBAHrTP9vFVB2k8E2jEE"',
17 results = y.xmlToJson(y.query(query).results);
18
19 //for each file in files
20 var xml = <D:multistatus xmlns:D="DAV:"/>;
21 xml.appendChild(<D:response xmlns:D="DAV:" xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
22 <D:href>/webdav/</D:href>
23 <D:propstat>
24 <D:prop>
25 <lp1:resourcetype>
26 <D:collection/>
27 </lp1:resourcetype>
28 <lp1:creationdate>2010-01-02T19:43:01Z</lp1:creationdate>
29 <lp1:getlastmodified>Sat, 02 Jan 2010 19:43:01 GMT</lp1:getlastmodified>
30 <lp1:getetag>"19013d-1000-b2283b40"</lp1:getetag>
31 <D:supportedlock>
32 <D:lockentry>
33 <D:lockscope>
34 <D:exclusive/>
35 </D:lockscope>
36 <D:locktype>
37 <D:write/>
38 </D:locktype>
39 </D:lockentry>
40 <D:lockentry>
41 <D:lockscope>
42 <D:shared/>
43 </D:lockscope>
44 <D:locktype>
45 <D:write/>
46 </D:locktype>
47 </D:lockentry>
48 </D:supportedlock>
49 <D:lockdiscovery/>
50 <D:getcontenttype>httpd/unix-directory</D:getcontenttype>
51 </D:prop>
52 <D:status>HTTP/1.1 200 OK</D:status>
53 </D:propstat>
54 </D:response>);
55
56 for (var file in results.results.result.value) {
57
58 xml.appendChild(<D:response xmlns:D="DAV:" xmlns:lp1="DAV:" xmlns:lp2="http://apache.org/dav/props/">
59 <D:href>/webdav/{file}</D:href>
60 <D:propstat>
61 <D:prop>
62 <lp1:resourcetype/>
63 <lp1:creationdate>2010-01-02T19:43:01Z</lp1:creationdate>
64 <lp1:getcontentlength>0</lp1:getcontentlength>
65 <lp1:getlastmodified>Sat, 02 Jan 2010 19:43:01 GMT</lp1:getlastmodified>
66 <lp1:getetag>"19013f-0-b2283b40"</lp1:getetag>
67 <lp2:executable>F</lp2:executable>
68 <D:supportedlock>
69 <D:lockentry>
70 <D:lockscope>
71 <D:exclusive/>
72 </D:lockscope>
73 <D:locktype>
74 <D:write/>
75 </D:locktype>
76 </D:lockentry>
77 <D:lockentry>
78 <D:lockscope>
79 <D:shared/>
80 </D:lockscope>
81 <D:locktype>
82 <D:write/>
83 </D:locktype>
84 </D:lockentry>
85 </D:supportedlock>
86 <D:lockdiscovery/>
87 <D:getcontenttype>text/plain</D:getcontenttype>
88 </D:prop>
89 <D:status>HTTP/1.1 200 OK</D:status>
90 </D:propstat>
91 </D:response>);
92
93 }
94
95 return xml;
96 }();
97 ]]></execute>
98 </select>
99 </bindings>
100 </table>
Something went wrong with that request. Please try again.