[Zope-CMF] Problem with Registering Local Utilities on reinstall of product

2008-06-16 Thread Nathan Van Gheem
Hello,

It seems that there is an issue with registering local utilities on a
Product install.  It seems that on a product reinstall, the local utility is
re-registered.  In doing so, you lose all data that the local utility was
managing.

Martin Aspeli pointed out,

 I think the problem is in Products.GenericSetup.components - in
 _initUtilities it does

 elif factory is not None:
self.context.registerUtility(factory(), provided, name)

 without first checking of a utility with this name for this interface
 already exists.


Although, from what I've found, this is not the problem.  By stepping
through the code, I found in this context, the local utility no longer
exists.  So at some point in the install reinstall process it is
unregistered.

Looking deeper, I found that in the reinstall of a product the method
_cascadeRemove() is called from
Products.CMFQuickInstallerTool.InstalledProduct that unregisters all
utilities.

 if 'utilities' in cascade:
 utilities = getattr(self, 'utilities', [])
 if utilities:
 sm = getSiteManager()
 for registration in utilities:
 provided = _resolveDottedName(registration[0])
 name = registration[1]
 if queryUtility(provided, name=name) is not None:
 sm.unregisterUtility(provided=provided, name=name)


The stack trace is like so,


 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZServer/PubCore/ZServerPublisher.py(25)__init__()
 - response=b)

 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/Publish.py(401)publish_module()
 - environ, debug, request, response)

 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/Publish.py(202)publish_module_standard()
 - response = publish(request, module_name, after_list, debug=debug)

 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/Publish.py(119)publish()
 - request, bind=1)

 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/mapply.py(88)mapply()
 - if debug is not None: return debug(object,args,context)

 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/ZPublisher/Publish.py(42)call_object()
 - result=apply(object,args) # Type scr to step into published object.
   string(6)_facade()

 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/AccessControl/requestmethod.py(64)_curried()
 - return callable(*args, **kw)

 /Applications/Plone-3.1.1/myproject/parts/plone/CMFQuickInstallerTool/QuickInstallerTool.py(639)reinstallProducts()
 - self.uninstallProducts(products, cascade, reinstall=True)
   string(4)_facade()

 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/AccessControl/requestmethod.py(64)_curried()
 - return callable(*args, **kw)

 /Applications/Plone-3.1.1/myproject/parts/plone/CMFQuickInstallerTool/QuickInstallerTool.py(621)uninstallProducts()
 - prod.uninstall(cascade=cascade, reinstall=reinstall)

 /Applications/Plone-3.1.1/myproject/parts/plone/CMFQuickInstallerTool/InstalledProduct.py(297)uninstall()
 - self._cascadeRemove(cascade)

 /Applications/Plone-3.1.1/myproject/parts/plone/CMFQuickInstallerTool/InstalledProduct.py(386)_cascadeRemove()
 - sm.unregisterUtility(provided=provided, name=name)
 
 /Applications/Plone-3.1.1/myproject/parts/zope2/lib/python/zope/component/registry.py(102)unregisterUtility()


I don't know how to go about fixing this problem since the infrastructure is
not set up to handle this.  Realistically, if there is an uninstall of a
component needed, I would think it could be handled in the
Products.GenericSetup.components class.

Any ideas to help me get around this problem would be greatly appreciated.


Thanks,
Nathan Van Gheem
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Problem with STX rendering

2007-05-10 Thread Charlie Clark
Just a quick question - it appears that STX has a problem with non- 
ascii texts so if I have a Document set as structured text some  
formatting operations will fail on non-ascii.


Example:

**some bold text with äüß** will be rendered as **some bold text with  
äüß**and not

strongsome bold text with äüß/strong as expected.

This is Zope 2.9 + CMF 2.0

I notice there is a similar bug:
http://www.zope.org/Collectors/Zope/2285

Although I would expect this to be independent of locale (it's an  
encoding issue) and I've got the problem with Zope 2.9.


Anyway before I submit a follow-up to the bug is there any CMF  
setting I can use to avoid this problem?


Thanks

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Problem with GenericSetup adapter

2006-06-06 Thread Doyon, Jean-Francois
Hi,

Finally started working on migrating to Zope 2.9.3/CMF 2!

Trying to get some GenericSetup functionality around my classes.

I've created my own adapter which is based on PropertiesXMLAdapter (for
now).

