[Zope] Icons in a product

Petr Knapek knapek@knapek.pvt.net
08 Sep 2000 17:16:52 +0200


>>>>> On Fri, 8 Sep 2000 23:18:40 +1000, Andrew Kenneth Milton <akm@mail.theinternet.com.au> said:

Hi Andrew,
thank you very much for quick answer but I it doesn't work because
in my __init__.py I register the product with the initialize(context)
function.

def initialize(context):
    try:
        context.registerClass(
            ISNG.ISNGDocument,
            constructors = (
                ISNG.manage_addISNGDocumentForm,
                ISNG.manage_addISNGDocument),
            icon = 'www/Document_icon.gif'
            )
    except:
        import sys, traceback, string
        type, val, tb = sys.exc_info()
        sys.stderr.write(string.join(traceback.format_exception(type, val, tb), ''))
        del type, val, tb

I think (not sure) that misc_={'iconId':
ImageFile('www/icon.gif',globals()).} will work only if product is not
registered by the old way (not my case) because I tried to put it on
different places of my __init__.py and wasn't succesfull.

Please, can anybody help me or give me a URL where the problems noted
below are solved. 

Thanks, Petr

    AKM> +-------[ Petr Knapek ]---------------------- | Hi Zopists, | I
    AKM> would like to know if there is any possibility how to publish
    AKM> an icon | on the web which is in www folder of my own created
    AKM> product. That is I | want to put some icons into the www folder
    AKM> of my product and to have | possibility to show them on the
    AKM> web. The problem with my own stylesheet | of my product is
    AKM> similar. Is there any possibility to put it in the | product
    AKM> (not ZODB) and later use it. In both cases I don't want put |
    AKM> anything into /Control_Panel/Products/myProduct/ over web
    AKM> interface. I | use Zope 2.1.6 | | I need to put any icon into
    AKM> my python product and later have possibility | to call this
    AKM> icon on the web. Where to put it in my folder structure on |
    AKM> the box and what the URL will be?  | | Thanks for help, Petr

    AKM> In your __init__.py;

    AKM> from ImageFile import ImageFile

    AKM> misc_={'iconId': ImageFile('www/icon.gif',globals()).}

    AKM> You then reference it is as:-

    AKM> <img src="/misc_/YourProductName/iconId">



-- 
Petr Knápek
NEXTRA Czech Republic, s.r.o., Veveří 102, 659 10 Brno, Czech Republic
e-mail: mailto:petr.knapek@nextra.cz
tel:+420-5-41 558 394
FAX:+420-5-41 558 390