public static TeamMentor_Article                 update_Cache_GuidanceItems(this TeamMentor_Article guidanceItem, TM_Xml_Database tmDatabase)
        {
            guidanceItem.htmlEncode(); // ensure MetaData is encoded

            var guidanceItemGuid = guidanceItem.Metadata.Id;

            if (TM_Xml_Database.Current.Cached_GuidanceItems.hasKey(guidanceItemGuid))
            {
                TM_Xml_Database.Current.Cached_GuidanceItems[guidanceItemGuid] = guidanceItem;
            }
            else
            {
                TM_Xml_Database.Current.Cached_GuidanceItems.Add(guidanceItem.Metadata.Id, guidanceItem);
            }

            tmDatabase.queue_Save_GuidanceItemsCache();

            return(guidanceItem);
        }
Exemple #2
0
        public TeamMentor_Article transform()
        {
            // fix the issue with older SI Library Articles
            if (phase == null)
            {
                phase     = Rule_Type;
                Rule_Type = Type;
            }
            var teamMentor_Article = new TeamMentor_Article
            {
                Metadata = new TeamMentor_Article_Metadata
                {
                    Id         = id.guid(),
                    Id_History = id_Original,
                    Library_Id = libraryId.guid(),
                    Title      = title,
                    Category   = Category,
                    Phase      = phase,
                    Technology = Technology,
                    Type       = Rule_Type,
                    Author     = Author,
                    Priority   = Priority,
                    Status     = Status,
                    Source     = Source,

                    DirectLink      = "",
                    Tag             = "",
                    Security_Demand = "",
                },
                Content = new TeamMentor_Article_Content
                {
                    Sanitized = true,
                    DataType  = "Html",
                    Data      = { Value = content }
                }
            };

            teamMentor_Article.setHashes();
            teamMentor_Article.htmlEncode();            //encode contents
            return(teamMentor_Article);
        }
Exemple #3
0
        public TeamMentor_Article transform()
        {
            // fix the issue with older SI Library Articles
            if (phase == null)
            {
                phase	    = Rule_Type;
                Rule_Type   = Type;
            }
            var teamMentor_Article = new TeamMentor_Article
                {
                    Metadata = new TeamMentor_Article_Metadata
                        {
                            Id          = id.guid(),
                            Id_History  = id_Original,
                            Library_Id  = libraryId.guid(),
                            Title       = title,
                            Category    = Category,
                            Phase       = phase,
                            Technology  = Technology,
                            Type        = Rule_Type,
                            Author      = Author,
                            Priority    = Priority,
                            Status      = Status,
                            Source      = Source,

                            DirectLink = "",
                            Tag = "",
                            Security_Demand = "",
                        },
                    Content = new TeamMentor_Article_Content
                        {
                            Sanitized = true,
                            DataType = "Html",
                            Data = {Value = content}
                        }
                };

            teamMentor_Article.setHashes();
            teamMentor_Article.htmlEncode();            //encode contents
            return teamMentor_Article;
        }