Re: [Zope] change properties in external methods (was get properties ....)
Hi Dieter, the slow motion is due to the many requests I do adding all the properties. So how to create one object or let a custom action create all the objects in a minimum of requests? Can you give some more hints about how to set an object with all the properties and how to transmit it via urllib so I can find a start to do it more efficient? -- many thanks for your replies, Elena ----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Elena Schulz" <elena.schulz@gmx.net> Sent: Tuesday, November 26, 2002 8:31 AM Subject: Re: [Zope] change properties in external methods (was get properties ....)
Please stay on the list...
Elena Schulz writes:
now I managed to deal with urllib. But whats about speed? Urllib is quite slow. Is there a change to improve the speed adding a couple of objects with properties via http? Maybe by adding a matrix of properties in one blow? I would not expect that "urllib" makes it much slower (unless you edit properties one after the other).
I would create one object than update all its properties (in 2 HTTP requests).
Of course, when you have hints that its the HTTP roundtime that makes things slow, you can pack all data in a single request and let a custom action create all the objects. However, it is much more work to do.
Dieter
Hi Elena, --On Dienstag, 26. November 2002 10:45 +0100 Elena Schulz <elena.schulz@gmx.net> wrote:
Hi Dieter,
the slow motion is due to the many requests I do adding all the properties. So how to create one object or let a custom action create all the objects in a minimum of requests? Can you give some more hints about how to set an object with all the properties and how to transmit it via urllib so I can find a start to do it more efficient?
I'm currently working on a function pair which creates/recreates complete dictionaries to and from a single string which can be transmitted in a hidden form value or may be request body in your case. (In fact its ready - I'm only in the testing stage ;) In any way you'll end up haveing a dispatcher method on the target site which receives data for object creation as well as their properties. You should be very carefull in designing this as this might open a security hole. Regards Tino
-- many thanks for your replies, Elena
----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Elena Schulz" <elena.schulz@gmx.net> Sent: Tuesday, November 26, 2002 8:31 AM Subject: Re: [Zope] change properties in external methods (was get properties ....)
Please stay on the list...
Elena Schulz writes:
now I managed to deal with urllib. But whats about speed? Urllib is quite slow. Is there a change to improve the speed adding a couple of objects with properties via http? Maybe by adding a matrix of properties in one blow? I would not expect that "urllib" makes it much slower (unless you edit properties one after the other).
I would create one object than update all its properties (in 2 HTTP requests).
Of course, when you have hints that its the HTTP roundtime that makes things slow, you can pack all data in a single request and let a custom action create all the objects. However, it is much more work to do.
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Tino, I am interested in your work as I could use it for a solution for the "busy-feedback" (recent dzug-list-posting) I guess. We had a short correspondence about that and you suggested to do it via an automatic-redirect. There the problem was the transfer of lots of formdata via url. At the moment I can transfer objects with all properties without any change on the target side. Its only quite slow as I need a http-request for any property. -- many thanks for your replies, Elena ----- Original Message ----- From: "Tino Wildenhain" <tino@wildenhain.de> To: "Elena Schulz" <elena.schulz@gmx.net>; <zope@zope.org> Sent: Tuesday, November 26, 2002 11:46 AM Subject: Re: [Zope] change properties in external methods (was get properties ....)
Hi Elena,
--On Dienstag, 26. November 2002 10:45 +0100 Elena Schulz <elena.schulz@gmx.net> wrote:
Hi Dieter,
the slow motion is due to the many requests I do adding all the properties. So how to create one object or let a custom action create all the objects in a minimum of requests? Can you give some more hints about how to set an object with all the properties and how to transmit it via urllib so I can find a start to do it more efficient?
I'm currently working on a function pair which creates/recreates complete dictionaries to and from a single string which can be transmitted in a hidden form value or may be request body in your case. (In fact its ready - I'm only in the testing stage ;)
In any way you'll end up haveing a dispatcher method on the target site which receives data for object creation as well as their properties. You should be very carefull in designing this as this might open a security hole.
Regards Tino
----- Original Message ----- From: "Elena Schulz" <elena.schulz@gmx.net> (...)
At the moment I can transfer objects with all properties without any
change
on the target side. Its only quite slow as I need a http-request for any property.
What makes it slow is more the response to each request than the request itself. When you call 'manage_addProperty' via http, that method is instructed to redirect you to another page, and that page's content is what you get back when you perform 'var = urllib.urlopen(url)', causing delays. (Yes, also happens when you add objects as well. ) You may avoid that behaviour anyway, by using a script (in the target server) with the only mission to perform 'manage_addProperty' for you, so that its only response would be a confirmation message that you could append to the log you may be creating.. In the long run Tino's approach looks the way to go. In either case, I'd like to have a copy of the final code. :) Ausum
-- many thanks for your replies, Elena
----- Original Message ----- From: "Tino Wildenhain" <tino@wildenhain.de> To: "Elena Schulz" <elena.schulz@gmx.net>; <zope@zope.org> Sent: Tuesday, November 26, 2002 11:46 AM Subject: Re: [Zope] change properties in external methods (was get properties ....)
Hi Elena,
--On Dienstag, 26. November 2002 10:45 +0100 Elena Schulz <elena.schulz@gmx.net> wrote:
Hi Dieter,
the slow motion is due to the many requests I do adding all the properties. So how to create one object or let a custom action create all the objects in a minimum of requests? Can you give some more hints about how to set an object with all the properties and how to transmit it via urllib so I can find a start to do it more efficient?
I'm currently working on a function pair which creates/recreates complete dictionaries to and from a single string which can be transmitted in a hidden form value or may be request body in your case. (In fact its ready - I'm only in the testing stage ;)
In any way you'll end up haveing a dispatcher method on the target site which receives data for object creation as well as their properties. You should be very carefull in designing this as this might open a security hole.
Regards Tino
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Tino again, now after the message of Ausum I understand the option to improve my ZupLoader :-) I have to pack the object data with the property-info transferred to a string send it in one or may be two http-requests to a remote dispacher-script (should be just a script nothing else) that unpacks the property-info and create an object with the properties on the remote zope. So if your functionpair is ready for packing and transferring the property-info via formdata etc. I would be happy to use it for this purpous. But I don't understand the security issue here. For the upload I need to login as Manager. The unpacker will need the proxy Manager too. Of course the transfer of the login-info is a critical point as I cannot use https. But thats the same with normal login which is done via http. So were is the extra problem? Is there no other solution to send an object packed with all property-info that can be unpacked just by a Python Script? May be _setObject(), _getOb() or the like? -- many thanks for your replies, Elena ----- Original Message ----- From: "Tino Wildenhain" <tino@wildenhain.de> To: "Elena Schulz" <elena.schulz@gmx.net>; <zope@zope.org> Sent: Tuesday, November 26, 2002 11:46 AM Subject: Re: [Zope] change properties in external methods (was get properties ....)
Hi Elena,
--On Dienstag, 26. November 2002 10:45 +0100 Elena Schulz <elena.schulz@gmx.net> wrote:
Hi Dieter,
the slow motion is due to the many requests I do adding all the properties. So how to create one object or let a custom action create all the objects in a minimum of requests? Can you give some more hints about how to set an object with all the properties and how to transmit it via urllib so I can find a start to do it more efficient?
I'm currently working on a function pair which creates/recreates complete dictionaries to and from a single string which can be transmitted in a hidden form value or may be request body in your case. (In fact its ready - I'm only in the testing stage ;)
In any way you'll end up haveing a dispatcher method on the target site which receives data for object creation as well as their properties. You should be very carefull in designing this as this might open a security hole.
Regards Tino
Elena Schulz wrote:
Hi Tino again,
now after the message of Ausum I understand the option to improve my ZupLoader :-) I have to pack the object data with the property-info transferred to a string send it in one or may be two http-requests to a remote dispacher-script (should be just a script nothing else) that unpacks the property-info and create an object with the properties on the remote zope.
So if your functionpair is ready for packing and transferring the property-info via formdata etc. I would be happy to use it for this purpous.
But I don't understand the security issue here. For the upload I need to login as Manager. The unpacker will need the proxy Manager too. Of course the transfer of the login-info is a critical point as I cannot use https. But thats the same with normal login which is done via http. So were is the extra problem?
Is there no other solution to send an object packed with all property-info that can be unpacked just by a Python Script? May be _setObject(), _getOb() or the like?
Hmm, am I blind or are you reinventing the wheel? Isn't that what you want to do (and more) solved already by ZSyncher? Maybe you'll be at least able to get some ideas from its source. cheers, oliver
How do you use ZSyncher from your account at Freezope to another Zope site, without asking their administrators to install it? That was clearly stated from the begining of the thread. By the way, to reinvent the wheel isn't a bad thing at all. Ask Goodyear or Bridgestone how they feel about it ;) Ausum ----- Original Message ----- From: "Oliver Bleutgen" <myzope@gmx.net> To: "Elena Schulz" <elena.schulz@gmx.net> Cc: <zope@zope.org> Sent: Thursday, November 28, 2002 11:06 AM Subject: Re: [Zope] ZupLoader and change properties in external methods
Elena Schulz wrote:
Hi Tino again,
now after the message of Ausum I understand the option to improve my ZupLoader :-) I have to pack the object data with the property-info transferred to a string send it in one or may be two http-requests to a remote dispacher-script (should be just a script nothing else) that unpacks the property-info and create an object with the properties on the remote zope.
So if your functionpair is ready for packing and transferring the property-info via formdata etc. I would be happy to use it for this purpous.
But I don't understand the security issue here. For the upload I need to login as Manager. The unpacker will need the proxy Manager too. Of course the transfer of the login-info is a critical point as I cannot use https. But thats the same with normal login which is done via http. So were is the extra problem?
Is there no other solution to send an object packed with all property-info that can be unpacked just by a Python Script? May be _setObject(), _getOb() or the like?
Hmm, am I blind or are you reinventing the wheel? Isn't that what you want to do (and more) solved already by ZSyncher? Maybe you'll be at least able to get some ideas from its source.
cheers, oliver
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Ausum Studio -
Elena Schulz -
Oliver Bleutgen -
Tino Wildenhain