C# Class SIL.FieldWorks.TE.TeSfmImporter

This subclass handles importing from a Standard Format file (includes Paratext).
Note: this runs on a background thread. It can't call any UI methods directly!
Inheritance: TeImporter
Show file Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_BTFootnoteStrBldr ITsStrBldr
m_BTPendingPictures List
m_BTfootnoteIndex int>.Dictionary
m_BookTitleParaProxy SIL.FieldWorks.TE.ImportStyleProxy
m_BtFootnoteStrBldrs List
m_CurrBTFootnote IStFootnote
m_CurrParaFootnotes List
m_CurrParaPictures List
m_DefaultAnnotationStyleProxy SIL.FieldWorks.TE.ImportStyleProxy
m_DefaultFootnoteParaProxy SIL.FieldWorks.TE.ImportStyleProxy
m_PendingAnnotations List
m_SOWrapper SIL.FieldWorks.TE.ScrObjWrapper
m_TsStringFactory ITsStrFactory
m_analTextProps ITsTextProps
m_btPendingChapterNumAdded List
m_btPendingVerseNumAdded List
m_context ContextValues
m_currDomain MarkerDomain
m_fBackTransChapterNumPending bool
m_fBackTransVerseNumPending bool
m_fChapterNumberPending bool
m_fGotFootnoteMarker bool
m_fInCharStyle bool
m_fInterpretFootnoteSettings bool
m_fStreamLinedImport bool
m_iNextBtPara int
m_importDomain ImportDomain
m_lastPara IScrTxtPara
m_nChapter int
m_notesStyleProxies ImportStyleProxy>.Dictionary
m_prevImportDomain ImportDomain
m_sCharStyleBeginMarker string
m_sCharStyleEndMarker string
m_sFootnoteBeginMarker string
m_sFootnoteEndMarker string
m_sMarker string
m_sSegmentText string
m_settings IScrImportSet
m_styleProxies ImportStyleProxy>.Dictionary
m_styleProxy SIL.FieldWorks.TE.ImportStyleProxy
m_unmappedMarkers List
m_vernParaStyleProxy SIL.FieldWorks.TE.ImportStyleProxy
m_vernTextProps ITsTextProps
m_wsCurrBtPara int
m_wsOfPrevImportStream int
m_wsPara int

Private Properties

Property Type Description
AddBTPictureCaptionsAndCopyrights void
AddBookTitleSegment void
AddBookTitleSegment void
AddNewAnnotation void
AddNewAnnotation void
AddPendingAnnotations void
AddPendingBTFootnotes void
AddPendingVerseAndChapterNumsToBackTrans void
AddSectionHeadSegment void
BtChapterNumPending bool
BtVerseNumPending bool
CheckForPendingFootnoteText void
CheckForSectionHeadInIntroMaterial void
CreateCmTranslationForPendingBT ICmTranslation
EndCharStyle void
EnsurePictureFilePathIsRooted string
FinalizeBook void
GetBTProps ITsTextProps
GetRootedPath string
GetSegmentInfo void
GetStyleProxy SIL.FieldWorks.TE.ImportStyleProxy
GetTextPropsWithWS ITsTextProps
GetWsForContext int
GetWsForImportDomain int
HandleBookTitle void
HandleFootnotes void
HandleNoteDomain void
HandleOtherParagraphStyles void
HandleSectionHead void
HandleSpecialTargets bool
HandleStartOfBook bool
HandleVerseNumbers bool
InitInterpretFootnoteSettings void
InsertSegment void
LoadImportMappingProxies void
PrepareForFirstScriptureSection void
PrepareForNextPara bool
ProcessBTEndMarker bool
ProcessBookTitleStart void
ProcessEndMarker bool
ProcessSectionHeadStart void
ProcessStartOfBook void
ProcessStartOfChapter void
ProcessVerseNumbers void
RemoveControlCharacters string
ReportBTTextNotPartOfPara void
SetBookName void
SetInCharacterStyle void
SetInFootnote void
SkipIntroMaterial bool
TrimTrailingSpace void

Public Methods

Method Description
Import ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager ) : ScrReference

This static method imports Scripture (This overload used only for testing w/o merge or overwrite dialog.)

Import ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager, TeImportUi importCallbacks, bool streamLinedImport = false ) : ScrReference

