Пример #1
1
        public IEnumerable<SelectListItem> GetSelectListItems(System.Web.Routing.RequestContext requestContext, string filter = null)
        {
            var siteName = requestContext.GetRequestValue("siteName");

            var site = new Site(siteName).AsActual();

            IEnumerable<Page> pageList = new List<Page>();

            var rootPages = Kooboo.CMS.Sites.Services.ServiceFactory.PageManager.All(site, null);

            pageList = rootPages.ToList();

            foreach (var r in rootPages)
            {
                this.GenerateList(site, r, ref pageList);
            }

            if (filter == null)
            {
                return null;
            }

            var result = pageList.Where(o => o.VirtualPath.StartsWith(filter, StringComparison.OrdinalIgnoreCase)).Select(o => new SelectListItem { Text = o.VirtualPath, Value = o.VirtualPath });

            return result;
        }
Пример #2
0
 public IEnumerable<Label> All(Site site)
 {
     return _dbContext.Labels
            .Where(it => it.SiteName == site.FullName)
            .ToArray()
            .Select(it => it.ToLabel(new Label() { Site = site })).AsQueryable();
 }
Пример #3
0
        /// <summary>
        /// The script file url o fsite
        /// </summary>
        /// <param name="frontUrlHelper">The front url helper</param>
        /// <param name="site">The site</param>
        /// <param name="baseUri">Base uri</param>
        /// <param name="relativeScriptFilePath">The relative script file path of site</param>
        /// <returns></returns>
        public static IHtmlString ScriptFileUrl(this FrontUrlHelper frontUrlHelper, Site site, string baseUri, string relativeScriptFilePath, bool forceSSL = false)
        {
            string resourceDomain = site.ResourceDomain.FormatUrlWithProtocol(forceSSL);

            bool scriptFileExists = false;
            string scriptFileUrl = String.Empty;
            string scriptFilePhysicalPath = String.Empty;

            do
            {
                site = site.AsActual();

                ScriptFile scriptFile = new ScriptFile(site, String.Empty);
                if (scriptFile != null)
                {
                    scriptFileUrl = UrlUtility.Combine(scriptFile.VirtualPath, relativeScriptFilePath);

                    scriptFilePhysicalPath = HttpContext.Current.Server.MapPath(scriptFileUrl);
                    scriptFileExists = File.Exists(scriptFilePhysicalPath);
                }

                site = site.Parent;
            } while (site != null && !scriptFileExists);

            if (!String.IsNullOrEmpty(resourceDomain))
            {
                baseUri = resourceDomain; // CDN have high priority
            }
            return new HtmlString(UrlUtility.ToHttpAbsolute(baseUri, scriptFileUrl));
        }
Пример #4
0
        private ShippingAddressesModel GetAddresses(Site site, ControllerContext controllerContext)
        {
            var model = new ShippingAddressesModel();
            var member = controllerContext.HttpContext.Membership().GetMembershipUser();
            var customer = site.Commerce().Customers
                                          .ByAccountId(member.UUID)
                                          .Include(c => c.Addresses)
                                          .FirstOrDefault();

            Address defaultAddr = null;

            if (customer.ShippingAddressId != null)
            {
                defaultAddr = customer.Addresses.FirstOrDefault(a => a.Id == customer.ShippingAddressId.Value);
            }

            if (defaultAddr == null)
            {
                defaultAddr = customer.Addresses.FirstOrDefault();
            }

            model.Default = defaultAddr;
            model.Alternatives = customer.Addresses.Where(x => x.Id != defaultAddr.Id).ToList();

            return model;
        }
