private TreeNode CreateXlfNode(EkJobDS.LocalizationTargetRow data) { TreeNode node = new TreeNode(); StringBuilder sb = new StringBuilder(); string strHover = string.Empty; EkJobDS.LocalizationTargetRow.States state = (EkJobDS.LocalizationTargetRow.States)data.State; node.Value = "xlf" + data.TargetID; if (data.ErrorMessage == null || 0 == data.ErrorMessage.Length) { node.PopulateOnDemand = false; node.SelectAction = TreeNodeSelectAction.None; strHover = " onmouseover=\"myTVNodeHover(this)\" onmouseout=\"myTVNodeUnhover(this)\""; } else { node.PopulateOnDemand = true; node.SelectAction = TreeNodeSelectAction.Expand; } node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/translation.png"; node.ImageToolTip = GetMessage("alt xliff"); sb.Append("<div class=\"L10nXlf\"" + strHover + ">"); sb.Append("<div class=\"L10nXlfFileName\">"); sb.Append(this.FormatErrorMessage(data.ErrorMessage)); if (!data.IsTargetLanguageNull()) { Ektron.Cms.Localization.LocaleData targetLocale = this.GetLocaleData(data.TargetLanguage); if (targetLocale != null) { string targetFlag = targetLocale.FlagUrl; if (targetFlag.Length > 0) { sb.AppendFormat("<img src=\"{0}\" alt=\"{1}\" title=\"{1}\" class=\"L10nFlag\" /> ", targetFlag, targetLocale.EnglishName); } } } sb.Append(data.FileName); sb.Append("</div>"); if (data.IsLastEditDateNull()) { sb.Append(this.FormatDateTime(DateTime.MinValue, "L10nXlfDate")); } else { sb.Append(this.FormatDateTime(data.LastEditDate, "L10nXlfDate", GetMessage("generic date modified"))); } sb.Append("<div class=\"L10nXlfState\">"); if (data.IsStateNull()) { sb.Append(" "); } else { switch (state) { case EkJobDS.LocalizationTargetRow.States.ErrorOccurred: sb.Append(GetMessage("lbl error")); if (!this.methodCreateXlfNode_isFirstErrorExpanded && data.ErrorMessage != null && data.ErrorMessage.Length > 0) { this.methodCreateXlfNode_isFirstErrorExpanded = true; node.Expand(); } break; case EkJobDS.LocalizationTargetRow.States.NeedsReview: sb.Append(GetMessage("lbl needs review")); break; case EkJobDS.LocalizationTargetRow.States.NeedsTranslation: sb.Append(GetMessage("lbl needs translation")); break; case EkJobDS.LocalizationTargetRow.States.SignedOff: sb.Append(GetMessage("lbl signed off")); break; case EkJobDS.LocalizationTargetRow.States.Translated: sb.Append(GetMessage("lbl translated")); break; default: sb.Append(state.ToString()); break; } } sb.Append("</div>"); sb.Append("</div>"); node.Text = sb.ToString(); return node; }
private TreeNode CreateSklNode(EkJobDS.LocalizationSkeletonRow data) { // Special case: skeleton may be used as a placeholder to no skeletons EkSklTypes itemType = (EkSklTypes)data.ItemType; if (itemType == EkSklTypes.Information) { if (data.IsErrorMessageNull() || 0 == data.ErrorMessage.Length) { return this.CreateMsgNode(data.Title, MessageStyleType.Information); } else { return this.CreateMsgNode(data.ErrorMessage, MessageStyleType.ErrorMessage); } } TreeNode node = new TreeNode(); StringBuilder sb = new StringBuilder(); string strToolTipForItemID = string.Empty; node.Value = "skl" + data.SkeletonID; node.PopulateOnDemand = true; node.SelectAction = TreeNodeSelectAction.Expand; switch (itemType) { case EkSklTypes.Content: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/contentHtml.png"; node.ImageToolTip = GetMessage("lbl content"); strToolTipForItemID = GetMessage("generic content id"); break; case EkSklTypes.Form: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/contentForm.png"; node.ImageToolTip = GetMessage("form text"); strToolTipForItemID = GetMessage("alt form id"); break; case EkSklTypes.SmartFormData: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/xml.png"; node.ImageToolTip = GetMessage("lbl smart form"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.SmartFormDesign: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/contentSmartForm.png"; node.ImageToolTip = GetMessage("generic xml configuration"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.Menu: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/menu.png"; node.ImageToolTip = GetMessage("generic menu title"); strToolTipForItemID = GetMessage("alt menu number"); break; case EkSklTypes.MenuItem: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/menu.png"; node.ImageToolTip = GetMessage("alt menu items"); strToolTipForItemID = GetMessage("alt menu items number"); break; case EkSklTypes.Taxonomy: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/taxonomy.png"; node.ImageToolTip = GetMessage("generic taxonomy lbl"); strToolTipForItemID = GetMessage("alt taxonomy number"); break; case EkSklTypes.Image: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/image.png"; node.ImageToolTip = GetMessage("generic image"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.Audio: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/audio.png"; node.ImageToolTip = GetMessage("lbl audio"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.Video: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/video.png"; node.ImageToolTip = GetMessage("lbl video"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.PDF: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/acrobat.png"; node.ImageToolTip = GetMessage("content:asset:pdf"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.MsWord: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/word.png"; node.ImageToolTip = GetMessage("content:mso:doc"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.MsExcel: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/excel.png"; node.ImageToolTip = GetMessage("content:mso:xls"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.MsPowerPoint: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/powerpoint.png"; node.ImageToolTip = GetMessage("content:mso:ppt"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.MsPublisher: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/publisher.png"; node.ImageToolTip = GetMessage("content:mso:pub"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.MsVisio: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/visio.png"; node.ImageToolTip = GetMessage("content:mso:vsd"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.Flash: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/flash.png"; node.ImageToolTip = GetMessage("lbl adobe flash"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.Compressed: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/zip.png"; node.ImageToolTip = GetMessage("content:asset:zip"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.Document: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/text.png"; node.ImageToolTip = GetMessage("lbl dms documents"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.HtmlFile: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/html.png"; node.ImageToolTip = GetMessage("lbl html"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.XmlFile: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/xml.png"; node.ImageToolTip = GetMessage("lbl xml"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.TextFile: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/text.png"; node.ImageToolTip = GetMessage("content:asset:txt"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.File: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/file.png"; node.ImageToolTip = GetMessage("lbl generic file"); strToolTipForItemID = GetMessage("generic id"); break; case EkSklTypes.DmsAsset: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/contentDMSDocument.png"; node.ImageToolTip = GetMessage("lbl dms documents"); strToolTipForItemID = GetMessage("generic id"); break; default: node.ImageUrl = GetCommonApi().AppPath + "images/UI/Icons/FileTypes/text.png"; node.ImageToolTip = data.ItemType.ToString(); strToolTipForItemID = GetMessage("generic id"); break; } sb.Append("<div class=\"L10nSkl\">"); sb.Append("<div class=\"L10nSklItemID\""); if (strToolTipForItemID.Length > 0) { sb.Append(" title=\"" + strToolTipForItemID + "\">"); sb.Append(data.ItemID); } else { sb.Append(">"); } sb.Append("</div>"); sb.Append("<div class=\"L10nSklTitle\">"); sb.Append(this.FormatErrorMessage(data.ErrorMessage)); sb.Append(data.Title); sb.Append("</div>"); if (data.IsLastEditDateNull()) { sb.Append(this.FormatDateTime(DateTime.MinValue, "L10nSklDate")); } else { sb.Append(this.FormatDateTime(data.LastEditDate, "L10nSklDate", GetMessage("generic date modified"))); } sb.Append("</div>"); node.Text = sb.ToString(); if (!this.methodCreateSklNode_isFirstErrorExpanded && data.ErrorMessage != null && data.ErrorMessage.Length > 0) { this.methodCreateSklNode_isFirstErrorExpanded = true; node.Expand(); } return node; }