This module registers service end points that call SpreadsheetEngine services belonging to walkingkooka-spreadsheet. Each module contains minimal logic and is mostly concerned with unmarshalling/marshalling parameters and invoking the service.
GET methods require no BODY and always return a BODY POST, PUT methods require and return a BODY DELETE methods require no body and return a BODY
A swagger-ui is available at:
- Simple payloads are present.
- The following tests contain many examples SpreadsheetHttpServerTest
A collection of end points to help manage plugins.
- GET /api/plugin/*
- GET /api/plugin/PluginName
- GET /api/plugin/from PluginName:to PluginName
- POST /api/plugin/PluginName Body contains Plugin as JSON.
- DELETE /api/plugin/*
- DELETE /api/plugin/PluginName
- DELETE /api/plugin/from PluginName:to PluginName
- POST /api/plugin/*/upload Multipart file upload Binary file upload
- GET /api/plugin/pluginName/download
- GET /api/plugin/pluginName/list
- GET /api/plugin/pluginName/filter?query=$query&offset=0&count=1
A collection of end points that support CRUD operations on spreadsheets. Note all payloads are in JSON form.
- GET /api/spreadsheet/*?offset=0&count=10
- GET /api/spreadsheet/SpreadsheetId
- POST /api/spreadsheet/ expects no BODY, creates a Spreadsheet with SpreadsheetMetadata with defaults using any provided
Locale. - POST /api/spreadsheet/SpreadsheetId requires a BODY to update existing
SpreadsheetMetadata. - PATCH /api/spreadsheet/SpreadsheetId Used to update an existing SpreadsheetMetadata, name or individual global settings for a spreadsheet.
- POST /api/spreadsheet/SpreadsheetId/metadata/SpreadsheetMetadataPropertyNameConverterSelector/verify
- GET /api/spreadsheet/SpreadsheetId/metadata/SpreadsheetMetadataPropertyNameFormatterSelector/edit/SpreadsheetFormatterSelector
- DELETE /api/spreadsheet/SpreadsheetId
A collection of end points that support manipulating cells, columns and rows and similar functionality. All input and output is always a SpreadsheetDelta in JSON form, where necessary.
Most of these end points are used to fill the viewport or from actions such as selecting a cell or cell-range and then clicking a context menu command.
- GET /api/spreadsheet/SpreadsheetId/cell/*/clear-value-error-skip-evaluate?home=A1&&width=2&height=3&includeFrozenColumnsRows=true&selectionType=cell-range&selection=A1:B2&selectionNavigation=extend-left&properties="*"
Used by the UI to load just enough cells to fill the viewport. - GET /api/spreadsheet/SpreadsheetId/cell/A1/clear-value-error-skip-evaluate
- GET /api/spreadsheet/SpreadsheetId/cell/A1/skip-evaluate
- GET /api/spreadsheet/SpreadsheetId/cell/A1/force-recompute
- GET /api/spreadsheet/SpreadsheetId/cell/A1/compute-if-necessary
- GET /api/spreadsheet/SpreadsheetId/cell/A1:B2/sort?comparators=A=day-of-month;B=month-of-year
- PATCH /api/spreadsheet/SpreadsheetId/cell/A1 The UI uses this to update individual properties of a cell, such as updating the formula text
- POST /api/spreadsheet/SpreadsheetId/cell/A1
- DELETE /api/spreadsheet/SpreadsheetId/cell/A1
- DELETE /api/spreadsheet/SpreadsheetId/cell/A1:B2
- POST /api/spreadsheet/SpreadsheetId/cell/A1-B2/fill Input includes region of cells to be the fill content This has many purposes including functionality such as filling a range, pasting previously copied cells etc.
- GET /api/spreadsheet/SpreadsheetId/cell/A1/form/FormName
- POST /api/spreadsheet/SpreadsheetId/cell/A1/form/FormName
- GET /api/spreadsheet/SpreadsheetId/cell/A1/formatter-edit/SpreadsheetFormatterSelector
- POST /api/spreadsheet/SpreadsheetId/cell/A1/formatter-menu
- GET /api/spreadsheet/SpreadsheetId/cell/A1/labels?offset=0&count=1
- GET /api/spreadsheet/SpreadsheetId/cell/A1-B2/labels?offset=0&count=1
- GET /api/spreadsheet/SpreadsheetId/cell/*/labels?offset=0&count=1
- GET /api/spreadsheet/SpreadsheetId/cell/*/references?offset=0&count=1
Many of these are very closely mapped to the context menu that appears when column/columns are selected.
- PATCH /api/spreadsheet/SpreadsheetId/column/A
- POST /api/spreadsheet/SpreadsheetId/column/A/clear
Used by the UI to clear or erase all cells within the selected column/columns. - POST /api/spreadsheet/SpreadsheetId/column/A:B/clear
- POST /api/spreadsheet/SpreadsheetId/column/A/before?count=1 Used by the UI to insert one or more columns before the given column
- POST /api/spreadsheet/SpreadsheetId/column/A:B/before?count=1
- POST /api/spreadsheet/SpreadsheetId/column/A/after?count=1
- POST /api/spreadsheet/SpreadsheetId/column/A:B/after?count=1
- DELETE /api/spreadsheet/SpreadsheetId/column/A
- DELETE /api/spreadsheet/SpreadsheetId/column/A:B
These end points may be used to work with available SpreadsheetComparatorInfoSet
- GET /api/spreadsheet/SpreadsheetId/comparator
- GET /api/spreadsheet/SpreadsheetId/comparator/SpreadsheetComparatorName
These end points may be used to work with available ConverterInfoSet
- GET /api/converter
- GET /api/converter/ConverterName
End points to fetch DateTimeSymbols for a given Locale.
- GET /api/dateTimeSymbols/LocaleTag
- GET /api/dateTimeSymbols/*/localeStartsWith/LOCALE
End points to fetch DecimalNumberSymbols for a given Locale.
- GET /api/decimalNumberSymbols/*/localeStartsWith/LOCALE
- GET /api/decimalNumberSymbols/LocaleTag
These end points may be used to work with available SpreadsheetExporterInfoSet
- GET /api/exporter
- GET /api/exporter/SpreadsheetExporterName
- GET /api/spreadsheet/SpreadsheetId/form/FormName
- GET /api/spreadsheet/SpreadsheetId/form/*?offset=0&count=1
- POST /api/spreadsheet/SpreadsheetId/form/FormName
- DELETE /api/spreadsheet/SpreadsheetId/form/FormName
These end points may be used to work with available SpreadsheetFormatterInfoSet
- GET /api/formatter
- GET /api/formatter/SpreadsheetFormatterName
These end points may be used to work with available SpreadsheetFormHandlerInfoSet
- GET /api/formHandler
- GET /api/formHandler/FormHandlerName
These end points may be used to work with available ExpressionFunctionInfoSet
- GET /api/function
- GET /api/function/ExpressionFunctionName
These end points may be used to work with available SpreadsheetImporterInfoSet
- GET /api/importer
- GET /api/importer/SpreadsheetImporterName
These end points are mostly used by the label management dialog.
- GET /api/spreadsheet/SpreadsheetId/label/*?offset=0&count=1
- GET /api/spreadsheet/SpreadsheetId/label/spreadsheetLabelName
- GET /api/spreadsheet/SpreadsheetId/label/*/findByName/QUERY
- POST /api/spreadsheet/SpreadsheetId/label Used by the UI to create a new label to cell or cell-range
- POST /api/spreadsheet/SpreadsheetId/label/spreadsheetLabelName
- DELETE /api/spreadsheet/SpreadsheetId/label/spreadsheetLabelName
End points to query available Locales.
- GET /api/locale/LocaleTag
- GET /api/locale/*?offset=0&count=1
These end points may be used to work with available SpreadsheetParserInfoSet
- GET /api/parser
- GET /api/parser/SpreadsheetParserName
- GET /api/spreadsheet/SpreadsheetId/parser/*/edit/SpreadsheetParserSelector
Many of these are very closely mapped to the context menu that appears when row/rows are selected.
- PATCH /api/spreadsheet/SpreadsheetId/row/1
- POST /api/spreadsheet/SpreadsheetId/row/1
- POST /api/spreadsheet/SpreadsheetId/row/1/after?count=1
- POST /api/spreadsheet/SpreadsheetId/row/1:2/after?count=1
- POST /api/spreadsheet/SpreadsheetId/row/1/before?count=1
- POST /api/spreadsheet/SpreadsheetId/row/1:2/before?count=1
- POST /api/spreadsheet/SpreadsheetId/row/1/clear
- POST /api/spreadsheet/SpreadsheetId/row/1:3/clear
- DELETE /api/spreadsheet/SpreadsheetId/row/1
- DELETE /api/spreadsheet/SpreadsheetId/row/1:2
These end points may be used to work with available ValidatorInfoSet
- GET /api/validator
- GET /api/validator/ValidatorName
selection-type&selection
These parameters which must be present together are used to include the current selection and may affect the results, such as loading cells.window
This parameter is used to limit the range of cells, columns and rows returned. For example updating a cell may result in many cells being updated but only those visible in the viewport should be returned.
Currently communication between the browser and the server follows a browser client and Http server paradigm.
A HttpRequest is constructed, headers describe various aspects of the JSON payload and the desired response. The
server hosts a router which examines the request which selects a handler which performs the action and prepares a
response.
A simple message from the browser to an API, looks something like this, where the react app uses the browser's fetch object.
main UI thread
-> Fetch HttpRequest
-> Http Servlet container
-> promise
-> dispatch
The switch to offline mode means the walkingkooka-spreadsheet-dominokit simply replaces the Jetty servlet container, rather than using the browser's fetch object to communicate via http to a Jetty server, the request is serialized and posted to a webworker. The webworker hosts the same java server code translated to javascript.
HttpRequests and HttpResponses abstractions are still present but in webworker mode they are serialized as strings
within messages and the semantics are emulated by walkingkooka-spreadsheet-webworker.
main UI thread
-> Fetch that really posts message (HttpRequest)
-> window.postMessage(JSON.stringify(HttpRequest))
web worker.onMessage
-> message
-> JSON.parse(HttpRequest)
-> fake HttpServer
The url, headers and body of the request are still present and used to evaluate, route and select a handler which will be responsible for producing some reply.
webworker HttpResponse
-> webworker.postMessage(JSON.stringify(HttpResponse)
main UI thread
-> window.onMessage
-> JSON.parse(HttpResponse)
-> dispatch
Naturally there are limitations due to the offline nature and browser sand-boxing and those are currently unaddressed and issues will be created.