Call this static method to Import Scripture

PrevRunIsVerseNumber ( ITsStrBldr bldr ) : bool

Determine whether the previous run is Verse Number.

Protected Methods

Method Description
AddBackTranslations ( ) : void

Add any accumulated Back Translation(s) (one per WS) to the last paragraph created.

AddChapterAndVerseNumsToBackTranslations ( ) : void

Add any pending chapter number and/or the current verse number as a run to each Back Translation.

AddDropChapterNumToPara ( ITsStrBldr bldr, int ws ) : void

Inserts the pending chapter number string into the beginning of a new paragraph, in proper location as a drop-cap.

AddImportStyleProxyForMapping ( SIL.FieldWorks.FDO.Scripture.ImportMappingInfo mapping, ImportStyleProxy>.Dictionary styleProxies ) : void

Add an Import style proxy for the given mapping and include it in the hash map.

A second styleProxy is added if the mapping has an end marker.

AddTextToPara ( string sText ) : void

Add the given text (using the text props from the current proxy) as a new run to the end of the current paragraph.

AddTextToPara ( string sText, ITsTextProps pttpProps ) : void

Add the given text and props as a new run to the end of the current paragraph.

AddTextToPara ( string sText, ITsTextProps pttpProps, ITsStrBldr strbldr ) : void

Add the given text and props as a new run to the end of the specified paragraph under construction.

BeginFootnote ( ) : void

Begin a footnote: insert the footnote into the ScrBook and insert the footnote marker into the paragraph. Subsequent footnote segments will be added to the footnote paragraph until EndFootnote is called.

CheckDataForFootnoteMarker ( ) : void

Check to see if the current footnote data is a USFM style footnote or otherwise begins with a single character that is likely to be a footnote marker. If so, strip the marker from the data. If we aren't sure, then we leave the data as is but let the caller know.

Dispose ( bool disposing ) : void

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.

If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.

EndBTFootnote ( ) : void

Finalize the BT of the footnote, if any.

EndFootnote ( ) : void

When finished adding all segments of the current footnote, call this to reset builder and other state variables to resume normal segment processing and increment the footnote counter.

FinalizeImport ( ) : void

Clean-up any last paragraphs and such

FinalizePrevParagraph ( ) : void

If we have any pending text in buffers or Para builder, finish making the paragraph and add it to the database. Add it to the current title or section (make a section if we need one and don't have one). Clean up the string builder to prepare for a new paragraph.

FinalizePrevTitle ( ) : void

Finalizes the title. If is empty, a single blank paragraph is written for whatever is missing.

FindCorrespondingFootnote ( string styleId ) : IScrFootnote

Find a footnote with the specified style id

FindCorrespondingFootnote ( string styleId, int index ) : IScrFootnote

Find a footnote with the specified style id

FindCorrespondingPicture ( int index ) : ICmPicture

Find the next picture

FindCorrespondingVernParaForAnnotation ( SILUBS.SharedScrUtils.BCVRef targetRef ) : IScrTxtPara

Find a paragraph containing the specified reference.

FindCorrespondingVernParaForSegment ( IStStyle style, SILUBS.SharedScrUtils.BCVRef targetRef, bool &fAppend ) : IScrTxtPara

Find a paragraph with the specified style id, containing the specified verse number, if specified, and having the correct sequence number. Sets all appropriate state variables before returning.

GetAnnotDiscussionParaBldr ( ScrAnnotationInfo info ) : SIL.FieldWorks.FDO.Cellar.StTxtParaBldr

Gets a paragraph builder for a simple, single-paragraph Scripture annotation discussion field. This is virtual to allow subclasses to return NULL if they can't deal with this much simplicity.

GetVerseRefAsString ( int wsBt ) : string

Get the verse part of the reference (as a string) from current Scripture segment

The string returned includes any sub-verse letters, etc. that would be hard to recreate from a numeric verse number (e.g., "2-6a")

Import ( ) : void

This is the actual workhorse to Import Scripture

InitScriptureObject ( ) : void

Initialize the scripture object wrapper.

Virtual for testing override purposes.

Initialize ( ) : void

Initialize the scripture importer

InsertPicture ( ) : void

Inserts a picture, either using the current segment (USFM-style) or the pending picture in m_currPictureInfo.

LoadImportMappingProxies ( ) : void

Load mapping proxies from m_settings.

LoadScriptureProject ( ) : void

Load the scripture project and enumerator, preparing us to read the data files.

Virtual for testing override purposes.

ProcessBackTransSegment ( ) : void

Process a back translation segment (duh)

ProcessBtParaStart ( ) : void

Remember info about this paragraph so we can try to find a corresponding paragraph later.

ProcessSegment ( ) : void

Process this scripture text segment

ResetStateVariablesForNewBook ( ) : void

Resets importer state variables for the new book Need to reset a few more things than the base class.

StopImport ( ) : void

Throw an exception to end the import process.

TeSfmImporter ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager, TeImportUi importCallbacks, bool streamLinedImport = false ) : System

