RE: [Zope] Help wanted on Zope ZClasses/DTML please.
Thanks to everyone who gave me tips in answer to my questions, I have one further question. I have worked out thanks to Seb's comments that the problem I have with the use of manage_delObjects is (I think) that I am passing in the title or id of the object to be deleted rather than the object itself. I want to put the object into the REQUEST so I can still access it from a different namespace - at the point I want to do the deletion, my target object is out of scope. How do you get a reference or pointer to the current object and put it into the REQUEST for later use? Thanks again, Alex ================================== Alex Bowyer IT Contractor, Logica Australasia Tel : +61 2 9202 8130 Fax : +61 2 9922 7466 E-mail : bowyera@logica.com WWW : http://www.logica.com.au/ ==================================
-----Original Message----- From: Seb Bacon [mailto:seb@jamkit.com] Sent: Friday, November 03, 2000 8:08 PM To: Bowyer, Alex; zope@zope.org Subject: RE: [Zope] Help wanted on Zope ZClasses/DTML please.
Hi, just some quick pointers (I'm in a hurry...)
refer to http://zdp.zope.org/projects/zqr/ZopeQR for more details
<!-- do the deletion - this is the bit that doesn't work --> <dtml-call "manage_delObjects('the_id')"> What is the correct way to use manage_delObjects?
<dtml-call "manage_delObjects(the_id)">
should work. What you wrote looks for an object with id "the_id". In fact you want the value of the_id, which is evaluated for you when it's in quotes (think of everything in quotes as python).
Is there a way to get the name of an object's parent (or its own name for that matter) and use it to construct a URL?
<dtml-var "PARENTS[0]"> gives you the parent
3) When redirecting or linking to a page I have already visited, how can I force a refresh? I tried the JavaScript window.location.reload(true) but I think that is only supported by Netscape. It didn't work in IE5 for me anyway.
window.location.reload() works for me...
4) What is the best way to handle security with ZClasses. In my example I want the index_html pages to be public but everything else to require a password. I managed to require a password for a particular instance of the UAPage, but that affects both the index_html and the edit pages.
you can attach permissions to specific methods in a ZClass by mapping them to existing permissions in the 'define permissions' management tab.
cheers,
seb.
I have worked out thanks to Seb's comments that the problem I have with the use of manage_delObjects is (I think) that I am passing in the title or id of the object to be deleted rather than the object itself.
Not quite... manage_delObjects takes a string which is the id of the object to be deleted. Your example <dtml-call "manage_delObjects('the_id')"> was passing a string 'the_id' to the method. I might have interpreted what you were trying to do wrongly, but I believe you actually wanted to pass the _value_ of the_id.
I want to put the object into the REQUEST so I can still access it from a different namespace - at the point I want to do the deletion, my target object is out of scope.
In fact you just have to put the correct string into the REQUEST and then make sure you have the object you're trying to reference in your current namespace, e.g. by using <dtml-with foo_namespace><dtml-var "manage_delObjects(the_id)"></dtml-with>. If you need more help, post the snippet you're working on again. seb.
participants (2)
-
Bowyer, Alex -
Seb Bacon