Esempio n. 1
0
 // ReSharper disable once UnusedParameter.Local
 private static void Main(string[] args)
 {
     Console.WriteLine("Begin CreateSitemaps");
     //Console.WriteLine($"{SitemapManager.UpdateAllSitemapVirtualPages()} pages written");
     Console.WriteLine($"{SitemapManager.UpdateSitemapVirtualPage()} pages written");
     Console.WriteLine("End CreateSitemaps");
 }
Esempio n. 2
0
    private static SitemapNode GetSiteMapNode(HttpRequestBase request)
    {
        //get the aboslute url
        string url = request.Url.AbsolutePath;

        return(SitemapManager.GetSiteMapNode(url));
    }
Esempio n. 3
0
        public override void Process(HttpRequestArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            if (Context.Site == null || string.IsNullOrEmpty(Context.Site.RootPath.Trim()))
            {
                return;
            }
            if (Context.Page.FilePath.Length > 0)
            {
                return;
            }
            var sitemapHandler = string.IsNullOrWhiteSpace(Context.Site.Properties["sitemapHandler"])
                ? "sitemap.xml"
                : Context.Site.Properties["sitemapHandler"];

            if (!args.Url.FilePath.Contains(sitemapHandler))
            {
                return;
            }

            // Important to return qualified XML (text/xml) for sitemaps
            args.Context.Response.ClearHeaders();
            args.Context.Response.ClearContent();
            args.Context.Response.ContentType = "text/xml";

            // Checking the HTML cache first
            var site = Context.Site;

#if !DEBUG
            var cacheKey = "UltimateSitemapXML_" + site.Name;
            var cache    = CacheManager.GetHtmlCache(site).GetHtml(cacheKey);
            if (!string.IsNullOrWhiteSpace(cache))
            {
                args.Context.Response.Write(cache);
                args.Context.Response.End();
                return;
            }
#endif

            var content = string.Empty;
            try
            {
                var config         = new SitemapManagerConfiguration(site.Name);
                var sitemapManager = new SitemapManager(config);

                content = sitemapManager.BuildSiteMapForHandler();
                args.Context.Response.Write(content);
            }
            finally
            {
#if !DEBUG
                CacheManager.GetHtmlCache(site).SetHtml(cacheKey, content);
#endif
                args.Context.Response.Flush();
                args.Context.Response.End();
            }
        }
        private async Task <SitemapRouteDocument> CreateDocumentAsync()
        {
            var sitemaps = await SitemapManager.GetSitemapsAsync();

            var document = new SitemapRouteDocument();

            BuildEntries(document, sitemaps);

            return(document);
        }
Esempio n. 5
0
        public ActionResult Permission(int id = 0)
        {
            ViewBag.User = db.User.Find(id);
            if (ViewBag.User == null)
            {
                return(RedirectToAction("Index"));
            }

            return(View(SitemapManager.GetPermissions(id)));
        }
Esempio n. 6
0
        public ActionResult _BreadcrumbPartial(int id = 0)
        {
            var list = SitemapManager.GetParentViewSitemapList(Request["category"]);
            var doc  = db.Document.Find(id);

            if (doc != null)
            {
                list.Add(new Sitemap()
                {
                    ViewUrl = string.Format("/Document/ViewNewsContent/{0}?category={1}", doc.Id, doc.Category),
                    Text    = doc.Title
                });
            }
            return(PartialView(list));
        }
Esempio n. 7
0
    private void BuildTree()
    {
        treeMenu.Nodes.Clear();

#if (DEBUG) //
        SitemapManager.GetInstance().Dispose();
#endif

        sitemap = SitemapManager.GetInstance().SiteInfo;
        Sitemap_Node node = new Sitemap_Node(sitemap);

        treeMenu.Nodes.Add(node);

        AddNodes(sitemap, node);

        treeMenu.ExpandAll();
    }
