Skip to content

Commit

Permalink
selective sync docs (#11) (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Tomas Mizera <[email protected]>
  • Loading branch information
PeterPetrik and tomasMizera authored Aug 16, 2021
1 parent c2269ee commit 708d045
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/.vuepress/public/mergin-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"input-selective-sync": true,
"input-selective-sync-dir": ""
}
Binary file added src/.vuepress/public/mergin-config.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion src/.vuepress/sidebar/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ module.exports = {
'/components/mobile/external_gps',
'/components/mobile/gps_accuracy',
'/components/mobile/position_variables',
'/components/mobile/reuse_last_values'
'/components/mobile/reuse_last_values',
'/components/mobile/selective_sync'
]
},
{
Expand Down
Binary file added src/components/mobile/images/selective-sync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions src/components/mobile/selective_sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Selective synchronization

<Badge text="Since Input 1.0.0" type="info"/>

Selective sync feature adds a possibility to alter the synchronization process to not download specified files on other devices. These files are only stored on creator's device and server and can be accessed on Mergin web or QGIS desktop. Other colleagues on different devices will not receive these files during synchronization.

Selective sync is useful mainly when a project contains a lot of data (for example photos) and these data do not necessarily need to be stored on all devices.

Practical example can be seen in the picture below. Two surveyors Jim and Susan are capturing features on a field. When it comes to synchronization, Jim first hits the [arrow icon](./data_sync.md) synchronize his changes. Features together with photos are now stored on the server. When Susan synchronizes the project, synchronization first downloads Jim's changes (including photos) and after that uploads Susan's changes to the server. However, selective sync can alter this behavior and exclude photos from being downloaded.

:::tip
Features and other data are still being downloaded and you will see them, only photos will miss.
:::

![Example](./images/selective-sync.png)

Another advantage is a significant reduction of synchronization time.

## How to set up selective sync

Selective sync is not allowed by default on new projects. Project needs to contain a specific file called `mergin-config.json` that describes the behavior. If you are not interested in customizing the behavior, skip to [get started](#get-started).

The config file is of type `JSON` and contains following keys:

- `input-selective-sync` specifies if selective sync should be allowed for this project. Keep this one as `true` in order to have selective sync enabled

- `input-selective-sync-dir` specifies a subfolder that should be considered for selective sync. Only files that are located inside this directory (or any of its subdirectories) will be considered. To use selective sync on all project files, leave this value as an empty _string_ `""`


Example config setup to use selective sync on all project files:

```json
{
"input-selective-sync": true,
"input-selective-sync-dir": ""
}
```

Example config setup to use selective sync only on files (photos) in subdirectory `images`:
```json
{
"input-selective-sync": true,
"input-selective-sync-dir": "images"
}
```

> Note: You can also use subsubdirectories (or any depth really) like `"resources/images"`. The path is relative to project's root directory.
## Get started

Projects with file `mergin-config.json` are set to use selective synchronization. You can either create the file on your own and copy content from previous section to it or download prepared file and add it to your project.

You can find `mergin-config.json` file <a :href="$withBase('/mergin-config.json')" download>here</a> and add it to your project via [Mergin website](https://public.cloudmergin.com/).

:::tip
If download does not work, ZIP archive is available for download <a :href="$withBase('/mergin-config.zip')" download>here</a>, decompress it and use as mentioned in the previous step.
:::

The config file needs to be placed in the root project directory where your `*.qgz` QGIS project is. These files are by default set to consider entire project directory and needs to be edited in text editor to use specific subdirectory.

---

In the future, we plan to add an option to set up selective sync conveniently in Mergin QGIS plugin.

0 comments on commit 708d045

Please sign in to comment.