C# 클래스 Bloom.WebLibraryIntegration.BookTransfer

Currently pushes a book's metadata to Parse.com (a mongodb service) and files to Amazon S3. We are using both because Parse offers a more structured, query-able data organization that is useful for metadata, but does not allow large enough files for some of what we need.
파일 보기 프로젝트 열기: BloomBooks/BloomDesktop 1 사용 예제들

Private Properties

프로퍼티 타입 설명
BackgroundUpload void
DisplayNetworkUploadProblem void
DisplayProblem void
DownloadBook string
FullUpload string
GetUrlAndTitle void
HandleBloomBookOrder void
HandleBookOrder void
HandleDownloadWithoutProgress string
IsThisVersionAllowedToUpload bool
IsUrlOrder bool
MetaDataText string
OnDoDownload void
S3BookId string
UploadInternal void
UploadPdfPath string
WaitUntilS3DataIsOnServer void

공개 메소드들

메소드 설명
BookTransfer ( BloomParseClient bloomParseClient, BloomS3Client bloomS3Client, BookThumbNailer htmlThumbnailer, BookDownloadStartingEvent bookDownloadStartingEvent ) : System
DownloadFromOrderUrl ( string orderUrl, string destPath, string title = "unknown" ) : string

Download a book

HandleBookOrder ( string bookOrderPath, string projectPath ) : void
IsBookOnServer ( string bookPath ) : bool
LogIn ( string account, string password ) : bool
Logout ( ) : void
UploadBook ( string bookFolder, IProgress progress ) : string
UploadBook ( string bookFolder, IProgress progress, string &parseId, string pdfToInclude = null ) : string
UploadFolder ( string folder, ApplicationContainer container ) : void

Upload bloom books in the specified folder to the bloom library. Folders that contain exactly one .htm file are interpreted as books and uploaded. Other folders are searched recursively for children that appear to be bloom books. The parent folder of a bloom book is searched for a .bloomContainer file and, if one is found, the book is treated as part of that collection (e.g., for determining vernacular language). If no collection is found there it uses whatever collection was last open, or the current default.

비공개 메소드들

메소드 설명
BackgroundUpload ( object sender, DoWorkEventArgs doWorkEventArgs ) : void

Worker function for a background thread task. See first lines for required args passed to RunWorkerAsync, which triggers this.

DisplayNetworkUploadProblem ( Exception e, IProgress progress ) : void
DisplayProblem ( Exception e, string message ) : void
DownloadBook ( string bucket, string s3BookId, string dest ) : string

Internal for testing because it's not yet clear this is the appropriate public routine. Probably some API gets a list of BloomInfo objects from the parse.com data, and we pass one of them as the argument for the public method.

FullUpload ( Book book, SIL.Windows.Forms.Progress.LogBox progressBox, PublishView publishView, string languages, string &parseId, Form invokeTarget = null ) : string

Common routine used in normal upload and bulk upload.

GetUrlAndTitle ( string bucket, string s3orderKey, string &url, string &title ) : void
HandleBloomBookOrder ( string order ) : void
HandleBookOrder ( string bookOrderPath ) : void
HandleDownloadWithoutProgress ( string url, string destRoot ) : string

url is typically something like https://s3.amazonaws.com/BloomLibraryBooks/[email protected]/0a2745dd-ca98-47ea-8ba4-2cabc67022e It is harmless if there are more elements in it (e.g. address to a particular file in the folder) Note: if you copy the url from part of the link to a file in the folder from AWS, you typically need to change %40 to @ in the uploader's email.

IsThisVersionAllowedToUpload ( ) : bool
IsUrlOrder ( string argument ) : bool
MetaDataText ( string bookFolder ) : string
OnDoDownload ( object sender, DoWorkEventArgs args ) : void

this runs in a worker thread

S3BookId ( BookMetaData metadata ) : string
UploadInternal ( string folder, BulkUploadProgressDlg dlg, ApplicationContainer container, ProjectContext &context ) : void

Handles the recursion through directories: if a folder looks like a Bloom book upload it; otherwise, try its children. Invisible folders like .hg are ignored.

UploadPdfPath ( string bookFolder ) : string
WaitUntilS3DataIsOnServer ( string bucket, string bookPath ) : void

메소드 상세

BookTransfer() 공개 메소드

public BookTransfer ( BloomParseClient bloomParseClient, BloomS3Client bloomS3Client, BookThumbNailer htmlThumbnailer, BookDownloadStartingEvent bookDownloadStartingEvent ) : System
bloomParseClient BloomParseClient
bloomS3Client BloomS3Client
htmlThumbnailer BookThumbNailer
bookDownloadStartingEvent BookDownloadStartingEvent
리턴 System

DownloadFromOrderUrl() 공개 메소드

Download a book
public DownloadFromOrderUrl ( string orderUrl, string destPath, string title = "unknown" ) : string
orderUrl string bloom://localhost/order?orderFile=BloomLibraryBooks-UnitTests/[email protected]/a211f07b-2c9f-4b97-b0b1-71eb24fdbed79887cda9_bb1d_4422_aa07_bc8c19285ca9/My Url Book/My Url Book.BloomBookOrder
destPath string
title string
리턴 string

HandleBookOrder() 공개 메소드

public HandleBookOrder ( string bookOrderPath, string projectPath ) : void
bookOrderPath string
projectPath string
리턴 void

IsBookOnServer() 공개 메소드

public IsBookOnServer ( string bookPath ) : bool
bookPath string
리턴 bool

LogIn() 공개 메소드

public LogIn ( string account, string password ) : bool
account string
password string
리턴 bool

Logout() 공개 메소드

public Logout ( ) : void
리턴 void

UploadBook() 공개 메소드

public UploadBook ( string bookFolder, IProgress progress ) : string
bookFolder string
progress IProgress
리턴 string

UploadBook() 공개 메소드

public UploadBook ( string bookFolder, IProgress progress, string &parseId, string pdfToInclude = null ) : string
bookFolder string
progress IProgress
parseId string
pdfToInclude string
리턴 string

UploadFolder() 공개 메소드

Upload bloom books in the specified folder to the bloom library. Folders that contain exactly one .htm file are interpreted as books and uploaded. Other folders are searched recursively for children that appear to be bloom books. The parent folder of a bloom book is searched for a .bloomContainer file and, if one is found, the book is treated as part of that collection (e.g., for determining vernacular language). If no collection is found there it uses whatever collection was last open, or the current default.
public UploadFolder ( string folder, ApplicationContainer container ) : void
folder string
container ApplicationContainer
리턴 void