Re: [Zope3-Users] Trouble with Skins

2007-06-27 Thread Arne Nordmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Herman,

thank you very much for your answer.

 However, this case shows me that I'm not the only one with such problems. 
 These ComponentLookupErrors and cryptic tracebacks (at least for newbies) 
 drove me mad and costed me hours to resolve. In the end it was always my 
 fault, e.g.:
 
 - Forgot to add the appropriate  layer to the request
 - Forgot to omit __parent__ in my formlib class
 - Forgot to register something or registered it for the wrong interface
You were completely right. The problem was an absent comma in
standardmacros.py and an incorrect closed metal-tag. [1]

 I'm curious how others deal with this problem because I'm often paralyzed by 
 this ComponentLookupError. The traceback also does not show which interface 
 my objects provide - for example it cannot be seen if a BrowserRequest 
 provides a specific layer or not. To solve this problem, I had to insert 
 something like print IMyLayer.providedBy(request) into the Zope source to 
 find out what happens.
Phillip von Weitershausen had a great talk at the DZUG conference this
year about Zope on a Paste[2]. He demonstrated some kind of middleware
that does what you asked for - giving you the possibility to look into
every object in the moment the error occurred.
I wonder if a tool like this will find it's way to the ordinary Zope3
user. Phillip?

 Maybe a Zope3 newbie-debug-mode would help a lot that throws a traceback 
 like this (regarding to the original problem)?
 
 
 ... Original Traceback ...
 --- Verbose Traceback ---
 ...
I'm completely with you at this point. When I came to the point to solve
a problem based on a traceback for the first time, I was stuck.
Even when I solved those problems in the past, I often couldn't find a
hint in the traceback retroactively, even with knowing the actual problem.

I often thought about something like you suggested - a kinda comfort
traceback.
One of the advantages of a CMS-like system like Zope is, that you don't
have to care about the entire machine that is working in the background
behind your application. But from the moment on you get the error, you
are forced to deal with the traceback that gives you lots of information
on parts of this machine you don't really want to deal with.

As I mentioned, I'm loosely thinking about this kinda comfort traceback
for months, but I don't really think that my understanding of the Zope3
machine is deep enough to do this on my own.
Perhaps there should be a draft or some kind of feature request thrown
to the Zope3-dev list to exchange opinions with the developers.

Regards,

Arne

- -
[1] For those, who deal with the same error:
- - I forgot to type the comma in the value of the attribute 'macro_pages'
of zope.app.basicskin.standardmacros.StandardMacros (see example 10.3.2
in Phillip's book Web Component Development With Zope3, 2nd Edition)
- - I falsely closed a metal:slot-tag with /metal instead of
/metal:slot in my custom page macro.

[2]
http://www.zope.de/redaktion/dzug/tagung/potsdam-2007/folien/zope-on-a-paste.pdf
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGgj+5RawDj1XqbtwRAg1nAJ4sru+DtJXqF+r+hw3ESJpPslMYlACbBFnd
49eUvBiLeIj7sAMvdGJpwVw=
=c7AO
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Trouble with Skins

2007-06-26 Thread Arne Nordmann
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I tried to create my own skin for a website of mine. I used Phillip's
book (2nd version) and tried to do everything analog (just different
names and a slightly different file structure).

If I call a test view (registered for IRootFolder) with the skin I get
the following error:

ComponentLookupError: ((zope.app.folder.folder.Folder object at
0x886916c, zope.publisher.browser.BrowserRequest instance
URL=http://localhost:9673/++skin++norro/test), InterfaceClass
zope.interface.Interface, 'h')

(Full traceback attached)

I don't know what this traceback wants to say. I'm wondering about the
value of the name-parameter that seems to be 'h' in this case. Where
does this 'h' come from? I really don't know where to look at.

I would appreciate every hint on what's going on here or where to look
for the error.

Thanks in advance,

Arne

PS: Using Zope 3.4 and Python 2.4
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGgO3kRawDj1XqbtwRAgx2AJ4/xyFR/mB4KIcfEfVHQANj3HE96gCeNUyW
cOdTYjKurokuileJgE5gpf0=
=qtZD
-END PGP SIGNATURE-
--
2007-06-26T12:30:33 ERROR SiteError http://localhost:9673/++skin++norro/test
Traceback (most recent call last):
  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 133, 
in publish
result = publication.callObject(request, obj)
  File 
/usr/lib/python2.4/site-packages/zope/app/publication/zopepublication.py, 
line 161, in callObject
return mapply(ob, request.getPositionalArguments(), request)
  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 108, 
in mapply
return debug_call(obj, args)
   - __traceback_info__: security proxied 
zope.app.publisher.browser.viewmeta.Test instance at 0x88b002c
  File /usr/lib/python2.4/site-packages/zope/publisher/publish.py, line 114, 
in debug_call
return obj(*args)
  File 
/usr/lib/python2.4/site-packages/zope/app/pagetemplate/viewpagetemplatefile.py,
 line 83, in __call__
return self.im_func(im_self, *args, **kw)
  File 
/usr/lib/python2.4/site-packages/zope/app/pagetemplate/viewpagetemplatefile.py,
 line 51, in __call__
sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
  File /usr/lib/python2.4/site-packages/zope/pagetemplate/pagetemplate.py, 
line 117, in pt_render
strictinsert=0, sourceAnnotations=sourceAnnotations)()
   - Warning: Macro expansion failed
   - Warning: zope.component.interfaces.ComponentLookupError: 
((zope.app.folder.folder.Folder object at 0x886916c, 
zope.publisher.browser.BrowserRequest instance 
URL=http://localhost:9673/++skin++norro/test), InterfaceClass 
zope.interface.Interface, 'h')
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 271, 
in __call__
self.interpret(self.program)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 346, 
in interpret
handlers[opcode](self, args)
  File /usr/lib/python2.4/site-packages/zope/tal/talinterpreter.py, line 870, 
in do_useMacro
macro = self.engine.evaluateMacro(macroExpr)
  File /usr/lib/python2.4/site-packages/zope/tales/tales.py, line 696, in 
evaluate
return expression(self)
   - /var/www/zope_hp/lib/python/hp/browser/test.pt
   - Line 1, Column 0
   - Expression: PathExpr standard:u'context/@@standard_macros/page'
   - Names:
  {'args': (),
   'context': zope.app.folder.folder.Folder object at 0x886916c,
   'default': object object at 0xb7e10558,
   'loop': {},
   'nothing': None,
   'options': {},
   'repeat': {},
   'request': zope.publisher.browser.BrowserRequest instance 
URL=http://localhost:9673/++skin++norro/test,
   'template': 
zope.app.pagetemplate.viewpagetemplatefile.ViewPageTemplateFile object at 
0x905644c,
   'usage': zope.pagetemplate.pagetemplate.TemplateUsage object at 
0x88bbc8c,
   'view': zope.app.publisher.browser.viewmeta.Test object at 0x88b002c,
   'views': zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object 
at 0x88bbb2c}
  File /usr/lib/python2.4/site-packages/zope/tales/expressions.py, line 217, 
in __call__
return self._eval(econtext)
  File /usr/lib/python2.4/site-packages/zope/tales/expressions.py, line 194, 
in _eval
ob = self._subexprs[-1](econtext)
  File /usr/lib/python2.4/site-packages/zope/tales/expressions.py, line 124, 
in _eval
ob = self._traverser(ob, element, econtext)
  File /usr/lib/python2.4/site-packages/zope/app/pagetemplate/engine.py, line 
68, in __call__
request=request)
  File /usr/lib/python2.4/site-packages/zope/traversing/adapters.py, line 
164, in traversePathElement
return traversable.traverse(nm, further_path)
   - __traceback_info__: (zope.app.publisher.browser.viewmeta.standard_macros 
object at 0x88ab84c, 'page')
  File /usr/lib/python2.4/site-packages/zope/traversing/adapters.py, line 49, 
in traverse
return subject[name]
   - __traceback_info__: (zope.app.publisher.browser.viewmeta.standard_macros 
object at 

Re: [Zope3-Users] Re: Unit test problem - ImportError

2006-09-28 Thread Arne Nordmann

Hi.

Philipp von Weitershausen schrieb:

Looks like this instance was created with Zope 3.2 or even X3 3.0.

You are right, that may be the case here.

Create a new instance by calling mkzopeinstance and copy over a) your 
data in 'var' and b) your packages in 'lib/python' to the new instance. 
Also adjust files in 'etc' according to the old instance's configuration

