1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Flash Menu from Navigation XML

Flash Menu from Navigation XML

2 posts, 0 answered
  1. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    21 Oct 2009
    Link to this post
    Hi,

    We're in the process of implementing a site, for our client, in Sitefinity 3.6 and we need some advice.
    The site will be using Flash for the banner part of the site which includes navigation. In order for this to work our Flash developer would need a feed of sorts to extract the navigation hierarchy. To my mind we can go one of two routes, but I'm not sure what the more appropriate route is.

    1. We create a webservice and call on the Sitefinity navigation API (if there is one) to produce XML, which is returned to Flash on the browser.
    2. We create a standard page (Aspx page) which does the same thing, but renders it's results in XML.

    With option 1 we foresee an issue with security, or rather, having to do extra development work to cater for security via a webservice, but we're not sure if this is the case.
    Option 2 eliminates the issues of security to a degree, but again we can't be certain of this.

    Has anyone implemented something like this before with Sitefinity and can we gain some insight into the approach we should be taking?

    Thanks,
    Jacques
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    21 Oct 2009
    Link to this post
    Hi J.Hov,

    Thank you for using our services.

    Basically our suggestion would be to use the ASP.NET SiteMap class to get all nodes in the sitemap. Then you will cast every node to CmsSiteMapNode and get the corresponding cms page for that node. Then you can use the pages API to get property values for each page - like URL, DenyAnonymous, Navigable and etc. You can write those files to XML. Unforutnately we do not have built in methods for this so you will have to implement your own logic for creating the XML. Here is how you can get all nodes in Site Map:
    Telerik.Cms.CmsManager cmsManager = new Telerik.Cms.CmsManager();
    foreach (CmsSiteMapNode node in SiteMap.RootNode.GetAllNodes())
    {
                Telerik.Cms.ICmsPage page = node.GetCmsPage();
                bool isDenyAnonymous = page.DenyAnonymous;
                bool isNavigable = page.Navigable;
                IList urls = page.Urls;
                //You need page ID to deal with security latee
                Guid pageID = page.ID;
                //write the properties to XML
    }

    Then when a you bind the navigation control to display the nodes you should see whether logged in user has right to see a page, for this you should use the ID property:
    Telerik.Cms.CmsManager cmsManager = new Telerik.Cms.CmsManager();
    //retreieve page from the saved ID, and check view rights for current logged in user
    Telerik.Cms.ICmsPage page = cmsManager.GetPage(new Guid(pageID));
    PagePermission perm = new PagePermission(page);
    if (perm.CheckDemand(Telerik.Cms.Security.PageRights.View))
    {
        
    }

    This is just sample how to utilize security. You should also retrieve the saved values for isNavigable and isDenyAnonymous and perform necessary checks.

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered