From 7bc16d4b7d5f10d257f415448f80e082901e027a Mon Sep 17 00:00:00 2001 From: gergina1 Date: Mon, 1 May 2017 11:56:24 -0400 Subject: [PATCH] PB-874. Remove updateRole that causes recreate Signers. Remove default values. Only add TitleBarOptions when values are set. Remove default FooterOptions. Make DocumentPackageAttributes LinkedHashMap to keep data fields order. --- .../com/silanis/esl/api/model/TitleBarOptions.java | 9 ++++----- .../silanis/esl/sdk/DocumentPackageAttributes.java | 8 ++++---- .../silanis/esl/sdk/DocumentPackageSettings.java | 2 +- .../builder/DocumentPackageSettingsBuilder.java | 2 +- .../converter/CeremonyLayoutSettingsConverter.java | 14 ++++++++------ .../silanis/esl/sdk/service/PackageService.java | 5 ----- 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/sdk/src/main/java/com/silanis/esl/api/model/TitleBarOptions.java b/sdk/src/main/java/com/silanis/esl/api/model/TitleBarOptions.java index 957acbd8c..d57d0747f 100644 --- a/sdk/src/main/java/com/silanis/esl/api/model/TitleBarOptions.java +++ b/sdk/src/main/java/com/silanis/esl/api/model/TitleBarOptions.java @@ -1,8 +1,7 @@ package com.silanis.esl.api.model; // -import com.fasterxml.jackson.annotation.*; -import java.util.List; -import java.util.ArrayList; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.silanis.esl.api.util.SchemaSanitizer; @JsonIgnoreProperties(ignoreUnknown=true) public class TitleBarOptions extends Model @@ -19,8 +18,8 @@ public class TitleBarOptions extends Model public TitleBarOptions ( ) {} // Fields - protected Boolean _progressBar = true; - protected Boolean _title = true; + protected Boolean _progressBar; + protected Boolean _title; // Accessors diff --git a/sdk/src/main/java/com/silanis/esl/sdk/DocumentPackageAttributes.java b/sdk/src/main/java/com/silanis/esl/sdk/DocumentPackageAttributes.java index 0562ed19b..4a86ad10f 100644 --- a/sdk/src/main/java/com/silanis/esl/sdk/DocumentPackageAttributes.java +++ b/sdk/src/main/java/com/silanis/esl/sdk/DocumentPackageAttributes.java @@ -1,6 +1,6 @@ package com.silanis.esl.sdk; -import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; /** @@ -10,21 +10,21 @@ */ public class DocumentPackageAttributes { - private Map contents = new HashMap(); + private Map contents = new LinkedHashMap(); public DocumentPackageAttributes() { } public void append( String name, Object value ) { if (null == contents) { - contents = new HashMap(); + contents = new LinkedHashMap(); } contents.put(name, value); } public void append( DocumentPackageAttributes attributes ) { if (null == contents) { - contents = new HashMap(); + contents = new LinkedHashMap(); } if(null != attributes && null != attributes.getContents()) { contents.putAll(attributes.getContents()); diff --git a/sdk/src/main/java/com/silanis/esl/sdk/DocumentPackageSettings.java b/sdk/src/main/java/com/silanis/esl/sdk/DocumentPackageSettings.java index 6252bde49..915f66b36 100644 --- a/sdk/src/main/java/com/silanis/esl/sdk/DocumentPackageSettings.java +++ b/sdk/src/main/java/com/silanis/esl/sdk/DocumentPackageSettings.java @@ -13,7 +13,7 @@ public class DocumentPackageSettings { private List declineReasons = new ArrayList(); private List optOutReasons = new ArrayList(); private Integer maxAuthAttempts = null; - private Boolean showDocumentToolbarDownloadButton = true; + private Boolean showDocumentToolbarDownloadButton; private Boolean showDialogOnComplete = null; private Boolean showPackageOwnerInPerson = null; private Boolean showLanguageDropDown = null; diff --git a/sdk/src/main/java/com/silanis/esl/sdk/builder/DocumentPackageSettingsBuilder.java b/sdk/src/main/java/com/silanis/esl/sdk/builder/DocumentPackageSettingsBuilder.java index 6137b26a4..2d1636ba9 100644 --- a/sdk/src/main/java/com/silanis/esl/sdk/builder/DocumentPackageSettingsBuilder.java +++ b/sdk/src/main/java/com/silanis/esl/sdk/builder/DocumentPackageSettingsBuilder.java @@ -22,7 +22,7 @@ public class DocumentPackageSettingsBuilder { private List declineReasons = new ArrayList(); private List optOutReasons = new ArrayList(); private Integer maxAuthAttempts = null; - private Boolean showDocumentToolbarDownloadButton = true; + private Boolean showDocumentToolbarDownloadButton = null; private Boolean showDialogOnComplete = null; private Boolean showPackageOwnerInPerson = null; private Boolean showLanguageDropDown = null; diff --git a/sdk/src/main/java/com/silanis/esl/sdk/internal/converter/CeremonyLayoutSettingsConverter.java b/sdk/src/main/java/com/silanis/esl/sdk/internal/converter/CeremonyLayoutSettingsConverter.java index 4c9988abb..71727fecd 100644 --- a/sdk/src/main/java/com/silanis/esl/sdk/internal/converter/CeremonyLayoutSettingsConverter.java +++ b/sdk/src/main/java/com/silanis/esl/sdk/internal/converter/CeremonyLayoutSettingsConverter.java @@ -44,15 +44,18 @@ public com.silanis.esl.api.model.LayoutOptions toAPILayoutOptions() { return apiLayoutOptions; } - TitleBarOptions titleBarOptions = new TitleBarOptions(); - titleBarOptions.safeSetTitle( sdkCeremonyLayoutSettings.getShowTitle() ); - titleBarOptions.safeSetProgressBar( sdkCeremonyLayoutSettings.getProgressBar() ); - HeaderOptions headerOptions = new HeaderOptions(); + + if (sdkCeremonyLayoutSettings.getShowTitle() != null || sdkCeremonyLayoutSettings.getProgressBar() != null) { + TitleBarOptions titleBarOptions = new TitleBarOptions(); + titleBarOptions.safeSetTitle(sdkCeremonyLayoutSettings.getShowTitle()); + titleBarOptions.safeSetProgressBar(sdkCeremonyLayoutSettings.getProgressBar()); + headerOptions.safeSetTitleBar(titleBarOptions); + } + headerOptions.safeSetBreadcrumbs( sdkCeremonyLayoutSettings.getBreadCrumbs() ); headerOptions.safeSetSessionBar( sdkCeremonyLayoutSettings.getSessionBar() ); headerOptions.safeSetGlobalNavigation( sdkCeremonyLayoutSettings.getGlobalNavigation() ); - headerOptions.safeSetTitleBar( titleBarOptions ); GlobalActionsOptions globalActionsOptions = new GlobalActionsOptions(); globalActionsOptions.safeSetConfirm( sdkCeremonyLayoutSettings.getShowGlobalConfirmButton() ); @@ -72,7 +75,6 @@ public com.silanis.esl.api.model.LayoutOptions toAPILayoutOptions() { com.silanis.esl.api.model.LayoutOptions result = new LayoutOptions(); result.safeSetIframe( sdkCeremonyLayoutSettings.getiFrame() ); result.safeSetNavigator( sdkCeremonyLayoutSettings.getNavigator() ); - result.safeSetFooter( new FooterOptions() ); result.safeSetHeader( headerOptions ); result.safeSetBrandingBar( brandingBarOptions ); diff --git a/sdk/src/main/java/com/silanis/esl/sdk/service/PackageService.java b/sdk/src/main/java/com/silanis/esl/sdk/service/PackageService.java index 240f9a4e3..46900d364 100644 --- a/sdk/src/main/java/com/silanis/esl/sdk/service/PackageService.java +++ b/sdk/src/main/java/com/silanis/esl/sdk/service/PackageService.java @@ -199,11 +199,6 @@ public void updatePackage( PackageId packageId, DocumentPackage sdkPackage ) thr } catch (Exception e) { throw new EslException("Could not update the package.", e); } - // Update roles - List roleList = aPackage.getRoles(); - for (Role role : roleList) { - updateRole(packageId, role); - } } /**