Add error handler for PSI failures.
Support appending to an existing Procedure Set
This commit is contained in:
parent
7511ebcd2c
commit
13d9350fdf
@ -188,6 +188,8 @@ namespace DataLoader
|
||||
{
|
||||
DataRow drpsi = dt.Rows[0];
|
||||
string psistr = drpsi["TEXTM"].ToString();
|
||||
try
|
||||
{
|
||||
if (psistr != null && psistr != "")
|
||||
{
|
||||
StringReader strrd = new StringReader(psistr);
|
||||
@ -205,11 +207,16 @@ namespace DataLoader
|
||||
{
|
||||
nm = sLine.Substring(0, indx);
|
||||
string tmpPsi = sLine.Substring(indx + 1, sLine.Length - indx - 1);
|
||||
if (tmpPsi.Length > 0) tmpPsi=TextConvert.ConvertText(tmpPsi);
|
||||
if (tmpPsi.Length > 0) tmpPsi = TextConvert.ConvertText(tmpPsi);
|
||||
vl = tmpPsi;
|
||||
}
|
||||
ci.AddItem("PSI", nm, vl == null ? null : vl);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
log.Warn("Failure during PSI", ex);
|
||||
}
|
||||
}
|
||||
dapsi.Dispose();
|
||||
@ -329,7 +336,7 @@ namespace DataLoader
|
||||
// addpart = false;
|
||||
//}
|
||||
//FrType = 0;
|
||||
Console.WriteLine("'before',{0},{1},{2},{3}", SectItm == null ? "" : SectItm.DisplayNumber, parentitem.DisplayNumber, level, dicSecCount.Count > 0 ? dicSecCount[level] : 0);
|
||||
//Console.WriteLine("'before',{0},{1},{2},{3}", SectItm == null ? "" : SectItm.DisplayNumber, parentitem.DisplayNumber, level, dicSecCount.Count > 0 ? dicSecCount[level] : 0);
|
||||
dicSecParentItem[level] = SectItm;
|
||||
int subSecs = drw["Sequence"].ToString().PadRight(12, ' ')[5] - 48;
|
||||
if (level > 0)
|
||||
@ -357,7 +364,7 @@ namespace DataLoader
|
||||
parentitem = itm;
|
||||
}
|
||||
}
|
||||
Console.WriteLine("'after',{0},{1},{2},{3}", SectItm == null ? "" : SectItm.DisplayNumber, parentitem.DisplayNumber, level, dicSecCount.Count > 0 ? dicSecCount[level] : 0);
|
||||
//Console.WriteLine("'after',{0},{1},{2},{3}", SectItm == null ? "" : SectItm.DisplayNumber, parentitem.DisplayNumber, level, dicSecCount.Count > 0 ? dicSecCount[level] : 0);
|
||||
}
|
||||
dv.Dispose();
|
||||
//foreach (Item secItm in dicSecParentItem.Values)
|
||||
@ -395,8 +402,8 @@ namespace DataLoader
|
||||
// to. However, if reset, the 'oldto' may not contain a reference
|
||||
// to a foldout, i.e. may contain 'junk' data. Only add the
|
||||
// reference to the dictionary if it's a foldout.
|
||||
int fromStep = drt["FROMSEQUEN"].ToString()[1] - '0';
|
||||
int toStep = drt["TOSEQUENCE"].ToString()[1] - '0';
|
||||
int fromStep = TextConvert.ConvertSeq(drt["FROMSEQUEN"].ToString())[1] - '0';
|
||||
int toStep = TextConvert.ConvertSeq(drt["TOSEQUENCE"].ToString())[1] - '0';
|
||||
string foldSeq = drt["OLDTO"].ToString().Substring(0, 2);
|
||||
if (foldSeq[1] == 'F')
|
||||
{
|
||||
@ -513,7 +520,7 @@ namespace DataLoader
|
||||
private Item MigrateProcedures(OleDbConnection cn, string pth, DocVersion docver, bool convertProcedures, FormatInfo activeFormat)
|
||||
{
|
||||
|
||||
Item FirstItm = null;
|
||||
Item FirstItm = docver.MyItem;// null;
|
||||
// Loop through Set File for each Procedure
|
||||
try
|
||||
{
|
||||
@ -521,6 +528,8 @@ namespace DataLoader
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds);
|
||||
Item FrItm = null;
|
||||
if (FirstItm != null)
|
||||
FrItm = ItemInfo.Get(FirstItm.ItemID).LastSibling.Get();
|
||||
frmMain.pbProcMaximum = ds.Tables[0].Rows.Count;
|
||||
frmMain.UpdateLabels(0, 0, 0);
|
||||
dicSetfileEntries = new Dictionary<string, string>(); // used to check for duplicate SET file info - jsj 2/11/10
|
||||
@ -528,7 +537,8 @@ namespace DataLoader
|
||||
frmMain.ShowSections = convertProcedures;
|
||||
foreach (DataRow dr in ds.Tables[0].Rows)
|
||||
{
|
||||
if (++i > frmMain.SkipProcedures)
|
||||
i++;
|
||||
if (i > frmMain.SkipProcedures && (frmMain.HowManyProcedures == 0|| i <= (frmMain.SkipProcedures + frmMain.HowManyProcedures) ))
|
||||
{
|
||||
if (OKtoProcessDBF(dr, pth)) // look for duplicate SET file info - jsj 2/11/10
|
||||
{
|
||||
|
@ -90,18 +90,24 @@ namespace DataLoader
|
||||
rofst = ROFst.MakeROFst(rodb, ab, null, fi.LastWriteTimeUtc, "Migration");
|
||||
}
|
||||
// Next hook the rofst to the docversion using the associations table.
|
||||
bool appending = false;
|
||||
if (docver.DocVersionAssociationCount == 0)
|
||||
{
|
||||
DocVersionAssociation dva = docver.DocVersionAssociations.Add(rofst);
|
||||
AssociationConfig assoc_cfg = new AssociationConfig();
|
||||
assoc_cfg.RODefaults_graphicsprefix = img_prefix;
|
||||
assoc_cfg.RODefaults_setpointprefix = sp_prefix;
|
||||
dva.Config = assoc_cfg.ToString();
|
||||
docver.Save();
|
||||
rofstinfo = ROFstInfo.Get(rofst.ROFstID); // refresh the info record!
|
||||
rofst.Dispose();
|
||||
}
|
||||
else
|
||||
appending = true;
|
||||
rofstinfo = ROFstInfo.Get(rofst.ROFstID); // refresh the info record!
|
||||
|
||||
// Now load any images in... type 8: // Intergrated Graphics RO type
|
||||
ROFSTLookup mylookup = rofstinfo.GetROFSTLookup(DocVersionInfo.Get(docver.VersionID));
|
||||
if (mylookup != null)
|
||||
if (!appending && mylookup != null)
|
||||
{
|
||||
for (int i = 0; i < mylookup.myHdr.myDbs.Length; i++)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user