----------------------------------------------------------------------------------------------------------------------------

Retrieve custom metadata

Retrieving custom meta data using the CLI

You can use the CLI to 'peek' into the metadata connected to a data identifier:

H:\Proj\Kadaster\Kadaster\NFileStorages\CBS>FileStorageCmd.exe meta cbs_gemeenten 5f5f5f5f-5f5f-5f5f-5f5f-676d30303035
Creation time UTC 17-3-2009 15:33:59
File size 2.123 bytes
Custom meta data type FileStorage.MetaData.Helper.KeyValueMetaData
Custom meta data [Key GM_NAAM -> Value Bedum]
[Key GM_CODE -> Value GM0005]
[Key AANT_INW -> Value 10550]
[Key AANT_MAN -> Value 5300]
[Key AANT_VROUW -> Value 5250]
[Key P_00_14_JR -> Value 19]
[Key P_15_24_JR -> Value 12]
[Key P_25_44_JR -> Value 24]
[Key P_45_64_JR -> Value 31]
[Key P_65_EO_JR -> Value 14]
[Key P_N_W_AL -> Value 2]
[Key P_TURKIJE -> Value 0]
[Key P_MAROKKO -> Value 0]
[Key P_SURINAM -> Value 0]
[Key P_ANT_ARU -> Value 0]
[Key P_OVER_NW -> Value 1]
[Key P_WEST_AL -> Value 4]
[Key AANTAL_HH -> Value 4200]
[Key P_EENP_HH -> Value 27]
[Key P_HH_Z_K -> Value 34]
[Key P_HH_M_K -> Value 39]
[Key GEM_HH_GR -> Value 2,4]
[Key BEV_DICHTH -> Value 237]
[Key OPP_TOT -> Value 4496]
[Key OPP_LAND -> Value 4458]
[Key OPP_WATER -> Value 38]

This operation took 11145 msecs

H:\Proj\Kadaster\Kadaster\NFileStorages\CBS>

Don't worry too much about the long time it takes to finish this operation; when you perform this activity in your C# code, the Xml deserializer that is compiled runtime will be cached automatically by the .NET runtime, thus only the first metadata request might be a bit slow-ish.

Retrieving custom meta data using C#

The facade has a GetMetaData function that you can use to retrieve a so called MetaDataContainer. The MetaDataContainer is a wrapper that stores the Customer meta data, as well as some generic meta data.

        public static MetaDataContainer GetMetaData(string fileStorageName, Guid dataIdentifier)
        {
            var fileStorageHandler = FileStorageHandler.Open(fileStorageName);
            return fileStorageHandler.GetMetaDataContainer(dataIdentifier, StreamStateBehaviour.OpenNewStreamForReading, StreamStateBehaviour.OpenNewStreamForReading);
        }

----------------------------------------------------------------------------------------------------------------------------

Last edited May 30, 2009 at 10:19 AM by barkgj, version 4

Comments

No comments yet.