Re: [Zope3-Users] So, there is going to be no Zope4... how to handle maintenance a couple of years from now?

2014-09-07 Thread Thierry Florac

Hi,

I think ZCA doesn't do "so much more" than implement a few object design
patterns and provide a very flexible components registry framework.
I'm working mainly on developing new framework-like packages and I just
can't work without it except by re-inventing it!

Many users blame ZCML just because it's XML !
But it's just configuration, and separating configuration from
Python code is one of the greatest benefits of ZCML, mainly while
working on huge projects. The XML format is just a detail and is
probably not so worse than many INI-like or text based configuration
format; and at least it's a de-facto standard.

Regards,
Thierry


Le Sun, 7 Sep 2014 14:14:14 +0530,
  Milind Khadilkar  a écrit:

> Thanks, Thierry.
> I think the real problem with ZCA and ZCML is "bad press". We did not
> face any ZCML problem when we worked on the Zope3 projects. It was
> later, thankfully, that we came across the negative opinion. ZCA did
> require a mindset change for some, but more often than not it has
> helped them in their future work on other platforms too.
> But that was 10 years ago... Don't know about now.
> 
> Regards,
> Milind
> 
> 
> On Sun, Sep 7, 2014 at 11:43 AM, Thierry Florac 
> wrote:
> 
> >
> > Hi,
> >
> > Le Sun, 7 Sep 2014 09:26:43 +0530,
> >   Milind Khadilkar  a écrit:
> >
> > > Seems there will be no Zope4. Puts a fond hope to rest.
> > >
> > > I have one large Zope2 (Zope 2.6) project, one large Zope3 (Zope
> > > 3.4) project, two medium sized Grok projects, one GAE project,
> > > allof them need to be maintained beyond two years.
> > > I would like, if possible, to redevelop them using ONE single
> > > framework. While some of the original developers are available,
> > > most work would need to be done through people who need to be
> > > trained from the ground up.
> > >
> > > My first choice (mainly because I have a complex Zope3 project to
> > > redevelop) would be Bluebream, even if it means using ZCML and
> > > programming in ZCA-shackles. But I am speaking without any real
> > > experience of it. (Negative press ensured that I did not go for
> > > it...)
> > >
> > > Any suggestions?
> >
> > If you are considering a complete re-development, maybe you should
> > have a look at Pyramid.
> > It allows you to reuse a lot of Zope related technologies, including
> > ZODB, traversing and even ZCA ! ;-)
> >
> > I use and develop ZTFY which is based on Bluebream (with updated
> > packages based on ZTK) and which is used in many of my own projects
> > with great success, but which is probably condamned to death in a
> > relatively near future...
> >
> > Regards,
> > Thierry
> >
> >
> > P.S.: by the way, I don't really understand where is the real
> > problem with ZCA (which is so powerful, and not so complicated!)
> > and with ZCML (which is nothing in XML files terms compared to any
> > "serious" Java server development environment...)
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] So, there is going to be no Zope4... how to handle maintenance a couple of years from now?

2014-09-06 Thread Thierry Florac

Hi,

Le Sun, 7 Sep 2014 09:26:43 +0530,
  Milind Khadilkar  a écrit:

> Seems there will be no Zope4. Puts a fond hope to rest.
> 
> I have one large Zope2 (Zope 2.6) project, one large Zope3 (Zope 3.4)
> project, two medium sized Grok projects, one GAE project, allof them
> need to be maintained beyond two years.
> I would like, if possible, to redevelop them using ONE single
> framework. While some of the original developers are available, most
> work would need to be done through people who need to be trained from
> the ground up.
> 
> My first choice (mainly because I have a complex Zope3 project to
> redevelop) would be Bluebream, even if it means using ZCML and
> programming in ZCA-shackles. But I am speaking without any real
> experience of it. (Negative press ensured that I did not go for it...)
> 
> Any suggestions?

If you are considering a complete re-development, maybe you should have
a look at Pyramid.
It allows you to reuse a lot of Zope related technologies, including
ZODB, traversing and even ZCA ! ;-)

I use and develop ZTFY which is based on Bluebream (with updated
packages based on ZTK) and which is used in many of my own projects
with great success, but which is probably condamned to death in a
relatively near future...

Regards,
Thierry


P.S.: by the way, I don't really understand where is the real problem
with ZCA (which is so powerful, and not so complicated!) and with ZCML
(which is nothing in XML files terms compared to any "serious" Java
server development environment...)
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Installation problems with ztfy.webapp on fresh baked gentoo!

2013-07-23 Thread Thierry Florac

Hi,

I've tried to create a new ztfy.webapp site from a fresh virtual
environment and didn't had any "real" problem.
I've tried using several environments (based on setuptools or
distribute) always with good results.
The only thing I had to do was to upgrade my setuptools package
("easy_install -U setuptools" or "pip install -U setuptools").

I work with an up-to-date Debian "sid" operating system (unstable,
amd64).

Regards,
Thierry


Le Sat, 20 Jul 2013 01:36:34 +0200,
  Tamer Higazi  a écrit:

> Same result as before.
> 
> I tried it globally as well as in a virtualenv
> 
> 
> 
> Tamer
> 
> 
> On 07/20/13 01:19, Thierry Florac wrote:
> > 
> > Hi,
> > 
> > Le Sat, 20 Jul 2013 01:09:50 +0200,
> >   Tamer Higazi  a écrit:
> > 
> >> I believe also that it is not related to ztfy packages, because the
> >> same result is being displayed with bluebream as well.
> >>
> >> I am using Python 2.7.5 on Gentoo Linux 64 Bit.
> > 
> > I already had a few installation problem with zc.buildout in release
> > 2.x.
> > Can you try to install release 1.5.2 of zc.buildout ?
> > (easy_install zc.buildout==1.5.2)
> > 
> > 
> > Regards,
> > Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Installation problems with ztfy.webapp on fresh baked gentoo!

2013-07-23 Thread Thierry Florac

Could you give me your versions of setuptools, distribute and
zc.buildout ?

Thierry


Le Sat, 20 Jul 2013 01:36:34 +0200,
  Tamer Higazi  a écrit:

> Same result as before.
> 
> I tried it globally as well as in a virtualenv
> 
> 
> 
> Tamer
> 
> 
> On 07/20/13 01:19, Thierry Florac wrote:
> > 
> > Hi,
> > 
> > Le Sat, 20 Jul 2013 01:09:50 +0200,
> >   Tamer Higazi  a écrit:
> > 
> >> I believe also that it is not related to ztfy packages, because the
> >> same result is being displayed with bluebream as well.
> >>
> >> I am using Python 2.7.5 on Gentoo Linux 64 Bit.
> > 
> > I already had a few installation problem with zc.buildout in release
> > 2.x.
> > Can you try to install release 1.5.2 of zc.buildout ?
> > (easy_install zc.buildout==1.5.2)
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Installation problems with ztfy.webapp on fresh baked gentoo!

2013-07-19 Thread Thierry Florac

Hi,

Le Sat, 20 Jul 2013 01:09:50 +0200,
  Tamer Higazi  a écrit:

> I believe also that it is not related to ztfy packages, because the
> same result is being displayed with bluebream as well.
> 
> I am using Python 2.7.5 on Gentoo Linux 64 Bit.

I already had a few installation problem with zc.buildout in release
2.x.
Can you try to install release 1.5.2 of zc.buildout ?
(easy_install zc.buildout==1.5.2)


Regards,
Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Installation problems with ztfy.webapp on fresh baked gentoo!

2013-07-19 Thread Thierry Florac

Hi,

Le Fri, 19 Jul 2013 23:43:54 +0200,
  Tamer Higazi  a écrit:

> Hi peeople!
> I sent by mistake this question to the zope2 Mailinglist, and I hope
> you forgive me. I have this problem:
> 
> I am trying to install zope3 /ztfy webapp, and I face quickly a
> problem by running "python bootstrap.py" after application setup.
> Here the problem:
> 
> README.txt  bootstrap.py  buildout.cfg  debug.ini  deploy.ini  etc 
> extends-cache  setup.py  src  var
> tamer@tux /storage/PyProjects/ztfyAPP $ python bootstrap.py
> Traceback (most recent call last):
>   File "bootstrap.py", line 111, in 
> ws.find(pkg_resources.Requirement.parse(requirement)).location
> AttributeError: 'NoneType' object has no attribute 'location'
> 
> This problem appears if I try to setup bluebream or a ztfy project
> and I am not getting smart. what could it be?! 
> 
> I already spoke with somebody who had the same problem. He installed
> "zc.builout" globally, and it was solved for him but not me.
> 
> My problem still exist even after installing through easy_install
> zc.buildout globally.
> 
> Any ideas what it could be?!
> 
> For any help I would kindly thank you


I don't think that this problem is strictly related to ZTFY packages.

Which Python version do you use ? On what operating system ??
I'm the creator and maintainer of all ZTFY packages, which are actually
only compatible with Python 2.6 and 2.7.

Regards,
Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] SSL permission error

2013-04-18 Thread Thierry Florac
Hi,

> my server sometimes stops running. I use apache2 in front of zope3 with
> rewrite rules. Here's the transcript.log :
>
> Traceback (most recent call last):
>   File "/var/lib/zope3/instance/www.test.com/bin/runzope", line 48, in ?
> run()
>   File "/var/lib/zope3/instance/www.test.com/bin/runzope", line 44, in run
>   main(["-C", CONFIG_FILE] + sys.argv[1:])
>   File "/usr/lib/python2.4/site-packages/zope/app/twisted/main.py", line
> 73, in main
> service = setup(load_options(args))
>   File "/usr/lib/python2.4/site-packages/zope/app/twisted/main.py", line
> 152, in setup
> service = server.create(db)
>   File "/usr/lib/python2.4/site-packages/zope/app/twisted/server.py", line
> 187, in create
>   backlog=self.backlog,
>   File "/usr/lib/python2.4/site-packages/zope/app/twisted/server.py", line
> 108, in create
>   contextFactory = ssl.DefaultOpenSSLContextFactory(
>   File "/usr/lib/python2.4/site-packages/twisted/internet/ssl.py",
> line
> 78, in __init__
>   self.cacheContext()
>   File "/usr/lib/python2.4/site-packages/twisted/internet/ssl.py",
> line
> 82, in cacheContext
>   ctx.use_certificate_file(self.certificateFileName)
>   OpenSSL.SSL.Error: [('system library', 'fopen', 'Permission
> denied'),
> ('BIO routines', 'FILE_CTRL', 'system lib'), ('SSL routines',
> 'SSL_CTX_use_certificate_file', 'system lib')]
>
> It seems coming from the SSL certificate file with a permission error.


It seems that you're using Python2.4, which is quite old now.
What Zope version are you using ??

Regards,
Thierry


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


Re: [Zope3-Users] Choosing between Bluebream, Zope2 and Grok

2012-10-23 Thread Thierry Florac

Hi,

Le Wed, 24 Oct 2012 07:45:50 +0530,
  Milind Khadilkar  a écrit:

> Hello all Zope Users!
> We are trying to decide on a Zope platform for, say, the next five
> years. We have developed small products on Zope2 and Zope3 between
> 2000 and 2008, and in Grok over the past couple of years, off and on.
> We are looking to build as per customer requirements, and it would be
> common sense to choose the platform as per requirement. However, with
> a small team size, we can't spread ourselves thin over the three
> platforms...Pyramid, Django and GAE also keep beckoning
> 
> We have seven revivable products in Zope2 (2.6 - 2.10), including one
> in Plone. Some of them do not open in Zope 2.11...
> Some of them use DTML for no reason now discernable.
> Some of them use a very old version of ZODB.
> 
> We have one big product in Zope 3.3.  Can we attempt converting it
> from Zope 3 to Zope2?
> 
> We have no real work done in Grok, but there is a level of
> familiarity with it. Newer members of the team know neither Zope2 nor
> Zope3.
> 
> Making use of our past work is an important criterion for us.
> Training new team members is another...
> 
> What other things must we keep in mind when deciding on the platform?
> Any pointers would help.
> 
> Sorry for this rambling question.
> Thanks in advance for your answers.

Using Zope 2 for several years, I switched to Zope 3.3 probably five
years ago and our latest developments since two years are based on ZTK
and ZopeApp. We are really very happy with these!

Having small teams of developers, mainly coming from the Java world,
training them for recent environments was more "natural" and easier to
them than it was for Zope 2.

The main problem with these releases is that BlueBream "as is" is a
dead project; I only used it as a base to create my new development
environments based on recent releases of ZTK and ZopeApp packages.
These ZTK and ZopeApp packages are still maintained (last release was
in May, 2012) but don't seems to evolve much actually (even if
development work seems to be visible in Launchpad). Development
community on these packages don't seems to be very active or is, at
least, hard to find! Same for Grok, for which the last release was 18
months ago.

Excluding Django, Pyramid seems to be the most active project actually
among those you mentioned. And it can include many "old" Zope concepts
(ZODB, traversing...). But I didn't had any time to test it until now...

Best regards,
Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] KGS for ZTK 1.1.1 ?

2011-05-27 Thread Thierry Florac
Hi,

I've seen that ZTK and ZopeApp packages have been released in version
1.1.1 since april, 2011.
Is there any KGS, mainly for zc.* and z3c.* packages, matching this
release ?

Thanks,
Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Referencing objects

2011-02-04 Thread Thierry Florac
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,


Le vendredi  4 février 2011,
  Michael Seifert  a écrit :
