← Back to team overview

dhis2-devs team mailing list archive

Metadata

 

Hi,

I was thinking a lot around metadata implementation and came up with the
following. I have created 3 tables: MetaObject, MetaObjectProperties and
MetaObjectRelations. In DHIS2 schema most of MetaObjects (DE, Indicators,
DS, DECategoryCombo, DECategory, DEOption) have one one to many relations.
So I read each object and placed its property values into MetaObject. After
all goes well I put id of MetaObject back to original object's metaCode
persisted field, added to IdentifiableObject inherited by all metadata
objects. Instead of objects Id I added its metacode as its reference to
other objects.
In listings of each metadata objects' interface I added add to metadata
link, which will add this particular object into MetaObject. After all
metaobjects are added into MetaObject table, we can easily rebuit our other
objects with their links to other objects. This also should be useful for
new installation, once we create XML representation of MetaObject.
Similarly we can use MetaObject for transfering data (import/export) between
nodes of the same metaobjects as all have exactly same metacode.
Implementation is here https://code.launchpad.net/~murodlatifov/+junk/dhis2

regards,
murod

Follow ups