Esempio n. 8
0
        public ActionResult sitemap(FormCollection collection)
        {
            // Get the current domain
            Domain currentDomain = Tools.GetCurrentDomain();
            ViewBag.CurrentDomain = currentDomain;

            // Get query parameters
            string returnUrl = collection["returnUrl"];
            ViewBag.QueryParams = new QueryParams(returnUrl);

            // Check if the administrator is authorized
            if (Administrator.IsAuthorized(new string[] { "Administrator", "Editor" }) == true)
            {
                ViewBag.AdminSession = true;
            }
            else if (Administrator.IsAuthorized(Administrator.GetAllAdminRoles()) == true)
            {
                ViewBag.AdminSession = true;
                ViewBag.AdminErrorCode = 1;
                ViewBag.TranslatedTexts = StaticText.GetAll(currentDomain.back_end_language, "id", "ASC");
                return View("index");
            }
            else
            {
                // Redirect the user to the start page
                return RedirectToAction("index", "admin_login");
            }

            // Get form values 
            Int32 domainId = Convert.ToInt32(collection["hiddenDomainId"]);
            string priorityCategories = collection["selectPriorityCategories"];
            string priorityProducts = collection["selectPriorityProducts"];
            string changeFrequency = collection["selectChangeFrequency"];

            // Get the domain
            Domain domain = Domain.GetOneById(domainId);

            // Update the sitemap
            SitemapManager.CreateSitemap(domain, priorityCategories, priorityProducts, changeFrequency);

            // Redirect the user to the list
            return Redirect(returnUrl);

        } // End of the sitemap method
    /// <summary>
    /// UpdatePanel 을 갱신한다
    /// </summary>
    public void Update()
    {
        if (Sitemap == null)
        {
            return;
        }

        string path = Sitemap.ViewControl;

        if (path != null && path != string.Empty)
        {
            this.PlaceHolder1.Controls.Add(
                LoadControl(path));
        }
        lblSitemapPath.Text = SitemapManager.GetInstance().GetNavigateString(_sitemap);
        lblModuleID.Text    = _sitemap.ID;

        //this.panelCommonMainPlace.Update();
    }
Esempio n. 10
0
        public override void Process(HttpRequestArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            if (Context.Site == null || string.IsNullOrEmpty(Context.Site.RootPath.Trim()))
            {
                return;
            }
            if (Context.Page.FilePath.Length > 0)
            {
                return;
            }
            var site = Context.Site;

            if (!args.Url.FilePath.Contains(Constants.RobotsFileName))
            {
                return;
            }

            args.HttpContext.Response.ClearHeaders();
            args.HttpContext.Response.ClearContent();
            args.HttpContext.Response.ContentType = "text/plain";

            var content = string.Empty;

            try
            {
                var config         = new SitemapManagerConfiguration(site.Name);
                var sitemapManager = new SitemapManager(config);

                content = sitemapManager.GetRobotSite();
                args.HttpContext.Response.Write(content);
            }
            catch (Exception e)
            {
                Log.Error("Error Robots", e, this);
            }
            finally
            {
                args.HttpContext.Response.Flush();
                args.HttpContext.Response.End();
            }
        }
Esempio n. 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BuildTree();
        }

        //CurrentSitemapInfo = SitemapManager.GetInstance().GetSitemapByID(treeMenu.SelectedValue);
        //LoadPlaceTemplateByID(treeMenu.SelectedValue);
        string currentID = GetParamString("id");

        if (currentID == null)
        {
            Response.Redirect(Request.Path + "?id=ADMIN1");
        }

        CurrentSitemapInfo = SitemapManager.GetInstance().GetSitemapByID(currentID);

        LoadPlaceTemplateByID(CurrentSitemapInfo.ID);
    }
Esempio n. 12
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (CurrentUserInfo.Level != LevelAttribute.ADMIN)
            {
                Response.Redirect(SitemapManager.GetInstance().GetSitemapByID("ADMIN1").GetInitParam("page.admin.login"));
            }


            Response.Cache.SetNoStore();
            Response.Expires = 0;
            Response.AddHeader("pragma", "no-cache");

            ClientScript.RegisterClientScriptBlock(this.GetType(), "BaseScript",
                                                   "<link href=\"/Common/Css/global.css\" rel=\"stylesheet\" type=\"text/css\" />"
                                                   + "<script type=\"text/javascript\" src=\"/Common/Js/Script.aculo.us/lib/prototype.js\"></script>"
                                                   + "<script type=\"text/javascript\" src=\"/Common/Js/Script.aculo.us/src/scriptaculous.js\"></script>"
                                                   + "<script type=\"text/javascript\" src=\"/Common/Js/Blog.js\"></script>"
                                                   + "<script type=\"text/javascript\" src=\"/Common/Js/greybox/AJS.js\"></script>"
                                                   + "<script type=\"text/javascript\" src=\"/Common/Js/greybox/AJS_fx.js\"></script>"
                                                   + "<script type=\"text/javascript\" src=\"/Common/Js/greybox/gb_scripts.js\"></script>"
                                                   + "<link href=\"/Common/Js/greybox/gb_styles.css\" rel=\"stylesheet\" type=\"text/css\" />");
        }
Esempio n. 13
0
 private void LoadPlaceTemplateByID(string id)
 {
     LoadPlaceTemplate(SitemapManager.GetInstance().GetSitemapByID(id));
 }
Esempio n. 14
0
    protected void treeMenu_SelectedNodeChanged(object sender, EventArgs e)
    {
        CurrentSitemapInfo = SitemapManager.GetInstance().GetSitemapByID(treeMenu.SelectedValue);

        LoadPlaceTemplate(CurrentSitemapInfo);
    }