Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: danieltellez <danieltellez-Zel9jL5WV+H3RgZPAnJ57g <at> public.gmane.org>
Subject: how to create a directory programatically
Newsgroups: gmane.comp.web.zope.cps.devel
Date: Monday 29th October 2007 10:21:07 UTC (over 9 years ago)
Bonjour!!

I'm trying to create a directory programatically, but i'm getting errors 
when I try to use the _setObject() method.
This is my code:

dtool = context.portal_directories

dir = ZODBDirectory( ... )

# here i assert that ZODBDirectory is created correctly

dtool._setObject(dir.getId(),dir)


When I comment _setObject method, all runs correctly. But when I 
discomment it, I get the next error:

Traceback (innermost last):

  Module ZPublisher.Publish, line 115, in publish

  Module ZPublisher.mapply, line 88, in mapply

  Module ZPublisher.Publish, line 41, in call_object

  Module Products.CMFCore.FSPythonScript, line 108, in __call__

  Module Shared.DC.Scripts.Bindings, line 311, in __call__

  Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec

  Module Products.CMFCore.FSPythonScript, line 142, in _exec

   - 

RuntimeError: PortalASELEX/skins/aselex_default/aselex_creardirectorio.py
has errors.

 /home/conchimartin/instances/development/Products/CMFCore/FSPythonScript.py(142)_exec()

-> raise RuntimeError, '%s has errors.' % self._filepath

When I put this line nor even logger asserts are printed.

I've tried putting the next lines in a AllowModules script:

from AccessControl import ModuleSecurityInfo

ModuleSecurityInfo('Products.CPSDirectory.ZODBDirectory').declarePublic('ZODBDirectory')
ModuleSecurityInfo('Products.CPSDirectory.CPSDirectoryTool').declarePublic('_setObject')


... Nothing.

Of course, I've tried to use manage_addCPSDirectory... but i don't think 
this was a great idea...

Any smart people out there that could help me ?? Many thanks in advance.

-- 
Daniel Téllez Sabán. 
Director Dpto I+D.
Yerbabuena Software. 
[email protected]
http://www.yerbabuena.es
Tlf/Fax: 902 995 246 Móvil: 615 051 283

_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
 
CD: 2ms