Пример #5
0
        public string UpdateTextContent(Site site, TextFolder textFolder, string uuid, System.Collections.Specialized.NameValueCollection values, [System.Runtime.InteropServices.OptionalAttribute][System.Runtime.InteropServices.DefaultParameterValueAttribute("")]string userid, string vendor)
        {
            var schema = textFolder.GetSchema();
            var textContent = new TextContent(textFolder.Repository.Name, textFolder.SchemaName, textFolder.FullName);

            textContent = _textContentBinder.Bind(schema, textContent, values);

            IncomingQueue incomeQueue = new IncomingQueue()
            {
                Message = null,
                Object = new Dictionary<string, object>(textContent),
                ObjectUUID = textContent.IntegrateId,
                ObjectTitle = textContent.GetSummary(),
                Vendor = vendor,
                PublishingObject = PublishingObject.TextContent,
                Action = PublishingAction.Publish,
                SiteName = site.FullName,
                Status = QueueStatus.Pending,
                UtcCreationDate = DateTime.UtcNow,
                UtcProcessedTime = null,
                UUID = Kooboo.UniqueIdGenerator.GetInstance().GetBase32UniqueId(10)
            };
            _incomeQueueProvider.Add(incomeQueue);

            return textContent.IntegrateId;
        }
Пример #6
0
 public virtual void EnsureAssembliesExistsInBin(Site site)
 {
     var files = GetFiles(site);
     foreach (var file in files)
     {
         var fileInBin = GetAssemblyBinFilePath(file.FileName);
         if (!File.Exists(fileInBin))
         {
             File.Copy(file.PhysicalPath, fileInBin);
         }
     }
     foreach (var file in files)
     {
         var assembly = GetAssembly(site, file.FileName);
         if (assembly == null)
         {
             var fileInBin = GetAssemblyBinFilePath(file.FileName);
             Assembly.LoadFrom(fileInBin);
         }
     }
     if (site.Parent != null)
     {
         EnsureAssembliesExistsInBin(site.Parent);
     }
 }
Пример #7
0
        public static IHtmlString Parse(PagePosition position, Site site)
        {
            if (position == null) { return null; }

            var view = position as ViewPosition;
            if (view != null) { return new PageDesignViewContent(view); }

            var module = position as ModulePosition;
            if (module != null) { return new PageDesignModuleContent(module); }

            var html = position as HtmlPosition;
            if (html != null) { return new PageDesignHtmlContent(html); }

            var folder = position as ContentPosition;
            if (folder != null) { return new PageDesignFolderContent(folder); }

            var htmlBlock = position as HtmlBlockPosition;
            if (htmlBlock != null)
            {
                var entry = htmlBlock.GetHtmlBlock(site);
                if (entry != null)
                {
                    return new PageDesignHtmlBlockContent(htmlBlock, entry.Body);
                }
            }

            return new HtmlString("");
        }
Пример #8
0
        public virtual void Initialize(Site site)
        {
            var bucketName = site.GetBucketName();
            if (!DatabaseHelper.ExistBucket(bucketName))
            {
                DatabaseHelper.CreateBucket(bucketName);
                //此处需暂停几秒钟,否则,通过选择模板创建站点的方式,在导入数据时,会出现数据未导入的情况
                //大致原因在于,Couchbae在数据库创建之后,需要几秒钟的初始化过程,在这个过程中插入任何数据都将失败
            }
            //            string viewsTemplate = @"{{
            //                    ""views"": {{
            //                        {0}
            //                    }}
            //            }}";
            //            string viewTemplate = @"""{0}"":{{""map"":""function(doc,meta){{if(doc._datatype_==='{1}'){{emit(meta.id,doc);}}}}""}}";
            //            List<string> views = new List<string>();
            //            views.Add(string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.PageDataType), ModelExtensions.PageDataType));
            //            views.Add(string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.PageDraftDataType), ModelExtensions.PageDraftDataType));
            //            views.Add(string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.HtmlBlockDataType), ModelExtensions.HtmlBlockDataType));
            //            views.Add(string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.LabelDataType), ModelExtensions.LabelDataType));
            //            views.Add(string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.LabelCategoryDataType), ModelExtensions.LabelCategoryDataType));
            //            views.Add(string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.UserDataType), ModelExtensions.UserDataType));

            //string document = string.Format(viewsTemplate, string.Join(",", views.ToArray()));
            //DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.DesignName, document);

            string viewTemplate = @"{{""views"":{{""{0}"":{{""map"":""function(doc,meta){{if(doc._datatype_==='{1}'){{emit(meta.id,null);}}}}""}}}}}}";
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.PageDataType), string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.PageDataType), ModelExtensions.PageDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.PageDraftDataType), string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.PageDraftDataType), ModelExtensions.PageDraftDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.HtmlBlockDataType), string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.HtmlBlockDataType), ModelExtensions.HtmlBlockDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.LabelDataType), string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.LabelDataType), ModelExtensions.LabelDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.LabelCategoryDataType), string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.LabelCategoryDataType), ModelExtensions.LabelCategoryDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.UserDataType), string.Format(viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.UserDataType), ModelExtensions.UserDataType));
            System.Threading.Thread.Sleep(3000);
        }
