[Zope3-dev] Introduced a master check box to the ZMI

2007-02-01 Thread Florian Lindner
Hello,

Log message for revision 72287:
  Introduce a master checkbox to the ZMI that toggles all other check boxes 
from a folder listing.

I have checked in the change. I think the change itself is no problem and I 
hope it's done correctly. If not please improve me. If it's entirely 
unapprecated it will be also ok to revert it.

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Utility registration vanished after restart?

2007-01-07 Thread Florian Lindner
Hello,
I have two object that are registed in content space. The first one with the 
ZMI the other one programmatically with:

getSiteManager().registerUtility(self, INewsfeed, self.__name__)

both registration show up fine in the ZMI registration tab. But after a 
restart of Zope both object are unregistred again.
Is this behavior correct? Why that?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Do not serialize one attribute

2006-12-14 Thread Florian Lindner
Hello,
I have a object, derived from Persistent when contain one attribute which is 
not serializable and that's not a problem for me, but Zope complains about 
that.
Can I mark this attribute somehow as "not to serialize" and make Zope call a 
member function when it has unserialized this object so I can reinstantiate 
this attribute?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: expected string or Unicode object

2006-12-05 Thread Florian Lindner
Am Dienstag, 5. Dezember 2006 07:10 schrieb Jürgen Kartnaller:
> How should ZODB know how to serialize your xmpp.Client and /or
> xmpp.protocol.JID ?

Ok, I see the problem. What options do I have to change it?

My idea:
Mark the xmpp.* object as not serializable and recreate them from the string 
values everytime the JabberClient object is deserialized.
How can I do that? Which function will be called when the object will be 
deserialized?

Thanks,

Florian

>
> If connectOnStartup is True your code creates these objects.
>
> Jürgen
>
> Florian Lindner wrote:
> > Hello,
> > everytime I add my utility I get:
> >
[...]
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] expected string or Unicode object

2006-12-04 Thread Florian Lindner
Hello,
everytime I add my utility I get:

2006-12-04T22:44:26 ERROR SiteError 
http://horus.local:8080/++etc++site/default/+/AddJabberClient.html%3D
Traceback (most recent call last):
  File "/home/florian/Zope3/src/zope/publisher/publish.py", line 138, in 
publish
publication.afterCall(request, obj)
  File "/home/florian/Zope3/src/zope/app/publication/browser.py", line 78, in 
afterCall
super(BrowserPublication, self).afterCall(request, ob)
  File "/home/florian/Zope3/src/zope/app/publication/zopepublication.py", line 
167, in afterCall
txn.commit()
  File "/home/florian/Zope3/src/transaction/_transaction.py", line 395, in 
commit
self._commitResources()
  File "/home/florian/Zope3/src/transaction/_transaction.py", line 495, in 
_commitResources
rm.commit(self)
  File "/home/florian/Zope3/src/ZODB/Connection.py", line 498, in commit
self._commit(transaction)
  File "/home/florian/Zope3/src/ZODB/Connection.py", line 543, in _commit
self._store_objects(ObjectWriter(obj), transaction)
  File "/home/florian/Zope3/src/ZODB/Connection.py", line 570, in 
_store_objects
p = writer.serialize(obj)  # This calls __getstate__ of obj
  File "/home/florian/Zope3/src/ZODB/serialize.py", line 407, in serialize
return self._dump(meta, obj.__getstate__())
  File "/home/florian/Zope3/src/ZODB/serialize.py", line 416, in _dump
self._p.dump(state)
TypeError: expected string or Unicode object, NoneType found
127.0.0.1 - - [4/Dec/2006:22:44:26 
+0200] "POST /++etc++site/default/+/AddJabberClient.html%3D HTTP/1.1" 500 
89 "http://horus.local:8080/++etc++site/default/+/AddJabberClient.html="; 
"Mozilla/5.0 
(compatible; Konqueror/3.5; Linux) KHTML/3.5.5 (like Gecko)"

I have already tried on zope3-users but got no solution. This is my code:

interfaces.py:

from zope.interface import Interface
from zope.schema import TextLine, Password, Bool

class IJabberClient(Interface):
JID = TextLine(
title = u"Jabber ID",
description = u"Jabber ID ([EMAIL PROTECTED]). You need 
to reconnect in order to take effect.",
required = True )

password = Password(
title = u"Password",
description = u"Password for the jabber account",
required = True )

connectOnStartup = Bool(
title = u"Connect on startup",
description = u"Automatically connect when Zope starts 
and also when the object is newly added (what you are about to do).",
default = True)

jabberclient.py:

from interfaces import IJabberClient
from zope.interface import implements

from persistent import Persistent
from zope.app.container.contained import Contained

import xmpp

class JabberClient(Persistent, Contained):
implements(IJabberClient)

JID = u""
password = u""
connectOnStartup = True

status = u"offline"


def finishInitialization(self):
""" Finish the rest of the initialziation that can't be done in 
__init__. """
if self.connectOnStartup:
self.setStatus("available")
else:
self.setStatus("offline")


def setStatus(self, newStatus):
if self.status == "offline" and newStatus == "available":
self.jabberID = xmpp.protocol.JID(self.JID)
self.client = xmpp.Client(self.jabberID.getDomain(), debug=[])
self.client.connect()
self.client.auth(self.jabberID.getNode(), self.password)
self.client.sendPresence(self.jabberID)

if self.status == "available" and newStatus == "offline":
# disconnect
pass

self.status = newStatus

def getStatus(self):
return self.status

  
def onObjectAdded(event):
if IJabberClient.providedBy(event.object):
event.object.finishInitialization()


configure.zcml

http://namespaces.zope.org/zope"; 
xmlns:browser="http://namespaces.zope.org/browser";>


















Sorry for the huge posting but I got no idea where the error comes from. The 
error occurs only when connectOnStartup is True.

Thanks for any help,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Zope3-Users] How does the static-apidoc script works?

