An eBag weblibrary is an organized catalogue of web resources (links) that eBag is able to download from the Internet and open in a single click. You can feed your eBag installation with any number of different libraries. If you want to build a brand new library (in order to use it in your own flights and/or share it with the world) you are in the right place.
eBag reads its weblibraries from the /Resources/plugins/eBag/weblib subfolder.
Each weblibrary is defined by a single .json file, which is a text file, named with extension .json. Its content must follow the json syntax rules: for more detailed information see here. Anyway, you don't need to be an IT specialist to write one, just follow the following very basic tutorial.
For complex libraries, using a json editor software will make life easier. A good tool (online) is jsoneditoronline.org
We want to build a very simple library: a library with one single resource: the Jeppesen charts examples PDF file. First of all, create a new text file named My First Library.json inside your /Resources/plugins/eBag/weblib folder. You can call it whatever you like, just be sure to put the .json extension at the end of the filename. In order to be able to manage file extensions, you might need to deactivate the default windows behaviour: hide extensions for known file types, depending on your operating system configurations.
Done ? Great! Now let's put some simple content into that file.
For now don't bother about all the syntactical details (brackets, quotes, ...).
Just note this:
- a weblibrary must have the eBagLib root object
- each library item must have its url attribute, and may have a filename attribute. These attributes are right what one expects: the URL tells eBag where to download the file from (the same you see in your web browser); while filename tells eBag how to name that file. If filename was not specified, than the original filename (extracted from the URL) will be used.
Make sure you saved the file content and than start X-Plane with eBag installed.
Click the "Open" button, just like if you were opening a normal file, expand the WebLibraries folder and... there you are! Your first weblibrary should be there!
Now click on the 'Jeppesen Charts Examples' node: eBag will download and open the web resource which in this case is a PDF file.
Organize items in hierarchy
The json format allows to model a hierarchy of items. That means you can organize your web libraries the same way you do with your files / folders in your PC. Let's see how this can be achieved.
Let's say we would like to put our Jeppesen Sample file into a "Charts" folder. Remember the My First Library.json file ? Edit that file like this:
See what we've done ? Just added the "Charts" container around our resource.
Again, as before, go back to X-Plane and press the refresh icon in your eBag file selector dialog to see the result:
Each folder can contain any number of child items. Let's add a "Charts Legend" file in our brand new charts collection:
Here's the result:
If you examine the content of the provided FAA Airports Library, you'll notice that the resources URLs are filled with some special string patterns: $yy$ and $month$.
These are substituted by eBag just before downloading the resource with the current YEAR and MONTH. This is necessary because the FAA charts are updated monthly in cycles. This feature assures the charts you download are always up to date.
For this to work properly, your PC clock must be set correctely.