==
> Hello everyone,
> 
> I recently started a Zope3 project, but I am stuck at the very
> beginning. Although I have some experience with Zope2, the more
> flexible approach to developing web applications was giving me a
> really hard start. Let me point out my situation:
> I created a container hierarchy which is stored in ZODB. Say I have a
> set of object types A, B, C, D, whose relationships look like the
> following (edges represent containment, i.e. A contains B,... where B
> and D are in subcontainers of A):
> 
> A
>/ \
>   B   D
>   |
>   C
> 
> C has an attribute referencing an object of type D. As this attribute
> is mandatory on creation, I created a vocabulary, which ascends the
> hierarchy from the current context until it reaches A and returns all
> objects of type D.
> Now the part that doesn't work:
> While ascending from C to B and from B to A works fine, descending
> from A to D returns a security proxied object and since these objects
> cannot be pickled, I cannot store it's reference in the attribute of
> C.
> 
> 1. Is this the way it's meant to be done? :) What is your opinion of
> storing B and D objects in subcontainers of A?

That shouldn't be a problem, it's not different when you use a "basic"
folder-like container which, internally, stores sub-objects in an
internal b-tree container ; the only difference here is that you own
two internal containment attributes.


> 2. Are there any means to turn the vocabulary into trusted code, so it
> will not be encapsulated in a proxy (without deactivating the security
> proxy)?

Perhaps can you use the "removeSecurityProxy" function ?


> 3. How do you reference objects like you do with foreign keys in
> relational databases? I want to do this to prevent objects from being
> saved multiple times.

If the targetted object is persistent (and so a subclass of
"Persistent" class), it should be stored only once in the database
(just try to alter properties of an object and check if the other one
is also modified or not to check !)
Another way I commonly use to store references is to store only an
IIntIds utility reference, which is an integer ; the benefit of this
is that this value can easilly be indexed.

Regards,
Thierry
- -- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk1MI5EACgkQNl1a1Vtu7wrpzACeLPBWLaKoVVQn+fueivqnwhJb
jSwAn1LWhDCBnleB+jsfU/VoiJH0eBKD
=sWJB
-END PGP SIGNATURE-
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Bluebream

2010-10-30 Thread Thierry Florac
__
Le samedi 30 octobre,
  Albert DURANTON  a écrit :

> I learn bluebream with bluebream documentattion. After chap1 i run
> bin/paster serve debug.ini. I get :
> r...@mamachine:/home/albert2/bluebream/ticketcollector# bin/paster
> serve debug.ini Traceback (most recent call last): File "bin/paster",
> line 116, in paste.script.command.run()
> File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
> line 84, in run invoke(command, command_name, options, args[1:]) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
> line 123, in invoke exit_code = runner.run(args) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/command.py",
> line 218, in run result = self.command() File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py",
> line 276, in command relative_to=base, global_conf=vars) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteScript-1.7.3-py2.6.egg/paste/script/serve.py",
> line 313, in loadapp **kw) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 204, in loadapp return loadobj(APP, uri, name=name, **kw) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 224, in loadobj global_conf=global_conf) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 248, in loadcontext global_conf=global_conf) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 278, in _loadconfig return loader.get_context(object_type, name,
> global_conf) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 400, in get_context global_additions=global_additions) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 474, in _filter_app_context APP, next_name, global_conf) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 409, in get_context section) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 431, in _context_from_use object_type, name=use,
> global_conf=global_conf) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 361, in get_context global_conf=global_conf) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 248, in loadcontext global_conf=global_conf) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 285, in _loadegg return loader.get_context(object_type, name,
> global_conf) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 561, in get_context object_type, name=name) File
> "/home/albert2/bluebream/ticketcollector/eggs/PasteDeploy-1.3.3-py2.6.egg/paste/deploy/loadwsgi.py",
> line 581, in find_egg_entry_point pkg_resources.require(self.spec)
> File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 654,
> in require needed = self.resolve(parse_requirements(requirements))
> File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 556,
> in resolve raise VersionConflict(dist,req) # XXX put more info here
> pkg_resources.VersionConflict: (mechanize 0.1.11
> (/usr/lib/python2.6/dist-packages),
> Requirement.parse('mechanize>=0.2.0')) I mechanise 0.2.0 in
> buildout.cfg, How use mechanize 0.1.11 in my buildout.cfg or other
> solution ? Merci d'avance. I am blocked and i can not continue. Dudu
__


Hi,

You probably have a mechanize package (0.1.11) in your default Python
install and another one (0.2.0) in your Buildout eggs directory.
Maybe you should try to create an isolated environment (without site
packages) using Virtualenv ??

Regards,
Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Zope3-users Digest, Vol 71, Issue 2

2010-10-11 Thread Thierry Florac
__
Le dimanche 10 octobre,
  david ally  a écrit :

> Ok, I couldn't create a project however, please see the error I got
> when tried zopeproject LearningZope;
> 
> da...@ubuntu104:~$ zopeproject LearningZope
> Enter user (Name of an initial administrator user): david
> Enter passwd (Password for the initial administrator user): test
> Enter eggs_dir (Location where zc.buildout will look for and place
> packages) ['/home/david/buildout-eggs']:
> While:
>   Initializing.
> 
> An internal error occurred due to a bug in either zc.buildout or in a
> recipe being used:
> Traceback (most recent call last):
>   File
> "/usr/local/lib/python2.6/dist-packages/zc.buildout-1.5.1-py2.6.egg/zc/buildout/buildout.py",
> line 1783, in main
> user_defaults, windows_restart, command)
>   File
> "/usr/local/lib/python2.6/dist-packages/zc.buildout-1.5.1-py2.6.egg/zc/buildout/buildout.py",
> line 198, in __init__
> data['buildout'].copy(), override))
>   File
> "/usr/local/lib/python2.6/dist-packages/zc.buildout-1.5.1-py2.6.egg/zc/buildout/buildout.py",
> line 1431, in _open
> eresult = _open(base, extends.pop(0), seen, dl_options, override)
>   File
> "/usr/local/lib/python2.6/dist-packages/zc.buildout-1.5.1-py2.6.egg/zc/buildout/buildout.py",
> line 1381, in _open
> path, is_temp = download(filename)
>   File
> "/usr/local/lib/python2.6/dist-packages/zc.buildout-1.5.1-py2.6.egg/zc/buildout/download.py",
> line 96, in __call__
> local_path, is_temp = self.download(url, md5sum, path)
>   File
> "/usr/local/lib/python2.6/dist-packages/zc.buildout-1.5.1-py2.6.egg/zc/buildout/download.py",
> line 173, in download
> tmp_path, headers = urllib.urlretrieve(url, tmp_path)
>   File "/usr/lib/python2.6/urllib.py", line 93, in urlretrieve
> return _urlopener.retrieve(url, filename, reporthook, data)
>   File "/usr/lib/python2.6/urllib.py", line 237, in retrieve
> fp = self.open(url, data)
>   File "/usr/lib/python2.6/urllib.py", line 205, in open
> return getattr(self, name)(url)
>   File "/usr/lib/python2.6/urllib.py", line 344, in open_http
> h.endheaders()
>   File "/usr/lib/python2.6/httplib.py", line 904, in endheaders
> self._send_output()
>   File "/usr/lib/python2.6/httplib.py", line 776, in _send_output
> self.send(msg)
>   File "/usr/lib/python2.6/httplib.py", line 735, in send
> self.connect()
>   File "/usr/lib/python2.6/httplib.py", line 716, in connect
> self.timeout)
>   File "/usr/lib/python2.6/socket.py", line 514, in create_connection
> raise error, msg
> IOError: [Errno socket error] [Errno 110] Connection timed out
> 
> Please help!
__


Hi,

Did you install ZopeProject from an Ubuntu package (which may also
be outdated) or with easy_install ?
You also need an internet connection while creating your project to
download packages... Is it OK ??

A good way to install ZopeProject and all Zope3 dependencies is with
VirtualEnv ; you can find a quick tutorial on my own web site :

 - http://www.ztfy.org/installation/virtualenv/virtualenv.html
 - http://www.ztfy.org/installation/zopeproject/zopeproject.html

Hope this helps,
Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Zope3-users Digest, Vol 71, Issue 2

2010-10-09 Thread Thierry Florac
__
Le samedi  9 octobre,
  david ally  a écrit :

> I installed version 3.2 from svn repository on Ubuntu Linux 10.04,
> but all i want is the right way to install zope version 3 to learn
> how to write zope applications.
__


Wow !
This release seems really out of date !

A simple way to install Zope actually is to use ZopeProject
(http://pypi.python.org/pypi/zopeproject) and follow it's documentation.

After that, you can find a lot of tutorials about the Zope Component
Architecture and about the way of building Zope3 applications.

Regards,
Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] problems installing and starting zope3

2010-10-08 Thread Thierry Florac
Le vendredi  8 octobre 2010,
  david ally  a écrit :
==
> Hi All,
> 
> I'm newbie and i'm running zope3 on ubuntu 10.04, I got this error
> while trying to run zope;
==


Hi,

Could you be more explicit ?
 - what release do you use ?
 - did you install from eggs or via an Ubuntu pre-configured package ?
 - ...

Regards,
Thierry
-- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr

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


Re: [Zope3-Users] Zope 3.4.1 KGS released!

2010-06-25 Thread Thierry Florac
Le jeudi 24 juin 2010,
  Adam GROSZER  a écrit :
==
> ==
> Zope 3.4.1 Released!
> ==
> 
> June 22, 2010 - The Zope 3 development team announces the Zope 3.4.1
> release.
> 
> The 3.4.1 is the long awaited next bugfix version of 3.4.0.
> 
> Major changes
> ~
> 
> - setuptools update to 0.6c11, so that it supports svn 1.6.
> 
> - z3c.layer update to 0.2.4, which is a **SECURITY** fix.
> 
> For details see the changelog.
==


Hi,

I've tried to build a new zc.buildout based project this morning using
Zope-3.4.1 versions.cfg as reference.

I think there's a small problem with zope.configuration package, as
release 3.4.1 mentionned in KGS is not available on Pypi...

Hope this helps,
Thierry
-- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr

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


Re: [Zope3-Users] ZEO multi-processes client setup with WSGI

2010-06-24 Thread Thierry Florac
Le jeudi 24 juin 2010,
  Jim Fulton  a écrit :
==
> On Thu, Jun 24, 2010 at 6:09 AM, Thierry Florac
>  wrote:
> >
> > Hi,
> >
> > I'm currently going to setup a new Zope3 web site.
> > I'd like to setup this site using :
> >  - a remote ZEO server
> >  - several physical web servers, each hosting a set of ZEO clients
> > and using WSGI (with mod_wsgi).
> >
> > My main question is about mod_wsgi multi-processes setup, and
> > actually : if defining several processes (ideally, one for each CPU
> > core), can several ZEO clients processes share the same ZEO cache ??
> 
> No.
> 
> Jim
==

