[Zope3-Users] z3c.pagelet, z3c.layer.pagelet and error views not working(Unauthorized)

2008-06-04 Thread Nylan
Hello, I'm having a serious problem with z3c.pagelet and z3c.layer.pagelet.

I've created my own layer based on 
IFormLayer,IDivFormLayer,IPageletBrowserLayer.
Layer and skin work fine.
Only with PAU zope doesn't redirect to login page when Unauthorized is thrown. 

Zope always displays:
--
URL: http://localhost:/manage.html
Module paste.evalexception.middleware:306 in respond
.
Module zope.publisher.publish:130 in publish
Module zope.publisher.browser:539 in traverse
Module zope.app.publication.browser:66 in getDefaultTraversal
Unauthorized: (z3c.pagelet.zcml.Manage object at 0x22a2f90, 
'browserDefault','zope.ManageContent')
--

Questions:
1. Why doesn't the redirect in the credentialsplugins challenge work?
2. The redirect doesn't work. 
   Why isn't zope displaying the error view registered for IUnauthorized?



I've found several similar issues:
1.  http://thread.gmane.org/gmane.comp.web.zope.zope3.user/6468/focus=6469
2.  http://thread.gmane.org/gmane.comp.web.zope.zope3.user/7539/focus=7544

I've checked my sources for every hint found above, without
success(z3c.layer.pagelet configure.zcml is included)

Did I include wrong packages?

I'll provide information as necessary.

Help greatly appreciated.

Best regards!

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


AW: [Zope3-Users] z3c.pagelet, z3c.layer.pagelet and error views notworking(Unauthorized)

2008-06-04 Thread Roger Ineichen
Hi Nylan
 
 Betreff: [Zope3-Users] z3c.pagelet, z3c.layer.pagelet and 
 error views notworking(Unauthorized)
 
 Hello, I'm having a serious problem with z3c.pagelet and 
 z3c.layer.pagelet.
 
 I've created my own layer based on 
 IFormLayer,IDivFormLayer,IPageletBrowserLayer.
 Layer and skin work fine.
 Only with PAU zope doesn't redirect to login page when 
 Unauthorized is thrown. 

Did you check the following?

This could happen if you access a public view and this view
will access a protected object. Then you run into Unauthorized
exception but since the rendering of the pagelet allready 
started, there is no way to show the right Unauthorized view
for that. 

But of corse it could be something different. I whould
at least trace the involved obejcts with pdb and check if 
the right object get used. Probably a wrong view get used
because of a to generic configuration.

Regards
Roger Ineichen

 Zope always displays:
 --
 URL: http://localhost:/manage.html
 Module paste.evalexception.middleware:306 in respond
 .
 Module zope.publisher.publish:130 in publish
 Module zope.publisher.browser:539 in traverse
 Module zope.app.publication.browser:66 in getDefaultTraversal
 Unauthorized: (z3c.pagelet.zcml.Manage object at 0x22a2f90,
 'browserDefault','zope.ManageContent')
 --
 
 Questions:
 1. Why doesn't the redirect in the credentialsplugins challenge work?
 2. The redirect doesn't work. 
Why isn't zope displaying the error view registered for 
 IUnauthorized?
 
 
 
 I've found several similar issues:
 1.  
 http://thread.gmane.org/gmane.comp.web.zope.zope3.user/6468/focus=6469
 2.  
 http://thread.gmane.org/gmane.comp.web.zope.zope3.user/7539/focus=7544
 
 I've checked my sources for every hint found above, without 
 success(z3c.layer.pagelet configure.zcml is included)
 
 Did I include wrong packages?
 
 I'll provide information as necessary.
 
 Help greatly appreciated.
 
 Best regards!
 
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users
 

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


[Zope3-Users] IIntIds in test environment

2008-06-04 Thread Kai Diefenbach
Hi, 

to register a IntIds utility by startup I'm using following subscriber:

snip

def bootStrapSubscriber(event):
Subscriber to the IDataBaseOpenedEvent

Create local utilities if not yet present

db, connection, root, root_folder = getInformationFromEvent(event)

ensureUtility(root_folder, IIntIds, '', IntIds, copy_to_zlog=False)
transaction.commit()
connection.close()

/snip

and register this with 

snip

  subscriber
  for=zope.app.appsetup.IDatabaseOpenedEvent
  handler=.bootstrap.bootStrapSubscriber /

/snip

This is working when zope is running.

I wonder why it isn't within tests. the code above is executed but the
IntIds utility is not available.

With:

snip

 from zope.app.intid.interfaces import IIntIds
 from zope.component import getUtility
 intids = getUtility(IIntIds)

/snip

I get: 

File
/Users/Kai/Zope/instances/iqpp.qab/src/iqppqab/actions/adapters/actions
.txt, line 28, in actions.txt
Failed example:
intids = getUtility(IIntIds)
Exception raised:
Traceback (most recent call last):
  File
/Users/Kai/Zope/instances/iqpp.qab/eggs/tmpDJ2x_9/zope.testing-3.5.1-py
2.4.egg/zope/testing/doctest.py, line 1356, in __run

  File doctest actions.txt[10], line 1, in ?
intids = getUtility(IIntIds)
  File
/Users/Kai/Zope/instances/iqpp.qab/eggs/zope.component-3.4.0-py2.4.egg/
zope/component/_api.py, line 207, in getUtility
raise ComponentLookupError(interface, name)
ComponentLookupError: (InterfaceClass
zope.app.intid.interfaces.IIntIds, '')

I guess I don't understand the whole SiteManager thing. Is there a
working example of how to setup a test environment with IntIds.

Thanks
Kai

-- 
iqplusplus - http://iqpp.de
EasyShop - http://easyshop-for-plone.googlecode.com/

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