2006-09-07 Thread Florian Lindner
Am Mittwoch, 6. September 2006 12:25 schrieb Stephan Richter:
> On Monday 14 August 2006 17:46, Florian Lindner wrote:
> > ow does that script works? Executing gives an error:
> >
> > [EMAIL PROTECTED] ~/Zope3 $ python utilities/static-apidoc
> > /home/florian/z3-doc/ Traceback (most recent call last):
> >   File "utilities/static-apidoc", line 37, in ?
> >     main()
> >   File "/home/florian/Zope3/src/zope/app/apidoc/static.py", line 504, in
> > main maker.start()
> >   File "/home/florian/Zope3/src/zope/app/apidoc/static.py", line 200, in
> > start self.browser._links_factory.urltags = urltags
> >   File "/home/florian/Zope3/src/mechanize/_mechanize.py", line 505, in
> > __getattr__
> >     raise AttributeError(
> > AttributeError: 
> > instance has no attribute _links_factory (perhaps you forgot to
> > .select_form()?)
>
> You know, this is probably due to a new mechanize version. You would have
> to update the scripts probably to the latest mechanize.

I've managed to fix the script so far that it works with the OnlineBrowser() 
(self.browser = OnlineBrowser()).

If I use the PublisherBrowser() I get a ConfigurationError:

-> return chooseClasses(method, environment)
  /home/florian/Zope3/src/zope/app/publication/httpfactory.py(33)chooseClasses()
-> factory = factoryRegistry.lookup(method, content_type, environment)
  
/home/florian/Zope3/src/zope/app/publication/requestpublicationregistry.py(97)lookup()
-> raise ConfigurationError('No registered publisher found '

Should I modify it in a way that it always uses the OnlineBrowser() and check 
in? 
Maybe I will have time to look into the problem with PublisherBrowser() but I 
doubt so since is examina time in university...

Here is some output from the script:

[EMAIL PROTECTED] ~/Zope3/utilities $ python static-apidoc /home/florian/z3-doc/
INFO: Starting retrieval.
Link   166: 
http://localhost:8080/++apidoc++/Code/ZConfig/schema/BaseParser/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/ZConfig/schema/BaseParser
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link   553: 
http://localhost:8080/++apidoc++/Code/zope/app/authentication/idpicker/IdPicker/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/zope/app/authentication/idpicker/IdPicker
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link   650: 
http://localhost:8080/++apidoc++/Code/zope/app/container/contained/ContainerModifiedEvent/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/zope/app/container/contained/ContainerModifiedEvent
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link   656: 
http://localhost:8080/++apidoc++/Code/zope/app/container/contained/ObjectMovedEvent/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/zope/app/container/contained/ObjectMovedEvent
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link  1198: 
http://localhost:8080/++apidoc++/Code/zope/app/workflow/stateful/xmlimportexport/XMLFormatChecker/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/zope/app/workflow/stateful/xmlimportexport/XMLFormatChecker
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link  1200: 
http://localhost:8080/++apidoc++/Code/zope/app/workflow/stateful/xmlimportexport/XMLStatefulImporter/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/zope/app/workflow/stateful/xmlimportexport/XMLStatefulImporter
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link  1237: 
http://localhost:8080/++apidoc++/Code/zope/component/interfaces/RegistrationEvent/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/zope/component/interfaces/RegistrationEvent
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link  1269: 
http://localhost:8080/++apidoc++/Code/zope/configuration/xmlconfig/ConfigurationHandler/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/zope/configuration/xmlconfig/ConfigurationHandler
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link  1365: 
http://localhost:8080/++apidoc++/Code/zope/fssync/metadata/EntriesHandler/index.html
WARNING: Internal Server Error (500): 
http://localhost:8080/++apidoc++/Code/zope/fssync/metadata/EntriesHandler
WARNING: +-> Reference: http://localhost:8080/++apidoc++/Code/staticmenu.html
Link  1846: http://localhost:8080/++apidoc++/Interface/file/index.htm


I terminated it at this point. At the end it gets very slow, about one link 
every 

Re: [Zope3-dev] Static apidoc

2006-09-03 Thread Florian Lindner
Am Sonntag, 3. September 2006 18:29 schrieb Stephan Richter:
> On Sunday 03 September 2006 12:23, Florian Lindner wrote:
> > AttributeError: 
> > instance has no attribute _links_factory (perhaps you forgot to
> > .select_form()?)
>
> It would take me as long as it would take you to debug the problem. The
> script was never completely finished, polished and stabilized.

> > Just using ++apidoc++/static.html und let wget spider it makes my
> > computer spidering for more that 10 hours with the server being
> > localhost.
>
> We tried the wget method first. wget is just not smart enough.

Were you able to figure out what exactly is the problem with wget?

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Static apidoc

2006-09-03 Thread Florian Lindner
Hello,
I've already asked that a while ago on zope-user but got not reply
How does that script works? Executing gives an error:

[EMAIL PROTECTED] ~/Zope3 $ python utilities/static-apidoc /home/florian/z3-doc/
Traceback (most recent call last):
  File "utilities/static-apidoc", line 37, in ?
main()
  File "/home/florian/Zope3/src/zope/app/apidoc/static.py", line 504, in main
maker.start()
  File "/home/florian/Zope3/src/zope/app/apidoc/static.py", line 200, in start
self.browser._links_factory.urltags = urltags
  File "/home/florian/Zope3/src/mechanize/_mechanize.py", line 505, in 
__getattr__
raise AttributeError(
AttributeError:  instance has 
no attribute _links_factory (perhaps you forgot to .select_form()?)


and the z3-doc directoy is empty.

Just using ++apidoc++/static.html und let wget spider it makes my computer 
spidering for more that 10 hours with the server being localhost.

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Zope 2 clock server for Zope 3

2006-08-20 Thread Florian Lindner
Am Sonntag, 20. August 2006 06:11 schrieb Christian Theune:
> Hi,
>
> you might try a look at the recently released zc.async which allows you
> to leverage twisted asynchronous handling together with persistent
> objects (as far as I know right now, haven't looked at it personally yet).

I've overflown the readme and it looks rather complicated compared with the 
Zope2 clock server which is pretty straightforward.

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Zope 2 clock server for Zope 3

2006-08-19 Thread Florian Lindner
Hello,
I've just read the release announcement for Zope 2.10b2 and there is a clock 
server mentioned:

Added a "clock server" servertype which allows users to configure methods that 
should be called periodically as if they were being called by a remote user 
agent on one of Zope's HTTP ports. This is meant to replace wget+cron for 
some class of periodic callables.

Do Zope3 have something like this? Is someone working on backporting this?

Whereas I would prefer to configure in with ZCML directive and not in 
zope.conf.

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/dublincore/ Dublin Core property to use Dublin Core meta data as simple properties.

2006-08-14 Thread Florian Lindner
Am Montag, 14. August 2006 12:52 schrieb Jürgen Kartnaller:
> Log message for revision 69463:
>   Dublin Core property to use Dublin Core meta data as simple properties.
>
>
> Changed:
>   A   Zope3/trunk/src/zope/dublincore/property.py
>   A   Zope3/trunk/src/zope/dublincore/property.txt
>   A   Zope3/trunk/src/zope/dublincore/tests/test_property.py

Do I understand this change correctly that it obsoletes 
zope.dublincore.annotatableadapter.partialAnnotatableAdapterFactory?

Quote from zope/dublincore/tests/partial.txt which describes the 
partialAnnotatableAdapterFactory:

> Sometimes we want to include data in content objects which mirrors one
> or more Dublin Core fields.  In these cases, we want the Dublin Core
> structures to use the data in the content object rather than keeping a
> separate value in the annotations typically used.  What fields we want
> to do this with can vary, however, and we may not want the Dublin Core
> APIs to constrain our choices of field names for our content objects.

Should the partialAnnotatableAdapterFactory therefore be removed/deprecated?

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Remove zwiki-configure and bugtracker-configure?

2006-07-18 Thread Florian Lindner
Am Mittwoch, 19. Juli 2006 00:16 schrieb Christian Theune:
> Fred Drake wrote:
> > On 7/18/06, Christian Theune <[EMAIL PROTECTED]> wrote:
> >> AFAICT they were removed already, I stumbled over this today as SVN
> >> didn't remove them on their own.
> >
> > They get copied into zopeskel/etc/package-includes/ (and thence into
> > instances); those copies don't get remove automatically.
>
> Right. So if I got it right, SVN doesn't hold any references to it
> anymore, but sandboxes (checkouts, instances) might.

Ok, I just did a fresh checkout and I see that those files have vanished. 
Sorry for not checking this first...

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Remove zwiki-configure and bugtracker-configure?

2006-07-18 Thread Florian Lindner
Hello,
since these two packages have been moved out of the trunk is it ok to remove 
zwiki-configure.zcml and bugtracker-configure.zcml from 
zopeskel/etc/package-includes?

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Usage of the order attribute

2006-07-05 Thread Florian Lindner
repost to zope3-dev since I think it could be a bug...

Hello,
how is the order attribute of the menuItem directive being used?

Do elements with a lower order come first?
What is the order of elements that have not defined one? Is is higher than of 
all others.

I wonder because I have menuItem defined with order 0 (or 1) and there is 
still one item above it which has not even order defined.

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Displaying ReStructered Text

2006-06-21 Thread Florian Lindner
Hello,
I've written this question to zope3-users already, but I got only one replay 
which has not helped me

I have a document written in ReStructered Text and I want to display it with 
Zope3 (of course converted to HTML). How can I do that?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Checkins] SVN: zc.resourcelibrary/trunk/ A basic makefile, the ZPL and copyright headers.

2006-06-15 Thread Florian Lindner
Am Donnerstag, 15. Juni 2006 04:23 schrieb Benji York:
> Brian Sutherland wrote:
> > Log message for revision 68639:
> >   A basic makefile, the ZPL and copyright headers.
>
> Is there consensus about adding makefiles like this (diff below)?  I
> personally don't like the idea, but I wanted to bring it up to the list.
>
> I don't like them for a couple of reasons. First, they're make files;
> that's an automatic strike :).  Second, they're not useful
> cross-platform; if what they're doing is important, then they should be
> Python scripts, if not, then they shouldn't exist.  Third, /I/ don't
> value what they're doing for me.
>
> Other opinions?

I can't judge the necessity of a make system or if a simple python script 
would suffice. 
If make files are really necessary I would also prefer a python based make 
system. IIRC KDE switches to such a system for version 4. [1]

Regards,

Florian


[1] http://dot.kde.org/1126452494/
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Changing skins from ZMI

2006-06-12 Thread Florian Lindner
Hello,
the ZMI has a preview tab which (if registered) shows the current object in an 
iframe. But the object is always shown in the default skin (the one the ZMI 
uses) and I doubt that a lot of object a designed to be used with the default 
skin.

My idea:
Add a selector to the ZMI which lists all available skins and changes the skin 
when one is being selected. So the current object can be viewed in a 
arbitrary skin.

What do you think?

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] What's wrong with my configure.zcml?

2006-06-04 Thread Florian Lindner
Am Sonntag, 4. Juni 2006 12:44 schrieb [EMAIL PROTECTED]:
> Hi Florian
>
> Change the default defined in the interface for the
> layer attribute to:
>
> default=u'',
>
> instead of:
>
> default='',
>
> I guess there is a layer attribute somewhere
> in a interface which looks something like:
>
> layer = zope.schema.TextLine(
> title=_('Layer'),
> default=u'',
> )
>
> Or not?

There is not. layer refers to this interface:

class IXGMSkin(zope.app.rotterdam.Rotterdam):
"""Skin for xgm.de."""

But your hint has lead to the solution. I have an interface:

class IAbbreviation(Interface):
  [...]

description = TextLine(
title = u"Erklaerung",
required = False,
default = "")  <--

Which I have changed to

default = u""

Thanks a lot!!

Florian


>
> Regards
> Roger Ineichen
> _
> END OF MESSAGE
>
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On
> > Behalf Of Florian Lindner
> > Sent: Sunday, June 04, 2006 12:25 PM
> > To: zope3-dev@zope.org
> > Subject: [Zope3-dev] What's wrong with my configure.zcml?
> >
> > Hello,
> > sorry for the post to the dev list but on the users list no
> > one was able to help me and I got no idea what I can try
> > My Zope3 (most recent SVN version gives that error on startup):
> >
> > [...]
> >   File
> > "/home/florian/Zope3/src/zope/schema/_bootstrapfields.py",
> > line 263, in _validate
> > super(MinMaxLen, self)._validate(value)
> >   File
> > "/home/florian/Zope3/src/zope/schema/_bootstrapfields.py",
> > line 165, in _validate
> > raise WrongType(value, self._type)
> > zope.configuration.xmlconfig.ZopeXMLConfigurationError:
> > File "/home/florian/Desktop/zope/etc/site.zcml", line 7.2-7.55
> > ZopeXMLConfigurationError:
> > File
> > "/home/florian/Desktop/zope/etc/package-includes/xgm-configure.zcml",
> > line 1.0-1.25
> > ZopeXMLConfigurationError:
> > File "/home/florian/Desktop/zope/lib/python/xgm/configure.zcml", line
> > 2.4-2.34
> > ZopeXMLConfigurationError:
> > File
> > "/home/florian/Desktop/zope/lib/python/xgm/browser/configure.z
> > cml", line
> > 2.4-2.31
> > ZopeXMLConfigurationError:
> > File
> > "/home/florian/Desktop/zope/lib/python/xgm/browser/skin/config
> > ure.zcml",
> > line 3.4-7.6
> > ConfigurationError: ('Invalid value for', 'layer', "('',
> > )")
> >
> >
> > I have attached xgm/browser/skin/configure.zcml. It is not
> > containing any unicode nor does interface.py (in which is the
> > layer declared).
> >
> > [EMAIL PROTECTED] ~/Desktop/zope/lib/python $ file
> > xgm/browser/skin/configure.zcml
> > xgm/browser/skin/configure.zcml: ASCII text [EMAIL PROTECTED]
> > ~/Desktop/zope/lib/python $ file xgm/interfaces.py
> > xgm/interfaces.py: ASCII Java program text, with CRLF line terminators
> >
> > (don't know why file thinks it's java...)
> >
> > Any one got any idea what I can do?
> >
> > Thanks,
> >
> > Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] What's wrong with my configure.zcml?

2006-06-04 Thread Florian Lindner
Hello,
sorry for the post to the dev list but on the users list no one was able to 
help me and I got no idea what I can try
My Zope3 (most recent SVN version gives that error on startup):

[...]
  File "/home/florian/Zope3/src/zope/schema/_bootstrapfields.py", line 263, in 
_validate
super(MinMaxLen, self)._validate(value)
  File "/home/florian/Zope3/src/zope/schema/_bootstrapfields.py", line 165, in 
_validate
raise WrongType(value, self._type)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: 
File "/home/florian/Desktop/zope/etc/site.zcml", line 7.2-7.55
ZopeXMLConfigurationError: 
File "/home/florian/Desktop/zope/etc/package-includes/xgm-configure.zcml", 
line 1.0-1.25
ZopeXMLConfigurationError: 
File "/home/florian/Desktop/zope/lib/python/xgm/configure.zcml", line 
2.4-2.34
ZopeXMLConfigurationError: 
File "/home/florian/Desktop/zope/lib/python/xgm/browser/configure.zcml", line 
2.4-2.31
ZopeXMLConfigurationError: 
File "/home/florian/Desktop/zope/lib/python/xgm/browser/skin/configure.zcml", 
line 3.4-7.6
ConfigurationError: ('Invalid value for', 'layer', "('', 
)")


I have attached xgm/browser/skin/configure.zcml. It is not containing any 
unicode nor does interface.py (in which is the layer declared).

[EMAIL PROTECTED] ~/Desktop/zope/lib/python $ file 
xgm/browser/skin/configure.zcml
xgm/browser/skin/configure.zcml: ASCII text
[EMAIL PROTECTED] ~/Desktop/zope/lib/python $ file xgm/interfaces.py
xgm/interfaces.py: ASCII Java program text, with CRLF line terminators

(don't know why file thinks it's java...)

Any one got any idea what I can do?

Thanks,

Florian
http://namespaces.zope.org/browser";>
























___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Ok to change PAU session credentials plugin?

2006-04-21 Thread Florian Lindner
Am Donnerstag, 20. April 2006 19:17 schrieb Florian Lindner:
> Hello,
> I plan to change the PAU session credentials plugin to make it configurable
> in which form fields it looks for the credentials.
>
> My use case is that I want to use formlib to create a login form. formlib
> prepends "form." at all IDs of the form fields. Therefore it is impossible
> to use these forms as login forms for that plugin (it's probably possible
> with some formlib subclassing but that introduces a lot effort).
>
> I don't see any negative aspects of this change. The values will default to
> the hard coded values that are used now, so now compatibility will be
> broken.
>
> Any objections?

Since no one has objected I have made the change in revision 67211.

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Ok to change PAU session credentials plugin?

2006-04-20 Thread Florian Lindner
Hello,
I plan to change the PAU session credentials plugin to make it configurable in 
which form fields it looks for the credentials.

My use case is that I want to use formlib to create a login form. formlib 
prepends "form." at all IDs of the form fields. Therefore it is impossible to 
use these forms as login forms for that plugin (it's probably possible with 
some formlib subclassing but that introduces a lot effort).

I don't see any negative aspects of this change. The values will default to 
the hard coded values that are used now, so now compatibility will be broken.

Any objections?

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Get nearest site from TALES

2006-04-04 Thread Florian Lindner
Hello,
is there a TALES expression I can use in PageTemplates to get the nearest 
site?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Why z.a.appsetup.bootstrap function do not return the actual object

2006-03-27 Thread Florian Lindner
Hello,
I've changed the code how you described. All tests pass, but some code used in 
startup of Zope and some tests generate deprecation warnings.
Would you like to review the code before I check in? I can try to clean up the 
code and the tests causing the deprecation warnings the next days and checkin 
later.

Regards,

Florian

Am Montag, 20. März 2006 14:27 schrieb Stephan Richter:
> On Wednesday 08 March 2006 08:57, Florian Lindner wrote:
> > Hello,
> > I'm currently playning with the functions from
> > zope.app.appsetup.bootstrap and I'm wondering why the functions that
> > create objects
> > (addConfigureUtility, addUtility, configureUtility, ensureObject,
> > ensureUtility) do return the name of the object added (or None) and not
> > the object itself. What is the reason for that?
> >
> > IMO in most cases you add a Utility you want to change some attributes of
> > it afterwards. In order to do that you need the object instance. To get
> > it from the name you have to perform a getUtility call. If the functions
> > above would return the object you could omit the getUtility.
> >
> > What do you think about that?
>
> This is a relic from the early days, when we still had context wrappers. I
> am +1 for the change, but backward-compatibility has to be provided. And
> since the return value changes, this has to be done in two steps:
>
> 1. Create a new option argument to the functions saying ``asObject=False``,
> and only if set to True the object will return. Then deprecate the string
> return value by generating a warning message.
>
> 2. After two releases, remove deprecated string value return and set
> ``asObject=True`` by default. Also deprecate the asObject argument again.
>
> Regards,
> Stephan
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Deprecate conditionally

2006-03-27 Thread Florian Lindner
Hello,
I want show a deprecation warning only if a argument of a function is set to 
False.

def foo(arg1, arg2, arg3 = False):

if not arg3:
arg3 = deprecation.deprecated(arg3, "arg3=False is deprecated.")

But that does not show anything. How do it correctly?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Why z.a.appsetup.bootstrap function do not return the actual object

2006-03-22 Thread Florian Lindner
Am Montag, 20. März 2006 14:27 schrieb Stephan Richter:
> On Wednesday 08 March 2006 08:57, Florian Lindner wrote:
> > Hello,
> > I'm currently playning with the functions from
> > zope.app.appsetup.bootstrap and I'm wondering why the functions that
> > create objects
> > (addConfigureUtility, addUtility, configureUtility, ensureObject,
> > ensureUtility) do return the name of the object added (or None) and not
> > the object itself. What is the reason for that?
> >
> > IMO in most cases you add a Utility you want to change some attributes of
> > it afterwards. In order to do that you need the object instance. To get
> > it from the name you have to perform a getUtility call. If the functions
> > above would return the object you could omit the getUtility.
> >
> > What do you think about that?
>
> This is a relic from the early days, when we still had context wrappers. I
> am +1 for the change, but backward-compatibility has to be provided. And
> since the return value changes, this has to be done in two steps:
>
> 1. Create a new option argument to the functions saying ``asObject=False``,
> and only if set to True the object will return.

Done.

> Then deprecate the string 
> return value by generating a warning message.

Mmmhh... how can I deprecate a function argument conditionally?

def ensureObject(root_folder, object_name, object_type, object_factory, 
asObject=False):
"""Check that there's a basic object in the site
manager. If not, add one.

Return the name abdded, if we added an object, otherwise None.
"""
if not asObject:
asObject = deprecation.deprecated(asObject, "Using asObject=False is 
deprecated")


But that does not do anything


> 2. After two releases, remove deprecated string value return and set
> ``asObject=True`` by default. Also deprecate the asObject argument again.

Hope I'll remember that.

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] New way of using skins

2006-03-11 Thread Florian Lindner
Am Freitag, 10. März 2006 13:50 schrieb Stephan Richter:
> On Friday 10 March 2006 07:22, Florian Lindner wrote:
> > Am Freitag, 10. März 2006 12:45 schrieb Stephan Richter:
> > > On Friday 10 March 2006 05:55, Florian Lindner wrote:
> > > > layer = centershock does not seem to work anymore (for what is name
> > > > attribute of the interface directive?).
> > > >
> > > > layer="CS.skin.interfaces.ICentershockLayer" seems to work but do I
> > > > always have to give the lenghty python path??
> > >
> > > Yes, this is one use case Phillip removed.
> >
> > And what meaning has the name attribute of the interface directive?
>
> Well it is the name of the interface utility.
>
> Have you tried registering your layer using the interface directive with a
> name and then use that in the layer attribute?
>
> I think ovarall, Phillip should support those named layers.

Yes, I have my interface registered with:



class ICentershockSkin(zope.app.rotterdam.Rotterdam):


I've tried to use the name centershock in either a layer or a type attribute, 
but nothing worked. Only giving the the python path with the layer attribute 
worked. The type attribute does not even seem to exist, although I understood 
Philipps proposal that it should replace the layer.
(tested with a resource directive)

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] New way of using skins

