Re: [Zope] Cloning a ZClass-Instance

2000-11-13 Thread Sven Hohage

Hallo Chris,
my reply is late but the problem is already not solved.
I've build a simple ZClass 'News' with base-classes 'ZObject,
ZObjectManager'.
I haven't changed the permission-settings in the product.
The script working on the objects is this:

--
dtml-in "objectValues(['news'])"
dtml-let x="_.getitem('sequence-item')"
 dtml- call "manage_clone(x,'test',REQUEST)" 

/dtml-let
/dtml-in
--

The response of Dieter Maurer was, that it is a permission problem
--"Either you are not allowed to call the ZClass constructor
  at the destination,

  or you are not allowed to access the object to be cloned
  at the destination."
I'm trying to execute the operation with the role 'manager'


That's the traceback:
--
The object holle does not support this operation 
  
Traceback (innermost last):
  File C:\Zop\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
  File C:\Zop\lib\python\ZPublisher\Publish.py, line 187, in publish
  File C:\Zop\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: ElementWithAttributes)
  File C:\Zop\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\Zop\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: NewsPruefer)
  File C:\Zop\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: NewsPruefer)
  File C:\Zop\lib\python\OFS\DTMLMethod.py, line 167, in __call__
(Object: NewsPruefer)
  File C:\Zop\lib\python\DocumentTemplate\DT_String.py, line 502, in
__call__
(Object: NewsPruefer)
  File C:\Zop\lib\python\DocumentTemplate\DT_In.py, line 607, in
renderwob
(Object: objectValues(['news']))
  File C:\Zop\lib\python\DocumentTemplate\DT_Let.py, line 147, in render
(Object: x="_.getitem('sequence-item')")
  File C:\Zop\lib\python\DocumentTemplate\DT_Util.py, line 337, in eval
(Object: manage_clone(x,'versuch',REQUEST))
(Info: REQUEST)
  File string, line 0, in ?
  File C:\Zop\lib\python\OFS\CopySupport.py, line 321, in manage_clone
(Object: holle)
  File C:\Zop\lib\python\OFS\CopySupport.py, line 402, in
_verifyObjectPaste
(Object: holle)
Copy Error: (see above)



Thanks and Bye
 Sven

___
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 )




Re: [Zope] Cloning a ZClass-Instance

2000-11-09 Thread Sven Hohage

Once again thanks to you, but I can't figure out why cloning it's not
possible.
The object is a simple zclass with the baseclasses -ZObject,
ZObjectManager-
Nothing special.
I know that cloning a catalogaware zclass it's not working but
object-manager??
That's the complete traceback:


--
Traceback (innermost last):
  File C:\Zop\lib\python\ZPublisher\Publish.py, line 222, in
publish_module
  File C:\Zop\lib\python\ZPublisher\Publish.py, line 187, in publish
  File C:\Zop\lib\python\Zope\__init__.py, line 221, in
zpublisher_exception_hook
(Object: ElementWithAttributes)
  File C:\Zop\lib\python\ZPublisher\Publish.py, line 171, in publish
  File C:\Zop\lib\python\ZPublisher\mapply.py, line 160, in mapply
(Object: NewsPruefer)
  File C:\Zop\lib\python\ZPublisher\Publish.py, line 112, in call_object
(Object: NewsPruefer)
  File C:\Zop\lib\python\OFS\DTMLMethod.py, line 167, in __call__
(Object: NewsPruefer)
  File C:\Zop\lib\python\DocumentTemplate\DT_String.py, line 502, in
__call__
(Object: NewsPruefer)
  File C:\Zop\lib\python\DocumentTemplate\DT_In.py, line 607, in
renderwob
(Object: objectValues(['news']))
  File C:\Zop\lib\python\DocumentTemplate\DT_Let.py, line 147, in render
(Object: x="_.getitem('sequence-item')")
  File C:\Zop\lib\python\DocumentTemplate\DT_Util.py, line 337, in eval
(Object: manage_clone(x,'versuch',REQUEST))
(Info: REQUEST)
  File string, line 0, in ?
  File C:\Zop\lib\python\OFS\CopySupport.py, line 321, in manage_clone
(Object: holle)
  File C:\Zop\lib\python\OFS\CopySupport.py, line 402, in
_verifyObjectPaste
(Object: holle)
Copy Error: (see above)

