[Zope] Exporting zodb data (Urgent)

Sukhwinder Singh ssruprai@hotmail.com
Sun, 29 Jun 2003 01:13:39 +0530


> You do have a problem.  I suspect you will need to learn a bit about Zope
> to do much of anything.  Have you examined the system using the ZMI?
> http://yourURL/manage?  You can extract most of the information in the
> system  through FTP.  Which port depends upon how the Zope system has been
> started.  Typically, if you start XZZope on port 8080, ftp access is
> available on port 8021.

I have tried to read whatever I could in last two days. But there is not
much information available on net about zodb.
I have used and explored zope management interface. I also read the zope
developers guide. There is not much information about how zope stores
objects in zodb and how to access those objects. Other documentation provide
information about storing data and then retrieving that data. No
documentation is available about how to retrieve already stored data about
which I don't have any prior knowledge. As in java, ide's use introspection
to determine what are fields and methods of a object (bean). Other DBMS also
allow us to determine how many tables etc. are there in database. But how do
I do that with zope and zodb?

I can access objects If I knew which objects store data and how many fields
are there in each object. Looking into every dtml file or other methods
isn't possible in this shot period. Even If I did that I may miss some
fields which are used in this application.

--Sukhwinder Singh

----- Original Message -----
From: "Dennis Allison" <allison@sumeru.stanford.EDU>
To: "Sukhwinder Singh" <ssruprai@hotmail.com>
Cc: <zope@zope.org>
Sent: Friday, June 27, 2003 9:45 PM
Subject: Re: [Zope] Exporting zodb data (Urgent)


> You do have a problem.  I suspect you will need to learn a bit about Zope
> to do much of anything.  Have you examined the system using the ZMI?
> http://yourURL/manage?  You can extract most of the information in the
> system  through FTP.  Which port depends upon how the Zope system has been
> started.  Typically, if you start XZZope on port 8080, ftp access is
> available on port 8021.
>
> HTH, -d
>
> On Fri, 27 Jun 2003, Sukhwinder Singh wrote:
>
> > Hello,
> >
> >     (I posted this question to zope-db@zope.org but no one replied so I
am posting it here as it is urgent.)
> > I have a web application which is written by some other person using
> > zope/zodb/python. Now client wants to write this application using
> > php/mysql. But existing data stored in zodb database has to be exported
to
> > mysql database. Zodb uses fileStorage to store data. I have tried zope's
xml
> > export but that doesn't make any sense to me.
> >
> >     Now problem is I don't have much knowledge about zope. I have only
basic
> > knowledge that everything is stored as an object. I also have some
knowledge
> > of python. I have searched the web for any information about zodb but
could
> > not find much. I have only 2-3 days so I cannot learn zope then zodb and
> > then python. My problems are:
> >
> >     1. How do I identify which of these objects store data(tables)
because
> > zope stores everything (images, dhtml files, folders etc) as objects so
I
> > want only objects which store data(rows) and then how many of these
tables
> > are there?
> >
> >     2.How do I determine how many fields are there in each data object
and
> > what are their names and data types.
> >
> >     3. How do I extract data from these objects and then store that to
some
> > intermediate format (csv) and then import it to mysql.
> >
> >     So what I want to do is introspection.
> >
> >     I don't know where to start.
> >
> >     There are many sub-folders under this web applications. I know that
I
> > have to use external methods and I have tried it like this:
> >
> >         from ZODB import FileStorage, DB
> >           storage = FileStorage.FileStorage('data.fs')
> >           db = DB( storage )
> >           connection = db.open()
> >           root = connection.root() // up to this point it works.
> >
> >     now when I try something like:
> >
> >           students = root['students']
> >
> >       error message is displayed that students not found.
> >
> >       For this reason I want to determine in which objects data is
stored so
> > that I can get its values.
> >       I also have to determine the name of the attributes (fields) used
in
> > this objects so that I can create mysql table fields of the same name
and
> > data type.
> >
> >       If possible, please give me complete code which I can just copy
and
> > paste in external method file. If that is no possible then provide some
> > other working example or explain the steps in detail as I don't have
much
> > knowledge about zope and co.
> >
> >
> >
>
>