Example #1
0
        /// <summary>
        /// Returns a summary list of all site articles.
        /// </summary>
        /// <returns>A list of all site articles.</returns>
        public static List<BaseArticle> GetSiteArticles(out BaseArticle logsArticle, out BaseArticle rightsArticle)
        {
            List<BaseArticle> siteArticles = new List<BaseArticle>();

            // Get the input directory and the index file used to get the display title of the articles.
            string siteArticlesDirectory = ConfigurationManager.AppSettings["siteArticlesDirectory"].ToString();
            string indexFilePath = Path.Combine(siteArticlesDirectory, INDEX_FILE_NAME);

            StreamReader indexFile = new StreamReader(indexFilePath);
            while (!indexFile.EndOfStream)
            {
                // Not EOF => We can read at least once more.
                string line = indexFile.ReadLine();

                // Each line of the index file is composed of 2 parts separated by tabs.
                string[] lineParts = line.Split(new char[] { '\t' });

                // E.g. "SearchModule.SearchPage"
                string lineArticleTitle = lineParts[0];

                // E.g. "General Search Page"
                string lineArticleDisplayTitle = lineParts[1];

                SiteArticleInfo siteArticle = new SiteArticleInfo(lineArticleTitle, lineArticleDisplayTitle);
                siteArticles.Add(siteArticle);
            }

            logsArticle = new SiteArticleInfo(SITE_LOGS_ARTICLE_TITLE, SITE_LOGS_ARTICLE_TITLE);
            rightsArticle = new SiteArticleInfo(SITE_RIGHTS_ARTICLE_TITLE, SITE_RIGHTS_ARTICLE_TITLE);

            return siteArticles;
        }
Example #2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="baseArticle">A BaseArticle upon which this object is created.</param>
 /// <param name="id">The id of the article.</param>        
 /// <param name="originalDate">The date at which the article was created.</param>
 /// <param name="originalUser">The user that created the article.</param>
 /// <param name="lastModifiedDate">The date at which the article was last modified.</param>
 /// <param name="lastModifiedUser">The user that made the last modifications to the article.</param>
 /// <param name="status">The status of the article.</param>
 /// <param name="lockedBy">The user that currently has locked the article (if any).</param>
 /// <param name="lockedAt">The date and time at which the article was locked (if it is locked).</param>
 /// <param name="validationDate">The date at which the last change of status was made.</param>
 /// <param name="validationUser">The user that made the last change on the status of the article.</param>
 /// <param name="summary">The summary of the article.</param>
 public WikiArticleInfo(BaseArticle baseArticle, int id, DateTime originalDate, string originalUser, DateTime lastModifiedDate, string lastModifiedUser, ArticleStatus status, string lockedBy, DateTime lockedAt, DateTime validationDate, string validationUser, string summary)
     : this(id, baseArticle.Title, baseArticle.Type, originalDate, originalUser, lastModifiedDate, lastModifiedUser, status, lockedBy, lockedAt, validationDate, validationUser, summary)
 {
 }