OK :-(
So as processes setup is defined via WSGI, how can I define such a
"zope.conf" setup with several ZEO clients sharing the same
configuration file ?
Is there a simple setup so that each process use it's own ZEO cache ??

I've finally found a multi-processes configuration sample for Grok
(http://grok.zope.org/documentation/tutorial/installing-and-setting-up-grok-under-mod-wsgi/installing-and-configuring-a-grok-site-under)
and it doesn't seems to specify any custom configuration to handle this
use case...

Thanks for any help,
Thierry
-- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr

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


[Zope3-Users] ZEO multi-processes client setup with WSGI

2010-06-24 Thread Thierry Florac

Hi,

I'm currently going to setup a new Zope3 web site.
I'd like to setup this site using :
 - a remote ZEO server
 - several physical web servers, each hosting a set of ZEO clients and
   using WSGI (with mod_wsgi).

My main question is about mod_wsgi multi-processes setup, and
actually : if defining several processes (ideally, one for each CPU
core), can several ZEO clients processes share the same ZEO cache ??

Many thanks for any help or advise about this kind of setup...

Thierry
-- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr

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


[Zope3-Users] reStructuredText sections question

2010-04-14 Thread Thierry Florac

Hi,

Sorry for cross-posting but I don't know where to ask for this little
question...

I use reST to produce contents which can be :
 - generated as standalone HTML pages
 - included into an existing CMS (via Zope3)

While generating HTML from my CMS, how can I produce sections headers
starting, for example, as "H3" headers instead of "H1" ?
I've seen in Zope3 reST renderer this kind of code :

def render(self):
settings_overrides = {
'halt_level': 6,
'input_encoding': 'unicode',
'output_encoding': 'unicode',
'initial_header_level': 3
}
writer = Writer()
writer.translator_class = ZopeTranslator
html = docutils.core.publish_string(
self.context,
writer=writer,
settings_overrides=settings_overrides,
)
return html

I suppose that "initial_header_level=3" allows to handle my use case,
but apparently it doesn't work...

Any hint ?
I'm currently using Zope-3.4 KGS, with zope.app.renderer-3.4.0 and
docutils-0.4...

Thanks,
Thierry
-- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr

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


[Zope3-Users] Multi-database settings for Zope3

2010-04-06 Thread Thierry Florac

Hi,

I have to build a new application, including several virtual
hosts each matching a different ZODB accessed via ZEO.

Is there any easy way to handle such a configuration in a
single Zope3 instance (I still use Zope-3.4) ?
I used to use ZODB mount points with old Zope2 applications, but didn't
found any equivalent option with Zope3.

Thanks for any help or hint,
Thierry
___
Zope3-users mailing list
Zope3-users@zope.org
https://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Paul carduner z3c tutorial

2010-03-11 Thread Thierry Florac
Le jeudi 11 mars 2010,
  Albert DURANTON  a écrit :
==
> I learn the paulcarduner/z3ctutorial.
> I am the form but when i click add i get:URL:
> http://localhost:8080/%2B%2Bskin%2B%2BZContact/%40%40addContact.html
>
> Module zcontact.browser.contact:14 in create 
> << 
> def create(self, data):
> contact = Contac()
> form.applyChanges(self, contact, data)
> return contact>> contact = Contac()
> NameError: global name 'Contac' is not defined
> 
> I all verified.
> Some can help me ?
> Thank you
==

Hi,

Shouldn't you have :

  contact = Contact()   # Missing 't'

instead of :

  contact = Contac()


Otherwise it looks like a missing import...


Thierry
-- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr

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


Re: [Zope3-Users] CRM based on zope3 or grok?

2010-02-19 Thread Thierry Florac
Le vendredi 19 février 2010,
  Massimiliano della Rovere  a
écrit :
==
> At work we are planning move from Sugar CRM PRO to something else
> free. I'd love moving to something python based, but it seems the only
> free and reliable solution is VTiger 5 written in php.
> 
> Does anybody here know any CRM based on zope3 or grok?
==

I don't know any Zope3 based CRM solution.
But OpenERP is a free Python based ERP offering a CRM module.

Thierry
-- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr

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


Re: [Zope3-Users] Accessing Annotations

2009-09-22 Thread Thierry Florac
__
Le lundi 21 septembre,
  Paul Wilson  a écrit :

> I'm writing a web service that presents objects that additionally
> contain metadata in the form of annotations. I want clients to be able
> to manipulate (GET/PUT) this information without retrieving the whole
> item.
> I was wondering if Zope provides a method for traversing to the
> annotations on such an object, or if I will be required to write a
> custom traverser for my published objects that is aware of my
> annotations, instead?
__


I don't think that Zope3 provides such a traverser "out of the box".
But you can have a look at z3c.traverser package, which provides easy
ways to implement new traversing plugins.

Thierry

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [Zope3-Users] Assigning programmatically a Role to a Principal

2009-05-12 Thread Thierry Florac
Le mardi 12 mai 2009,
  paftek  a écrit :
==
> I created a Role and a Permission affected to it :
> 
> 
> 
> 
> My users are store in a PostgreSQL database, not in the ZODB.
> I use the Zope authentication system to return a PrincipalInfo when an
> user log in.
> 
> I do not know how to assign my "app.User" Role to the Principal who
> log in. I tried the following, without success :
> 
> @adapter(IAuthenticatedPrincipalCreated)
> def setPermission(event):
> role_map = IPrincipalRoleManager(getSiteManager())
> role_map.assignRoleToPrincipal('app.User', event.principal.id)
==

Hi,

What do you mean when you say "without success" ?
What do you get when you look at the "@@grant.html" view over your
context ??

Thierry
-- 
Chef de projets intranet/internet
Office National des Forêts - Département Informatique
2, Avenue de Saint-Mandé
75570 Paris Cedex 12
Tél. : 01 40 19 59 64
Fax. : 01 40 19 58 85
Mél. : thierry.flo...@onf.fr
Web. : http://www.onf.fr

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


Re: [Zope3-Users] Error on adding an index: "ComponentLookupError: (, '') "

2009-05-06 Thread Thierry Florac
==
Le mercredi  6 mai 2009,
  Chetan Kumar  a écrit :

> On Wed, May 6, 2009 at 1:17 PM, Thierry Florac
>  wrote: ...
> > Did you register your "ind" component as default provider of IIntIds
> > interface ??
> 
> The intent is to register this component as provider of IIntIds. I
> see this
> 
> 
> >>> sm.registerUtility(ind, intid.IntIds)
> Traceback (most recent call last):
>   File "", line 1, in ?
>   File
> "/home/xpmt/.buildout/eggs/zope.component-3.4.0-py2.4.egg/zope/component/registry.py",
> line 85, in registerUtility self.utilities.register((), provided,
> name, component) File
> "/home/xpmt/.buildout/eggs/zope.interface-3.4.1-py2.4-linux-i686.egg/zope/interface/adapter.py",
> line 117, in register self._v_lookup.add_extendor(provided)
>   File
> "/home/xpmt/.buildout/eggs/zope.interface-3.4.1-py2.4-linux-i686.egg/zope/interface/adapter.py",
> line 430, in add_extendor for i in provided.__iro__:
> AttributeError: type object 'IntIds' has no attribute '__iro__'
> >>>
> 
==


You should probably have "sm.registerUtility(ind, intid.IIntIds)"...
(Note the IIntIds instead of IntIds).

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


Re: [Zope3-Users] Error on adding an index: "ComponentLookupError: (, '') "

2009-05-06 Thread Thierry Florac
==
Le mercredi  6 mai 2009,
  Chetan Kumar  a écrit :

> Hi all
> What could be the issue here [1]? 'ind' is added as seen in [2]
> 
> I also see this [3], [4]
> 
> This error stops me from adding an index to the catalog.


Did you register your "ind" component as default provider of IIntIds
interface ??

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


[Zope3-Users] TextIndexNG question...

2009-02-18 Thread Thierry Florac
Hi,

I'm currently using TextIndexNG (release 3.2, I think...) to index
documents in a Zope3 application.
Indexed documents are multi-linguals ; I've created one index for each
field and each language, because all fields are not indexed in the same
way (for example, I use stopwords on documents contents but not on
titles).

Everything is **nearly** fine, except for one thing : in french, I have
to index a word like (for example) " l'eau " ; the important word is
"eau" here so, so while searching on title I would like to get a result
while entering query "eau" as well as " l'eau ".
Actually, none of them is working !

I tried to debug a bit, and noticed (if I'm not wrong), that :
 - it's the word " leau " which is computed for indexing
 - but the query " l'eau " is not modified while searching.

I suppose that all this is a splitter/stopwords problem, but I can't
manage to make this work correctly so any help would be greatly
appreciated.


  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.flo...@onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Run starup code with zope 3.

2009-02-12 Thread Thierry Florac
Le jeudi 12 février 2009 à 17:50 +0100, Sebastian Bartos a écrit :
> I'm struggling with some Zope 3 startup code. I registered a user like
> this for the Session Credentials plugin and login form stuff:
> 
> ...
> 
> def create(self, data):
> site = getSite()
> sm = site.getSiteManager()
> 
> if sm.has_key('auth'):
> return "Site is already set up"
> 
> pau = Pluggableauth()
> sm['auth'] = pau
> sm.registerUtility(pau, Iauth)
> users = PrincipalFolder()
> sm['auth']['Users'] = users
> sm.registerUtility(users, IAuthenticatorPlugin, name="Users")
> pau.authenticatorPlugins = (users.__name__, )
> pau.credentialsPlugins = ("No Challenge if Authenticated",
>   "Session Credentials")
> 
> user = InternalPrincipal("user", "foo", "user",
>  passwordManagerName="SHA1")
> users["user"] = user
>principalPermissionManager.grantAllPermissionsToPrincipal("user")


To run code automatically at application startup, I think that you
should have a look at the IDatabaseOpenedWithRootEvent (defined in
zope.app.appsetup.interfaces).
I use this event to check a set of persistent database utilities at
application startup, and it works fine.

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.flo...@onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Interface Use Cases

2009-01-28 Thread Thierry Florac
Le mercredi 28 janvier 2009 à 10:39 -0200, Tim Cook a écrit :
> All,
> 
> I have many places where I have used this in a schema.
> 
> class IAbc
> attr1 = Object(schema=IAbc)
> 
> class Abc(object):
> """does some stuff but is usually an abstract class"""
> implements (IAbc)
> 
> Where IAbc is actually meant to represent that any one of (let's say)
> three different sub-classes of Abc would be acceptable for that
> attribute.
> 
> I think my approach is completely wrong but I do not understand all the
> different cases to use implements, Provides, classImplements, etc.
> 
> 
> so if I had:
> 
> class Def(Abc):
> implements(IDef)
> 
> class Gbn(Abc):
> implements(IGbn)
> 
> class Xds(Abc):
> implements(IXds)
> 
> 
> What is the correct function to use and where so that when attr1 is
> assigned a value it will be happy with an instance of Def, Gbn or Xds?
> 
> But nothing else?


Hi,

If I correctly understand your question :

from zope.schema.fieldproperty import FieldProperty

class Abc(object):
implements(IAbc)
attr1 = FieldProperty(IAbc['attr1'])

Like that, each time attr1 will receive a new value, this value will be
checked to ensure it provides IAbc, otherwise a SchemaNotProvided
exception will be raised.

Hope this will help you,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.flo...@onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] zc.catalog NormalizationWrapper question...

2008-12-18 Thread Thierry Florac
Le jeudi 18 décembre 2008 à 11:03 -0500, Gary Poster a écrit :
> On Dec 18, 2008, at 9:52 AM, Thierry Florac wrote:
> 
> > Hi,
> >
> > I'm currently using zc.catalog package for value and set indexes on a
> > Zope-3.3 application.
> >
> > I'd also like to use DateTimeValueIndex and DateTimeSetIndex and their
> > normalization wrappers to retrieve informations from date-based  
> > queries,
> > and now just have a small question : in the function which defines  
> > these
> > index (in catalogindex.py), resolution is set to 2 with a comment  
> > which
> > says "Hour - good for per-day searches", while in interfaces.py the
> > resolution of 2 is given for minutes...
> 
> 2 is for minutes.  Doctest confirms.
> 
> comment in catalogindex.py is buggy.  Feel like adjusting?  Perhaps  
> simply noting "per-minute"?  Or perhaps it would be nice to make some  
> constants in interfaces.py around where the vocabulary is made?
> 
> > I understood until now that I should use "0" for date-based indexation
> > and queries...
> 
> I suggest hourly for date-based searches *if multiple time-zones are  
> in effect*, so one person's date would not be the same as someone  
> else's for an event that happens at a particular (UTC) time.
> 
> If you don't care about that use case, 0 should work.

All right !
Many thanks for your precise answer...

It's not a big deal to adjust these small settings, but I don't have any
write access to zc package CVS server...


  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.flo...@onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] zc.catalog NormalizationWrapper question...

2008-12-18 Thread Thierry Florac
Hi,

I'm currently using zc.catalog package for value and set indexes on a
Zope-3.3 application.

I'd also like to use DateTimeValueIndex and DateTimeSetIndex and their
normalization wrappers to retrieve informations from date-based queries,
and now just have a small question : in the function which defines these
index (in catalogindex.py), resolution is set to 2 with a comment which
says "Hour - good for per-day searches", while in interfaces.py the
resolution of 2 is given for minutes...

I understood until now that I should use "0" for date-based indexation
and queries...

Did I missed something or is there an error somewhere ??

Thanks for any advise...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : thierry.flo...@onf.fr
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Zope3 and SQLAlchemy

2008-11-18 Thread Thierry Florac
Hi,

I currently have to integrate an SQL database (PostgreSQL, with PostGIS
extensions) into my Zope3 application.
I'd like to use SQLAlchemy to handle this, and I've seen that several
packages are available : z3c.zalchemy, z3c.sqlalchemy,
zope.sqlalchemy...

So my questions are simple :
 - what package is the best to plug into my Zope (3.3.1) application ?
 - do all these packages handle the same features ??

Thanks for any information,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Last zc.async package for Zope-3.3.1

2008-10-20 Thread Thierry Florac

  Hi,

Actually using Zope-3.3.1, I'm looking at zc.async package but the last
release is no more compatible with my Zope release.

Could anyone point me to the last compatible release ??

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] How to add content in HTML head ?

2008-09-18 Thread Thierry Florac

  Hi,

I'm actually building an application with Zope3 (3.3.1).
One of my components (a content provider) provides a list of elements,
for which I should provide an RSS URL.

My question is simple : how can I automatically put the 'link' tag in
HTML head as soon as this component is displayed in any template ?
I already use zc.resourcelibrary package, which handles the same kind of
problem for JS/CSS resources...

Thanks for any help or link...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Copying Objects from/in the ZODB

2008-07-27 Thread Thierry Florac
Le dimanche 27 juillet 2008 à 15:15 -0300, Tim Cook a écrit :
> Hi All,
> 
> Another basic question but I can't seem to find the easy way to do this.
> 
> 
> I have a group of instances stored in the ZODB.  They are basically
> skeletons that I want to copy, edit and store as new instances elsewhere
> in the ZODB.  In Zope2.x this was fairly obvious to me.  Using the ZCA
> it isn't so obvious.  Is there a class I should be inheriting from to do
> this or do I need to provide a copy method in the class itself?  
> 
> If the later; are there any good examples?


Hi,

Have a look at "zope.copypastemove" package interfaces and classes ;
they should provide the simple functions you are looking for...

  Thierry



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [Zope3-Users] Preferred languages

2008-04-17 Thread Thierry Florac
Le jeudi 17 avril 2008 à 12:53 +0200, Frank Burkhardt a écrit :
> there's a problem with my web application. It's written in Zope 3
> and makes heavy use of i18n (-> _("..."), i18n:translate, ...).
> 
> I extracted the english strings and made a german translation (language code
> 'de'). Whenever my browser's "most" preferred language is 'de' or 'de-de'
> (example: "Accept-Language: de-de,en;q=0.5" ), everything works fine.
> 
> But when I switch to 'en','de' (example: "Accept-Language: en,de-de;q=0.5" ,
> the result is unexpected. Zope returns german translations although english
> strings are available (hardcoded into the application).
> 
> Is there a way to tell Zope to use the hardcoded strings, when 'en' is
> requested?

Hi,

I currently use z3c.language.(switch|negotiator|session) packages to
handle internationalization.
It works correctly for me...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] TextIndexNG ranking questions

2008-04-15 Thread Thierry Florac
Le mardi 15 avril 2008 à 14:03 +0200, Andreas Jung a écrit :
> Intersection is likely possible. However I don't know about the 
> implementation of hurry.catalog or the other related Zope 3 components.
> Performing two queries and intersecting the results (e.g. given by paths,
> UIDs or whatever) is basically supported through the various BTree types
> or Zope or by Python's set module..

Intersecting is possible, but BTrees and sets dont support ordering...
So I suppose that I have to convert search results to lists and to
merge/intersect them manually...
Or, given a set (containing final results set intersection) and a list
(containing TextIndexNG results, ordered by ranking), is it possible to
EFFICIENTLY get items of the set in the order in which they are stored
in the list ??

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] TextIndexNG ranking questions