2006-03-10 Thread Florian Lindner
Am Freitag, 10. März 2006 12:45 schrieb Stephan Richter:
> On Friday 10 March 2006 05:55, Florian Lindner wrote:
> > layer = centershock does not seem to work anymore (for what is name
> > attribute of the interface directive?).
> >
> > layer="CS.skin.interfaces.ICentershockLayer" seems to work but do I
> > always have to give the lenghty python path??
>
> Yes, this is one use case Phillip removed.

And what meaning has the name attribute of the interface directive?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] New way of using skins

2006-03-10 Thread Florian Lindner
Hello,

I have:




class ICentershockSkin(zope.app.rotterdam.Rotterdam):


What do I have to give for the layer or type (what is the difference?) 
attributes of view / pages / ... directives?

layer = centershock does not seem to work anymore (for what is name attribute 
of the interface directive?).

layer="CS.skin.interfaces.ICentershockLayer" seems to work but do I always 
have to give the lenghty python path??


Thanks,

florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Why z.a.appsetup.bootstrap function do not return the actual object

2006-03-08 Thread Florian Lindner
Hello,
I'm currently playning with the functions from zope.app.appsetup.bootstrap and 
I'm wondering why the functions that create objects (addConfigureUtility, 
addUtility, configureUtility, ensureObject, ensureUtility) do return the name 
of the object added (or None) and not the object itself. What is the reason 
for that?

IMO in most cases you add a Utility you want to change some attributes of it 
afterwards. In order to do that you need the object instance. To get it from 
the name you have to perform a getUtility call. If the functions above would 
return the object you could omit the getUtility.

What do you think about that?

Florian

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Broken homefolder tests

2006-02-08 Thread Florian Lindner
Am Dienstag, 7. Februar 2006 23:48 schrieb Roger Ineichen:
> Hi Stephan
>
> [...]
>
> > No, this is usually painful tracking down. You could check
> > for test setup code
> > that assigns AttributeAnnotatable to File. Also note that
> > there is no good
> > way for tearing down classImplements() statements. So this
> > issue potentially
> > exists in many places. I think for now it would be okay to add the
> > declaration to the test setup.
>
> Ok, I will take a look at this next week.
>
> Have a nice week

Thanks for fixing that!

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Broken homefolder tests

2006-02-07 Thread Florian Lindner
Am Dienstag, 7. Februar 2006 10:31 schrieb Stephan Richter:
> On Monday 06 February 2006 19:18, Roger Ineichen wrote:
> > Does somebody know if there is a method for check if
> > a teardown get called after a test? Some hints?
>
> No, this is usually painful tracking down. You could check for test setup
> code that assigns AttributeAnnotatable to File. Also note that there is no
> good way for tearing down classImplements() statements. So this issue
> potentially exists in many places. I think for now it would be okay to add
> the declaration to the test setup.

Can I assume that the problem is not in the homefolder package?

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Add HomeFolder enhancement to CHANGELOG

2006-02-05 Thread Florian Lindner
Hello,
should I add the enhancement to the homefolder manager to the CHANGELOG or is 
it too unimportant to add? (revision 41424)

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] doctest: Get type of object

2006-01-24 Thread Florian Lindner
Am Dienstag, 24. Januar 2006 22:57 schrieb Tim Peters:
> [Florian Lindner]
>
> > I've tried:
> >
> > Failed example:
> > homeFolder #doctest: +ELLIPSIS
> > Expected:
> > 
> > Got nothing
> >
> >
> > I've also tried it without the #doctest
> >
> > Why do I get just nothing?
>
> That's expected if (and only if) `homeFolder` is bound to `None`.
> What happens if you change the line to:
>
>   print homeFolder #doctest: +ELLIPSIS
>
> ? That added "print " at the front, and will display:
>
> None
>
> if homeFolder is in fact bound to None.

Thanks, it works now. Actually I don't know exactly where the error was... 
anyway, it vanished.

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] doctest: Get type of object

2006-01-24 Thread Florian Lindner
Am Dienstag, 24. Januar 2006 21:07 schrieb Florian Lindner:
> Hello,
> I'm currently writing a test in a README.txt and I want to make sure that
> returned object a is of type zope.app.x. How can I test that?

I've tried:

Failed example:
homeFolder #doctest: +ELLIPSIS
Expected:

Got nothing


I've also tried it without the #doctest

Why do I get just nothing?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] doctest: Get type of object

2006-01-24 Thread Florian Lindner
Hello,
I'm currently writing a test in a README.txt and I want to make sure that 
returned object a is of type zope.app.x. How can I test that?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Enhancement of HomeFolderManager: ok to checkin?

2006-01-22 Thread Florian Lindner
Am Donnerstag, 19. Januar 2006 18:49 schrieb Florian Lindner:
> Hello,
> I did a small enhancement to the HomeFolderManager.
>
> I've added a field containerObject that holds the object to be created as a
> home folder. The type is string. The default is zope.app.folder.Folder.
> The field is validated with:
>
> def _toFieldValue(self, input):
>   try:
> objectToCreate = resolve(input)
>   except ImportError, e:
> raise ConversionError(_('dotted name is not is not correct !'), e)
>   else:
> return input
>
> (from browser.py)
>
> The code that creates the folder is:
>
> objectToCreate = resolve(self.containerObject)
> self.homeFolderBase[name] = objectToCreate()
>
> (fron homefolder.py)
>
> Right now there are no tests yet.
>
> Is this ok to checkin after I've written tests for the new functionality?

Can I take no answers as no objections?

So I'll checkin the next days. If it's not ok, someone can still restore the 
changes in SVN.

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Enhancement of HomeFolderManager: ok to checkin?

2006-01-19 Thread Florian Lindner
Hello,
I did a small enhancement to the HomeFolderManager.

I've added a field containerObject that holds the object to be created as a 
home folder. The type is string. The default is zope.app.folder.Folder.
The field is validated with:

def _toFieldValue(self, input):
  try:
objectToCreate = resolve(input)
  except ImportError, e:
raise ConversionError(_('dotted name is not is not correct !'), e)
  else:
return input

(from browser.py)

The code that creates the folder is:

objectToCreate = resolve(self.containerObject)
self.homeFolderBase[name] = objectToCreate()

(fron homefolder.py)

Right now there are no tests yet.

Is this ok to checkin after I've written tests for the new functionality?

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: [Zope3-Users] Re: Get classes implementing Interface

