Пример #1
0
        public SitecoreContentEntity Map(Item input)
        {
            var output = new SitecoreContentEntity
            {
                Id         = _enterspeedIdentityService.GetId(input),
                Type       = input.TemplateName,
                Properties = _enterspeedPropertyService.GetProperties(input)
            };

            EnterspeedSiteInfo siteInfo = _enterspeedConfigurationService.GetConfiguration().GetSite(input);

            if (siteInfo != null)
            {
                if (input.Paths.FullPath.StartsWith(siteInfo.HomeItemPath, StringComparison.OrdinalIgnoreCase))
                {
                    // Routable content resides on or below the Home item path.
                    output.Url = _urlService.GetItemUrl(input);
                }

                if (!input.Paths.FullPath.Equals(siteInfo.SiteItemPath, StringComparison.OrdinalIgnoreCase))
                {
                    // If the input item is the Site item, we do not set a parent ID.
                    output.ParentId = _enterspeedIdentityService.GetId(input.Parent);
                }
            }

            return(output);
        }
Пример #2
0
        public SitecoreRenderingEntity Map(RenderingItem input)
        {
            var output = new SitecoreRenderingEntity();

            output.Id         = _enterspeedIdentityService.GetId(input);
            output.Type       = "rendering";
            output.Properties = _enterspeedPropertyService.GetProperties(input);

            return(output);
        }
        public SitecoreDictionaryEntity Map(Item input)
        {
            var output = new SitecoreDictionaryEntity
            {
                Id         = _enterspeedIdentityService.GetId(input),
                Type       = "dictionaryEntry",
                Properties = _enterspeedPropertyService.GetProperties(input)
            };

            return(output);
        }
Пример #4
0
 public UmbracoContentEntity(
     IPublishedContent content,
     IEnterspeedPropertyService propertyService,
     IEntityIdentityService entityIdentityService,
     string[] redirects,
     string culture = null)
 {
     _content = content;
     _culture = culture;
     _entityIdentityService = entityIdentityService;
     Redirects  = redirects;
     Properties = propertyService.GetProperties(_content, _culture);
 }