From 3af48b1892d7df1ac33be8d3ea8756765eb9cf8c Mon Sep 17 00:00:00 2001 From: Andy Gup Date: Tue, 8 Sep 2015 10:55:54 -0600 Subject: [PATCH 1/4] Closes #406 --- doc/howtouseeditlibrary.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/howtouseeditlibrary.md b/doc/howtouseeditlibrary.md index cdf38d99..75a1b3b9 100644 --- a/doc/howtouseeditlibrary.md +++ b/doc/howtouseeditlibrary.md @@ -5,6 +5,8 @@ How to use the edit library The `edit` library allows a developer to extend a feature layer with offline editing support. You can combine this functionality with offline tiles. For a complete list of features consult the [OfflineFeaturesManager API doc](offlinefeaturesmanager.md). +**IMPORTANT:** Only use a single instance of OfflineFeaturesManager per application. With this single instance you can extend offline capabilities to multiple feature layers. This single instance contains all edits for all feature layers initialized via `offlineFeaturesManager.extend().` Multiple feature layers share a single database. The database maintains the relationship between each edit and its' respective feature layer via a UUID. + **Step 1** Include `offline.min.js`, `offline-tiles-basic-min.js` and `offline-edit-min.js` in your app's require contstructor. Be sure to include `ofline.mins.js` which is a 3rd party library for detecting if the browser is online or offline. The pattern for how we include the tiles and edit library within the `require` statement is called generic script injection. Note that we do assign any of the editing or tile libraries an alias name. For example, we specified the mobile path "esri/map" and we gave it an alias called "Map." But, we did not do the equivalent for `offline-tiles-based-min.js` or `offline-edit-min.js`. @@ -121,7 +123,7 @@ For full offline use, the pattern would look like this where we are creating a ` ``` -When working with fully offline browser restarts you should wait until the layer has been successfully extended before forcing the library to go back online. When you force the library to `goOnline()` it will attempt to sync any edits that occurred while offline. +When working with fully offline browser restarts you should wait until the layer has been successfully extended before forcing the library to go back online. When you force the library to `goOnline()` it will attempt to sync any edits that occurred while offline. Only call `goOnline()` once. If there are errors or it doesn't work then the best practice is to recheck the contens of the edits database. The workflow for this coding pattern is you start out online > offline > browser restart > then back online. @@ -317,6 +319,9 @@ resultsObject = { ``` +Typically you should only need to call this method once for each online/offline cycle. However, resync attempts won't always happen perfectliy. In your code, if there are errors or the library fails to sync for some reason then the best practice is to evaluate any error messages, recheck the online/offline status and recheck the contents of the edits database. + +If there was a an failure and/or errors, it's a good idea to reevaluate the edits that remain in the database because some edits may have been synced and others may still be pending. Only then, and depending on the error message, should the app try to `goOnline()` again. ####offlineFeaturesManager.getOnlineStatus() Within your application you can manually check online status and then update your user interface. By using a switch/case statement you can check against three enums that indicate if the library thinks it is offline, online or in the process of reconnecting. From 707dc751cddf7958ba4de110460c9f57ccf9a32c Mon Sep 17 00:00:00 2001 From: Andy Gup Date: Tue, 8 Sep 2015 11:05:08 -0600 Subject: [PATCH 2/4] update supported browsers table --- demo/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/index.html b/demo/index.html index d0cea6fd..ffd672a3 100644 --- a/demo/index.html +++ b/demo/index.html @@ -143,7 +143,7 @@

Supported Browsers

Supported Supported N/A - Not Supported + N/A Not Supported N/A @@ -152,14 +152,14 @@

Supported Browsers

Supported N/A Not Supported - Not Supported + * Supported Mac OS X Supported Supported - Not Supported + Not Supported * Supported From a9d7bbc941c93f3a523290f19b8e462ee6ba3591 Mon Sep 17 00:00:00 2001 From: Andy Gup Date: Tue, 8 Sep 2015 11:06:47 -0600 Subject: [PATCH 3/4] Update changelog --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee8a9966..8aee1ad7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # offline-editor-js - Changelog +## Version 2.14.0.2 - Sep. 8, 2015 + +No breaking changes. Doc updates only. + +**Enhancements** +* Closes $406. Provided additional clarification on using offlineFeaturesManager.goOnline() in the 'How to use the edit library' doc. +* Updated supported browsers table. + ## Version 2.14.0.1 - Aug. 17, 2015 No breaking changes. Doc updates only. From 54dba2e7b8ea0da182dda4cfd9d95a11da6c16ac Mon Sep 17 00:00:00 2001 From: Andy Gup Date: Tue, 8 Sep 2015 11:07:40 -0600 Subject: [PATCH 4/4] fix minor typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8aee1ad7..78d76e8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ No breaking changes. Doc updates only. **Enhancements** -* Closes $406. Provided additional clarification on using offlineFeaturesManager.goOnline() in the 'How to use the edit library' doc. +* Closes #406. Provided additional clarification on using offlineFeaturesManager.goOnline() in the 'How to use the edit library' doc. * Updated supported browsers table. ## Version 2.14.0.1 - Aug. 17, 2015