[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-25 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-25 Thread Zorba Build Bot
Voting criteria failed for the following merge proposals:

https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579 :
Votes: {'Approve': 2, 'Needs commit message': 1}
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-25 Thread Federico Cavalieri
The proposal to merge lp:~zorba-coders/zorba/json-http-module into lp:zorba has 
been updated.

Commit Message changed to:

Added JSON HTTP client module.
Fixed initialization, error reporting and encoding bugs in the XML HTTP client.
Reimplemented XML HTTP client on top of the JSON HTTP client module.

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-25 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-25 Thread Zorba Build Bot
Validation queue result for 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Stage CommitZorba failed.

Check console output at http://jenkins.lambda.nu/job/CommitZorba/54/console to 
view the results.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-25 Thread Zorba Build Bot
Validation queue succeeded - proposal merged!
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-25 Thread noreply
The proposal to merge lp:~zorba-coders/zorba/json-http-module into lp:zorba has 
been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Chris Hillery
Review: Approve

Looks good, thanks!
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue result for 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Stage BuildZorbaUbuntu failed.

Check compiler output at 
http://jenkins.lambda.nu/job/BuildZorbaUbuntu/127/parsed_console to view the 
results.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Federico Cavalieri
The proposal to merge lp:~zorba-coders/zorba/json-http-module into lp:zorba has 
been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue result for 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Stage TestZorbaUbuntu failed.
158 tests failed (8414 total tests run).

Check test results at 
http://jenkins.lambda.nu/job/TestZorbaUbuntu/114/testReport/ to view the 
results.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Federico Cavalieri
The proposal to merge lp:~zorba-coders/zorba/json-http-module into lp:zorba has 
been updated.

Status: Approved = Needs review

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-24 Thread Zorba Build Bot
Validation queue starting for the following merge proposals:
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579

Progress dashboard at http://jenkins.lambda.nu/view/ValidationQueue
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-19 Thread Federico Cavalieri
Chris, thanks for the comments.

I think I resolved all reported issues with the module.
The old http module is xquery only now.
I also did a cleaning pass over the cpp and removed two small initialization 
bugs.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-12 Thread Federico Cavalieri

The old http-module when you send an http-request, specifying a non textual 
mime-type, the current http-client invokes the serializer specifiying the 
(unaccessible from XQuery code) binary method.

If the body is an xml node it gets converted in a very strange way:
hellothere/hello becomes hello there then it is encoded as base64 and 
sent encoded.
There is a test which specifically verifies this case.

Trying to send a JSON object results in an error.
A base64 value is sent encoded as is.
Anything else is first converted into a string and then encoded in base64. 

I personally believe that this does not make sense at all and the JSON http 
client behaves differently. 

Is this really the intended behaviour (there is a test which verifies it)?
Is there some code depending on it?
What is the rationale of the conversion from hellothere/hello to hello 
there (it cannot even be reproduced without a UDF)?
Should I reproduce this behaviour?
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-12 Thread Federico Cavalieri
 
 The old http-module when you send an http-request, specifying a non textual
 mime-type, the current http-client invokes the serializer specifiying the
 (unaccessible from XQuery code) binary method.
 
I meant
The old http-module when you send an http-request, specifying a non textual 
mime-type, invokes the serializer specifiying the (unaccessible from XQuery 
code) binary method.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-09 Thread Chris Hillery
Review: Needs Fixing

1. OMG code duplication: the entire contents of http-client.xq.src is copied 
(and modified?) from the original http-client module. That's nearly 3000 lines 
of some of the ugliest and most error-filled code we've got. No way do we want 
to maintain two copies of it. Also, they both call curl_global_init() and 
curl_global_cleanup(), which means that they will stomp on each other if anyone 
attempts to use both. This code must be consolidated somehow, perhaps into a 
common library that both modules use. Or, we need to simply eliminate the 
original http-client library. Perhaps we could replace the old http-client 
module with a pure XQuery wrapper module that replicates the old API, much like 
V2 of the EXPath http-client module does?

2. Need to consolidate the CMake code which searches for curl, etc. It was 
copied from modules/com/zorba-xquery/www/modules/CMakeLists.txt, and it still 
exists in that location. That means the search for CURL is done twice, and the 
cached variable ZORBA_HAVE_CURL is defined twice, and the Windows .pem files 
are copied twice... I would suggest that it should remain where it is in 
modules/CMakeList.txt, and be deleted from the other location, and testing done 
to ensure it still works right. (This issue would also be resolved by 
eliminating the original http-client module or replacing it with a wrapper 
module.)

3. The module error codes need to be changed to match the coding guidelines: 
http://my.zorba.io/dokuwiki/doku.php?id=coding-guidelines#error_codes


-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-09 Thread Federico Cavalieri
Thank you for your feedback.
 
 3. The module error codes need to be changed to match the coding guidelines:
 http://my.zorba.io/dokuwiki/doku.php?id=coding-guidelines#error_codes

I updated the error codes according to the guidelines
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-07-09 Thread Federico Cavalieri
 1. OMG code duplication: the entire contents of http-client.xq.src is copied
 (and modified?) from the original http-client module. That's nearly 3000 lines
 of some of the ugliest and most error-filled code we've got. No way do we want
 to maintain two copies of it. Also, they both call curl_global_init() and
 curl_global_cleanup(), which means that they will stomp on each other if
 anyone attempts to use both. This code must be consolidated somehow, perhaps
 into a common library that both modules use. Or, we need to simply eliminate
 the original http-client library. Perhaps we could replace the old http-client
 module with a pure XQuery wrapper module that replicates the old API, much
 like V2 of the EXPath http-client module does?
 
 2. Need to consolidate the CMake code which searches for curl, etc. It was
 copied from modules/com/zorba-xquery/www/modules/CMakeLists.txt, and it still
 exists in that location. That means the search for CURL is done twice, and the
 cached variable ZORBA_HAVE_CURL is defined twice, and the Windows .pem files
 are copied twice... I would suggest that it should remain where it is in
 modules/CMakeList.txt, and be deleted from the other location, and testing
 done to ensure it still works right. (This issue would also be resolved by
 eliminating the original http-client module or replacing it with a wrapper
 module.)

Yes, part of the code of the json-http-client duplicates that of the original 
http-client-module. It is not 100% the same because, as you said, because 
the original contains several bugs. The bugs I found (which include, headers 
mangling, 
broken/absent charset encoding/decoding, broken/absent streamable string and 
binary
support, error reporting, and so on) are fixed in the JSON HTTP module code.

I believe that removing the old http-client module would solve many problems, 
but given the widespread use of this module I am not sure if this is feasible.
I remember that when I started working on this module there was a discussion on 
this option and that keeping the old module (and duplicating the code) was the 
final decision.
However, my knowledge in this respect is limited, so I am not sure.

The next best thing would be to replace the old module with a wrapper.
The only downside of this is that some of the old module bugs are really 
common, 
e.g.: all requests which do not contain a manually specified charset=UTF-8 
specification in the media-type are sent with a wrong encoding.

Therefore, I will begin to work on the wrapper.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-24 Thread Cezar Andrei
Review: Approve

Checked the integer issue and is fixed also done more testing. Looks good.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-21 Thread Federico Cavalieri
I merged the trunk into the branch and added the ability to use hexbinary as a 
body type.
Note that this required a further API extension beside in addtion to the 
hexbinary stream which has been merged into the trunk a few hours ago.

Removed the jsoniq note from docs
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-20 Thread Federico Cavalieri
 In the Doc examples use WWW.zorba.io... but the module is registered without
 WWW:
 
 xqDoc:
 import module namespace http=http://www.zorba.io/modules/http-client;;
 http:get(http://www.example.com;)

Fixed

 timeout option has a bug. Uncomment timeout in the following script and 
 get this error:
 $ ./zorba -i -f -q q.jq
 error [zerr:ZSTR0040]: type error: Item::getIntValue() not defined for type 
 xs:integer
Fixed and added test

-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-20 Thread Federico Cavalieri
  Cezar, it is not necessary for users to have a jsoniq version header in
 their
  queries to use this module. They can use (field) object accessors instead
 of
  .field .
 
 My point was to mention these options somewhere in the doc and link to a page
 which better describes this. IMHO it's confusing if you also count in the file
 extension .jq.

The file extension is .xq, should I make it .jq?
Thanks
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-20 Thread Federico Cavalieri
  Cezar, it is not necessary for users to have a jsoniq version header in
 their
  queries to use this module. They can use (field) object accessors instead
 of
  .field .
 
 My point was to mention these options somewhere in the doc and link to a page
 which better describes this. IMHO it's confusing if you also count in the file
 extension .jq.

I added a small note which says that the module is written in jsoniq and that 
can be imported
both by xquery and jsoniq modules.
However, I don't know which webpage should I link to explain the version 
declaration: jsoniq.org does not mention this header, which I only found 
discussed in http://www.zorba.io/blog/. A link to this page would soon become 
outdated and I don't know how to get the specific post url. Any suggestions?
Thanks
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-20 Thread Matthias Brantner
 Cezar, it is not necessary for users to have a jsoniq version header in
 their
 queries to use this module. They can use (field) object accessors instead
 of
 .field .
 
 My point was to mention these options somewhere in the doc and link to a page
 which better describes this. IMHO it's confusing if you also count in the 
 file
 extension .jq.
 
 I added a small note which says that the module is written in jsoniq and that 
 can be imported
 both by xquery and jsoniq modules.
 However, I don't know which webpage should I link to explain the version 
 declaration: jsoniq.org does not mention this header, which I only found 
 discussed in http://www.zorba.io/blog/. A link to this page would soon become 
 outdated and I don't know how to get the specific post url. Any suggestions?
 Thanks
I think that's fine. Leave it like this. Zorba still has to catch up to make 
.jq modules
possible. Once this is done, we need some general documentation for such cases.

 -- 
 https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
 You are subscribed to branch lp:zorba.


-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-20 Thread Chris Hillery
IMHO, it's not a good idea to have any notes in module docs about how to use 
JSONiq. Virtually ask of our modules will have the same concerns, so we'd need 
to duplicate it dozens of times. This isn't the appropriate location for that 
information. I would take out that doc.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-19 Thread Cezar Andrei
Review: Needs Fixing

Also, add a note on the module documentation section about using the header 
jsoniq version 1.0; at the top and put a link to a page that describes this 
header.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-19 Thread Cezar Andrei
timeout option has a bug. Uncomment timeout in the following script and get 
this error:

$ ./zorba -i -f -q q.jq
error [zerr:ZSTR0040]: type error: Item::getIntValue() not defined for type 
xs:integer


jsoniq version 1.0;
import module namespace http=http://zorba.io/modules/http-client;;

http:send-request(
{
  method: POST, 
  href: http://requestb.in/13727yx1;,
  authentication:
  {
username : user,
password : pass,
auth-method : Basic
  },
  options:
  {
status-only: true,
override-media-type: text/plain,
follow-redirect: true,
(: timeout: 30, :)
user-agent: Mozilla/5.0
  },
  headers:
  {
name: value
  },
  body:
  {
media-type: text/plain,
content: ...
  }
})
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-19 Thread Chris Hillery
 Also, add a note on the module documentation section about using the header
 jsoniq version 1.0; at the top and put a link to a page that describes this
 header.

Cezar, it is not necessary for users to have a jsoniq version header in their 
queries to use this module. They can use (field) object accessors instead of 
.field .
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-19 Thread Cezar Andrei
 Cezar, it is not necessary for users to have a jsoniq version header in their
 queries to use this module. They can use (field) object accessors instead of
 .field .

My point was to mention these options somewhere in the doc and link to a page 
which better describes this. IMHO it's confusing if you also count in the file 
extension .jq.
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-19 Thread Matthias Brantner
 timeout option has a bug. Uncomment timeout in the following script and
 get this error:
 
 $ ./zorba -i -f -q q.jq
 error [zerr:ZSTR0040]: type error: Item::getIntValue() not defined for type
 xs:integer
 
 
 jsoniq version 1.0;
 import module namespace http=http://zorba.io/modules/http-client;;
 
 http:send-request(
 {
   method: POST,
   href: http://requestb.in/13727yx1;,
   authentication:
   {
 username : user,
 password : pass,
 auth-method : Basic
   },
   options:
   {
 status-only: true,
 override-media-type: text/plain,
 follow-redirect: true,
 (: timeout: 30, :)
 user-agent: Mozilla/5.0
   },
   headers:
   {
 name: value
   },
   body:
   {
 media-type: text/plain,
 content: ...
   }
 })

Federico, the problem occurs because getIntValue only works for xs:int items 
and not for xs:integer. However, because there is no representation of an 
arbitrary precision integer in the API, you have to do a trick as follows:

  Item lTmp = aOptions.getObjectValue(timeout);
  if (!lTmp.isNull())
  {
if (lTmp.getTypeCode() != store::XS_INTEGER)
{
  // raiseTypeError(lTmp.getType(), timeout, integer);
}
else
{
  aValue = atoi(lTmp.getStringValue().c_str());
}
  }
  else
  {
aValue = 0;
  }
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-18 Thread Cezar Andrei
Code looks good. I need a few more tests to make sure everything is fine. 
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/json-http-module into lp:zorba

2013-06-18 Thread Cezar Andrei
Review: Needs Fixing

In the Doc examples use WWW.zorba.io... but the module is registered without 
WWW:

xqDoc:
import module namespace http=http://www.zorba.io/modules/http-client;;
http:get(http://www.example.com;)
-- 
https://code.launchpad.net/~zorba-coders/zorba/json-http-module/+merge/169579
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp