946
edits
Line 88: | Line 88: | ||
=== createRecord === | === createRecord === | ||
The <tt>createRecord( guid )</tt> method gets called by the engine to request a new record for an item with a given GUID. | The <tt>createRecord( guid, cryptoMetaURL )</tt> method gets called by the engine to request a new record for an item with a given GUID. The cryptoMetaURL is the URL to the location of the cryptoMeta record that will be used to encrypt it. | ||
It's your Store's responsibility to instantiate a Record object (of the class you defined earlier), assign the given GUID to it, and return it. | It's your Store's responsibility to instantiate a Record object (of the class you defined earlier), assign the given GUID and cryptoMetaURL to it, and return it. | ||
It's also strongly recommended that your Store cache the record object. The base class provides the cache, so you can store a record in it like so: | It's also strongly recommended that your Store cache the record object. The base class provides the cache, so you can store a record in it like so: | ||
Line 106: | Line 106: | ||
// ... | // ... | ||
record.id = guid; | record.id = guid; | ||
record.encryption = cryptoMetaURL; | |||
return record; | return record; | ||
edits