Added getRoUsagesForDocVersion and modified vesp_ListTables3 stored procedures
Updated how RO values are updated as a result of issues identified by Calvert data Modified code to handle non-standard characters in StepType variable. Chnaged how transitions are updated to utilize methods of Content and ContentInfo classes
This commit is contained in:
@@ -60,10 +60,12 @@ namespace DataLoader
|
||||
get { return _MyStepRTB; }
|
||||
}
|
||||
private string _LogPath;
|
||||
public TransitionFixer(StepRTB myStepRTB,string logpath)
|
||||
private frmLoader _MyLoader;
|
||||
public TransitionFixer(StepRTB myStepRTB,string logpath, frmLoader myLoader)
|
||||
{
|
||||
_MyStepRTB = myStepRTB;
|
||||
_LogPath = logpath;
|
||||
_MyLoader = myLoader;
|
||||
}
|
||||
public TimeSpan Process(bool checkRTF)
|
||||
{
|
||||
@@ -75,8 +77,8 @@ namespace DataLoader
|
||||
{
|
||||
Status = "Getting List...";
|
||||
// Loop through all Items and check before and after text
|
||||
ItemInfoList myListFrom = ItemInfoList.GetListTranFrom();
|
||||
ItemInfoList myListTo = ItemInfoList.GetListTranTo();
|
||||
ItemInfoList myListFrom = ItemInfoList.GetListTranFrom(); //ItemInfoList.GetByContentID(99732);//
|
||||
ItemInfoList myListTo = ItemInfoList.GetListTranTo(); //ItemInfoList.GetByContentID(99732); //
|
||||
ConversionRTBProblems myProblems = new ConversionRTBProblems();
|
||||
int i = 0;
|
||||
foreach (ItemInfo item in myListFrom)
|
||||
@@ -100,10 +102,28 @@ namespace DataLoader
|
||||
{
|
||||
try
|
||||
{
|
||||
if (item.MyContent.MyGrid != null)
|
||||
updatedText = FixTableTransitionText(updatedText, tran, item.MyContent.Get());
|
||||
else
|
||||
updatedText = FixTransitionText(updatedText, tran);
|
||||
using (Content c = item.MyContent.Get())
|
||||
{
|
||||
c.FixTransitionText(tran);
|
||||
c.Save();
|
||||
}
|
||||
if (item.NewTransToUnNumberedItem)
|
||||
{
|
||||
using (Item itm = item.Get())
|
||||
{
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
ia.SearchText = "Transition to un-numbered step";
|
||||
ia.UserID = "Migration";
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
//_MyLoader.AddInfo("{0}", item.MyContent.MyContentMessage);
|
||||
//if (item.MyContent.MyGridMessage != string.Empty)
|
||||
// _MyLoader.AddInfo("{0}", item.MyContent.MyGridMessage);
|
||||
// updatedText = FixTransitionText(originalText, tran, item.MyContent.ContentID);
|
||||
//if (item.MyContent.MyGrid != null)
|
||||
// updatedText = FixTableTransitionText(originalText, tran, item.MyContent.Get());
|
||||
//else
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -111,45 +131,45 @@ namespace DataLoader
|
||||
_MyLog.WarnFormat("Transition Conversion Error: {0}", ex.Message);
|
||||
}
|
||||
// Added for transitions to un-numbered steps
|
||||
if (tran.NewTransToUnNumberedItem) item.NewTransToUnNumberedItem = true;
|
||||
//if (tran.NewTransToUnNumberedItem) item.NewTransToUnNumberedItem = true;
|
||||
}
|
||||
}
|
||||
if (updatedText.EndsWith(" ")) updatedText = updatedText.Substring(0, updatedText.Length - 1);
|
||||
if (item.MyContent.MyGrid != null)
|
||||
{
|
||||
using (Item itm = item.Get())
|
||||
{
|
||||
updatedText = (updatedText.Replace("<START]", "<START]")).Replace("[END>", "[END>");
|
||||
string sstring = AdjustSizeAndGetSearchString(updatedText, itm);
|
||||
itm.MyContent.Text = sstring;
|
||||
if (item.NewTransToUnNumberedItem)
|
||||
{
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
ia.SearchText = "Transition to un-numbered step";
|
||||
ia.UserID = "Migration";
|
||||
}
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.NewTransToUnNumberedItem)
|
||||
{
|
||||
using (Item itm = item.Get())
|
||||
{
|
||||
ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
ia.SearchText = "Transition to un-numbered step";
|
||||
ia.UserID = "Migration";
|
||||
itm.Save();
|
||||
}
|
||||
}
|
||||
using (Content c = item.MyContent.Get())
|
||||
{
|
||||
c.Text = updatedText;
|
||||
c.Save();
|
||||
}
|
||||
}
|
||||
// Added for transitions to un-numbered steps
|
||||
//if (updatedText.EndsWith(" ")) updatedText = updatedText.Substring(0, updatedText.Length - 1);
|
||||
//if (item.MyContent.MyGrid != null)
|
||||
//{
|
||||
// using (Item itm = item.Get())
|
||||
// {
|
||||
// updatedText = (updatedText.Replace("<START]", "<START]")).Replace("[END>", "[END>");
|
||||
// string sstring = AdjustSizeAndGetSearchString(updatedText, itm);
|
||||
// itm.MyContent.Text = sstring;
|
||||
// if (item.NewTransToUnNumberedItem)
|
||||
// {
|
||||
// ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
// ia.SearchText = "Transition to un-numbered step";
|
||||
// ia.UserID = "Migration";
|
||||
// }
|
||||
// itm.Save();
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (item.NewTransToUnNumberedItem)
|
||||
// {
|
||||
// using (Item itm = item.Get())
|
||||
// {
|
||||
// ItemAnnotation ia = itm.ItemAnnotations.Add(VerificationRequiredType);
|
||||
// ia.SearchText = "Transition to un-numbered step";
|
||||
// ia.UserID = "Migration";
|
||||
// itm.Save();
|
||||
// }
|
||||
// }
|
||||
// using (Content c = item.MyContent.Get())
|
||||
// {
|
||||
// c.Text = updatedText;
|
||||
// c.Save();
|
||||
// }
|
||||
//}
|
||||
//// Added for transitions to un-numbered steps
|
||||
if (checkRTF)
|
||||
{
|
||||
MyStepRTB.MyItemInfo = item;
|
||||
@@ -190,7 +210,7 @@ namespace DataLoader
|
||||
return _VerificationRequiredType;
|
||||
}
|
||||
}
|
||||
public string FixTransitionText(string Text, TransitionInfo tran)
|
||||
public string FixTransitionText(string Text, TransitionInfo tran, int contentID)
|
||||
{
|
||||
string lookFor = string.Format(@"<START\]\\v0 ([^#]*?)\\v #Link:Transition[^:]*?:{0} {1}( [0-9]*){2}\[END>", tran.TranType, tran.TransitionID, "{1,2}");
|
||||
string transText = tran.ResolvePathTo();
|
||||
@@ -202,7 +222,9 @@ namespace DataLoader
|
||||
if (m != null && m.Groups.Count > 1)
|
||||
{
|
||||
System.Text.RegularExpressions.Group g = m.Groups[1];
|
||||
if (g.ToString() != transText)
|
||||
_MyLoader.AddInfo("DataLoader.TransitionFixer:Content:{0}, {1}, {2}", contentID, tran.TransitionID, g.ToString());
|
||||
//Console.WriteLine("DataLoader.TransitionFixer:Content:{0}, {1}", tran.TransitionID, g.ToString());
|
||||
if (g.ToString() != transText)
|
||||
Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
|
||||
}
|
||||
else
|
||||
@@ -221,7 +243,9 @@ namespace DataLoader
|
||||
if (m != null && m.Groups.Count > 1)
|
||||
{
|
||||
System.Text.RegularExpressions.Group g = m.Groups[1];
|
||||
if (g.ToString() != transText)
|
||||
_MyLoader.AddInfo("DataLoader.TransitionFixer:Grid:{0}, {1}, {2}", content.ContentID, tran.TransitionID, g.ToString());
|
||||
// Console.WriteLine("DataLoader.TransitionFixer:Grid:{0}, {1}", tran.TransitionID, g.ToString());
|
||||
if (g.ToString() != transText)
|
||||
Text = Text.Substring(0, g.Index) + transText + Text.Substring(g.Index + g.Length);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user