Example #1
0
        private SyndicationItem BuildSyndicationRegisterItem(Kartverket.Register.Models.Api.Registeritem u)
        {
            var content = GetContent(u);
            var item    = new SyndicationItem()
            {
                Title           = new TextSyndicationContent(u.label),
                BaseUri         = new Uri(u.id),
                LastUpdatedTime = u.lastUpdated,
                Content         = new TextSyndicationContent(content, TextSyndicationContentKind.Html),
                Id = u.id
            };

            item.Links.Add(new SyndicationLink()
            {
                Title = u.label, Uri = new Uri((u.id))
            });
            item.Authors.Add(new SyndicationPerson()
            {
                Name = u.owner
            });
            item.Categories.Add(new SyndicationCategory()
            {
                Name = u.status
            });
            item.Categories.Add(new SyndicationCategory()
            {
                Name = u.owner
            });
            if (u.itemclass == "Alert" && !string.IsNullOrEmpty(u.ServiceUuid))
            {
                item.ElementExtensions.Add(new XElement("uuid", u.ServiceUuid));
            }
            return(item);
        }
Example #2
0
        //public List<Registeritem> narrower { get; set; }

        public Concept(object models)
        {
            if (models is Register)
            {
                Register register = (Register)models;
                id      = register.id;
                name    = register.label;
                seoname = Helpers.RegisterUrls.MakeSeoFriendlyString(register.label);
                owner   = register.owner;

                if (!string.IsNullOrWhiteSpace(register.contentsummary))
                {
                    description = register.contentsummary;
                }
                else
                {
                    description = "";
                }
                codevalue = "";
                broader   = "";
            }
            else if (models is Registeritem)
            {
                Registeritem item = (Registeritem)models;
                id      = item.id;
                name    = item.label;
                seoname = Helpers.RegisterUrls.MakeSeoFriendlyString(item.label);
                owner   = item.owner;
                if (!string.IsNullOrWhiteSpace(item.description))
                {
                    description = item.description;
                }
                else
                {
                    description = "";
                }

                if (!string.IsNullOrWhiteSpace(item.codevalue))
                {
                    codevalue = item.codevalue;
                }
                else
                {
                    codevalue = "";
                }
                if (item.broader != null)
                {
                    broader = item.broader;
                }
                else
                {
                    broader = "";
                }

                ValidFromDate = item.ValidFrom;
                ValidToDate   = item.ValidTo;
            }
        }
Example #3
0
 public InspireDataset(Registeritem registerItem)
 {
     if (registerItem != null)
     {
         Name               = registerItem.label;
         RespAuthority      = registerItem.owner;
         Uuid               = registerItem.uuid.ToString();
         Theme              = new InspireTheme(registerItem.theme);
         Coverage           = new InspireCoverage();
         MdDataSetExistence = new MdDataSetExistence();
     }
 }
Example #4
0
        public ConceptSheme(object models)
        {
            concepts = new List <Concept>();
            narrower = new List <string>();

            if (models is Registeritem)
            {
                Registeritem item = (Registeritem)models;
                id     = item.id;
                name   = item.label;
                owner  = item.owner;
                status = item.status;
                if (!string.IsNullOrWhiteSpace(item.description))
                {
                    description = item.description;
                }
                else
                {
                    description = "";
                }
                seoname       = Helpers.RegisterUrls.MakeSeoFriendlyString(item.label);
                codelistValue = item.codevalue;
                concepts      = new List <Concept>();
                if (item.broader != null)
                {
                    broader = item.broader;
                }
                else
                {
                    broader = "";
                }

                foreach (var nitem in item.narrower)
                {
                    narrower.Add(nitem);
                }

                ValidFromDate = item.ValidFrom;
                ValidToDate   = item.ValidTo;
            }
            if (models is Register)
            {
                Register register = (Register)models;
                id    = register.id;
                name  = register.label;
                owner = register.owner;
                if (!string.IsNullOrWhiteSpace(register.contentsummary))
                {
                    description = register.contentsummary;
                }
                else
                {
                    description = "";
                }
                codelistValue = "";
                seoname       = Helpers.RegisterUrls.MakeSeoFriendlyString(register.label);
                concepts      = new List <Concept>();
                broader       = "";

                if (register.containedSubRegisters != null)
                {
                    foreach (Register reg in register.containedSubRegisters)
                    {
                        Concept conceptItem = new Concept(reg);
                        concepts.Add(conceptItem);
                    }
                }

                foreach (Registeritem item in register.containeditems)
                {
                    Concept conceptItem = new Concept(item);
                    concepts.Add(conceptItem);
                }
            }
        }