2008-04-15 Thread Thierry Florac
Le mardi 15 avril 2008 à 13:18 +0200, Andreas Jung a écrit :
> Using the ranking of TextIndexNG makes basially only sense when you perform 
> a query against the index alone - not in combination with queries against 
> other fields.

Yes, that's what I thought... :-(
So is there an easy way to "intersect" the results of several distinct
queries, so that the results order provided by TextIndexNG and following
ranking is kept ??

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] TextIndexNG ranking questions

2008-04-15 Thread Thierry Florac

  Hi,

I'm currently using TextIndexNG-3.2.0 as well as other zc.catalog
indexes in a Zope-3.3.1 application.
Indexing several fields as well as external files seems OK, but now I'm
facing a few interrogations about searching and ranking :

1. I've created TXNG indexes with a "term_frequencies" storage and
ranking enabled => OK

2. I'm now using "hurry.query" package to run queries on a set of
catalogs ; it's generally OK but my main question are :

- how can I use TXNG ranking feature when running a single query against
several indexes (actually I have to run queries against several
ValueIndex indexes, matching workflow status and publication date, and
one or two TextIndexNG indexes -- one for title and another one for
content) ? How can I be sure that my results order is matching
ranking ??

- does a ranking query generate a numeric value which could be used to
display to users the relevance of found results ?


Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


{Spam?} Re: [Zope3-Users] Problem with z3c.form / z3c.formui packages

2008-03-27 Thread Thierry Florac
On mer, 2008-03-19 at 06:33 -0700, garz wrote:

> have some views for some content:
> class SomeContentDisplayForm(z3c.formui.layout.FormLayoutSupport,
> z3c.form.form.DisplayForm):
>   fields = z3c.form.field.Fields(ISomeConcent)
> class SomeContentEditForm(z3c.formui.layout.FormLayoutSupport,
> z3c.form.form.EditForm):
>   fields = z3c.form.field.Fields(ISomeConcent)
> 
> if i try to use the view, a componentlookuperror is raised:
> IFieldWidgets cant be looked up
> 
> i thought, the errors source was the BrowserRequest, which should be marked
> with the skin-type. if it was it should look up the adapter from the right
> layer. so i think something is wrong with my skin registration.
> 
> could please somebody help me. i'm stuck with the problem. :(


I think I had the same problem while using z3c.form "DisplayForm"
subclass.
Problem disappeared by using an "EditForm" subclass and setting form's
mode to "DISPLAY_MODE"...

Thierry

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [Zope3-Users] Problem with z3c.form / z3c.formui packages

2008-03-14 Thread Thierry Florac
Hi,

On ven, 2008-03-14 at 23:12 +0100, Thierry Florac wrote:
> I'm trying to use a few z3c.* packages to build a little test
> application : z3c.form, z3c.formui, z3c.layout, z3c.pagelet...
> 
> What I've done until now is :
>  - create a custom layer :
> class ITestLayer(z3c.form.interfaces.IFormLayer,
>  z3c.layer.pagelet.IPageletBrowserLayer)
> 
>  - create a custom skin based on this layer :
> class ITestSkin(z3c.formui.interfaces.IDivFormLayer,
> ITestLayer)
> 
>  - create a pagelet based layout for my skin (via z3c.layout)
> 
>  - create an add form, a display form and an edit form for my custom
> content :
> class TestAddForm(z3c.formui.form.AddForm)
> class TestDisplayForm(z3c.formui.form.DisplayForm)
> class TestEditForm(z3c.formui.form.EditForm)
> 
>  - declare these forms as pagelets (via z3c.pagelet)
> 
> Until now, everything is OK : I've created a set of custom widgets that
> I can display without any problem in the different modes, and these
> forms work perfectly.
> 
> My problem is that I would like to modify the default form template,
> actually provided by z3c.formui template 'div-form.pt' ; so I've created
> a new template, but I can't use it : I've tried to register it via
> several ZCML directives (z3c.template...), but none of them is OK and my
> custom template is never used !

I'm replying to my own message after a short discussion on IRC with
Stephan Richter, for anybody which would be interested in the answer...

The problem is coming from the ITestSkin interface, which was inheriting
from IDivFormLayer : actually, IDivFormLayer benefit is to provide a
ready to use div-based form layout ; so if your goal (like for me in
this example) is just to override this layout template, inheriting from
IDivFormLayer doesn't make any sense.

Problem was finally solved with the following statements :

class ITestSkin(z3c.formui.interfaces.IFormUILayer,ITestLayer):
...




Many thanks,
Thierry



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


[Zope3-Users] Problem with z3c.form / z3c.formui packages

2008-03-14 Thread Thierry Florac
Hi,

I'm trying to use a few z3c.* packages to build a little test
application : z3c.form, z3c.formui, z3c.layout, z3c.pagelet...

What I've done until now is :
 - create a custom layer :
class ITestLayer(z3c.form.interfaces.IFormLayer,
 z3c.layer.pagelet.IPageletBrowserLayer)

 - create a custom skin based on this layer :
class ITestSkin(z3c.formui.interfaces.IDivFormLayer,
ITestLayer)

 - create a pagelet based layout for my skin (via z3c.layout)

 - create an add form, a display form and an edit form for my custom
content :
class TestAddForm(z3c.formui.form.AddForm)
class TestDisplayForm(z3c.formui.form.DisplayForm)
class TestEditForm(z3c.formui.form.EditForm)

 - declare these forms as pagelets (via z3c.pagelet)

Until now, everything is OK : I've created a set of custom widgets that
I can display without any problem in the different modes, and these
forms work perfectly.

My problem is that I would like to modify the default form template,
actually provided by z3c.formui template 'div-form.pt' ; so I've created
a new template, but I can't use it : I've tried to register it via
several ZCML directives (z3c.template...), but none of them is OK and my
custom template is never used !

So I just suppose that it's my ZCML directive which is bad, that I
missed a set of declarations (I didn't declare any macro, for example),
or just that the interface for which the template is registered is not
the good one...

Thanks for any help,
Thierry



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


[Zope3-Users] Dynamic interfaces ?

2008-03-10 Thread Thierry Florac
Hi,

I'm looking for a way to handle what I've called "dynamic interfaces".
My problem is quite simple : I have an application where an
administrator can define "content types" ; for each content type, a set
of common predefined attributes are used, but the administrator can
define for each content type a set of custom attributes, each attribute
being defined by a name, a datatype (text, textline, date, boolean...)
and eventually a list of references values (for choices) ; definition of
these custom attributes is persistent and stored in the ZODB.
When creating data, contributor can select the data type, according to
which the matching set of attributes will be available in forms.

The main point is probably that I'd like to use z3c.form package "as
usual", and so integrate this attributes management into Zope3
interfaces machinery... ; I suppose I should need a king of "interface
factory", but couldn't find any link about that.

Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] UnpickleableError when adding object with reference

2008-01-15 Thread Thierry Florac
Le mardi 15 janvier 2008 à 07:05 -0500, john saponara a écrit :
> I add a Limoservice object, then inside that object add a Car; then I 
> add a Driver (which contains a Car), and the AddForm offers a dropdown 
> with '(no value)' and my Car object.  If I select the car from the 
> dropdown I get an error:
> 
> UnpickleableError: Cannot pickle  
> objects
> 
> Whereas if I leave the dropdown at '(no value)', the error does not 
> occur.  What am I doing wrong?  (See attached error.txt for full error.)

Hi, 
As explained into error message, you can't store security proxied
objects into ZODB : you have to remove proxy before they can be stored.

What I generally do is just something like this :

  ...
  from zope.security.proxy import removeSecurityProxy

  class Driver(Contained):
implements(IDriver,ILimoserviceContained)
_car = None

def _getCar(self):
  return self._car

def _setCar(self, value):
  self._car = removeSecurityProxy(value)

car = property(_getCar,_setCar)
  ...

Like that, any way the car property is modified, it's automatically
unproxied and can be stored safely.


  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Object-deleted-events

2008-01-07 Thread Thierry Florac
Le lundi 07 janvier 2008 à 14:30 +0100, Tobias Rodäbel a écrit :
> Hi,
> 
> I'd like to implement an event to be fired when an InternalPrincipal  
> shall be deleted from a PrincipalFolder.
> 
> class IObjectShallBeDeletedEvent(IObjectEvent):
>   """Event, when an object will be deleted.
>   """
> 
> class ObjectShallBeDeletedEvent(object):
>   """Event, when an object will be deleted.
>   """
>   implements(IObjectDeletedEvent)
> 
>   def __init__(self, obj):
>   self.object = obj
> 
> class MyPrincipal(InternalPrincipal):
>   def __del__(self):
>   notify(ObjectShallBeDeletedEvent(self))
>   super(MyObject, self).__del__()
> 
> Because of some reason my event will not be fired. Did I miss something?
> 
> For now I implemented this by subclassing PrincipalFolder and adding  
> my notify call to the __delitem__ method. That works well. But I would  
> prefer an implementation like drafted above.


  Hi,

Maybe I'm wrong, but I thing that '__del__' destructor is not called
when an object is removed from it's container, but when it's references
count in Python interpretor is decremented to 0.

For your use case, the only thing you should do is just to implement a
subscriber to IObjectRemovedEvent (defined into
zope.app.container.interfaces) which is automatically fired by all
"standard" Zope3 containers.

Hope this helps,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] How to persist an attribute of list type

2007-11-30 Thread Thierry Florac
Le samedi 01 décembre 2007 à 02:34 +0800, Yuan HOng a écrit :
> Hi,
> 
> It seems that I can not get list attribute of an persistent object
> changed. I have the following class, which has a list as one of its
> attributes:
> 
> class Cart(Persistent):
> items = []
> amount = 0
> 
> In the debug console, I find that only with direct attribute
> assignment can I change the persisted attribute value. If I use
> items.append to modify the list, even after I set the _p_changed
> attribute of the cart object to True and commit, the persisted version
> won't change.
> 
> I also tried to use PersistentList as the type of the 'items'
> attribute. It doesn't work either with append.
> 
> What could be missing? I am using Zope 3.4.

You just have to use persistent lists :

  from persistent.list import PersistentList
  
  class Cart(Persistent):
items = PersistentList()
amount = 0

Persistent list are then handled as normal Python lists.

  Thierry


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [Zope3-Users] Zope3, ZEO and RAMCache

2007-11-22 Thread Thierry Florac
Le jeudi 22 novembre 2007 à 14:46 +, Chris Withers a écrit :
> Thierry Florac wrote:
> >   Hi,
> > 
> > I have a simple question : I'm using RAMCache 
> 
> What's RAMCache?

I'm just talking about the RAMCache utility, which is defined into
zope.app.cache package...


> > with ZEO and several Zope
> > frontends ; when calling cache.invalidate(), are the selected entries
> > invalidated only on the Zope frontend which handled the request, or are
> > they invalidated on each frontend ??
> 
> if the invalidation finds its way back to ZEO, all clients will be 
> invalidated...

As it's name implies, RAMCache utility only stores it's data in RAM. So
I guess that ZODB won't be impacted by cache updates, as other Zope
frontends...
So what do you mean by "find it's way back to ZEO" ? And how can you
handle this ??

Thanks for any advise,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Zope3, ZEO and RAMCache

2007-11-22 Thread Thierry Florac

  Hi,

I have a simple question : I'm using RAMCache with ZEO and several Zope
frontends ; when calling cache.invalidate(), are the selected entries
invalidated only on the Zope frontend which handled the request, or are
they invalidated on each frontend ??

Thanks for any information,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Installing Twisted with ZopeProject

2007-11-20 Thread Thierry Florac
Hi,

Until now, I was using Zope (3.3) installed from source (on Linux)
without problem.
Actually, I'm trying to discover ZopeProject and other eggs based
distributed packages, which seems to become the default (only ?)
distribution mode for future releases of Zope3.

My problem is simple : I'm currently using the "scheduler" package,
which is using the Twisted framework to handle tasks scheduling. But the
Twisted package is not provided anymore via ZopeProject as it was with
previous Zope3 "big package". So :
 - I've installed VirtualEnv
 - I've installed ZopeProject into it, created and launched a new
application and everything was OK
 - I've tried to add "twisted" in setup.py file generated by
ZopeProject ; but it seems that the package can't be installed via
SetupTools. Should I install it by hand, use "twisted" package provided
by Zope3 or can I use python-twisted packages provided by Debian ?
 - when Twisted is installed, how can I setup my ZopeProject application
so that Twisted web server is used instead of default ZDaemon ?

For my own information, could anyone also tell me what are the benefits
of the different web servers that can be used with Zope3 (Twisted,
ZDaemon...) ??

Thanks,
Thierry


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [Zope3-Users] Re: lack of security declaration: bug or feature?