Пример #9
0
        public void EnsureAssembliesExistsInBin(Site site, bool copyParent = true, bool copyChildren = false)
        {
            var files = GetFiles(site);
            foreach (var file in files)
            {
                if (!_assemblyReferences.IsSystemAssembly(file.PhysicalPath))
                {
                    var fileInBin = GetAssemblyBinFilePath(file.FileName);

                    File.Copy(file.PhysicalPath, fileInBin, true);
                    _assemblyReferences.AddReference(file.PhysicalPath, GetReferenceName(site));

                }
            }
            //foreach (var file in files)
            //{
            //    var assembly = GetAssembly(site, file.FileName);
            //    if (assembly == null)
            //    {
            //        var fileInBin = GetAssemblyBinFilePath(file.FileName);
            //        Assembly.LoadFrom(fileInBin);
            //    }
            //}
            if (copyParent && site.Parent != null)
            {
                EnsureAssembliesExistsInBin(site.Parent, copyParent, copyChildren);
            }
            if (copyChildren)
            {
                foreach (var child in ServiceFactory.SiteManager.ChildSites(site))
                {
                    EnsureAssembliesExistsInBin(child, copyParent, copyChildren);
                }
            }
        }
Пример #10
0
        public void OnIncluded(Site site)
        {
            // Add code here that will be executed when the module was included to the site.

            // API access to the local or public file path
               // var privatedatafolder = new ModulePathHelper(ModuleAreaRegistration.ModuleName, site).GetModuleLocalFilePath();
        }
Пример #11
0
 public string UpdateTextContent(Site site, TextFolder textFolder, string integrateId, NameValueCollection values, string userid, string vendor)
 {
     var integrate = new ContentIntegrateId(integrateId);
     var files = values.GetFilesFromValues();
     var textContent = _textContentManager.Update(textFolder.Repository, textFolder, integrate.ContentUUID, values, files, DateTime.UtcNow, null, null, userid, true);
     return textContent.IntegrateId;
 }
Пример #12
0
 public static string GetAbsolutePageUrl(Site site, string pageUrl)
 {
     FrontRequestChannel requestChannel = site.FrontRequestChannel();
     string wrapperPageUrl = FrontUrlHelper.WrapperUrl(pageUrl, site, requestChannel).ToString();
     string host = GetHost(site);
     return HttpContext.Current.Request.ToAbsoluteUrl(host, wrapperPageUrl);
 }