I will try that. Thank you for the prompt answer.

Arne
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Permissions for updateOrder() on OrderedContainer

2006-08-10 Thread Arne Nordmann

Hi Phillip,

I didn't spend much time in finding out about removeAllProxies. This 
trick came to me along with a serious warning via email as an answer to 
my mailing list message.


I just used this cheating to find out, if the way I'm going besides that 
is possible. Now that I know, that it's working, I will read the other 
answers carefully and will try to understand what's going on there and 
how I can do it without ignoring this red, blinking lamp :)


Thanks for your support,

Arne

Philipp von Weitershausen schrieb:

Arne Nordmann wrote:

thank you very much indeed for your answers. I use
removeAllPermissions() at the moment to have an ad hoc solution and
now will busy myself with your ideas.

For the sake of correctness: I ment to write removeAllProxies()


removeAllProxies simply disables security checking. Big red warning
lights should go on in your head whenever you want to use it.

It seems like you invested some time in finding out about
removeAllProxies instead of following our advice. Tom Dossis even
spelled it out for you. If you choose to ignore this, you're on your
own. Don't expect Zope to do much security for you when you ignore its
system completely.

Philipp

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Permissions for updateOrder() on OrderedContainer

2006-08-09 Thread Arne Nordmann

Hey guys,

thank you very much indeed for your answers. I use 
removeAllPermissions() at the moment to have an ad hoc solution and now 
will busy myself with your ideas.


So long,

Arne

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Permissions for updateOrder() on OrderedContainer

2006-08-09 Thread Arne Nordmann
thank you very much indeed for your answers. I use 
removeAllPermissions() at the moment to have an ad hoc solution and now 
will busy myself with your ideas.

For the sake of correctness: I ment to write removeAllProxies()
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Permissions for updateOrder() on OrderedContainer

2006-08-08 Thread Arne Nordmann

Hi folks,

first of all: I'm working with Zope 3.3 and Python 2.4.

I created a hierarchical structure of OrderedContainers - some kind of a 
tree - and now want to sort it with Python. To move the containers from 
level to level in this tree with the ObjectMover is no problem, but 
updating the order of the contained elements inside the containers fails 
with a ForbiddenAttribute error.


For example:
A, B, C are containers with the names 'A', 'B' and 'C'.
B and C are contained by A.

 A.updateOrder(['C', 'B'])
Traceback (most recent call last):
...
ForbiddenAttribute: ('updateOrder', mypackage.cont.Cont object at 
0x022244B0

-
(object at 0x022244B0 is OrderedContainer 'A')

configure.zcml defines each used interface with permission 
'ManageContent' and I'm logged in as 'Manager'. Accessing the method 
keys(), values(), etc. of the OrderedContainers is no problem. So what's 
the problem?


Every hint or comment one that would be great, because I'm trying and 
searching for hours yet.


Thanks,

Arne
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users