2007-11-05 Thread Thierry Florac
Le lundi 05 novembre 2007 à 12:35 +0100, Lorenzo Gil Sanchez a écrit :
> Oh, that's true indeed. It's a shame IOrderedContainer is defined as
> inheriting from IContainer because I can't declare a permission for the
> updateOrder method in an independent way. Something like: I want Public
> permission for reading an ordered folder and I want ManageContent
> permission for writing *and* changing the folder order.

I've done this configuration, which seems OK for me until now :








  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Weird error for a certain named attribute

2007-10-23 Thread Thierry Florac

Le mardi 23 octobre 2007 à 14:11 +0200, Maken Seteva a écrit :
> Btw, is there an already existing way to index a field with a list of  
> strings so you can do a search on a particular element in the list? It's 
>a little cumbrsome writing an adapter for each
> field that has a list of strings to join them as one string (if this  
> is even a good solution at all, I'm not sure).


Just have a look at SetIndex component ; I think it's included into
zc.catalog SVN package.

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] zmi in zope 3.3.1

2007-08-28 Thread Thierry Florac
Le lundi 27 août 2007 à 15:22 -0700, Roman Budzianowski a écrit :
> Hi,
> 
> 
> I am following the book by Philipp von Weitershausen (2005) using an
> installation of zope 3.31 on Linux.
> I cannot locate in the zmi the interface browser shown on page 58.
> There are other tabs shown there like Tasks and Services.
> I don't see them either.
> 
> 
> Is my installation incorrect, or all of this has been removed since
> the book publication? Thanks for help.

Hi,

You probably have the first edition of Philipp's book, which describes
Zope X3, an old release of Zope.
Many changes have occured since this release ; you may get the second
(excellent !) edition of his book, published in 2007, which is based on
Zope-3.3.

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] hurry.workflow - retrieve item's history with timestamps of states transitions

2007-07-31 Thread Thierry Florac
Le mardi 31 juillet 2007 à 11:25 +, Alek Kowalczyk a écrit :
> Hello,
> I would like to have an ability to get 'workflow history' for my object. 
> History
> should contain a list of transitions with "from" and "to" states and with
> timestamps.
> 
> Have anyone tried to implement such a simple functionality in hurry.workflow,
> similar to what ClearQuest does? I would be grateful for suggestions how to 
> deal
> with this. Maybe I've missed something while reading hurry.workflow docs, and 
> it
> is already available?


Hi,

I implemented such a functionality by adding a listener on
IWorkflowTransitionEvent, which with the help of zc.comment package add
comments with source and destination states labels, as well as a few
user comments ; these comments are prefixed by special characters so
that I can (when needed) filter them easilly, but implementing another
cleaner adapter to handle this should be very easy.

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] z3c.zalchemy / z3c.sqlalchemy

2007-07-17 Thread Thierry Florac

  Hi,

I'm looking for packages to ease integration of SQLAlchemy and Zope3.
I found the two references listed into this message's subject and was
wondering if there was any link between then, if both of them are
up-to-date and actively maintained, and what where the benefits of using
any or both of them...

Thanks for any information.

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Zope3 PID file ?

2007-07-17 Thread Thierry Florac
Le mardi 17 juillet 2007 à 12:23 +0200, Martijn Pieters a écrit :
> On 7/17/07, Thierry Florac <[EMAIL PROTECTED]> wrote:
> > > What about "zopectl logreopen"?
> > >
> >
> > "zopectl logreopen" works, but it seems that a SIGUSR2 signal is sent
> > and that the whole Zope process is respawned.
> > So I don't see any difference with "zopectl restart"... :-(
> >
> > Am I wrong ?
> 
> You are. There is a SIGUSR2 handler in Signals.Signals, which calls
> the 'reopen' method on all active loggers..
> 
> Nowhere is there a signal handler that restarts Zope on SIGUSR2.
> SIGHUP will cause a restart, SIGINT a shutdown, and SIGTERM a fast
> shutdown.
> 

My comment was just based on what I can see in "z3.log" after running
"zopectl logreopen" :

--
2007-07-17T14:19:42 INFO ZEO.ClientStorage (14916) ClientStorage
(pid=14916) created RW/normal for storage: 'www'
--
2007-07-17T14:19:42 INFO ZEO.cache reusing persistent cache file
'/var/local/zope/zeo1-www.zec'
--
2007-07-17T14:19:46 INFO ZEO.ClientStorage (14916) Testing connection

--
2007-07-17T14:19:46 INFO ZEO.zrpc.Connection(C) (localhost:8100)
received handshake 'Z303'
--
2007-07-17T14:19:46 INFO ZEO.ClientStorage (14916) Server authentication
protocol None
--
2007-07-17T14:19:46 INFO ZEO.ClientStorage (14916) Connected to storage:
('localhost', 8100)
--
2007-07-17T14:19:46 INFO ZEO.ClientStorage (14916) No verification
necessary (last_inval_tid up-to-date)
--
2007-07-17T14:19:47 INFO ZEO.ClientStorage (14916) ClientStorage
(pid=14916) created RW/normal for storage: 'www'
--
2007-07-17T14:19:47 INFO ZEO.cache created temporary cache file
''
--
2007-07-17T14:19:47 INFO ZEO.ClientStorage (14916) Testing connection

--
2007-07-17T14:19:47 INFO ZEO.zrpc.Connection(C) (localhost:8100)
received handshake 'Z303'
--
2007-07-17T14:19:47 INFO ZEO.ClientStorage (14916) Server authentication
protocol None
--
2007-07-17T14:19:47 INFO ZEO.ClientStorage (14916) Connected to storage:
('localhost', 8100)
--
2007-07-17T14:19:47 INFO ZEO.ClientStorage (14916) Verifying cache
--
2007-07-17T14:19:47 INFO ZEO.ClientStorage (14916) endVerify finishing
--
2007-07-17T14:19:47 INFO ZEO.ClientStorage (14916) endVerify finished
--
2007-07-17T14:19:47 INFO root -- HTTP:localhost:8080 Server started.
Hostname: localhost
Port: 8080
--
2007-07-17T14:19:47 INFO root Startup time: 22.791 sec real, 17.310 sec
CPU


This output is just the same as what I can read when starting Zope.
Also, as you can see, I'm using a ZEO client storage and Twisted web
server ; I only found "logreopen" and "SIGUSR2" references in ZDaemon
source code, and I thought that default server for Zope-3.3.1 was
Twisted...

Thanks (as always) for any complement...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Zope3 PID file ?

2007-07-17 Thread Thierry Florac
Tuesday, July 17, 2007, 11:17:50 AM, you wrote:
> 
> TF>   Hi,
> 
> TF> I need to write scripts to handle Zope3 logfiles rotation.
> TF> But I can't find any PID file for the running instance.
> TF> Do I have to call for Zope restart or is there any other way which
> could
> TF> avoid restarting Zope and flushing all caches ?


Le mardi 17 juillet 2007 à 11:48 +0200, Adam Groszer a écrit :

> What about "zopectl logreopen"?
> 

"zopectl logreopen" works, but it seems that a SIGUSR2 signal is sent
and that the whole Zope process is respawned.
So I don't see any difference with "zopectl restart"... :-(

Am I wrong ?

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Zope3 PID file ?

2007-07-17 Thread Thierry Florac

  Hi,

I need to write scripts to handle Zope3 logfiles rotation.
But I can't find any PID file for the running instance.
Do I have to call for Zope restart or is there any other way which could
avoid restarting Zope and flushing all caches ?

Thanks for any advise,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] View or content provider

2007-07-11 Thread Thierry Florac
Hi,

I need very basic content providers to generate HTML contents from a set
of classes, inside pages templates.
Is there a huge difference between using views (and "context/@@viewname"
syntax) and using content providers (with "provider:providername"
syntax), mainly in terms of performances, CPU usage and/or memory
usage ??

Thanks for any advise for this simple "problem", as both methods work
perfectly...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Using RAMCache

2007-07-03 Thread Thierry Florac
Le mardi 03 juillet 2007 à 13:47 +0200, Dominique Lederer a écrit :
> hi
> 
> i would like to cache the results of method in a view, and thougt, that 
> RAMCache
> could be of use here.
> 
> After spending a lot of time searching for some documentation or examples, i
> came to this:
> 
> from zope.app.cache.ram import RAMCache
> cache = RAMCache()
> query = cache.query('test',key={'x':1})
> if query == None:
>   result = expensive_stuff_method()
>   cache.set(result, 'test', key={'x':1})
>   return result
> else:
>   return query
> 
> but that won´t work, the cache looses it´s entry, if i call the browser-view 
> again.

First of all, I thing that you can implement a RAM cache manager as a
utility into your site, and then just get to it via
zapi.queryUtility('IRAMCache').
But I didn't use RAM cache until now so I'm not sure if everything is OK
with them...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Custom Schemas, form widgets

2007-07-03 Thread Thierry Florac
Le mardi 03 juillet 2007 à 13:32 +0200, Hermann Himmelbauer a écrit :
> There are several missing schemas that derive from a TextLine but have custom 
> validation methods, e.g. for URLs, for an email address etc. Moreover there 
> are several widgets missing, e.g. a select widget for date/datetime fields.

Hi,

I currently use "zc.datetimewidget" package for date/time inputs. It's
available throught SVN, and works very well (currently with formlib for
me).

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Getting view result from Python

2007-06-28 Thread Thierry Florac
Le mercredi 27 juin 2007 à 20:17 +0300, Marius Gedminas a écrit :
> On Wed, Jun 27, 2007 at 04:59:07PM +0200, Thierry Florac wrote:
> > Le mercredi 27 juin 2007 à 14:31 +0200, Christophe Combelles a écrit :
> > > Thierry Florac a écrit :
> > > > I'd like to get a view output from some Python code.
> > > > 
> > > > Actually, I don't have any problem if I use a page template with a
> > > > simple  expression and
> > > > return "self.template()" in Python.
> > > > But it should certainly be "cleaner" and less expensive to get view
> > > > output directly from Python code, which I don't actually manage to do...
> > > 
> > > It depends on what you call a view,
> > > if this is a BrowserPage, you have a __call__ method that returns the 
> > > output.
> > > so just call your view().
> > > If this is a BrowserView, there is no __call__ because a BrowserView is 
> > > not 
> > > intended to be published as is. But you can have any method that returns 
> > > HTML.
> 
> If you use getMultiAdapter to get the view, all these differences are
> hidden and you can call the view to get its output.
> 
> > > If this is a Viewlet or a ContentProvider, there is a render method that 
> > > returns 
> > > the output. (provided you first call the update method)
> 
> Then it's not really a view, is it?  ;-)
> 
> > In fact it's a little bit more complicated...
> > What I have at first is a BrowserPage view, which is generally called
> > from a page template with "context/@@viewname" syntax, without any
> > problem.
> > 
> > But I need also to be able to get the same view output from a JSON call,
> > so that I can update a little bit of HTML code dynamically. I don't have
> > any problem when defining a template with the same syntax. But if I call
> > in python :
> > 
> >   view = zapi.getMultiAdapter((myContext,myRequest), Interface,
> >   name=u'viewname')
> 
> This should work.  You don't have to pass Interface explicitly, by the
> way, view = getMultiAdapter((context, request), name='...') will work as
> well.
> 
> > I receive an error message :
> > 
> >   __init__() takes at least 3 arguments (1 given)
> 
> I don't believe you :-)
> 
> Can you show the full traceback?  getMultiAdapter definitely passes the
> context tuple to the adapter's __init__.  There must be some other piece
> of code that fails for you.
> 
> > So zapi.getMultiAdapter creates the view, but how can I initialize it
> > with it's required parameters (context and request) ?
> 
> getMultiAdapter does that.  I speak from personal experience.

Whoops !
I'm really sorry but I think I made a stupid mistake in my
zapi.getMultiAdapter() call, because I used a "custom" request as
parameter instead of the initial request I received in my JSON
MethodPublisher subclass ; that's probably because of several tests I
made to get things working as I need... :-(

Really sorry again, but now it works perfectly...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Getting view result from Python

2007-06-27 Thread Thierry Florac
Le mercredi 27 juin 2007 à 14:31 +0200, Christophe Combelles a écrit :
> Thierry Florac a écrit :
> >   Hi,
> > 
> > I'd like to get a view output from some Python code.
> > 
> > Actually, I don't have any problem if I use a page template with a
> > simple  expression and
> > return "self.template()" in Python.
> > But it should certainly be "cleaner" and less expensive to get view
> > output directly from Python code, which I don't actually manage to do...
> > 
> > So any advise to this probably simple problem would be welcome.
> 
> It depends on what you call a view,
> if this is a BrowserPage, you have a __call__ method that returns the output.
> so just call your view().
> If this is a BrowserView, there is no __call__ because a BrowserView is not 
> intended to be published as is. But you can have any method that returns HTML.
> If this is a Viewlet or a ContentProvider, there is a render method that 
> returns 
> the output. (provided you first call the update method)

In fact it's a little bit more complicated...
What I have at first is a BrowserPage view, which is generally called
from a page template with "context/@@viewname" syntax, without any
problem.

But I need also to be able to get the same view output from a JSON call,
so that I can update a little bit of HTML code dynamically. I don't have
any problem when defining a template with the same syntax. But if I call
in python :

  view = zapi.getMultiAdapter((myContext,myRequest), Interface,
  name=u'viewname')

I receive an error message :

  __init__() takes at least 3 arguments (1 given)

So zapi.getMultiAdapter creates the view, but how can I initialize it
with it's required parameters (context and request) ?

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Getting view result from Python

2007-06-27 Thread Thierry Florac

  Hi,

I'd like to get a view output from some Python code.

Actually, I don't have any problem if I use a page template with a
simple  expression and
return "self.template()" in Python.
But it should certainly be "cleaner" and less expensive to get view
output directly from Python code, which I don't actually manage to do...

So any advise to this probably simple problem would be welcome.

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Zope3 profiler ?

2007-06-12 Thread Thierry Florac
Hi,

I'm looking for a simple solution to profile a Zope3 application, some
kind of 'ZopeProfiler' product which was available for Zope2.

Any link or advise would be welcome...

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] zope.conf options

