Describes a page layout to the Orckestra CMS core so it may set up editing UI
        private void ParseTemplate(string virtualPath,
            AspNet.Razor.RazorPageTemplate webPage,
            out PageTemplateDescriptor templateDescriptor,
            out IDictionary<string, PropertyInfo> placeholderProperties)
        {
            Func<PageTemplateDescriptor> constructor = () => new RazorPageTemplateDescriptor(virtualPath);

            templateDescriptor = TemplateDefinitionHelper.BuildPageTemplateDescriptor(webPage, constructor, out placeholderProperties);
        }
        internal bool LoadRazorTemplate(
            string virtualPath,
            out WebPageBase webPage,
            out PageTemplateDescriptor parsedTemplate,
            out IDictionary<string, PropertyInfo> placeholderProperties,
            out Exception loadingException)
        {
            try
            {
                webPage = WebPageBase.CreateInstanceFromVirtualPath(virtualPath);
            }
            catch(Exception ex)
            {
                Log.LogError(LogTitle, "Failed to compile razor file '{0}'", virtualPath);
                Log.LogError(LogTitle, ex);

                loadingException = ex is TargetInvocationException ? ex.InnerException : ex;

                webPage = null;
                parsedTemplate = null;
                placeholderProperties = null;
                return false;
            }

            if (webPage == null || !(webPage is RazorPageTemplate))
            {
                parsedTemplate = null;
                placeholderProperties = null;
                loadingException = null;
                return true;
            }

            RazorPageTemplate razorPageTemplate = webPage as RazorPageTemplate;
            razorPageTemplate.Configure();

            try
            {
                ParseTemplate(virtualPath, razorPageTemplate, out parsedTemplate, out placeholderProperties);
            }
            catch (Exception ex)
            {
                Log.LogError(LogTitle, "Failed to load razor page template '{0}'", virtualPath);
                Log.LogError(LogTitle, ex);

                loadingException = ex;
                parsedTemplate = null;
                placeholderProperties = null;
                return false;
            }
            finally
            {
                razorPageTemplate.Dispose();
            }

            loadingException = null;
            return true;
        }