Re: [Zope] calling a product with xmlrpc

2006-04-12 Thread Dieter Maurer
Paul Winkler wrote at 2006-4-11 20:06 -0400:
> ...
>I do think it's odd he got NotFound

One gets "NotFound" with "debug-mode off", one gets a
message describing that a docstring is missing with "debug-mode on".

It was an error to switch to "debug-mode off" by default...


-- 
Dieter
___
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 )


Re: [Zope] calling a product with xmlrpc

2006-04-11 Thread Paul Winkler
On Tue, Apr 11, 2006 at 04:55:18PM -0500, J Cameron Cooper wrote:
> I'm sure it's in the Zope book.

Doubt it, as the Zope book doesn't cover filesystem Product development.

But it is in the ZDG :)
http://www.zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx

I do think it's odd he got NotFound, I haven't seen that.
Maybe I'm just so used to running in debug mode that I've fixed
all these before they ever got to a production server ;-)

-- 

Paul Winkler
http://www.slinkp.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 )


Re: [Zope] calling a product with xmlrpc

2006-04-11 Thread J Cameron Cooper

Reinoud van Leeuwen wrote:

On Tue, Apr 11, 2006 at 01:43:22PM -0500, Floyd May wrote:


Paul Winkler wrote:


On Tue, Apr 11, 2006 at 05:54:35PM +0200, Reinoud van Leeuwen wrote:


