Re: Query Builder internals
"Jukka Zitting" <[email protected]> Thu, 23 Feb 2006 19:10:53 +0200
| Newsgroups | gmane.comp.web.midgard.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, Thanks, excellent! On 2/23/06, Piotras <[email protected]> wrote: > > 4) Are duplicate (sid, lang) values allowed in MultiLang tables? > No. If exist , it means bug. OK. Perhaps we could add a UNIQUE constraint in the table definitions to enforce this. Otherwise we can easily end up with strange errors. > > 5) Does a MultiLang object always have a lang 0 record? > Always. ( Like Chuck Norris. :) Even if I create an object explicitly in some specific language? Do the multilang properties then get duplicated to lang 0? This kind of makes sense from a technical point of view, but can easily surprise a content editor. > > 6) Do all MultiLang tables use the "sitegroup" column? > Yes. But it's not mandatory IMO. OK. Having the "sitegroup" column in all tables is quite nice for some operations even though it isn't required and can even cause inconsistencies due to the non-normalized table structure it creates. I'd suggest always having the column and mandating that the MultiLang sitegroup always be the same as the main object sitegroup, even at the expense of potential problems. > > 8) Can different language versions of an object have different parameters? > If you think about higher level API then there are parameters. The same like objects. > If you change lang they can be different. Parameters are multilanged so it's hard > to say about different parameters for different versions. OK, so SELECT * FROM record_extension WHERE tablename LIKE '%_i' should always return zero rows. The same would apply to the blobs table. MultiLanged parameter handling raises a few other questions. Consider an object X with MultiLang records L0 and Ln (for lang n), and MultiLanged parameters P0 and Pn (both with the same domain and name): 8a) If mgd_get_lang() is n and Pn does not exist, is P0 accessible? 8b) If Pn exists, is P0 required to exist? 8c) If not, and if mgd_get_lang() is 0 and P0 does not exist, is Pn accessible? 8d) If mgd_get_lang() is n and Ln does not exist, is Pn accessible? 8e) If mgd_get_lang() is n and Ln does not exist, is P0 accessible? The same questions apply also to attachments, but I suppose the answers are the same as the data model is similar. > > 13) Do the MultiLang _i records have their own metadata fields? > No, because this is "part" of an object. Not object itself. OK. So if edit the English title of an article, the Finnish version of the article is also marked as edited? I'd actually be quite happy if the multilang records had their own metadata just like they have their own guids. I'm currently using the repligard.changed timestamp in Exorcist to track the last modification time of the MultiLang records. BR, Jukka Zitting -- Yukatan - http://yukatan.fi/ - [email protected] Software craftsmanship, JCR consulting, and Java development