Esempio n. 1
0
        public override void XmlLoad(XmlNode node)
        {
            var relationshipsNode = node.SelectSingleNode("relationships"); //deprecated, use "r"

            if (relationshipsNode == null)
            {
                relationshipsNode = node.SelectSingleNode("r");
            }
            if (relationshipsNode != null)
            {
                this.Relationships.XmlLoad(relationshipsNode);
            }

            var columnsNode = node.SelectSingleNode("columns"); //deprecated, use "c"

            if (columnsNode == null)
            {
                columnsNode = node.SelectSingleNode("c");
            }
            if (columnsNode != null)
            {
                this.Columns.XmlLoad(columnsNode);
            }

            var tableIndexListNode = node.SelectSingleNode("til");

            if (tableIndexListNode != null)
            {
                TableIndexList.XmlLoad(tableIndexListNode, this.Root);
            }

            this.Immutable = XmlHelper.GetAttributeValue(node, "immutable", _def_immutable);
            this.IsTenant  = XmlHelper.GetAttributeValue(node, "isTenant", _def_isTenant);

            this.ResetId(XmlHelper.GetAttributeValue(node, "id", this.Id));

            var staticDataNode = node.SelectSingleNode("staticData");

            if (staticDataNode != null)
            {
                this.StaticData.XmlLoad(staticDataNode);
            }

            this.AssociativeTable = XmlHelper.GetAttributeValue(node, "associativeTable", AssociativeTable);
            this.HasHistory       = XmlHelper.GetAttributeValue(node, "hasHistory", HasHistory);
            this.FullIndexSearch  = XmlHelper.GetAttributeValue(node, "fullIndexSearch", _def_fullIndexSearch);

            this.Key                    = XmlHelper.GetAttributeValue(node, "key", string.Empty);
            this.Name                   = XmlHelper.GetAttributeValue(node, "name", string.Empty);
            this.DBSchema               = XmlHelper.GetAttributeValue(node, "dbschema", _def_dbSchema);
            this.CodeFacade             = XmlHelper.GetAttributeValue(node, "codeFacade", _def_codeFacade);
            this.Description            = XmlHelper.GetAttributeValue(node, "description", _def_description);
            this.AllowModifiedAudit     = XmlHelper.GetAttributeValue(node, "modifiedAudit", AllowModifiedAudit);
            this.AllowCreateAudit       = XmlHelper.GetAttributeValue(node, "createAudit", _def_createAudit);
            this.TypedTable             = (TypedTableConstants)XmlHelper.GetAttributeValue(node, "typedTable", int.Parse(TypedTable.ToString("d")));
            this.AllowTimestamp         = XmlHelper.GetAttributeValue(node, "timestamp", AllowTimestamp);
            this.GeneratesDoubleDerived = XmlHelper.GetAttributeValue(node, "generatesDoubleDerived", _def_generatesDoubleDerived);
        }
Esempio n. 2
0
        public override void XmlAppend(XmlNode node)
        {
            var oDoc = node.OwnerDocument;

            node.AddAttribute("key", this.Key);
            node.AddAttribute("name", this.Name);
            node.AddAttribute("dbschema", this.DBSchema, _def_dbSchema);
            node.AddAttribute("codeFacade", this.CodeFacade, _def_codeFacade);
            node.AddAttribute("description", this.Description, _def_description);

            if (this.Relationships.Count > 0)
            {
                var relationshipsNode = oDoc.CreateElement("r");
                this.Relationships.XmlAppend(relationshipsNode);
                node.AppendChild(relationshipsNode);
            }

            var tableIndexListNode = oDoc.CreateElement("til");

            TableIndexList.XmlAppend(tableIndexListNode);
            node.AppendChild(tableIndexListNode);

            var columnsNode = oDoc.CreateElement("c");

            this.Columns.XmlAppend(columnsNode);
            node.AppendChild(columnsNode);

            node.AddAttribute("isTenant", this.IsTenant, _def_isTenant);
            node.AddAttribute("immutable", this.Immutable, _def_immutable);
            node.AddAttribute("modifiedAudit", this.AllowModifiedAudit, _def_modifiedAudit);
            node.AddAttribute("typedTable", this.TypedTable.ToString("d"), _def_isTypeTable.ToString("d"));
            node.AddAttribute("createAudit", this.AllowCreateAudit, _def_createAudit);
            node.AddAttribute("timestamp", this.AllowTimestamp, _def_timestamp);
            node.AddAttribute("generatesDoubleDerived", this.GeneratesDoubleDerived, _def_generatesDoubleDerived);
            node.AddAttribute("id", this.Id);

            if (this.StaticData.Count > 0)
            {
                var staticDataNode = oDoc.CreateElement("staticData");
                this.StaticData.XmlAppend(staticDataNode);
                node.AppendChild(staticDataNode);
            }

            node.AddAttribute("associativeTable", this.AssociativeTable, _def_associativeTable);
            node.AddAttribute("hasHistory", this.HasHistory, _def_hasHistory);
            node.AddAttribute("fullIndexSearch", this.FullIndexSearch, _def_fullIndexSearch);
        }