Initializes a new instance of the TeSfmImporter class

Private Methods

Method Description
AddBTPictureCaptionsAndCopyrights ( ) : void

Process any pending picture caption/copyright back translations.

AddBookTitleSegment ( ) : void

Add a hard line break to separate this segment from the previous one. Then insert this segment as a new run. Use this version only for vernacular Scripture.

AddBookTitleSegment ( ITsStrBldr bldr, IParaStylePropsProxy titleParaStyleProxy, ITsTextProps props ) : void

Add a hard line break to separate this segment from the previous one. Then insert this segment as a new run.

AddNewAnnotation ( ) : void

Add a new annotation to the pending list

AddNewAnnotation ( SIL.FieldWorks.TE.ImportStyleProxy paraProxy, ITsTextProps runProps ) : void

Add a new annotation to the pending list

AddPendingAnnotations ( ) : void

Add any pending annotations for the last paragraph.

AddPendingBTFootnotes ( int ws, ITsStrBldr bldr ) : void

Add footnote callers to the string builder being built for the Back Translation and add BT to the footnotes themselves.

AddPendingVerseAndChapterNumsToBackTrans ( string sVerseRef, int ws, ITsStrBldr bldr ) : void

Add any pending verse or chapter number as a run to the Back Translation for the given writing system.

AddSectionHeadSegment ( ) : void

Add a hard line break to separate this segment from the previous one. Then insert this segment as a new run.

BtChapterNumPending ( int ws ) : bool

Gets whether the chapter number is pending for the Back Translation for the given writing system.

BtVerseNumPending ( int ws ) : bool

Gets whether a verse number is pending for the Back Translation for the given writing system.

CheckForPendingFootnoteText ( ) : void

Checks for pending footnote text.

CheckForSectionHeadInIntroMaterial ( ) : void

if we are in an intro paragraph (i.e. not in scripture content) then make sure the section head has an intro section head style

CreateCmTranslationForPendingBT ( int ws, string btText, bool &fAppend ) : ICmTranslation

Creates a new CmTranslation to hold the BT in the given builder (and possibly BTs in other writing systems as well).

EndCharStyle ( ) : void

Ends the character style run.

EnsurePictureFilePathIsRooted ( string textRep ) : string

Check the text representation of a picture for a folder. If it doesn't include the folder name, then add it.

FinalizeBook ( ) : void

Finalizes the current book.

GetBTProps ( int wsBT ) : ITsTextProps

Get the correct text props to use for the current BT segment. This method returns the properties of the current proxy, doped up with the given writing system if necessary.

GetRootedPath ( string fileName ) : string

Gets the rooted path.

GetSegmentInfo ( ) : void

Get the context and paragraph text properties for this segment.

GetStyleProxy ( ) : SIL.FieldWorks.TE.ImportStyleProxy

Gets a style proxy for processing a segment

GetTextPropsWithWS ( int ws, ITsStrBldr currBldr ) : ITsTextProps

Return text props that can be used for a run of "Default Paragraph Characters" having only a WS.

GetWsForContext ( ITsStrBldr strbldr ) : int

Determine the writing system for the context. First use the WS of the para, if any (i.e., for BT paras); otherwise use the ws of the preceding segment, if any; otherwise use the default WS for the domain.

GetWsForImportDomain ( ) : int

Choose the correct default WS based on the current import domain

HandleBookTitle ( bool &fInsertSegment ) : void

Handle the start and end of book title segments

HandleFootnotes ( bool &fInsertSegment ) : void

Handle footnote processing

HandleNoteDomain ( ) : void

Process a segment in the Note (Annotation) domain. This method doesn't actually create an annotation. It just adds info about it to an array, to be added later by AddPendingAnnotations.

HandleOtherParagraphStyles ( ) : void

If this segment is any other kind of paragraph besides the special cases already handled, then finish off the previous para and prepare for this new one.

HandleSectionHead ( bool &fInsertSegment ) : void

Handle section head segments (begin or end)

HandleSpecialTargets ( ) : bool

If this segment is a special target then handle it

HandleStartOfBook ( ) : bool

Handle the start of book segments

HandleVerseNumbers ( ) : bool

See if current segment is a verse number, and if so process the verse number part of it. Also prepare to handle any text following the number (vernacular stream only).

InitInterpretFootnoteSettings ( ) : void

Initialize the m_fInterpretFootnoteSettings flag

InsertSegment ( ) : void

We've processed paragraph start and inserted specially marked text segments. Insert other marked text, from the current segment, into our paragraph (or footnote).

LoadImportMappingProxies ( ImportStyleProxy>.Dictionary styleProxies, IEnumerable mappings ) : void

Load mapping proxies from the given enumeration of mappings

PrepareForFirstScriptureSection ( ) : void

Prepares a new Scripture section section (if needed). Used when the imported data switches from book title or background information to scripture data.

PrepareForNextPara ( ) : bool

Handle a segment which may end a section head or book title. Prepare for a new paragraph by setting the m_ParaBldr.ParaStylePropsProxy and m_fInVerseTextParagraph members.

ProcessBTEndMarker ( ) : bool

Process char style or footnote end marker in a back translation

Note: This logic is similar (and probably needs to be kept in synch with) ProcessEndMarker, but we can't use that method, because the details differ.

ProcessBookTitleStart ( ) : void

Process a book title. Note: they're always a new paragraph

ProcessEndMarker ( ) : bool

Process char style or footnote end marker in the vernacular textF

Note: This logic is similar (and probably needs to be kept in synch with) ProcessBTEndMarker, but we can't use that method, because the details differ.

ProcessSectionHeadStart ( ) : void

Handle a segment which initiates a new section.

ProcessStartOfBook ( ) : void

Process segment which is the beginning of a new book.

ProcessStartOfChapter ( ) : void

Process segment which is the beginning of a new chapter

ProcessVerseNumbers ( ) : void

Process verse number segments

RemoveControlCharacters ( string sText ) : string

Remove control characters from the given string, and return the result. Tab characters are replaced by a space. Need to use this because control characters are not valid in XML unless they are quoted.

ReportBTTextNotPartOfPara ( ) : void

Throw an exception to report BT text that does not correspond to vernacular text

SetBookName ( ) : void

Set the Name property of the book if the current segment is the Main Title and the name has not already been set (i.e., by a Title Short segment).

SetInCharacterStyle ( ) : void

Sets the state for a character style run. This can be a real character style or a special target (e.g., Footnote Target Ref) that is treated as a char style.

SetInFootnote ( ) : void

Sets the state for a footnote run.

SkipIntroMaterial ( ) : bool

Determine if this segment should be skipped as part of introductory material

TrimTrailingSpace ( ITsStrBldr bldr ) : void

Trims the last character from the given string builder if it's a separator

Method Details

AddBackTranslations() protected method

Add any accumulated Back Translation(s) (one per WS) to the last paragraph created.
protected AddBackTranslations ( ) : void
return void

AddChapterAndVerseNumsToBackTranslations() protected method

Add any pending chapter number and/or the current verse number as a run to each Back Translation.
protected AddChapterAndVerseNumsToBackTranslations ( ) : void
return void

AddDropChapterNumToPara() protected method

