Skip to content

Commit fd9984c

Browse files
authored
Merge pull request #1268 from adobe/dev_to_master_11_June
Dev to master 11 june
2 parents d849b2d + 04530dd commit fd9984c

File tree

108 files changed

+2663
-656
lines changed

Some content is hidden

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

108 files changed

+2663
-656
lines changed

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/util/AbstractContainerImpl.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import org.apache.sling.models.factory.ModelFactory;
3535
import org.jetbrains.annotations.NotNull;
3636
import org.jetbrains.annotations.Nullable;
37+
import org.slf4j.Logger;
38+
import org.slf4j.LoggerFactory;
3739

3840
import com.adobe.cq.export.json.ComponentExporter;
3941
import com.adobe.cq.export.json.SlingModelFilter;
@@ -49,6 +51,8 @@
4951
*/
5052
public abstract class AbstractContainerImpl extends AbstractBaseImpl implements Container, ContainerConstraint {
5153

54+
private static final Logger logger = LoggerFactory.getLogger(AbstractContainerImpl.class);
55+
5256
@OSGiService
5357
private SlingModelFilter slingModelFilter;
5458

@@ -143,9 +147,16 @@ protected <T> Map<String, T> getChildrenModels(@Nullable SlingHttpServletRequest
143147
// todo: if possible set i18n form parent to child here, this would optimize the first form rendering
144148
model = modelFactory.getModelFromWrappedRequest(request, child, modelClass);
145149
} else {
146-
model = child.adaptTo(modelClass);
147-
if (model instanceof Base && i18n != null) {
148-
((Base) model).setI18n(i18n);
150+
try {
151+
model = child.adaptTo(modelClass);
152+
if (model instanceof Base && i18n != null) {
153+
((Base) model).setI18n(i18n);
154+
}
155+
} catch (Exception e) {
156+
// Log the exception as info, since there can be site component inside form, but we don't care about they being adapted
157+
// or not
158+
// by default, site component cannot be adapted with resource
159+
logger.info("Could not adapt resource {} to model class {}: {}", child.getPath(), modelClass.getName(), e.getMessage());
149160
}
150161
}
151162
if (model != null) {

examples/ui.apps/src/main/content/jcr_root/apps/forms-components-examples/components/form/fileinput/.content.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
jcr:primaryType="cq:Component"
44
jcr:title="Adaptive Form File Attachment"
55
jcr:description="Add a button to upload one or more files as form attachment."
6-
sling:resourceSuperType="core/fd/components/form/fileinput/v2/fileinput"
6+
sling:resourceSuperType="core/fd/components/form/fileinput/v3/fileinput"
77
componentGroup="Core Components Examples - Adaptive Form"/>

examples/ui.content/src/main/content/jcr_root/content/core-components-examples/library/.content.xml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,139 @@
602602
width="12"/>
603603
</cq:responsive>
604604
</teaser_wizard>
605+
<teaser_checkbox
606+
cq:styleIds="[1547060090076]"
607+
jcr:primaryType="nt:unstructured"
608+
sling:resourceType="core-components-examples/components/teaser"
609+
actionsEnabled="false"
610+
descriptionFromPage="true"
611+
fileReference="/content/dam/core-components-examples/library/forms-components/checkbox.svg"
612+
linkURL="/content/core-components-examples/library/adaptive-form/checkbox"
613+
textIsRich="true"
614+
titleFromPage="true">
615+
<cq:responsive jcr:primaryType="nt:unstructured">
616+
<default
617+
jcr:primaryType="nt:unstructured"
618+
width="3"/>
619+
<small
620+
jcr:primaryType="nt:unstructured"
621+
width="4"/>
622+
<extrasmall
623+
jcr:primaryType="nt:unstructured"
624+
width="12"/>
625+
</cq:responsive>
626+
</teaser_checkbox>
627+
<teaser_fragment
628+
cq:styleIds="[1547060090076]"
629+
jcr:primaryType="nt:unstructured"
630+
sling:resourceType="core-components-examples/components/teaser"
631+
actionsEnabled="false"
632+
descriptionFromPage="true"
633+
fileReference="/content/dam/core-components-examples/library/forms-components/fragment.svg"
634+
linkURL="/content/core-components-examples/library/adaptive-form/fragment"
635+
textIsRich="true"
636+
titleFromPage="true">
637+
<cq:responsive jcr:primaryType="nt:unstructured">
638+
<default
639+
jcr:primaryType="nt:unstructured"
640+
width="3"/>
641+
<small
642+
jcr:primaryType="nt:unstructured"
643+
width="4"/>
644+
<extrasmall
645+
jcr:primaryType="nt:unstructured"
646+
width="12"/>
647+
</cq:responsive>
648+
</teaser_fragment>
649+
<teaser_recaptcha
650+
cq:styleIds="[1547060090076]"
651+
jcr:primaryType="nt:unstructured"
652+
sling:resourceType="core-components-examples/components/teaser"
653+
actionsEnabled="false"
654+
descriptionFromPage="true"
655+
fileReference="/content/dam/core-components-examples/library/forms-components/recaptcha.svg"
656+
linkURL="/content/core-components-examples/library/adaptive-form/recaptcha"
657+
textIsRich="true"
658+
titleFromPage="true">
659+
<cq:responsive jcr:primaryType="nt:unstructured">
660+
<default
661+
jcr:primaryType="nt:unstructured"
662+
width="3"/>
663+
<small
664+
jcr:primaryType="nt:unstructured"
665+
width="4"/>
666+
<extrasmall
667+
jcr:primaryType="nt:unstructured"
668+
width="12"/>
669+
</cq:responsive>
670+
</teaser_recaptcha>
671+
<teaser_verticaltabs
672+
cq:styleIds="[1547060090076]"
673+
jcr:primaryType="nt:unstructured"
674+
sling:resourceType="core-components-examples/components/teaser"
675+
actionsEnabled="false"
676+
descriptionFromPage="true"
677+
fileReference="/content/dam/core-components-examples/library/forms-components/verticaltabs.svg"
678+
linkURL="/content/core-components-examples/library/adaptive-form/verticaltabs"
679+
textIsRich="true"
680+
titleFromPage="true">
681+
<cq:responsive jcr:primaryType="nt:unstructured">
682+
<default
683+
jcr:primaryType="nt:unstructured"
684+
width="3"/>
685+
<small
686+
jcr:primaryType="nt:unstructured"
687+
width="4"/>
688+
<extrasmall
689+
jcr:primaryType="nt:unstructured"
690+
width="12"/>
691+
</cq:responsive>
692+
</teaser_verticaltabs>
693+
<teaser_termsandconditions
694+
cq:styleIds="[1547060090076]"
695+
jcr:primaryType="nt:unstructured"
696+
sling:resourceType="core-components-examples/components/teaser"
697+
actionsEnabled="false"
698+
descriptionFromPage="true"
699+
fileReference="/content/dam/core-components-examples/library/forms-components/termsandconditions.svg"
700+
linkURL="/content/core-components-examples/library/adaptive-form/termsandconditions"
701+
textIsRich="true"
702+
titleFromPage="true">
703+
<cq:responsive jcr:primaryType="nt:unstructured">
704+
<default
705+
jcr:primaryType="nt:unstructured"
706+
width="3"/>
707+
<small
708+
jcr:primaryType="nt:unstructured"
709+
width="4"/>
710+
<extrasmall
711+
jcr:primaryType="nt:unstructured"
712+
width="12"/>
713+
</cq:responsive>
714+
</teaser_termsandconditions>
715+
<teaser_switch
716+
cq:styleIds="[1547060090076]"
717+
jcr:primaryType="nt:unstructured"
718+
sling:resourceType="core-components-examples/components/teaser"
719+
actionsEnabled="false"
720+
descriptionFromPage="true"
721+
fileReference="/content/dam/core-components-examples/library/forms-components/switch.svg"
722+
linkURL="/content/core-components-examples/library/adaptive-form/switch"
723+
textIsRich="true"
724+
titleFromPage="true">
725+
<cq:responsive jcr:primaryType="nt:unstructured">
726+
<default
727+
jcr:primaryType="nt:unstructured"
728+
width="3"/>
729+
<small
730+
jcr:primaryType="nt:unstructured"
731+
width="4"/>
732+
<extrasmall
733+
jcr:primaryType="nt:unstructured"
734+
width="12"/>
735+
</cq:responsive>
736+
</teaser_switch>
737+
605738
</container_1789240808>
606739

607740
</responsivegrid>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:dam="http://www.day.com/dam/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
3+
jcr:mixinTypes="[mix:referenceable]"
4+
jcr:primaryType="dam:Asset"
5+
jcr:uuid="24ee0d78-af00-4c74-888c-6930358d6240">
6+
<jcr:content
7+
dam:assetState="processed"
8+
jcr:lastModified="{Date}2024-06-10T11:48:18.136+05:30"
9+
jcr:lastModifiedBy="admin"
10+
jcr:primaryType="dam:AssetContent">
11+
<metadata
12+
dam:extracted="{Date}2024-06-10T11:48:15.055+05:30"
13+
dam:sha1="3f8c6c2f0c371b0c3f3295b265992d5c6a690ed0"
14+
dam:size="{Long}988"
15+
dc:format="image/svg+xml"
16+
jcr:mixinTypes="[cq:Taggable]"
17+
jcr:primaryType="nt:unstructured"/>
18+
<related jcr:primaryType="nt:unstructured"/>
19+
</jcr:content>
20+
</jcr:root>
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0"
3+
jcr:primaryType="nt:file">
4+
<jcr:content
5+
jcr:lastModifiedBy="workflow-process-service"
6+
jcr:primaryType="oak:Resource"/>
7+
</jcr:root>
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0"
3+
jcr:primaryType="nt:file">
4+
<jcr:content
5+
jcr:lastModifiedBy="workflow-process-service"
6+
jcr:primaryType="oak:Resource"/>
7+
</jcr:root>
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:oak="http://jackrabbit.apache.org/oak/ns/1.0"
3+
jcr:primaryType="nt:file">
4+
<jcr:content
5+
jcr:lastModifiedBy="workflow-process-service"
6+
jcr:primaryType="oak:Resource"/>
7+
</jcr:root>

0 commit comments

Comments
 (0)