This project includes an example custom Core Data atomic store and several unit tests for the store. The store code is in the HTMLStore files. The HTMLStoreLoader can be used by applications wishing to use this store via loading it as a plugin. 

==========================================================================================

HOW TO RUN THE APP
- Choose the HTMLStoreApplication target. This target builds the store bundle and the app
- Build and run
- In the window that comes up, you can add Person object on the left. On the right you can add new pictures, drag in pictures into the image well to set picture data, edit picture labels, and use the "next" and "previous" buttons to navigate pictures.
- Press command-s or go to the File menu to save changes
- You can see the HTML file generated by the store in ~/Library/Application\ Support/HTMLStore/

HOW TO RUN THE TESTS
- Choose the otest target. This target build the store bundle, the testing framework, and an executable test tool
- Build and run
- 4 tests should run and none should fail. 
- The tests are implemented in BasicStoreTesting.m
- The tests run against the sample html file "BasicHTMLStore.html" and create copies to modify in the user TempDirectory (/private/var/tmp/folders.xxxx/TemporaryItems/) and try to clean up after themselves

- The store implementation is split into two files 
    1. HTMLStore.[h,m] implementation/overrides of basic methods from NSAtomicStore and NSObjectStore
    2. HTMLStore_Internal.[h,m] contain methods the store implements for itself - mainly for handling HTML and doing type conversion

==========================================================================================


A few concepts for the store:
- Each entity in a model maps to a table in the store
- Each table has a class name attribute which is the entity name
- Each table has a nextID attribute as a performance optimization for determining the value of new row element id's
- Each table has a header row where each header element is a property name
- All non-header table rows are data rows and each data element in a data row contains property data
- Each data-row element contains an id attribute of the form "EntityName_<#>" where <#> is a non-negative integer
- Relationships are encapsulated in links (<a href></a>)
- Links are of the form #DestinationEntityName_<#>

- We support reading binary data attributes as either a blob or by using an href
- Binary data is saved in base64 form as the data attribute of <object> elements. You can modify the HTML by hand to be an <a href="some://uri"></a> to some binary file and the store will preserve that change and load the data at that href URL using NSURL. In the event that it can't save changes to that URL (again, using NSURL), it falls back to writing the data to the store file in the form of an <object>.

- We chose to use base64 encoding for all the blobs. To support base64 coding/decoding, we leverage the OpenSSL library that's included with OSX. HSTMLStore_Internal uses OpenSSL functions to decode the base64 value of the data attribute into an NSData. Using openSSL is the only "free" way we have to decode base64.


==========================================================================================

Things that are missing:
- Support for saving data blobs as separate files
- More unit tests

