Skip to content
Open
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ External runtime libraries (including mirthsync) are copied to `mirthsync-plugin
- Access to a Mirth Connect or Open Integration Engine 4.5.2 or 4.6.0 environment (the exact versions listed in `mirth.plugin.compatible_versions` in `pom.xml`)
- Optional: custom signing certificate/keystore (default self-signed cert lives in `certificate/keystore.jks`; password is `storepass` and alias `selfsigned`)

The plugin depends on [`com.saga-it:mirthsync`](https://clojars.org/com.saga-it/mirthsync), which is published on [Clojars](https://clojars.org) and resolved automatically during the Maven build. The embedded CLI version is pinned in `server/pom.xml` and `client/pom.xml` (currently **3.7.0**); bump both together, and publish that mirthsync release to Clojars first.
The plugin depends on [`com.saga-it:mirthsync`](https://clojars.org/com.saga-it/mirthsync), which is published on [Clojars](https://clojars.org) and resolved automatically during the Maven build. The embedded CLI version is pinned in `server/pom.xml` and `client/pom.xml` (currently **3.8.1**); bump both together, and publish that mirthsync release to Clojars first.

---

Expand Down Expand Up @@ -95,6 +95,7 @@ From **Settings → MirthSync** inside the Administrator UI:
- **Flags & Toggles**
- Includes mirthsync options like `--force`, `--include-configuration-map`, `--git-init`, `--delete-orphaned`, etc.
- Deploy after push: “Deploy channels after push” (`--deploy`), “Deploy all together” (`--deploy-all`), “Deploy only changed channels” (`--deploy-changed`, mirthsync 3.7.0+) and, with it, “Also deploy new channels” (`--deploy-new`).
- “Sort unordered collections” (on by default, mirthsync 3.8.0+): on pull, sorts collections Mirth stores in no fixed order (code template context types, library/alert channel IDs, the configuration map, etc.) so pulled XML stays stable and diffs stay clean. Uncheck it to keep the server's order (`--no-sort-unordered`). Expect a one-time commit that only reorders elements the first time you pull with “Force overwrite” checked after upgrading; without it, a pull does not overwrite existing files.
- “Allow interactive prompts” is currently disabled with a tooltip (“Currently unsupported”).

- **Git Metadata & Commands**
Expand Down
4 changes: 2 additions & 2 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.saga-it</groupId>
<artifactId>mirthsync-plugin</artifactId>
<version>0.0.5</version>
<version>0.0.6</version>
</parent>

<artifactId>client</artifactId>
Expand All @@ -51,7 +51,7 @@
<dependency>
<groupId>com.saga-it</groupId>
<artifactId>mirthsync</artifactId>
<version>3.7.0</version>
<version>3.8.1</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public class MainSettingsPanel extends AbstractSettingsPanel {
private MirthCheckBox autoCommitCheckbox;
private MirthCheckBox gitInitCheckbox;
private MirthCheckBox deleteOrphanedCheckbox;
private MirthCheckBox sortUnorderedCheckbox;

private MirthTextField commitMessageField;
private MirthTextField gitAuthorField;
Expand Down Expand Up @@ -128,6 +129,7 @@ public class MainSettingsPanel extends AbstractSettingsPanel {
Keys.AUTO_COMMIT,
Keys.GIT_INIT,
Keys.DELETE_ORPHANED,
Keys.SORT_UNORDERED,
Keys.COMMIT_MESSAGE,
Keys.GIT_AUTHOR,
Keys.GIT_EMAIL,
Expand Down Expand Up @@ -313,6 +315,9 @@ private JPanel buildOptionsPanel() {
autoCommitCheckbox = createCheckBox("Auto commit after operations");
gitInitCheckbox = createCheckBox("Initialise git repository if missing");
deleteOrphanedCheckbox = createCheckBox("Delete orphaned files on pull");
sortUnorderedCheckbox = createCheckBox("Sort unordered collections");
sortUnorderedCheckbox.setSelected(true);
sortUnorderedCheckbox.setToolTipText("On pull, sort collections Mirth stores in no fixed order so the XML stays stable and diffs stay clean. Uncheck to keep the server's order (--no-sort-unordered).");
registerCheckboxListener(forceCheckbox);
registerCheckboxListener(includeConfigurationMapCheckbox);
registerCheckboxListener(skipDisabledCheckbox);
Expand Down Expand Up @@ -346,6 +351,7 @@ private JPanel buildOptionsPanel() {
registerCheckboxListener(autoCommitCheckbox);
registerCheckboxListener(gitInitCheckbox);
registerCheckboxListener(deleteOrphanedCheckbox);
registerCheckboxListener(sortUnorderedCheckbox);

panel.add(forceCheckbox, "growx");
panel.add(includeConfigurationMapCheckbox, "growx, wrap");
Expand All @@ -370,6 +376,7 @@ private JPanel buildOptionsPanel() {
panel.add(gitInitCheckbox, "growx, wrap");

panel.add(deleteOrphanedCheckbox, "growx");
panel.add(sortUnorderedCheckbox, "growx, wrap");

return panel;
}
Expand Down Expand Up @@ -664,6 +671,7 @@ private Map<String, String> createEmptyPreset() {
preset.put(Keys.AUTO_COMMIT, Boolean.FALSE.toString());
preset.put(Keys.GIT_INIT, Boolean.FALSE.toString());
preset.put(Keys.DELETE_ORPHANED, Boolean.FALSE.toString());
preset.put(Keys.SORT_UNORDERED, Boolean.TRUE.toString());
preset.put(Keys.COMMIT_MESSAGE, "mirthsync commit");
preset.put(Keys.GIT_AUTHOR, "");
preset.put(Keys.GIT_EMAIL, "");
Expand Down Expand Up @@ -950,6 +958,7 @@ private Map<String, String> snapshotCurrentSettings() {
snapshot.put(Keys.AUTO_COMMIT, Boolean.toString(autoCommitCheckbox.isSelected()));
snapshot.put(Keys.GIT_INIT, Boolean.toString(gitInitCheckbox.isSelected()));
snapshot.put(Keys.DELETE_ORPHANED, Boolean.toString(deleteOrphanedCheckbox.isSelected()));
snapshot.put(Keys.SORT_UNORDERED, Boolean.toString(sortUnorderedCheckbox.isSelected()));
snapshot.put(Keys.COMMIT_MESSAGE, textOrEmpty(commitMessageField));
snapshot.put(Keys.GIT_AUTHOR, textOrEmpty(gitAuthorField));
snapshot.put(Keys.GIT_EMAIL, textOrEmpty(gitEmailField));
Expand Down Expand Up @@ -1012,6 +1021,7 @@ private void applyPresetValues(Map<String, String> preset) {
autoCommitCheckbox.setSelected(Boolean.parseBoolean(preset.getOrDefault(Keys.AUTO_COMMIT, "false")));
gitInitCheckbox.setSelected(Boolean.parseBoolean(preset.getOrDefault(Keys.GIT_INIT, "false")));
deleteOrphanedCheckbox.setSelected(Boolean.parseBoolean(preset.getOrDefault(Keys.DELETE_ORPHANED, "false")));
sortUnorderedCheckbox.setSelected(parseBooleanOrDefault(preset.get(Keys.SORT_UNORDERED), true));

commitMessageField.setText(preset.getOrDefault(Keys.COMMIT_MESSAGE, "mirthsync commit"));

Expand All @@ -1032,6 +1042,18 @@ private void applyPresetValues(Map<String, String> preset) {
setSaveEnabled(true);
}

/**
* For settings added after presets/properties were first saved: a missing
* key, or the blank value serializePresetValues writes for one, means the
* default rather than false.
*/
private boolean parseBooleanOrDefault(String value, boolean defaultValue) {
if (isBlank(value)) {
return defaultValue;
}
return Boolean.parseBoolean(value.trim());
}

private int parseIntOrDefault(String value, int defaultValue) {
if (isBlank(value)) {
return defaultValue;
Expand Down Expand Up @@ -1356,6 +1378,8 @@ private List<String> buildExecutionArguments() {
addFlag(args, autoCommitCheckbox.isSelected(), "--auto-commit");
addFlag(args, gitInitCheckbox.isSelected(), "--git-init");
addFlag(args, deleteOrphanedCheckbox.isSelected(), "--delete-orphaned");
// Sorting is mirthsync's default (3.8.0+), so only the opt-out is passed.
addFlag(args, !sortUnorderedCheckbox.isSelected(), "--no-sort-unordered");

args.add(actionOption.getCliValue());

Expand Down Expand Up @@ -1860,6 +1884,7 @@ private static final class Keys {
static final String AUTO_COMMIT = "autoCommit";
static final String GIT_INIT = "gitInit";
static final String DELETE_ORPHANED = "deleteOrphaned";
static final String SORT_UNORDERED = "sortUnordered";
static final String COMMIT_MESSAGE = "commitMessage";
static final String GIT_AUTHOR = "gitAuthor";
static final String GIT_EMAIL = "gitEmail";
Expand Down Expand Up @@ -2149,6 +2174,7 @@ public void doRefresh() {
autoCommitCheckbox.setSelected(Boolean.parseBoolean(properties.getProperty(Keys.AUTO_COMMIT, "false")));
gitInitCheckbox.setSelected(Boolean.parseBoolean(properties.getProperty(Keys.GIT_INIT, "false")));
deleteOrphanedCheckbox.setSelected(Boolean.parseBoolean(properties.getProperty(Keys.DELETE_ORPHANED, "false")));
sortUnorderedCheckbox.setSelected(parseBooleanOrDefault(properties.getProperty(Keys.SORT_UNORDERED), true));

commitMessageField.setText(properties.getProperty(Keys.COMMIT_MESSAGE, "mirthsync commit"));
gitAuthorField.setText(properties.getProperty(Keys.GIT_AUTHOR, ""));
Expand Down Expand Up @@ -2202,6 +2228,7 @@ private Properties buildProperties() {
properties.setProperty(Keys.AUTO_COMMIT, Boolean.toString(autoCommitCheckbox.isSelected()));
properties.setProperty(Keys.GIT_INIT, Boolean.toString(gitInitCheckbox.isSelected()));
properties.setProperty(Keys.DELETE_ORPHANED, Boolean.toString(deleteOrphanedCheckbox.isSelected()));
properties.setProperty(Keys.SORT_UNORDERED, Boolean.toString(sortUnorderedCheckbox.isSelected()));

properties.setProperty(Keys.COMMIT_MESSAGE, textOrEmpty(commitMessageField));
properties.setProperty(Keys.GIT_AUTHOR, textOrEmpty(gitAuthorField));
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<groupId>com.saga-it</groupId>
<artifactId>mirthsync-plugin</artifactId>
<version>0.0.5</version>
<version>0.0.6</version>
<packaging>pom</packaging>

<url>https://saga-it.com/products/mirthsync-plugin</url>
Expand Down
4 changes: 2 additions & 2 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.saga-it</groupId>
<artifactId>mirthsync-plugin</artifactId>
<version>0.0.5</version>
<version>0.0.6</version>
</parent>

<artifactId>server</artifactId>
Expand Down Expand Up @@ -232,7 +232,7 @@
<dependency>
<groupId>com.saga-it</groupId>
<artifactId>mirthsync</artifactId>
<version>3.7.0</version>
<version>3.8.1</version>
</dependency>

</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion shared/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>com.saga-it</groupId>
<artifactId>mirthsync-plugin</artifactId>
<version>0.0.5</version>
<version>0.0.6</version>
</parent>

<properties>
Expand Down
Loading