2007-05-28 Thread Thierry Florac
Hi,

I'm looking for the set of parameters that can be used in zope.conf
file, including those relatives to ZODB caching options and ZEO
configuration.
Any link would be greatly welcome...

Thanks for any help,
Thierry


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


[Zope3-Users] Small skinning question...

2007-05-10 Thread Thierry Florac

  Hi,

I'm building a new application with Zope3.
In this application, I can use several skins :
 - for all "back-office" and management pages, a single skin is used ;
it's defined via an Apache rewrite rule on a specific virtual host
 - for front-office pages, the applied skin can be chosen by each
"subsite" administrator between a set of skins made available to him.

My idea is to use the "IBeforeTraverseEvent" on the "site" container,
and to apply the selected skin when I'm on a front-office page.
So my question is simple : can I know easilly (without hardcoding
virtual hosts, in fact) if I'm on a back-office page or not and, in
fact, if a specific skin has already been applied ?

Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Getting values of catalog index in a given "context" ?

2007-05-02 Thread Thierry Florac

  Hi,

I'm using Zope3 catalog (with it's "zc.catalog" extensions and indexes).
What I'd like is to get a list of indexed values for a given index but
in a given context ; for that, I have :
 - a SetIndex which indexes content's path elements
 - a ValueIndex which indexes the content property that I'm looking for.

The SetIndex allows me to easilly find contents which are located in a
given subpath ; but is there a way to get distinct values of the
ValueIndex for these contents, without iterating over them explicitly
(because contents count can be quite huge !) ?

Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Single formlib widget for several fields

2007-04-20 Thread Thierry Florac

  Hi,

I'd like to create a custom formlib widget which could handle several
fields at once ; for example, I'd like a set of fields like "month" and
"year" to be handled in a single widget which could display two
combo-boxes.

Do I have to join these fields in a single interface, for which I can
create and declare a custom widget, or can I handle such things without
modifying my current interface (which I'd prefer).

Thanks for any advise,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] ZEO security examples

2007-04-13 Thread Thierry Florac

  Hi,

Maybe I'm wrong, but it seems that ZEO protocol is, by default,
unauthenticated.
I've read here and there a few references to an authentication mechanism
which could be setup in ZOPE/ZEO, but can't find any valuable
implementation example for Zope3.
So, any link to define this for Zope3 would be very nice.

Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

___
Zope3-users mailing list
[EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] "boolean" value of adapted objects

2007-04-03 Thread Thierry Florac

  Hi,

I have a little question about "boolean" values of adapted objects.
For example, I had the following code :

info = ISharedDataInfo(context, None) or \
   IPrivateDataInfo(context, None)
if info is not None:
return context
return None

Even if "context" is correctly adapted to the first interface, the
boolean value matching the adapted object is not always True ; in these
cases, the second test is done, and the global result is set to "None"
instead of "context".

Of course, it's easy to modify this code with two tests instead of one,
but I'm sure there's an easy way to handle such things, so any
information would be really great !!

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Formlib and custom validation constraints

2007-03-19 Thread Thierry Florac

  Hi,

I'm having a few problem(s) with Zope3's formlib package.
Actually, I've defined a 'Bytes' property to store an external file
which is sometimes required, sometimes not, depending on a set of
current context values.
The interface field is actually defined as "required=False", which is
the more current case ; when field is required, setting
"self.widgets['myfield']" is enough in "setUpWidgets" to display the
field as mandatory, but not to let this constraint to be checked.

So my question is simple : how do I have to handle such custom
constraints, which are applied to only one field and which I don't want
to define via invariants (because I'd like the error message to be
displayed correctly next to the required widget) ?
Until now I've tried a few methods (via "widget._error" property for
example) not nothing gave me correct results...

Thanks for any help,

  Thierry Florac

P.S. : I currently use Zope-3.3.1


-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Cancelling AddForm

2007-03-12 Thread Thierry Florac

  Hi,

I have several formlib.form.AddForm subclasses in which I've created a
custom Action via "@action(...)".
My problem is that I'd like to be able to launch some of these actions
(but not all of them, it's "action specific") without executing
automatic formlib controls (actually, for example, even a simple
"Cancel" button which should just redirect the browser actually raises
an exception when required fields are missing).

Any help ?
Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Internationalisation of a viewlet property

2007-03-06 Thread Thierry Florac
Hi,

I've created a custom viewlet to display a menu entries with the
following declaration :



My problem is simple : how can I get the "label" property to be
correctly included by the I18n extraction machinery in my gettext ".pot"
file ?

Thanks,
Thierry



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [Zope3-Users] Question about IOrderedContainer interface

2007-02-27 Thread Thierry Florac
Le lundi 26 février 2007 à 19:39 +0200, Marius Gedminas a écrit :
> On Mon, Feb 26, 2007 at 05:28:12PM +0100, Thierry Florac wrote:
> > I have a little question about the "IOrderedContainer" interface.
> > 
> > Actually, this interface is derived from "IContainer", and only contains
> > a single method, "updateOrder()" which is an updating method.
> > 
> > When I create a subclass of "OrderedContainer" for which I'd like only a
> > limited set of roles to have reordering permission,
> ...
> > So I can see only three ways to make this working :
> ...
> >  - wait for someone else to give me another solution, which wouldn't
> > need to modify Zope source code :-)
> 
>interface="IReadContainer"
>   permission="zope.View" />
>interface="IWriteContainer"
>   permission="zope.ManageContent" />
>attributes="updateOrder"
>   permission="zope.ManageContent" />

I agree with you that I can use this workaround.
But is it really fine to define a "writing" interface as a sub-interface
of IReadContainer which, as said before, just need reading
permissions ??
Using "attributes" here in ZCML is only OK because we have a single
method in IOrderedContainer interface...

Thanks anyway,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Question about IOrderedContainer interface

2007-02-26 Thread Thierry Florac

  Hi,

I have a little question about the "IOrderedContainer" interface.

Actually, this interface is derived from "IContainer", and only contains
a single method, "updateOrder()" which is an updating method.

When I create a subclass of "OrderedContainer" for which I'd like only a
limited set of roles to have reordering permission, I'd like to do
something like :

  
  

But this doesn't work, because of a ConfigurationConflictError.

So I can see only three ways to make this working :
 - make IOrderedContainer derived from IWriteContainer instead of
IContainer (what I've done until now !)
 - make IOrderedContainer a separate interface, so that I could do
something like :

  
  
  

 - wait for someone else to give me another solution, which wouldn't
need to modify Zope source code :-)

Thanks for any help or advise,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Problem with zc.table content internationalization

2007-01-30 Thread Thierry Florac
  Hi,

I currently have a little problem to translate contents displayed in a
zc.table component.
Here is an extract of my Python code :


from onf import _

DRAFT  =  0  # New document
PROPOSED   =  1  # Publication request
CANCELED   =  2  # Publication request canceled
REFUSED=  3  # Publication request refused
PUBLISHED  =  4  # Publication approved

