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..693ef384ef --- /dev/null +++ b/bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/SignerInfoFieldImpl.java @@ -0,0 +1,80 @@ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~ 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 { + + 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 = PN_COUNTRY_CODE_SOURCE) + private String countryCodeSource; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_EMAIL) + private String email; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_EMAIL_SOURCE) + private String emailSource; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_PHONE_SOURCE) + private String phoneSource; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_RECIPIENT_ROLE) + private String recipientRole; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_DELEGATES_TO) + private String delegatesTo; + + @ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = PN_SECURITY_OPTION) + private String securityOption; + + public Map getSignerFieldMap() { + Map signerField = new LinkedHashMap<>(); + 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; + } + +} \ 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..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 @@ -57,6 +57,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; @@ -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,12 @@ protected boolean getEditMode() { if (!associateProperties.isEmpty()) { properties.put(CUSTOM_ASSOCIATE_PROPERTY_WRAPPER, associateProperties); } + + Resource signerInfoResource = resource.getChild(CUSTOM_SIGNER_PROPERTY_WRAPPER); + if (signerInfoResource != null) { + properties.put(CUSTOM_SIGNER_PROPERTY_WRAPPER, 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 @@ +