Connecting a Ketida book to a Lulu project
Context
In Ketida 2 there are currently two available export options:
A. PDF
B. Epub
The following choices are available:
- Size (for PDF only)
- Content (title page, copyright, and table of contents)
- Template selection
Once the user has made these choices, a PDF or Epub can be downloaded. In order for the user to order print on demand copies or publish their book through Lulu, Ketida 2 needs to be integrated with the Lulu system and mapped to a specific project on the Lulu site, to which a print-ready PDF can be sent. This issue outlines the requirements relevant to this print on demand integration and the proposal to meet these requirements.
In Ketida 2, we aim to keep a book as a single source, which can be exported to multiple formats. Within each export format type (for example PDF) there can be multiple different exports available. For example, a user could have one single source of content, that is export to PDF or epub in various page sizes and/or with various templates, therefore numerous combinations of user choices can result in multiple exports for each format of a book.
Significant differences in the nature of the export may require the user to have a distinct ISBN for that format. Currently we store one ISBN with the single source of content. Since we support multiple unique exports, which might differ significantly, a sufficient solution is to add multiple ISBN fields in metadata that each have a separate but connected ISBN label field (e.g. label: softcover, ISBN: xxxx-xxxx-xxxx-xxxx; label: hardcover, ISBN: xxxx-xxxx-xxxx-xxxx).
The need to save export configurations at the export step is relevant to the initial integration to send exports of a book to Lulu, as well as when updating a book on Lulu. On the Lulu site, users can create Projects. Each Lulu Project would have a unique ISBN and be associated with a unique set of printing qualities. To change printing details for a book (for example to have either a different page size, different ISBN, or different paper type) the user would need to create a new Lulu Project. This necessitates that we connect a particular export configuration in Ketida to one project on Lulu, this involves a) saving export profiles in Ketida, b) initialising the Lulu project, c) sending the interior file and some metadata for the export profile, d) opening the project in Lulu, e) determining when an export is out of sync with Lulu, e) syncing with Lulu when appropriate.
Proposal
In the Export page, add the following functionality:
- Save an export configuration (save the choices that the user made for all the settings parameters)
- Name and rename an export configuration
- Switch between export configurations
- Edit an export configuration
- Connect to a user's Lulu account
- Initialise a Lulu project
- Connect an export configuration with a particular project on Lulu
- Send the interior file to Lulu (and what other information?)
- Show a link to the relevant Lulu project from the export config, so it's clear what project it's mapped to
- Display a status for each export configuration to compare [time since last synced with Lulu] with [time since the content of the book was last changed] and [time since the export configuration was changed and saved]. If [time since last synced with Lulu] > [time since the content of the book was last changed] and/or [time since the export configuration was changed and saved], display a message explaining that the latest changes have not been synced to Lulu
- Update on Lulu button to send the new package for that config to Lulu (this button should be active when out of sync)
Design
Please see the latest prototype here with explanatory video attached: lulu_export_settings__720p_
Implementation queries
A. Determine if REST or GraphQL will be used
B. SSO
- Which info should be passed to which endpoint e.g. email, password, callback url, etc.
- Is 2fa involved
- What is the outcome of that action ? access token, refresh token, expiration times, etc?
- Error codes?
C. Trigger a new Lulu project
- When we say new Lulu project this means a print job or we are referring to a completely new concept? (based on your API documentation)
- If yes then we should be providing a form in order for a user to fill shipping address, shipping level etc?
- If that’s not the case, where can we find the specifications of the create/update Lulu project API in a similar way as https://api.lulu.com/docs?
- Will there be any webhooks similar to the ones you have for print-jobs?
- Which will be the object attributes of the project entity?
- Pod_package_id will be provided also as info in the responses of the API for project creation?
- In your current print-job API the handling of line_items e.g. book, is based on the premise that a URL of the file will be passed in the request. During our call you’ve mentioned that for our use-case a pre-singed URL will be provided in order for our system to upload the created PDF. As these cases are different, which one should we follow?
- If we go with the pre-signed URL path how will the project creation flow look? On initial call will trigger the creation of the project on your end which will have as a response the pre-signed URL (among other things) where we will catch that and upload a PDF as step two with a second call?
D. Deleting an export from Ketida
- What should happen if an export profile is deleted in Ketida that is already connected with Lulu?
- What should happen if book is deleted in Ketida that is already connected to one or multiple Lulu projects?
- Will it be possible for a user to delete a project from Ketida?