Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • user gets identified by token (basicAuth or JWT)
  • Additional API in bundle data-provider
  • Create a settings entry in the database if none exists
  • Delivers back all settings of a user
  • Updates the settings of a user 
  • Can delete (reset) settings of a user
  • model is using camelCase for properties

 Open Questions:

  • when should the initial settings entry of a user be created? When settings are updated / saved for the first time?
    • UI is responsible for data-structure → so initial data is writting by UI
    • empty data on server will return empty json object: "{}"
  • Use PUT or PATCH for updating entries? (settings may grow over time, eg. dashboard, networkmap, ...) Should the entire settings object be send or only a partial one?
    • PUT!
    • partial will be implemented
  • If we use PUT, do we need POST?
    • no
  • Should settings be queryable by section? ( eg. dashboard, networkmap, ...)
    • filter only for root element key

...

OperationExpected result
GET /userdataGets all the settings of a specified user
GET /userdata/{key}Gets the subsettings of a spefic user for rootElem[key]
PUT /userdataCreates/Updates settings entry of a user
PUT /userdata/{key}Creates/Updates settings entry of a user for rootElem[key]
DELETE /userdataDeletes settings entry of a user
DELETE /userdata/{key}Deletes settings entry of a user for rootElem[key]

In fact that jetty servlets can also handle camelCase URLs it is easily possible to filter for the correct property.

Examples

Read settings data of a user

...

Write partial settings data of a user

PUT /userdata/networkMap

Code Block
{
    "startupPosition": {"lat": 52.5095, "lon":13.3290, "zoom": 10},
    "tileOpacity": 90,
    "dashboardstyling":{
        "colortheme": "#F00light"
    }
}

Note: settings data currently subject to change, note will be deleted once finalized