Skip to content

A technology agnostic server abstraction for walkingkooka-spreadsheet.

License

Notifications You must be signed in to change notification settings

mP1/walkingkooka-spreadsheet-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4,092 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status License Language grade: Java Total alerts J2CL compatible

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.

REST

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:

http://server/api-doc/index.html

Plugin

A collection of end points to help manage plugins.

A collection of end points that support CRUD operations on spreadsheets. Note all payloads are in JSON form.

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

These end points may be used to work with available ConverterInfoSet

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

These end points may be used to work with available SpreadsheetFormatterInfoSet

These end points may be used to work with available SpreadsheetFormHandlerInfoSet

These end points may be used to work with available ExpressionFunctionInfoSet

These end points may be used to work with available SpreadsheetImporterInfoSet

These end points are mostly used by the label management dialog.

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

Many of these are very closely mapped to the context menu that appears when row/rows are selected.

These end points may be used to work with available ValidatorInfoSet

url / query string parameters

  • 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.

Execution environment

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.

browser client / jetty server

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

offline mode

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.

About

A technology agnostic server abstraction for walkingkooka-spreadsheet.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages