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, |
Call this static method to Import Scripture
|
|
PrevRunIsVerseNumber ( ITsStrBldr bldr ) : bool |
Determine whether the previous run is Verse Number.
|
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 |
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, |
Initializes a new instance of the TeSfmImporter class
|
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 |
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
|
protected AddChapterAndVerseNumsToBackTranslations ( ) : void | ||
return | void |
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 |
protected AddImportStyleProxyForMapping ( SIL.FieldWorks.FDO.Scripture.ImportMappingInfo mapping, ImportStyleProxy>.Dictionary |
||
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 |
protected AddTextToPara ( string sText ) : void | ||
sText | string | Text to be appended to the paragraph being built |
return | void |
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 |
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 |
protected CheckDataForFootnoteMarker ( ) : void | ||
return | void |
protected FindCorrespondingFootnote ( string styleId ) : IScrFootnote | ||
styleId | string | style of footnote to find |
return | IScrFootnote |
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 |
protected FindCorrespondingPicture ( int index ) : ICmPicture | ||
index | int | |
return | ICmPicture |
protected FindCorrespondingVernParaForAnnotation ( SILUBS.SharedScrUtils.BCVRef targetRef ) : IScrTxtPara | ||
targetRef | SILUBS.SharedScrUtils.BCVRef | Reference to seek |
return | IScrTxtPara |
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 |
protected GetAnnotDiscussionParaBldr ( ScrAnnotationInfo info ) : SIL.FieldWorks.FDO.Cellar.StTxtParaBldr | ||
info | ScrAnnotationInfo | The information about a annotation being imported. |
return | SIL.FieldWorks.FDO.Cellar.StTxtParaBldr |
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 |
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 |
public static Import ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager, |
||
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 | UI callbacks | |
streamLinedImport | bool | flag indicated if import id done through FLEx. |
return | ScrReference |
protected LoadImportMappingProxies ( ) : void | ||
return | void |
public PrevRunIsVerseNumber ( ITsStrBldr bldr ) : bool | ||
bldr | ITsStrBldr | string builder |
return | bool |
protected ResetStateVariablesForNewBook ( ) : void | ||
return | void |
protected TeSfmImporter ( IScrImportSet settings, SIL.FieldWorks.FDO.FdoCache cache, FwStyleSheet styleSheet, SIL.FieldWorks.TE.UndoImportManager undoManager, |
||
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 | UI callbacks | |
streamLinedImport | bool | flag indicating if import is done through FLEx. |
return | System |
protected ImportStyleProxy,SIL.FieldWorks.TE m_BookTitleParaProxy | ||
return | SIL.FieldWorks.TE.ImportStyleProxy |
protected ImportStyleProxy,SIL.FieldWorks.TE m_DefaultAnnotationStyleProxy | ||
return | SIL.FieldWorks.TE.ImportStyleProxy |
protected ImportStyleProxy,SIL.FieldWorks.TE m_DefaultFootnoteParaProxy | ||
return | SIL.FieldWorks.TE.ImportStyleProxy |
protected ScrObjWrapper,SIL.FieldWorks.TE m_SOWrapper | ||
return | SIL.FieldWorks.TE.ScrObjWrapper |
protected bool m_fBackTransChapterNumPending | ||
return | bool |
protected bool m_fBackTransVerseNumPending | ||
return | bool |
protected bool m_fInterpretFootnoteSettings | ||
return | bool |
protected Dictionary |
||
return | ImportStyleProxy>.Dictionary |
protected Dictionary |
||
return | ImportStyleProxy>.Dictionary |
protected ImportStyleProxy,SIL.FieldWorks.TE m_styleProxy | ||
return | SIL.FieldWorks.TE.ImportStyleProxy |
protected ImportStyleProxy,SIL.FieldWorks.TE m_vernParaStyleProxy | ||
return | SIL.FieldWorks.TE.ImportStyleProxy |