Пример #1
0
        public static StructureGroupResult From(StructureGroupData item, string currentUserId)
        {
            var result = new StructureGroupResult
            {
                Directory     = TextEntry.From(string.IsNullOrWhiteSpace(item.Directory) ? Resources.EmptyLabel : item.Directory, Resources.LabelDirectory),
                Template      = LinkEntry.From(item.DefaultPageTemplate, Resources.LabelTemplate, currentUserId),
                PathOnWebsite = GetPublishPath(item.LocationInfo as PublishLocationInfo, item.Directory)
            };

            if (item.IsActiveResolvedValue == false)
            {
                string publishable = Resources.CannotBePublished;
                if (item.IsActive == true)
                {
                    publishable = Resources.CannotBePublishedDueToAncestor;
                }
                result.Publishable = TextEntry.From(publishable, Resources.LabelPublishable);
            }

            AddCommonProperties(item, result);
            AddPropertiesForRepositoryLocalObject(item, result, currentUserId);
            return(result);
        }
        public static StructureGroupResult From(StructureGroupData item, string currentUserId)
        {
            var result = new StructureGroupResult
            {
                Directory = TextEntry.From(string.IsNullOrWhiteSpace(item.Directory) ? Resources.EmptyLabel : item.Directory, Resources.LabelDirectory),
                Template = LinkEntry.From(item.DefaultPageTemplate, Resources.LabelTemplate, currentUserId),
                PathOnWebsite = GetPublishPath(item.LocationInfo as PublishLocationInfo, item.Directory)
            };

            if (item.IsActiveResolvedValue == false)
            {
                string publishable = Resources.CannotBePublished;
                if (item.IsActive == true)
                {
                    publishable = Resources.CannotBePublishedDueToAncestor;
                }
                result.Publishable = TextEntry.From(publishable, Resources.LabelPublishable);
            }

            AddCommonProperties(item, result);
            AddPropertiesForRepositoryLocalObject(item, result, currentUserId);
            return result;
        }