/// <summary>
 /// converts the passed umbraco content into a site media image
 /// </summary>
 private static MediaImageModel ConvertImage(IUmbracoWrapper umbracoWrapper, IPublishedContent image)
 {
     return(new MediaImageModel
     {
         Url = image.Url,
         Width = umbracoWrapper.GetPropertyValue <int>(image, "umbracoWidth"),
         Height = umbracoWrapper.GetPropertyValue <int>(image, "umbracoHeight")
     });
 }
Ejemplo n.º 2
0
        public IPublishedContent FindNode(IEnumerable <IPublishedContent> rootNodes)
        {
            var settings = new SettingsNodeType().FindNode(rootNodes);
            var homeId   = _umbracoWrapper.GetPropertyValue <int>(settings, "umbracoInternalRedirectId");

            return(_umbracoWrapper.TypedContent(homeId));
        }
Ejemplo n.º 3
0
        public object Debug()
        {
            Log($"START: Gathering events to cleanup");

            var config = new GetEventsConfiguration
            {
                EarliestDate = DateTime.MinValue,
                LatestDate   = _dateTimeProvider.Now().AddDays(-3)
            };

            Log(
                $"Config: {config.EarliestDate.Value.ToString("yyyy MMMM dd")} -> {config.LatestDate.Value.ToString("yyyy MMMM dd")}");

            var results = _eventSearchService.GetVenueEvents(config);

            if (!results.Any())
            {
                Log($"NO RESULTS FOUND");
            }

            foreach (var publishedContent in results)
            {
                var startDate = _umbracoWrapper.GetPropertyValue <DateTime>(publishedContent, "contentStartDateTime");
                if (startDate > _dateTimeProvider.Now().AddDays(-2))
                {
                    Log(
                        $"Event is NOT in cleanup date range! {publishedContent.Id}|{publishedContent.Name}|STARTS:{startDate.ToString("yyyy MMMM dd")}");
                }
                else
                {
                    Log($"Event is in cleanup date range {publishedContent.Id}|{publishedContent.Name}");
                }
            }

            Log($"COMPLETE: Gathering events to cleanup");

            return("OK");
        }
        /// <summary>
        /// converts the passed umbraco content into a site media file
        /// </summary>
        private static MediaFileModel ConvertFile(IUmbracoWrapper umbracoWrapper, IPublishedContent file)
        {
            var extension    = umbracoWrapper.GetPropertyValue <string>(file, "umbracoExtension");
            var umbracoBytes = umbracoWrapper.GetPropertyValue <double>(file, "umbracoBytes");

            var size = Math.Round(umbracoBytes / 1000, 1);
            var unit = "KB";
            var type = extension.ToUpper();

            if (size > 1000)
            {
                size = Math.Round(size / 1000, 1);

                unit = "MB";
            }

            return(new MediaFileModel
            {
                Url = file.Url,
                Extension = extension,
                Size = $"{size}&nbsp;{unit}"
            });
        }
Ejemplo n.º 5
0
        public IEnumerable <LiveLinkEvent> GetEventsForVenue(IPublishedContent venueContent, int?limit)
        {
            var identifier = _umbracoWrapper
                             .GetPropertyValue <string>(venueContent, "developerFacebookPageIdentifier");

            var eventsConfiguration = new FacebookEventsOptions
            {
                Limit = limit
            };

            var config   = new GetEventsConfiguration(eventsConfiguration, identifier);
            var response = _getEventsCall.Call(config);

            return(AsLiveLinkEvents(response.Events, venueContent.Id));
        }
Ejemplo n.º 6
0
 protected virtual bool ShowInNavigation(IPublishedContent content)
 {
     return(_umbracoWrapper.HasValue(content, "umbracoNaviHide") &&
            !_umbracoWrapper.GetPropertyValue <bool>(content, "umbracoNaviHide"));
 }
Ejemplo n.º 7
0
 private FacebookOAuthData AuthData()
 {
     return(_umbracoWrapper.GetPropertyValue <FacebookOAuthData>(Settings(), "settingsFacebookOAuth"));
 }