Re: [Zope] Object adding strangeness

2000-12-14 Thread Dieter Maurer

Geoffrey L. Wright writes:
  So I've created a simple little product to dynamically manage CSS.  It
  consists of three ZClasses and the arrangement looks something like
  this:
   
 STYLEn_containerClass
   \
\-- STYLEn_styleClass
\
 \-- STYLEn_stylePropertyClass
   
   creating "STYLEn_stylePropertyClass" instance overwrite
   "title" property of folder (containing STYLEn_containerClass instance)
  .

  ..
  dtml-with "STYLEn_stylePropertyClass.createInObjectManager('color', REQUEST)"
dtml-call "REQUEST.set('value','#00')"
dtml-call 
 "propertysheets.STYLEn_stylePropertyClassPropertySheet.manage_editProperties(REQUEST)"
dtml-call "manage_editProperties(REQUEST)"
  /dtml-with
  .

I expect the "manage_editProperties" is the culprit.
I further expect that neither of your classes has
a "manage_editProperties". Therefore, the
"manage_editProperties" of the enclosing folder is
acquired. It changes the properties of this folder.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Object adding strangeness

2000-12-13 Thread Geoffrey L. Wright


So I've created a simple little product to dynamically manage CSS.  It
consists of three ZClasses and the arrangement looks something like
this:
 
   STYLEn_containerClass
 \
  \-- STYLEn_styleClass
  \
   \-- STYLEn_stylePropertyClass
 
The STYLEn_containerClass can contain a variable number of styles
which can, in turn, contain a variable number of properties.

I've also hacked the add method for the STYLEn_containerClass so that
it creates a number of default styles.  So far, this has all worked
swimmingly, but I have run into one really strange issue that I can't
figure out for the life of me.  Basicly, the folder that contains the
STYLEn_containerClass somehow(?) manages to aquire the title of the
last instance of STYLEn_styleClass that gets created.  So in the
follow example, the title of the containing folder get renamed to
"Header style" from whatever it happened to be before.

Does anybody have an idea of why this might be happening?   TIA for 
any answers or leads.

My code is below:
 
 ---
 
dtml-commentCreate the "STYLEn" container./dtml-comment
 
dtml-with "STYLEn_containerClass.createInObjectManager('STYLEn',REQUEST)"

  dtml-call 
"propertysheets.STYLEn_containerClassPropertySheet.manage_editProperties(REQUEST)"
  dtml-call "manage_editProperties(REQUEST)"
 
 
  dtml-commentCreate header style/dtml-comment
 
  dtml-call "REQUEST.set('ts', ZopeTime())"
  dtml-call "REQUEST.set('id',_.str(_.int(ts)) + '-1')"
  dtml-call "REQUEST.set('title','Header style')"
  dtml-with "STYLEn_styleClass.createInObjectManager(REQUEST['id'], REQUEST)"
dtml-call "REQUEST.set('element','h1')"
dtml-call "REQUEST.set('style','header')"
dtml-call 
"propertysheets.STYLEn_styleClassPropertySheet.manage_editProperties(REQUEST)"
dtml-call "manage_editProperties(REQUEST)"
dtml-with "STYLEn_stylePropertyClass.createInObjectManager('font-family', 
REQUEST)"
  dtml-call "REQUEST.set('value','arial, sans-serif')"
  dtml-call 
"propertysheets.STYLEn_stylePropertyClassPropertySheet.manage_editProperties(REQUEST)"
  dtml-call "manage_editProperties(REQUEST)"
/dtml-with
dtml-with "STYLEn_stylePropertyClass.createInObjectManager('font-size', REQUEST)"
  dtml-call "REQUEST.set('value','16pt')"
  dtml-call 
"propertysheets.STYLEn_stylePropertyClassPropertySheet.manage_editProperties(REQUEST)"
  dtml-call "manage_editProperties(REQUEST)"
/dtml-with
dtml-with "STYLEn_stylePropertyClass.createInObjectManager('font-style', 
REQUEST)"
  dtml-call "REQUEST.set('value','normal')"
  dtml-call 
"propertysheets.STYLEn_stylePropertyClassPropertySheet.manage_editProperties(REQUEST)"
  dtml-call "manage_editProperties(REQUEST)"
/dtml-with
dtml-with "STYLEn_stylePropertyClass.createInObjectManager('font-weight', 
REQUEST)"
  dtml-call "REQUEST.set('value','bold')"
  dtml-call 
"propertysheets.STYLEn_stylePropertyClassPropertySheet.manage_editProperties(REQUEST)"
  dtml-call "manage_editProperties(REQUEST)"
/dtml-with
dtml-with "STYLEn_stylePropertyClass.createInObjectManager('color', REQUEST)"
  dtml-call "REQUEST.set('value','#00')"
  dtml-call 
"propertysheets.STYLEn_stylePropertyClassPropertySheet.manage_editProperties(REQUEST)"
  dtml-call "manage_editProperties(REQUEST)"
/dtml-with
  /dtml-with

/dtml-with

dtml-comment
  Now we need to return something.  We do this via a redirect so that the URL is 
correct.

  Unfortunately, the way we do this depends on whether we live in a product or in a 
class.  If we live in a 
  product, we need to use DestinationURL to decide where to go. If we live in a class, 
DestinationURL won't 
  be available, so we use URL2.
/dtml-comment

dtml-if DestinationURL

  dtml-call "RESPONSE.redirect(DestinationURL+'/manage_workspace')"

dtml-else

  dtml-call "RESPONSE.redirect(URL2+'/manage_workspace')"

/dtml-if

/body/html

 ---



-- 
Geoffrey L. Wright
Developer / Systems Administrator

(907) 563-2721 ex. 4900
http://www.integritysi.com


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )