From c6c85709d653d577a09bae2d4230ee0abc6c9eef Mon Sep 17 00:00:00 2001 From: Ikshu Jain Date: Sat, 13 Jun 2026 20:13:27 +0530 Subject: [PATCH 1/3] FORMS-25687: Adobe Sign backend integration --- .../internal/models/v1/form/PanelImpl.java | 7 ++ .../models/v1/form/SignerInfoFieldImpl.java | 72 +++++++++++++++++++ .../models/v1/form/SignerInfoImpl.java | 47 ++++++++++++ .../core/components/models/form/Panel.java | 11 +++ .../components/models/form/SignerInfo.java | 48 +++++++++++++ .../util/AbstractFormComponentImpl.java | 20 ++++-- .../v2/container/_cq_dialog/.content.xml | 6 ++ 7 files changed, 205 insertions(+), 6 deletions(-) create mode 100644 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java create mode 100644 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoImpl.java create mode 100644 bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/SignerInfo.java diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PanelImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PanelImpl.java index 0d32ad9502..a2c0aab03b 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PanelImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/PanelImpl.java @@ -120,6 +120,13 @@ public Boolean isReadOnly() { return readOnly; } + @Override + @JsonInclude(JsonInclude.Include.NON_NULL) + @Nullable + public boolean isWrapData() { + return wrapData; + } + @Override @JsonIgnore @NotNull diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java new file mode 100644 index 0000000000..ed24f63666 --- /dev/null +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java @@ -0,0 +1,72 @@ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~ Copyright 2026 Adobe +~ +~ Licensed under the Apache License, Version 2.0 (the "License"); +~ you may not use this file except in compliance with the License. +~ You may obtain a copy of the License at +~ +~ http://www.apache.org/licenses/LICENSE-2.0 +~ +~ Unless required by applicable law or agreed to in writing, software +~ distributed under the License is distributed on an "AS IS" BASIS, +~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~ See the License for the specific language governing permissions and +~ limitations under the License. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +package com.adobe.cq.forms.core.components.internal.models.v1.form; + +import java.util.LinkedHashMap; +import java.util.Map; + +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.Model; +import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; +import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; + +import com.adobe.cq.export.json.ExporterConstants; + +@Model(adaptables = Resource.class) +@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) +public class SignerInfoFieldImpl { + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "signerTitle") + private String signerTitle; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "countryCodeSource") + private String countryCodeSource; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "email") + private String email; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "emailSource") + private String emailSource; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "phoneSource") + private String phoneSource; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "recipientRole") + private String recipientRole; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "delegatesTo") + private String delegatesTo; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "securityOption") + private String securityOption; + + public Map getSignerFieldMap() { + Map signerField = new LinkedHashMap<>(); + ; + signerField.put("signerTitle", signerTitle); + signerField.put("countryCodeSource", countryCodeSource); + signerField.put("email", email); + signerField.put("emailSource", emailSource); + signerField.put("phoneSource", phoneSource); + signerField.put("recipientRole", recipientRole); + signerField.put("delegatesTo", delegatesTo); + signerField.put("securityOption", securityOption); + return signerField; + } + +} \ No newline at end of file diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoImpl.java new file mode 100644 index 0000000000..1f34ed2b0b --- /dev/null +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoImpl.java @@ -0,0 +1,47 @@ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Copyright 2026 Adobe + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +package com.adobe.cq.forms.core.components.internal.models.v1.form; + +import java.util.*; + +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.Model; + +import com.adobe.aemds.guide.model.SignerInfo; +import com.adobe.aemds.guide.model.SignerResource; +import com.adobe.cq.export.json.ExporterConstants; + +@Model(adaptables = Resource.class) +@Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) +public class SignerInfoImpl { + public static Map getSignerDetails(Resource signerInfoResource) { + Map signerProperties = new LinkedHashMap<>(); + SignerResource signerResource = signerInfoResource.adaptTo(SignerResource.class); + if (signerResource == null) { + return signerProperties; + } + signerProperties.put("firstSignerFormFiller", signerResource.isFirstSignerFormFiller()); + signerProperties.put("workflowType", signerResource.getWorkflowType()); + if (signerResource.getAllSignerInfo().size() > 0) { + List signersList = signerResource.getAllSignerInfo(); + signerProperties.put("signers", signersList); + } + return signerProperties; + } + +} \ No newline at end of file diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Panel.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Panel.java index 2ba29fed56..0968b161fb 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Panel.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Panel.java @@ -36,4 +36,15 @@ public interface Panel extends Container, ContainerConstraint { default Boolean isReadOnly() { return null; } + + /** + * Checks if the container is wrap data. + * + * @return {@code true} if the container is wrap data, {@code false} otherwise + * @since com.adobe.cq.forms.core.components.models.form 5.3.0 + */ + default boolean isWrapData() { + return false; + } + } diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/SignerInfo.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/SignerInfo.java new file mode 100644 index 0000000000..ce6dea3b8c --- /dev/null +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/SignerInfo.java @@ -0,0 +1,48 @@ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ Copyright 2026 Adobe + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +package com.adobe.cq.forms.core.components.models.form; + +import org.osgi.annotation.versioning.ConsumerType; + +@ConsumerType +public interface SignerInfo { + + /** + * Check if first signer form filler + * + * @return the firstSignerFormFiller + * @since com.adobe.cq.forms.core.components.models.form 0.0.1 + */ + String getFirstSignerFormFiller(); + + /** + * Returns the workflow type + * + * @return the signer's email + * @since com.adobe.cq.forms.core.components.models.form 0.0.1 + */ + String getWorkflowType(); + + /** + * Returns the signer + * + * @return the signer + * @since com.adobe.cq.forms.core.components.models.form 0.0.1 + */ + String[] getSigners(); + +} \ No newline at end of file diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java index 1bc880b674..8bf6eb0175 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java @@ -41,10 +41,7 @@ import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ValueMap; import org.apache.sling.models.annotations.Default; -import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; -import org.apache.sling.models.annotations.injectorspecific.ScriptVariable; -import org.apache.sling.models.annotations.injectorspecific.SlingObject; -import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; +import org.apache.sling.models.annotations.injectorspecific.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; @@ -57,6 +54,7 @@ import com.adobe.cq.forms.core.components.internal.form.FeatureToggleConstants; import com.adobe.cq.forms.core.components.internal.form.FormConstants; import com.adobe.cq.forms.core.components.internal.form.ReservedProperties; +import com.adobe.cq.forms.core.components.internal.models.v1.form.SignerInfoImpl; import com.adobe.cq.forms.core.components.models.form.BaseConstraint; import com.adobe.cq.forms.core.components.models.form.FieldType; import com.adobe.cq.forms.core.components.models.form.FormComponent; @@ -129,6 +127,9 @@ public class AbstractFormComponentImpl extends AbstractComponentImpl implements @Nullable protected Style currentStyle; + @ChildResource(injectionStrategy = InjectionStrategy.OPTIONAL, name = "fd:signerInfo") + private Resource signerInfoResource; + @Nullable @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_VIEWTYPE) protected String viewType; @@ -308,6 +309,7 @@ protected boolean getEditMode() { public static final String CUSTOM_ASSOCIATE_PROPERTY_WRAPPER = "fd:associate"; public static final String CUSTOM_DOR_PROPERTY_WRAPPER = "fd:dor"; + public static final String CUSTOM_SIGNER_PROPERTY_WRAPPER = "fd:signerInfo"; public static final String CUSTOM_DOR_CONTAINER_WRAPPER = "dorContainer"; // used for DOR and SPA editor to work public static final String CUSTOM_JCR_PATH_PROPERTY_WRAPPER = "fd:path"; @@ -336,8 +338,9 @@ protected boolean getEditMode() { if (!getCustomLayoutProperties().isEmpty()) { properties.put(CUSTOM_PROPERTY_WRAPPER, getCustomLayoutProperties()); } - if (!getDorProperties().isEmpty()) { - properties.put(CUSTOM_DOR_PROPERTY_WRAPPER, getDorProperties()); + Map dorProperties = getDorProperties(); + if (!dorProperties.isEmpty()) { + properties.put(CUSTOM_DOR_PROPERTY_WRAPPER, dorProperties); } Map annotations = getCqAnnotations(); if (annotations != null) { @@ -358,6 +361,11 @@ protected boolean getEditMode() { if (!associateProperties.isEmpty()) { properties.put(CUSTOM_ASSOCIATE_PROPERTY_WRAPPER, associateProperties); } + + if (signerInfoResource != null) { + properties.put("fd:signerInfo", SignerInfoImpl.getSignerDetails(signerInfoResource)); + } + return properties; } diff --git a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/_cq_dialog/.content.xml b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/_cq_dialog/.content.xml index 9ce011f785..62c53f44aa 100644 --- a/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/_cq_dialog/.content.xml +++ b/ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/container/v2/container/_cq_dialog/.content.xml @@ -416,6 +416,12 @@ + Date: Tue, 23 Jun 2026 11:36:23 +0530 Subject: [PATCH 2/3] FORMS-25687: Addressing comments --- .../models/v1/form/SignerInfoFieldImpl.java | 42 +++++++++++-------- .../util/AbstractFormComponentImpl.java | 6 ++- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java index ed24f63666..693ef384ef 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java @@ -31,41 +31,49 @@ @Exporter(name = ExporterConstants.SLING_MODEL_EXPORTER_NAME, extensions = ExporterConstants.SLING_MODEL_EXTENSION) public class SignerInfoFieldImpl { - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "signerTitle") + private static final String PN_SIGNER_TITLE = "signerTitle"; + private static final String PN_COUNTRY_CODE_SOURCE = "countryCodeSource"; + private static final String PN_EMAIL = "email"; + private static final String PN_EMAIL_SOURCE = "emailSource"; + private static final String PN_PHONE_SOURCE = "phoneSource"; + private static final String PN_RECIPIENT_ROLE = "recipientRole"; + private static final String PN_DELEGATES_TO = "delegatesTo"; + private static final String PN_SECURITY_OPTION = "securityOption"; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_SIGNER_TITLE) private String signerTitle; - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "countryCodeSource") + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_COUNTRY_CODE_SOURCE) private String countryCodeSource; - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "email") + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_EMAIL) private String email; - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "emailSource") + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_EMAIL_SOURCE) private String emailSource; - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "phoneSource") + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_PHONE_SOURCE) private String phoneSource; - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "recipientRole") + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_RECIPIENT_ROLE) private String recipientRole; - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "delegatesTo") + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_DELEGATES_TO) private String delegatesTo; - @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = "securityOption") + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_SECURITY_OPTION) private String securityOption; public Map getSignerFieldMap() { Map signerField = new LinkedHashMap<>(); - ; - signerField.put("signerTitle", signerTitle); - signerField.put("countryCodeSource", countryCodeSource); - signerField.put("email", email); - signerField.put("emailSource", emailSource); - signerField.put("phoneSource", phoneSource); - signerField.put("recipientRole", recipientRole); - signerField.put("delegatesTo", delegatesTo); - signerField.put("securityOption", securityOption); + signerField.put(PN_SIGNER_TITLE, signerTitle); + signerField.put(PN_COUNTRY_CODE_SOURCE, countryCodeSource); + signerField.put(PN_EMAIL, email); + signerField.put(PN_EMAIL_SOURCE, emailSource); + signerField.put(PN_PHONE_SOURCE, phoneSource); + signerField.put(PN_RECIPIENT_ROLE, recipientRole); + signerField.put(PN_DELEGATES_TO, delegatesTo); + signerField.put(PN_SECURITY_OPTION, securityOption); return signerField; } diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java index 8bf6eb0175..15b9f4e1ac 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java @@ -41,7 +41,11 @@ import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ValueMap; import org.apache.sling.models.annotations.Default; -import org.apache.sling.models.annotations.injectorspecific.*; +import org.apache.sling.models.annotations.injectorspecific.ChildResource; +import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; +import org.apache.sling.models.annotations.injectorspecific.ScriptVariable; +import org.apache.sling.models.annotations.injectorspecific.SlingObject; +import org.apache.sling.models.annotations.injectorspecific.ValueMapValue; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; From 862c1be061ac64cc3b8be5b906ca58f36c56ecd0 Mon Sep 17 00:00:00 2001 From: Ikshu Jain Date: Wed, 24 Jun 2026 01:30:42 +0530 Subject: [PATCH 3/3] FORMS-25687: Addressing comments --- .../core/components/util/AbstractFormComponentImpl.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java index 15b9f4e1ac..d1889ae76c 100644 --- a/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractFormComponentImpl.java @@ -41,7 +41,6 @@ import org.apache.sling.api.resource.Resource; import org.apache.sling.api.resource.ValueMap; import org.apache.sling.models.annotations.Default; -import org.apache.sling.models.annotations.injectorspecific.ChildResource; import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy; import org.apache.sling.models.annotations.injectorspecific.ScriptVariable; import org.apache.sling.models.annotations.injectorspecific.SlingObject; @@ -131,9 +130,6 @@ public class AbstractFormComponentImpl extends AbstractComponentImpl implements @Nullable protected Style currentStyle; - @ChildResource(injectionStrategy = InjectionStrategy.OPTIONAL, name = "fd:signerInfo") - private Resource signerInfoResource; - @Nullable @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_VIEWTYPE) protected String viewType; @@ -366,8 +362,9 @@ protected boolean getEditMode() { properties.put(CUSTOM_ASSOCIATE_PROPERTY_WRAPPER, associateProperties); } + Resource signerInfoResource = resource.getChild(CUSTOM_SIGNER_PROPERTY_WRAPPER); if (signerInfoResource != null) { - properties.put("fd:signerInfo", SignerInfoImpl.getSignerDetails(signerInfoResource)); + properties.put(CUSTOM_SIGNER_PROPERTY_WRAPPER, SignerInfoImpl.getSignerDetails(signerInfoResource)); } return properties;