[Feedhenry-raincatcher] [Community Functionality] Image storage

Wojciech Trocki wtrocki at redhat.com
Thu Oct 12 15:43:16 UTC 2017


Following email contains proposition for new RainCatcher functionality.
Contents of this email will be also moved to public jira and open for
discussion.

*Introduction *

RainCatcher users can build processes using steps.
When working with the steps results are saved as JSON file in workorders.

There are some situations when saving data in JSON format may not be
efficient.
For example binary files like images/pdfs needs to be encoded and can lead
to really big JSON payloads.

*Top Level Functionality*

RainCatcher as solution should support file (initially photos only) upload
that can be used when building steps.
Developers should be able to build their steps that can interact with the
files.
Server side should support file storage using interface - storage agnostic.

[image: Inline image 1]



App flow

1. Step can use client api to create photo requests.
2. As result client is calling camera plugin and photo is stored in local
storage.
3. Step retrieves link to local file that contains image

File Sync flow

1. All files that are created are put on sync queue.
Queue supports two types of sync (syncing local file, fetching file from
server)
2.1 When online, files are synced to server
2.2 When online, files are fetched from server. Step is notified and
retrieves link to new file.
3. When offline queue is holding reference.
Queue needs to be persisted to survive application restarts.

Note: Sync implementation will not use FeedHenry Sync.

*Client side support*

Client side (plain javascript) will contain queue implementation that will
interact with the cordova network state plugin.
Queue will hold references to local file and sync them when online.
Client will interact with the cordova camera plugin.
Client will be available as separate npm module that can be required by any
step implementation.

*Server side support*

New module that will expose file upload/download api.

Proposed api endpoints

*GET /api/files/{ID}* - retrieve specific file
*POST /api/files* - create file

Endpoints will be used by client to sync needed files

*Functional requirements*

Both client and server should be configurable:

- supporting different storage locations and other cordova parameters like
thumbnails support etc.
- supporting different storage engines on the server (interface)

*Examples*

Example step will be provided that will implement file sync functionality

*Relation to Beta Version functionality*

Provided API in beta was missing required functionalities like full offline
support, configurable authentication etc.
With that in mind I personally suggest to not reuse any of the
functionalities from previous versions.

*Notes*

As this functionality is not WFM specific I suggest to done it in the way
so it will be reusable by others who wants to implement Cordova offline
file sync.

Regards

-- 

WOJCIECH TROCKI

Red Hat Mobile <https://www.redhat.com/>

IM: wtrocki
<https://red.ht/sig>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/feedhenry-raincatcher/attachments/20171012/b252f96b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 39853 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/feedhenry-raincatcher/attachments/20171012/b252f96b/attachment.png>


More information about the Feedhenry-raincatcher mailing list