bic / wave-cli-app

0 stars 0 forks source link

Location Picker & Location Active Search #37

Open paulbalomiri opened 10 years ago

paulbalomiri commented 10 years ago

Structure

Locationpicker Elements

The Location picker is an element which contains an hierarchical data set of Location bits, meaning that each bit of information refines the previous bit (Note: Bit is used in this context as in piece, not as in bits of a byte).

In the image description above a Location picker UI Widget is displayed with it's elements which shall be explained in the following List:

class LocationPicker:
   int picker_level // root =0, child = 1, child of child = 2 e.t.c
   LocationPickerDataset dataset   
   LocationActiveSearch active_search //Active search which needs to be announced when the user erases part of the search
   // Note that the link to active_search might be solved more elegantly by using Callbacks

   LocationPicker  child // This is not mandatory
   LocationPicker parent // This is mandatory, but can be null = Root of the tree. It's value can be deduced 
                                   //from the dataset
class LocationActiveSearch:
   List<LocationPicker> location_pickers // A list of the location pickers which get input from this LocationActiveSearch
   int search_delay; // delay in milliseconds to send a query after the search_text has changed
   String search_text //  Search text as input from the user. This can differ from current_dataset_search_text which will be set delayed, upon receiving a search response from the server
   String current_dataset_search_text : //Current search text for which the dataset is available
   List<LocationPickerDataset> current_dataset // List of  datasets for each possible choice corresponding to formatted_search_result
   List<FormattedString> search_results // List of entries to be offered as choice for the user to pick.
   LocationPicker location_picker // Location picker to set the LocationPickerDataset for a picked result
class LocationBit
   String name
   Location location // optional
   int radius // optional, radius in meters for which this location bit is still valid
class LocationPickerDataset
   List<List<LocationBit>> levels // location bits  by picker level
   Optional<boolean> is_complete // set to true if the location definition of the last picker in dataset is complete
   Optional<int> fixed_location_bits_count //  if 2 than the first 2 location bits are fixed.
    // Note that this can actually exceed the limits of a picker level.

class LocationActiveSearchRequest:
   String user_input
   LocationPickerDataset  current_data_set
   Position current_position // see http://www.w3schools.com/html/html5_geolocation.asp
                             // regarding getCurrentPosition() return data structure 
   int max_results // Maximum number of results 
class Position:
   // This class is analogous to the return Object getCurrentPosition() 
   // as defined Here http://www.w3schools.com/html/html5_geolocation.asp
   Coordinates coords
   int timestamp // ms since 1.1.1970
class Coordinates:
    //see Position description
    float latitude
    float longitude
    float accuracy
    float altitude
    float altitude_accuracy
    float heading
    float speed
class LocationSearchUpdate
  String query
  List<LocationQueryResultSection> result_sections  // the sections to be displayed in the result popup
class LocationQueryResultSection
  String name // Name of the result section
  List<LocationPickerDataset> result_datasets
  List<FormattedString> formatted_results // corresponds with result_datasets

Operation mode:

Both the LocationPicker and the LocationActiveSearch operate on and with LocationPickerDataset Objects.

Sequences of execution model:

Let's look at what happens from loading time to the completion of a Location specification:

paulbalomiri commented 10 years ago

Note that a correction has been made: The CORRECT version as updated in the ticket description is :

class Dataset
   List<List<LocationBitDataset>> location_bits_content_by_picker_level

Whereas previously it was

class Dataset
   List<List<String>> location_bits_content_by_picker_level