2006-01-04 Thread Florian Lindner
Am Samstag, 31. Dezember 2005 14:48 schrieb Florian Lindner:
> Am Freitag, 30. Dezember 2005 20:57 schrieb Jeff Shell:
> > On 12/30/05, Florian Lindner <[EMAIL PROTECTED]> wrote:
> > > Am Freitag, 30. Dezember 2005 17:45 schrieb Jim Fulton:
> > > > Philipp von Weitershausen wrote:
> > > > > So, what you want is not a list of classes but a list of factories
> > > > > that can create IContainers. This is possible by using
> > > > > zapi.getUtilitiesFor(IFactory) and then checking each factory's
> > > > > getInterfaces() method whether IContainer is a part of the returned
> > > > > result. I would probably base an implementation of all on the
> > > > > UtilityVocabulary.
> > > >
> > > > I'll also note that the use case is also directly addressed through
> > > > containment constraints.  You can say that a container
> > > > should only contain objects of some given types and you will get
> > > > just those types in the add list.
> > >
> > > But the HomeFolderManager is not a container itself it's just a utility
> > > that creates container upon requests. And I want to make choosable
> > > which container to create. Or do I misunderstand you?
> >
> > Well first (and I apologize if this has been mentioned before),
> > 'containers' are a more abstract notion while 'folders' are more
> > concrete. A message or document that allows comments might be a
> > container, but it's not something that you'd see in the ZMI or any
> > content management type interface as a folder. You'd see it as an
> > article.
> >
> > Something that's "Folderish" (to drag up an old term) will probably
> > have a folder icon, will probably (but not necessarily) will have
> > sub-folders, will have a view to manage its contents, and so on.
>
> [...]
>
> Basically the HomeFolderManager (HFM) only creates an 1:1 relation between
> a principal and an object. It can also auto-create these objects if the
> relation is being read for the first time. In this case the object to be
> created is hardcoded to be a zope.app.folder.Folder. The HFM does not care
> what is being done with the objects it just returns them.
> In my project I've another folderish object that I want to have created,
> therefore I forked the HFM and modified the code to create the object I
> want. Of course, the common use case would be to create a folderish object,
> but any other kind of objects would make sense to. A principal could have a
> home page (just one site) which is not folderish neither a IContainer which
> could the HFM return. Or a project which can contain comments, which is not
> folderis either but is an IContainer implemention.
> I think that the HFM should allow creation of ANY objects, regardless of
> being folderish or IContainer implemenations. Of course, the name
> HomeFOLDERManager would not make sense anymore in this case.
>
> What do you think?
>
> Florian

No thoughts / opinions of anyone?

Can I make the changes to the HomeFolderManager (list box of all classes 
implementing IContainer to select which class to create) and commit?

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Zope3-Users] Re: Get classes implementing Interface

2005-12-31 Thread Florian Lindner
Does anyone got this mail? I've not received a copy from the mailinglists 
neither it shows up in the archives...

Am Freitag, 30. Dezember 2005 20:57 schrieb Jeff Shell:
> On 12/30/05, Florian Lindner <[EMAIL PROTECTED]> wrote:
> > Am Freitag, 30. Dezember 2005 17:45 schrieb Jim Fulton:
> > > Philipp von Weitershausen wrote:
> > > > So, what you want is not a list of classes but a list of factories
> > > > that can create IContainers. This is possible by using
> > > > zapi.getUtilitiesFor(IFactory) and then checking each factory's
> > > > getInterfaces() method whether IContainer is a part of the returned
> > > > result. I would probably base an implementation of all on the
> > > > UtilityVocabulary.
> > >
> > > I'll also note that the use case is also directly addressed through
> > > containment constraints.  You can say that a container
> > > should only contain objects of some given types and you will get
> > > just those types in the add list.
> >
> > But the HomeFolderManager is not a container itself it's just a utility
> > that creates container upon requests. And I want to make choosable which
> > container to create. Or do I misunderstand you?
>
> Well first (and I apologize if this has been mentioned before),
> 'containers' are a more abstract notion while 'folders' are more
> concrete. A message or document that allows comments might be a
> container, but it's not something that you'd see in the ZMI or any
> content management type interface as a folder. You'd see it as an
> article.
>
> Something that's "Folderish" (to drag up an old term) will probably
> have a folder icon, will probably (but not necessarily) will have
> sub-folders, will have a view to manage its contents, and so on.

[...]

Basically the HomeFolderManager (HFM) only creates an 1:1 relation between a 
principal and an object. It can also auto-create these objects if the 
relation is being read for the first time. In this case the object to be 
created is hardcoded to be a zope.app.folder.Folder. The HFM does not care 
what is being done with the objects it just returns them.
In my project I've another folderish object that I want to have created, 
therefore I forked the HFM and modified the code to create the object I want.
Of course, the common use case would be to create a folderish object, but any 
other kind of objects would make sense to. A principal could have a home page 
(just one site) which is not folderish neither a IContainer which could the 
HFM return. Or a project which can contain comments, which is not folderis 
either but is an IContainer implemention.
I think that the HFM should allow creation of ANY objects, regardless of being 
folderish or IContainer implemenations. Of course, the name HomeFOLDERManager 
would not make sense anymore in this case.

What do you think?

Florian

I've included zope-dev in the recipients.

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: [Zope3-Users] Re: Get classes implementing Interface

2005-12-31 Thread Florian Lindner
Am Freitag, 30. Dezember 2005 20:57 schrieb Jeff Shell:
> On 12/30/05, Florian Lindner <[EMAIL PROTECTED]> wrote:
> > Am Freitag, 30. Dezember 2005 17:45 schrieb Jim Fulton:
> > > Philipp von Weitershausen wrote:
> > > > So, what you want is not a list of classes but a list of factories
> > > > that can create IContainers. This is possible by using
> > > > zapi.getUtilitiesFor(IFactory) and then checking each factory's
> > > > getInterfaces() method whether IContainer is a part of the returned
> > > > result. I would probably base an implementation of all on the
> > > > UtilityVocabulary.
> > >
> > > I'll also note that the use case is also directly addressed through
> > > containment constraints.  You can say that a container
> > > should only contain objects of some given types and you will get
> > > just those types in the add list.
> >
> > But the HomeFolderManager is not a container itself it's just a utility
> > that creates container upon requests. And I want to make choosable which
> > container to create. Or do I misunderstand you?
>
> Well first (and I apologize if this has been mentioned before),
> 'containers' are a more abstract notion while 'folders' are more
> concrete. A message or document that allows comments might be a
> container, but it's not something that you'd see in the ZMI or any
> content management type interface as a folder. You'd see it as an
> article.
>
> Something that's "Folderish" (to drag up an old term) will probably
> have a folder icon, will probably (but not necessarily) will have
> sub-folders, will have a view to manage its contents, and so on.

[...]

Basically the HomeFolderManager (HFM) only creates an 1:1 relation between a 
principal and an object. It can also auto-create these objects if the 
relation is being read for the first time. In this case the object to be 
created is hardcoded to be a zope.app.folder.Folder. The HFM does not care 
what is being done with the objects it just returns them.
In my project I've another folderish object that I want to have created, 
therefore I forked the HFM and modified the code to create the object I want.
Of course, the common use case would be to create a folderish object, but any 
other kind of objects would make sense to. A principal could have a home page 
(just one site) which is not folderish neither a IContainer which could the 
HFM return. Or a project which can contain comments, which is not folderis 
either but is an IContainer implemention.
I think that the HFM should allow creation of ANY objects, regardless of being 
folderish or IContainer implemenations. Of course, the name HomeFOLDERManager 
would not make sense anymore in this case.

What do you think?

Florian

I've included zope-dev in the recipients.

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Debugging Zope

2005-10-12 Thread Florian Lindner
Am Mittwoch, 12. Oktober 2005 16:00 schrieb Jim Fulton:
> Florian Lindner wrote:
> > Hello,
> > what tools do you use for debugging your Zope applications and/or the
> > Zope source?
> >
>  > Is there something more comforable (more graphical) than pdb
>  > available? I've tried eric3 but it does not work,
>
> There are a number of debuggers available for Python. Graphical debuggers
> include Wing and Kimodo.  Zope doesn't require anything special.
>
> pdb interacts with emacs in a way that makes emacs almost graphical. :)
> As I step through code, emacs displays it and highlights the line being
> executed.

Is this integrated in the python-mode?

>
> > probably due to Zope3 spawning processes.
>
> As a rule, you should try to avoid debugging Zope as an app server.
> You want to find and debug modt problems in tests, which are much easier
> to debug than a server.

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Debugging Zope

2005-10-08 Thread Florian Lindner
Hello,
what tools do you use for debugging your Zope applications and/or the Zope 
source? Is there something more comforable (more graphical) than pdb 
available? I've tried eric3 but it does not work, probably due to Zope3 
spawning processes.

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] collector issue 438: canWrite throwing forbidden attribute

2005-09-28 Thread Florian Lindner
Am Dienstag, 27. September 2005 16:29 schrieb Fred Drake:
> On 9/27/05, Gary Poster <[EMAIL PROTECTED]> wrote:
> > Hi.  Kevin (cc'd, along with the person whom I believe filed the
> > original bug) asked me to look at collector issue 438.  Here are a
> > few thoughts and observations.
>
> Ok, this made me look at the collector issue again, since
> partialAnnotatableAdapterFactory is my fault.
>
> > My first guess, then, is that the factory generated by
> > annotatableadapter.partialAnnotatableAdapterFactory is not the class
> > that is instantiated.  I don't know that code: maybe I'm wrong.  But,
> > generally, the missing link that needs to be filled is getting the
> > security settings on the object generated by the
> > partialAnnotatbleAdapterFactory.  The zcml is trying to do that, I
> > see, but it's not working.
>
> I've followed up in the collector; I think we're missing information
> about the content object itself, and I've attempted to clarify there
> what appears to be happening.  Your diagnosis remains a possibility,
> though I'm hoping it's unlikely.

I've created and uploaded a example which demonstrates the error: 
http://xgm.de/partial.tar.gz

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Still problems with partialAnnotationsAdapter

2005-08-27 Thread Florian Lindner
I'm posting this to zope3-dev because I have not received any reply on 
zope3-users and I think it could be a bug...


Hello,
I'm still having problems with the partialAnnotationsAdapter.
Refer to my posting:

Subject: [Zope3-Users] Problems with PartialAnnotationsAdapter
From: Florian Lindner <[EMAIL PROTECTED]>
To: zope3-users@zope.org
Date: 25.07.2005 15:14

or

http://www.zope.org/Collectors/Zope3-dev/438

I've created a minimalistic (2,7 KB unzipped size) content type that 
demonstrates the problem.
It is uploaded at http://xgm.de/partial.tar.gz.

I would really appreciate it, if someone might have a look at it. I've tested 
with the newest SVN version (from 2 hours ago) and I've also created a new 
plain instance for it. The described error still persists.

Another thing that puzzles me, is that altough I've defined a schema field 
"description" the addform is empty.
As soon as I've entered a object id and clicked "Add" the error comes up. I've 
the item was added to the root folder I'm unable to get into the ZMI without 
deleting the files in instance/var. (which is not a problem for me)

Thanks!

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] (no subject)

2005-07-09 Thread Florian Lindner
Am Samstag, 9. Juli 2005 02:20 schrieb aaron wang:
> hi all,
> I am a newcomer to python & zope, I read some materials, and want to know
> wheather I could start on zope3 without experience on zope2. I want start
> on my learning by  constructing a small website, but I don't have right
> book/tutorial for reference.
>
> Thanks your reply in advance

Hi Aaron,
there are currently two books around. Stephans Zope3 book is more a reference 
guide. It is available both online and printed. The online version can be 
found at 
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book. 
But at the moment the printed version is much more recent that the online 
version.

