示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PopulateJavascriptIncludesAndVariables();

            this.more.HRef = MoreUrl;

            if (Parameters != null)
            {

                //set the header
                this.header.Text = Parameters.Header;

                if (Parameters.HideHeader)
                {
                    this.headerspan.Visible = false;
                }
                else
                {
                    if (!string.IsNullOrEmpty(Parameters.MoreUrl))
                    {
                        this.more.HRef = Parameters.MoreUrl;
                    }
                }
            }

            // set the Id
            if (!string.IsNullOrEmpty(this.ID))
            {
                this.articleListDiv.ID = this.ID;
            }

            //load data
            LoadData();

            //set the articles
            this.articleListRow.Stage = this.Stage;
            this.articleListRow.Parameters = Parameters;
            this.articleListRow.Articles = articles;

            if (articles != null && articles.Count != 0)
            {
                this.none.Style["display"] = "none";
            }
            else
            {
                this.actioncontrols.Visible = false;
            }
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PublishingStatus"/> class.
 /// </summary>
 /// <param name="stage">Publishing stage.</param>
 /// <param name="statusText">The status text.</param>
 /// <param name="progress">Publishing progress.</param>
 public PublishingStatus(PublishingStage stage, string statusText, PublishingProgress progress) 
 {
     Stage = stage.ToString();
     StatusText = statusText;
     Progress = progress.ToString();
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PublishingStatus"/> class.
 /// </summary>
 /// <param name="stage">Publishing stage.</param>
 /// <param name="statusText">The status text.</param>
 /// <param name="progress">Publishing progress.</param>
 /// <param name="progressComplted">The progress complted percent.</param>
 public PublishingStatus(PublishingStage stage, string statusText, PublishingProgress progress, double progressComplted)
     : this(stage, statusText, progress)
 {
     ProgressCompleted = progressComplted;
 }
示例#4
0
        public IList<Article> ReadInPath(ArticleHandler handler, string path, long ownerId, PublishingStage stage, int start, int size, out int total)
        {
            #region argument

            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            #endregion

            return ArticleDbInteractor.Instance.GetArticlesInPath(path, ownerId, (int)stage, Article.ArticleTagKey, handler.Id, start, size, out total);
        }
示例#5
0
        public bool TryGetArticle(string urlKey, PublishingStage stage, out Article article)
        {
            article = null;
            bool success = false;

            try
            {
                article = GetArticle(Utility.SanitizeUrl(urlKey), stage);
                success = true;
            }
            catch (MessageException mex)
            {
                logger.Log(LogLevel.Debug, "Article at [{0}] doesnot exist, exception - {1}", Utility.SanitizeUrl(urlKey), mex.Message);
            }

            return success;
        }
示例#6
0
 public IList<Article> Read(string query, long ownerId, PublishingStage stage, int start, int size, out int total)
 {
     return ArticleDbInteractor.Instance.GetArticles(query, ownerId, (int)stage, Article.ArticleTagKey, BlogArticleHandler.HandlerIdGuid, start, size, out total);
 }
示例#7
0
        public Article GetArticle(string urlKey, PublishingStage stage)
        {
            #region argument

            if (string.IsNullOrEmpty(urlKey))
            {
                throw new ArgumentNullException("urlKey");
            }

            #endregion

            return ArticleDbInteractor.Instance.GetArticle(Utility.SanitizeUrl(urlKey), (int)stage);
        }
示例#8
0
        public bool Exists(string urlKey, PublishingStage stage)
        {
            Article a;

            return TryGetArticle(Utility.SanitizeUrl(urlKey), stage, out a);
        }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PublishingStageViewModel"/> class.
 /// </summary>
 /// <param name="stage">The stage.</param>
 public PublishingStageViewModel(PublishingStage stage)
 {
     Stage = stage;
 }
示例#10
0
        /// <summary>
        /// Initializes the specified client unique identifier.
        /// </summary>
        /// <param name="clientGuid">The client unique identifier.</param>
        /// <param name="stages">The stages.</param>
        /// <param name="refreshClient">if set to <c>true</c> [refresh client].</param>
        /// <param name="restartIis">if set to <c>true</c> [restart IIS].</param>
        public void Init(Guid clientGuid, PublishingStage stages, bool refreshClient = false, bool restartIis = false)
        {
            foreach (var stage in Enum.GetValues(typeof(PublishingStage)).Cast<PublishingStage>().Where(stage => (stage & stages) == stage)) 
                Stages.Add(new PublishingStageViewModel(stage));

            TotalWork = Stages.Count;
            WorkCompleted = 0;

            SetupNotifications();

            RefreshClient = refreshClient;
            RestartIis = restartIis;
        }