Re: [Zorba-coders] [Merge] lp:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-07-02 Thread David Graf
Review: Approve

The failing query execution on ubuntu has nothing to do with this change. When 
execution in a different environment, it works. Therefore, I approve it.
-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-07-02 Thread David Graf
The proposal to merge lp:~davidagraf/zorba/email-module-fixes into 
lp:zorba/email-module has been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-07-02 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/email-module-fixes-2012-07-02T09-40-42.139Z/log.html
-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-07-02 Thread Zorba Build Bot
Validation queue job email-module-fixes-2012-07-02T09-40-42.139Z is finished. 
The final status was:

All tests succeeded!
-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-07-02 Thread noreply
The proposal to merge lp:~davidagraf/zorba/email-module-fixes into 
lp:zorba/email-module has been updated.

Status: Approved = Merged

For more details, see:
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-06-26 Thread David Graf
David Graf has proposed merging lp:~davidagraf/zorba/email-module-fixes into 
lp:zorba/email-module.

Requested reviews:
  Alexander Kreutz (kreutz)
  Dennis Knochenwefel (dennis-knochenwefel)
  David Graf (davidagraf)

For more details, see:
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051

Several email module fixes:
- case insensitive email attribute comparison
- catch more attachment filenames
- don't create empty recipients and email tags
- fixed typos
- made constant for namespace prefix
- introduced default mime charset
- remove newlines from base64 that comes from uw-imap
- if email content is quoted-printable encoded and the content type binary, it 
needs to be encoded into base64
- fixed content type check
- decode all email headers
- non-ascii (non encoded) chars are not allowed in email headers - we ignore 
them
- added missing namespaces
-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.
=== modified file 'src/com/zorba-xquery/www/modules/email/imap.xq.src/imap_function.cpp'
--- src/com/zorba-xquery/www/modules/email/imap.xq.src/imap_function.cpp	2012-06-01 13:35:25 +
+++ src/com/zorba-xquery/www/modules/email/imap.xq.src/imap_function.cpp	2012-06-26 10:10:34 +
@@ -21,10 +21,11 @@
 #include map
 #include sstream
 
-#include zorba/zorba.h
+#include zorba/base64.h
+#include zorba/diagnostic_list.h
 #include zorba/iterator.h
 #include zorba/user_exception.h
-#include zorba/diagnostic_list.h
+#include zorba/zorba.h
 
 #include unicode/ucnv.h
 #include unicode/ustring.h
@@ -36,6 +37,7 @@
 namespace zorba { namespace emailmodule {
 
 const char* ImapFunction::SCHEMA_NAMESPACE = http://www.zorba-xquery.com/modules/email;;  
+const char* ImapFunction::SCHEMA_PREFIX = email;  
 
 ImapFunction::ImapFunction(const ImapModule* aModule)
   : theModule(aModule)
@@ -297,11 +299,11 @@
   const bool aQualified) const
 {
   NsBindings ns_binding;
-  ns_binding.push_back(std::pairString, String(email, SCHEMA_NAMESPACE));
+  ns_binding.push_back(std::pairString, String(SCHEMA_PREFIX, SCHEMA_NAMESPACE));
   
   // if aParent is null, then we want to have the flags node qualified (so that it can be shema validated)
   Item lFlagsName;
-  lFlagsName = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, email, flags);
+  lFlagsName = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, SCHEMA_PREFIX, flags);
   Item lFlagsType = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE,  flagsType);
   aFlags = theModule-getItemFactory()-createElementNode(aParent, lFlagsName, lFlagsType, false, false, ns_binding);
 
@@ -327,7 +329,7 @@
 break;
   }
   
-  Item lOneFlagName = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, email, lFlagName);
+  Item lOneFlagName = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, SCHEMA_PREFIX, lFlagName);
   Item lOneFlagType = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, emptyType);
   Item lOneFlag = theModule-getItemFactory()-createElementNode(aFlags, lOneFlagName, lOneFlagType, false, true, ns_binding);
 }
@@ -366,7 +368,7 @@
   Item lNullItem;

   NsBindings null_binding;
-  Item lName = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, email, content);
+  Item lName = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, SCHEMA_PREFIX, content);
   Item lType = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, contentType );
   Item lItem = theModule-getItemFactory()-createElementNode(aParent, lName, lType, false, false, null_binding);
   
@@ -390,37 +392,51 @@
   const char* aMailbox,
   const char* aHost) const
 {
-  Item lType = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, emailAddress);
-  Item lName = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, email,  aName);
-
-  NsBindings ns_binding;
-  ns_binding.push_back(std::pairString, String(email, SCHEMA_NAMESPACE));
- 
-  Item lItem = theModule-getItemFactory()-createElementNode(aParent, lName, lType, false, false, ns_binding);
-  if (aPersonal) {
-createInnerNodeWithText(lItem, SCHEMA_NAMESPACE, email, name, http://www.w3.org/2001/XMLSchema;, string, aPersonal);
-  }
   if ((aMailbox)  (aHost)) {
-createInnerNodeWithText(lItem, SCHEMA_NAMESPACE, email, email, SCHEMA_NAMESPACE, emailAddressType, std::string(aMailbox) + @ + std::string(aHost));  
+// mailbox and host needs to be available, otherwise broken
+Item lType = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, emailAddress);
+Item lName = theModule-getItemFactory()-createQName(SCHEMA_NAMESPACE, SCHEMA_PREFIX,  aName);
+
+NsBindings ns_binding;
+ns_binding.push_back(std::pairString, String(SCHEMA_PREFIX, SCHEMA_NAMESPACE));
+   
+Item lItem = theModule-getItemFactory()-createElementNode(aParent, lName, lType, false, false, ns_binding);
+if (aPersonal) {
+  std::string 

[Zorba-coders] [Merge] lp:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-06-26 Thread David Graf
The proposal to merge lp:~davidagraf/zorba/email-module-fixes into 
lp:zorba/email-module has been updated.

Commit Message changed to:

Several email module fixes:
- case insensitive email attribute comparison
- catch more attachment filenames
- don't create empty recipients and email tags
- fixed typos
- made constant for namespace prefix
- introduced default mime charset
- remove newlines from base64 that comes from uw-imap
- if email content is quoted-printable encoded and the content type binary, it 
needs to be encoded into base64
- fixed content type check
- decode all email headers
- non-ascii (non encoded) chars are not allowed in email headers - we ignore 
them
- added missing namespaces

For more details, see:
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-06-26 Thread Alexander Kreutz
Review: Approve


-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-06-26 Thread David Graf
Review: Approve


-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-06-26 Thread David Graf
Unfortunately, I cannot run fix on ubuntu 12.04 because of:

./bin/zorba -q ~/sausalito/build/test.xq  -f
operating system error [zerr:ZOSE0005]: 
/home/dagraf/zorba/build/LIB_PATH/com/zorba-xquery/www/modules/email/libsmtp_1.0.so:
 error loading dynamic library: 
/home/dagraf/zorba/build/LIB_PATH/com/zorba-xquery/www/modules/email/libsmtp_1.0.so:
 undefined symbol: crypt; raised at 
/home/dagraf/zorba/sandbox/src/context/dynamic_loader.cpp:168

But it has nothing to do with the change.
-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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:~davidagraf/zorba/email-module-fixes into lp:zorba/email-module

2012-06-26 Thread David Graf
Review: Needs Fixing


-- 
https://code.launchpad.net/~davidagraf/zorba/email-module-fixes/+merge/112051
Your team Zorba Coders is subscribed to branch lp:zorba/email-module.

-- 
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