Skip to content

Files

Editing and working with local files is very important for businesses. The host applicationn provides a number of functions to support editing these with local applications as seen in the interface.

Architecture

For most users the internal architecture is not important, but here is a description of the internal processes used for a deeper understanding.

sequenceDiagram__NEWLINE__ participant S as Aeppic Server__NEWLINE__ participant A as Aeppic Web Application__NEWLINE__ participant H as Host Desktop Client App__NEWLINE__ participant OS as Operating System__NEWLINE____NEWLINE__ H->>A: hosts__NEWLINE__ A->>S: accesses__NEWLINE__ H->>OS: opens files using__NEWLINE__ OS->>H: notifies changes__NEWLINE__ H->>S: uploads changed file content__NEWLINE__ H->>A: reports uploaded content__NEWLINE__ A->>S: updates document to use new content

Edit Sequence

Edit File command

sequenceDiagram__NEWLINE__ participant AeppicApplication as Aeppic Application__NEWLINE__ participant Client as Desktop App__NEWLINE__ participant LocalStorage as Local Filesystem__NEWLINE__ participant Server as Aeppic Server__NEWLINE__ participant Editor as Editing Application__NEWLINE____NEWLINE__ AeppicApplication->>Client: Edit file__NEWLINE__ Client->>LocalStorage: Check if file is downloaded for editing__NEWLINE__ alt File not downloaded__NEWLINE__ Client->>LocalStorage: Store data_url in data-url.txt__NEWLINE__ Server->>Client: Download from Server__NEWLINE__ Client->>LocalStorage: Store file, data_url, and ETag__NEWLINE__ Client->>Editor: Open file for editing__NEWLINE__ else File exists__NEWLINE__ alt File is being uploaded__NEWLINE__ Client->>AeppicApplication: Do not do anything as we are uploading__NEWLINE__ else__NEWLINE__ LocalStorage->>Client: Read data_url in data-url.txt__NEWLINE__ Client->>Client: Compare data_url.__NEWLINE__ alt no previous data_url (potentially aborted download)__NEWLINE__ LocalStorage->>Client: Read ETag__NEWLINE__ Server->>Client: Download from Server providing ETag. Do not redownload if same__NEWLINE__ else data_url provided is different__NEWLINE__ Client->>AeppicApplication: Do not do anything as we still have different data. `DataUrlOutOfSync` Error.__NEWLINE__ note left of Client: Use openFile (without dataUrl) to see the most recent version__NEWLINE__ note left of Client: Use returned dataUrl to ensure only that or derived is shown__NEWLINE__ note left of Client: Use `delete` to remove the local copy.__NEWLINE__ else NO data_url provided by Aeppic Application__NEWLINE__ Client->>Editor: Open file for editing to overwrite the server version__NEWLINE__ end__NEWLINE__ Client->>Editor: Open file for editing__NEWLINE__ end__NEWLINE__ end

File Change Sequence

sequenceDiagram__NEWLINE__ participant AeppicApplication as Aeppic Application__NEWLINE__ participant Client as Desktop App__NEWLINE__ participant LocalStorage as Local Filesystem__NEWLINE__ participant Server as Aeppic Server__NEWLINE__ participant Editor as Editing Application__NEWLINE____NEWLINE__ LocalStorage->>Client: File Change Detected__NEWLINE__ Client->>Client: Mark File as being uploaded__NEWLINE__ Client->>Client: Generate new data_url__NEWLINE__ Client->>LocalStorage: Delete ETag file and store data_url__NEWLINE__ Client->>LocalStorage: Store upload marker file__NEWLINE__ Client->>Server: Start Upload__NEWLINE__ alt Upload goes through __NEWLINE__ Client-->>AeppicApplication: Send Event to notify of upload with new data_url__NEWLINE__ Client->>Client: Wait for Upload to finish (This is done asynchronously)__NEWLINE__ Client-->>AeppicApplication: Send Event to notify of upload finish with new data_url__NEWLINE__ AeppicApplication->>Client: Aeppic Application acknowledges the new data_url for the document__NEWLINE__ Client->>LocalStorage: Delete upload marker file__NEWLINE__ else __NEWLINE__ Client-->>AeppicApplication: Send Event to notify of error during upload__NEWLINE__ LocalStorage->>Client: Read data_url to use__NEWLINE__ AeppicApplication->>Client: Send Retry to retry the upload__NEWLINE__ note right of Client: Start Sequence with "Start Upload" as described above__NEWLINE__ end

File Change during upload

When a file change is detected during an upload, the upload is immediately cancelled. Once the upload has been cancelled, the normal file change sequence as described above is executed.

Resume Sequence

CAUTION

This is not implemented yet.

When the system starts, the aeppic Application can ask the client to resume any uploads. A list can be generated for all files where the upload was interrupted by looking for the upload marker files. Each file can then be resumed which will start watching the files for changed (not opening any editor though) and the file is being uploaded.

If edit is called (instead of resume) the call would be ignored, therefore it is important for the client application to read the pending upload list and ask the user about what to do.

The pending file upload could be cancelled and the data_url overwritten with the latest known version. The actual file can then be opened for editing again (it would still have any changes made since downloading).