StateLabels = { 
DRAFT : _("status-draft","Draft"),
PROPOSED  : _("status-proposed","Publication request"),
CANCELED  : _("status-canceled","Canceled publication
request"),
REFUSED   : _("status-refused","Refused publication
request"),
PUBLISHED : _("status-published","Published")
}

class EventManagerSearchForm(BaseForm):
...
columns = (...
  SortableColumn(_('status','Status'),
lambda c,f:
StateLabels.get(IWorkflowState(c).getState())),
   ...)

@Lazy
def formatter(self):
return Formatter(self.context, self.request,
 self.values(),columns=self.columns)


ZPT is as simple :


...

...



My problem is that the "StateLabels" are translated correctly in several
templates, but not when used inside this table (I can only see the
"status-..." translation key in generated output).
So any help or advise would be very helpful...

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Security related questions

2007-01-17 Thread Thierry Florac
Le mercredi 17 janvier 2007 à 11:06 +0100, FB a écrit :
> Hi,
> 
> On Tue, Jan 16, 2007 at 01:15:53PM -0500, Stephan Richter wrote:
> > On Tuesday 16 January 2007 12:39, FB wrote:
> > > is there a way to get all the permissions and roles, the current principal
> > > is associated to for a given object?
> > >
> > > Something like:
> > >
> > >  getAllRoles(context)
> > >  getAllPermissions(context)
> > 
> > No. You would have to write your own code doing that. Note that it really 
> > depends on the security policy on what roles and permissions are available.
> 
> My securitypolicy is z.a.securitypolicy :-) .

Hi,

I've written my own adapter to get the list of roles granted or denied
for a given principal, and the list of principals granted or denied for
a given role, always in the context of the adapted object ; you'll find
the source code into joined files, just having to configure it :







I'm far from sure if this is the best approach, but at list it works for
my own needs in the context of zope.app.securitypolicy.
Writing the same adapter to get the list of permissions (by iterating
throught the list of granted or denied roles and using the
IRolePermissionManager interface) shouldn't be too difficult...

Hope this will help you,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85
# Copyright (C) ONF 2006 by Thierry Florac


"""
"""

__version__   = "$Revision: $"
__release__   = "$Id: $"
__docformat__ = 'restructuredtext'


# import Zope3 interfaces
from zope.interface import Interface

# import local interfaces

# import Zope3 packages

# import local packages

from ulthar import _


class ISecurityManager(Interface):
"""This facility class is used to access roles and permissions on a given object for current interaction"""

def getLocalRoles(principal=None):
"""Get principal allowed and denied roles on current object

Result is given as a dictionary :
{ 'allow': ['role1','role2'], 'deny': ['role3',] }
"""

def getLocalAllowedRoles(principal=None):
"""Get list of locally allowed roles"""

def getLocalDeniedRoles(principal=None):
"""Get list of locally denied roles"""

def getRoles(principal=None):
"""Get list of roles, including inherited ones

Result is given as a dictionary :
{ 'allow': ['role1','role2'], 'deny': ['role3',] }
"""

def getAllowedRoles(principal=None):
"""Get list of allowed roles, including inherited ones"""

def getDeniedRoles(principal=None):
"""Get list of denied roles, including inherited ones"""

def getLocalPrincipals(roleId):
"""Get list of principals with locally defined role

Result is given as a dictionary :
{ 'allow': ['principal1','principal2'], 'deny': ['principal3',] }
"""

def getLocalAllowedPrincipals(roleId):
"""Get list of principals with locally granted role"""

def getLocalDeniedPrincipals(roleId):
"""Get list of principals with locally denied role"""

def getPrincipals(roleId):
"""Get list of principals with access defined for allowed role, including inherited ones

Result is given as a dictionary :
{ 'allow': ['principal1','principal2'], 'deny': ['principal3',] }
    """

def getAllowedPrincipals(roleId):
"""Get list of principals with granted access to specified role, including inherited ones"""

def getDeniedPrincipals(roleId):
"""Get list of principals with denied access to specified role, including inherited ones"""

def canUseRole(roleId, principal=None):
"""Return true or false to specify role usage for given principal"""

def canUsePermission(permission, principal=None):
"""Return true or false to specify permission usage for given principal"""

def canView(p

Re: [Zope3-Users] Content cloning ?

2007-01-16 Thread Thierry Florac
Le mardi 16 janvier 2007 à 07:27 -0500, Gary Poster a écrit :
> On Jan 16, 2007, at 6:24 AM, Thierry Florac wrote:
> > The last problem I still have is that some of the informations stored
> > into object's annotations have to be indexed into a set of catalogs.
> > While these informations are indexed correctly when annotations are
> > created "by hand" in the "normal" way, it's not the case when  
> > content is
> > duplicated "in a whole". Any idea ? Should I iterate over object
> > annotations and check for ones that should contain indexable content ?
> 
> This isn't very clear to me, but if you fire the appropriate event  
> and you are using the default IKeyReference implementation then the  
> new copies should be indexed as different objects than the original,  
> as usual.

Absolutely !
My difficulty is due to the fact that this duplication is done in a
workflow context, which isn't aware of the different interfaces
supported by the duplicated objects ; sometimes, it's a whole container
which can be duplicated in a single operation, and so it's whole content
have to be duplicated and indexed correctly...
But workflow classes can't notify events for classes it's not directly
aware of. Right ?

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Content cloning ?

2007-01-16 Thread Thierry Florac
Le lundi 15 janvier 2007 à 16:36 +0100, Christian Theune a écrit :
> Am Montag, den 15.01.2007, 16:06 +0100 schrieb Thierry Florac:
> >   Hi,
> > 
> > In an application I'm currently building with Zope3, I need to be able
> > to "clone" several kinds of content data.
> > While cloning a simple content class is quite simple, I don't know
> > exactly how to clone data provided through adapters, which may store
> > these data throught annotations.
> > 
> > What I was thinking about was something like :
> >  - create a new interface "IClonable", with a single "clone" method
> >  - make my specific content interfaces, eventually provided throught
> > adapters, extend IClonable
> >  - get a list of interfaces provided by my content class, directly or
> > throught adapters, which extend IClonable, and call their "clone" method
> > when cloning is required.
> > 
> > So, actually, my main problem is : 
> >  - how can I get the list of interfaces provided by a given class,
> > directly of throught adapters ?
> >  - is this conception method the best one in Python/Zope3 to clone
> > data ??
> > 
> > Thanks for any help or advise...
> 
> You might want to checkout zc.copy.

Hi,

Thanks for this link ; in fact I already downloaded "zc.copy" but just
forgot to take a look at it...

In fact, after looking at "zc.copy" package, I finally used the
"original" zope.copypastemove package function to duplicate my content
because it better feets my needs, without duplicating a set of
informations as zc.copy does but just keeping a link on them.

The last problem I still have is that some of the informations stored
into object's annotations have to be indexed into a set of catalogs.
While these informations are indexed correctly when annotations are
created "by hand" in the "normal" way, it's not the case when content is
duplicated "in a whole". Any idea ? Should I iterate over object
annotations and check for ones that should contain indexable content ?

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Content cloning ?

2007-01-15 Thread Thierry Florac

  Hi,

In an application I'm currently building with Zope3, I need to be able
to "clone" several kinds of content data.
While cloning a simple content class is quite simple, I don't know
exactly how to clone data provided through adapters, which may store
these data throught annotations.

What I was thinking about was something like :
 - create a new interface "IClonable", with a single "clone" method
 - make my specific content interfaces, eventually provided throught
adapters, extend IClonable
 - get a list of interfaces provided by my content class, directly or
throught adapters, which extend IClonable, and call their "clone" method
when cloning is required.

So, actually, my main problem is : 
 - how can I get the list of interfaces provided by a given class,
directly of throught adapters ?
 - is this conception method the best one in Python/Zope3 to clone
data ??

Thanks for any help or advise...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Required choice without default value in formlib

2007-01-12 Thread Thierry Florac

  Hi,

I use formlib to handle my forms.
In a AddForm, how can I have a required choice property, using a dynamic
vocabulary, without a default selected value ?

Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Periodically refresh RSS feeds

2006-12-19 Thread Thierry Florac
Le mardi 19 décembre 2006 à 08:17 +0100, Christian Theune a écrit :
> Hi,
> 
> Florian Lindner wrote:
> > Hello,
> > I have the following situation:
> > 
> > An object represents an RSS feed. It should be updated like every 20 
> > minutes. 
> > If there is something new a Jabber message should be send out.
> > 
> > Currently I have it implemented with an scheduler loop that emits an 
> > refreshRSSFeed event evey 20 minutes. My problem is that a handler for an 
> > event must be a static function, but I want a handler function to be called 
> > as a member of every instantiated RSS feed object.
> > 
> > Another idea I have:
> > Implement an utility where the RSS feeds could register a function that is 
> > called every 20 minutes.
> > Another way would be that this utility takes an URL and monitors the URL 
> > for 
> > changes and only notifies the RSS Feed object in case of a change.
> >
> > How would you do that?
> 
> So there's two problems here: scheduling and notifying persistent
> objects about an event.
> 
> I don't have a good idea about the scheduling right now, except the hint
> that using a 'zopectl run' script might be worthwhile.  I'm not sure
> what a 'scheduler function is'.
> 
> About notifying persistent objects: There is a method
> 'getAllUtilitiesRegisteredFor(interface)' which might help you. Have a
> look at zope/app/catalog/catalog.py beginning from line 150
> (indexDocSubscriber) how the catalog handles events and dispatches them
> to multiple catalogs. I think this pretty much matches your use case if
> you make each RSS feed a (named) utility.
> 
> Of course you could also have a utility that maintains references to all
> RSS feed objects and simply loops over them and calls a method for
> refreshing.


Hi,

I had a several problem to handle regular "alerts" which I solved in
this way :
 - scheduling in done via the "schedule" package, available from Zope3
SVN ; I created an "AlertManager" utility which is a subclass of
scheduler.CronTask (because my alerts are launched at fixed time, but
you can use other classes)
 - objects which can raise alerts are registered with a specific
interface IAlert
 - when the AlertManager is launched, it opens a new connection (via
ZEO.ClientStorage), search for registered components (via
zapi.getAllUtilitiesRegisteredFor(IAlert)) and call one of the
interface's methods which may raise the alert. In my use case an email
is sent, but it could be any kind of alert that Python can handle.

I'm far to know if this is the best approach, but at least it works
quite efficiently...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Database conflicts errors ?

2006-12-08 Thread Thierry Florac
Le vendredi 08 décembre 2006 à 15:08 +0100, Thierry Florac a écrit :
>   Hi,
> 
> I'm currently writing an image management adapter for Zope3.
> It's goal is just to create and store thumbnails "on the fly" when an
> image is requested with an additional specific traversal name (for
> example, "myimage/thumbnail" will create a thumbnail of a given
> predefined size, while "myimage/200x200" will create a copy of the
> original image reduced to 200 pixels).
> These thumbnails are stored in the original image annotations.
> 
> Everything seems to work fine, except for a little thing : I've created
> a specific widget so that, when an image is uploaded, a thumbnail of the
> new uploaded image is immediately displayed next to the "data" field
> upload button.
> But when the form is displayed, a "DatabaseConflictError" is visible
> into Zope's log, even if everything seems to work correctly from a
> browser's point of view.
> 
> I'm not completely sure to understand what DatabaseConflictErrors are,
> so any explanation about this kind of problem would be greet.
> I'll just add for your information that I'm using ZEO...


Oops !!
Sorry, I found the source of my problem : it was a misconfiguration of
the adapter, who was writing data in it's context each time it was
called, even if the context was already "adapted".

A small missing tab and conflicts are gone...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Database conflicts errors ?

2006-12-08 Thread Thierry Florac

  Hi,

I'm currently writing an image management adapter for Zope3.
It's goal is just to create and store thumbnails "on the fly" when an
image is requested with an additional specific traversal name (for
example, "myimage/thumbnail" will create a thumbnail of a given
predefined size, while "myimage/200x200" will create a copy of the
original image reduced to 200 pixels).
These thumbnails are stored in the original image annotations.

Everything seems to work fine, except for a little thing : I've created
a specific widget so that, when an image is uploaded, a thumbnail of the
new uploaded image is immediately displayed next to the "data" field
upload button.
But when the form is displayed, a "DatabaseConflictError" is visible
into Zope's log, even if everything seems to work correctly from a
browser's point of view.

I'm not completely sure to understand what DatabaseConflictErrors are,
so any explanation about this kind of problem would be greet.
I'll just add for your information that I'm using ZEO...

Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Scheduler package usage

2006-11-22 Thread Thierry Florac
Le mercredi 22 novembre 2006 à 08:12 +1100, Tom Dossis a écrit :
> Thierry Florac wrote:
> >  - as I use virtual hosting, my utilities are located and registered in
> > a "sub-site". How can I get access to these components in my scheduler
> > tasks throught zapi functions, without knowing "a priori" their names or
> > paths ?
> 
> from zope.app.component import hooks
> hooks.setSite(mysite)
> 
> This should make your utility lookups work.  Of course you still need a
> way to get your subsite 'mysite' object, whether you traverse from the
> root object, etc. is up to you.
> 
> Finally, I'm not sure if you need to setup an interaction, which raises
> the question: what/who is the principal in within your scheduler context?

Many thanks : it seems to work perfectly !
The main solution was to know the "hooks.setSite()" method.
For the rest, I'm just using a ZEO ClientStorage connection to avoid
errors relatives to different database connections, and take a look at
the 'Application' values to find objects implementing a given required
interface (my own site manager interface), and everything is really fine
now...

Thanks again,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] how to access the root folder in normal operation

2006-11-17 Thread Thierry Florac
Le vendredi 17 novembre 2006 à 16:59 +0530, Shailesh Kumar a écrit :
> Hi, 
>  
> zope.traversing.api.getRoot  returns the root of a given object. What
> I wanted to do was that when zope starts, I would like to create a few
> content objects inside the root folder. 
>  
> Something like:
> root = getRootFolder() #using some way I don't know. 
> root['etc'] = Folder()
> root['var'] = Folder()
> ... 
>  
> Is it possible to do that? 


I currently use something like this, to handle a site configuration on startup 
(define catalog indexes...) :

from zope.app.appsetup.interfaces import \
IDatabaseOpenedWithRootEvent
from zope.app.publication.zopepublication import ZopePublication
from zope.component import adapter

@adapter(IDatabaseOpenedWithRootEvent)
def handleDatabaseOpenedWithRootEvent(event):
db = event.database
connection = db.open()
root = connection.root()
root_folder = root.get(ZopePublication.root_name, None)
...

And in ZCML :




  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Utilities naming convention

2006-11-17 Thread Thierry Florac
Le vendredi 17 novembre 2006 à 11:48 +0100, FB a écrit :
> PS: I know, zapi is deprecated - but it's so convenient :-) ...

???
What ? Why is zapi going to be deprecated ?? I didn't know that and I
agree with you that it is VERY convenient and usefull, even if it's
"just" a set of shortcuts to get access to functions provided
elsewhere...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Needed help with zc.table selection column

2006-11-15 Thread Thierry Florac

  Hi,

I'm using zc.table to handle simple lists of items to replace the
standard "contents.html" container view.
I use a SelectionColumn and a set of sortable columns, to display a
checkbox in front of every item, and a set of custom actions to handle
my selections.
My question is trivial : as items names are base64 encoded into form
widgets and form data, is there an already defined way to easilly get
the list of selected keys, without decoding base64 input fields ?

Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Handling deletion rights ?

2006-10-31 Thread Thierry Florac
Le lundi 30 octobre 2006 à 11:13 -0400, Stephan Richter a écrit :
> On Friday 06 October 2006 08:40, Thierry Florac wrote:
> > I can easilly give access rights for managers and contributors so that
> > each of them can only create given objects.
> > But what concerning deletion ? How can I prevent a contributor from
> > removing a sub-folder ?
> 
> Good question. I think you have to try a different strategy. You have several 
> choices:
> 
> - Implement two deletion methods, each with the right permission.
> - Implement views that work out the permissions manually.
> - Have separate folders for sub-folders and content.

Separating sub-folders and content is not appropriated in my own case.
At last, I think that I'll finally :
 - listen to ObjectDeletedEvent and raise an exception if the current
user doesn't have required roles, or...
 - replace the standard folders's "contents.html" view to remove the
"Delete" action, and provide this action through entries available in
sub-folders and content management screens

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Granting roles automatically ?

2006-10-27 Thread Thierry Florac

  Hi,

I have two kinds of principals in my current application development :
 - internal ones, which are authenticated via an LDAP directory
 - external ones, which are authenticated via a simple user's folder
stored in Zope database.
Everything is handled by a PluggableAuthentication tool without any
problem.

What I'd like to do is to be able to grant a set of roles automatically
to my internal principals authenticated via LDAP. Is it possible ?

Thanks for any answer,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Zope3 database activity

2006-10-26 Thread Thierry Florac

  Hi,

Zope2 provided a nice tool in his control panel to view database
activity (objects loads and stores, cache usage...).
Two questions :
 - is there any way to get access to such information with Zope3 ?
 - is it possible with Zope3 to setup cache size ??

Thanks for any answer,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Problem with ZODB...

2006-10-25 Thread Thierry Florac

  Hi,

I know this message is not closely related to Zope3, but I hope someone
could help me.
I have an application with :
 - a local ZODB
 - a remote ZODB accessed throught ZEO and a ClientStorage to read or
duplicate a few informations when required.

But if I do, for example :

def copyToRemote(source):
storage = ClientStorage((hostname, port))
db = DB(storage)
tm = transaction.manager
connection = db.open(transaction_manager=tm)
root = connection.root()
app = root['Application']
parent = traversing.api.getParent(source)
name = traversing.api.getName(source)
remoteParent = traversing.api.traverse(app, name)
remoteObject = Folder()
remoteParent[name] = remoteObject

When transaction is committed, I receive an InvalidObjectReference for
'remoteObject' ("Attempt to store an object from a foreign database
connection") which I don't understand, as remoteObject is a new object
which is not loaded from the local ZODB...
I've tried to find a few documentation about multi-databases
applications, but can't find how to manage this problem.

Of course, any help would be really appreciated...
Thanks in advance,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] Synchronizing with a remote host

2006-10-24 Thread Thierry Florac

  Hi,

I need a few advises.
I'm building a new Zope3 site, including :
 - a 'back-office' server, containing all internal data handled by
contributors and administrators, including drafts, versioning,
workflows, publication, archiving...
 - a 'front-office' server, containing a selection of published data
available to the outside.

I need to be able to synchronize data from back-office to front-office,
so that :
 - all the maintenance is made on the back-office server
 - any published data is made available to the front-office
 - any retired data is deleted from the front-office immediately.

To handle such a task, I was thinking about using :
 - a ZEO server instance on the front-office server,
 - and a ZEO ClientStorage on the back-office to handle replication of
data to the front-office.

Of course, I'm far from sure if this is the best way to handle my
problem.
There may be several approachs (using XML-RPC ?) and as I'm not a great
ZODB or ZEO specialist, any advise would be greatly welcome.

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Problem with Python 2.4.4

2006-10-24 Thread Thierry Florac
Le mardi 24 octobre 2006 à 07:51 -0400, Jim Fulton a écrit :
> Torvald Bringsvor wrote:
> > I guess this may be a Python problem rather than a
> > zope problem, but I just thought I'd check here.
> > 
> > I have set up Zope 3.3.0 with Python 2.4.4, and it
> > didn't quite work. Some operations such as adding a
> > content object provoked an error from cgi.py line 716,
> > this line reads:
> >   line = self.fp.readline(1<<16)
> > 
> > and then Python reacts that readline should have max
> > one argument, but it gets two. By correcting it to
> >line = self.fp.readline()
> > 
> > everything works well.
> > 
> > Have anybody else had this problem?
> 
> You should report this in the Zope 3 collector,
> http://www.zope.org/Collectors/Zope3-dev.
> 
> It looks like Zope's file stream object that it passes to
> the CGI module needs to grow a maximum size.

Hi,

I had the same problem on Debian GNU/Linux.
Problem is due to a security patch applied on "cgi.py" in Debian's
unstable release.


  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] ForbiddenAttribute problem with viewlet manager and hurry.workflow

