[Zope-dev] One object where there should be two

Adrian Hungate adrian@haqa.co.uk
Wed, 16 Jan 2002 07:53:11 -0000


I am having a problem with XMLKit. I have the following code in which should
use one disk based DTML Method and produce two slightly different creation
forms, one for XML and one for RSS (a specialization of the XML form):-

manage_addRSSDocumentForm = Globals.DTMLFile('www/addXMLDocument',
globals(), kind='RSS')
manage_addXMLDocumentForm = Globals.DTMLFile('www/addXMLDocument',
globals(), kind='XML')

The problem is that both of my constructors run the RSS form, the XML
version never gets displayed. I have checked the code in __init__ and it
appears fine:-

    context.registerClass(
        XMLDocument.XMLDocument,
        meta_type='XML Document',
        permission='Add XML Documents',
        icon='www/XMLDocument.gif',
        constructors=(
            XMLDocument.manage_addXMLDocumentForm,
            XMLDocument.manage_addXMLDocument,
        ),
    )
    context.registerClass(
        XMLDocument.RSSDocument,
        meta_type='RSS Document',
        permission='Add RSS Documents',
        icon='www/RSSDocument.gif',
        constructors=(
            XMLDocument.manage_addRSSDocumentForm,
            XMLDocument.manage_addRSSDocument,
        ),
    )

I've tried just about everything I can think of, can anyone shed any light?
Is this a special rule I have broken?

Thanks.

Adrian...

--
Adrian Hungate

All views expressed in this email are those of the whole world, however some
people don't realise this yet.