C# 클래스 Bloom.Book.BookStorage

상속: IBookStorage
파일 보기 프로젝트 열기: BloomBooks/BloomDesktop 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AssertIsAlreadyInitialized void
AttemptToReplaceMissingImage bool
EnsureDoesntHaveLinkToStyleSheet void
EnsureHasLinkToStyleSheet void
EnsureHasLinksToStylesheets void
ExpensiveInitialization void
GetBaseForRelativePaths string
GetImagePathsRelativeToBook List
GetNameForATempFileInStorageFolder string
GetNormalizedPathForOS string
GetUniqueFolderName string
GetUniqueFolderPath string
IsPathReadonly bool
MakeCssLinksAppropriateForStoredFile void
ProcessAccessDeniedError void
RemoveDangerousCharacters string
SanitizeNameForFileSystem string
Update void
UpdateSupportFiles void
ValidateBook string

공개 메소드들

메소드 설명
BookStorage ( string folderPath, SIL baseFileLocator, BookRenamedEvent bookRenamedEvent, CollectionSettings collectionSettings ) : System
CheckBook ( IProgress progress, string pathToFolderOfReplacementImages = null ) : void

The image-replacement feature is perhaps a one-off for a project where an advisor replaced the folders with a version that lacked most of the images (perhaps because dropbox copies small files first and didn't complete the sync)

CleanupUnusedImageFiles ( ) : void

Compare the images we find in the top level of the book folder to those referenced in the dom, and remove any unreferenced on

FindBookHtmlInFolder ( string folderPath ) : string
GetBrokenBookRecommendationHtml ( ) : string
GetFileLocator ( ) : IFileLocator

this is a method because it wasn't clear if we will eventually generate it on the fly (book paths do change as they are renamed)

GetHtmlMessageIfVersionIsIncompatibleWithThisBloom ( HtmlDom dom, string path ) : string
GetLooksOk ( ) : bool
GetRelocatableCopyOfDom ( IProgress log ) : HtmlDom

creates a relocatable copy of our main HtmlDom

GetValidateErrors ( ) : string
HandleRetiredXMatterPacks ( HtmlDom dom, string nameOfXMatterPack ) : string
MakeDomRelocatable ( HtmlDom dom, IProgress log = null ) : HtmlDom

this one works on the dom passed to it

RemoveBookThumbnail ( string fileName ) : bool

Save ( ) : void
SaveHtml ( HtmlDom dom ) : string
SetBaseForRelativePaths ( HtmlDom dom, string folderPath ) : void
SetBookName ( string name ) : void
TryGetPremadeThumbnail ( string fileName, Image &image ) : bool
UpdateBookFileAndFolderName ( CollectionSettings collectionSettings ) : void
ValidateBook ( string path ) : string

보호된 메소드들

메소드 설명
OnFolderPathChanged ( ) : void

비공개 메소드들

메소드 설명
AssertIsAlreadyInitialized ( ) : void
AttemptToReplaceMissingImage ( string missingFile, string pathToFolderOfReplacementImages, IProgress progress ) : bool
EnsureDoesntHaveLinkToStyleSheet ( HtmlDom dom, string path ) : void
EnsureHasLinkToStyleSheet ( HtmlDom dom, string path ) : void
EnsureHasLinksToStylesheets ( HtmlDom dom ) : void
ExpensiveInitialization ( ) : void

Do whatever is needed to do more than just show a title and thumbnail

GetBaseForRelativePaths ( string folderPath ) : string
GetImagePathsRelativeToBook ( XmlElement element ) : List

Return the paths, relative to the book folder, of all the images referred to in the element.

GetNameForATempFileInStorageFolder ( ) : string

Get a temporary file pathname in the current book's folder. This is needed to ensure proper permissions are granted to the resulting file later after FileUtils.ReplaceFileWithUserInteractionIfNeeded is called. That method may call File.Replace which replaces both the file content and the file metadata (permissions). The result of that if we use the user's temp directory is described in http://issues.bloomlibrary.org/youtrack/issue/BL-3954.

GetNormalizedPathForOS ( string path ) : string
GetUniqueFolderName ( string parentPath, string name ) : string

if necessary, append a number to make the subfolder name unique within the given folder

GetUniqueFolderPath ( string folderPath ) : string

if necessary, append a number to make the folder path unique

IsPathReadonly ( string path ) : bool
MakeCssLinksAppropriateForStoredFile ( HtmlDom dom ) : void

/// Creates a relative path from one file or folder to another. ///

ProcessAccessDeniedError ( UnauthorizedAccessException error ) : void
RemoveDangerousCharacters ( string name ) : string
SanitizeNameForFileSystem ( string name ) : string
Update ( string fileName, string factoryPath = "" ) : void
UpdateSupportFiles ( ) : void

we update these so that the file continues to look the same when you just open it in firefox

ValidateBook ( HtmlDom dom, string path ) : string

메소드 상세

BookStorage() 공개 메소드

public BookStorage ( string folderPath, SIL baseFileLocator, BookRenamedEvent bookRenamedEvent, CollectionSettings collectionSettings ) : System
folderPath string
baseFileLocator SIL
bookRenamedEvent BookRenamedEvent
collectionSettings Bloom.Collection.CollectionSettings
리턴 System

CheckBook() 공개 메소드

The image-replacement feature is perhaps a one-off for a project where an advisor replaced the folders with a version that lacked most of the images (perhaps because dropbox copies small files first and didn't complete the sync)
public CheckBook ( IProgress progress, string pathToFolderOfReplacementImages = null ) : void
progress IProgress
pathToFolderOfReplacementImages string We'll find any matches in the entire folder, regardless of sub-folder name
리턴 void

CleanupUnusedImageFiles() 공개 메소드

Compare the images we find in the top level of the book folder to those referenced in the dom, and remove any unreferenced on
public CleanupUnusedImageFiles ( ) : void
리턴 void

FindBookHtmlInFolder() 공개 정적인 메소드

public static FindBookHtmlInFolder ( string folderPath ) : string
folderPath string
리턴 string

GetBrokenBookRecommendationHtml() 공개 메소드

public GetBrokenBookRecommendationHtml ( ) : string
리턴 string

GetFileLocator() 공개 메소드

this is a method because it wasn't clear if we will eventually generate it on the fly (book paths do change as they are renamed)
public GetFileLocator ( ) : IFileLocator
리턴 IFileLocator

GetHtmlMessageIfVersionIsIncompatibleWithThisBloom() 공개 정적인 메소드

public static GetHtmlMessageIfVersionIsIncompatibleWithThisBloom ( HtmlDom dom, string path ) : string
dom HtmlDom
path string
리턴 string

GetLooksOk() 공개 메소드

public GetLooksOk ( ) : bool
리턴 bool

GetRelocatableCopyOfDom() 공개 메소드

creates a relocatable copy of our main HtmlDom
public GetRelocatableCopyOfDom ( IProgress log ) : HtmlDom
log IProgress
리턴 HtmlDom

GetValidateErrors() 공개 메소드

public GetValidateErrors ( ) : string
리턴 string

HandleRetiredXMatterPacks() 공개 메소드

public HandleRetiredXMatterPacks ( HtmlDom dom, string nameOfXMatterPack ) : string
dom HtmlDom
nameOfXMatterPack string
리턴 string

MakeDomRelocatable() 공개 메소드

this one works on the dom passed to it
public MakeDomRelocatable ( HtmlDom dom, IProgress log = null ) : HtmlDom
dom HtmlDom
log IProgress
리턴 HtmlDom

OnFolderPathChanged() 보호된 메소드

protected OnFolderPathChanged ( ) : void
리턴 void

RemoveBookThumbnail() 공개 메소드

public RemoveBookThumbnail ( string fileName ) : bool
fileName string
리턴 bool

Save() 공개 메소드

public Save ( ) : void
리턴 void

SaveHtml() 공개 메소드

public SaveHtml ( HtmlDom dom ) : string
dom HtmlDom
리턴 string

SetBaseForRelativePaths() 공개 정적인 메소드

public static SetBaseForRelativePaths ( HtmlDom dom, string folderPath ) : void
dom HtmlDom
folderPath string
리턴 void

SetBookName() 공개 메소드

public SetBookName ( string name ) : void
name string
리턴 void

TryGetPremadeThumbnail() 공개 메소드

public TryGetPremadeThumbnail ( string fileName, Image &image ) : bool
fileName string
image Image
리턴 bool

UpdateBookFileAndFolderName() 공개 메소드

public UpdateBookFileAndFolderName ( CollectionSettings collectionSettings ) : void
collectionSettings Bloom.Collection.CollectionSettings
리턴 void

ValidateBook() 공개 정적인 메소드

public static ValidateBook ( string path ) : string
path string
리턴 string