What a run imports
An import configuration either list records (list of static URLs) or it says how to find the roots of a run (sync Scope or Contains Place). The type of the configuration decides how. Everything after that — fetching, parsing, following references — is the same for every type.
The existing types
static- A hand-maintained list of resource URLs. Each one is a root. Suited to a fixed set of objects, such as the attractions of one city.
syncScope - A sync scope id. The run asks the API which resources in that scope were created or updated, optionally only within the last days, and imports those. Suited to keeping a whole scope up to date on a schedule.
containsPlace - The id of one place. The run fetches it and imports everything it lists in
schema:. Suited to "everything in this region".contains Place
Each type is implemented by a URL provider, a class implementing
\Werkraum.
Adding a type
A URL provider answers three questions:
canProvide For Configuration () - Is this configuration mine? Usually a comparison of the configuration's type. The first provider answering yes is used.
createWith Configuration () - Return a provider set up for this configuration. Providers are shared services, so return a configured copy rather than changing the shared instance.
getUrls () - The root URLs of the run. Requests made here go through the same HTTP client, with the same timeouts and retries, as the rest of the run.
Registration is automatic through the import. tag the interface carries.
The configuration record needs to offer the type as well:
- An item in the
typeselect oftx_.thuecat_ import_ configuration - The type's fields in
\Werkraum. Fields every type has — storage page, file folder, API key, tuning values — are shared there and need not be repeated.Media\ Thue Cat\ Typo3\ Flex Form\ Import Configuration Data Structure - Labels in
locallang_, including the sheet titleflexform. xlf import.Configuration.<type>. sheet Title - A getter on
\Werkraumfor each new field, for the provider to read.Media\ Thue Cat\ Domain\ Model\ Backend\ Import Configuration
A run whose configuration no provider claims stops with an exception before anything is fetched.