For some reason however, queryMultiAdapter seems intent on returning
PropertiesXMLAdapter, and not my own!

I have:



class PortalLocalizerTool(UniqueObject, SimpleItemWithProperties):

implements(IPortalLocalizer)



configure xmlns=http://namespaces.zope.org/zope;

  adapter factory=.portallocalizer.PortalLocalizerXMLAdapter/

/configure



class PortalLocalizerXMLAdapter(XMLAdapterBase, PropertyManagerHelpers):

 XML im- and exporter for properties. 

adapts(IPortalLocalizer, ISetupEnviron)

---

The import step works but using the wrong adapter :(

Did I miss something?

Thanks!

Jean-François Doyon
Internet Service Development and Systems Support / Spécialiste de
dèveloppements internet et soutien technique
Canada Centre for Remote Sensing/Centre Canadien de télédétection
Natural Resources Canada/Ressources Naturelles Canada
http://atlas.gc.ca
Tel./Tél.: (613) 992-4902
Fax: (613) 947-2410
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] problem in setting local roles for newly created object

2006-04-01 Thread Dieter Maurer
Bartek Gorny wrote at 2006-3-29 11:50 +0200:
 ...
I have a script which creates a new instance of a certain portal_type
by a method constructContent, and then calls manage_setLocalRoles.
And I get an exception:

Module AccessControl.Role, line 362, in manage_setLocalRoles
AttributeError: __hash__

and the lines in question are:
361dict=self.__ac_local_roles__ or {}
362dict[userid]=roles

This means, the userid does not have a __hash__ method
and especially is not as string. But, it should be a string!

-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] problem in setting local roles for newly created object

2006-04-01 Thread Bartek Gorny
On 4/1/06, Dieter Maurer [EMAIL PROTECTED] wrote:
 Bartek Gorny wrote at 2006-3-29 11:50 +0200:
  ...
 I have a script which creates a new instance of a certain portal_type
 by a method constructContent, and then calls manage_setLocalRoles.
 And I get an exception:
 
 Module AccessControl.Role, line 362, in manage_setLocalRoles
 AttributeError: __hash__
 
 and the lines in question are:
 361dict=self.__ac_local_roles__ or {}
 362dict[userid]=roles

 This means, the userid does not have a __hash__ method
 and especially is not as string. But, it should be a string!

Of course. I did a stupid thing - got a user by getMemberById
function, and then tried to use the object to set a local role,
instead of the object's id. The misleading thing was that when I tried
to print out the 'userid' to a log, it gave the id, with no
information that it is an object. Your comment help me figure it out -
thanks.

Bartek

 --
 Dieter

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] problem in setting local roles for newly created object

2006-03-29 Thread Bartek Gorny
Hi

I have a script which creates a new instance of a certain portal_type
by a method constructContent, and then calls manage_setLocalRoles.
And I get an exception:

Module AccessControl.Role, line 362, in manage_setLocalRoles
AttributeError: __hash__

and the lines in question are:
361dict=self.__ac_local_roles__ or {}
362dict[userid]=roles

Needless to say, if do the same things (constructContent and
manage_setLocalRoles) one at a time, it works fine. Does this mean
that I should do something in the meantime, after constructContent, to
complete object construction before calling setLocalRoles? Or is there
other way to set local roles on new object?

Bartek
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Problem with Filesystem Directory View's support of .metadata on folders?

2005-07-14 Thread sureshvv

Jens Vagelpohl wrote:


On Apr 13, 2005, at 18:45, sureshvv wrote:


Is there a reason for this? Would you be interested in a patch?



It does. Look at CMF CVS HEAD.


I looked at the code in DirectoryView.py and it appears that the setting of 
properties will work only for sub-directories but not for the top level 
directory that is added.


Also security does not appear to be handled.

Can someone please verify this?

Thanks,

Suresh


___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Problem

2005-06-17 Thread Andreas Jung



--On 17. Juni 2005 10:26:31 +0200 Maya Angelova [EMAIL PROTECTED] 
wrote:



Hi

I have a the following problem by restarting a plone site under zope.
Could anybody give me a hint.
would be very grateful


sh plone2 restart
plone2: line 156: plone2 : command not found
plone2: line 158: plone2 : command not found



This is likely a problem for the Plone-users list.

-aj





pgpFkjc9lV4TW.pgp
Description: PGP signature
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Problem

