Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master to 650 3 july 24 #1301

Merged
merged 176 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
ccb2daf
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 Apr 15, 2024
153ca33
@releng [maven-scm] :prepare for next development iteration
barshat7 Apr 15, 2024
4967387
Update VERSIONS.md and README.md to include version 3.0.14
Apr 15, 2024
fae2e3a
Added condition on description and error message in aria-describedby
Apr 16, 2024
7a326df
Merge pull request #1192 from adobe/acc/err
barshat7 Apr 17, 2024
06d1f11
FORMS-12203: Added localization changes and test cases (#1152)
shivangimittal791 Apr 17, 2024
5c19a65
FORMS-12822 : format should not be visible when no pattern is selecte…
AnurudraS Apr 17, 2024
ab496c7
Revert "FORMS-12822 : format should not be visible when no pattern is…
rismehta Apr 17, 2024
c770451
FORMS-13851 Support for language in date picker and number input (#1169)
rismehta Apr 18, 2024
fa4651c
Added condition on description and error message in aria-describedby
Apr 16, 2024
c58343d
FORMS-12203: Added localization changes and test cases (#1152)
shivangimittal791 Apr 17, 2024
f0f6fae
FORMS-13851 Support for language in date picker and number input (#1169)
rismehta Apr 18, 2024
ad0490c
Merge pull request #1197 from adobe/devtomaster-18Apr
rismehta Apr 18, 2024
ad4f690
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 Apr 19, 2024
d825c78
@releng [maven-scm] :prepare for next development iteration
barshat7 Apr 19, 2024
7f470d9
Update VERSIONS.md and README.md to include version 3.0.16
Apr 19, 2024
7851278
FORMS-12822 : format should not be visible when no pattern is selecte…
AnurudraS Apr 22, 2024
63e3561
FORMS-14013 - Fixing default value check in dropdown (#1199)
TalmizAhmed Apr 23, 2024
1c11f2a
Revert "FORMS-14013 - Fixing default value check in dropdown (#1199)"
rismehta Apr 23, 2024
4d09843
FORMS-13209 - Added support for form submission handlers and correcte…
arunattri26 Apr 23, 2024
4848bd6
FORMS-12822 : format should not be visible when no pattern is selecte…
AnurudraS Apr 22, 2024
c2f2914
FORMS-14013 - Fixing default value check in dropdown (#1199)
TalmizAhmed Apr 23, 2024
8bab1a5
Revert "FORMS-14013 - Fixing default value check in dropdown (#1199)"
rismehta Apr 23, 2024
ce35b04
FORMS-13209 - Added support for form submission handlers and correcte…
arunattri26 Apr 23, 2024
681c790
Merge pull request #1207 from adobe/dev-to-master-29Apr
rismehta Apr 29, 2024
e9355af
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 Apr 29, 2024
4df9b29
@releng [maven-scm] :prepare for next development iteration
barshat7 Apr 29, 2024
395f306
Update VERSIONS.md and README.md to include version 3.0.18
Apr 29, 2024
ef7330d
FORMS-13935 update examples for aemcomponents.dev (#1204)
barshat7 Apr 29, 2024
8118d35
FORMS-14013 - Testcase added - Fixing Dropdown that had a selected va…
TalmizAhmed Apr 29, 2024
4995557
Forms 11746 allow attaching same file (#1201)
rajatofficial Apr 29, 2024
33ddc31
Read-only is not working in file-attachment (#1200)
pavi41 Apr 30, 2024
9de36fd
Readonly & Disable were not working in TNC component (#1211)
pavi41 May 2, 2024
9e94891
FORMS-14018 - Fix for dropdown not working when enumNames are not pro…
TalmizAhmed May 2, 2024
c227001
Moving to 15860 image (#1212)
rismehta May 2, 2024
4446d6b
FORMS-13811 | Adding rendition for hCaptcha (#1174)
navneet-ag May 3, 2024
2410b74
Added condition on description and error message in aria-describedby
Apr 16, 2024
e5959b2
FORMS-14013 - Fixing default value check in dropdown (#1199)
TalmizAhmed Apr 23, 2024
d78da59
Revert "FORMS-14013 - Fixing default value check in dropdown (#1199)"
rismehta Apr 23, 2024
f5bba4d
FORMS-13935 update examples for aemcomponents.dev (#1204)
barshat7 Apr 29, 2024
6189774
FORMS-14013 - Testcase added - Fixing Dropdown that had a selected va…
TalmizAhmed Apr 29, 2024
9313bbe
Forms 11746 allow attaching same file (#1201)
rajatofficial Apr 29, 2024
5f0f64c
Read-only is not working in file-attachment (#1200)
pavi41 Apr 30, 2024
207c12b
Readonly & Disable were not working in TNC component (#1211)
pavi41 May 2, 2024
027455e
FORMS-14018 - Fix for dropdown not working when enumNames are not pro…
TalmizAhmed May 2, 2024
96f18e8
Moving to 15860 image (#1212)
rismehta May 2, 2024
aa543a3
FORMS-13811 | Adding rendition for hCaptcha (#1174)
navneet-ag May 3, 2024
24dc607
Merge pull request #1217 from adobe/devtomaster_3May
rismehta May 3, 2024
a4cb971
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 May 3, 2024
de45a0b
@releng [maven-scm] :prepare for next development iteration
barshat7 May 3, 2024
e7cd993
Update VERSIONS.md and README.md to include version 3.0.20
May 3, 2024
2300e33
Update README.md
rismehta May 7, 2024
e9b4d42
[FORMS-11581] Enabled Draft functionality for V2 (#1209)
girotraapankaj May 7, 2024
e23a818
adding source property in sling model of image component to get dam a…
deepprakash345 May 7, 2024
cf9da81
eds semantic html without a separate selector (#1194)
deepprakash345 May 7, 2024
2ed2a4f
Update README.md
rismehta May 7, 2024
2465443
Update VERSIONS.md
rismehta May 7, 2024
81b807d
add data-cmp-valid attribute for checkboxgroup and radiobutton (#1225)
barshat7 May 9, 2024
8779579
Exclude from DoR is not working for text field in AF2
May 9, 2024
40f1b66
Merge pull request #1226 from adobe/textDrawDoR
devgurjar May 9, 2024
36444a5
Removed space between the short desc if long desc is not present
May 3, 2024
9536076
Refactored code of space removal in description
May 9, 2024
995b58d
Merge pull request #1228 from adobe/acc/space-remove-two
barshat7 May 9, 2024
45e9c7b
FORMS-14313 Direct children of fragment is not responsive (#1227)
dmaurya929 May 9, 2024
686026c
Merge branch 'master' into devtomaster-9-May-2024
barshat7 May 9, 2024
3381636
formatting
barshat7 May 9, 2024
22e8c75
Merge pull request #1229 from adobe/devtomaster-9-May-2024
barshat7 May 9, 2024
b9d43d6
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 May 9, 2024
fac918a
@releng [maven-scm] :prepare for next development iteration
barshat7 May 9, 2024
01924b5
Update VERSIONS.md and README.md to include version 3.0.22
May 9, 2024
19ad077
CM build is failing as 2.24.4 version is not available (#1230)
barshat7 May 10, 2024
ec82233
FORMS-14313 Direct children of fragment is not responsive (#1227)
dmaurya929 May 9, 2024
65568ce
CM build is failing as 2.24.4 version is not available (#1230)
barshat7 May 10, 2024
601db25
Merge pull request #1231 from adobe/devtomaster_10May2024
barshat7 May 10, 2024
b1060db
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 May 10, 2024
bc117af
@releng [maven-scm] :prepare for next development iteration
barshat7 May 10, 2024
15bcd3a
Update VERSIONS.md and README.md to include version 3.0.24
May 10, 2024
a3cadab
removing only in radio button test (#1232)
barshat7 May 13, 2024
11f9f0a
Moving to 16145 aem release (#1233)
rismehta May 14, 2024
2e84ae1
Moving to latest sites rotary aem image (#1240)
rismehta May 17, 2024
f59b405
Encoding formDefinition using jsonString context (#1236)
TalmizAhmed May 17, 2024
2bd72f4
Revert "Encoding formDefinition using jsonString context (#1236)" (#1…
TalmizAhmed May 17, 2024
2b0116c
FORMS-14305 Issues with AEM Forms Date Picker field behaviors. (#1235)
sakshi-arora1 May 20, 2024
74e7d4c
custom function edge delivery integration (#1223)
deepprakash345 May 22, 2024
f6c58d6
FORMS-14461 Reset resets static text. (#1239)
sakshi-arora1 May 22, 2024
9dbeff7
FORMS-14125: Exposed all spec function in globals, updated af2-web-ru…
arunattri26 May 23, 2024
c3151cd
Form fragment support in Universal Editor (#1245)
nit23uec May 23, 2024
0c50239
UE: Supporting custom viewType in sling models (#1247)
TalmizAhmed May 24, 2024
650ed5e
Update README.md
rismehta May 27, 2024
a22e04a
FORMS-14622 AEM Adaptive forms: Panel Component issue with Radio Butt…
sakshi-arora1 May 27, 2024
fdca3b1
dev to master commit pr 28 may 24......
May 28, 2024
bbf8271
adding skip call in wizard.locale test cases...
May 28, 2024
10a254e
FORMS-14673 fixed radio button rich text rendition (#1252)
im-shiv May 28, 2024
49216cb
Merge pull request #1253 from adobe/dev_to_master_28may
rismehta May 28, 2024
9ab4bba
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
May 28, 2024
a8fcf58
@releng [maven-scm] :prepare for next development iteration
May 28, 2024
956872e
Update VERSIONS.md and README.md to include version 3.0.26
May 28, 2024
821b956
FORMS-14545 Adding custom submit test behind FT (#1251)
rismehta May 29, 2024
739826b
reCAPTCHA enterprise support (#1250)
navneet-ag May 30, 2024
0cb9f5c
adding custom function registration in try/catch.....
May 30, 2024
b411b58
Merge pull request #1255 from adobe/customFunctionCorsFix
deepprakash345 May 30, 2024
cc066b1
FORMS-14673 fixed radio button rich text rendition (#1252)
im-shiv May 28, 2024
ccef3d3
FORMS-14545 Adding custom submit test behind FT (#1251)
rismehta May 29, 2024
aae2861
reCAPTCHA enterprise support (#1250)
navneet-ag May 30, 2024
6a48b90
adding custom function registration in try/catch.....
May 30, 2024
4c61cdb
Merge pull request #1256 from adobe/dev_to_master_30May24
rismehta May 30, 2024
4ed99c7
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
May 30, 2024
1903ca3
@releng [maven-scm] :prepare for next development iteration
May 30, 2024
d901cd9
Update VERSIONS.md and README.md to include version 3.0.28
May 31, 2024
e24b83f
FORMS-14701 removing widget value before initialisation (#1254)
im-shiv May 31, 2024
e0481b5
Retiring FT-FORMS-8771 (#1258)
navneet-ag Jun 3, 2024
4a55a33
Encode formDefinition with jsonString context (#1242)
TalmizAhmed Jun 5, 2024
72b5f34
FORMS-14701 removing widget value before initialisation (#1254)
im-shiv May 31, 2024
ad88026
Retiring FT-FORMS-8771 (#1258)
navneet-ag Jun 3, 2024
d44e650
Encode formDefinition with jsonString context (#1242)
TalmizAhmed Jun 5, 2024
423270c
Merge pull request #1260 from adobe/dev-to-master-june6
rismehta Jun 6, 2024
4af734c
@trivial handling error if site component is adapted to resource (#1262)
rismehta Jun 7, 2024
752d6a6
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
Jun 7, 2024
fa712f4
@releng [maven-scm] :prepare for next development iteration
Jun 7, 2024
c2100f4
Update VERSIONS.md and README.md to include version 3.0.30
Jun 7, 2024
de133f7
Update README.md
rismehta Jun 10, 2024
8e1a759
Accessibility changes in file-input (#1246)
pavi41 Jun 10, 2024
4f37812
FORMS-13935 adding icons for new components (#1265)
barshat7 Jun 10, 2024
d849b2d
Update README.md
rismehta Jun 11, 2024
1238d86
@trivial handling error if site component is adapted to resource (#1262)
rismehta Jun 7, 2024
9e25a38
Accessibility changes in file-input (#1246)
pavi41 Jun 10, 2024
04530dd
FORMS-13935 adding icons for new components (#1265)
barshat7 Jun 10, 2024
fd9984c
Merge pull request #1268 from adobe/dev_to_master_11_June
rismehta Jun 11, 2024
d1805af
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 Jun 12, 2024
59801cd
@releng [maven-scm] :prepare for next development iteration
barshat7 Jun 12, 2024
94ab153
Update VERSIONS.md and README.md to include version 3.0.32
Jun 12, 2024
76c66be
made changes in getId method where currentPage is null in case of res…
deepprakash345 Jun 13, 2024
f0afa1b
merged master to dev_to_master_13June
Jun 13, 2024
af38109
Update README.md
rismehta Jun 13, 2024
c249528
Fixing minimum and maximum date by setting explicit save timezone (#1…
rismehta Jun 13, 2024
65f973f
thank you msg overriding and role main adding (#1222)
rajatofficial Jun 13, 2024
c98ae52
UE: Encoding HTML in Tooltip and Description using XSSAPI (#1267)
TalmizAhmed Jun 13, 2024
3263356
Merge branch 'dev' into dev_to_master_13June
Jun 13, 2024
47ef57d
Not running sync workflow for PR against master branch
rismehta Jun 13, 2024
292217b
Merge pull request #1273 from adobe/dev_to_master_13June
deepprakash345 Jun 13, 2024
01ae8dd
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
Jun 13, 2024
163f0b2
@releng [maven-scm] :prepare for next development iteration
Jun 13, 2024
56f1357
Update VERSIONS.md and README.md to include version 3.0.34
Jun 13, 2024
50f42de
Fixing RUM related test case including visitorId change (#1279)
subodh2711 Jun 20, 2024
6419fbb
Move core component to 0.14.0 spec version | RTC approved (#1277)
navneet-ag Jun 20, 2024
360899a
Test case to reduce enum after enum gets initialized (#1280)
rismehta Jun 24, 2024
cb599d4
FORMS-15116 Load coral library only in authoring (#1284)
rismehta Jun 24, 2024
45b8dd0
FORMS-15098 | Adding e2e test cases for captcha failure (#1282)
navneet-ag Jun 25, 2024
b31d382
Changing RUM visitorId to sid key name change (#1285)
subodh2711 Jun 26, 2024
13407fa
FORMS-15088: skip submit error handler test-cases (#1289)
arunattri26 Jun 26, 2024
6db7e47
FORMS-11775 Fixing issues related to edit pattern in date picker (#1286)
rismehta Jun 26, 2024
d4417e5
Fixing enum and enumNames during initialize (#1288)
rismehta Jun 26, 2024
5574c85
updating af-core version (#1291)
rismehta Jun 27, 2024
488f108
FORMS-15088: fix rule editor submit error handler tests (#1287)
arunattri26 Jun 27, 2024
debfe3b
UE: Custom property support for Universal Editor (#1264)
TalmizAhmed Jun 27, 2024
f3f9ae8
Merge pull request #1295 from adobe/dev_to_master_27june
rismehta Jun 27, 2024
dbab0e7
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
barshat7 Jun 27, 2024
cc274dd
@releng [maven-scm] :prepare for next development iteration
barshat7 Jun 27, 2024
d2a3d91
Using org level sona credentials
rismehta Jun 28, 2024
da1ea4e
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
rismehta Jun 28, 2024
d5adeed
@releng [maven-scm] :prepare for next development iteration
rismehta Jun 28, 2024
660ddec
@releng [maven-scm] :prepare release core-forms-components-reactor-3.…
rismehta Jun 28, 2024
ba48df5
@releng [maven-scm] :prepare for next development iteration
rismehta Jun 28, 2024
d2940f7
Update README.md
rismehta Jun 29, 2024
371c2a0
Update VERSIONS.md
rismehta Jun 29, 2024
118b643
Merge branch 'release/650' into master-to-650-3_July_24
barshat7 Jul 3, 2024
d8c308e
update aemfd client version for build fix
barshat7 Jul 4, 2024
82d6f65
Revert "FORMS-13811 | Adding rendition for hCaptcha (#1174)"
barshat7 Jul 5, 2024
a01da19
test fix
barshat7 Jul 5, 2024
be503c8
release 650 test fix
barshat7 Jul 8, 2024
a332933
release 650 test fix
barshat7 Jul 8, 2024
ec99c54
release 650 test fix
barshat7 Jul 8, 2024
0d1c2a1
release 650 test fix
barshat7 Jul 8, 2024
bdf66a7
release 650 test fix
barshat7 Jul 9, 2024
c68e198
release 650 test fix: selectors were incorrect for 650
barshat7 Jul 9, 2024
f3101f7
Changing 6.5 sp version
rismehta Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .circleci/ci/it-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const qpPath = '/home/circleci/cq';
const buildPath = '/home/circleci/build';
const { TYPE, BROWSER, AEM, PRERELEASE, FT, CONTEXTPATH, FTCONFIG} = process.env;
const classicFormAddonVersion = 'LATEST';
// this value is for 6.5.20.0 version as per, https://experienceleague.adobe.com/en/docs/experience-manager-release-information/aem-release-updates/forms-updates/aem-forms-releases
const classicFormReleasedAddonVersion = '6.0.1192';
// this value is for 6.5.21.0 version as per, https://experienceleague.adobe.com/en/docs/experience-manager-release-information/aem-release-updates/forms-updates/aem-forms-releases
const classicFormReleasedAddonVersion = '6.0.1244';

try {
ci.stage("Integration Tests");
let wcmVersion = ci.sh('mvn help:evaluate -Dexpression=core.wcm.components.version -q -DforceStdout', true);
let wcmVersion = "2.25.4";
ci.dir(qpPath, () => {
// Connect to QP
ci.sh('./qp.sh -v bind --server-hostname localhost --server-port 55555');
Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ executors:
docker:
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
<<: *docker_auth
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem:6.5.20.0-openjdk11
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem:6.5.21.0-openjdk11
<<: *docker_auth
test_executor_655_latest:
docker:
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-qp:6.4.6-openjdk11
<<: *docker_auth
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem:6.5.21-load5-openjdk11
- image: docker-adobe-cif-release.dr-uw2.adobeitc.com/circleci-aem:6.5.21.0-openjdk11 # move to 6.5.22-load1-openjdk11, once forms aemfd package moves to this SP
<<: *docker_auth

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<servers>
<server>
<id>ossrh</id>
<username>${env.SONATYPE_USER}</username>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
<server>
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
git config --global user.name "ci-build"

- name: Sync with Base Branch
if: ${{ github.event.pull_request.base.ref != 'master' && github.event.pull_request.base.ref != 'release/650' }}
run: |
git fetch origin
git checkout ${{ github.event.pull_request.base.ref }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,5 @@ node_modules/
test_results/
ui.tests/test-module/reports
ui.tests/test-module/cypress

.java-version
2 changes: 1 addition & 1 deletion bundles/af-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -698,4 +698,4 @@
</developer>
</developers>

</project>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2024 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.form;

import org.apache.jackrabbit.JcrConstants;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ValueMap;
import org.apache.sling.caconfig.resource.ConfigurationResourceResolver;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
import org.apache.sling.models.annotations.injectorspecific.OSGiService;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;

import com.adobe.cq.forms.core.components.models.form.FormConfigurationProvider;

@Model(
adaptables = { Resource.class },
adapters = FormConfigurationProvider.class)
public class FormConfigurationProviderImpl implements FormConfigurationProvider {

private static final String CUSTOM_FUNCTION_CONFIG_BUCKET_NAME = "settings/cloudconfigs";
private static final String CUSTOM_FUNCTION_CONFIG_NAME = "edge-delivery-service-configuration";

private static final String CUSTOM_FUNCTION_FILE_PATH = "/blocks/form/functions.js";
private static final String HTTPS_PROTOCOL = "https://";
private static final String EDGE_DELIVERY_DOMAIN = ".hlx.live";

@SlingObject
private Resource resource;

@OSGiService
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL)
private ConfigurationResourceResolver configurationResourceResolver;

@Override
public String getCustomFunctionModuleUrl() {
String customFunctionUrl = "";
if (resource != null && configurationResourceResolver != null) {
Resource configResource = configurationResourceResolver.getResource(resource, CUSTOM_FUNCTION_CONFIG_BUCKET_NAME,
CUSTOM_FUNCTION_CONFIG_NAME);
if (configResource != null) {
Resource jcrResource = configResource.getChild(JcrConstants.JCR_CONTENT);
if (jcrResource != null) {
ValueMap configValueMap = jcrResource.getValueMap();
String owner = configValueMap.getOrDefault("owner", "").toString();
String repo = configValueMap.getOrDefault("repo", "").toString();
String ref = configValueMap.getOrDefault("ref", "main").toString();
if (!owner.isEmpty() && !repo.isEmpty()) {
customFunctionUrl = HTTPS_PROTOCOL + ref + "--" + repo + "--" + owner + EDGE_DELIVERY_DOMAIN
+ CUSTOM_FUNCTION_FILE_PATH;
}
}
}
}
return customFunctionUrl;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,35 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
package com.adobe.cq.forms.core.components.internal.form;

import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.cq.forms.core.components.models.form.FormContainer;
import com.adobe.cq.forms.core.components.models.form.FormStructureParser;
import com.adobe.cq.forms.core.components.util.ComponentUtils;
import com.adobe.cq.forms.core.components.views.Views;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.module.SimpleModule;

@Model(
adaptables = { SlingHttpServletRequest.class, Resource.class },
adapters = FormStructureParser.class)
public class FormStructureParserImpl implements FormStructureParser {

private static final Logger logger = LoggerFactory.getLogger(FormStructureParserImpl.class);
@SlingObject(injectionStrategy = InjectionStrategy.OPTIONAL)
@Nullable
private SlingHttpServletRequest request;
Expand Down Expand Up @@ -108,4 +121,30 @@ private String getFormContainerPath(Resource resource) {

return getFormContainerPath(resource.getParent());
}

public String getFormDefinition() {
String result = null;
FormContainer formContainer = resource.adaptTo(FormContainer.class);
try {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new SimpleModule().addSerializer(String.class, new FormStructureParserImpl.EncodeHTMLSerializer()));
Writer writer = new StringWriter();
// return publish view specific properties only for runtime
mapper.writerWithView(Views.Publish.class).writeValue(writer, formContainer);
result = writer.toString();
} catch (IOException e) {
logger.error("Unable to generate json from resource");
}
return result;
}

private static class EncodeHTMLSerializer extends JsonSerializer<String> {
@Override
public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
if (value != null) {
String escapedValue = StringEscapeUtils.escapeHtml4(value);
jsonGenerator.writeString(escapedValue);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2024 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.form;

import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
import org.apache.sling.models.annotations.injectorspecific.SlingObject;
import org.jetbrains.annotations.Nullable;

import com.adobe.cq.forms.core.components.models.form.HtlUtil;

@Model(
adaptables = { SlingHttpServletRequest.class, Resource.class },
adapters = HtlUtil.class)
public class HtlUtilImpl implements HtlUtil {
@SlingObject(injectionStrategy = InjectionStrategy.OPTIONAL)
@Nullable
private SlingHttpServletRequest request;

public Boolean isEdgeDeliveryRequest() {
if (request != null) {
Object isEdgeDelivery = request.getAttribute("com.adobe.aem.wcm.franklin.internal.servlets.FranklinDeliveryServlet");
return isEdgeDelivery != null && isEdgeDelivery.equals(Boolean.TRUE);
}
return false;
}
}
Loading
Loading