Nico Klasens wrote: > Hello, > > The hasRelationManager method of Cloud is annoying me a bit. It > generates a lot of log.error messages, because a RelationManager does > not exist. This is just the reason why this method is there in the first > place. I like to change this amd a very easy way is to use the > TypeRel.contains method. There is only one small difference in the > current functionality and the contains method. > The current method allows that the source and destination nodemanager > are switched. > > To make it more clear. > I have defined an typerel from site to navchannel with role navrel. > > Cloud.hasRelationManager() > site, navchannel, navrel = true > navchannel, site, navrel = true > Typerel.contains > site, navchannel, navrel = true > navchannel, site, navrel = false > > > MMbase itself does not use this method anywhere in the code (except for > the new 1.8 HasRelationManagerTag). > The hasRelationManager method is avaliable since 1.6 and changing this > behaviour might break some mmbase applications. Should I just change this? > > Another option I have is to provide the same functionality, but then I > need another method to check that the relation is only from site to > navchannel. I could create another method with an extra parameter > searchdir. I can then use it with Searchdir.DESTIONATION. The old method > could then use the new method with Searchdir.BOTH.
> Which one do you prefer? I prefer the first one, so without a searchdir parameter. Because basicly this implicit turning around of source and destination when creating a relation which is not allowed in the requested direction is annonoying me in itself. Perhaps it can remain doing that in the 'createRelation' method, but it should not advertise it.. It raises the question what to do with 'maycreaterelation' though. I see that the maycreaterelation tag is actually calling typerel itself (probably because the bridge methods did not suffice at the time). This is very ugly. While we're at it, perhaps we can fix that too... Michiel -- Michiel Meeuwissen mihxil' Peperbus 111 MediaPark H'sum [] () +31 (0)35 6772979 nl_NL eo_XX en_US _______________________________________________ Developers mailing list [email protected] http://lists.mmbase.org/mailman/listinfo/developers
