Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic post-form autosync #711

Merged
merged 1 commit into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/application/FormController.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ public SubmitResponseBean submitForm(@RequestBody SubmitRequestBean submitReques
}
}

if (storageFactory.getPropertyManager().isSyncAfterFormEnabled()) {
//If configured to do so, do a sync with server now to ensure dats is up to date.
//Need to do before end of form nav triggers, since the new data might change the
//validity of the form
restoreFactory.performTimedSync();
}

if (formEntrySession.getMenuSessionId() != null &&
!("").equals(formEntrySession.getMenuSessionId().trim())) {
Object nav = doEndOfFormNav(menuSessionRepo.findOneWrapped(formEntrySession.getMenuSessionId()));
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/util/FormplayerPropertyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class FormplayerPropertyManager extends PropertyManager {
public static final String ENABLE_BULK_PERFORMANCE = "cc-enable-bulk-performance";
public static final String AUTO_PURGE_ENABLED = "cc-auto-purge";

public static final String POST_FORM_SYNC = "cc-sync-after-form";

/**
* Constructor for this PropertyManager
*
Expand All @@ -40,4 +42,8 @@ public boolean isBulkPerformanceEnabled() {
public boolean isAutoPurgeEnabled() {
return doesPropertyMatch(AUTO_PURGE_ENABLED, NO, YES);
}

public boolean isSyncAfterFormEnabled() {
return doesPropertyMatch(POST_FORM_SYNC, NO, YES);
}
}