Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/zorba-error_printer_in_api into lp:zorba

2013-02-06 Thread Paul J. Lucas
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-06 Thread Paul J. Lucas
The proposal to merge lp:~zorba-coders/zorba/zorba-error_printer_in_api into 
lp:zorba has been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-06 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/zorba-error_printer_in_api-2013-02-07T00-11-30.914Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-06 Thread Zorba Build Bot
The proposal to merge lp:~zorba-coders/zorba/zorba-error_printer_in_api into 
lp:zorba has been updated.

Status: Approved = Needs review

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-06 Thread Paul J. Lucas
The proposal to merge lp:~zorba-coders/zorba/zorba-error_printer_in_api into 
lp:zorba has been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-06 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/zorba-error_printer_in_api-2013-02-07T01-32-31.231Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-06 Thread noreply
The proposal to merge lp:~zorba-coders/zorba/zorba-error_printer_in_api into 
lp:zorba has been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-05 Thread Paul J. Lucas
Actually, in the short term, I'd like to revert the way the error code is 
printed to:

codeerr:XPST0003/code

and merge the branch into the trunk immediately because this branch actually 
makes testing the branch for bug 786 much easier.  I'll file a separate bug 
to change the form to:

code namespace=http://www.w3.org/2005/xqt-errors; local-name=XPST0003/

for 3.0.

OK?
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-05 Thread Paul J. Lucas
Also, does the 28msec code rely on the kind being like:

  kindstatic error/kind

or will:

  kindstatic/kind

still work?
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-03 Thread Paul J. Lucas
The error code was printed in XML as:

  codeerr:XPST0003/code

I think it's better to print it as:

  codehttp://www.w3.org/2005/xqt-errors#XPST0003/code

