Exemple #1
0
        public static PutPagePropertiesRequest ToPutRequest(this GetPagePropertiesResponse response)
        {
            var model = MapPageModel(response);

            return(new PutPagePropertiesRequest {
                Data = model, Id = response.Data.Id
            });
        }
Exemple #2
0
        public static PostPagePropertiesRequest ToPostRequest(this GetPagePropertiesResponse response)
        {
            var model = MapPageModel(response);

            return(new PostPagePropertiesRequest {
                Data = model
            });
        }
        public static GetPagePropertiesResponse Unmarshall(UnmarshallerContext context)
        {
            GetPagePropertiesResponse getPagePropertiesResponse = new GetPagePropertiesResponse();

            getPagePropertiesResponse.HttpResponse = context.HttpResponse;
            getPagePropertiesResponse.RequestId    = context.StringValue("GetPageProperties.RequestId");
            getPagePropertiesResponse.Success      = context.BooleanValue("GetPageProperties.Success");
            getPagePropertiesResponse.Message      = context.StringValue("GetPageProperties.Message");
            getPagePropertiesResponse.Data         = context.StringValue("GetPageProperties.Data");
            getPagePropertiesResponse.ErrorCode    = context.IntegerValue("GetPageProperties.ErrorCode");
            getPagePropertiesResponse.ErrorMsg     = context.StringValue("GetPageProperties.ErrorMsg");

            return(getPagePropertiesResponse);
        }
Exemple #4
0
        private static SavePagePropertiesModel MapPageModel(GetPagePropertiesResponse response)
        {
            var model = new SavePagePropertiesModel
            {
                Version = response.Data.Version,
                PageUrl = response.Data.PageUrl,
                Title = response.Data.Title,
                Description = response.Data.Description,
                IsPublished = response.Data.IsPublished,
                PublishedOn = response.Data.PublishedOn,
                LayoutId = response.Data.LayoutId,
                MasterPageId = response.Data.MasterPageId,
                Categories = response.Data.Categories,
                IsArchived = response.Data.IsArchived,
                MainImageId = response.Data.MainImageId,
                FeaturedImageId = response.Data.FeaturedImageId,
                SecondaryImageId = response.Data.SecondaryImageId,
                CustomCss = response.Data.CustomCss,
                CustomJavaScript = response.Data.CustomJavaScript,
                UseCanonicalUrl = response.Data.UseCanonicalUrl,
                UseNoFollow = response.Data.UseNoFollow,
                UseNoIndex = response.Data.UseNoIndex,
                IsMasterPage = response.Data.IsMasterPage,
                LanguageId = response.Data.LanguageId,
                LanguageGroupIdentifier = response.Data.LanguageGroupIdentifier,
                ForceAccessProtocol = response.Data.ForceAccessProtocol,
                MetaData = response.MetaData,
                AccessRules = response.AccessRules,
                PageOptions = response.PageOptions,
            };

            if (response.Tags != null)
            {
                model.Tags = response.Tags.Select(t => t.Name).ToList();
            }

            return model;
        }
Exemple #5
0
        private static SavePagePropertiesModel MapPageModel(GetPagePropertiesResponse response)
        {
            var model = new SavePagePropertiesModel
            {
                Version                 = response.Data.Version,
                PageUrl                 = response.Data.PageUrl,
                Title                   = response.Data.Title,
                Description             = response.Data.Description,
                IsPublished             = response.Data.IsPublished,
                PublishedOn             = response.Data.PublishedOn,
                LayoutId                = response.Data.LayoutId,
                MasterPageId            = response.Data.MasterPageId,
                Categories              = response.Data.Categories,
                IsArchived              = response.Data.IsArchived,
                MainImageId             = response.Data.MainImageId,
                FeaturedImageId         = response.Data.FeaturedImageId,
                SecondaryImageId        = response.Data.SecondaryImageId,
                CustomCss               = response.Data.CustomCss,
                CustomJavaScript        = response.Data.CustomJavaScript,
                UseCanonicalUrl         = response.Data.UseCanonicalUrl,
                UseNoFollow             = response.Data.UseNoFollow,
                UseNoIndex              = response.Data.UseNoIndex,
                IsMasterPage            = response.Data.IsMasterPage,
                LanguageId              = response.Data.LanguageId,
                LanguageGroupIdentifier = response.Data.LanguageGroupIdentifier,
                ForceAccessProtocol     = response.Data.ForceAccessProtocol,
                MetaData                = response.MetaData,
                AccessRules             = response.AccessRules,
                PageOptions             = response.PageOptions,
            };

            if (response.Tags != null)
            {
                model.Tags = response.Tags.Select(t => t.Name).ToList();
            }

            return(model);
        }