Merge lp:~zorba-coders/zorba/expath-http-on-json-http into lp:zorba/http-client-module

Proposed by Federico Cavalieri
Status: Merged
Merged at revision: 36
Proposed branch: lp:~zorba-coders/zorba/expath-http-on-json-http
Merge into: lp:zorba/http-client-module
Diff against target: 130 lines (+8/-55)
4 files modified
src/CMakeLists.txt (+0/-19)
src/http-client.xq (+8/-8)
src/org/CMakeLists.txt (+0/-14)
src/org/expath/CMakeLists.txt (+0/-14)
To merge this branch: bzr merge lp:~zorba-coders/zorba/expath-http-on-json-http
Reviewer Review Type Date Requested Status
Cezar Andrei Approve
Chris Hillery Approve
Review via email: mp+176996@code.launchpad.net

Commit message

Updated the expath http client to use the json http client

To post a comment you must log in.
Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Ready for review.
This is updates the expath http client to be based on the wrapper module introduced in lp:~zorba-coders/zorba/http-client-wrapper

The comments of the previous branch (outdated links, wrapper conversion module) have been addressed.

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Apparently the Expath HTTP Client queries 2 and 3 fail on the zorba demo website
(http://zorbawebsite2.my28msec.com/html/demo)

This does not seem to depend on the latest http client merge which apparently is not there yet.
Is this a known problem?

37. By Federico Cavalieri

Small documentation improvements

Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Cezar Andrei (cezar-andrei) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'src/CMakeLists.txt'
2--- src/CMakeLists.txt 2011-07-26 10:42:50 +0000
3+++ src/CMakeLists.txt 1970-01-01 00:00:00 +0000
4@@ -1,19 +0,0 @@
5-# Copyright 2006-2008 The FLWOR Foundation.
6-#
7-# Licensed under the Apache License, Version 2.0 (the "License");
8-# you may not use this file except in compliance with the License.
9-# You may obtain a copy of the License at
10-#
11-# http://www.apache.org/licenses/LICENSE-2.0
12-#
13-# Unless required by applicable law or agreed to in writing, software
14-# distributed under the License is distributed on an "AS IS" BASIS,
15-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16-# See the License for the specific language governing permissions and
17-# limitations under the License.
18-
19-# all external module libraries are generated in the directory
20-# of the corresponding .xq file
21-MESSAGE(STATUS "Add org")
22-ADD_SUBDIRECTORY(org)
23-MESSAGE(STATUS "End modules")
24
25=== renamed file 'src/org/expath/ns/CMakeLists.txt' => 'src/CMakeLists.txt'
26=== renamed file 'src/org/expath/ns/http-client.xq' => 'src/http-client.xq'
27--- src/org/expath/ns/http-client.xq 2013-06-15 19:39:40 +0000
28+++ src/http-client.xq 2013-07-25 18:50:32 +0000
29@@ -30,22 +30,22 @@
30 : <p>
31 : In general, both functions take a description of the HTTP request to make
32 : as parameter, execute the request, and return a representation of the HTTP
33- : response. For instance, in the following code snippet, we fetch the blog feed from Zorba:
34+ : response. For instance, in the following code snippet, we fetch the Zorba
35+ : home page:
36 : </p>
37 : <pre class="ace-static" ace-mode="xquery"><![CDATA[import module namespace http = "http://expath.org/ns/http-client";
38 :
39 : http:send-request(
40- : <http:request href="http://www.zorba-xquery.com/blog/feed" method="get" />
41+ : <http:request href="http://zorba.io" method="get" />
42 : )
43 : ]]></pre>
44- : <p>You can try this example <a href="http://www.zorba-xquery.com/html/demo#GKnscDSYqVadJ+CQftvnRw+LUd0=">live</a>.</p>
45 :
46 : <p>
47 : The <code>http:send-request()</code> functions are declared as sequential.
48 : Sequential functions are allowed to have side effects. For example, most probably,
49 : an HTTP POST request is a request that has side effects because it adds/changes
50 : a remote resource. Sequential functions are specified in the
51- : <a href="http://www.zorba-xquery.com/html/documentation/latest/zorba/scripting_tutorial">XQuery Scripting Extension</a>.
52+ : <a href="http://zorba.io/documentation/2.9/zorba/scripting_tutorial.html">XQuery Scripting Extension</a>.
53 : In contrast, the http:read() functions are not declared as sequential -
54 : they are declared as nondeterministic though, which
55 : means that several calls may return different results.
56@@ -97,7 +97,7 @@
57 : <a href="http://expath.org/spec/http-client#d2e491">specification</a>.
58 : </p>
59 :
60- : @author Markus Pilman
61+ : @author Federico Cavalieri, Markus Pilman
62 : @see <a href="http://www.w3.org/TR/xquery-3/#FunctionDeclns">XQuery 3.0: Function Declaration</a>
63 : @library <a href="http://curl.haxx.se/">cURL Library</a>
64 : @project EXPath/EXPath HTTP Client
65@@ -105,7 +105,7 @@
66 :)
67 module namespace http = "http://expath.org/ns/http-client";
68
69-import module namespace zorba-http = "http://www.zorba-xquery.com/modules/http-client";
70+import module namespace http-wrapper = "http://zorba.io/modules/http-client-wrapper";
71 import module namespace err = "http://expath.org/ns/error";
72
73 import module namespace tidy="http://www.zorba-xquery.com/modules/converters/html";
74@@ -152,7 +152,7 @@
75 try
76 {
77 {
78- variable $result := zorba-http:send-request($request, $href, $bodies);
79+ variable $result := http-wrapper:http-sequential-request($request, $href, $bodies);
80 http:tidy-result($result, fn:data($request/@override-media-type))
81 }
82 } catch XPTY0004 {
83@@ -223,4 +223,4 @@
84 tidy:parse($body)
85 else
86 $body
87-};
88+};
89
90=== removed directory 'src/org'
91=== removed file 'src/org/CMakeLists.txt'
92--- src/org/CMakeLists.txt 2011-10-06 08:18:34 +0000
93+++ src/org/CMakeLists.txt 1970-01-01 00:00:00 +0000
94@@ -1,14 +0,0 @@
95-# Copyright 2006-2008 The FLWOR Foundation.
96-#
97-# Licensed under the Apache License, Version 2.0 (the "License");
98-# you may not use this file except in compliance with the License.
99-# You may obtain a copy of the License at
100-#
101-# http://www.apache.org/licenses/LICENSE-2.0
102-#
103-# Unless required by applicable law or agreed to in writing, software
104-# distributed under the License is distributed on an "AS IS" BASIS,
105-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
106-# See the License for the specific language governing permissions and
107-# limitations under the License.
108-ADD_SUBDIRECTORY(expath)
109
110=== removed directory 'src/org/expath'
111=== removed file 'src/org/expath/CMakeLists.txt'
112--- src/org/expath/CMakeLists.txt 2011-10-06 08:18:34 +0000
113+++ src/org/expath/CMakeLists.txt 1970-01-01 00:00:00 +0000
114@@ -1,14 +0,0 @@
115-# Copyright 2006-2008 The FLWOR Foundation.
116-#
117-# Licensed under the Apache License, Version 2.0 (the "License");
118-# you may not use this file except in compliance with the License.
119-# You may obtain a copy of the License at
120-#
121-# http://www.apache.org/licenses/LICENSE-2.0
122-#
123-# Unless required by applicable law or agreed to in writing, software
124-# distributed under the License is distributed on an "AS IS" BASIS,
125-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126-# See the License for the specific language governing permissions and
127-# limitations under the License.
128-ADD_SUBDIRECTORY(ns)
129
130=== removed directory 'src/org/expath/ns'

Subscribers

People subscribed via source and target branches

to all changes: