[Helma-user] _extends & _prototype
Jonathan Puckey
me at jonathanpuckey.com
Tue Oct 31 17:24:32 CET 2006
Ack.. This isn't working in the way I wanted it to after all..
When I restart my app and point to /Exhibitions/archive/2005/this-is-
the-title/, it uses the Page prototype and not the ArchivePage
prototype..
And then sometimes it does use the right one.. Flakey at best!
So I need a different approach, I guess..
What would be the best way to have the main.hac that is fired be
dependent on the collection that it resides in?
Thanks,
Jonathan
> Hi listers,
>
> I have a small question about _extends:
>
> I'm using _extends to extend my Page prototype to have a different
> _parent.
> This is because I want to make a different main.hac fire when the
> Page is loaded from:
> /Exhibitions/archive/2005/this-is-the-title/
>
> then when it's loaded from:
> /Exhibitions/this-is-the-title/
>
> But now I'm recieving the following errors in my event.log:
> [2006/10/31 16:32:16] *** Prototype not stored for extended
> relational type ArchivePage
> [2006/10/31 16:32:16] *** objects fetched from db will have base
> prototype!
>
> Should I take any notice of these errors?
> I just don't see the reason for defining a _prototype field for this
> setup..
>
> greetings,
> Jonathan
>
> More information on my setup:
>
> Category type.properties:
> _children = collection(Page)
> _children.local = ID
> _children.foreign = PAGE_CAT
> _children.accessname = URLTITLE
> archive = collection(ArchivePage)
> archive.group = YEAR
> archive.local = ID
> archive.foreign = PAGE_CAT
> archive.accessname = URLTITLE
> archive.group.prototype= Archive
> archive.group.order = YEAR desc
>
> Page type.properties:
> _db = myDataSource
> _table = PAGE
> _id = ID
> _parent = cat
> cat=object(Category)
> cat.local=PAGE_CAT
> cat.foreign=ID
>
> ArchivePage type.properties:
> _extends = Page
> _parent = cat.archive
> cat=object(Category)
> cat.local=PAGE_CAT
> cat.foreign=ID
>
>
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
>
> !DSPAM:45476fa6977985172891808!
>
More information about the Helma-user
mailing list