public CCForm(CCreator parent, ITisFormParams form) #endif : base(parent, form != null? form.Name:String.Empty, null, null, null) { try { if (pages == null) { pages = new List <CCPage>(); } else { pages.Clear(); } this.FormType = form.Name; this.EflowOwner = form; this.NamedParent = form.ParentFlow.Name; foreach (ITisPageParams pg in form.Pages) { pages.Add(new CCPage(this.ParentCreator, pg, pg.NumberOfLinkedEFIs == 1 ? pg.get_LinkedEFIByIndex(0).Name : form.ParentFlow.Process.DefaultEFI ?? String.Empty)); } } catch (Exception ex) { ILog.LogError(ex); } }
public CCTable(CCreator parent, ITisFieldTableParams fieldTable, bool createSubFields) #endif : this(parent, fieldTable.Name, new Dictionary <String, String>(), null, null) { this.EflowOwner = fieldTable; this.NamedParent = fieldTable.ParentFieldGroupExists ? fieldTable.ParentFieldGroup.Name : String.Empty; if (fieldArrays == null) { fieldArrays = new List <CCFieldArray>(); } else { fieldArrays.Clear(); } foreach (ITisFieldParams fa in fieldTable.LinkedFields) { for (int inr = 0; inr < Math.Max(1, (int)fieldTable.Table.NumberOfRows); inr++) { fieldArrays.Add(new CCFieldArray(this.ParentCreator, fa, createSubFields)); if (!fieldTable.Table.KeepEmptyRows) { break; } } } }
public CCCollection(CCreator parent, ITisClientServicesModule csm, ITisCollectionData collection) #endif : base(parent, collection != null? collection.Name:String.Empty, parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(collection) : null, parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(collection, false) : null, parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(collection, true) : null) { try { Priority = WorkflowPriorityLevel.Normal; FlowType = String.Empty; TargetQueue = String.Empty; LoginApplication = String.Empty; LoginStation = String.Empty; ImagePath = String.Empty; if (forms == null) { forms = new List <CCForm>(); } else { forms.Clear(); } this.LoginStation = csm.Session.StationName; this.LoginApplication = csm.Application.AppName; this.ParentCollection = collection; this.FlowType = collection.FlowType; this.EflowOwner = collection; this.ImagePath = collection.GetAttachmentFileName(CCEnums.CCFilesExt.TIF.ToString()); #region remove the collection image path from the attachments. List <String> att = new List <string>(); att.AddRange(CCUtils.GetAttachments(csm, collection.AttachedFileManager)); for (int ia = att.Count - 1; ia >= 0; ia--) { if (String.Compare(Path.GetFileName(att[ia]), this.ImagePath, true) == 0) { att.RemoveAt(ia); } } #endregion this.Attachments = att.ToArray(); this.Priority = collection.PriorityLevel; //-- Create forms --\\ foreach (ITisFormData frm in collection.Forms) { forms.Add(new CCForm(this.ParentCreator, frm)); } } catch (Exception ex) { ILog.LogError(ex); } }
public CCPage(CCreator parent, String pageName, String pageId, CCGroup[] linkGroups) : #endif base(parent, pageName ?? String.Empty, null, null) { this.LinkedGroups = linkGroups; this.PageID = pageId; }
public CCForm(CCreator parent, ITisFormData form) #endif : base(parent, form != null? form.Name:String.Empty, parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(form) : null, parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(form, false) : null, parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(form, true) : null) { try { if (pages == null) { pages = new List <CCPage>(); } else { pages.Clear(); } this.ParentCollection = form.ParentCollection; this.FormType = form.FormType; this.EflowOwner = form; this.NamedParent = form.ParentCollection.Name; foreach (ITisPageData pg in form.LinkedPages) { pages.Add(new CCPage(this.ParentCreator, pg)); } } catch (Exception ex) { ILog.LogError(ex); } }
internal CCFieldArray(CCreator parent, ITisFieldArrayData fieldArray) : this(parent, fieldArray != null? fieldArray.Name:String.Empty, parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(fieldArray) : null, parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(fieldArray, false) : null, parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(fieldArray, true) : null) { this.EflowOwner = fieldArray; this.ParentCollection = fieldArray.ParentCollection; this.ParentForm = fieldArray.ParentForm; this.ParentPage = fieldArray.ParentPage; this.ParentGroup = fieldArray.ParentFieldGroup; this.ParentTable = fieldArray.ParentFieldTable; this.NamedParent = fieldArray.ParentFieldTable.Name; if (fields == null) { fields = new List <CCField>(); } else { fields.Clear(); } foreach (ITisFieldData fd in fieldArray.LinkedFields) { fields.Add(new CCField(this.ParentCreator, fd)); } }
public CCTable(CCreator parent, ITisFieldTableData fieldTable) #endif : this(parent, fieldTable.Name, parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(fieldTable) : null, parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(fieldTable, false) : null, parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(fieldTable, true) : null) { this.EflowOwner = fieldTable; this.ParentCollection = fieldTable.ParentCollection; this.ParentForm = fieldTable.ParentForm; this.ParentPage = fieldTable.ParentPage; this.ParentGroup = fieldTable.ParentFieldGroup; this.NamedParent = fieldTable.ParentFieldGroupExists ? fieldTable.ParentFieldGroup.Name : String.Empty; List <CCFieldArray> fas = new List <CCFieldArray>(); if (fieldArrays == null) { fieldArrays = new List <CCFieldArray>(); } else { fieldArrays.Clear(); } foreach (ITisFieldArrayData fa in fieldTable.FieldArrays) { fieldArrays.Add(new CCFieldArray(this.ParentCreator, fa)); } }
public CCField(CCreator parent, String name, String contents, short confidence, TIS_RECT fieldRect, Dictionary <String, String> specialTags, Dictionary <String, String> namedTags, Dictionary <String, String> userTags) : #endif base(parent, name ?? String.Empty, specialTags, namedTags, userTags) { this.Contents = contents ?? String.Empty; this.Confidence = confidence; this.Rect = new FieldRect(fieldRect); }
public CCEflowBaseObject FromEflowObject(CCreator creator, ITisDataLayerTreeNode eflowObject) #endif { try { if (eflowObject is ITisFieldData) { return(new CCCollection.CCField(creator, eflowObject as ITisFieldData)); } else if (eflowObject is ITisFieldParams) { return(new CCCollection.CCField(creator, eflowObject as ITisFieldParams)); } else if (eflowObject is ITisFieldGroupData) { return(new CCCollection.CCGroup(creator, eflowObject as ITisFieldGroupData)); } else if (eflowObject is ITisFieldGroupParams) { return(new CCCollection.CCGroup(creator, eflowObject as ITisFieldGroupParams)); } else if (eflowObject is ITisFieldTableData) { return(new CCCollection.CCTable(creator, eflowObject as ITisFieldTableData)); } else if (eflowObject is ITisFieldTableParams) { return(new CCCollection.CCTable(creator, eflowObject as ITisFieldTableParams)); } else if (eflowObject is ITisFieldArrayData) { return(new CCCollection.CCFieldArray(creator, eflowObject as ITisFieldArrayData)); } else if (eflowObject is ITisPageData) { return(new CCCollection.CCPage(creator, eflowObject as ITisPageData)); } else if (eflowObject is ITisPageParams) { ITisPageParams pg = eflowObject as ITisPageParams; return(new CCCollection.CCPage(creator, pg, pg.NumberOfLinkedEFIs == 1 ? pg.get_LinkedEFIByIndex(0).Name : pg.ParentForm.ParentFlow.Process.DefaultEFI ?? String.Empty)); } else if (eflowObject is ITisFormData) { return(new CCCollection.CCForm(creator, eflowObject as ITisFormData)); } else if (eflowObject is ITisFormParams) { return(new CCCollection.CCForm(creator, eflowObject as ITisFormParams)); } } catch (Exception ex) { ILog.LogError(ex); } return(null); }
public CCEflowBaseObject(CCreator parent, String name, Dictionary <String, String> namedTags, Dictionary <String, String> userTags) #endif { this.NamedParent = String.Empty; this.ParentCreator = parent; this.NamedUserTags.NativeDictionary = namedTags; this.UserTags.NativeDictionary = userTags; this.Name = name; }
public int CreateCollection(String applicationName, bool copySourceFiles, String collectionDataPath, out int errCode, out String errMsg) #endif { errCode = -1; errMsg = null; try { //-- Create \ initilaize configuration data --\\ CCConfiguration.CCConfigurationData cfg = CCConfiguration.CCConfigurationData.FromXml(applicationName); //-- Create a collection creator class --\\ using (CCreator crt = new CCreator(cfg)) { crt.CurrentProfile.CopySourceFiles = copySourceFiles; //-- Create the collection definition --\\ CCCollection coll = CCCollection.FromXml(collectionDataPath, !copySourceFiles); if (coll == null) { errCode = (int)CCEnums.CCErrorCodes.E0091; errMsg = String.Format("{0}, file name: [{1}], error code [{2}]", CCConstants.E0091, collectionDataPath ?? String.Empty, errCode); throw new Exception(errMsg); } String[] resCols = crt.CreateCollections(null, out errCode, coll); if (resCols == null || resCols.Length != 1) { errCode = errCode <= 0 ? (int)CCEnums.CCErrorCodes.E0092: errCode; errMsg = String.Format("{0}, {1}, Source file path [{1}], error code [{2}]", CCConstants.E0092, collectionDataPath ?? String.Empty, errCode); throw new Exception(errMsg); } else { ILog.LogInfo("Done creating collection [{0}] from file [{1}] in eFlow system", resCols[0], collectionDataPath); errCode = (int)CCEnums.CCErrorCodes.E0001; } } } catch (Exception ex) { if (String.IsNullOrEmpty(errMsg)) { errMsg = ex.Message; } ILog.LogError(ex); if (currCfg == null || currCfg.ThrowAllExceptions) { throw ex; } } return(errCode); }
public CCTimerSearch(ITisClientServicesModule oCSM, String configPath, String profileName) { try { CSM = oCSM; CollectionsCreator = new CCreator(); if (CSM != null) { CSM.Session.OnMessage += StationMessage; workDir = CSM.PathLocator.get_Path(CCEnums.CCFilesExt.TIF.ToString()); } //-- Initialize profile --\\ if (File.Exists(configPath ?? String.Empty)) { config = CCConfiguration.FromXml(configPath); } else { config = CCConfiguration.FromCSM(CSM); } //-- Initialize profile --\\ if (String.IsNullOrEmpty(profileName)) { profileName = CSM.Application.AppName; } currentProfile = config != null?config.GetConfiguration(profileName) : null; if (currentProfile == null) { currentProfile = new CCConfiguration.CCConfigurationData(); //-- create a default profile --\\ } //-- Define collections creator settings --\\ CollectionsCreator.CurrentProfile = currentProfile; //collectionsCreator.OnPostFileLock += PostFileLock; CollectionsCreator.OnCollectionCreated += CollectionCreated; if (SearchHandler == null) { SearchHandler = new CCSearchFiles(currentProfile); } SearchHandler.OnPostFileLock += PostFileLock; SearchHandler.OnPreFileLock += PreFileLock; PollingTimer.Enabled = currentProfile.SearchPaths != null && currentProfile.SearchPaths.Length > 0 && currentProfile.SearchExtensions != null && currentProfile.SearchExtensions.Length > 0; CreateEvent();//-- fire OnCreate event --\ } catch (Exception ex) { ILog.LogError(ex); } }
public CCCollection(CCreator parent, String collectionName, params CCForm[] frms) : #endif base(parent, collectionName ?? String.Empty, null, null, null) { this.Forms = frms; Priority = WorkflowPriorityLevel.Normal; FlowType = String.Empty; TargetQueue = String.Empty; LoginApplication = String.Empty; LoginStation = String.Empty; ImagePath = String.Empty; }
public CCPage(CCreator parent, ITisPageData page) #endif : base(parent, page != null? page.Name:String.Empty, parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(page, false) : null, parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(page, true) : null) { try { if (groups == null) { groups = new List <CCGroup>(); } else { groups.Clear(); } this.Attachments = CCUtils.GetAttachments(page); this.EflowOwner = page; this.ParentCollection = page.ParentCollection; this.ParentForm = page.ParentForm; this.PageID = page.PageId; this.NamedParent = page.ParentFormExists ? page.ParentForm.Name : String.Empty; List <String> grpNames = new List <String>(); foreach (ITisFieldData fld in page.LinkedFields) { if (grpNames.Contains(fld.ParentFieldGroup.Name.ToUpper())) { continue; } grpNames.Add(fld.ParentFieldGroup.Name.ToUpper()); groups.Add(new CCGroup(this.ParentCreator, fld.ParentFieldGroup)); } foreach (ITisFieldTableData fldTbl in page.LinkedFieldTables) { if (grpNames.Contains(fldTbl.ParentFieldGroup.Name.ToUpper())) { continue; } grpNames.Add(fldTbl.ParentFieldGroup.Name.ToUpper()); groups.Add(new CCGroup(this.ParentCreator, fldTbl.ParentFieldGroup)); } } catch (Exception ex) { ILog.LogError(ex); } }
public CCGroup(CCreator parent, ITisFieldGroupParams group, bool createFields) #endif : base(parent, group.Name, null, null, null) { try { if (fields == null) { fields = new List <CCField>(); } else { fields.Clear(); } if (tables == null) { tables = new List <CCTable>(); } else { tables.Clear(); } this.EflowOwner = group; this.NamedParent = group.ParentForm.Name; if (createFields) { List <String> fieldNames = new List <String>(); foreach (ITisFieldParams fld in group.LinkedFields) { if (fieldNames.Contains(fld.Name.ToUpper())) { continue; } fields.Add(new CCField(this.ParentCreator, fld)); fieldNames.Add(fld.Name); } foreach (ITisFieldTableParams fldTbl in group.LinkedFieldTables) { tables.Add(new CCTable(this.ParentCreator, fldTbl)); } } } catch (Exception ex) { ILog.LogError(ex); } }
/// <summary> /// The method that fires the 'OnCollectionCreated' event /// </summary> /// <param name="cApi"></param> /// <param name="creator"></param> /// <param name="csm"></param> /// <param name="collection"></param> /// <param name="canPut"></param> protected virtual void CollectionCreated(CCTimerSearch cApi, CCreator creator, ITisClientServicesModule csm, ITisCollectionData collection, ref bool canPut) { try { if (OnCollectionCreated != null) { OnCollectionCreated(this, creator, csm, collection, ref canPut); } } catch (Exception ex) { ILog.LogError(ex); } }
public CCField(CCreator parent, ITisFieldParams field) : #endif this(parent, field != null? field.Name:String.Empty, String.Empty, 0, new TIS_RECT(), null, null, null) { this.EflowOwner = field; if (field.ParentFieldTableExists) { this.NamedParent = field.ParentFieldTable.Name; } else if (field.ParentFieldGroupExists) { this.NamedParent = field.ParentFieldGroup.Name; } }
public CCFieldArray(CCreator parent, ITisFieldParams fieldParent, bool createSubFields) #endif : this(parent, fieldParent != null? fieldParent.Name:String.Empty, new Dictionary <String, String>(), null, null) { this.EflowOwner = fieldParent; this.NamedParent = fieldParent.ParentFieldTableExists ? fieldParent.ParentFieldTable.Name : String.Empty; if (fields == null) { fields = new List <CCField>(); } else { fields.Clear(); } if (createSubFields) { fields.Add(new CCField(this.ParentCreator, fieldParent)); } }
public CCTimerSearch(ITisClientServicesModule oCSM, CCConfiguration.CCConfigurationData dataCfg) { try { CSM = oCSM; CollectionsCreator = new CCreator(); if (CSM != null) { CSM.Session.OnMessage += StationMessage; workDir = CSM.PathLocator.get_Path(CCEnums.CCFilesExt.TIF.ToString()); } //-- Initialize profile --\\ config = dataCfg.ParentConfiguration; //-- Initialize profile --\\ currentProfile = dataCfg; //-- Define collections creator settings --\\ CollectionsCreator.CurrentProfile = currentProfile; CollectionsCreator.OnCollectionCreated += CollectionCreated; if (SearchHandler == null) { SearchHandler = new CCSearchFiles(currentProfile); } SearchHandler.OnPostFileLock += PostFileLock; SearchHandler.OnPreFileLock += PreFileLock; PollingTimer.Enabled = currentProfile.SearchPaths != null && currentProfile.SearchPaths.Length > 0 && currentProfile.SearchExtensions != null && currentProfile.SearchExtensions.Length > 0; CreateEvent();//-- fire OnCreate event --\ } catch (Exception ex) { ILog.LogError(ex); } }
public CCField(CCreator parent, ITisFieldData field) : #endif this(parent, field != null? field.Name:String.Empty, field != null? field.Contents:String.Empty, field != null? field.Confidence:short.MinValue, field != null? field.FieldBoundingRect:new TIS_RECT(), parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(field) : null, parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(field, false) : null, parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(field, true) : null) { this.EflowOwner = field; this.ParentCollection = field.ParentCollection; this.ParentForm = field.ParentForm; this.ParentPage = field.ParentPage; this.ParentGroup = field.ParentFieldGroup; this.ParentFieldArray = field.ParentFieldArray; this.Index = field.TableRepetitionIndex; this.ParentTable = field.ParentFieldTable; if (field.ParentFieldArrayExists) { this.NamedParent = field.ParentFieldArray.Name; } else if (field.ParentFieldGroupExists) { this.NamedParent = field.ParentFieldGroup.Name; } }
public CCCollection(CCreator parent, String collectionName, String collectionImagePath, String collectionFlowType, String formType, int numberOfFormsAndPages) : #endif base(parent, collectionName ?? String.Empty, null, null, null) { Priority = WorkflowPriorityLevel.Normal; TargetQueue = String.Empty; LoginApplication = String.Empty; LoginStation = String.Empty; ParentCreator = parent; ImagePath = collectionImagePath; FlowType = collectionFlowType; if (numberOfFormsAndPages > 0) { if (forms == null) { forms = new List <CCForm>(); } while (forms.Count < numberOfFormsAndPages) { AddForm(formType, true); } } }
/// <summary> /// return groups data from page /// </summary> /// <param name="creator"></param> /// <param name="pageParams"></param> /// <param name="pageID"></param> /// <returns></returns> internal static CCGroup[] GroupsFromPage(CCreator creator, ITisPageParams pageParams, String pageID) { List <CCGroup> ccGrps = new List <CCGroup>(); try { List <ITisFieldGroupParams> fldGroupParams = new List <ITisFieldGroupParams>(); List <String> groupNames = new List <String>(); if (!String.IsNullOrEmpty(pageID)) { ITisEFIParams efi = pageParams.get_LinkedEFI(pageID); foreach (ITisROIParams roi in efi.ROIs) { if (roi.Miscellaneous.OrderInField <= 1) { ITisFieldParams fp = pageParams.get_LinkedField(roi.Miscellaneous.FieldName); if (fp != null) { if (fp.ParentFieldGroupExists) { if (groupNames.Contains(fp.ParentFieldGroup.Name.ToUpper())) { continue; } groupNames.Add(fp.ParentFieldGroup.Name.ToUpper()); ccGrps.Add(new CCGroup(creator, fp.ParentFieldGroup)); } else if (fp.ParentFieldTableExists) { if (groupNames.Contains(fp.ParentFieldGroup.Name.ToUpper())) { continue; } groupNames.Add(fp.ParentFieldTable.ParentFieldGroup.Name.ToUpper()); ccGrps.Add(new CCGroup(creator, fp.ParentFieldTable.ParentFieldGroup)); } } } } } else { foreach (ITisFieldParams fldParams in pageParams.LinkedFields) { if (fldParams.ParentFieldGroupExists) { if (!fldGroupParams.Contains(fldParams.ParentFieldGroup)) { fldGroupParams.Add(fldParams.ParentFieldGroup); } } else if (fldParams.ParentFieldTableExists && fldParams.ParentFieldTable.ParentFieldGroupExists) { if (!fldGroupParams.Contains(fldParams.ParentFieldTable.ParentFieldGroup)) { fldGroupParams.Add(fldParams.ParentFieldTable.ParentFieldGroup); } } } } foreach (ITisFieldGroupParams fldGrp in fldGroupParams) { ccGrps.Add(new CCGroup(creator, fldGrp)); } } catch (Exception ex) { ILog.LogError(ex); } return(ccGrps.ToArray()); }
internal CCGroup(CCreator parent, ITisFieldGroupParams group, bool createFields)
public CCGroup(CCreator parent, ITisFieldGroupParams group) #endif : this(parent, group, true) { }
internal CCGroup(CCreator parent, ITisFieldGroupParams group)
public CCGroup(CCreator parent, ITisFieldGroupData group) #endif : base(parent, group != null? group.Name:String.Empty, parent == null || !parent.CurrentProfile.IgnoreExceptions ? CCUtils.GetSpecialTags(group) : null, parent == null || !parent.CurrentProfile.IgnoreNamedUserTags ? CCUtils.GetNamedUserTags(group, false) : null, parent == null || !parent.CurrentProfile.IgnoreUserTags ? CCUtils.GetUserTags(group, true) : null) { try { if (fields == null) { fields = new List <CCField>(); } else { fields.Clear(); } if (tables == null) { tables = new List <CCTable>(); } else { tables.Clear(); } this.EflowOwner = group; this.ParentCollection = group.ParentCollection; this.ParentForm = group.ParentForm; this.NamedParent = group.ParentForm.Name; List <String> fieldNames = new List <String>(); foreach (ITisFieldData fld in group.LinkedFields) { if (fieldNames.Contains(fld.Name.ToUpper())) { continue; } if (this.ParentPage == null) { this.ParentPage = fld.ParentPage; } fields.Add(new CCField(this.ParentCreator, fld)); fieldNames.Add(fld.Name); } foreach (ITisFieldTableData fldTbl in group.LinkedFieldTables) { if (this.ParentPage == null) { this.ParentPage = fldTbl.ParentPage; } tables.Add(new CCTable(this.ParentCreator, fldTbl)); } } catch (Exception ex) { ILog.LogError(ex); } }
internal CCGroup(CCreator parent, ITisFieldGroupData group)
public CCGroup(CCreator parent, String groupName, params CCTable[] setTables) : #endif this(parent, groupName ?? String.Empty, null, setTables) { }
internal CCGroup(CCreator parent, String groupName, params CCTable[] setTables) :
public CCGroup(CCreator parent, String groupName, CCField[] setFields, params CCTable[] setTables) : #endif this(parent, groupName ?? String.Empty, setFields) { this.LinkedTables = setTables; }