2006-10-18 Thread Thierry Florac
Le mercredi 18 octobre 2006 à 13:31 +0200, Thierry Florac a écrit :
>   Hi,
> 
> I'm trying to use the "hurry.workflow" package (loaded from CVS) to
> handle a simple workflow.
> I've created a ViewletManager to display available transitions, but a
> ForbiddenAttribute exception is raised. I know that this exception is
> due to missing permissions settings, but no configuration is working...
> 
> This is the code of my viewlet manager :
> 
> class WorkflowTransitions(object):
> 
> implements(IContentProvider)
> adapts(Interface, IDefaultBrowserLayer, Interface)
> 
> template = ViewPageTemplateFile('transitions.pt')
> 
> def __init__(self, context, request, view):
> self.context = context
> self.request = request
> self.__parent__ = view
> 
> def update(self):
> wf = zapi.queryUtility(IWorkflow)
> if wf is not None:
> info = IWorkflowInfo(self.context)
> self._transitions = info.getManualTransitionsIds()
> else:
> self._transitions = []
> 
> @property
> def transitions(self):
> return self._transitions
> 
> def render(self, *args, **kw):
> return self.template(self, *args, **kw)
> 
> I've tryed to define several security declarations in ZCML, but none is
> working. The exception is raised while accessing
> "getManualTransitionIds()" method :
> 
>   File ".../onf/publication/browser/viewlets/transition/__init__.py", \
>   line 45, in update
> ids = info.getManualTransitionsIds()
>   ForbiddenAttribute: ('getManualTransitionsIds', \
>   )

Oops, Sorry !!
The error was a simple syntax error : correct method name is
"getManualTransitionIds()", without the "s".
But as said in a previous post, the ForbiddenAttribute exception is
strange in such a case...

Thanks,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


[Zope3-Users] ForbiddenAttribute problem with viewlet manager and hurry.workflow

2006-10-18 Thread Thierry Florac

  Hi,

I'm trying to use the "hurry.workflow" package (loaded from CVS) to
handle a simple workflow.
I've created a ViewletManager to display available transitions, but a
ForbiddenAttribute exception is raised. I know that this exception is
due to missing permissions settings, but no configuration is working...

This is the code of my viewlet manager :

class WorkflowTransitions(object):

implements(IContentProvider)
adapts(Interface, IDefaultBrowserLayer, Interface)

template = ViewPageTemplateFile('transitions.pt')

def __init__(self, context, request, view):
self.context = context
self.request = request
self.__parent__ = view

def update(self):
wf = zapi.queryUtility(IWorkflow)
if wf is not None:
info = IWorkflowInfo(self.context)
self._transitions = info.getManualTransitionsIds()
else:
self._transitions = []

@property
def transitions(self):
return self._transitions

def render(self, *args, **kw):
return self.template(self, *args, **kw)

I've tryed to define several security declarations in ZCML, but none is
working. The exception is raised while accessing
"getManualTransitionIds()" method :

  File ".../onf/publication/browser/viewlets/transition/__init__.py", \
  line 45, in update
ids = info.getManualTransitionsIds()
  ForbiddenAttribute: ('getManualTransitionsIds', \
  )

I've also tried to use a simple content provider with an adapter but got
the same result.

Thanks for any help,

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Custom DateWidget with Month/Day/Year

2006-10-18 Thread Thierry Florac
Le mardi 17 octobre 2006 à 13:46 +0200, FB a écrit :
> Hi,
> 
> On Mon, Oct 16, 2006 at 05:46:29PM +0200, Thierry Florac wrote:
> 
> [snip]
> 
> > Installation is fine, as well as widget, but I can't get dates displayed
> > or entered in a french way (DD/MM/).
> > I've tried to modify browser settings as well as a few parameters, but
> > nothing is doing it correctly (and when date is displayed correctly in a
> > form, Zope 'normally' says that dates are not correctly formatted while
> > submitting !).
> 
> Hmm ... it took me 10 seconds to change the format to DD/MM/Y.
> Have a look at datetimewidget.py, look for '_format' .

What I'd like in fact is to be able to display and enter dates in a
format following user's locale.
That doesn't seem to work or is not supported by current implementation
of zc.datetimewidget...

  Thierry Florac
-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] Custom DateWidget with Month/Day/Year

2006-10-16 Thread Thierry Florac
Le lundi 16 octobre 2006 à 10:51 -0400, Fred Drake a écrit :
> On 10/16/06, Oliver Petznick <[EMAIL PROTECTED]> wrote:
> > i'm trying to overwrite the DateWidget so the user can select day/
> > month/year out of 3 dropdowns. my problem is that zope searches for
> > 'form.field' and not for 'form.field.day' and so on.. so i get the
> > "no input" error..  how i can solve this? is there a method which i
> > can overwrite?
> 
> That's entirely a function of the widget itself.  Instead of hacking
> up the existing widget, you'll need to create an entirely new widget.
> 
> Or, you might be interested in zc.datetimewidget, available in the
> Zope Subversion repository:
> 
> http://svn.zope.org/zc.datetimewidget/trunk/
> 
> This provides a JavaScript-based widget with a little calendar to pick
> dates from.  Both date and date/time variants are provided.

I've just tried to use "zc.datetimewidget" package in my Zope3
development installation.
Installation is fine, as well as widget, but I can't get dates displayed
or entered in a french way (DD/MM/).
I've tried to modify browser settings as well as a few parameters, but
nothing is doing it correctly (and when date is displayed correctly in a
form, Zope 'normally' says that dates are not correctly formatted while
submitting !).

Thanks for any help...

  Thierry Florac

P.S. : I also tried to install and configure "z3c.language" package.
Could there be any "inter-dependance" between these two packages ?

-- 
  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85

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


Re: [Zope3-Users] ForbiddenAttribute on "locate" method

2006-10-11 Thread Thierry Florac




Le mercredi 11 octobre 2006 à 00:52 +0200, Thierry FLORAC a écrit :


  Hi,

I try to setup a little application but have a probably little problem
with a ForbiddenAttribute exception on "location.locate" method.
Here is my setup :

class IPhoto(IContainer,IContained):
"""Photo handling interface"""
...
image = Bytes(...)
...

class Photo(Folder):
"""Photo handling class"""
...
image = None
def __init__(self, image=None):
super(Photo,self).__init__()
self.__parent__ = self.__name__ = None
if image:
self.image = image
...

class IEvent(IContained):
"""Event handling interface"""
...

class Event(Persistent):
"""Event handling class"""
...
def __init__(self):
super(Event,self).__init__()
self.__parent__ = self.__name__ = None

In my event creation form (derived from formlib.AddForm), I put
something like this, without a problem :

def create(self, data):
event = Event()
if data.has_key('image'):
event.image = Photo(image=data['image'])
location.locate(event.image, event, 'image')
form.applyChanges(event, self.form_fields, data)
return event

"event.image" access can then be granted easily in an URL through a
"z3c.traverser" plug-in and everything works fine... until now !
Because when I'm trying to make the same thing in an edit form to update
an existing event, an exception is raised :

def edit(self, action, data):
changed = False
event = self.context
if data.has_key('image'):
event.image = Photo(image=data['image'])
location.locate(event.image, event, 'image')
changed = True
return super(EventEditForm,self).edit(action, data) or
changed

Here is the traceback :

Traceback (most recent call last):
  File "/usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py", line 133, in publish
result = publication.callObject(request, obj)
  File "/usr/local/zope/3.3.0/lib/python/zope/app/publication/zopepublication.py", line 161, in callObject
return mapply(ob, request.getPositionalArguments(), request)
  File "/usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py", line 108, in mapply
return debug_call(obj, args)
   - __traceback_info__: 
  File "/usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py", line 114, in debug_call
return obj(*args)
  File "/usr/local/zope/3.3/lib/python/zope/formlib/form.py", line 751, in __call__
self.update()
  File "/usr/local/zope/3.3/lib/python/zope/formlib/form.py", line 732, in update
result = action.success(data)
  File "/usr/local/zope/3.3/lib/python/zope/formlib/form.py", line 582, in success
return self.success_handler(self.form, self, data)
  File "/var/local/zope/3.3/lib/python/ulthar/forms/forms.py", line 104, in handle_edit_action
self.edit_action(action,data)
  File "/var/local/zope/3.3/lib/python/ulthar/forms/forms.py", line 107, in edit_action
if not self.edit(action, data):
  File "/var/local/zope/3.3/lib/python/usf/news/browser/event.py", line 85, in edit
location.locate(event.image, event, 'image')
  File "/usr/local/zope/3.3.0/lib/python/zope/location/location.py", line 71, in locate
object.__parent__ = parent
ForbiddenAttribute: ('__parent__', )



Hi,

I finally solved this stupid problem by myself...
Switching "location.locate" method call from "EditForm" view to "Event" class was just enough...




  Thierry Florac
-- 



  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85








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


[Zope3-Users] ForbiddenAttribute on "locate" method

2006-10-10 Thread Thierry FLORAC

  Hi,

I try to setup a little application but have a probably little problem
with a ForbiddenAttribute exception on "location.locate" method.
Here is my setup :

class IPhoto(IContainer,IContained):
"""Photo handling interface"""
...
image = Bytes(...)
...

class Photo(Folder):
"""Photo handling class"""
...
image = None
def __init__(self, image=None):
super(Photo,self).__init__()
self.__parent__ = self.__name__ = None
if image:
self.image = image
...

class IEvent(IContained):
"""Event handling interface"""
...

class Event(Persistent):
"""Event handling class"""
...
def __init__(self):
super(Event,self).__init__()
self.__parent__ = self.__name__ = None

In my event creation form (derived from formlib.AddForm), I put
something like this, without a problem :

def create(self, data):
event = Event()
if data.has_key('image'):
event.image = Photo(image=data['image'])
location.locate(event.image, event, 'image')
form.applyChanges(event, self.form_fields, data)
return event

"event.image" access can then be granted easily in an URL through a
"z3c.traverser" plug-in and everything works fine... until now !
Because when I'm trying to make the same thing in an edit form to update
an existing event, an exception is raised :

def edit(self, action, data):
changed = False
event = self.context
if data.has_key('image'):
event.image = Photo(image=data['image'])
location.locate(event.image, event, 'image')
changed = True
return super(EventEditForm,self).edit(action, data) or
changed

Here is the traceback :

Traceback (most recent call last):
  File "/usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py", line 133, 
in publish
result = publication.callObject(request, obj)
  File 
"/usr/local/zope/3.3.0/lib/python/zope/app/publication/zopepublication.py", 
line 161, in callObject
return mapply(ob, request.getPositionalArguments(), request)
  File "/usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py", line 108, 
in mapply
return debug_call(obj, args)
   - __traceback_info__: 
  File "/usr/local/zope/3.3.0/lib/python/zope/publisher/publish.py", line 114, 
in debug_call
return obj(*args)
  File "/usr/local/zope/3.3/lib/python/zope/formlib/form.py", line 751, in 
__call__
self.update()
  File "/usr/local/zope/3.3/lib/python/zope/formlib/form.py", line 732, in 
update
result = action.success(data)
  File "/usr/local/zope/3.3/lib/python/zope/formlib/form.py", line 582, in 
success
return self.success_handler(self.form, self, data)
  File "/var/local/zope/3.3/lib/python/ulthar/forms/forms.py", line 104, in 
handle_edit_action
self.edit_action(action,data)
  File "/var/local/zope/3.3/lib/python/ulthar/forms/forms.py", line 107, in 
edit_action
if not self.edit(action, data):
  File "/var/local/zope/3.3/lib/python/usf/news/browser/event.py", line 85, in 
edit
location.locate(event.image, event, 'image')
  File "/usr/local/zope/3.3.0/lib/python/zope/location/location.py", line 71, 
in locate
object.__parent__ = parent
ForbiddenAttribute: ('__parent__', )


I've tried to setup different permissions and access rights, but without 
success.
So any help would be great !

Thanks,
Thierry



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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


Re: [Zope3-Users] Seeking a ZCML Example for a CSSViewlet

2006-10-09 Thread Thierry Florac




Le samedi 07 octobre 2006 à 17:00 +1300, Darryl Cousins a écrit :


configure zcml::

  
  name="layout.css"
  for="">
  manager="barrysmithgallery.layer.public.ICSS"
  permission="zope.Public"
  class="..BRSPublicLayerLayoutCSSViewlet"
  layer="barrysmithgallery.layer.public.IBRSPublicBrowserLayer"
  weight="2"
  />



Maybe I'm wrong, but it seems that the "weight" parameter is not used by the default implementation of the CSS viewlet manager...
Correct ?




  Thierry Florac
-- 



  Chef de projet intranet/internet
  Office National des Forêts - Département Informatique
  2, Avenue de Saint-Mandé
  75570 PARIS Cedex 12
  Mél : [EMAIL PROTECTED]
  Tél. : +33 01.40.19.59.64
  Fax. : +33 01.40.19.59.85








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


  1   2   >