Philipps book is more aimed toward beginners and available only printed. The 
homepage is http://worldcookery.com/.

A good starting point for all kinds of Zope3 documentation is 
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Documentation.

BTW: This is the list for people developing Zope3, not for people developing 
_with_ Zope3.  ;-) zope3-users@zope.org would be more appropriate  for your 
question. (http://www.zope.org/Resources/MailingLists). I'm alos posting a 
follow up there.

Hope that helps,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Problem with partialAnnotatableAdapters

2005-05-30 Thread Florian Lindner
Am Freitag, 27. Mai 2005 16:33 schrieb Jim Fulton:
> Fred Drake wrote:
> > On 5/25/05, Ivo van der Wijk <[EMAIL PROTECTED]> wrote:
> >>I'm trying something similar right now as well - "sharing" the title
> >>field between DC and content. Everything works fine, until I try to
> >>change the title through the Metadata tab:
> >
> > This is interesting.  We're not using the Metadata tab at all in the
> > application for which we initially determined that something like this
> > is needed.  I'll have to take a look at this next week if someone
> > doesn't figure it out before then; can't do it now.  A collector issue
> > is in order.
>
> Actually, I ran into this yesterday.  I'll be checking in at least a
> partial fix today.

Hello,
have you already checked it in? I went through the checkin mails but couldn't 
find anything which I could identify to patch it. ;-)

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: __name__ in auto generated addforms

2005-05-30 Thread Florian Lindner
Hey!
Sorry for mailing you again. Have you found any better solution where I can 
omit I name chooser? You said that I eventually don't it.

Thanks a lot,

Florian

Am Montag, 23. Mai 2005 22:19 schrieb Ruslan Spivak:
> В Пнд, 23/05/2005 в 22:02 +0200, Florian Lindner пишет:
> > Am Sonntag, 22. Mai 2005 01:31 schrieb Ruslan Spivak:
> > > В Сбт, 21/05/2005 в 19:33 +0200, Florian Lindner пишет:
> > > > Hello,
> > > > is it possible to let the user enter the name of a object (the
> > > > __name__ attribut) in forms that are auto generated from schema data
> > > > (via the addform directive)?
> > > >
> > > > Thanks,
> > > >
> > > > Florian
> > >
> > > Hi, Florian.
> > >
> > > You need create adapter to zope.app.container.interfaces.INameChooser
> > > and register it for your xxx interface.
> > >
> > > Take a look at bugtracker application inside zope, it contains example
> > > of INameChooser usage.
> >
> > Ok, I've done so.
> >
> > I've created a INameChooser implementation:
> >
> >
> > from zope.app.container.interfaces import INameChooser
> >
> > class NameChooser:
> > implements(INameChooser)
> >
> > def __init__(self, context):
> > self.context = context
> >
> > def chooseName(self, name, object):
> > print object
> > return object.title
> >
> > gives the traceback:
> >
> > 2005-05-23T22:01:13 ERROR SiteError
> > http://localhost:8080/cs/home/zope.manager/t
> > estfolder/+/AddCSLink.html%3D
> > Traceback (most recent call last):
> >
> >   File
> > "/home/florian/Desktop/zope/lib/python/CS/ContentFolder/contentfolder.py"
> >, line 22, in
> > chooseName
> > return object.title
> > AttributeError: 'Link' object has no attribute 'title'
> >
> > but the Link object has a attribute title.
> >
> > title = TextLine(
> > title = u"Title",
> > description = u"Short title",
> > required = True
> > )
> >
> > What is wrong there?
>
> You need to use set_before_add in your addform definition to set needed
> fields which will be assigned to newly created object before it's added
> (take a look at ZCML online help, browser section). That's needed if you
> want to access fields of object's schema inside INameChooser
> implementation.

I'll have a look at it tomorrow...

> P.S. As you probably noted INameChooser is helpful, for example, for
> creating custom object names that follow your own policy(let's say you
> want prepend year_month_day to object's title or whatever you want to
> do). I just reread your first post and wondering if i'm correctly
> understood your question and you really need INameChooser...

What I need is fairly simple: If I auto-create a addform the user sees widgets 
for all schema fields I've created in my interface. But I couldn't set the 
name of the object (__name__ attribute).

I've just discovered that this is not entirely true.
If I click on menu items I've created with:



I get this URL as a link
http://localhost:8080/++skin++centershock/cs/home/zope.manager/%40%40AddCSLink.html
where I can't enter the objects name.

But when I take the URL from the ZMI add dialoge and add a ++skin++centershock 
I get this URL:

http://localhost:8080/++skin++centershock/cs/home/zope.manager/+/AddCSLink.html=

Both refer to the same object and both look the same with the only difference 
that I can enter a objects name in the last one.

You know what the difference is and why is it?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: __name__ in auto generated addforms

2005-05-23 Thread Florian Lindner
Am Montag, 23. Mai 2005 22:19 schrieb Ruslan Spivak:
> В Пнд, 23/05/2005 в 22:02 +0200, Florian Lindner пишет:
> > Am Sonntag, 22. Mai 2005 01:31 schrieb Ruslan Spivak:
> > > В Сбт, 21/05/2005 в 19:33 +0200, Florian Lindner пишет:
> > > > Hello,
> > > > is it possible to let the user enter the name of a object (the
> > > > __name__ attribut) in forms that are auto generated from schema data
> > > > (via the addform directive)?
> > > >
> > > > Thanks,
> > > >
> > > > Florian
> > >
> > > Hi, Florian.
> > >
> > > You need create adapter to zope.app.container.interfaces.INameChooser
> > > and register it for your xxx interface.
> > >
> > > Take a look at bugtracker application inside zope, it contains example
> > > of INameChooser usage.
> >
> > Ok, I've done so.
> >
> > I've created a INameChooser implementation:
> >
> >
> > from zope.app.container.interfaces import INameChooser
> >
> > class NameChooser:
> > implements(INameChooser)
> >
> > def __init__(self, context):
> > self.context = context
> >
> > def chooseName(self, name, object):
> > print object
> > return object.title
> >
> > gives the traceback:
> >
> > 2005-05-23T22:01:13 ERROR SiteError
> > http://localhost:8080/cs/home/zope.manager/t
> > estfolder/+/AddCSLink.html%3D
> > Traceback (most recent call last):
> >
> >   File
> > "/home/florian/Desktop/zope/lib/python/CS/ContentFolder/contentfolder.py"
> >, line 22, in
> > chooseName
> > return object.title
> > AttributeError: 'Link' object has no attribute 'title'
> >
> > but the Link object has a attribute title.
> >
> > title = TextLine(
> > title = u"Title",
> > description = u"Short title",
> > required = True
> > )
> >
> > What is wrong there?
>
> You need to use set_before_add in your addform definition to set needed
> fields which will be assigned to newly created object before it's added
> (take a look at ZCML online help, browser section). That's needed if you
> want to access fields of object's schema inside INameChooser
> implementation.

I'll have a look at it tomorrow...

> P.S. As you probably noted INameChooser is helpful, for example, for
> creating custom object names that follow your own policy(let's say you
> want prepend year_month_day to object's title or whatever you want to
> do). I just reread your first post and wondering if i'm correctly
> understood your question and you really need INameChooser...

What I need is fairly simple: If I auto-create a addform the user seas widget 
for all schema fields I've created in my interface. But I couldn't set the 
name of the object (__name__ attribute).

I've just discovered that this is not entirely true.
If I click on menu items I've created with:



I get this URL as a link
http://localhost:8080/++skin++centershock/cs/home/zope.manager/%40%40AddCSLink.html
where I can't enter the objects name.

But when I take the URL from the ZMI add dialoge and add a ++skin++centershock 
I get this URL:

http://localhost:8080/++skin++centershock/cs/home/zope.manager/+/AddCSLink.html=

Both refer to the same object and both look the same with the only difference 
that I can enter a objects name in the last one.

You know what the difference is and why is it?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: __name__ in auto generated addforms

2005-05-23 Thread Florian Lindner
Am Sonntag, 22. Mai 2005 01:31 schrieb Ruslan Spivak:
> В Сбт, 21/05/2005 в 19:33 +0200, Florian Lindner пишет:
> > Hello,
> > is it possible to let the user enter the name of a object (the __name__
> > attribut) in forms that are auto generated from schema data (via the
> > addform directive)?
> >
> > Thanks,
> >
> > Florian
>
> Hi, Florian.
>
> You need create adapter to zope.app.container.interfaces.INameChooser
> and register it for your xxx interface.
>
> Take a look at bugtracker application inside zope, it contains example
> of INameChooser usage.

Ok, I've done so.

I've created a INameChooser implementation:


from zope.app.container.interfaces import INameChooser

class NameChooser:
implements(INameChooser)

def __init__(self, context):
self.context = context

def chooseName(self, name, object):
print object
return object.title

gives the traceback:

2005-05-23T22:01:13 ERROR SiteError 
http://localhost:8080/cs/home/zope.manager/t
estfolder/+/AddCSLink.html%3D
Traceback (most recent call last):

  File 
"/home/florian/Desktop/zope/lib/python/CS/ContentFolder/contentfolder.py"   
 , 
line 22, in chooseName
return object.title
AttributeError: 'Link' object has no attribute 'title'

but the Link object has a attribute title.

title = TextLine(
title = u"Title",
description = u"Short title",
required = True
)

What is wrong there?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: __name__ in auto generated addforms

2005-05-22 Thread Florian Lindner
Am Sonntag, 22. Mai 2005 01:31 schrieben Sie:
> В Сбт, 21/05/2005 в 19:33 +0200, Florian Lindner пишет:
> > Hello,
> > is it possible to let the user enter the name of a object (the __name__
> > attribut) in forms that are auto generated from schema data (via the
> > addform directive)?
> >
> > Thanks,
> >
> > Florian
>
> Hi, Florian.
>
> You need create adapter to zope.app.container.interfaces.INameChooser
> and register it for your xxx interface.
>
> Take a look at bugtracker application inside zope, it contains example
> of INameChooser usage.

Ok, so I can choose the name of the object which is about to be created. But 
how can I allow the user to enter a value for the name? Create a schema field 
name and use that to set __name__? Or is there a more elegant way?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] __name__ in auto generated addforms

2005-05-21 Thread Florian Lindner
Hello,
is it possible to let the user enter the name of a object (the __name__ 
attribut) in forms that are auto generated from schema data (via the addform 
directive)?

Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Problem with partialAnnotatableAdapters

2005-05-19 Thread Florian Lindner
Am Donnerstag, 19. Mai 2005 19:07 schrieb Stephan Richter:
> On Thursday 19 May 2005 13:02, Florian Lindner wrote:
> > Â Â  > Â Â Â Â for=".link.Link"
> > Â Â Â Â provides="zope.app.dublincore.interfaces.IZopeDublinCore"
> > Â Â Â Â factory=".link.factory"
> > Â Â Â Â />
>
> You need to make this a trusted adapter and provide a permission for
> accessing it, i.e. add ``trusted="True"`` and ``permission="zope.public"``

Ok. thanks a lot!

It works, however I get another, not so grave error.

I add the object. I can edit the schema description field and the DC 
description fields changes as well. But when I hit the "Save 
changes" (Ãnderungen spreichern) or "Refresh" (Auffrischen) buttons in the 
meta data pane, regardless whether I changed something or not I get a system 
error with this backtrace:


  File "/home/florian/Zope3/src/zope/tales/tales.py", line 698, in evaluate
return expression(self)
  File "/home/florian/Zope3/src/zope/tales/expressions.py", line 204, in 