Inserts the pending chapter number string into the beginning of a new paragraph, in proper location as a drop-cap.
protected AddDropChapterNumToPara ( ITsStrBldr bldr, int ws ) : void
bldr ITsStrBldr The string builder of the paragraph being built
ws int HVO of writing system to be used for chapter number (and /// preceding space if this is an intra-paragraph chapter number). Can be 0 to use /// vernacular or negative to get the correct WS for the context.
return void

AddImportStyleProxyForMapping() protected method

Add an Import style proxy for the given mapping and include it in the hash map.
A second styleProxy is added if the mapping has an end marker.
protected AddImportStyleProxyForMapping ( SIL.FieldWorks.FDO.Scripture.ImportMappingInfo mapping, ImportStyleProxy>.Dictionary styleProxies ) : void
mapping SIL.FieldWorks.FDO.Scripture.ImportMappingInfo The mapping for which the proxy entry is to be created
styleProxies ImportStyleProxy>.Dictionary Dictionary to add the proxy to
return void

AddTextToPara() protected method

Add the given text (using the text props from the current proxy) as a new run to the end of the current paragraph.
protected AddTextToPara ( string sText ) : void
sText string Text to be appended to the paragraph being built
return void

AddTextToPara() protected method

Add the given text and props as a new run to the end of the current paragraph.
protected AddTextToPara ( string sText, ITsTextProps pttpProps ) : void
sText string Text to be appended to the paragraph being built
pttpProps ITsTextProps Properties (should contain only a named style) for the run /// of text to be added.
return void

AddTextToPara() protected method

Add the given text and props as a new run to the end of the specified paragraph under construction.
protected AddTextToPara ( string sText, ITsTextProps pttpProps, ITsStrBldr strbldr ) : void
sText string Text to be appended to the paragraph being built
pttpProps ITsTextProps Properties (should contain only a named style) for the run /// of text to be added.
strbldr ITsStrBldr String builder of paragraph being built
return void

BeginFootnote() protected method

Begin a footnote: insert the footnote into the ScrBook and insert the footnote marker into the paragraph. Subsequent footnote segments will be added to the footnote paragraph until EndFootnote is called.
protected BeginFootnote ( ) : void
return void

CheckDataForFootnoteMarker() protected method

Check to see if the current footnote data is a USFM style footnote or otherwise begins with a single character that is likely to be a footnote marker. If so, strip the marker from the data. If we aren't sure, then we leave the data as is but let the caller know.
protected CheckDataForFootnoteMarker ( ) : void
return void

Dispose() protected method

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.
If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.
protected Dispose ( bool disposing ) : void
disposing bool
return void

EndBTFootnote() protected method

Finalize the BT of the footnote, if any.
protected EndBTFootnote ( ) : void
return void

EndFootnote() protected method

When finished adding all segments of the current footnote, call this to reset builder and other state variables to resume normal segment processing and increment the footnote counter.
protected EndFootnote ( ) : void
return void

FinalizeImport() protected method

Clean-up any last paragraphs and such
protected FinalizeImport ( ) : void
return void

FinalizePrevParagraph() protected method

If we have any pending text in buffers or Para builder, finish making the paragraph and add it to the database. Add it to the current title or section (make a section if we need one and don't have one). Clean up the string builder to prepare for a new paragraph.
protected FinalizePrevParagraph ( ) : void
return void

FinalizePrevTitle() protected method

Finalizes the title. If is empty, a single blank paragraph is written for whatever is missing.
protected FinalizePrevTitle ( ) : void
return void

FindCorrespondingFootnote() protected method

Find a footnote with the specified style id
protected FindCorrespondingFootnote ( string styleId ) : IScrFootnote
styleId string style of footnote to find
return IScrFootnote

FindCorrespondingFootnote() protected method

Find a footnote with the specified style id
protected FindCorrespondingFootnote ( string styleId, int index ) : IScrFootnote
styleId string style of footnote to find
index int Index of footnote within the current paragraph
return IScrFootnote

FindCorrespondingPicture() protected method

Find the next picture
protected FindCorrespondingPicture ( int index ) : ICmPicture
index int
return ICmPicture

FindCorrespondingVernParaForAnnotation() protected method

Find a paragraph containing the specified reference.
protected FindCorrespondingVernParaForAnnotation ( SILUBS.SharedScrUtils.BCVRef targetRef ) : IScrTxtPara
targetRef SILUBS.SharedScrUtils.BCVRef Reference to seek
return IScrTxtPara

FindCorrespondingVernParaForSegment() protected method

Find a paragraph with the specified style id, containing the specified verse number, if specified, and having the correct sequence number. Sets all appropriate state variables before returning.
protected FindCorrespondingVernParaForSegment ( IStStyle style, SILUBS.SharedScrUtils.BCVRef targetRef, bool &fAppend ) : IScrTxtPara
style IStStyle style of paragraph to find. If the style is null, then /// disregard the style of the paragraph. Just get first paragraph with the given /// reference.
targetRef SILUBS.SharedScrUtils.BCVRef Reference to seek
fAppend bool Indicates to caller that the found paragraph already has /// been used previously, so new (BT) text should be appended to the existing back /// translation (with a hard line break separating the two parts). This is needed to /// support special logic we do in section headers when two paragraphs with the same /// style are imported in succession.
return IScrTxtPara

GetAnnotDiscussionParaBldr() protected method

Gets a paragraph builder for a simple, single-paragraph Scripture annotation discussion field. This is virtual to allow subclasses to return NULL if they can't deal with this much simplicity.
protected GetAnnotDiscussionParaBldr ( ScrAnnotationInfo info ) : SIL.FieldWorks.FDO.Cellar.StTxtParaBldr
info ScrAnnotationInfo The information about a annotation being imported.
return SIL.FieldWorks.FDO.Cellar.StTxtParaBldr

GetVerseRefAsString() protected method

Get the verse part of the reference (as a string) from current Scripture segment
The string returned includes any sub-verse letters, etc. that would be hard to recreate from a numeric verse number (e.g., "2-6a")
protected GetVerseRefAsString ( int wsBt ) : string
wsBt int Writing system of the back translation for which this reference /// is being formatted or 0 if for the vernacular text.
return string

Import() public static method

This static method imports Scripture (This overload used only for testing w/o merge or overwrite dialog.)
public static Import ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager ) : ScrReference
settings IScrImportSet Import settings object (filled in by wizard)
cache SIL.FieldWorks.FDO.FdoCache The cache used to import to and get misc. info. from.
styleSheet FwStyleSheet Stylesheet from which to get scripture styles.
undoManager SIL.FieldWorks.TE.UndoImportManager The undo import manager (which is responsible for creating /// and maintaining the archive of original books being overwritten and maintaining /// the book filter).
return ScrReference

Import() public static method

Call this static method to Import Scripture
public static Import ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager, TeImportUi importCallbacks, bool streamLinedImport = false ) : ScrReference
settings IScrImportSet Import settings object (filled in by wizard)
cache SIL.FieldWorks.FDO.FdoCache The cache used to import to and get misc. info. from.
styleSheet FwStyleSheet Stylesheet from which to get scripture styles.
undoManager SIL.FieldWorks.TE.UndoImportManager The undo import manager (which is responsible for creating /// and maintaining the archive of original books being overwritten and maintaining /// the book filter).
importCallbacks TeImportUi UI callbacks
streamLinedImport bool flag indicated if import id done through FLEx.
return ScrReference

Import() protected method

This is the actual workhorse to Import Scripture
protected Import ( ) : void
return void

InitScriptureObject() protected method

Initialize the scripture object wrapper.
Virtual for testing override purposes.
protected InitScriptureObject ( ) : void
return void

Initialize() protected method

Initialize the scripture importer
protected Initialize ( ) : void
return void

InsertPicture() protected method

Inserts a picture, either using the current segment (USFM-style) or the pending picture in m_currPictureInfo.
protected InsertPicture ( ) : void
return void

LoadImportMappingProxies() protected method

Load mapping proxies from m_settings.
protected LoadImportMappingProxies ( ) : void
return void

LoadScriptureProject() protected method

Load the scripture project and enumerator, preparing us to read the data files.
Virtual for testing override purposes.
protected LoadScriptureProject ( ) : void
return void

PrevRunIsVerseNumber() public method

Determine whether the previous run is Verse Number.
public PrevRunIsVerseNumber ( ITsStrBldr bldr ) : bool
bldr ITsStrBldr string builder
return bool

ProcessBackTransSegment() protected method

Process a back translation segment (duh)
protected ProcessBackTransSegment ( ) : void
return void

ProcessBtParaStart() protected method

Remember info about this paragraph so we can try to find a corresponding paragraph later.
protected ProcessBtParaStart ( ) : void
return void

ProcessSegment() protected method

Process this scripture text segment
protected ProcessSegment ( ) : void
return void

ResetStateVariablesForNewBook() protected method

Resets importer state variables for the new book Need to reset a few more things than the base class.
protected ResetStateVariablesForNewBook ( ) : void
return void

StopImport() protected method

Throw an exception to end the import process.
If not skipping the current book; this will cause /// the import to roll back the current book, leaving the last whole book (if any) /// imported.
protected StopImport ( ) : void
return void

TeSfmImporter() protected method

Initializes a new instance of the TeSfmImporter class
protected TeSfmImporter ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager, TeImportUi importCallbacks, bool streamLinedImport = false ) : System
settings IScrImportSet Import settings object (filled in by wizard)
cache SIL.FieldWorks.FDO.FdoCache The cache used to import to and get misc. info. from.
styleSheet FwStyleSheet Stylesheet from which to get scripture styles.
undoManager SIL.FieldWorks.TE.UndoImportManager The undo import manager(which is responsible for creating /// and maintainging the archive of original books being overwritten).
importCallbacks TeImportUi UI callbacks
streamLinedImport bool flag indicating if import is done through FLEx.
return System

Property Details

m_BTFootnoteStrBldr protected property

String builder for creating back translations of footnotes
protected ITsStrBldr m_BTFootnoteStrBldr
return ITsStrBldr

m_BTPendingPictures protected property

List of accumulated picture caption back translations for the current paragraph
protected List m_BTPendingPictures
return List

m_BTfootnoteIndex protected property

Dictionary of indexes to the current footnote in the back translation(s) (one entry for each WS).
protected Dictionary m_BTfootnoteIndex
return int>.Dictionary

m_BookTitleParaProxy protected property

Book Title paragraph style proxy
protected ImportStyleProxy,SIL.FieldWorks.TE m_BookTitleParaProxy
return SIL.FieldWorks.TE.ImportStyleProxy

m_BtFootnoteStrBldrs protected property

Collection of BtFootnoteBldrInfo thingies for Back Translation footnotes. Used only for non-interleaved Back Translations.
protected List m_BtFootnoteStrBldrs
return List

m_CurrBTFootnote protected property

Footnote whose BT is currently being imported. Null whenever a footnote BT is not being imported. Used only for interleaved Back Translations.
protected IStFootnote m_CurrBTFootnote
return IStFootnote

m_CurrParaFootnotes protected property

List of footnotes in current paragraph
protected List m_CurrParaFootnotes
return List

m_CurrParaPictures protected property

List of pictures in current paragraph in the vernacular
protected List m_CurrParaPictures
return List

m_DefaultAnnotationStyleProxy protected property

Default Annotation style proxy
protected ImportStyleProxy,SIL.FieldWorks.TE m_DefaultAnnotationStyleProxy
return SIL.FieldWorks.TE.ImportStyleProxy

m_DefaultFootnoteParaProxy protected property

Default Footnote paragraph style proxy
protected ImportStyleProxy,SIL.FieldWorks.TE m_DefaultFootnoteParaProxy
return SIL.FieldWorks.TE.ImportStyleProxy

m_PendingAnnotations protected property

Collection of ScrAnnotationInfo objects with information about imported notes that are waiting to be merged.
protected List m_PendingAnnotations
return List

m_SOWrapper protected property

Wrapper object for TE, Paratext scripture objects. Normally use the SOWrapper property to access this.
protected ScrObjWrapper,SIL.FieldWorks.TE m_SOWrapper
return SIL.FieldWorks.TE.ScrObjWrapper

m_TsStringFactory protected property

Factory for creating TsStrings.
protected ITsStrFactory m_TsStringFactory
return ITsStrFactory

m_analTextProps protected property

Analysis Text Properties.
protected ITsTextProps m_analTextProps
return ITsTextProps

m_btPendingChapterNumAdded protected property

List of BTs which have already had the "pending" chapter number added. This is cleared every time m_fBackTransChapterNumPending is set to true.
protected List m_btPendingChapterNumAdded
return List

m_btPendingVerseNumAdded protected property

List of BTs which have already had the "pending" verse number added. This is cleared every time m_fBackTransVerseNumPending is set to true.
protected List m_btPendingVerseNumAdded
return List

m_context protected property

The context of the current segment
protected ContextValues m_context
return ContextValues

m_currDomain protected property

The current domain (unchanged by in-line markers)
protected MarkerDomain m_currDomain
return MarkerDomain

m_fBackTransChapterNumPending protected property

True if chapter number is ready to be inserted into the back translation(s).
protected bool m_fBackTransChapterNumPending
return bool

m_fBackTransVerseNumPending protected property

True if verse number is ready to be inserted into the back translation(s).
protected bool m_fBackTransVerseNumPending
return bool

m_fChapterNumberPending protected property

True if chapter number is ready to be inserted at a proper location.
protected bool m_fChapterNumberPending
return bool

m_fGotFootnoteMarker protected property

If processing a footnote, this tells whether we've hit a Note Marker segment
protected bool m_fGotFootnoteMarker
return bool

m_fInCharStyle protected property

In a char style with an end marker
protected bool m_fInCharStyle
return bool

m_fInterpretFootnoteSettings protected property

If true, this member indicates that when we encounter a footnote, we should attempt to interpret it as a USFM-style footnote and set the database settings accordingly.
protected bool m_fInterpretFootnoteSettings
return bool

m_fStreamLinedImport protected property

flag that indicates import is being done through FLEx and some special processing may need to be done.
protected bool m_fStreamLinedImport
return bool

m_iNextBtPara protected property

Index of next BT paragraph to locate (0-based).
protected int m_iNextBtPara
return int

m_importDomain protected property

Domain of the current import stream. Main for the primary Scripture stream or if the BT and/or notes segment is being imported interleaved with the vernacular data stream.
protected ImportDomain m_importDomain
return ImportDomain

m_lastPara protected property

The last paragraph that was created
protected IScrTxtPara m_lastPara
return IScrTxtPara

m_nChapter protected property

Current chapter number, based on actual text in incoming data
protected int m_nChapter
return int

m_notesStyleProxies protected property

Dictionary of string (import marker/tag) to import style proxy used for Annotations domain. For end markers, the key is EndMarker\UFFFBeginMarker.
protected Dictionary m_notesStyleProxies
return ImportStyleProxy>.Dictionary

m_prevImportDomain protected property

The domain of the import stream of the previous marker.
protected ImportDomain m_prevImportDomain
return ImportDomain

m_sCharStyleBeginMarker protected property

The begin marker used to open the current character style (if any).
protected string m_sCharStyleBeginMarker
return string

m_sCharStyleEndMarker protected property

End marker for current character style
protected string m_sCharStyleEndMarker
return string

m_sFootnoteBeginMarker protected property

The begin marker used to open the current footnote (if any).
protected string m_sFootnoteBeginMarker
return string

m_sFootnoteEndMarker protected property

End marker for current footnote
protected string m_sFootnoteEndMarker
return string

m_sMarker protected property

The marker of the tag (includes backslash).
protected string m_sMarker
return string

m_sSegmentText protected property

Text contents of the current segment.
protected string m_sSegmentText
return string

m_settings protected property

Settings object that represent the Paratext or SF settings for importing
protected IScrImportSet m_settings
return IScrImportSet

m_styleProxies protected property

Dictionary of string (import marker/tag) to import style proxy. For end markers, the key is EndMarker\UFFFBeginMarker.
protected Dictionary m_styleProxies
return ImportStyleProxy>.Dictionary

m_styleProxy protected property

The style proxy to be used for the processing of current segment
protected ImportStyleProxy,SIL.FieldWorks.TE m_styleProxy
return SIL.FieldWorks.TE.ImportStyleProxy

m_unmappedMarkers protected property

List of markers that we encounter during import that did not have mappings (currently we create mappings on the fly, but if the fly complains too much we might change that)
protected List m_unmappedMarkers
return List

m_vernParaStyleProxy protected property

The style proxy used for processing previous paragraph segment
protected ImportStyleProxy,SIL.FieldWorks.TE m_vernParaStyleProxy
return SIL.FieldWorks.TE.ImportStyleProxy

m_vernTextProps protected property

Vernacular Text Properties.
protected ITsTextProps m_vernTextProps
return ITsTextProps

m_wsCurrBtPara protected property

The writing system of the current back trans para being processed -- needed to be able to stick BT character runs into the proper BT para
protected int m_wsCurrBtPara
return int

m_wsOfPrevImportStream protected property

The HVO of the writing system of the import stream of the previous marker.
protected int m_wsOfPrevImportStream
return int

m_wsPara protected property

The writing system used by the current paragraph segment.
protected int m_wsPara
return int