B2019-076: support for folder/working draft level proc set specific info (moved code from VlnSvgPageHelper to here)

B2019-076: support for folder/working draft level proc set specific info & C2019-023: default values on outside transitions SI
B2019-076: make folder/working draft level proc set specific info consistent
B2019-076: Move GetInheritedSIValue from here to DocVersionExt.cs so it is accessible from TransitionExt.cs
This commit is contained in:
2019-05-21 12:34:47 +00:00
parent aaf2c74371
commit 311d442b57
4 changed files with 72 additions and 36 deletions

View File

@@ -2070,7 +2070,7 @@ i = 0;
plstr = plstr.Replace(token, un);
break;
default:
if (token.Contains(@"SI-")) // folder or working draft specific information.
if (token.Contains(@"SI-")) // procedure set specific information. (at folder or working draft levels)
{
DocVersionConfig dvConfig = new DocVersionConfig(section.MyProcedure.MyDocVersion.Config);
FolderConfig folderConfig = new FolderConfig(section.MyProcedure.MyDocVersion.MyFolder.Config);
@@ -2081,13 +2081,13 @@ i = 0;
string val = null;
if (qindx == -1)
{
val = GetInheritedSIValue(section.MyProcedure, token.Substring(4, token.Length - 5));
val = DocVersionInfo.GetInheritedSIValue(section.MyProcedure, token.Substring(4, token.Length - 5));
plstr = plstr.Replace(token, val);
}
else
{
string pstok = token.Substring(indx + 1, qindx - indx - 1);
plstr = GetInheritedSIValue(section.MyProcedure, pstok);
plstr = DocVersionInfo.GetInheritedSIValue(section.MyProcedure, pstok);
//if (dvConfig != null)
// plstr = dvConfig.GetValue("SI", pstok);
//if ((plstr == null || plstr == "") && folderConfig != null)
@@ -2193,28 +2193,29 @@ i = 0;
}
return retval;
}
private string GetInheritedSIValue(ProcedureInfo pi, string fieldName)
{
string val = null;
DocVersionConfig dvConfig = new DocVersionConfig(pi.MyDocVersion.Config);
if (dvConfig != null)
{
val = dvConfig.GetValue("SI", fieldName);
if (val != null && val != "") return val; // the value exists within the docversion level
}
FolderInfo fi = pi.MyDocVersion.MyFolder;
while (fi != null)
{
FolderConfig folderConfig = new FolderConfig(fi.Config);
if (folderConfig != null)
{
val = folderConfig.GetValue("SI", fieldName);
if (val != null && val != "") return val; // the value exists within this folder
}
fi = fi.ActiveParent as FolderInfo;
}
return val;
}
// B2019-076: moved the following to DocVersionExt.cs to make it available to transitionext.cs code.
//private string GetInheritedSIValue(ProcedureInfo pi, string fieldName)
//{
// string val = null;
// DocVersionConfig dvConfig = new DocVersionConfig(pi.MyDocVersion.Config);
// if (dvConfig != null)
// {
// val = dvConfig.GetValue("SI", fieldName);
// if (val != null && val != "") return val; // the value exists within the docversion level
// }
// FolderInfo fi = pi.MyDocVersion.MyFolder;
// while (fi != null)
// {
// FolderConfig folderConfig = new FolderConfig(fi.Config);
// if (folderConfig != null)
// {
// val = folderConfig.GetValue("SI", fieldName);
// if (val != null && val != "") return val; // the value exists within this folder
// }
// fi = fi.ActiveParent as FolderInfo;
// }
// return val;
//}
private static ItemInfo ValveGetFirstStep(VEPROMS.CSLA.Library.SectionInfo section)
{
ItemInfo firstHigh = null;