__call__
return self._eval(econtext)
  File "/home/florian/Zope3/src/zope/tales/expressions.py", line 198, in _eval
return ob()
  File "/home/florian/Zope3/src/zope/app/dublincore/browser/metadataedit.py", 
line 37, in edit
dc.title = unicode(request['dctitle'])
ForbiddenAttribute: ('title', 
)
127.0.0.1 - zope.manager [19/May/2005:19:38:34 +0200] 
"POST /cs/home/zope.manager/testfolder/Link/@@EditMetaData.html HTTP/1.1" 500 
316 
"http://localhost:8080/cs/home/zope.manager/testfolder/Link/@@EditMetaData.html";
 
"Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.0 (like Gecko)"

I have not touched the title field (it is empty) neither do I have created a 
mapping for it. Only the description field is mapped.

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Problem with partialAnnotatableAdapters

2005-05-19 Thread Florian Lindner
Hello,
I try to connect a schema field with a dublin core metadata field using 
partialAnnotatableAdapterFactory.
I'm logged in as zope.Manager.

My configure.zcml:



My link.py:

[...]
from zope.app.dublincore import annotatableadapter

factory = annotatableadapter.partialAnnotatableAdapterFactory(["description"])

the description field is defined in the interface:

description = TextLine (
title = u"Description",
description = u"Description which mirrors the DC metadata.",
required = False)

What is wrong there?

The backtrace is pasted at the end of the mail.

Thanks,

Florian



2005-05-16T17:26:57 ERROR SiteError 
http://localhost:8080/cs/home/zope.manager/+/AddCSLink.html%3D
Traceback (most recent call last):
[...]
  File "/home/florian/Zope3/src/zope/app/dublincore/timeannotators.py", line 
31, in ModifiedAnnotator
dc.modified = datetime.utcnow()
  File "/home/florian/Zope3/src/zope/app/dublincore/zopedublincore.py", line 
75, in __set__
super(DateProperty, self).__set__(inst, value)
  File "/home/florian/Zope3/src/zope/app/dublincore/zopedublincore.py", line 
48, in __set__
inst._changed()
  File "/home/florian/Zope3/src/zope/app/dublincore/annotatableadapter.py", 
line 49, in _changed
self.annotations[DCkey] = self._mapping
  File "/home/florian/Zope3/src/zope/app/annotation/attribute.py", line 66, in 
__setitem__
annotations = self.obj.__annotations__ = OOBTree()
ForbiddenAttribute: ('__annotations__', )
127.0.0.1 - zope.manager [16/May/2005:17:26:57 +0200] 
"POST /cs/home/zope.manager/+/AddCSLink.html%3D HTTP/1.1" 500 316 
"http://localhost:8080/cs/home/zope.manager/+/AddCSLink.html="; "Mozilla/5.0 
(compatible; Konqueror/3.4; Linux) KHTML/3.4.0 (like Gecko)"
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Question and maybe enhancement of the HomeFolderManager

2005-04-21 Thread Florian Lindner
Am Mittwoch, 20. April 2005 14:00 schrieben Sie:
> On Wednesday 20 April 2005 07:01, Florian Lindner wrote:
> > when I want to use my own Folder implementation as a homefolder I have
> > two possibilities at the moment:
> >
> > 1) Disable autoCreate and create the homefolder myself.
> > 2) Write a completely own implementation of IHomeFolderManager, use the
> > existing code, only change the line self.homeFolderBase[name] = Folder()
> > in assignHomeFolder(..) to something which creates my own IContainer
> > implementation
> >
> > Is this correct?
>
> Yes.
>

I've started to fork you Homefolder Manager and get a conflicting error:

zope.configuration.config.ConfigurationConflictError: Conflicting 
configuration actions
  For: ('utility', , 'IHomeFolderManager')
File "/home/florian/Desktop/zope/lib/python/CS/Homefolder/configure.zcml", 
line 74.2-78.8

File "/home/florian/Zope3/src/zope/app/homefolder/configure.zcml", line 
74.2-78.8



Why do they conflict? The interface is different, only the last part is equal?

Thx,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Question and maybe enhancement of the HomeFolderManager

2005-04-20 Thread Florian Lindner
Hello,
when I want to use my own Folder implementation as a homefolder I have two 
possibilities at the moment:

1) Disable autoCreate and create the homefolder myself.
2) Write a completely own implementation of IHomeFolderManager, use the 
existing code, only change the line self.homeFolderBase[name] = Folder() in 
assignHomeFolder(..) to something which creates my own IContainer 
implementation

Is this correct?

My enhancement idea: Make it possible in the utility management site to select 
the object type to create. Just display a list of all classes (or all classes 
derived from IContained) and let the user select one.

Is this possible to implement?

ATM my knowledge is not sufficient to implement this, so for now I'll go the 
way number 2 and file a collector issue. Maybe I'll be able to do this later.

Ok?

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreignview:contextchanged

