Beispiel #1
0
    private string BindMSDAttributes_For_MSD_2_1(string DBNId, string MSDId, string lngcodedb)
    {
        string RetVal = string.Empty;
        string ConceptName = string.Empty;
        string ConceptDescription = string.Empty;
        string CategorySchemeName = string.Empty;
        string CategorySchemeDescription = string.Empty;
        string CodelistName = string.Empty;
        string CodelistDescription = string.Empty;
        string ObjectType = string.Empty;
        XmlDocument MSDXml;
        XmlDocument SummaryXml;
        StringBuilder sb;
        StringBuilder sbChild;
        int i, j, k;
        SDMXObjectModel.Structure.MetadataAttributeType MetadataAttribute;
        SDMXObjectModel.Structure.IdentifiableObjectTargetType IdentifiableObjectTarget;
        SDMXObjectModel.Structure.IdentifiableObjectRepresentationType LocalRepresentation;
        SDMXObjectModel.Common.ItemSchemeReferenceType Enumeration;
        SDMXObjectModel.Structure.MetadataTargetType MetadataTarget;
        SDMXObjectModel.Structure.ReportStructureType ReportStructure;
        SDMXObjectModel.Common.ConceptReferenceType ConceptReference;
        SDMXObjectModel.Common.ConceptRefType ConceptRef;

        try
        {
            string MSDPath = "";
            string MSDViewPath = "";
            string MFDPath = "";
            string MFDViewPath = "";
            string ConceptSchemePath = "";
            string ConceptSchemeViewPath = "";
            string MFDId = "";
            string ConceptSchemeId = "";

            MSDPath = Server.MapPath(System.IO.Path.Combine("~", @"stock\\data\\" + DBNId + "\\sdmx\\MSD\\" + MSDId + ".xml"));
            MSDViewPath = "../../stock/data/" + DBNId + "/sdmx/MSD/" + MSDId + ".xml";
            MSDXml = new XmlDocument();
            MSDXml.Load(MSDPath);

            MFDId = MSDId.Replace("MSD", "MFD");
            MFDPath = Server.MapPath(System.IO.Path.Combine("~", @"stock\\data\\" + DBNId + "\\sdmx\\Provisioning Metadata\\" + MFDId + ".xml"));
            MFDViewPath = "../../stock/data/" + DBNId + "/sdmx/Provisioning Metadata/" + MFDId + ".xml";

            ConceptSchemeId = MSDId + "_Concepts";
            ConceptSchemePath = Server.MapPath(System.IO.Path.Combine("~", @"stock\\data\\" + DBNId + "\\sdmx\\Concepts\\" + ConceptSchemeId + ".xml"));
            ConceptSchemeViewPath = "../../stock/data/" + DBNId + "/sdmx/Concepts/" + ConceptSchemeId + ".xml";

            SummaryXml = new XmlDocument();

            SDMXObjectModel.Structure.StructuresType ConceptsObj;

            SDMXObjectModel.Structure.DataStructureComponentsType DSComponents = new DataStructureComponentsType();

            SDMXObjectModel.Message.StructureType SummaryStructure = new SDMXObjectModel.Message.StructureType();
            SummaryXml.Load(Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, Constants.FolderName.Data + DBNId + "\\sdmx\\Summary" + DevInfo.Lib.DI_LibSDMX.Constants.XmlExtension));
            SummaryStructure = (SDMXObjectModel.Message.StructureType)SDMXObjectModel.Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), SummaryXml);

            DSComponents = (SDMXObjectModel.Structure.DataStructureComponentsType)(SummaryStructure.Structures.DataStructures[0].Item);
            ConceptsObj = SummaryStructure.Structures;

            SDMXObjectModel.Message.StructureType MSDStructure = new SDMXObjectModel.Message.StructureType();
            MSDStructure = (SDMXObjectModel.Message.StructureType)Deserializer.LoadFromXmlDocument(typeof(SDMXObjectModel.Message.StructureType), MSDXml);
            MetadataTarget = new MetadataTargetType();
            MetadataTarget = (MetadataTargetType)(((SDMXObjectModel.Structure.MetadataStructureComponentsType)MSDStructure.Structures.MetadataStructures[0].Item).Items[0]);
            ReportStructure = new SDMXObjectModel.Structure.ReportStructureType();
            ReportStructure = (SDMXObjectModel.Structure.ReportStructureType)(((SDMXObjectModel.Structure.MetadataStructureComponentsType)MSDStructure.Structures.MetadataStructures[0].Item).Items[1]);
            IdentifiableObjectTarget = ((SDMXObjectModel.Structure.IdentifiableObjectTargetType)(MetadataTarget.Items[0]));
            LocalRepresentation = ((SDMXObjectModel.Structure.IdentifiableObjectRepresentationType)(IdentifiableObjectTarget.LocalRepresentation));
            Enumeration = ((SDMXObjectModel.Common.ItemSchemeReferenceType)(LocalRepresentation.Items[0]));

            sb = new StringBuilder();
            //sb.Append("<div>");
            //sb.Append("<img id=\"imgdivCS\" src=\"../../stock/themes/default/images/expand.png\" alt=\"Expand and Collapse\" onclick=\"ExpandCollapseList('imgdivCS','divCS')\" style=\"margin-top: 10px;margin-right: 4px\" class=\"flt_lft\"/>");
            //sb.Append("<h3 id=\"lang_Concept_Scheme_MSD\" class=\"flt_lft\"></h3>");
            //sb.Append("&nbsp;<img id=\"imghelpConceptScheme\" src=\"../../stock/themes/default/images/help.gif\" alt=\"Help\"  onclick=\"ToggleCallout('divCallout', event,  'divHelpCS')\" style=\"margin-top:10px;cursor:pointer;\" onmouseout=\"HideCallout('divCallout')\";/>");
            //sb.Append("</div>");
            //sb.Append("<br/>");
            //sb.Append("<div id=\"divCS\" style=\"display:none\">");
            //for (i = 0; i < SummaryStructure.Structures.Concepts.Count; i++)
            //{
            //    if (SummaryStructure.Structures.Concepts[i].id == ConceptSchemeId)
            //    {
            //        sb.Append("<div class=\"reg_li_sub_txt\">");
            //        sb.Append("<b>");
            //        sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Name, lngcodedb));
            //        sb.Append("</b>");
            //        sb.Append("<span class=\"reg_li_brac_txt\">(");
            //        sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Description, lngcodedb));
            //        sb.Append(")</span> ");
            //        sb.Append("</div>");
            //        sb.Append("<div>");
            //        sb.Append("<a href=\" " + ConceptSchemeViewPath + "\"  ");
            //        sb.Append(" target=\"_blank\" class=\"reg_li_link_txt\" name=\"lang_View\"></a> | ");
            //        sb.Append("<a href='Download.aspx?fileId=" + ConceptSchemePath + "' class=\"reg_li_link_txt\" name=\"lang_Download\"></a>");
            //        sb.Append("</div>");
            //        sb.Append("<br/>");
            //        sb.Append("<ul>");
            //        for (j = 0; j < SummaryStructure.Structures.Concepts[i].Items.Count; j++)
            //        {
            //            sb.Append("<li>");

            //            sb.Append("<span>");
            //            sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Items[j].Name, lngcodedb));
            //            sb.Append("</span>");
            //            if (!string.IsNullOrEmpty(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Items[j].Description, lngcodedb)))
            //            {
            //                sb.Append("<span class=\"reg_li_brac_txt\">(");
            //                sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Items[j].Description, lngcodedb));
            //                sb.Append(")</span>");
            //            }
            //            sb.Append("</li>");

            //        }
            //        sb.Append("</ul>");
            //        break;
            //    }
            //}
            //sb.Append("</div>");
            sb.Append("<div>");
            sb.Append("<img id=\"imgdivMSD\" src=\"../../stock/themes/default/images/expand.png\" alt=\"Expand and Collapse\" onclick=\"ExpandCollapseList('imgdivMSD','divMSD')\" style=\"margin-top: 10px;margin-right: 4px\" class=\"flt_lft\"/>");
            sb.Append("<h3 id=\"lang_Metadata_Structure_Definition\" class=\"flt_lft\"></h3>");
            sb.Append("&nbsp;<img id=\"imghelpMSD\" src=\"../../stock/themes/default/images/help.gif\" alt=\"Help\" onclick=\"ToggleCallout('divCallout', event, 'divHelpMSD')\" style=\"margin-top:10px;cursor:pointer;\" onmouseout=\"HideCallout('divCallout')\";/>");
            sb.Append("</div>");
            sb.Append("<br/>");
            sb.Append("<div id=\"divMSD\" style=\"display:none\">");
            sb.Append("<div class=\"reg_li_sub_txt\">");
            sb.Append("<b>");
            sb.Append(GetLangSpecificValue_For_Version_2_1(MSDStructure.Structures.MetadataStructures[0].Name, lngcodedb));
            sb.Append("</b>");
            sb.Append("<span class=\"reg_li_brac_txt\">(");
            sb.Append(GetLangSpecificValue_For_Version_2_1(MSDStructure.Structures.MetadataStructures[0].Description, lngcodedb));
            sb.Append(")</span> ");
            sb.Append("</div>");
            sb.Append("<div>");
            sb.Append("<a href=\" " + MSDViewPath + "\"  ");
            sb.Append(" target=\"_blank\" class=\"reg_li_link_txt\" name=\"lang_View\"></a> | ");
            sb.Append("<a href='Download.aspx?fileId=" + MSDPath + "' class=\"reg_li_link_txt\" name=\"lang_Download\"></a>");
            sb.Append("</div>");
            sb.Append("<br/>");
            sb.Append("<h4 id=\"lang_Target\"></h4>");
            if (((SDMXObjectModel.Common.ItemSchemeRefType)(Enumeration.Items[0])).@class == ObjectTypeCodelistType.Codelist)
            {
                for (i = 0; i < SummaryStructure.Structures.Codelists.Count; i++)
                {
                    if (((SDMXObjectModel.Common.ItemSchemeRefType)(Enumeration.Items[0])).id == SummaryStructure.Structures.Codelists[i].id)
                    {
                        sb.Append("<div id=\"divTarget\" class=\"reg_li_sub_txt\">");
                        sb.Append("<ul class=\"reg_nonlst_txt\"><li>");
                        CodelistName = GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Codelists[i].Name, lngcodedb).ToUpper();
                        CodelistDescription = GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Codelists[i].Description, lngcodedb);
                        if (CodelistName != string.Empty)
                        {
                            sb.Append(CodelistName);
                        }
                        if (CodelistDescription != string.Empty)
                        {
                            sb.Append("<span class=\"reg_li_brac_txt\" >(");
                            sb.Append(CodelistDescription);
                            sb.Append(")</span>");
                        }
                        sb.Append("  -  ");
                        sb.Append("<span id=\"lang_Object_Type" + i + "\" ></span>");
                        sb.Append(IdentifiableObjectTarget.objectType.ToString());
                        sb.Append("</li>");
                        sb.Append("</ul>");
                        sb.Append("</div>");
                        break;
                    }
                }
            }
            else if (((SDMXObjectModel.Common.ItemSchemeRefType)(Enumeration.Items[0])).@class == ObjectTypeCodelistType.CategoryScheme)
            {
                for (i = 0; i < SummaryStructure.Structures.CategorySchemes.Count; i++)
                {
                    if (((SDMXObjectModel.Common.ItemSchemeRefType)(Enumeration.Items[0])).id == SummaryStructure.Structures.CategorySchemes[i].id)
                    {
                        sb.Append("<div id=\"divTarget\">");
                        sb.Append("<ul class=\"reg_nonlst_txt\"><li>");
                        CategorySchemeName = GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.CategorySchemes[i].Name, lngcodedb).ToUpper();
                        CategorySchemeDescription = GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.CategorySchemes[i].Description, lngcodedb);
                        if (CategorySchemeName != string.Empty)
                        {
                            sb.Append(CategorySchemeName);
                        }
                        if (CategorySchemeDescription != string.Empty)
                        {
                            sb.Append("<span class=\"reg_li_brac_txt\">(");
                            sb.Append(CategorySchemeDescription);
                            sb.Append(")</span>");
                        }

                        sb.Append("  -  ");
                        sb.Append("<span id=\"lang_Object_Type" + i + "\" ></span>");
                        sb.Append(IdentifiableObjectTarget.objectType.ToString());
                        sb.Append("</li>");
                        sb.Append("</ul>");
                        sb.Append("</div>");
                        break;
                    }
                }
            }

            sb.Append("<h4 id=\"lang_Report_Structure\"></h4>");
            sb.Append("<ul id=\"ulRS\">");
            for (i = 0; i < ReportStructure.Items.Count; i++)
            {
                sb.Append("<li>");
                MetadataAttribute = ((SDMXObjectModel.Structure.MetadataAttributeType)(ReportStructure.Items[i]));
                ConceptReference = MetadataAttribute.ConceptIdentity;
                ConceptRef = ((ConceptRefType)(ConceptReference.Items[0]));
                for (j = 0; j < ConceptsObj.Concepts.Count; j++)
                {
                    if (ConceptRef.maintainableParentID == ConceptsObj.Concepts[j].id)
                    {
                        ConceptSchemeId = ConceptRef.maintainableParentID;
                        for (k = 0; k < ConceptsObj.Concepts[j].Items.Count; k++)
                        {
                            if (ConceptRef.id.ToString() == ConceptsObj.Concepts[j].Items[k].id.ToString())
                            {
                                ConceptName = GetLangSpecificValue_For_Version_2_1(ConceptsObj.Concepts[j].Items[k].Name, lngcodedb).ToUpper();
                                ConceptDescription = GetLangSpecificValue_For_Version_2_1(ConceptsObj.Concepts[j].Items[k].Description, lngcodedb);
                                if (ConceptName != string.Empty)
                                {
                                    sb.Append(ConceptName);
                                }
                                if (ConceptDescription != string.Empty)
                                {
                                    sb.Append("<span class=\"reg_li_brac_txt\">(");
                                    sb.Append(ConceptDescription);
                                    sb.Append(")</span> ");
                                }
                                break;
                            }
                        }
                    }
                }
                sb.Append("<div class=\"reg_li_sub_txt\">");
                sb.Append("<span id=\"lang_Presentational" + i + "\" ></span>");
                if (MetadataAttribute.isPresentational == true)
                {
                    sb.Append("<span id=\"lang_Yes" + i + "\" ></span>");
                }
                else
                {
                    sb.Append("<span id=\"lang_No" + i + "\" ></span>");
                }
                sb.Append("</div>");
                sbChild = new StringBuilder();
                sb.Append(BindChildMetadatAttributes_For_Version_2_1(sbChild, MetadataAttribute, ConceptsObj, lngcodedb));
                sb.Append("</li>");
            }
            sb.Append("</ul>");
            sb.Append("</div>");
            sb.Append("<div>");
            sb.Append("<img id=\"imgdivMFD\" src=\"../../stock/themes/default/images/expand.png\" alt=\"Expand and Collapse\" onclick=\"ExpandCollapseList('imgdivMFD','divMFD')\" style=\"margin-top: 10px;margin-right: 4px\" class=\"flt_lft\"/>");
            sb.Append("<h3 id=\"lang_Metadata_Flow_Definition\" class=\"flt_lft\"></h3>");
            sb.Append("&nbsp;<img id=\"imghelpMFD\" src=\"../../stock/themes/default/images/help.gif\" alt=\"Help\"  onclick=\"ToggleCallout('divCallout', event,  'divHelpMFD')\" style=\"margin-top:10px;cursor:pointer;\" onmouseout=\"HideCallout('divCallout')\";/>");
            sb.Append("</div>");
            sb.Append("<br/>");
            sb.Append("<div id=\"divMFD\" style=\"display:none\">");
            for (i = 0; i < SummaryStructure.Structures.Metadataflows.Count; i++)
            {
                if (MSDStructure.Structures.MetadataStructures[0].id == ((SDMXObjectModel.Common.MetadataStructureRefType)(SummaryStructure.Structures.Metadataflows[i].Structure.Items[0])).id)
                {
                    sb.Append("<div class=\"reg_li_sub_txt\">");
                    sb.Append("<b>");
                    sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Metadataflows[i].Name, lngcodedb));
                    sb.Append("</b>");
                    sb.Append("<span class=\"reg_li_brac_txt\">(");
                    sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Metadataflows[i].Description, lngcodedb));
                    sb.Append(")</span> ");
                    sb.Append("</div>");
                    sb.Append("<div>");
                    sb.Append("<a href=\" " + MFDViewPath + "\"  ");
                    sb.Append(" target=\"_blank\" class=\"reg_li_link_txt\" name=\"lang_View\"></a> | ");
                    sb.Append("<a href='Download.aspx?fileId=" + MFDPath + "' class=\"reg_li_link_txt\" name=\"lang_Download\"></a>");
                    sb.Append("</div>");

                    break;
                }

            }
            //lang_Concept_Scheme changed to lang_Concept_Scheme_MSD
            sb.Append("</div>");
            sb.Append("<div>");
            sb.Append("<img id=\"imgdivCS\" src=\"../../stock/themes/default/images/expand.png\" alt=\"Expand and Collapse\" onclick=\"ExpandCollapseList('imgdivCS','divCS')\" style=\"margin-top: 10px;margin-right: 4px\" class=\"flt_lft\"/>");
            sb.Append("<h3 id=\"lang_Concept_Scheme_MSD\" class=\"flt_lft\"></h3>");
            sb.Append("&nbsp;<img id=\"imghelpConceptScheme\" src=\"../../stock/themes/default/images/help.gif\" alt=\"Help\"  onclick=\"ToggleCallout('divCallout', event,  'divHelpCS')\" style=\"margin-top:10px;cursor:pointer;\" onmouseout=\"HideCallout('divCallout')\";/>");
            sb.Append("</div>");
            sb.Append("<br/>");
            sb.Append("<div id=\"divCS\" style=\"display:none\">");
            for (i = 0; i < SummaryStructure.Structures.Concepts.Count; i++)
            {
                if (SummaryStructure.Structures.Concepts[i].id == ConceptSchemeId)
                {
                    sb.Append("<div class=\"reg_li_sub_txt\">");
                    sb.Append("<b>");
                    sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Name, lngcodedb));
                    sb.Append("</b>");
                    sb.Append("<span class=\"reg_li_brac_txt\">(");
                    sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Description, lngcodedb));
                    sb.Append(")</span> ");
                    sb.Append("</div>");
                    sb.Append("<div>");
                    sb.Append("<a href=\" " + ConceptSchemeViewPath + "\"  ");
                    sb.Append(" target=\"_blank\" class=\"reg_li_link_txt\" name=\"lang_View\"></a> | ");
                    sb.Append("<a href='Download.aspx?fileId=" + ConceptSchemePath + "' class=\"reg_li_link_txt\" name=\"lang_Download\"></a>");
                    sb.Append("</div>");
                    sb.Append("<br/>");
                    sb.Append("<ul>");
                    for (j = 0; j < SummaryStructure.Structures.Concepts[i].Items.Count; j++)
                    {
                        sb.Append("<li>");

                        sb.Append("<span>");
                        sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Items[j].Name, lngcodedb));
                        sb.Append("</span>");
                        if (!string.IsNullOrEmpty(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Items[j].Description, lngcodedb)))
                        {
                            sb.Append("<span class=\"reg_li_brac_txt\">(");
                            sb.Append(GetLangSpecificValue_For_Version_2_1(SummaryStructure.Structures.Concepts[i].Items[j].Description, lngcodedb));
                            sb.Append(")</span>");
                        }
                        sb.Append("</li>");

                    }
                    sb.Append("</ul>");
                    break;
                }
            }
            sb.Append("<div id=\"divMFD\">");
            RetVal = sb.ToString();

        }
        catch (Exception ex)
        {
            RetVal = string.Empty;
            Global.CreateExceptionString(ex, null);
        }

        return RetVal;
    }
        private Dictionary<string, string> Target_Validation(GenericMetadataType Metadata, SDMXObjectModel.Structure.MetadataStructureType MSD)
        {
            Dictionary<string, string> RetVal;
            SDMXObjectModel.Structure.IdentifiableObjectTargetType IdentifiableObjectTarget;
            SDMXObjectModel.Structure.IdentifiableObjectRepresentationType LocalRepresentation;
            SDMXObjectModel.Common.ItemSchemeReferenceType Enumeration;
            SDMXObjectModel.Structure.MetadataTargetType MetadataTarget;
            SDMXObjectModel.Structure.ReportStructureType ReportStructure;
            SDMXObjectModel.Common.ObjectRefType ObjectRef;

            RetVal = new Dictionary<string, string>();
            try
            {
                MetadataTarget = new MetadataTargetType();
                MetadataTarget = (MetadataTargetType)(((SDMXObjectModel.Structure.MetadataStructureComponentsType)MSD.Item).Items[0]);
                ReportStructure = new SDMXObjectModel.Structure.ReportStructureType();
                ReportStructure = (SDMXObjectModel.Structure.ReportStructureType)(((SDMXObjectModel.Structure.MetadataStructureComponentsType)MSD.Item).Items[1]);
                IdentifiableObjectTarget = ((SDMXObjectModel.Structure.IdentifiableObjectTargetType)(MetadataTarget.Items[0]));
                LocalRepresentation = ((SDMXObjectModel.Structure.IdentifiableObjectRepresentationType)(IdentifiableObjectTarget.LocalRepresentation));
                Enumeration = ((SDMXObjectModel.Common.ItemSchemeReferenceType)(LocalRepresentation.Items[0]));

                if (Metadata.MetadataSet[0].Report[0].id == ReportStructure.id)
                {
                    if (Metadata.MetadataSet[0].Report[0].Target.id == MetadataTarget.id)
                    {
                        ObjectRef = new ObjectRefType();
                        ObjectRef=((SDMXObjectModel.Common.ObjectRefType)((SDMXObjectModel.Common.ObjectReferenceType)(Metadata.MetadataSet[0].Report[0].Target.ReferenceValue[0].Item)).Items[0]);
                        if (((ObjectRef.agencyID == ((SDMXObjectModel.Common.ItemSchemeRefType)Enumeration.Items[0]).agencyID) && (ObjectRef.maintainableParentID == ((SDMXObjectModel.Common.ItemSchemeRefType)Enumeration.Items[0]).id) && (ObjectRef.maintainableParentVersion == ((SDMXObjectModel.Common.ItemSchemeRefType)Enumeration.Items[0]).version))==false)
                        {
                            RetVal.Add(MetadataValidationStatus.Metadata_Target_Object_Reference_Invalid.ToString(), Constants.ValidationMessages.Invalid_Metadata_Target_Object_Reference);
                        }
                    }
                    else
                    {
                        RetVal.Add(MetadataValidationStatus.Metadata_Target_Invalid.ToString(), Constants.ValidationMessages.Invalid_Metadata_Target + Metadata.MetadataSet[0].Report[0].Target.id);
                    }
                }
                else
                {
                    RetVal.Add(MetadataValidationStatus.Metadata_Report_Invalid.ToString(), Constants.ValidationMessages.Invalid_Metadata_Report + Metadata.MetadataSet[0].Report[0].id);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return RetVal;
        }
Beispiel #3
0
        private void Fill_ReportStructure(ReportStructureType ReportStructure, DataTable DtMetadataCategory, MSDTypes msdType)
        {
            MetadataAttributeType MetadataAttribute;
            DataRow[] ParentRows;
            string CategoryNId, CategoryGId;
            bool IsPresentational;

            ReportStructure.Items = new List<ComponentType>();
            ParentRows = DtMetadataCategory.Select("ParentCategoryNId = -1", "CategoryOrder ASC");

            foreach (DataRow ParentRow in ParentRows)
            {
                CategoryNId = ParentRow["CategoryNId"].ToString();
                CategoryGId = ParentRow["CategoryGId"].ToString();
                IsPresentational = Convert.ToBoolean(ParentRow["IsPresentational"].ToString());

                MetadataAttribute = new MetadataAttributeType(CategoryGId, IsPresentational, null);
                this.Add_Children_Attributes(MetadataAttribute, CategoryNId, DtMetadataCategory, msdType);
                this.Fill_MetadataAttribute(MetadataAttribute, CategoryGId, msdType);

                ReportStructure.Items.Add(MetadataAttribute);
            }
        }