Beispiel #1
0
        /// <summary>
        /// Returns references to all children of the specific page.
        /// </summary>
        /// <param name="pageLink">The page link.</param>
        /// <returns>Reference to all children</returns>
        /// <remarks>This is expected to return all children regardless of languages</remarks>
        protected override PageReferenceCollection GetChildrenReferences(PageReference pageLink, string languageID)
        {
            PageReferenceCollection result = new PageReferenceCollection();

            if (pageLink == EntryPoint)
            {
                ExcelParser parser = new ExcelParser(_excelFilePath, _idColumn, _pageNameColumn, _sheetName);
                parser.GetPageIDs().ForEach(item => result.Add(base.ConstructPageReference(item)));
            }
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Reads data from the backing XML file and creates a PageData object from the data.
        /// </summary>
        /// <remarks>
        /// The language selector is used to see if a specific language is preferred, if language does not
        /// exist or a specific language was not given master language branch is returned.
        /// </remarks>
        /// <param name="pageLink">The page link.</param>
        /// <param name="selector">The selector which states the preffered language</param>
        /// <returns>A fully initialized PageData object</returns>
        protected override PageData GetLocalPage(PageReference pageLink, ILanguageSelector languageSelector)
        {
            List <string> pageLanguages            = new List <string>();
            PageData      pageData                 = new PageData();
            Dictionary <string, string> properties = new ExcelParser(_excelFilePath, _idColumn, _pageNameColumn, _sheetName).GetPageProperties(pageLink.ID);

            base.InitializePageData(pageData, properties[_pageNameColumn], _pageTypeName, GetGuidFromID(pageLink.ID), pageLink.CreateWritableClone(), EntryPoint, pageLanguages);

            foreach (KeyValuePair <string, string> keyValuePair in properties)
            {
                if (keyValuePair.Key != _idColumn && keyValuePair.Key != _pageNameColumn)
                {
                    pageData.SetValue(keyValuePair.Key, keyValuePair.Value);
                }
            }
            SetPageStatus(pageData, VersionStatus.Published);
            SetDynamicProperties(pageData);

            return(pageData);
        }