[...]
This however generates a NotFound Exception :-(


I'm not sure why you get NotFound, but one thing I spotted is that
anything you want to publish in zope 2 must have a docstring.



I've ran into situations where lack-of-docstring results in a NotFound. 
  Not saying that this is the sole culprit of the trouble, but it's 
certainly worth knowing.



Thanks! that did it!

Is this a bug or a feature? I would expect something else in the errorlog 
(or a warning in the eventlog)


It's fundamental Zope security. Old as the hills.

I'm sure it's in the Zope book.

--jcc
--
"Building Websites with Plone"
http://plonebook.packtpub.com/

Enfold Systems, LLC
http://www.enfoldsystems.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 )


Re: [Zope] calling a product with xmlrpc

2006-04-11 Thread Dieter Maurer
Reinoud van Leeuwen wrote at 2006-4-11 17:54 +0200:
>I have a working Pyhton script to search for users in a plone site with a 
>commandline xmlrpc client. It cannot be changed into an external method 
>because of the fact that it only works when running under a role with 
>sufficient rights.
>So I turned it into a product.
>
>Basically I have (I have deleted some obvious code):
>
>class Xmlrpcindex(UniqueObject, SimpleItem):
>security = ClassSecurityInfo()
>security.declarePublic('search')
>
>def search (self, SearchableText):

All published methods must have a non empty docstring.
You search lacks a docstring.

If you run Zope in development mode ("debug-mode on"), you will get
a better error message.

> ...
>server = xmlrpclib.Server('http://localhost/plonesite/my_xmlrpc_instance')
>results = server.search('sometext')
>
>
>This however generates a NotFound Exception :-(
>
>Am I doing something elementary wrong? Should I call the search method in 
>another way?
>
>>From the ZMI error log:
>
>User Name (User Id) Anonymous User (None)
>Request URL http://localhost/plonesite/my_xmlrpc_instance/search
>Exception Type NotFound

-- 
Dieter
___
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 )


Re: [Zope] calling a product with xmlrpc

2006-04-11 Thread Reinoud van Leeuwen
On Tue, Apr 11, 2006 at 01:43:22PM -0500, Floyd May wrote:
> Paul Winkler wrote:
> >On Tue, Apr 11, 2006 at 05:54:35PM +0200, Reinoud van Leeuwen wrote:
> >>[...]
> >>This however generates a NotFound Exception :-(
> >
> >I'm not sure why you get NotFound, but one thing I spotted is that
> >anything you want to publish in zope 2 must have a docstring.
> >
> 
> I've ran into situations where lack-of-docstring results in a NotFound. 
>Not saying that this is the sole culprit of the trouble, but it's 
> certainly worth knowing.

Thanks! that did it!

Is this a bug or a feature? I would expect something else in the errorlog 
(or a warning in the eventlog)

-- 
__
"Nothing is as subjective as reality"
Reinoud van Leeuwen[EMAIL PROTECTED]
http://www.xs4all.nl/~reinoud
__
___
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 )


Re: [Zope] calling a product with xmlrpc

2006-04-11 Thread Floyd May

Paul Winkler wrote:

On Tue, Apr 11, 2006 at 05:54:35PM +0200, Reinoud van Leeuwen wrote:

[...]
This however generates a NotFound Exception :-(


I'm not sure why you get NotFound, but one thing I spotted is that
anything you want to publish in zope 2 must have a docstring.



I've ran into situations where lack-of-docstring results in a NotFound. 
   Not saying that this is the sole culprit of the trouble, but it's 
certainly worth knowing.



--
Floyd May
Senior Systems Analyst
CTLN - CareerTech Learning Network
[EMAIL PROTECTED]
___
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 )


Re: [Zope] calling a product with xmlrpc

2006-04-11 Thread Paul Winkler
On Tue, Apr 11, 2006 at 05:54:35PM +0200, Reinoud van Leeuwen wrote:
> Hi,
> 
> I have a working Pyhton script to search for users in a plone site with a 
> commandline xmlrpc client. It cannot be changed into an external method 
> because of the fact that it only works when running under a role with 
> sufficient rights.
> So I turned it into a product.
> 
> Basically I have (I have deleted some obvious code):
> 
> class Xmlrpcindex(UniqueObject, SimpleItem):
> security = ClassSecurityInfo()
> security.declarePublic('search')
> 
> def search (self, SearchableText):
>   return 'foobar'
> 
> The product is recignized as a Zope product and Plone product. It is 
> installed in my Plone instance and I have made an instance in my Plone 
> root (with id my_xmlrpc_instance).
> 
> So the client looks like this:
> 
> import xmlrpclib
> server = xmlrpclib.Server('http://localhost/plonesite/my_xmlrpc_instance')
> results = server.search('sometext')
> 
> 
> This however generates a NotFound Exception :-(

I'm not sure why you get NotFound, but one thing I spotted is that
anything you want to publish in zope 2 must have a docstring.

Stating the obvious: have you at least verified that the server url is
correct?  You should be able to point your browser directly at 
http://localhost/plonesite/my_xmlrpc_instance .

also, I'm not familiar with xmlrpclib.Server.
The library docs only mention xmlrpclib.ServerProxy, afaict.
Presumably that's just a typo and you are using the standard
xmlrpclib?

-- 

Paul Winkler
http://www.slinkp.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 )


[Zope] calling a product with xmlrpc

2006-04-11 Thread Reinoud van Leeuwen
Hi,

I have a working Pyhton script to search for users in a plone site with a 
commandline xmlrpc client. It cannot be changed into an external method 
because of the fact that it only works when running under a role with 
sufficient rights.
So I turned it into a product.

Basically I have (I have deleted some obvious code):

class Xmlrpcindex(UniqueObject, SimpleItem):
security = ClassSecurityInfo()
security.declarePublic('search')

def search (self, SearchableText):
return 'foobar'

The product is recignized as a Zope product and Plone product. It is 
installed in my Plone instance and I have made an instance in my Plone 
root (with id my_xmlrpc_instance).

So the client looks like this:

import xmlrpclib
server = xmlrpclib.Server('http://localhost/plonesite/my_xmlrpc_instance')
results = server.search('sometext')


This however generates a NotFound Exception :-(

Am I doing something elementary wrong? Should I call the search method in 
another way?

>From the ZMI error log:

User Name (User Id) Anonymous User (None)
Request URL http://localhost/plonesite/my_xmlrpc_instance/search
Exception Type  NotFound
Exception Value http://localhost/plonesite/my_xmlrpc_instance/search

Traceback (innermost last):

* Module ZPublisher.Publish, line 92, in publish
* Module ZPublisher.BaseRequest, line 344, in traverse
* Module ZPublisher.HTTPResponse, line 640, in debugError



-- 
__
"Nothing is as subjective as reality"
Reinoud van Leeuwen[EMAIL PROTECTED]
http://www.xs4all.nl/~reinoud
__
___
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 )