2005-04-16 Thread Florian Lindner
Am Samstag, 16. April 2005 13:03 schrieb Roger Ineichen:
> Hi Florian
>
> Behalf Of Florian Lindner
>
> > Sent: Saturday, April 16, 2005 12:34 PM
> > To: [EMAIL PROTECTED]
> > Cc: zope3-dev@zope.org
> > Subject: Re: [Zope3-dev] RE: [Zope3-Users] page uses
> > foreignview:contextchanged
> >
> > Am Samstag, 16. April 2005 11:59 schrieb Roger Ineichen:
> > > Hi Florian
>
> [snip]
>
> > > > > I'm not sure if you have a ViewPageTemplate instance
> > > > > at the view attribute.
> > > > > What do you get if you print out the result of view
> > > > > and index like:
> > > > >
> > > > > print "the view ", view
> > > > > print "the view index ", view.index
> > > > >
> > > > > Can you send me the output?
> > > >
> > > > the view   > > > from
> > > > /home/florian/Desktop/zope/lib/python/CS/Linklist/browser/skin
> > > > /childInfo.pt
> > > > object at 0xb2e1fc6c>
> > > >
> > > > the view index   > > >  > > > from
> > > > /home/florian/Desktop/zope/lib/python/CS/Linklist/browser/skin
> > > > /childInfo.pt
> > > > object at 0xb2e1fc6c>>
> > >
> > > This looks good.
> > >
> > > Can you send me the ZPT code of childInfo.pt
> > > And the ZCML directive where you register the childInfo.pt
> >
> >  > name="childInfo"
> > for="CS.Linklist.interfaces.ILink"
> > template="childInfo.pt"
> > permission="zope.View"
> > layer="centershock"
> > />
> >
> >
> > childInfo.pt:
> >
> >
> > 
> >   
> > 
> >   
> > 
> >   
> > 
> >
> >
> > My requests are also always for the centershock layer
> > (http://localhost:8080/++skin++centershock/...)
>
> What do you get with:
>
> htmlcode += view["childInfo"]

One addition:

print view["childInfo"] gives:

>
the viw childInfo:  [('version', '1.5.1'), ('mode', 'html'), ('setPosition', 
(4, 4)), ('setSourceFile', 
'/home/florian/Desktop/zope/lib/python/CS/Linklist/browser/skin/childInfo.pt'), 
('beginScope', {'define-macro': 'childInfo'}), ('optTag', ('metal:block', 
None, 'metal', 0, [('startTag', ('metal:block', [('define-macro', 
'childInfo', 'metal')]))], [('rawtextBeginScope', ('\r\n  ', 6, (5, 6), 
0, {'tal:replace': 'context/__name__'})), ('insertText', (, [('startEndTag', ('span', [('tal:replace', 
'context/__name__', 'tal')]))])), ('endScope', ()), ('rawtextColumn', ('\r\n
', 4))])), ('endScope', ())


Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreignview:contextchanged

2005-04-16 Thread Florian Lindner
Am Samstag, 16. April 2005 13:03 schrieb Roger Ineichen:
> Hi Florian
>
> Behalf Of Florian Lindner
>
> > Sent: Saturday, April 16, 2005 12:34 PM
> > To: [EMAIL PROTECTED]
> > Cc: zope3-dev@zope.org
> > Subject: Re: [Zope3-dev] RE: [Zope3-Users] page uses
> > foreignview:contextchanged
> >
> > Am Samstag, 16. April 2005 11:59 schrieb Roger Ineichen:
> > > Hi Florian
>
> [snip]
>
> > > > > I'm not sure if you have a ViewPageTemplate instance
> > > > > at the view attribute.
> > > > > What do you get if you print out the result of view
> > > > > and index like:
> > > > >
> > > > > print "the view ", view
> > > > > print "the view index ", view.index
> > > > >
> > > > > Can you send me the output?
> > > >
> > > > the view   > > > from
> > > > /home/florian/Desktop/zope/lib/python/CS/Linklist/browser/skin
> > > > /childInfo.pt
> > > > object at 0xb2e1fc6c>
> > > >
> > > > the view index   > > >  > > > from
> > > > /home/florian/Desktop/zope/lib/python/CS/Linklist/browser/skin
> > > > /childInfo.pt
> > > > object at 0xb2e1fc6c>>
> > >
> > > This looks good.
> > >
> > > Can you send me the ZPT code of childInfo.pt
> > > And the ZCML directive where you register the childInfo.pt
> >
> >  > name="childInfo"
> > for="CS.Linklist.interfaces.ILink"
> > template="childInfo.pt"
> > permission="zope.View"
> > layer="centershock"
> > />
> >
> >
> > childInfo.pt:
> >
> >
> > 
> >   
> > 
> >   
> > 
> >   
> > 
> >
> >
> > My requests are also always for the centershock layer
> > (http://localhost:8080/++skin++centershock/...)
>
> What do you get with:
>
> htmlcode += view["childInfo"]

  File 
"/home/florian/Desktop/zope/lib/python/CS/centershock/browser/skin/views.py", 
line 46, in getHTML
htmlcode += view["childInfo"]
TypeError: cannot concatenate 'str' and 'list' objects


When I change it to htmlcode += view["childInfo"]

Thx,
Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreignview:contextchanged

2005-04-16 Thread Florian Lindner
Am Samstag, 16. April 2005 11:59 schrieb Roger Ineichen:
> Hi Florian
>
> From: Florian Lindner [mailto:[EMAIL PROTECTED]
>
> > Sent: Saturday, April 16, 2005 10:28 AM
> > To: [EMAIL PROTECTED]
> > Cc: zope3-dev@zope.org
> > Subject: Re: [Zope3-dev] RE: [Zope3-Users] page uses
> > foreignview:contextchanged
>
> [snip]
>
> > > I'm not sure if you have a ViewPageTemplate instance
> > > at the view attribute.
> > > What do you get if you print out the result of view
> > > and index like:
> > >
> > > print "the view ", view
> > > print "the view index ", view.index
> > >
> > > Can you send me the output?
> >
> > the view   > from
> > /home/florian/Desktop/zope/lib/python/CS/Linklist/browser/skin
> > /childInfo.pt
> > object at 0xb2e1fc6c>
> >
> > the view index   >  > from
> > /home/florian/Desktop/zope/lib/python/CS/Linklist/browser/skin
> > /childInfo.pt
> > object at 0xb2e1fc6c>>
>
> This looks good.
>
> Can you send me the ZPT code of childInfo.pt
> And the ZCML directive where you register the childInfo.pt

 


childInfo.pt:





  

  



My requests are also always for the centershock layer 
(http://localhost:8080/++skin++centershock/...)


Thanks,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreignview:contextchanged

2005-04-16 Thread Florian Lindner
Am Samstag, 16. April 2005 01:55 schrieb Roger Ineichen:
> > That works now, but I get a error with instruction:
> >
> > htmlcode += view.index["childInfo"] <--
> >
> > traceback:
> >
> >   File
> > "/home/florian/Desktop/zope/lib/python/CS/centershock/browser/
> > skin/views.py",
> > line 41, in getHTML
> > htmlcode += view.index["childInfo"]
> > TypeError: unsubscriptable object
> >
> > The macro is existing. See also my previous posting.
>
> I'm not sure if you have a ViewPageTemplate instance
> at the view attribute.
> What do you get if you print out the result of view
> and index like:
>
> print "the view ", view
> print "the view index ", view.index
>
> Can you send me the output?

the view  

the view index  >

Here is requested output.

Thanks,

Florian

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreignview:contextchanged

2005-04-15 Thread Florian Lindner
Am Freitag, 15. April 2005 22:18 schrieb Roger Ineichen:
> Hi Florian
>
> Behalf Of Florian Lindner
>
> > Sent: Friday, April 15, 2005 6:43 PM
> > To: [EMAIL PROTECTED]
> > Cc: zope3-dev@zope.org
> > Subject: Re: [Zope3-dev] RE: [Zope3-Users] page uses
> > foreignview:contextchanged
> >
> > Am Mittwoch, 13. April 2005 16:16 schrieb Roger Ineichen:
> > > > One more question: How can I use only a specific macro of
> >
> > the view?
> >
> > > try this:
> > >
> > > def __init__(self, context, request):
> > >   self.context = context
> > >   self.request = request
> > >
> > > def getMacro(self):
> > >
> > >   macrocode = ""
> > >   # get the childs of folder 'f'
> > >   childs = self.context.values()
> > >
> > >   for item in childs:
> > >
> > > # get the 'childView' for each item
> > > view = zapi.getMultiAdapter((self.context, item),
> >
> > name='childView')
>
> Ups, that's not correct. If the item has a view called
> "childView", then you can use:
>
> view = zapi.getMultiAdapter((item, self.request), name="childView")
>
> This uses the item as the context and together with the request
> you can lookup for views (named adapters on context and requests).
>
> The item I guess is a Link object? Right?
>
> Sorry about my wrong sample.

That works now, but I get a error with instruction:

htmlcode += view.index["childInfo"] <--

  
traceback:

  File 
"/home/florian/Desktop/zope/lib/python/CS/centershock/browser/skin/views.py", 
line 41, in getHTML
htmlcode += view.index["childInfo"]
TypeError: unsubscriptable object

The macro is existing. See also my previous posting.

Thx,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreignview:contextchanged

2005-04-15 Thread Florian Lindner
Am Mittwoch, 13. April 2005 16:16 schrieb Roger Ineichen:

> > One more question: How can I use only a specific macro of the view?
>
> try this:
>
> def __init__(self, context, request):
>   self.context = context
>   self.request = request
>
> def getMacro(self):
>
>   macrocode = ""
>   # get the childs of folder 'f'
>   childs = self.context.values()
>
>   for item in childs:
>
> # get the 'childView' for each item
> view = zapi.getMultiAdapter((self.context, item), name='childView')
>
> # call the view, this returns the html code of the view
> macrocode += view.index['mymacroname']
>
> # return all html code where get collected
> return macrocode
>
> The result of getMacro can be used in the folder view like:
>
> 
>
>
> btw; don't use getView(), use getMultiAdapter().
>
> The method getView is deprecated and you should seee a TraceBack
> if you use getView()!

Here it does not really work. When I'm using this code:

childs = homefolder.values()

for item in childs:
print item.__name__
view = getMultiAdapter((self.context, item), name="childInfo") <--

htmlcode += view.index["childInfo"]

return htmlcode

I get the following traceback:

File "/home/florian/Zope3/src/zope/component/__init__.py", line 154, in 
getMultiAdapter
raise ComponentLookupError(objects, interface, name)
ComponentLookupError: ((, ), , 'childInfo')


childInfo is registered in the configure.zcml of the Link object:

 

When I change the code to use the deprecated getView method:

childs = homefolder.values()

for item in childs:
print item.__name__
view = getView(item, "childInfo", self.request)

htmlcode += view.index["childInfo"] <--

return htmlcode

I get a traceback one instruction later:

  File 
"/home/florian/Desktop/zope/lib/python/CS/centershock/browser/skin/views.py", 
line 41, in getHTML
htmlcode += view.index["childInfo"]
TypeError: unsubscriptable object

Altough the childInfo.py contains the macro:




Maybe it is a problem that self.context != homefolder?

Thx,

Florian

@Florent: You're perfectly right. Hope it's ok now. ;-)


___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreign view:contextchanged

2005-04-12 Thread Florian Lindner
Am Samstag, 9. April 2005 02:21 schrieb Roger Ineichen:
> Behalf Of Florian Lindner
>
> > Sent: Friday, April 08, 2005 8:18 PM
> > To: zope3-dev@zope.org; [EMAIL PROTECTED]
> > Subject: Re: [Zope3-dev] RE: [Zope3-Users] page uses foreign
> > view:contextchanged
> >
> > Am Mittwoch, 6. April 2005 18:26 schrieb Roger Ineichen:
> > > Hi Florian
> > >
> > > Behalf Of Florian Lindner
> > >
> > > > Sent: Wednesday, April 06, 2005 11:10 PM
> > > > To: zope3-dev@zope.org; [EMAIL PROTECTED]
> > > > Subject: Re: [Zope3-dev] RE: [Zope3-Users] page uses foreign
> > > > view: contextchanged
> > > >
> > > > Am Mittwoch, 6. April 2005 17:01 schrieb Roger Ineichen:
> > > > > Hi Florian
> > > > >
> > > > > Behalf Of Florian Lindner
> > > > >
> > > > > > Sent: Wednesday, April 06, 2005 10:22 PM
> > > > > > To: zope3-users@zope.org
> > > > > > Subject: [Zope3-Users] page uses foreign view: context changed
> > > > > >
> > > > > > Hello,
> > > > > > I'vw a viewA on a objectA including a macro:
> > > > > >
> > > > > >
> > > > > > 
> > > > > >   
> > > > > > 
> > > > > >
> > > > > > A view of objectB uses this macro and inserts it into its
> > > >
> > > > own viewB:
> > > > > I can't follow. What do you try to say?
> > > > > What is "A view of objectB" and "its own viewB"?
> > > >
> > > > A object uses a macro which is defined in a view of
> >
> > another object.
> >
> > > > In this macros I want to access the data from the object
> >
> > the view was
> >
> > > > originaly registered for.
> > >
> > > Ok, I was thinking about that you mean somthing like this.
> > > This isn't possible. Or let's say you mix up some parts.
> > >
> > > The macro which you suggest is just a page template. This template
> > > you are useing in a view. If this macro is also used in
> >
> > another view,
> >
> > > it has in this usecase nothing to do with the other view. There is
> > > no relation, if you register a page template as a macro and a second
> > > time as a view, between the macro and the view.
> > >
> > > Perhaps I don't understand this correctly. Can you post the ZCML
> > > directive, then I see what you mean?
> >
> > Ok, I've understand the problem.
> >
> > What I want:
> >
> > A folderish object f has a view. This should display
> > information from the
> > children of f. The children provide this information as a
> > snippet of HTML
> > code which could be inserted directly in f's view.
> >
> > f
> >
> > |- a
> > |- b
> > |- c
> > |- d
> >
> > The view of f should iterate through [a,b,c,d] and get the
> > snippet from every
> > object. The snippets should be in the same order like the
> > objects in the
> > folder. Only direct children should be called.
> >
> > The problem I see with pagelets that the order is undefinied
> > and that all
> > children (recursivly) and not only direct children are called.
> >
> > Or is the best way to implement a own MacroCollector for that?
>
> No pagelets are not the concept for collecting information
> from objects others then the context.
>
> If you like to use parts of the pagelet concept, you can use
> pagedata adapters. But I whould use a simply view on the folder
> for this.
>
> Write a view 'childView' for childs and a view 'folderView' for
> folder "f" with a method getHTML like:
>
>
> def __init__(self, context, request):
>   self.context = context
>   self.request = request
>
> def getHTML(self):
>
>   htmlcode = ""
>
>   # get the childs of folder 'f'
>   childs = self.context.values()
>
>   for item in childs:
>
> # get the 'childView' for each item
> view = zapi.getMultiAdapter((self.context, item), name='childView')
>
> # call the view, this returns the html code of the view
> htmlcode += view()
>
>   # return all html code where get collected
>   return htmlcode
>
> The view 'childView' is a page template where contains the html.
>
>
> The result of getHTML can be used in the folder view like:
>
> 
>
> I think this is the easiest way. You can also implement some
> permission checks before you access the childs. If you use
> different permissions on childs.

Hi Roger,

thanks, that works for so fine.
I've replaced your getMultiAdapter call by 
  view = getView(item, "childInfo", self.request)
I think that's a little bit nicer.

One more question: How can I use only a specific macro of the view?

Thx,
Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Re: SVN: Zope3/trunk/ - Implemented a generic user preferences system.

2005-04-08 Thread Florian Lindner
Am Freitag, 8. April 2005 14:03 schrieb Stephan Richter:
> On Friday 08 April 2005 14:00, Florian Lindner wrote:
> > > BTW, you should really get checkin rights. :-):-)
> >
> > Are you serious about that?
>
> Yep, if you send (email/fax) Jim the contributor agreement in the next hour
> or so, you can be up and running before the weekend starts. :-)

Is this the right contributor aggrement?
http://www.zope.org/DevHome/Subversion/Contributor.pdf

I will send the fax on Monday or Tuesday.
On Sunday I'm going back to Germany from a 2 months stay in Santiago de Chile 
and faxing from here is only possible from INet Cafes. At Monday I'm finally 
again at home, so I'll sign at then.
AFAIK noone depends on the changes in homefolder code, so it probably can wait 
until then.

The SVN username will be the same like my zope.org username?

Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Enhancement proposal for the HomeFolderManager

2005-04-08 Thread Florian Lindner
Am Freitag, 8. April 2005 14:28 schrieb Stephan Richter:
> On Friday 08 April 2005 14:23, Florian Lindner wrote:
> > Ok, they seem to pass!
> >
> > Hurra!  :-):-)
>
> Now you just have to add tests for your new code. :-)

The tests I've added in the README.txt are not sufficient?

  >>> manager.autoCreateAssignment = True
  >>> homeFolder = manager.getHomeFolder('florian')
  >>> 'florian' in manager.assignments
  True
  >>> 'florian' in baseFolder
  True


They pass without problems.

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Enhancement proposal for the HomeFolderManager

2005-04-08 Thread Florian Lindner
Am Freitag, 8. April 2005 14:05 schrieb Stephan Richter:
> On Friday 08 April 2005 14:03, Florian Lindner wrote:
> > But I can't really imagine that you (Stephan) as the original auther
> > wrote no tests (while propagating tests so strongly in his book), so I
> > somehow suspect the README.txt to act as test module and that the code
> > samples are executable. But I got no idea how to run these tests (if they
> > are tests). tests.py just reports that are no functional oder unit tests
> > to run.
>
> from the Zope3 root:
>
> python test.py -vpu1 --dir src/zope/app/homefolder

[EMAIL PROTECTED] ~/Zope3 $ python test.py -vpu1 --dir src/zope/app/homefolder
Configuration file found.
Running UNIT tests at level 1
Running UNIT tests from /home/florian/Zope3
   1/22 
(  4.5%): 
/home/florian/Zope3/src/zope/app/homefolder/README.txt--
Ran 22 tests in 0.680s

OK


Ok, they seem to pass!

Hurra!  :-)

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreign view: contextchanged

2005-04-08 Thread Florian Lindner
Am Mittwoch, 6. April 2005 18:26 schrieb Roger Ineichen:
> Hi Florian
>
> Behalf Of Florian Lindner
>
> > Sent: Wednesday, April 06, 2005 11:10 PM
> > To: zope3-dev@zope.org; [EMAIL PROTECTED]
> > Subject: Re: [Zope3-dev] RE: [Zope3-Users] page uses foreign
> > view: contextchanged
> >
> > Am Mittwoch, 6. April 2005 17:01 schrieb Roger Ineichen:
> > > Hi Florian
> > >
> > > Behalf Of Florian Lindner
> > >
> > > > Sent: Wednesday, April 06, 2005 10:22 PM
> > > > To: zope3-users@zope.org
> > > > Subject: [Zope3-Users] page uses foreign view: context changed
> > > >
> > > > Hello,
> > > > I'vw a viewA on a objectA including a macro:
> > > >
> > > >
> > > > 
> > > >   
> > > > 
> > > >
> > > > A view of objectB uses this macro and inserts it into its
> >
> > own viewB:
> > > I can't follow. What do you try to say?
> > > What is "A view of objectB" and "its own viewB"?
> >
> > A object uses a macro which is defined in a view of another object.
> > In this macros I want to access the data from the object the view was
> > originaly registered for.
>
> Ok, I was thinking about that you mean somthing like this.
> This isn't possible. Or let's say you mix up some parts.
>
> The macro which you suggest is just a page template. This template
> you are useing in a view. If this macro is also used in another view,
> it has in this usecase nothing to do with the other view. There is
> no relation, if you register a page template as a macro and a second
> time as a view, between the macro and the view.
>
> Perhaps I don't understand this correctly. Can you post the ZCML
> directive, then I see what you mean?

Ok, I've understand the problem.

What I want:

A folderish object f has a view. This should display information from the 
children of f. The children provide this information as a snippet of HTML 
code which could be inserted directly in f's view.

f
|- a
|- b
|- c
|- d

The view of f should iterate through [a,b,c,d] and get the snippet from every 
object. The snippets should be in the same order like the objects in the 
folder. Only direct children should be called.

The problem I see with pagelets that the order is undefinied and that all 
children (recursivly) and not only direct children are called.

Or is the best way to implement a own MacroCollector for that?

Bye,

Florian

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] Enhancement proposal for the HomeFolderManager

2005-04-08 Thread Florian Lindner
Am Mittwoch, 6. April 2005 20:21 schrieb Stephan Richter:
> On Wednesday 06 April 2005 16:22, Florian Lindner wrote:
> > I you think that is a good idea, I would like (to try) to make the
> > modifications at the HomeFolderManager. (as a junior job, practice and as
> > well as a little bit giving back for all your help).
>
> Sure. Go ahead.

Ok, I've made the changes and it works for me.

The diff I've created with:

[EMAIL PROTECTED] ~ $ svn diff Zope3/src/zope/app/homefolder/ > homefolder.diff

is attached.

I've also changed the readme to provide a example of the new feature.

However the changes are not formally tested. The homefolder module has not 
contained any tests I could have used as a template and since I've never 
written tests of zope components I've skipped that for now.

But I can't really imagine that you (Stephan) as the original auther wrote no 
tests (while propagating tests so strongly in his book), so I somehow suspect 
the README.txt to act as test module and that the code samples are 
executable. But I got no idea how to run these tests (if they are tests). 
tests.py just reports that are no functional oder unit tests to run.

Regards,

Florian
Index: Zope3/src/zope/app/homefolder/interfaces.py
===
--- Zope3/src/zope/app/homefolder/interfaces.py	(revision 29876)
+++ Zope3/src/zope/app/homefolder/interfaces.py	(working copy)
@@ -44,10 +44,17 @@
 
 createHomeFolder = Bool(
 title=_("Create Home Folder"),
-description=_("Whether home folders should be created, if missing."),
+description=_("Whether home folders should be created upon adding a assignment, if missing."),
 required=True,
 default=True)
-
+
+autoCreateAssignment = Bool(
+title=_("Auto create assignment"),
+description=_("Whether assignment and folder should be created when "
+  "calling getHomeFolder, if not existing."),
+required=True,
+default=False)
+
 homeFolderRole = Choice(
 title=_("Local Home Folder Role"),
 description=_("The local role that the user will have in "
@@ -80,10 +87,14 @@
 def getHomeFolder(principalId):
 """Get the home folder instance of the specified principal.
 
-If the home folder does not exist and `autoCreateFolder` is set to
-`True`, then create the home folder. During creation, the principal
-should get manager rights inside the folder.
+If a assignment does not exist and `autoCreateAssignment` is set to
+`True`, then create the assignment and the homefolder. The homefolder 
+will always be created regardless of the value of createHomeFolder.
+The folder will be given the same name like the principalId.
+
+During creation, the principal should get the rights specified in 
+homeFolderRole inside the folder.
 
-If the home folder does not exist and `autoCreateFolder` is set to
+If the home folder does not exist and `autoCreateAssignment` is set to
 `False`, then return `None`.
 """
Index: Zope3/src/zope/app/homefolder/homefolder.py
===
--- Zope3/src/zope/app/homefolder/homefolder.py	(revision 29876)
+++ Zope3/src/zope/app/homefolder/homefolder.py	(working copy)
@@ -35,6 +35,7 @@
 # See IHomeFolderManager
 homeFolderBase = None
 createHomeFolder = True
+autoCreateAssignment = False
 homeFolderRole = u'zope.Manager'
 
 def __init__(self):
@@ -68,7 +69,10 @@
 def getHomeFolder(self, principalId):
 """See IHomeFolderManager"""
 if principalId not in self.assignments:
-return None
+if self.autoCreateAssignment:
+self.assignHomeFolder(principalId, create=True)
+else:
+return None
 
 return self.homeFolderBase.get(self.assignments[principalId], None)
 
Index: Zope3/src/zope/app/homefolder/README.txt
===
--- Zope3/src/zope/app/homefolder/README.txt	(revision 29876)
+++ Zope3/src/zope/app/homefolder/README.txt	(working copy)
@@ -129,14 +129,27 @@
 
 
 If you try to get a folder and it does not yet exist, `None` will be
-returned. Remember 'dreamcatcher', which has an assignment, but not a folder?
+returned if autoCreateAssignment is False. Remember 'dreamcatcher', which 
+has an assignment, but not a folder:
 
   >>> 'dreamcatcher' in baseFolder
   False
   >>> homeFolder = manager.getHomeFolder('dreamcatcher')
   >>> homeFolder is None
   True
+  
+However,

Re: [Zope3-dev] Re: SVN: Zope3/trunk/ - Implemented a generic user preferences system.

2005-04-08 Thread Florian Lindner
Am Mittwoch, 6. April 2005 20:34 schrieb Stephan Richter:
> On Monday 04 April 2005 14:57, Florian Lindner wrote:
> > There is a small typo in the README.txt:
> >
> > [EMAIL PROTECTED] ~/Zope3/src/zope/app/preference $ svn diff README.txt
>
> Fixed in revision 29893.
>
> BTW, you should really get checkin rights. :-)

Are you serious about that?

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] RE: [Zope3-Users] page uses foreign view: context changed

2005-04-06 Thread Florian Lindner
Am Mittwoch, 6. April 2005 17:01 schrieb Roger Ineichen:
> Hi Florian
>
> Behalf Of Florian Lindner
>
> > Sent: Wednesday, April 06, 2005 10:22 PM
> > To: zope3-users@zope.org
> > Subject: [Zope3-Users] page uses foreign view: context changed
> >
> > Hello,
> > I'vw a viewA on a objectA including a macro:
> >
> >
> > 
> >   
> > 
> >
> > A view of objectB uses this macro and inserts it into its own viewB:
>
> I can't follow. What do you try to say?
> What is "A view of objectB" and "its own viewB"?

A object uses a macro which is defined in a view of another object.
In this macros I want to access the data from the object the view was 
originaly registered for.

> > 
> >
> > My problem is now, that the context of viewA is objectB. But
> > I want it to
> > insert some data from objectA. How can I get objectA, the
> > object viewA was
> > registered for?
>
> You only can access a view and this view adapts one context.
>
> If you have a viewA on objectA and you like to access other
> context as well there are different concept for this.
>
> Take a look at path adapters or pagedata in zope.app.pagelet
> both of them can be used to access additonal adapters which
> can lookup for other objects like objectB additional to your
> request adapter (viewA) on the context (objectA).

I've read Stephans pagelet demo and I don't think that pagelet are the right 
way to solve my problem.
I will try to take a look at those other methods you mentioned.

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Enhancement proposal for the HomeFolderManager

2005-04-06 Thread Florian Lindner
Hello,
I've just started playing with the HomeFolderManager and one idea for a small 
enhancement comes into my mind.

I think it would be good to have the option to create homefolders and the 
respective assignment automatically upon the first call of getHomeFolder.

(of course all of the following is IMO, but I just don't want to write "i 
think" or "in my opinion" in every sentence) ;-)

The missing of this options dramatically reduces the usefullness of the 
IPathAdapter.
Especially when using a external authentification source the creation of a 
prinicipal can often not or only with great difficulties be synchronized with 
creating the assignment in the HomeFolderManager.

The entrypoint of a user into a site can be arbitrary, especially when using 
HTTP based authentication.

Therefore at every page I've to check if a assignement exists and eventually 
create one. Since this AFAIK can't be done in TAL you've to create a view 
class for every template (other solution AFAIK: register a view class for "*" 
and do it in the __call__ method. but it's not beautiful either.)

If the homefolder and the assignment would be created automatically you can 
just use TAL expression request/prinicipal/homefolder without thinking about 
whether it is already existing or not.


I you think that is a good idea, I would like (to try) to make the 
modifications at the HomeFolderManager. (as a junior job, practice and as 
well as a little bit giving back for all your help).


Regards,

Florian
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: SVN: Zope3/trunk/ - Implemented a generic user preferences system.

2005-04-04 Thread Florian Lindner
There is a small typo in the README.txt:

[EMAIL PROTECTED] ~/Zope3/src/zope/app/preference $ svn diff README.txt
Index: README.txt
===
--- README.txt  (revision 29876)
+++ README.txt  (working copy)
@@ -365,7 +365,7 @@
   >>> interfaces.IPreferenceCategory.providedBy(prefs.ZMISettings2)
   True

-And the tree can built again by carefully cosntructing the id:
+And the tree can built again by carefully constructing the id:

   >>> context = xmlconfig.string('''
   ...  Log message for revision 29798:
>   - Implemented a generic user preferences system.
>
>   * User preferences are combined in groups that are described by
> schemas.
>
>   * One can create a tree of preference groups using Python's dot
> notation in the group ids.
>
>   * Preference groups can be declared to act as categories, which is
> used by the UI to improve the organization of the preferences.
>
>   * Using a default preference provider, the site administrator can
> customize the default settings of the preferences for a user on a
> site wide bases. Acquisition in multi-site pages is supported.
>
>   * The preferences are very easily accessible in TALES via a traversal
> namespace::
>
>   /++preferences++/zmi/folder/sortedby
>
>   * Preferences are easily accessible in Python code::
>  >>> prefs = IUserPreferences(context)
>
> where the context merely has to be an ``ILocation``.
>
>   * Preferences can be easily edited using intuitive URLs::
>
>   http://localhost:8080/++preferences++/zmi
>
>
>
> Changed:
[...]
>   D   Zope3/trunk/src/zope/app/preference/README.txt
>   A   Zope3/trunk/src/zope/app/preference/README.txt
[...]

___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com