Re: [Zope3-Users] How to configure zope to map ~foo to foo/public_html?

2008-06-05 Thread Peter Sabaini
On Wednesday 04 June 2008 22:21:02 Philip Johnson wrote:
 Greetings,

 I am a Plone/Zope newbie who is redesigning my old traditional
 apache-style website to use Plone 3/Zope 3.  This has been a
 delightful process in general.

I'm confused -- is it Zope3 or Plone3? AFAIK Plone still runs on Zope2?

 Though I am content to have most of my old URLs become invalid, I
 would like to retain my current user directories.

 Is there some simple way to configure Zope such that URLs like
 http://www.example.org/~foo/index.html are mapped to the user foo's
 public_html/index.html file?

Are you talking about user foo's $HOME/public_html/ dir, as in, on a physical 
filesystem or the users' folder in the ZODB?

If the former, you're probably best off with serving them from Apache, 
probably by Rewriting some URLs to be served from the FS and some from Plone.

hth,
peter.


 I have spent about an hour googling around and remain confused.

 Thanks in advance for your help!
 Philip Johnson
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users



-- 
http://sabaini.at


signature.asc
Description: This is a digitally signed message part.
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


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

2008-06-05 Thread Nylan
Roger Ineichen [EMAIL PROTECTED] writes:

 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. 

I've checked every object. All objects are zope.Public. Only one view has the
zope.ManageContent permission for testing purpose.
:-(

The breakpoint(pdb) in the credentialsplugin is triggered, but after is hard to
follow.






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


[Zope3-Users] Re: How to configure zope to map ~foo to foo/public_html?

2008-06-05 Thread Philipp von Weitershausen

Philip Johnson wrote:

Greetings,

I am a Plone/Zope newbie who is redesigning my old traditional 
apache-style website to use Plone 3/Zope 3.  This has been a delightful 
process in general.


Though I am content to have most of my old URLs become invalid, I would 
like to retain my current user directories.


Is there some simple way to configure Zope such that URLs like 
http://www.example.org/~foo/index.html are mapped to the user foo's 
public_html/index.html file?


I have spent about an hour googling around and remain confused.


The recommended practice is to run Apache in front of Zope and use 
mod_rewrite + mod_proxy to route all or most requests to Zope. With 
mod_rewrite you could then also exclude certain URLs to be forwarded to 
Zope so that they're handled locally by Apache, e.g.:


  RewriteEngine On
  RewriteRule ^/files/ - [L] # handle /files URLs locally
  RewriteRule ^~ - [L]   # handle ~... URLs locally
  # everything else goes to Zope running on localhost:8080
  RewriteRule ^/(.*) 
http://localhost:8080/++vh++http:%{SERVER_NAME}:80/++/$1 [P,L]


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


[Zope3-Users] Re: Annoying thing about schema

2008-06-05 Thread Philipp von Weitershausen

Peter Bengtsson wrote:

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?


Very good points. I think UnicodeDecodeErrors have a bad reputation, 
though (mostly because of Python's stupid implicit conversion). I think 
Grok's policy is very sane in this regard: wherever human-readable text 
has to be entered, either a unicode object or a string just containing 
ASCII characters are acceptable. A very explicit error message stating 
that exact policy should be raised. Look at Grok's error messages, we've 
tried hard making them understandable.


I think a proposal on zope3-dev (plus a patch) would be welcomed.

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


Re: [Zope3-Users] Re: Annoying thing about schema

2008-06-05 Thread Peter Bengtsson
2008/6/5 Philipp von Weitershausen [EMAIL PROTECTED]:
 Peter Bengtsson wrote:

 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?

 Very good points. I think UnicodeDecodeErrors have a bad reputation, though
 (mostly because of Python's stupid implicit conversion). I think Grok's
 policy is very sane in this regard: wherever human-readable text has to be
 entered, either a unicode object or a string just containing ASCII
 characters are acceptable. A very explicit error message stating that exact
 policy should be raised. Look at Grok's error messages, we've tried hard
 making them understandable.

This was actually Grok development. But the interface and schema part
is all zope3.
I should have posted to zope3-dev instead.

 I think a proposal on zope3-dev (plus a patch) would be welcomed.


I'm not sure how to write the proposal. Can't I just make a feature
request on launchpad or something?



-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Annoying thing about schema

2008-06-05 Thread Philipp von Weitershausen

On 5 Jun 2008, at 11:53 , Peter Bengtsson wrote:

2008/6/5 Philipp von Weitershausen [EMAIL PROTECTED]:

Peter Bengtsson wrote:


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?


Very good points. I think UnicodeDecodeErrors have a bad  
reputation, though
(mostly because of Python's stupid implicit conversion). I think  
Grok's
policy is very sane in this regard: wherever human-readable text  
has to be

entered, either a unicode object or a string just containing ASCII
characters are acceptable. A very explicit error message stating  
that exact
policy should be raised. Look at Grok's error messages, we've tried  
hard

making them understandable.


This was actually Grok development. But the interface and schema part
is all zope3.
I should have posted to zope3-dev instead.


zope-dev (my mistake to suggest zope3-dev, it's been dead for a while  
now)



I think a proposal on zope3-dev (plus a patch) would be welcomed.


I'm not sure how to write the proposal. Can't I just make a feature
request on launchpad or something?


An email to zope-dev would be the best. Writing a proposal is easy, it  
can be done in a couple of paragraphs:


1. State the current situtation
2. Identify the problem that you have with the current situation
3. Suggest a solution
4. Identify potential risks


P.S.: As you may have noticed, zope.schema fields use fields  
themselves to define the types of their attributes/parameters. For  
instance, the 'title' and 'description' arguments are  
zope.schema.TextLines. So, in order to make those parameters accept  
both unicode and pure ASCII, there are two choices:


a) change zope.schema.Text and TextLine to accept both unicode and str  
objects, as long as the 'str' object contained just ASCII (- validate  
and _validate methods)


b) introduce another schema field that has the aforementioned  
properties, thus leaving Text and TextLine unchanged.


I personally prefer a), but there might be good reasons to do b).  
Definitely something worth discussing in your proposal :).


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


Re: [Zope3-Users] IIntIds in test environment

2008-06-05 Thread Marius Gedminas
On Wed, Jun 04, 2008 at 05:19:11PM +0200, Kai Diefenbach wrote:
 to register a IntIds utility by startup I'm using following subscriber:
 
snip
 ensureUtility(root_folder, IIntIds, '', IntIds, copy_to_zlog=False)
snip
 This is working when zope is running.
 
 I wonder why it isn't within tests.

Are you talking about unit or functional tests?

 the code above is executed but the
 IntIds utility is not available.

This sounds like functional tests to me.

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

This looks more like a unit test to me.

Are you setting the site in the test fixture?  Local utilities can only
be found when you set the site (running zope does this for you when
processing requests) or pass some context to getUtility.

 /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:
...
 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.

zope/app/catalog/README.txt could be an example.  I haven't looked
deeply, but it seems that it is registering an IIntIds utility as a
global utility, which is much simpler and therefore more suitable for
tests.

Regards,
Marius Gedminas
-- 
... there is always a well-known solution to every human problem -- neat,
plausible, and wrong.
-- H. L. Mencken (1880-1956), Prejudices


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