Command line access to Zope data
I am assumming that all data on a Zope hosted website resides in Data.fs even if you are running a Plone site. If so, how do you update something like Plone news items from the command line? -- John
John Poltorak wrote:
I am assumming that all data on a Zope hosted website resides in Data.fs even if you are running a Plone site.
If so, how do you update something like Plone news items from the command line?
You can use a ZEO debug session to connect a Python console to a live Zope server. I do this all the time, and it's great. You could presumably also go about this with FTP. You can also make your own tools to interact with Zope via XML-RPC or in a RESTful manner (wget can be a REST tool). --jcc -- "He who fights with monsters should look to it that he himself does not become a monster. And when you gaze long into an abyss the abyss also gazes into you."
On Fri, Feb 20, 2004 at 04:46:13PM -0600, J Cameron Cooper wrote:
John Poltorak wrote:
I am assumming that all data on a Zope hosted website resides in Data.fs even if you are running a Plone site.
If so, how do you update something like Plone news items from the command line?
You can use a ZEO debug session to connect a Python console to a live Zope server. I do this all the time, and it's great.
You could presumably also go about this with FTP.
or webdav. I haven't tried either with plone lately.
You can also make your own tools to interact with Zope via XML-RPC or in a RESTful manner (wget can be a REST tool).
Yes, this is covered in the Advanced Scripting chapter of the zope book, way down at the bottom: http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.stx Look for the "Remote Scripting and Network Services" section. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's SILVAN FOOLISH GARBAGE-COLLECTOR! (random hero from isometric.spaceninja.com)
On Fri, Feb 20, 2004 at 06:03:52PM -0500, Paul Winkler wrote:
On Fri, Feb 20, 2004 at 04:46:13PM -0600, J Cameron Cooper wrote:
John Poltorak wrote:
I am assumming that all data on a Zope hosted website resides in Data.fs even if you are running a Plone site.
If so, how do you update something like Plone news items from the command line?
You can use a ZEO debug session to connect a Python console to a live Zope server. I do this all the time, and it's great.
You could presumably also go about this with FTP.
or webdav. I haven't tried either with plone lately.
I don't know anything about webdav. Is there a definitive reference for it? As for use FTP, how would I use that? I presumed that Zope stored data in its own database, so wouldn't I need to import the uploaded files into that database?
You can also make your own tools to interact with Zope via XML-RPC or in a RESTful manner (wget can be a REST tool).
Yes, this is covered in the Advanced Scripting chapter of the zope book, way down at the bottom:
http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.stx
Look for the "Remote Scripting and Network Services" section.
Where would I find the format of something like a News item?
--
Paul Winkler http://www.slinkp.com Look! Up in the sky! It's SILVAN FOOLISH GARBAGE-COLLECTOR! (random hero from isometric.spaceninja.com)
-- John
On Fri, Feb 20, 2004 at 11:24:10PM +0000, John Poltorak wrote:
On Fri, Feb 20, 2004 at 06:03:52PM -0500, Paul Winkler wrote:
On Fri, Feb 20, 2004 at 04:46:13PM -0600, J Cameron Cooper wrote:
John Poltorak wrote:
I am assumming that all data on a Zope hosted website resides in Data.fs even if you are running a Plone site.
If so, how do you update something like Plone news items from the command line?
You can use a ZEO debug session to connect a Python console to a live Zope server. I do this all the time, and it's great.
You could presumably also go about this with FTP.
or webdav. I haven't tried either with plone lately.
I don't know anything about webdav. Is there a definitive reference for it?
http://webdav.org Zope has a built-in webdav server.
As for use FTP, how would I use that? I presumed that Zope stored data in its own database, so wouldn't I need to import the uploaded files into that database?
Zope has a built-in FTP server. You can ftp directly to Zope. Plone allows you to configure what content types it creates based on MIME type. I forget exactly how, I think it's documented in the plone book.
You can also make your own tools to interact with Zope via XML-RPC or in a RESTful manner (wget can be a REST tool).
Yes, this is covered in the Advanced Scripting chapter of the zope book, way down at the bottom:
http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ScriptingZope.stx
Look for the "Remote Scripting and Network Services" section.
Where would I find the format of something like a News item?
In general, for this kind of question, you figure it out by looking at HTML source. In this case, view source of the news item edit page. From that you can figure out where to post to, and what parameters to pass. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's JANITOR LUGGAGE! (random hero from isometric.spaceninja.com)
On Fri, Feb 20, 2004 at 06:35:18PM -0500, Paul Winkler wrote:
I don't know anything about webdav. Is there a definitive reference for it?
http://webdav.org Zope has a built-in webdav server.
What do I use as a client? And how do I tell if the webdav server is enabled? I presume it isn't by default...
--
Paul Winkler http://www.slinkp.com Look! Up in the sky! It's JANITOR LUGGAGE! (random hero from isometric.spaceninja.com)
-- John
On Friday 20 February 2004 06:11 pm, John Poltorak wrote:
On Fri, Feb 20, 2004 at 06:35:18PM -0500, Paul Winkler wrote:
I don't know anything about webdav. Is there a definitive reference for it?
http://webdav.org Zope has a built-in webdav server.
What do I use as a client?
I understand some editors support WebDav directly (especially on Windows?) but for Linux there is a package that allows you to access a WebDav site as a filesystem. You need a kernel patch (which I don't have installed, so I haven't tried it yet). I think it's hosted on SourceForge, but I've forgotten the name of the package. I believe the kernel patch is for "coda support" (IIRC).
And how do I tell if the webdav server is enabled? I presume it isn't by default...
Nope, Zope starts HTTP, FTP, and WebDav servers by default. -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
On Fri, Feb 20, 2004 at 06:45:42PM -0600, Terry Hancock wrote:
On Friday 20 February 2004 06:11 pm, John Poltorak wrote:
On Fri, Feb 20, 2004 at 06:35:18PM -0500, Paul Winkler wrote:
I don't know anything about webdav. Is there a definitive reference for it?
http://webdav.org Zope has a built-in webdav server.
What do I use as a client?
I understand some editors support WebDav directly (especially on Windows?) but for Linux there is a package that allows you to access a WebDav site as a filesystem. You need a kernel patch (which I don't have installed, so I haven't tried it yet). I think it's hosted on SourceForge, but I've forgotten the name of the package. I believe the kernel patch is for "coda support" (IIRC).
Can't I use something like Netscape? I don't use either Windows or Linux.
And how do I tell if the webdav server is enabled? I presume it isn't by default...
Nope, Zope starts HTTP, FTP, and WebDav servers by default.
It looks as though FTP is the simplest option for me, so how would I do something like upload a news item to a Plone based site?
-- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
-- John
On Feb 21, 2004, at 6:34 AM, John Poltorak wrote:
I understand some editors support WebDav directly (especially on Windows?) but for Linux there is a package that allows you to access a WebDav site as a filesystem. You need a kernel patch (which I don't have installed, so I haven't tried it yet). I think it's hosted on SourceForge, but I've forgotten the name of the package. I believe the kernel patch is for "coda support" (IIRC).
Can't I use something like Netscape?
I don't use either Windows or Linux.
Do you use OS X? If so, WebDAV support is native. I do all my Zope editing in BBEdit through a WebDAV connection to my srever. ___/ / __/ / ____/ Ed Leafe Linux Love: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
On Sat, Feb 21, 2004 at 07:01:28AM -0500, Ed Leafe wrote:
On Feb 21, 2004, at 6:34 AM, John Poltorak wrote:
I understand some editors support WebDav directly (especially on Windows?) but for Linux there is a package that allows you to access a WebDav site as a filesystem. You need a kernel patch (which I don't have installed, so I haven't tried it yet). I think it's hosted on SourceForge, but I've forgotten the name of the package. I believe the kernel patch is for "coda support" (IIRC).
Can't I use something like Netscape?
I don't use either Windows or Linux.
Do you use OS X?
Only when X = 2 ;-)...
___/ / __/ / ____/ Ed Leafe
Linux Love: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
-- John
On Saturday 21 February 2004 08:45, Terry Hancock wrote:
On Friday 20 February 2004 06:11 pm, John Poltorak wrote:
On Fri, Feb 20, 2004 at 06:35:18PM -0500, Paul Winkler wrote:
I don't know anything about webdav. Is there a definitive reference for it?
http://webdav.org Zope has a built-in webdav server.
What do I use as a client?
I understand some editors support WebDav directly (especially on Windows?) but for Linux there is a package that allows you to access
and if we're running some form of kde, we can actually get to webdav server like so: webdav://your.server:port/something and that's it. auto ide :P
a WebDav site as a filesystem. You need a kernel patch (which I don't have installed, so I haven't tried it yet). I think it's hosted on SourceForge, but I've forgotten the name of the package. I believe the kernel patch is for "coda support" (IIRC).
And how do I tell if the webdav server is enabled? I presume it isn't by default...
Nope, Zope starts HTTP, FTP, and WebDav servers by default.
-- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Tuesday 24 February 2004 03:55 am, Bakhtiar A Hamid wrote:
On Saturday 21 February 2004 08:45, Terry Hancock wrote:
I understand some editors support WebDav directly (especially on Windows?) but for Linux there is a package that allows you to access
and if we're running some form of kde, we can actually get to webdav server like so:
webdav://your.server:port/something
Um. That's just the URL. Where does this need to be typed? It doesn't make sense to type it in a terminal window, it might work in Konqueror (but not in mine). Was there a particular application it works in? Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 26 February 2004 15:53, Terry Hancock is believed to have said:
On Tuesday 24 February 2004 03:55 am, Bakhtiar A Hamid wrote:
On Saturday 21 February 2004 08:45, Terry Hancock wrote:
I understand some editors support WebDav directly (especially on Windows?) but for Linux there is a package that allows you to access
and if we're running some form of kde, we can actually get to webdav server like so:
webdav://your.server:port/something
Um. That's just the URL. Where does this need to be typed? It doesn't make sense to type it in a terminal window, it might work in Konqueror (but not in mine). Was there a particular application it works in?
Konqueror works and Kate as well (in file open dialog ).
Cheers, Terry
-- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
- -- Eckart Hertzler Senior Consultant G+J Electronic Media Services GmbH 20457 Hamburg Tel. : +49 40 3703 7591 Fax : +49 40 3703 - 5792 email: hertzler.eckart@guj.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAPiYdxvP4sHhhP/gRAmw2AKD1nZD6zTv1OdaclTLTUD+0emgsxgCglUai G9aCYbPWYBMPR3ROgG/podw= =OlMC -----END PGP SIGNATURE-----
On Thursday 26 February 2004 11:00 am, Eckart Hertzler wrote:
Konqueror works and Kate as well (in file open dialog ).
Okay. It probably works in a later version than I'm using (no surprise, I'm using 2.2.2). Cheers, Terry -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
you may try skunkdav http://skunkdav.sourceforge.net/ gilles ----- Original Message ----- From: "Eckart Hertzler" <hertzler.eckart@guj.de> To: <zope@zope.org> Sent: Thursday, February 26, 2004 6:00 PM Subject: Re: [Zope] Command line access to Zope data -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 26 February 2004 15:53, Terry Hancock is believed to have said:
On Tuesday 24 February 2004 03:55 am, Bakhtiar A Hamid wrote:
On Saturday 21 February 2004 08:45, Terry Hancock wrote:
I understand some editors support WebDav directly (especially on Windows?) but for Linux there is a package that allows you to access
and if we're running some form of kde, we can actually get to webdav server like so:
webdav://your.server:port/something
Um. That's just the URL. Where does this need to be typed? It doesn't make sense to type it in a terminal window, it might work in Konqueror (but not in mine). Was there a particular application it works in?
Konqueror works and Kate as well (in file open dialog ).
Cheers, Terry
-- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
- -- Eckart Hertzler Senior Consultant G+J Electronic Media Services GmbH 20457 Hamburg Tel. : +49 40 3703 7591 Fax : +49 40 3703 - 5792 email: hertzler.eckart@guj.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAPiYdxvP4sHhhP/gRAmw2AKD1nZD6zTv1OdaclTLTUD+0emgsxgCglUai G9aCYbPWYBMPR3ROgG/podw= =OlMC -----END PGP SIGNATURE----- _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
John Poltorak wrote:
I am assumming that all data on a Zope hosted website resides in Data.fs even if you are running a Plone site.
If so, how do you update something like Plone news items from the command line?
As others have written you can connect to Zope in different ways. Zope takes care of marshalling and demarshalling the data. So if you get a news object from Zope by using FTP it will look like a normal HTML file to your editor, command line tool or other. You can then edit the ASCII file and save it back and Zope takes care of updating the database accordingly. A news item will look like this: ---- <html> <head> <title>My news item</title> <meta name="Subject" content="Cars" /> <meta name="Publisher" content="No publisher" /> <meta name="Description" content="This is a test of ftp to a news item" /> <meta name="Contributors" content="" /> <meta name="Effective_date" content="2004-02-21 14:37:19" /> <meta name="Expiration_date" content="2004-10-14 00:00:00" /> <meta name="Type" content="News Item" /> <meta name="Format" content="text/html" /> <meta name="Language" content="en" /> <meta name="Rights" content="" /> <meta name="SafetyBelt" content="1077369940.66" /> </head> <body> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus ligula urna, luctus a, bibendum ut, aliquet id, felis. Donec fermentum dui at eros. Duis ullamcorper mauris suscipit ipsum. Suspendisse pretium sagittis arcu. Praesent tincidunt feugiat erat. Mauris facilisis condimentum lacus. Maecenas accumsan. Nunc bibendum. </p> </body> </html> -- /Anton Stonor
On Sat, Feb 21, 2004 at 02:39:53PM +0100, Anton Stonor wrote:
John Poltorak wrote:
I am assumming that all data on a Zope hosted website resides in Data.fs even if you are running a Plone site.
If so, how do you update something like Plone news items from the command line?
As others have written you can connect to Zope in different ways. Zope takes care of marshalling and demarshalling the data. So if you get a news object from Zope by using FTP it will look like a normal HTML file to your editor, command line tool or other. You can then edit the ASCII file and save it back and Zope takes care of updating the database accordingly.
OK, so how does Zope's FTP recognise it is getting a news object and how does it know which Plone site it is meant for, since there could be multiple sites being hosted?
A news item will look like this:
Thanks, I will give this a try once I plug the gaps in my understanding of how it works. So far I have the format of a file stored locally, say newsitem.txt, once I ftp to:- myzopeftp.org 8021 how should the transaction proceed, assuming I have a Plone site called Plon1?
--
/Anton Stonor
-- John
OK, so how does Zope's FTP recognise it is getting a news object and how does it know which Plone site it is meant for, since there could be multiple sites being hosted?
If you are creating a new news object you can give the file a .news extension and CMF will recognize it. You can control that in the content_type_registry. To get it in the right place you simply FTP to the right place, for instance mysite.com/plon1/allmynews/mynewsitem /Anton
On Sat, Feb 21, 2004 at 04:11:22PM +0100, Anton Stonor wrote:
OK, so how does Zope's FTP recognise it is getting a news object and how does it know which Plone site it is meant for, since there could be multiple sites being hosted?
If you are creating a new news object you can give the file a .news extension and CMF will recognize it. You can control that in the content_type_registry.
To get it in the right place you simply FTP to the right place, for instance
mysite.com/plon1/allmynews/mynewsitem
I've just run FTP, entered USER and PASS and got a successful login but when I try list , I get 530 Unauthorised. pwd shows '/' but I don't know where to upload to. Is there a directory on the filesystem, or is this done internally via Zope's database? There is no directory call myplonesite under /opt/zope that I am aware of.
/Anton
-- John
I've just run FTP, entered USER and PASS and got a successful login but when I try list , I get 530 Unauthorised.
Are you sure you are connecting to the Zope ftp server and not a standard ftp server on the box? Zope ftp is often at port 8021--look in the zope config file. USER and PASS are the same as your Zope login, the same is the case for permissions.
pwd shows '/' but I don't know where to upload to. Is there a directory on the filesystem, or is this done internally via Zope's database?
There is no directory call myplonesite under /opt/zope that I am aware of.
You don't wanna ftp to the file system, but to Zope. The ftp dirs and files reflects the folders and other objects in your ZODB. Anton
On Sat, Feb 21, 2004 at 06:05:44PM +0100, Anton Stonor wrote:
I've just run FTP, entered USER and PASS and got a successful login but when I try list , I get 530 Unauthorised.
Are you sure you are connecting to the Zope ftp server and not a standard ftp server on the box? Zope ftp is often at port 8021--look in the zope config file.
USER and PASS are the same as your Zope login, the same is the case for permissions.
Yes, my login works fine - I get a 230 Login successful. Maybe some permission needs to be set for FTP access... Is there a good reference on Zope's FTP server? I haven't found anything which provides much information about it.
pwd shows '/' but I don't know where to upload to. Is there a directory on the filesystem, or is this done internally via Zope's database?
There is no directory call myplonesite under /opt/zope that I am aware of.
You don't wanna ftp to the file system, but to Zope. The ftp dirs and files reflects the folders and other objects in your ZODB.
I guess this won't make much sense until I can actually get 'list' to display something.... Is there a Zope log which might explain why I'm getting a 530 Unauthorised msg?
Anton
-- John
On Sat, Feb 21, 2004 at 07:13:59PM +0000, John Poltorak wrote:
Yes, my login works fine - I get a 230 Login successful.
I think you'll find that the Zope FTP server gives that response to *any* name and password that you provide.
Maybe some permission needs to be set for FTP access...
Perhaps the "FTP Access" permission (in the ZMI Security tab)? On my system at hand only the Admin and Manager roles have that permission at the Zope root; I don't know what the default is as installed. Only a username associated with a role that has that "FTP Access" permission will be able to list files or do any FTP activity other than login.
On Sat, Feb 21, 2004 at 02:47:55PM -0600, Fred Yankowski wrote:
On Sat, Feb 21, 2004 at 07:13:59PM +0000, John Poltorak wrote:
Yes, my login works fine - I get a 230 Login successful.
I think you'll find that the Zope FTP server gives that response to *any* name and password that you provide.
Maybe some permission needs to be set for FTP access...
Perhaps the "FTP Access" permission (in the ZMI Security tab)? On my system at hand only the Admin and Manager roles have that permission at the Zope root; I don't know what the default is as installed. Only a username associated with a role that has that "FTP Access" permission will be able to list files or do any FTP activity other than login.
I have managed to login with a newly created account and can cwd to the member's directory but can't display what is there. -- John
John Poltorak wrote at 2004-2-21 19:13 +0000:
... Is there a good reference on Zope's FTP server? I haven't found anything which provides much information about it.
With OpenSource components, the source may provide helpful documentation. It does for Zope's FTP Server. The source is located in "ZServer/FTPServer.py".
... Is there a Zope log which might explain why I'm getting a 530 Unauthorised msg?
You may configure your "error_log" object to report "Unauthorized" exceptions. I am not sure, whether the information will be helpful, though. -- Dieter
participants (11)
-
Anton Stonor -
Bakhtiar A Hamid -
Dieter Maurer -
Eckart Hertzler -
Ed Leafe -
Fred Yankowski -
Gilles Lavaux -
J Cameron Cooper -
John Poltorak -
Paul Winkler -
Terry Hancock