Пример #13
0
        protected virtual MenuItem GenerateItem(Site site, ControllerContext controllerContext, DirectoryResource directoryResource)
        {
            var menuItem = new MenuItem
            {
                Text = directoryResource.Name,
                Area = "Sites",
                Action = "Index",
                Controller = "File",
                Initializer = new FileFolderItemInitializer(),
                Localizable = false
            };

            menuItem.RouteValues = new System.Web.Routing.RouteValueDictionary();

            menuItem.RouteValues["folderPath"] = ((DirectoryEntry)directoryResource).RelativePath;
            menuItem.RouteValues["type"] = FileManager.Type;

            var subDirs = FileManager.GetDirectories(site, ((DirectoryEntry)directoryResource).RelativePath);
            if (subDirs != null && subDirs.Count() > 0)
            {
                var subList = new List<MenuItem>();
                foreach (var sub in subDirs)
                {
                    subList.Add(GenerateItem(site, controllerContext, sub));
                }
                menuItem.Items = subList;
            }

            return menuItem;
        }
Пример #14
0
        public virtual void Initialize(Site site)
        {
            var bucketName = site.GetBucketName();
            if (!DatabaseHelper.ExistBucket(bucketName))
            {
                DatabaseHelper.CreateBucket(bucketName);
                System.Threading.Thread.Sleep(3000);
                //此处需暂停几秒钟,否则,通过选择模板创建站点的方式,在导入数据时,会出现数据未导入的情况
                //大致原因在于,Couchbae在数据库创建之后,需要几秒钟的初始化过程,在这个过程中插入任何数据都将失败
            }
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.PageDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.PageDataType), ModelExtensions.PageDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.PageDraftDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.PageDraftDataType), ModelExtensions.PageDraftDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.HtmlBlockDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.HtmlBlockDataType), ModelExtensions.HtmlBlockDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.LabelDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.LabelDataType), ModelExtensions.LabelDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.LabelCategoryDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.LabelCategoryDataType), ModelExtensions.LabelCategoryDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.UserDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.UserDataType), ModelExtensions.UserDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.CustomErrorDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.CustomErrorDataType), ModelExtensions.CustomErrorDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.UrlRedirectDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.UrlRedirectDataType), ModelExtensions.UrlRedirectDataType));

            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.ABPageSettingDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.ABPageSettingDataType), ModelExtensions.ABPageSettingDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.ABPageTestResultDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.ABPageTestResultDataType), ModelExtensions.ABPageTestResultDataType));
            DatabaseHelper.CreateDesignDocument(bucketName, ModelExtensions.GetQueryView(ModelExtensions.ABRuleSettingDataType), string.Format(DataHelper.viewTemplate, ModelExtensions.GetQueryView(ModelExtensions.ABRuleSettingDataType), ModelExtensions.ABRuleSettingDataType));

            System.Threading.Thread.Sleep(3000);
        }
Пример #15
0
        public override void ExecuteResult(ControllerContext context)
        {
            string siteName = context.HttpContext.Request.QueryString["cms_siteName"];
            string pageName = context.HttpContext.Request.QueryString["cms_pageName"];

            if (string.IsNullOrEmpty(siteName) || string.IsNullOrEmpty(pageName))
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }
            var site = new Site(siteName).AsActual();
            if (site == null)
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }
            var page = new Page(site, pageName).AsActual();
            if (page == null || page.PagePositions == null)
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }
            var proxyPosition = page.PagePositions.OfType<ProxyPosition>().FirstOrDefault();
            if (proxyPosition == null)
            {
                context.HttpContext.Response.StatusCode = 404;
                return;
            }
            var remoteUrl = context.HttpContext.Request.RawUrl;
            var content = _proxyRender.Render(new ProxyRenderContext(context, null, proxyPosition, remoteUrl));
            if (content != null && !string.IsNullOrEmpty(content.ToString()))
            {
                context.HttpContext.Response.Write(content.ToString());
            }
        }
Пример #16
0
 public ModulePath(string moduleName, Site site)
 {
     ModuleName = moduleName;
     Site = site;
     PhysicalPath = PhysicalPathAccessor(moduleName);
     VirtualPath = VirtualPathAccessor(moduleName);
 }