Thanks again!

___
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 )




Re: [Zope] Cloning a ZClass-Instance

2000-11-09 Thread Chris Withers

Dieter Maurer wrote:
 
 I looked at the code of "OFS.CopySupport.manage_clone"
 and apparently, one of your "news" items (the one with
 id '973677459') lets its "cb_isCopyable" return false.
 Unfortunately, I have no idea why.

What product is being used to create these news items?

cheers,

Chris

___
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 )




Re: [Zope] Cloning a ZClass-Instance

2000-11-09 Thread Dieter Maurer

Sven Hohage writes:
  Once again thanks to you, but I can't figure out why cloning it's not
  possible.
  The object is a simple zclass with the baseclasses -ZObject,
  ZObjectManager-
  Nothing special.
  
  That's the complete traceback:
  
  
  --
  Traceback (innermost last):
  
File C:\Zop\lib\python\OFS\CopySupport.py, line 321, in manage_clone
  (Object: holle)
File C:\Zop\lib\python\OFS\CopySupport.py, line 402, in
  _verifyObjectPaste
  (Object: holle)
  Copy Error: (see above)
Your traceback indicates, that the object itself does not object
to be copied. It's the destination that does not want the
object.

  The problem occurs in "_verifyObjectPaste".
  Its source comment says:

# Verify whether the current user is allowed to paste the
# passed object into self. This is determined by checking
# to see if the user could create a new object of the same
# meta_type of the object passed in and checking that the
# user actually is allowed to access the passed in object
# in its existing context.

Thus, it is probably a security issue:

  Either you are not allowed to call the ZClass constructor
  at the destination,

  or you are not allowed to access the object to be cloned
  at the destination.


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 )




Re: [Zope] Cloning a ZClass-Instance

2000-11-08 Thread brocken22

Thank you Dieter for your reply,
but yout suggestion doesn't solve the problem.
This is the traceback:
"The object 973677459 does not support this operation "
This means to me that x is an instance.
That's my script-
dtml-in "objectValues(['news'])"
dtml-let x="_.getitem('sequence-item')"

dtml-if "Jetzt.isCurrentDay()"
 dtml- call "manage_clone(x,'versuch', [REQUEST])" 
   
Kopiert!!!
dtml-else
  
   dtml- var text
/dtml-if
/dtml-let
/dtml-in

-- 
Sent through GMX FreeMail - http://www.gmx.net


___
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 )




Re: [Zope] Cloning a ZClass-Instance

2000-11-08 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  Thank you Dieter for your reply,
  but yout suggestion doesn't solve the problem.
Sad to hear.

  This is the traceback:
  "The object 973677459 does not support this operation "
  This means to me that x is an instance.
I agree.
Though, your news items have strange id's.

  That's my script-
  dtml-in "objectValues(['news'])"
  dtml-let x="_.getitem('sequence-item')"
  
  dtml-if "Jetzt.isCurrentDay()"
   dtml- call "manage_clone(x,'versuch', [REQUEST])" 
You should not enclose "REQUEST" with "[...]", though this
is *NOT* your current problem.

I looked at the code of "OFS.CopySupport.manage_clone"
and apparently, one of your "news" items (the one with
id '973677459') lets its "cb_isCopyable" return false.
Unfortunately, I have no idea why.



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 )




Re: [Zope] Cloning a ZClass-Instance

2000-11-07 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  Hallo,
  'news'is a zclass and when I'm using a hardcoded value for x it's working.
  
  that's the cloning-method:
  --
  dtml-in "objectValues(['news'])"
  dtml-let x=sequence-item
  
  dtml-if "now.isCurrentDay()"
   dtml- call "manage_clone(_.getitem('x',0),'firstclone', [REQUEST])" 
  
  Copied!
  dtml-else
  Not needed to clone!!
  /dtml-if
  /dtml-let
  /dtml-in
  --
  And the traceback:
  ---
  The object one  does not support this operation 
Whereever you use a name in DTML, the referenced object
is called, if it is callable.

In your case, you use the name "sequence-item" in the "dtml-let".
Apparently, your "news" instances are callable.
If I am right, then "x" is a string (which of cause does not
support cloning).

Try:

  dtml-let x="_.getitem('sequence-item')"

  /dtml-let


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 )