-
Notifications
You must be signed in to change notification settings - Fork 187
Instructions for adding new fields
As of version 5.0 it seems like a good idea to update this section. Rather than writing exhaustive documentation, I will link to specific commits where a field was added. If necessary I will add a field to demonstrate. This is a work in progress.
this commit shows how new fields (price & format) were obtained from Amazon. Ignore the SearchManager changes — they were about handling ASINs better. Other search providers follow a similar pattern.
This is considerably changed as of (somewhere around) v3.4. See notes below.
CatalogueDBAdapter
- Add to CREATE
- Add to onUpgrade
- Add to exportBooks
- (3.4) Add to getBookFields
- Add to fetchAllBooks (3.4: not needed)
- Add to fetchAllBooksByAuthor (3.4: not needed)
- Add to fetchAllBooksByLoan (3.4: not needed)
- Add to fetchAllBooksBySeries (3.4: not needed)
- Add to fetchBook (3.4: not needed)
- Add to fetchBookByISBN (3.4: not needed)
- fetchBookByISBNOrCombo (3.4: not needed)
- Add to searchBooks (3.4: not needed)
- Add to createBook (3.4: not needed)
- Add to updateBook (3.4: not needed)
edit_book / edit_book_notes.xml
- Update edit_book.xml
BookEditFields / BookEditNotes / BookEditAnthology
- Add private class variable (3.4: not needed)
- Add to onCreate (3.4: add a field to myFields — see, eg, KEY_PUBLISHER — may want validator, formatter etc)
- Update populateFields (from database) (3.4: not needed, if it’s just a ‘simple’ field)
- Update populateFields (from variable / activity – Fields only) (3.4: not needed, if it’s just a ‘simple’ field)
- Update saveState (3.4: not needed, if it’s just a ‘simple’ field)
BookISBNSearch
- Update comment in go
- Update searchGoogle
- Update searchAmazon
LibraryThingManager (3.4)
update SearchLibraryThingEntryHandler
SearchAmazonHandler
- Create public class variable (not in 3.4)
- update GetBook
SearchGoogleBooksEntryHandler
- Create public class variable (not in 3.4)
- update GetBook
FieldVisibility
- Add to setupFields (fields, fieldRs and compulsary)
AdminstrationFunctions
- Add to exportData (title and rows; moved in 3.4 – now in ExportThread.java)
- Add to ImportData (not needed in 3.4)