Skip to content

Commit 72b26d5

Browse files
authored
Merge pull request #1668 from adobe/master_650-2407
MasterTo650_3007
2 parents 80657ca + b97a34f commit 72b26d5

File tree

210 files changed

+11346
-1070
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

210 files changed

+11346
-1070
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"accessibilityExceptionList": ["landmark-one-main", "label-title-only", "region", "focus-order-semantics", "target-size", "page-has-heading-one"]
2+
"accessibilityExceptionList": ["landmark-one-main", "label-title-only", "region", "focus-order-semantics", "target-size", "page-has-heading-one", "aria-required-attr", "empty-heading"]
33
}

.circleci/ci/it-tests.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,52 @@ try {
8484
// Set an environment variable indicating test was executed
8585
// this is used in case of re-run failed test scenario
8686
ci.sh("sed -i 's/false/true/' /home/circleci/build/TEST_EXECUTION_STATUS.txt")
87+
88+
// Update to OpenSSL 3 for security in classic AEM environments only
89+
// if (AEM === 'classic' || AEM === 'classic-latest' || AEM === 'classic-latest-cp') {
90+
// ci.stage('Updating to OpenSSL 3 in AEM Docker Container');
91+
// try {
92+
// // Find containers running the specific circleci-aem:6.5 image
93+
// const containerInfo = ci.sh('docker ps --format "{{.Names}}\t{{.Image}}"', true, false)
94+
// .split('\n')
95+
// .filter(line => line.trim())
96+
// .map(line => {
97+
// const [name, image] = line.split('\t');
98+
// return { name: name.trim(), image: image.trim() };
99+
// });
100+
101+
// console.log('Running containers:', containerInfo);
102+
103+
// // Filter for only the specific AEM image we want to update
104+
// const targetContainers = containerInfo.filter(container =>
105+
// container.image.includes('circleci-aem:6.5')
106+
// );
107+
108+
// if (targetContainers.length === 0) {
109+
// console.log('No circleci-aem:6.5 containers found, skipping OpenSSL 3 update');
110+
// } else {
111+
// // Update to OpenSSL 3 in the specific AEM containers
112+
// for (const container of targetContainers) {
113+
// console.log(`Updating to OpenSSL 3 in container: ${container.name} (image: ${container.image})`);
114+
// try {
115+
// // Check current OpenSSL version
116+
// ci.sh(`docker exec ${container.name} openssl version || echo "Current version check failed for ${container.name}"`);
117+
118+
// // Update package lists and install OpenSSL 3
119+
// ci.sh(`docker exec ${container.name} sh -c "apt-get update -qq && apt-get install -y openssl libssl3 libssl-dev || (sudo apt-get update -qq && sudo apt-get install -y openssl libssl3 libssl-dev)" || echo "OpenSSL 3 install failed for ${container.name}"`);
120+
121+
// // Verify OpenSSL 3 installation
122+
// ci.sh(`docker exec ${container.name} sh -c "openssl version && openssl version | grep -q '3\\.' && echo 'OpenSSL 3 successfully installed' || echo 'Warning: OpenSSL 3 not detected'" || echo "Version verification failed for ${container.name}"`);
123+
// } catch (containerError) {
124+
// console.log(`Failed to update OpenSSL 3 in ${container.name}:`, containerError.message);
125+
// }
126+
// }
127+
// }
128+
// } catch (error) {
129+
// console.log('OpenSSL 3 update in containers failed, continuing with existing version:', error.message);
130+
// }
131+
// }
132+
87133
// Start CQ
88134
ci.sh(`./qp.sh -v start --id author --runmode author --port 4502 --qs-jar /home/circleci/cq/author/cq-quickstart.jar \
89135
--bundle org.apache.sling:org.apache.sling.junit.core:1.0.23:jar \

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ See [AEM Sites Core Components](https://docs.adobe.com/content/help/en/experienc
5050
- [Terms and Conditions](ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/termsandconditions/v1/termsandconditions)
5151
- [Checkbox](ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/checkbox/v1/checkbox)
5252
- [Review](ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/review/v1/review)
53-
- [Turnstile](ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/turnstile/v1/turnstile)
5453

5554

5655
## System Requirements

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/FormConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,4 +142,8 @@ private FormConstants() {
142142

143143
/** Form definition type indicating submission view */
144144
public static final String FORM_DEFINITION_SUBMISSION = "submission";
145+
146+
/** The resource type for date time input field v1 */
147+
public static final String RT_FD_FORM_DATETIME_V1 = RT_FD_FORM_PREFIX + "datetime/v1/datetime";
148+
145149
}

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/form/ReservedProperties.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,20 @@ private ReservedProperties() {
7474
public static final String PN_PLACEHOLDER = "placeholder";
7575
public static final String PN_READ_ONLY = "readOnly";
7676
public static final String PN_DEFAULT_VALUE = "default";
77+
public static final String PN_EMPTY_VALUE = "fd:emptyValue";
7778
public static final String PN_MULTI_DEFAULT_VALUES = "fd:multiDefaultValues";
7879
public static final String PN_FORMAT = "format";
7980
public static final String PN_DISPLAY_FORMAT = "displayFormat";
81+
public static final String PN_CUSTOM_DISPLAY_FORMAT = "fd:customDisplayFormat";
8082
public static final String PN_EDIT_FORMAT = "editFormat";
8183
public static final String PN_DISPLAY_VALUE_EXPRESSION = "displayValueExpression";
8284
public static final String PN_DATA_FORMAT = "dataFormat";
8385
public static final String PN_MIN_LENGTH = "minLength";
8486
public static final String PN_MAX_LENGTH = "maxLength";
8587
public static final String PN_MINIMUM_DATE = "minimumDate";
8688
public static final String PN_MAXIMUM_DATE = "maximumDate";
89+
public static final String PN_MINIMUM_DATE_TIME = "minimumDateTime";
90+
public static final String PN_MAXIMUM_DATE_TIME = "maximumDateTime";
8791
public static final String PN_MAXIMUM = "maximum";
8892
public static final String PN_MINIMUM = "minimum";
8993
public static final String PN_EXCLUSIVE_MINIMUM = "exclusiveMinimum";
@@ -163,7 +167,8 @@ private ReservedProperties() {
163167
public static final String FD_ENABLE_AUTO_SAVE = "fd:enableAutoSave";
164168
public static final String FD_AUTO_SAVE_STRATEGY_TYPE = "fd:autoSaveStrategyType";
165169
public static final String FD_AUTO_SAVE_INTERVAL = "fd:autoSaveInterval";
166-
public static final String FD_EXCLUDE_FROM_DOR_IF_HIDDEN = "excludeFromDoRIfHidden";
170+
public static final String FD_EXCLUDE_FROM_DOR_IF_HIDDEN = "fd:excludeFromDoRIfHidden";
171+
public static final String FD_DIALOG_LABEL = "fd:dialogLabel";
167172

168173
public static final String FD_DRAFT_ID = "fd:draftId";
169174

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
~ Copyright 2025 Adobe
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16+
17+
package com.adobe.cq.forms.core.components.internal.models.v1.form;
18+
19+
import java.time.OffsetDateTime;
20+
import java.time.format.DateTimeFormatter;
21+
import java.util.Map;
22+
23+
import javax.annotation.Nullable;
24+
25+
import org.apache.sling.api.SlingHttpServletRequest;
26+
import org.apache.sling.api.resource.Resource;
27+
import org.apache.sling.models.annotations.Exporter;
28+
import org.apache.sling.models.annotations.Model;
29+
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
30+
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
31+
import org.jetbrains.annotations.NotNull;
32+
33+
import com.adobe.cq.export.json.ComponentExporter;
34+
import com.adobe.cq.export.json.ExporterConstants;
35+
import com.adobe.cq.forms.core.components.internal.form.FormConstants;
36+
import com.adobe.cq.forms.core.components.models.form.*;
37+
import com.adobe.cq.forms.core.components.util.AbstractFieldImpl;
38+
import com.adobe.xfa.ut.StringUtils;
39+
import com.fasterxml.jackson.annotation.JsonFormat;
40+
41+
@Model(
42+
adaptables = { SlingHttpServletRequest.class, Resource.class },
43+
adapters = { DateTime.class, ComponentExporter.class },
44+
resourceType = { FormConstants.RT_FD_FORM_DATETIME_V1 })
45+
@Exporter(
46+
name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
47+
extensions = ExporterConstants.SLING_MODEL_EXTENSION)
48+
public class DateTimeImpl extends AbstractFieldImpl implements DateTime {
49+
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL)
50+
@Nullable
51+
private String pattern;
52+
53+
@Override
54+
public String getFieldType() {
55+
return super.getFieldType(FieldType.DATETIME_INPUT);
56+
}
57+
58+
@Override
59+
public String getMinimumDateTime() {
60+
return getFormattedDate(minimumDateTime);
61+
}
62+
63+
@Override
64+
public String getMaximumDateTime() {
65+
return getFormattedDate(maximumDateTime);
66+
}
67+
68+
private String getFormattedDate(String dateTime) {
69+
if (!StringUtils.isEmpty(dateTime)) {
70+
OffsetDateTime formattedTime = OffsetDateTime.parse(dateTime);
71+
return formattedTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm"));
72+
}
73+
return dateTime;
74+
75+
}
76+
77+
public @NotNull Map<ConstraintType, String> getConstraintMessages() {
78+
Map<ConstraintType, String> res = super.getConstraintMessages();
79+
String msg = getConstraintMessage(ConstraintType.MINIMUM);
80+
if (msg != null) {
81+
res.put(ConstraintType.MINIMUM, msg);
82+
}
83+
msg = getConstraintMessage(ConstraintType.MAXIMUM);
84+
if (msg != null) {
85+
res.put(ConstraintType.MAXIMUM, msg);
86+
}
87+
return res;
88+
}
89+
90+
@Override
91+
@Nullable
92+
public String getFormat() {
93+
return "date-time";
94+
}
95+
96+
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Base.DATE_TIME_FORMATTER, timezone = "UTC")
97+
@Override
98+
public Object[] getDefault() {
99+
return defaultValue != null ? defaultValue.clone() : null;
100+
}
101+
102+
}

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/FragmentImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
import com.adobe.cq.forms.core.components.models.form.FormContainer;
4444
import com.adobe.cq.forms.core.components.models.form.Fragment;
4545
import com.adobe.cq.forms.core.components.util.ComponentUtils;
46+
import com.adobe.cq.forms.core.components.views.Views;
4647
import com.fasterxml.jackson.annotation.JsonIgnore;
48+
import com.fasterxml.jackson.annotation.JsonView;
4749

4850
@Model(
4951
adaptables = { SlingHttpServletRequest.class, Resource.class },
@@ -80,7 +82,7 @@ private void initFragmentModel() {
8082
}
8183
}
8284

83-
@JsonIgnore
85+
@JsonView(Views.Author.class)
8486
public String getFragmentPath() {
8587
return fragmentPath;
8688
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
~ Copyright 2025 Adobe
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
16+
17+
package com.adobe.cq.forms.core.components.internal.models.v1.form;
18+
19+
import java.util.Map;
20+
21+
import org.apache.sling.api.SlingHttpServletRequest;
22+
import org.apache.sling.api.resource.Resource;
23+
import org.apache.sling.models.annotations.Default;
24+
import org.apache.sling.models.annotations.Exporter;
25+
import org.apache.sling.models.annotations.Model;
26+
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
27+
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
28+
import org.jetbrains.annotations.NotNull;
29+
30+
import com.adobe.cq.export.json.ComponentExporter;
31+
import com.adobe.cq.export.json.ExporterConstants;
32+
import com.adobe.cq.forms.core.components.internal.form.ReservedProperties;
33+
import com.adobe.cq.forms.core.components.models.form.FieldType;
34+
import com.adobe.cq.forms.core.components.models.form.Scribble;
35+
import com.adobe.cq.forms.core.components.util.AbstractFieldImpl;
36+
import com.fasterxml.jackson.annotation.JsonIgnore;
37+
import com.fasterxml.jackson.annotation.JsonInclude;
38+
39+
@Model(
40+
adaptables = { SlingHttpServletRequest.class, Resource.class },
41+
adapters = { Scribble.class, ComponentExporter.class },
42+
resourceType = "core/fd/components/form/scribble/v1/scribble")
43+
@Exporter(
44+
name = ExporterConstants.SLING_MODEL_EXPORTER_NAME,
45+
extensions = ExporterConstants.SLING_MODEL_EXTENSION)
46+
public class ScribbleImpl extends AbstractFieldImpl implements Scribble {
47+
48+
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL)
49+
@JsonInclude(JsonInclude.Include.NON_EMPTY)
50+
private String value;
51+
52+
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.FD_DIALOG_LABEL)
53+
@Default(values = Scribble.DEFAULT_DIALOG_LABEL)
54+
protected String dialogLabel;
55+
56+
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_FORMAT)
57+
@JsonInclude(JsonInclude.Include.NON_NULL)
58+
protected String format;
59+
60+
@Override
61+
public String getValue() {
62+
return value;
63+
}
64+
65+
@JsonIgnore
66+
public String getDialogLabel() {
67+
return dialogLabel;
68+
}
69+
70+
@Override
71+
public String getFormat() {
72+
return format;
73+
}
74+
75+
@Override
76+
public String getFieldType() {
77+
return super.getFieldType(FieldType.FILE_INPUT);
78+
}
79+
80+
@Override
81+
public @NotNull Map<String, Object> getProperties() {
82+
Map<String, Object> customProperties = super.getProperties();
83+
customProperties.put(ReservedProperties.PN_VIEWTYPE, "signature");
84+
if (getDialogLabel() != null)
85+
customProperties.put(ReservedProperties.FD_DIALOG_LABEL, getDialogLabel());
86+
return customProperties;
87+
}
88+
}

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v2/form/FormContainerImpl.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222
import java.util.function.Consumer;
2323

2424
import javax.annotation.PostConstruct;
25+
import javax.inject.Inject;
2526

2627
import org.apache.commons.lang3.StringUtils;
2728
import org.apache.http.osgi.services.HttpClientBuilderFactory;
2829
import org.apache.sling.api.SlingHttpServletRequest;
2930
import org.apache.sling.api.resource.Resource;
31+
import org.apache.sling.api.resource.ResourceResolver;
3032
import org.apache.sling.api.resource.ValueMap;
3133
import org.apache.sling.models.annotations.Default;
3234
import org.apache.sling.models.annotations.Exporter;
@@ -156,6 +158,9 @@ public class FormContainerImpl extends AbstractContainerImpl implements FormCont
156158
@Self(injectionStrategy = InjectionStrategy.OPTIONAL)
157159
private AutoSaveConfiguration autoSaveConfig;
158160

161+
@Inject
162+
private ResourceResolver resourceResolver;
163+
159164
@Override
160165
public String getFieldType() {
161166
return super.getFieldType(FieldType.FORM);
@@ -326,13 +331,13 @@ public String getAction() {
326331
ComponentUtils.getEncodedPath(resource.getPath() + ".model.json");
327332
}
328333
}
329-
return getContextPath() + ADOBE_GLOBAL_API_ROOT + FORMS_RUNTIME_API_GLOBAL_ROOT + "/submit/" + getId();
334+
return getContextPath() + resourceResolver.map(ADOBE_GLOBAL_API_ROOT + FORMS_RUNTIME_API_GLOBAL_ROOT + "/submit/" + getId());
330335
}
331336

332337
@Override
333338
@JsonIgnore
334339
public String getDataUrl() {
335-
return getContextPath() + ADOBE_GLOBAL_API_ROOT + FORMS_RUNTIME_API_GLOBAL_ROOT + "/data/" + getId();
340+
return getContextPath() + resourceResolver.map(ADOBE_GLOBAL_API_ROOT + FORMS_RUNTIME_API_GLOBAL_ROOT + "/data/" + getId());
336341
}
337342

338343
@Override
@@ -429,7 +434,7 @@ public Map<String, Object> getDorProperties() {
429434
customDorProperties.put(DOR_TEMPLATE_TYPE, dorTemplateType);
430435
}
431436
if (excludeFromDoRIfHidden != null) {
432-
customDorProperties.put(EXCLUDE_FROM_DOR_IF_HIDDEN, excludeFromDoRIfHidden);
437+
customDorProperties.put(ReservedProperties.FD_EXCLUDE_FROM_DOR_IF_HIDDEN, excludeFromDoRIfHidden);
433438
}
434439
return customDorProperties;
435440
}
@@ -470,7 +475,8 @@ public String getName() {
470475

471476
@Override
472477
public String getCustomFunctionUrl() {
473-
return getContextPath() + ADOBE_GLOBAL_API_ROOT + FORMS_RUNTIME_API_GLOBAL_ROOT + "/customfunctions/" + getId();
478+
return getContextPath() + resourceResolver.map(ADOBE_GLOBAL_API_ROOT + FORMS_RUNTIME_API_GLOBAL_ROOT + "/customfunctions/"
479+
+ getId());
474480
}
475481

476482
@JsonIgnore

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/models/form/Base.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
public interface Base extends FormComponent {
3636
public final String DATE_FORMATTER = "yyyy-MM-dd";
3737

38+
public final String DATE_TIME_FORMATTER = "yyyy-MM-dd'T'HH:mm:ss";
39+
3840
/**
3941
* Constant representing the default language used, typically "en-US".
4042
*

0 commit comments

Comments
 (0)