Outside Transition logic and annotations for unresolved transitions
This commit is contained in:
parent
f7c2a291d3
commit
4157c3b094
@ -26,10 +26,21 @@ namespace DataLoader
|
||||
public partial class Loader
|
||||
{
|
||||
public Item MigrateDocVersion(DocVersion docver)
|
||||
{
|
||||
return MigrateDocVersion(docver, true);
|
||||
}
|
||||
|
||||
private OutsideTransition _OutTran;
|
||||
|
||||
public Item MigrateDocVersion(DocVersion docver, bool convertProcedures)
|
||||
{
|
||||
string pth = docver.Title;
|
||||
// Open connection
|
||||
// TODO: If set.dbf is missing or curset.dat is missing don't process it.
|
||||
if (!File.Exists(pth + @"\set.dbf") || !File.Exists(pth + @"\curset.dat")) return null; // Open connection
|
||||
OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + pth + ";Extended Properties=dBase III;Persist Security Info=False");
|
||||
if (convertProcedures)
|
||||
{
|
||||
_OutTran = new OutsideTransition(cn);
|
||||
// load rofst (use it later)....
|
||||
rofst = new ROFST(pth + "\\ro.fst");
|
||||
// Migrate library documents
|
||||
@ -37,26 +48,32 @@ namespace DataLoader
|
||||
// Initialize Dictionaries
|
||||
dicTrans_ItemDone = new Dictionary<string, Item>();
|
||||
dicTrans_ItemIds = new Dictionary<string, Item>();
|
||||
dicTrans_MigrationErrors = new Dictionary<string, List<Item>>();
|
||||
|
||||
// Create a 'dummy' content record. This will be used for any transitions 'to'
|
||||
// that don't exist when dbf is processed. At end, use this to see if there
|
||||
// are missing transitions.
|
||||
TransDummyCont = Content.MakeContent(null, "DUMMY CONTENT FOR TRANSITION MIGRATION", null, null, null);
|
||||
|
||||
}
|
||||
// Process Procedures
|
||||
Item itm = MigrateProcedures(cn,pth,docver);
|
||||
Item itm = null;
|
||||
if (convertProcedures || docver.VersionType == (int)VEPROMS.CSLA.Library.VersionTypeEnum.WorkingDraft)
|
||||
itm = MigrateProcedures(cn, pth, docver, convertProcedures);
|
||||
// Show any Missing Transtitons (i.e. Transitions which have not been processed)
|
||||
if (convertProcedures)
|
||||
{
|
||||
ShowMissingTransitions();
|
||||
log.InfoFormat("Completed Migration of {0}", pth);
|
||||
MessageBox.Show("Completed Migration of " + pth);
|
||||
rofst.Close();
|
||||
cn.Close();
|
||||
dicTrans_ItemDone.Clear();
|
||||
dicTrans_ItemDone = null;
|
||||
}
|
||||
cn.Close();
|
||||
if (itm != null)
|
||||
{
|
||||
docver.MyItem = itm;
|
||||
docver.Title = "";
|
||||
if (convertProcedures) docver.Title = ""; // clearing this tell us this docver (path) was converted?
|
||||
if (!docver.IsSavable) ErrorRpt.ErrorReport(docver);
|
||||
docver.Save();
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ namespace DataLoader
|
||||
{
|
||||
public static class ErrorRpt
|
||||
{
|
||||
public static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public static void ErrorReport(IVEHasBrokenRules mybr)
|
||||
{
|
||||
string smess = mybr.GetType().Name;
|
||||
@ -22,7 +23,8 @@ namespace DataLoader
|
||||
smess += "\n" + br.Property + " - " + br.Description;
|
||||
}
|
||||
}
|
||||
MessageBox.Show(smess);
|
||||
//MessageBox.Show(smess);
|
||||
_MyLog.Error(smess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user