(as suggested in http://www.w3.org/TR/xquery-30/#id-identifying-errors).
But is it better still to print it as:

  code ns=http://www.w3.org/2005/xqt-errors; prefix=err 
localname=XPST0003/

?
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-03 Thread Matthias Brantner
 The error code was printed in XML as:
 
   codeerr:XPST0003/code
 
 I think it's better to print it as:
 
   codehttp://www.w3.org/2005/xqt-errors#XPST0003/code
 
 (as suggested in http://www.w3.org/TR/xquery-30/#id-identifying-errors).
 But is it better still to print it as:
 
   code ns=http://www.w3.org/2005/xqt-errors; prefix=err
 localname=XPST0003/
 
 ?
It would make sense to me but the problem is that the change is not backwards 
compatible. I know that 28msec relies on it.
on the current way the error is reported.

-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2013-02-03 Thread Paul J. Lucas
 It would make sense to me but the problem is that the change is not backwards 
 compatible.
 I know that 28msec relies on it.
 on the current way the error is reported.

There were other mistakes that whoever coded the original XML made.  For 
example, not including a xmlns=... attribute on the exception element; 
omitting the raised-at ... information; using localized strings for the 
code value (this is one case where the string should NOT be localized).

Will those changes break 28msec as well?
Can't we just update the 28msec code?
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-12-20 Thread Paul J. Lucas
I've done a lot of clean-up.  You have the basic implementation correct.  I've 
moved several functions inline.  I've moved the printing of the stack trace 
constants to XQueryException since only XQueryException has stack traces.  I've 
added doxygen comments that you didn't.

Why don't you include the raised at in the XML format?

Why don't you include the applied at in the XML format?  (Not knowing what it 
is is not an acceptable reason.)

Why does ErrorPrinter need to exist at all?  It seems redundant.
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-12-17 Thread David Graf
 I just checked: ZorbaException already has a global
 operator(ostream,ZorbaException const) function defined for it.
 
 So why do you need to do anything at all?
Hi Paul, sorry for not following up for a long time. We just need it to get the 
errors in xml format. I guess this is not supported in 
operator(ostream,ZorbaException const). I will investigate in the stream 
manipulators. Hopefully, I understand how it works!
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-11-16 Thread David Graf
Cool, now I can fix what someone else did wrong :-(. 

Anyway, Paul, can you help me on one thing please? Can you tell me how I can 
use this ErrorPrinter for warnings too?

 It's a stupid API.  There's no reason to have a class with a single static
 member function.  If you're going to make it public, it needs to be better.
 Two things come to mind:
 
 1. (Trivial) Simply make it a global function -- no need for a class.
 
 2. (Less trivial) Create a (real) ErrorPrinter class that holds the
 configuration parameters; then using operator, you can write an
 XQueryException to it.
 
 3. Regardless, the indentation parameter should be an unsigned int (not a
 bool): it will specify a multiplier for the amount of indentation (where 0 =
 none).
 
 BTW: It should take a ZorbaException, not an XQueryException.
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-11-16 Thread Paul J. Lucas
 Anyway, Paul, can you help me on one thing please? Can you tell me how I can
 use this ErrorPrinter for warnings too?

An XQueryWarning is just a typedef for XQueryException, so it should just work 
as-is.

That aside: generally, I don't like to decide for the user how errors should be 
printed.  By putting an error-printer in the public API, you're essentially 
making that decision for them.  If you're going to do that, you could just 
define operator(ostream,ZorbaException const) and then  would just work.

If you want to set parameters (like XML or indentation), then the nice way to 
do it is via stream manipulators, e.g.:

// ...
}
catch ( XQueryException const e ) {
  cout  XQueryException::as_xml  XQueryException::indent( 2 )  e;
}

You can look at src/util/indent.h for how to do this kind of thing.  The above 
manipulators, however, should be one-shot and auto-reset (which is trivial to 
do).
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-11-16 Thread Paul J. Lucas
I just checked: ZorbaException already has a global 
operator(ostream,ZorbaException const) function defined for it.

So why do you need to do anything at all?
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-11-15 Thread William Candillon
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-11-15 Thread Matthias Brantner
Review: Approve

I approve but I want to make sure the same or similar functionality (maybe 
without XML printing) is not already available in the API. Hence, I added Paul.
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-11-15 Thread Paul J. Lucas
Review: Disapprove

It's a stupid API.  There's no reason to have a class with a single static 
member function.  If you're going to make it public, it needs to be better.  
Two things come to mind:

1. (Trivial) Simply make it a global function -- no need for a class.

2. (Less trivial) Create a (real) ErrorPrinter class that holds the 
configuration parameters; then using operator, you can write an 
XQueryException to it.

3. Regardless, the indentation parameter should be an unsigned int (not a 
bool): it will specify a multiplier for the amount of indentation (where 0 = 
none).

BTW: It should take a ZorbaException, not an XQueryException.
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-11-14 Thread David Graf
David Graf has proposed merging 
lp:~zorba-coders/zorba/zorba-error_printer_in_api into lp:zorba.

Commit message:
Moving the error printer from zorbacmd into the api.

Requested reviews:
  Matthias Brantner (matthias-brantner)
  William Candillon (wcandillon)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405

Moving the error printer from zorbacmd into the api.
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-11-07 11:48:14 +
+++ ChangeLog	2012-11-15 07:23:22 +
@@ -118,6 +118,7 @@
 http://www.zorba-xquery.com/modules/store/data-structures/unordered-map module.
   * Added support for fragments to fn:path
   * Positional pagination support for collections
+  * Pagination by reference support for collections
   * http://www.zorba-xquery.com/modules/archive module for creating,
 reading, and updating various (compressed) archives (e.g. zip, tar.gz,
 or tar.bz2)

=== modified file 'bin/CMakeLists.txt'
--- bin/CMakeLists.txt	2012-11-08 21:57:10 +
+++ bin/CMakeLists.txt	2012-11-15 07:23:22 +
@@ -44,7 +44,6 @@
 SET(SRCS
   zorbacmd.cpp
   zorbacmdproperties.cpp
-  error_printer.cpp
   util.cpp
   path_util.cpp
 )

=== modified file 'bin/zorbacmd.cpp'
--- bin/zorbacmd.cpp	2012-11-06 10:11:37 +
+++ bin/zorbacmd.cpp	2012-11-15 07:23:22 +
@@ -41,6 +41,7 @@
 #include zorba/serialization_callback.h
 #include zorba/audit.h
 #include zorba/audit_scoped.h
+#include zorba/util/error_printer.h
 
 #include zorba/store_manager.h
 
@@ -51,7 +52,6 @@
 #include zorba/audit_scoped.h
 #endif
 
-#include error_printer.h
 #include util.h
 #include path_util.h
 

=== renamed file 'bin/error_printer.h' = 'include/zorba/util/error_printer.h'
--- bin/error_printer.h	2012-09-19 21:16:15 +
+++ include/zorba/util/error_printer.h	2012-11-15 07:23:22 +
@@ -22,14 +22,22 @@
 
 class XQueryException;
 
-class ErrorPrinter {
+class ZORBA_DLL_PUBLIC ErrorPrinter {
 
   public:
 
+/**
+ * Generates an error message out of an XQuery exception.
+ *
+ * @param aException The exception.
+ * @param aOut   Stream to which the error message is written to.
+ * @param aAsXml Error message in XML format?
+ * @param aIndet Error message indented?
+ */
 static std::ostream
 print(
-  const XQueryException lException,
-  std::ostream  lOut,
+  const XQueryException aException,
+  std::ostream  aOut,
   bool   aAsXml,
   bool   aIndent);
 

=== modified file 'src/api/CMakeLists.txt'
--- src/api/CMakeLists.txt	2012-10-08 12:09:36 +
+++ src/api/CMakeLists.txt	2012-11-15 07:23:22 +
@@ -60,6 +60,7 @@
 streambuf.cpp
 transcode_streambuf.cpp
 uuid.cpp
+error_printer.cpp
 )
 
 IF (NOT ZORBA_NO_FULL_TEXT)

=== renamed file 'bin/error_printer.cpp' = 'src/api/error_printer.cpp'
--- bin/error_printer.cpp	2012-09-19 21:16:15 +
+++ src/api/error_printer.cpp	2012-11-15 07:23:22 +
@@ -23,7 +23,7 @@
 #include zorba/zorba_string.h
 
 #include zorba/util/uri.h
-#include error_printer.h
+#include zorba/util/error_printer.h
 
 namespace 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/zorba-error_printer_in_api into lp:zorba

2012-11-14 Thread David Graf
The proposal to merge lp:~zorba-coders/zorba/zorba-error_printer_in_api into 
lp:zorba has been updated.

Commit Message changed to:

Moving the error printer from zorbacmd into the api.

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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/zorba-error_printer_in_api into lp:zorba

2012-11-14 Thread David Graf
It would be good to use this error printer for the warning reporter too. But I 
didn't figure out how that should work yet? Can you guys help?
-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-error_printer_in_api/+merge/134405
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