2005-06-17 Thread Dieter Maurer
Maya Angelova wrote at 2005-6-17 10:26 +0200:
I have a the following problem by restarting a plone site under zope.
Could anybody give me a hint.
would be very grateful


sh plone2 restart
plone2: line 156: plone2 : command not found
plone2: line 158: plone2 : command not found

These are problems reported from the shell script plone2.

  In its line 156 and 158, it references unknown
  commands.

  Check which commands these are and why they are unknown.

In case, you have bash installed, try to use bash in place
of sh.


-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Problem in TypesTool with CMF1.5.1 and Zope2.8

2005-06-13 Thread Stefan H. Holek
I get a whole bunch of Unauthorized errors when running CMF-1_5- 
branch tests with Zope 2.8. Interestingly, CMF HEAD does not appear  
to suffer from the same...


Stefan


==
ERROR: test_CopyPasteSetsOwnership  
(CMFCore.tests.test_PortalContent.TestContentCopyPaste)

--
Traceback (most recent call last):
  File /Users/zope/cmf15/Products/CMFCore/tests/ 
test_PortalContent.py, line 90, in test_CopyPasteSetsOwnership

member_area.invokeFactory('File', id='test_file')
  File /Users/zope/cmf15/Products/CMFCore/PortalFolder.py, line  
418, in invokeFactory
return pt.constructContent(type_name, self, id, RESPONSE, *args,  
**kw)
  File /Users/zope/cmf15/Products/CMFCore/TypesTool.py, line 929,  
in constructContent

ob = info.constructInstance(container, id, *args, **kw)
  File /Users/zope/cmf15/Products/CMFCore/TypesTool.py, line 338,  
in constructInstance

raise AccessControl_Unauthorized('Cannot create %s' % self.getId())
Unauthorized: Cannot create File


On 12. Jun 2005, at 20:05, Jo Meder wrote:



While testing CMF 1.5.1 with the new Zope 2.8 I stumbled upon a
problem with the creation of new objects.



--
Software Engineering is Programming when you can't. --E. W. Dijkstra

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Problem with the portlet calendar

2005-06-12 Thread Mike Jaeger
Hello members of the zope-cmf-list,

I have a question regarding the portlet calendar in Plone.
After entering an event, which takes for example 2 weeks (project), the 
timeframe is marked on blue background. I would like to have that only the 
start and finish date are marked, the dates between start and finish date 
should remain on white background. I have looked in the code of CalendarTool.py 
and calendar_portlet, but it wasn't crowned with success. I have also looked 
for the problem in the internet, but I thing that I am the first person who 
requires this feature. Any idea how to get this feature without big hacking?
Is it possible to modify the queries on the portal_catalog?
Thank you in advance. 

Regards
Mike___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Problem in TypesTool with CMF1.5.1 and Zope2.8

2005-06-12 Thread Jo Meder

Hi there!

While testing CMF 1.5.1 with the new Zope 2.8 I stumbled upon a
problem with the creation of new objects. 

In its _queryFactoryMethod-method the TypesTool calls validate the
following way:

  getSecurityManager().validate(p, p, self.factory, m)

while the signature of validate (taken from
lib/python/AccessControl/ImplPython.py) is

  def validate(self, accessed, container, name, value, ...)

As after installing the new software the usual list of addable content
types turned up empty, I tried patching _queryFactoryMethod to use

  getSecurityManager().validate(p, container, self.factory, m)

instead, after checking that container indeed pointed to the object I
tried adding content to.

Now, this is strictly a works for me-solution, I don't know if it
breaks anything else or if it was only needed, since my CMF-instances
have been constantly upgraded since CMF 1.1.

Can anyone here shed some more light on this issue?

Jo.


-- 
internetmanufaktur jo- Berlin, Germany
  |||meder---fon: ++49-30-417 17 63 33
http://www.meder.de/ --- fax: ++49-30-417 17 63 45
Kollwitzstr. 75  mob: ++49-170- 2 98 89 97
10435 Berlin ---http://www.meder.de/keys/jo-pubkey.txt
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] Problem when setting Portal Image as index_html

2005-05-26 Thread Chris Withers

Dinh Trung Viet wrote:
It seems that Portal Image cannot display the image when it was set as 
default page i.e. id = index_html. Anyone has the same problem before? 
I'm using Plone 2.0.5.


Go ask on the plone list then ;-)

cheers,

Chris

--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests