From xmlrpc@opengroupware.org Tue May 2 13:14:59 2006 From: xmlrpc@opengroupware.org (=?iso-8859-15?Q?Thomas_B=FCckemeyer?=) Date: Tue, 02 May 2006 14:14:59 +0200 Subject: [OGo-XML-RPC] Which ID for person.getById Message-ID: <527542717@web.de> Hello, I have a question regarding the person.getById: First, I got a list of alle persons via PHP with $params = array(new XML_RPC_Value("name like '*'")); $msg = new XML_RPC_Message("person.fetchIds", $params); $response = $client->send($msg); $v = $response->value(); $nSize = $v->arraysize(); for($nA = 0; $nA < $nSize; $nA++) { $val = $v->arraymem($nA); var_dump($val); } The List shows like object(XML_RPC_Value)#4 (2) { ["me"]=> array(1) { ["string"]=> string(42) "skyrix://bueckemeyer/bueckemeyer-ogo/10000" } ["mytype"]=> int(1) } object(XML_RPC_Value)#5 (2) { ["me"]=> array(1) { ["string"]=> string(42) "skyrix://bueckemeyer/bueckemeyer- ogo/10120" } ["mytype"]=> int(1) } object(XML_RPC_Value)#6 (2) { ["me"]=> array(1) { ["string"]=> string(42) "skyrix://bueckemeyer/bueckemeyer-ogo/10570" } ["mytype"]=> int(1) } When i then try to geht a person document from the User with the id 10570 with $msg = new XML_RPC_Message("person.getById", new XML_RPC_Message('10570')); the result is NULL. Do I need another ID? Does someone know whats's wrong? Thanks for help! Thomas _______________________________________________________________ SMS schreiben mit WEB.DE FreeMail - einfach, schnell und kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192 From xmlrpc@opengroupware.org Tue May 2 13:44:06 2006 From: xmlrpc@opengroupware.org (Adam Tauno Williams) Date: Tue, 02 May 2006 08:44:06 -0400 Subject: [OGo-XML-RPC] Which ID for person.getById In-Reply-To: <527542717@web.de> References: <527542717@web.de> Message-ID: <1146573846.6833.9.camel@localhost> --=-nu6u8TaB0s+5zYdbqHv/ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > I have a question regarding the person.getById: > First, I got a list of alle persons via PHP with=20 > The List shows like=20 > object(XML_RPC_Value)#4 (2) { ["me"]=3D> array(1) { ["string"]=3D> =20 > string(42) "skyrix://bueckemeyer/bueckemeyer-ogo/10000" }=20 > ["mytype"]=3D> int(1) } object(XML_RPC_Value)#5 (2) { ["me"]=3D> =20 > array(1) { ["string"]=3D> string(42) "skyrix://bueckemeyer/bueckemeyer- > ogo/10120" } ["mytype"]=3D> int(1) } object(XML_RPC_Value)#6 (2) {=20 > ["me"]=3D> array(1) { ["string"]=3D> string(42)=20 > "skyrix://bueckemeyer/bueckemeyer-ogo/10570" } ["mytype"]=3D> int(1) }=20 > When i then try to geht a person document from the User with the id=20 > 10570 with=20 > $msg =3D new XML_RPC_Message("person.getById", new=20 > XML_RPC_Message('10570')); > the result is NULL. > Do I need another ID? Does someone know whats's wrong? In POGI we do a (roughly) - $this->client =3D new XML_RPC_Client($this->uri, $this->hostname, $this->port); $params =3D array(new XML_RPC_Value($id, "int")); $message =3D new XML_RPC_Message('person.getById', $params); $response =3D $this->client->send($message); You can view the POGI source code here - http://svn.opengroupware.org/viewcvs/pogi/?root=3DOGoProjects - I have just about everything working. BTW, some versions of the PEAR XML-RPC module think ISO8601 date strings in the response payload are base64 encoded. This is incorrect (probably some moron thinking their wacky BLOG API is some kind of reference standard), so if dates look completely thrashed you need to comment out the line - $XML_RPC_xh[$parser]['value'] =3D base64_decode($XML_RPC_xh[$parser]['ac']); - in the "case 'DATETIME.ISO8601':" clause of "XML_RPC_ee" in RPC.php It took me ages to figure this out, why it worked on one box and not on another. Grrrr.... --=-nu6u8TaB0s+5zYdbqHv/ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBEV1QWLRePpNle04MRArmNAJ9vVLQ86fm97e5u57NxAuzBeoPArQCbB/qw 1XhYSr49cpxoxUNKl/aKrNA= =SLsY -----END PGP SIGNATURE----- --=-nu6u8TaB0s+5zYdbqHv/-- From xmlrpc@opengroupware.org Fri May 5 16:28:59 2006 From: xmlrpc@opengroupware.org (Derya K.) Date: Fri, 05 May 2006 17:28:59 +0200 Subject: [OGo-XML-RPC] JOGI - Document Upload Message-ID: <445B6F3B.70404@gmx.de> Hi, i have a question regarding the JOGI API! I want to upload files... I know there is a method to create a new Document in Project with public boolean *newDocument*(java.lang.String path, java.lang.String content, Attribute attr) but how can i upload a Document which exists in a filesystem? For example a jpg Picture?? Is there a method - i can use? Thanks Derya K. From xmlrpc@opengroupware.org Fri May 5 16:30:57 2006 From: xmlrpc@opengroupware.org (Adam Tauno Williams) Date: Fri, 05 May 2006 11:30:57 -0400 Subject: [OGo-XML-RPC] JOGI - Document Upload In-Reply-To: <445B6F3B.70404@gmx.de> References: <445B6F3B.70404@gmx.de> Message-ID: <1146843057.8486.17.camel@localhost> --=-H915GutIiuKUoLCgFura Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > i have a question regarding the JOGI API! > I want to upload files... > I know there is a method to create a new Document in Project with > public boolean *newDocument*(java.lang.String path, > java.lang.String content, > Attribute attr) > but how can i upload a Document which exists in a filesystem? > For example a jpg Picture?? Have you tried reading the file into a string and using that as the parameter? You may need to base64 encode the string. --=-H915GutIiuKUoLCgFura Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBEW2+xLRePpNle04MRAo07AJ97nfgn0RMXnLFR6ediLSd8RV+EAACfQhHl 1KeeSln6+eO+itqBtJ8kXag= =524H -----END PGP SIGNATURE----- --=-H915GutIiuKUoLCgFura-- From xmlrpc@opengroupware.org Fri May 5 16:42:00 2006 From: xmlrpc@opengroupware.org (Adam Tauno Williams) Date: Fri, 05 May 2006 11:42:00 -0400 Subject: [OGo-XML-RPC] JOGI - Document Upload In-Reply-To: <1146843057.8486.17.camel@localhost> References: <445B6F3B.70404@gmx.de> <1146843057.8486.17.camel@localhost> Message-ID: <1146843720.8486.22.camel@localhost> --=-tNZYBGozkayr1vtt9SdS Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > > i have a question regarding the JOGI API! > > I want to upload files... > > I know there is a method to create a new Document in Project with > > public boolean *newDocument*(java.lang.String path, > > java.lang.String content, > > Attribute attr) > > but how can i upload a Document which exists in a filesystem? > > For example a jpg Picture?? > Have you tried reading the file into a string and using that as the > parameter? You may need to base64 encode the string. There might be some related information here - http://bugzilla.opengroupware.org/bugzilla/show_bug.cgi?id=3D689 I've not used most of the project.* methods extensively so I'm not sure. --=-tNZYBGozkayr1vtt9SdS Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBEW3JILRePpNle04MRAvGpAJ9fbNBXZABsSuFPfAxz2bg4/OUOEwCfRSqW M1RwgwwnyFvxGjItG5GtJls= =EC6Z -----END PGP SIGNATURE----- --=-tNZYBGozkayr1vtt9SdS-- From xmlrpc@opengroupware.org Sat May 6 09:13:28 2006 From: xmlrpc@opengroupware.org (Derya K.) Date: Sat, 06 May 2006 10:13:28 +0200 Subject: [OGo-XML-RPC] JOGI - Document Upload In-Reply-To: <1146843057.8486.17.camel@localhost> References: <445B6F3B.70404@gmx.de> <1146843057.8486.17.camel@localhost> Message-ID: <445C5AA8.6020701@gmx.de> Adam Tauno Williams schrieb: >>i have a question regarding the JOGI API! >>I want to upload files... >>I know there is a method to create a new Document in Project with >>public boolean *newDocument*(java.lang.String path, >> java.lang.String content, >> Attribute attr) >>but how can i upload a Document which exists in a filesystem? >>For example a jpg Picture?? >> >> > >Have you tried reading the file into a string and using that as the >parameter? You may need to base64 encode the string. > > File datei = new File("picture.jpg"); byte[] fby = getBytesFromFile(datei); String content = new BASE64Encoder().encode(fby); project.newDocument("pic.jpg", content, null); I tried it thatway... but it doesn't work!!! The File is there but i can't see the picture in OGo! Maybe somebody know? What i'm doing wrong? Thanks Bye Derya From xmlrpc@opengroupware.org Sat May 6 14:08:12 2006 From: xmlrpc@opengroupware.org (Adam Tauno Williams) Date: Sat, 06 May 2006 9:08:12 -0400 Subject: [OGo-XML-RPC] JOGI - Document Upload In-Reply-To: <445C5AA8.6020701@gmx.de> References: <445B6F3B.70404@gmx.de> <1146843057.8486.17.camel@localhost> <445C5AA8.6020701@gmx.de> Message-ID: <4612-SnapperMsg05076A73C0825043@[166.165.155.9]> >File datei = new File("picture.jpg"); >byte[] fby = getBytesFromFile(datei); > >String content = new BASE64Encoder().encode(fby); >project.newDocument("pic.jpg", content, null); >I tried it thatway... but it doesn't work!!! >The File is there but i can't see the picture in OGo! >Maybe somebody know? What i'm doing wrong? What MIME type does OGo think it is? If you downlad the file via the web-ui is it intact? From xmlrpc@opengroupware.org Sat May 6 16:46:33 2006 From: xmlrpc@opengroupware.org (Derya) Date: Sat, 06 May 2006 17:46:33 +0200 Subject: [OGo-XML-RPC] JOGI - Document Upload In-Reply-To: <4612-SnapperMsg05076A73C0825043@[166.165.155.9]> References: <445B6F3B.70404@gmx.de> <1146843057.8486.17.camel@localhost> <445C5AA8.6020701@gmx.de> <4612-SnapperMsg05076A73C0825043@[166.165.155.9]> Message-ID: <445CC4D9.2010006@gmx.de> Adam Tauno Williams schrieb: >> File datei = new File("picture.jpg"); >> byte[] fby = getBytesFromFile(datei); >> >> String content = new BASE64Encoder().encode(fby); >> project.newDocument("pic.jpg", content, null); >> I tried it thatway... but it doesn't work!!! >> The File is there but i can't see the picture in OGo! >> Maybe somebody know? What i'm doing wrong? >> > > What MIME type does OGo think it is? If you downlad the file via the > web-ui is it intact? > OGo set the picture icon for the file... But if i donwload the file via web-ui the file is not intact! No Picture!!!! Bye Derya From xmlrpc@opengroupware.org Sat May 6 17:14:35 2006 From: xmlrpc@opengroupware.org (Adam Tauno Williams) Date: Sat, 06 May 2006 12:14:35 -0400 Subject: [OGo-XML-RPC] JOGI - Document Upload In-Reply-To: <445CC4D9.2010006@gmx.de> References: <445B6F3B.70404@gmx.de> <1146843057.8486.17.camel@localhost> <445C5AA8.6020701@gmx.de> <4612-SnapperMsg05076A73C0825043@[166.165.155.9]> <445CC4D9.2010006@gmx.de> Message-ID: <4663-SnapperMsg05076A73C0827BF4@[70.217.183.234]> ...... Original Message ....... On Sat, 06 May 2006 17:46:33 +0200 "Derya" wrote: >Adam Tauno Williams schrieb: >>> File datei = new File("picture.jpg"); >>> byte[] fby = getBytesFromFile(datei); >>> >>> String content = new BASE64Encoder().encode(fby); >>> project.newDocument("pic.jpg", content, null); >>> I tried it thatway... but it doesn't work!!! >>> The File is there but i can't see the picture in OGo! >>> Maybe somebody know? What i'm doing wrong? >>> >> >> What MIME type does OGo think it is? If you downlad the file via the >> web-ui is it intact? >> >OGo set the picture icon for the file... >But if i donwload the file via web-ui the file is not intact! >No Picture!!!! Is it zero sized or stored as base64? From xmlrpc@opengroupware.org Sat May 6 19:27:55 2006 From: xmlrpc@opengroupware.org (docean) Date: Sat, 06 May 2006 20:27:55 +0200 Subject: [OGo-XML-RPC] JOGI - Document Upload In-Reply-To: <4663-SnapperMsg05076A73C0827BF4@[70.217.183.234]> References: <445B6F3B.70404@gmx.de> <1146843057.8486.17.camel@localhost> <445C5AA8.6020701@gmx.de> <4612-SnapperMsg05076A73C0825043@[166.165.155.9]> <445CC4D9.2010006@gmx.de> <4663-SnapperMsg05076A73C0827BF4@[70.217.183.234]> Message-ID: <445CEAAB.9090901@gmx.de> Adam Tauno Williams schrieb: > ...... Original Message ....... > On Sat, 06 May 2006 17:46:33 +0200 "Derya" wrote: > >> Adam Tauno Williams schrieb: >> >>>> File datei = new File("picture.jpg"); >>>> byte[] fby = getBytesFromFile(datei); >>>> >>>> String content = new BASE64Encoder().encode(fby); >>>> project.newDocument("pic.jpg", content, null); >>>> I tried it thatway... but it doesn't work!!! >>>> The File is there but i can't see the picture in OGo! >>>> Maybe somebody know? What i'm doing wrong? >>>> >>>> >>> What MIME type does OGo think it is? If you downlad the file via the >>> web-ui is it intact? >>> >>> >> OGo set the picture icon for the file... >> But if i donwload the file via web-ui the file is not intact! >> No Picture!!!! >> > > Is it zero sized or stored as base64? > It's not Zero!!!! I think it is stored as base64! From xmlrpc@opengroupware.org Wed May 10 12:18:41 2006 From: xmlrpc@opengroupware.org (Adam Tauno Williams) Date: Wed, 10 May 2006 07:18:41 -0400 Subject: [OGo-XML-RPC] Pyhton 2.4 Message-ID: <1147259921.9035.20.camel@localhost> Anyone have an example of a Python->OGo XML-RPC call using a modern Python 2.4? I swear I had Python working, but it isn't anymore for whatever reason (it went back to griping about the parameters to xmlrpclib.Server) and there seems to little to no documentation on anything more current. Grrrr.... scripts like - http://bugzilla.opengroupware.org/bugzilla/attachment.cgi?id=410&action=view - no longer work. If I edit the server call to be - server = xmlrpclib.Server(sys.argv[1],sys.argv[2],sys.argv[3]) - then it fails with - awilliam@aleph:~> ./loginChange.py http://localhost/RPC2 awilliam fred Traceback (most recent call last): File "./loginChange.py", line 5, in ? account = server.account.getByLogin("nawrot") File "/usr/lib/python2.4/xmlrpclib.py", line 1096, in __call__ return self.__send(self.__name, args) File "/usr/lib/python2.4/xmlrpclib.py", line 1379, in __request response = self.__transport.request( AttributeError: 'str' object has no attribute 'request' From xmlrpc@opengroupware.org Wed May 10 13:28:28 2006 From: xmlrpc@opengroupware.org (Helge Hess) Date: Wed, 10 May 2006 14:28:28 +0200 Subject: [OGo-XML-RPC] Pyhton 2.4 In-Reply-To: <1147259921.9035.20.camel@localhost> References: <1147259921.9035.20.camel@localhost> Message-ID: <4F977D0D-97E3-4C3E-8FD0-191D8273A346@opengroupware.org> On 10. Mai 2006, at 13:18 Uhr, Adam Tauno Williams wrote: > Anyone have an example of a Python->OGo XML-RPC call using a modern > Python 2.4? http://docs.python.org/lib/module-xmlrpclib.html > scripts like - > http://bugzilla.opengroupware.org/bugzilla/attachment.cgi? > id=410&action=view - no longer work. Si. I think you where using the old replacement xmlrpclib provided by OGo. With Python 2.0 or so the parameters changed. > server = xmlrpclib.Server(sys.argv[1],sys.argv[2],sys.argv[3]) > - then it fails with - ... > AttributeError: 'str' object has no attribute 'request' I think this is because either the second or the third arguments should not be strings. If I understand it right it should be just: s = xmlrpclib.Server("http://user:passwd@localhost/RPC2") This works for me (Debian Python 2.3). Greets, Helge -- http://docs.opengroupware.org/Members/helge/ OpenGroupware.org From xmlrpc@opengroupware.org Wed May 10 13:49:34 2006 From: xmlrpc@opengroupware.org (Adam Tauno Williams) Date: Wed, 10 May 2006 08:49:34 -0400 Subject: [OGo-XML-RPC] Pyhton 2.4 In-Reply-To: <4F977D0D-97E3-4C3E-8FD0-191D8273A346@opengroupware.org> References: <1147259921.9035.20.camel@localhost> <4F977D0D-97E3-4C3E-8FD0-191D8273A346@opengroupware.org> Message-ID: <1147265375.9031.3.camel@localhost> --=-0gZlsN4tkPFKK+62Ggvt Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2006-05-10 at 14:28 +0200, Helge Hess wrote: > On 10. Mai 2006, at 13:18 Uhr, Adam Tauno Williams wrote: > > Anyone have an example of a Python->OGo XML-RPC call using a modern > > Python 2.4? > http://docs.python.org/lib/module-xmlrpclib.html > > scripts like - > > http://bugzilla.opengroupware.org/bugzilla/attachment.cgi?=20 > > id=3D410&action=3Dview - no longer work. > Si. I think you where using the old replacement xmlrpclib provided by =20 > OGo. With Python 2.0 or so the parameters changed. I think so. > > server =3D xmlrpclib.Server(sys.argv[1],sys.argv[2],sys.argv[3]) > > - then it fails with - > > AttributeError: 'str' object has no attribute 'request' > I think this is because either the second or the third arguments =20 > should not be strings. > If I understand it right it should be just: > s =3D xmlrpclib.Server("http://user:passwd@localhost/RPC2") > This works for me (Debian Python 2.3). Yep, this works -=20 #!/usr/bin/env python import xmlrpclib server =3D xmlrpclib.Server('http://{username}:{password}@{hostname}/RPC2') person =3D server.person.getById("10100"); print(person["url"]) person["url"] =3D "" person =3D server.person.update(person) print(person["url"] --- producing the output --- awilliam@aleph:~> ./test.py http://www.whitemice.org http://www.whitemice.org -- which is a test case of Bug#1723 --=-0gZlsN4tkPFKK+62Ggvt Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBEYeFeLRePpNle04MRAl2oAJ42KCfv7djP9qrX1NqrVXxVWXzxAQCeKAob 9/FR18lfu7208VPGANLAcMY= =M4jf -----END PGP SIGNATURE----- --=-0gZlsN4tkPFKK+62Ggvt-- From xmlrpc@opengroupware.org Wed May 10 14:30:17 2006 From: xmlrpc@opengroupware.org (Adam Tauno Williams) Date: Wed, 10 May 2006 09:30:17 -0400 Subject: [OGo-XML-RPC] Pyhton 2.4 In-Reply-To: <1147265375.9031.3.camel@localhost> References: <1147259921.9035.20.camel@localhost> <4F977D0D-97E3-4C3E-8FD0-191D8273A346@opengroupware.org> <1147265375.9031.3.camel@localhost> Message-ID: <1147267817.9031.8.camel@localhost> --=-VzDX7kOJugnGAzAnn+y+ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > > > server =3D xmlrpclib.Server(sys.argv[1],sys.argv[2],sys.argv[3]) > > > - then it fails with - > > > AttributeError: 'str' object has no attribute 'request' > > I think this is because either the second or the third arguments =20 > > should not be strings. > > If I understand it right it should be just: > > s =3D xmlrpclib.Server("http://user:passwd@localhost/RPC2") > > This works for me (Debian Python 2.3). > Yep, this works -=20 > #!/usr/bin/env python > import xmlrpclib > server =3D > xmlrpclib.Server('http://{username}:{password}@{hostname}/RPC2') > person =3D server.person.getById("10100"); > print(person["url"]) > person["url"] =3D "" > person =3D server.person.update(person) > print(person["url"] I've made some notes about this in the docs plone. On the page - http://www.opengroupware.org/en/devs/resources/xmlrpc/index.html - is the text: "To call OGo XML-RPC functions you need a XML-RPC client which is able to perform HTTP basic-authentication. The xmlrpc module included with Python does not include this facility (the error printed with the "wrong" library looks like: TypeError: __init__() got an unexpected keyword argument 'login'). We provide a patched module that can handle HTTP basic-authentication. Get the module here." It would be good I think to replace this with a note about how to use the current Python XML-RPC stuff. The patched module doesn't really work anymore either. Also, could the "C# / Mono" section be changed to point to http://docs.opengroupware.org/Members/whitemice/OGoMojo/ ? --=-VzDX7kOJugnGAzAnn+y+ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBEYerpLRePpNle04MRAsa4AJ4qomrIluOqdav8UEsSBJvKCauXNACfagK5 yWh2S75DR1FpWWmoJc8xUX0= =0slp -----END PGP SIGNATURE----- --=-VzDX7kOJugnGAzAnn+y+-- From xmlrpc@opengroupware.org Wed May 10 14:36:27 2006 From: xmlrpc@opengroupware.org (Helge Hess) Date: Wed, 10 May 2006 15:36:27 +0200 Subject: [OGo-XML-RPC] Pyhton 2.4 In-Reply-To: <1147267817.9031.8.camel@localhost> References: <1147259921.9035.20.camel@localhost> <4F977D0D-97E3-4C3E-8FD0-191D8273A346@opengroupware.org> <1147265375.9031.3.camel@localhost> <1147267817.9031.8.camel@localhost> Message-ID: <7C750737-57F1-461D-A501-51B5E5481F2C@opengroupware.org> On 10. Mai 2006, at 15:30 Uhr, Adam Tauno Williams wrote: > Also, could the "C# / Mono" section be changed to point to > http://docs.opengroupware.org/Members/whitemice/OGoMojo/ ? Sure. Would you like to have write access to the webserver section in Svn and do such changes on your own? Frank can probably set this up for you at the end of the week. Greets, Helge -- http://docs.opengroupware.org/Members/helge/ OpenGroupware.org From xmlrpc@opengroupware.org Fri May 12 14:04:53 2006 From: xmlrpc@opengroupware.org (Derya K.) Date: Fri, 12 May 2006 15:04:53 +0200 Subject: [OGo-XML-RPC] loadDocumentAsByteArray() does not work! Message-ID: <446487F5.40900@gmx.de> Hi, i use the method loadDocumentAsByteArray() in the class org.opengroupware.jogi.connect.xmlrpc.XmlRpcProject to load a document from a projekt.* *But it doesn't work!!! byte [] loadfile; loadfile = prj.loadDocumentAsByteArray("pic.jpg"); If i do a System.out.println(prj.exists("pic.jpg")); i get TRUE!!! But the byte array is null! Why that could be? Thanks Derya