Enhancement Request
Overview
Implement a sleep/wakeup process similar to the geowatch-agent-track plugin that will invoke the OFS API during the plugin initialization to retrieve data from specified buckets.
Background
The geowatch-agent-track plugin (/Volumes/SSD Miquel - SanDisk/visual-code/cat-repos/geowatch-agent/geowatch-agent-track) demonstrates how to retrieve OFS position data during initialization. This enhancement will follow the same pattern but for retrieving bucket properties.
Requirements
Data Retrieval
The plugin should retrieve two types of properties from a specified bucket:
- String property - A text/string value stored in the bucket
- File property - A file stored in the bucket
Configuration
The bucket and properties to fetch will be defined in the plugin descriptor as secureData with the name DATA_TO_RETRIEVE in the following format:
[
{
"bucket_name": "my_data_bucket",
"properties_to_fetch": {
"string_property": "string",
"file_property": "file"
}
}
]
Data Storage
After retrieving the data from the OFS API:
- Store both the string property and file property in the device cache/local storage
- Persist the data so it's available when the plugin opens
Data Display
When the plugin is opened:
- Retrieve the previously stored data from device cache/local storage
- Display both the string property value and the file property on the page
- Handle cases where no data has been retrieved yet
Implementation Pattern
- Follow the same sleep/wakeup pattern used in geowatch-agent-track
- Invoke OFS API during plugin initialization (init process)
- Handle both string and file property types
- Store retrieved data in device cache/local storage
- Display stored data when plugin opens
Technical Approach
- Add sleep/wakeup event handlers
- Parse
DATA_TO_RETRIEVE from secureData
- Make API calls to OFS bucket API during initialization
- Handle string property retrieval
- Handle file property retrieval
- Store data in device cache/local storage
- On plugin open, retrieve data from local storage
- Display retrieved data on the plugin page
- Handle errors gracefully (missing bucket, properties, API failures, storage failures)
Reference Implementation
See: /Volumes/SSD Miquel - SanDisk/visual-code/cat-repos/geowatch-agent/geowatch-agent-track
Acceptance Criteria
Enhancement Request
Overview
Implement a sleep/wakeup process similar to the geowatch-agent-track plugin that will invoke the OFS API during the plugin initialization to retrieve data from specified buckets.
Background
The geowatch-agent-track plugin (
/Volumes/SSD Miquel - SanDisk/visual-code/cat-repos/geowatch-agent/geowatch-agent-track) demonstrates how to retrieve OFS position data during initialization. This enhancement will follow the same pattern but for retrieving bucket properties.Requirements
Data Retrieval
The plugin should retrieve two types of properties from a specified bucket:
Configuration
The bucket and properties to fetch will be defined in the plugin descriptor as
secureDatawith the nameDATA_TO_RETRIEVEin the following format:[ { "bucket_name": "my_data_bucket", "properties_to_fetch": { "string_property": "string", "file_property": "file" } } ]Data Storage
After retrieving the data from the OFS API:
Data Display
When the plugin is opened:
Implementation Pattern
Technical Approach
DATA_TO_RETRIEVEfrom secureDataReference Implementation
See:
/Volumes/SSD Miquel - SanDisk/visual-code/cat-repos/geowatch-agent/geowatch-agent-trackAcceptance Criteria
DATA_TO_RETRIEVEconfiguration from secureData