Пример #17
0
        public static ActionResult CreateRedirectResult(Site site, FrontRequestChannel channel, string url, string rawUrl, int? statusCode, RedirectType redirectType)
        {
            var redirectUrl = url;
            if (!UrlUtility.IsAbsoluteUrl(redirectUrl))
            {
                redirectUrl = UrlUtility.ResolveUrl(redirectUrl);
                //WrapperUrl will cause endless loop if site host by ASP.NET development server when transfer redirect.
                if (redirectType != RedirectType.Transfer || Settings.IsHostByIIS)
                {
                    redirectUrl = FrontUrlHelper.WrapperUrl(redirectUrl, site, channel).ToString();
                }
            }
            if (!string.IsNullOrEmpty(rawUrl))
            {
                redirectUrl = redirectUrl.AddQueryParam("errorpath", rawUrl);
            }
            if (statusCode != null)
            {
                redirectUrl = redirectUrl.AddQueryParam("statusCode", statusCode.ToString());
            }

            switch (redirectType)
            {
                case RedirectType.Moved_Permanently_301:
                    return new Redirect301Result(redirectUrl);

                case RedirectType.Transfer:
                    return new TransferResult(redirectUrl, statusCode ?? 200);
                case RedirectType.Found_Redirect_302:
                default:
                    return new RedirectResult(redirectUrl);
            }
        }
Пример #18
0
 public string AddTextContent(Site site, TextFolder textFolder, NameValueCollection values, string userid, string vendor)
 {
     var files = values.GetFilesFromValues();
     var categories = values.GetCategories().Select(it => new TextContent(textFolder.Repository.Name, "", it.CategoryFolder) { UUID = it.CategoryUUID }).ToArray();
     var textContent = _textContentManager.Add(textFolder.Repository, textFolder, values, files, categories, userid);
     return textContent.IntegrateId;
 }
Пример #19
0
 protected ModuleContext(Site site, string moduleName, ModuleSettings moduleSettings, ModulePosition position)
 {
     this.Site = site;
     ModuleName = moduleName;
     this.ModuleSettings = moduleSettings;
     this.ModulePosition = position;
 }
Пример #20
0
        public static void ParseTrackingToken(Site site, string trackingToken, out string pageVisitRuleName, out string matchedPage)
        {
            pageVisitRuleName = null;
            matchedPage = null;

            if (!string.IsNullOrEmpty(trackingToken))
            {
                try
                {
                    string trackingValue = SecurityHelper.Decrypt(site, trackingToken);

                    string[] values = trackingValue.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);

                    if (values.Length > 0)
                    {
                        pageVisitRuleName = values[0];
                        matchedPage = values[1];
                    }
                }
                catch (Exception e)
                {
                    Kooboo.HealthMonitoring.Log.LogException(e);
                }
            }
        }
Пример #21
0
 public void EnsureAssembliesExistsInBin(Site site, bool copyParent = true, bool copyChildren = false)
 {
     var files = GetFiles(site);
     foreach (var file in files)
     {
         var fileInBin = GetAssemblyBinFilePath(file.FileName);
         if (!File.Exists(fileInBin))
         {
             File.Copy(file.PhysicalPath, fileInBin);
         }
     }
     foreach (var file in files)
     {
         var assembly = GetAssembly(site, file.FileName);
         if (assembly == null)
         {
             var fileInBin = GetAssemblyBinFilePath(file.FileName);
             Assembly.LoadFrom(fileInBin);
         }
     }
     if (copyParent && site.Parent != null)
     {
         EnsureAssembliesExistsInBin(site.Parent, copyParent, copyChildren);
     }
     if (copyChildren)
     {
         foreach (var child in ServiceFactory.SiteManager.ChildSites(site))
         {
             EnsureAssembliesExistsInBin(child, copyParent, copyChildren);
         }
     }
 }
Пример #22
0
 public static string GetAbsolutePageUrl(Site site, Page page, object values)
 {
     UrlHelper urlHelper = MvcUtility.GetUrlHelper();
     FrontRequestChannel requestChannel = site.FrontRequestChannel();
     string pageUrl = FrontUrlHelper.GeneratePageUrl(urlHelper, site, page, values, requestChannel).ToString();
     string host = GetHost(site);
     return HttpContext.Current.Request.ToAbsoluteUrl(host, pageUrl);
 }