[Zope3-Users] Annoying thing about schema

2008-06-04 Thread Peter Bengtsson
Suppose you've written this:

class ISomething(zope.interface.Interface):
 foo = zope.schema.TextLine(title=Foo)

then you get the error below.
First of all, why can't it just help me and just convert the str to a
unicode. All it'd need to do is just::

 title = unicode(title)

Django does this.
If someone does something bad like `TextLine(title=Ölmage)` that
developer should rightly get a UnicodeDecodeError.
Secondly, if there is an actual reason for this extreme analism, why
can't the error be wrapped into something more user friendly?



$ ./bin/zopectl debug
Traceback (most recent call last):
  File 
/home/peterbe/buildout-eggs/tmpUIBNQF/zc.zope3recipes-0.7.0-py2.4.egg/zc/zope3recipes/debugzope.py,
line 60, in debug
  File 
/home/peterbe/buildout-eggs/tmpUIBNQF/zc.zope3recipes-0.7.0-py2.4.egg/zc/zope3recipes/debugzope.py,
line 39, in zglobals
  File 
/home/peterbe/buildout-eggs/zope.app.appsetup-3.4.1-py2.4.egg/zope/app/appsetup/appsetup.py,
line 111, in config
context = xmlconfig.file(file, context=context, execute=execute)
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py,
line 610, in file
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py,
line 546, in include
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py,
line 378, in processxmlfile
  File /usr/lib/python2.4/xml/sax/expatreader.py, line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
  File /usr/lib/python2.4/xml/sax/xmlreader.py, line 123, in parse
self.feed(buffer)
  File /usr/lib/python2.4/xml/sax/expatreader.py, line 207, in feed
self._parser.Parse(data, isFinal)
  File /usr/lib/python2.4/xml/sax/expatreader.py, line 348, in end_element_ns
self._cont_handler.endElementNS(pair, None)
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py,
line 357, in endElementNS
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py,
line 542, in end
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py,
line 690, in finish
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py,
line 546, in include
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py,
line 378, in processxmlfile
  File /usr/lib/python2.4/xml/sax/expatreader.py, line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
  File /usr/lib/python2.4/xml/sax/xmlreader.py, line 123, in parse
self.feed(buffer)
  File /usr/lib/python2.4/xml/sax/expatreader.py, line 207, in feed
self._parser.Parse(data, isFinal)
  File /usr/lib/python2.4/xml/sax/expatreader.py, line 348, in end_element_ns
self._cont_handler.endElementNS(pair, None)
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/xmlconfig.py,
line 357, in endElementNS
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py,
line 542, in end
  File 
/home/peterbe/buildout-eggs/tmpU_pQr6/zope.configuration-3.4.0-py2.4.egg/zope/configuration/config.py,
line 690, in finish
  File 
/home/peterbe/buildout-eggs/tmp_TGW-i/grok-0.12.1-py2.4.egg/grok/zcml.py,
line 48, in grokDirective
  File 
/home/peterbe/buildout-eggs/tmp_TGW-i/grok-0.12.1-py2.4.egg/grok/zcml.py,
line 53, in do_grok
  File /home/peterbe/buildout-eggs/martian-0.9.3-py2.4.egg/martian/core.py,
line 194, in grok_dotted_name
grok_package(module_info, grokker, **kw)
  File /home/peterbe/buildout-eggs/martian-0.9.3-py2.4.egg/martian/core.py,
line 199, in grok_package
grok_package(sub_module_info, grokker, **kw)
  File /home/peterbe/buildout-eggs/martian-0.9.3-py2.4.egg/martian/core.py,
line 197, in grok_package
grok_module(module_info, grokker, **kw)
  File /home/peterbe/buildout-eggs/martian-0.9.3-py2.4.egg/martian/core.py,
line 202, in grok_module
grokker.grok(module_info.dotted_name, module_info.getModule(),
  File 
/usr/lib/python2.4/site-packages/martian-0.9.3-py2.4.egg/martian/scan.py,
line 118, in getModule
  File 
/usr/lib/python2.4/site-packages/martian-0.9.3-py2.4.egg/martian/scan.py,
line 188, in resolve
  File /home/peterbe/dev/GROK/GrokGlossary/src/grokglossary/app.py,
line 20, in ?
class ITerm(interface.Interface):
  File /home/peterbe/dev/GROK/GrokGlossary/src/grokglossary/app.py,
line 21, in ITerm
term = schema.TextLine(title='Term')
  File 
/home/peterbe/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_bootstrapfields.py,
line 278, in __init__
super(Text, self).__init__(*args, **kw)
  File 
/home/peterbe/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_bootstrapfields.py,
line 260, in __init__

AW: [Zope3-Users] Sharing session data with zeo

2008-06-04 Thread Roger Ineichen
Hi Francois

 Betreff: [Zope3-Users] Sharing session data with zeo
 
 Good day,
 
 Are there any best practices for setting up a zeo server and 
 zope clients to share session data? I see that the 
 temporarystorage directive for zope.conf and zeo.conf is no 
 longer valid in zope3, how does one setup a temporary storage 
 area for the zeo/zope to use and share said session data, 
 Google is not very helpful?
 
 In short, here is what we are trying to accomplish:
 
 1 zeo
 4 zope instances
 the zeo and 4 zope instances are running on the same box in 
 order to fully utilize a multiprocessor server.
 1 squid reverse proxy that round robins between the zope instances
 
 I don't know if it matters but the above system is on a 
 Windows (spit) box
 
 Any help will be appreciated.

Take a look at lovely.memcached and lovely.session
and take a look at the README.txt files in this packages.

I guess this will fit for what you need because it can share
session data with different servers.

Jodok, right?

Regards
Roger Ineichen

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

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