C# (CSharp) Bloom.WebLibraryIntegration Namespace

Classes

Name Description
AccessKeys This class is responsible for the key bits of information that are needed to access our backend sites. These keys are not very secret and could easily be found, for example, by packet snooping. However, we want to keep them out of source code where someone might be able to do a google search and easily find our keys and use our storage. The keys are currently stored in a file called connections.dll. The installer must place a version of this in the EXE directory. Developers get it automatically, along with other dependencies. You can see what keys are stored in what order by checking the constructor. That will work for Parse.com, where we currently have different API keys for the sandbox. For the S3 data, we currently just use different buckets. If we wanted to, we could put the 'real data' bucket name here also, and put the appropriate one into the testing version of connections.dll. Todo: Some of the real keys are still in our version control history. Before we go live, we may want to change the keys so any keys discovered in our version control are obsolete.
BloomLinkArgs This class represents an instance of a hyperlink which, when activated, causes a bloom book to be downloaded and opened. Such a link looks like bloom://localhost/order?orderFile={path}, where path is appropriate urlencoded. Optionally, it may be followed by &title={title}, where title is the book title (urlencoded). To allow Bloom to be automatically started when such a link is activated requires some registry entries: The key HKEY_CLASSES_ROOT\bloom\shell\open\command must contain as its default value a string which is the path to Bloom.exe in quotes, followed by " %1". For example, "C:\palaso\bloom-desktop\Output\Debug\Bloom.exe" "%1" In addition, the HKEY_CLASSES_ROOT\bloom key must have a default value of "URL:BLOOM Protocol" and another string value called "URL Protocol" (no value). (Don't ask me why...Alistair may know.) One way to set these up on a developer machine is to edit the file bloom link.reg in the project root directory so that it contains the correct path to your exe, then double-click it. When a properly-formed link is followed, a new instance of Bloom is started up and passed the URL as its one command-line argument. This is recognized and handled in Program.Main(). Todo: Make installer set up the registry entries. Todo Linux: probably something quite different needs to be done to make Bloom the handler for bloom:// URLs.
BloomParseClient
BloomS3Client Handles Bloom file/folder operations on Amazon Web Services S3 service.
BookDownloadSupport BookDownloadSupport is used by program.cs at startup to make sure we are ready for download requests from the web. (It had a larger role at one point, but things have been simplified.)
BookDownloadedEventArgs Class for event args of BookTransfer.BookDownloaded
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.
ConsoleProgress
LoginDialog this class manages a the login process for Bloom, including signing up for new accounts. (This is a bit clumsy, but makes it easy to switch to login if the user enters a known address, or switch to signup if the user tries to log in with an unknown email. It also saves passing another object around.) Much of this logic unfortunately is or will be duplicated in the web site itself. We may at some point consider embedding a part of the web site itself in a Gecko window instead for login; but in the current state of my (JohnT's) knowledge, it was easier to do a plain C# version.
OverwriteWarningDialog
ProblemBookUploader this differs from Book Transfer in that it knows nothing of Parse or the Bloom Library. It simply knows how to push a zip to an s3 bucket and give hopefully helpful error messages. It is used for sending us problem books
ProgressDialogWrapper
ProxyManager Helper class that reads the proxy settings from environment variable http_proxy or HTTP_PROXY and provides the information for the Amazon S3Client.