public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { var link = GetPreviewLink(articleItemWrapper); var img = new Image { ImageUrl = "/VWB/images/vwb/urlicon.png" }; img.Attributes.Add("align", "absmiddle"); img.Attributes.Add("width", "16"); img.Attributes.Add("height", "16"); img.Attributes.Add("alt", "Hyperlink"); link.Controls.Add(img); if (articleItemWrapper.Embargoed) { var flagImg = new Image() { ImageUrl = "/VWB/images/vwb/flag_red_h.png" }; flagImg.Attributes.Add("align", "absmiddle"); flagImg.Attributes.Add("width", "16"); flagImg.Attributes.Add("height", "16"); link.Controls.Add(flagImg); } var label = new Label { Text = articleItemWrapper.Title }; link.Controls.Add(label); var tc = new TableCell(); var locking = articleItemWrapper.InnerItem.InnerItem.Locking; string lockUser = locking.GetOwner(); if (!string.IsNullOrEmpty(lockUser)) { lockUser = lockUser.Substring(lockUser.IndexOf(@"\") + 1); var lockimage = new Image { ImageUrl = "/VWB/images/vwb/icon_lock.png" }; lockimage.Attributes.Add("align", "absmiddle"); lockimage.Attributes.Add("width", "16"); lockimage.Attributes.Add("height", "16"); lockimage.Attributes.Add("title", "Locked by: " + lockUser); lockimage.Attributes.Add("alt", "Locked by: " + lockUser); tc.Controls.Add(lockimage); } tc.Controls.Add(link); return(tc); }
private HyperLink GetPreviewLink(ArticleItemWrapper articleItemWrapper, bool isMobile = false) { var link = new HyperLink { /*Text = articleItemWrapper.Title*/ }; string mobileQueryParam = String.Empty; if (isMobile) { mobileQueryParam = "&mobile=1"; } if (HttpContext.Current.Request.IsSecureConnection) { link.Attributes.Add("href", "/VWB/Util/LoginRedirectToPreview.aspx?redirect=" + HttpUtility.UrlEncode(articleItemWrapper.PreviewUrl + mobileQueryParam)); } else { link.Attributes.Add("href", "/VWB/Util/LoginRedirectToPreview.aspx?redirect=" + HttpUtility.UrlEncode(articleItemWrapper.PreviewUrl + mobileQueryParam)); } link.Attributes.Add("target", "_blank"); return(link); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { var tc = new TableCell(); if (articleItemWrapper.Embargoed && articleItemWrapper.EmbargoDate > DateTime.Now) { var label = new Label { Text = articleItemWrapper.EmbargoDate.ToString() }; label.Style.Add("color", "red"); tc.Controls.Add(label); } else if (articleItemWrapper.Embargoed && articleItemWrapper.EmbargoDate < DateTime.Now) { var label = new Label { Text = articleItemWrapper.EmbargoDate.ToString() }; tc.Controls.Add(label); } else { tc.Text = "No publishing restriction set"; } return(tc); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { ArticleItem articleItem = articleItemWrapper.InnerItem; var cell = new TableCell(); var text = new TextBox { Text = articleItemWrapper.NotesToEditorial, TextMode = TextBoxMode.MultiLine, Rows = 5, CssClass = "block", ID = "ta_" + articleItem.ID }; text.EnableViewState = false; var refresh = new Button { Text = "Save" }; text.Attributes.Add("itemID", articleItem.ID.ToString()); refresh.Attributes.Add("itemID", articleItem.ID.ToString()); refresh.OnClientClick = "UpdateEditorialNote('" + articleItem.ID.ToString() + "'); return false;"; cell.Controls.Add(text); cell.Controls.Add(refresh); return(cell); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { string a = string.Join("", x.Authors.ToArray()); string b = string.Join("", y.Authors.ToArray()); return(a.CompareTo(b)); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { var tc = new TableCell(); tc.Text = articleItemWrapper.ArticleLengthEstimate; return(tc); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { string value = string.Join("<br />", articleItemWrapper.SidebarArticleNumbers.ToArray()); return(new TableCell { Text = value }); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { if (x.MediaType == null || y.MediaType == null) { return(0); } return(x.MediaType.CompareTo(y.MediaType)); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { var xlocking = x.InnerItem.InnerItem.Locking; var ylocking = y.InnerItem.InnerItem.Locking; var boolcomp = xlocking.IsLocked().CompareTo(ylocking.IsLocked()); if (boolcomp != 0) { return(boolcomp); } return(xlocking.GetOwner().CompareTo(ylocking.GetOwner())); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { string authors = ""; if (articleItemWrapper.Authors != null) { authors = string.Join("<br />", articleItemWrapper.Authors.ToArray()); } return(new TableCell { Text = authors }); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { return(new TableCell().Alter(tc => tc.Controls.Add(new CheckBox() .Alter(cb => cb.CssClass = "js-article-checkbox") .Alter(cb => cb.InputAttributes["value"] = articleItemWrapper.InnerItem.SitecoreId)))); // checkbox.InputAttributes["value"] = articleItemWrapper.InnerItem.SitecoreId; //tc.Controls.Add(checkbox); //return tc; }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { string text; if (articleItemWrapper.ArticleCreation == DateTime.MinValue) { text = "N/E"; } else { text = VWBUtil.GetFormattedDateTime(articleItemWrapper.ArticleCreation); } return(new TableCell { Text = text }); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { if (x.Embargoed && !y.Embargoed) { return(1); } else if (!x.Embargoed && y.Embargoed) { return(-1); } else { // undefined sort. embargo date may be datetime.min, but we don't care. return(x.EmbargoDate.CompareTo(y.EmbargoDate)); } }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { var tc = new TableCell(); string url = GetDownloadLink(articleItemWrapper.InnerItem); if (url != "") { url += "?sc_mode=preview" + string.Format("&ts={0}", System.DateTime.Now.ToString("yyyyMMddHHmmss")); var hlink = new HyperLink(); //if (HttpContext.Current.Request.IsSecureConnection) //{ // //url = "../Util/LoginRedirectToPreview.aspx?redirect=" + HttpUtility.UrlEncode(url).Replace("http", "https"); // url = "../Util/LoginRedirectToPreview.aspx?redirect=" + url.Replace("http", "https"); //} //else //{ // url = "../Util/LoginRedirectToPreview.aspx?redirect=" + url; //} hlink.Attributes.Add("href", url); hlink.Attributes.Add("target", "_blank"); hlink.Text = articleItemWrapper.ArticleNumber; var img = new Image { ImageUrl = "/VWB/images/vwb/wordicon.png" }; img.Attributes.Add("align", "absmiddle"); img.Attributes.Add("width", "16"); img.Attributes.Add("height", "16"); img.Attributes.Add("alt", "Hyperlink"); var label = new Label { Text = articleItemWrapper.ArticleNumber }; hlink.Controls.Add(img); hlink.Controls.Add(label); tc.Controls.Add(hlink); } else { tc.Text = articleItemWrapper.ArticleNumber; } return(tc); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { Database masterDb = Factory.GetDatabase("master"); ArticleItem article = articleItemWrapper.InnerItem; Item item = article.InnerItem; var cell = new TableCell(); string text = ""; ItemState itemState = item.State; if (itemState == null) { cell.Text = "N/E"; return(cell); } WorkflowState workflowState = itemState.GetWorkflowState(); if (workflowState == null) { cell.Text = "N/E"; return(cell); } text += workflowState.DisplayName; if (workflowState.FinalState) { //TODO I took this from EmailUtil, need to refactor a bit so that code is not in two places List <WorkflowEvent> history = GetWorkflowHistory(masterDb, item); if (history.Count == 0) { cell.Text = "N/E"; return(cell); } else { WorkflowEvent latest = history.Last(); text += "<br />Signed off: " + latest.Date.ToServerTimeZone(); string user = latest.User; text += "<br />By: " + user.Substring(user.LastIndexOf(@"\") + 1); } } cell.Text = text; return(cell); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { var cell = new TableCell(); var locking = articleItemWrapper.InnerItem.InnerItem.Locking; string lockUser = locking.GetOwner() ?? ""; lockUser = lockUser.Substring(lockUser.IndexOf(@"\") + 1); var lockimg = new Image { ImageUrl = "/VWB/images/vwb/icon_lock.png" }; lockimg.Attributes.Add("align", "absmiddle"); lockimg.Attributes.Add("width", "16"); lockimg.Attributes.Add("height", "16"); lockimg.Attributes.Add("title", lockUser); cell.Controls.Add(lockimg); return(cell); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { return(new TableCell { Text = articleItemWrapper.ContentType }); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(x.ArticleNumber.CompareTo(y.ArticleNumber)); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { return(new TableCell { Text = articleItemWrapper.TaxonomyString }); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(x.TaxonomyString.CompareTo(y.TaxonomyString)); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { throw new NotImplementedException(); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { throw new NotImplementedException(); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(x.NotesToEditorial.CompareTo(y.NotesToEditorial)); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(x.Title.CompareTo(y.Title)); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(y.SidebarArticleNumbers.Count.CompareTo(x.SidebarArticleNumbers.Count)); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(x.PublicationName.ToLower().CompareTo(y.PublicationName.ToLower())); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(x.ArticleCreation.CompareTo(y.ArticleCreation)); }
public TableCell GetCell(ArticleItemWrapper articleItemWrapper) { return(new TableCell { Text = articleItemWrapper.PublicationName }); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(x.SAPDateTime.CompareTo(y.SAPDateTime)); }
public int Compare(ArticleItemWrapper x, ArticleItemWrapper y) { return(x.ContentType.CompareTo(y.ContentType)); }