Пример #23
0
 public void ExportToDisk(Site site)
 {
     var allItems = this.All(site);
     foreach (var item in allItems)
     {
         provider.Add(item.AsActual());
     }
 }
Пример #24
0
        protected virtual void SendMail(ControllerContext controllerContext, Site site, ContactSiteModel ContactSiteModel, HttpFileCollectionBase files) {

            var from = ContactSiteModel.From;
            var subject = ContactSiteModel.Subject;
            var body = string.Format(ContactSiteModel.EmailBody ,ContactSiteModel.From, ContactSiteModel.Subject, ContactSiteModel.Body);

            site.SendMailToSiteManager(from, subject, body, true , files);
        }
Пример #25
0
 private void SetThreadCulture(Site site)
 {
     if (!string.IsNullOrEmpty(site.Culture))
     {
         var culture = CultureInfoHelper.CreateCultureInfo(site.Culture);
         Thread.CurrentThread.CurrentCulture = culture;
     }
 }
Пример #26
0
 public void Add(Site site, Label label)
 {
     if (string.IsNullOrEmpty(label.UUID))
     {
         label.UUID = Kooboo.UniqueIdGenerator.GetInstance().GetBase32UniqueId(10);
     }
     this._labelProvider.Add(label);
 }
Пример #27
0
 public IEnumerable<ABTest.ABRuleSetting> All(Site site)
 {
     if (null == site)
     {
         return _dbContext.ABRuleSettings.Where(it => String.IsNullOrEmpty(it.SiteName)).ToList().Select(it => it.ToABRuleSetting());
     }
     return _dbContext.ABRuleSettings.Where(it => it.SiteName.Equals(site.FullName, StringComparison.OrdinalIgnoreCase)).ToList().Select(it => it.ToABRuleSetting());
 }
Пример #28
0
 public PathResource(Site site, string name)
 {
     if (site != null)
     {
         this.Site = new Site(site.FullName);
     }
     this.Name = name;
 }
 public void ExportToDisk(Site site)
 {
     var allItems = this.All(site).ToList();
     foreach (var item in allItems)
     {
         fileProvider.Add(item);
     }
 }
Пример #30
0
 private static byte[] GetKey(Site site)
 {
     if (site == null)
     {
         throw new ArgumentNullException("SecurityHelper requires the Site.Current context.".Localize());
     }
     return ASCIIEncoding.ASCII.GetBytes(site.Security.EncryptKey);
 }
Пример #31
0
        public static Kooboo.CMS.Sites.Models.Site GetSite(string repositoryId)
        {
            var site = new Kooboo.CMS.Sites.Models.Site(repositoryId).AsActual();

            if (site == null)
            {
                throw new FaultException <cmisFaultType>(CreateFault(enumServiceException.objectNotFound, string.Format("No such site:{0}.".Localize(), repositoryId)));
            }
            return(site);
        }
Пример #32
0
        public static Kooboo.CMS.Sites.Models.Site GetSite(string repositoryId)
        {
            var site = new Kooboo.CMS.Sites.Models.Site(repositoryId).AsActual();

            if (site == null)
            {
                throw new FaultException(string.Format("No such site:{0}.".Localize(), repositoryId));
            }
            return(site);
        }
Пример #33
0
 public Theme(Site site, string name)
     : base(site, name)
 {
 }
Пример #34
0
 public virtual Size GetContainerSize(Kooboo.CMS.Sites.Models.Site site)
 {
     return(new Size());
 }
Пример #35
0
 public PathResource(Site site, string name)
 {
     this.Site = site;
     this.Name = name;
 }
Пример #36
0
 public AssemblyFile(Site site, string fileName)
     : base(site, fileName)
 {
 }