[Zope] Re: ZClass Product distribution woes

Behrens Matt - Grand Rapids Matt.Behrens@Kohler.Com
Fri, 12 Oct 2001 08:31:35 -0400


Matt Behrens wrote:

> DefconContainer is the name of the ZClass I am trying to instantiate.  I 
> have a slightly modified ..._add method, just to init a property sheet:

I cut-and-pasted the wrong ..._add method... try this one :-)

----

<HTML>
<HEAD><TITLE>Add DefconContainer</TITLE></HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">

<dtml-comment> We add the new object by calling the class in
                 a with tag.  Not only does this get the thing
                 added, it adds the new thing's attributes to
                 the DTML name space, so we can call methods
                 to initialize the object.
</dtml-comment>

<dtml-with "DefconContainer.createInObjectManager(REQUEST['id'], REQUEST)">

        <dtml-call "propertysheets.properties.manage_editProperties(
                   REQUEST)">

</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>

----

-- 
Matt Behrens <matt.behrens@kohler.com>
System Analyst, Baker Furniture