File tree Expand file tree Collapse file tree 5 files changed +39
-7
lines changed
bundles/af-core/src/main/java/com/adobe/cq/forms/core/components
ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/fileinput/v3/fileinput/_cq_dialog Expand file tree Collapse file tree 5 files changed +39
-7
lines changed Original file line number Diff line number Diff line change @@ -125,13 +125,6 @@ public List<String> getAccept() {
125125 .orElse (Collections .emptyList ());
126126 }
127127
128- @ Override
129- public List <String > getAcceptExtensions () {
130- return Optional .ofNullable (acceptExtensions )
131- .map (Arrays ::asList )
132- .orElse (Collections .emptyList ());
133- }
134-
135128 @ Override
136129 public @ NotNull Map <String , Object > getProperties () {
137130 Map <String , Object > customProperties = super .getProperties ();
Original file line number Diff line number Diff line change 1818
1919package com .adobe .cq .forms .core .components .internal .models .v3 .form ;
2020
21+ import java .util .Arrays ;
22+ import java .util .Collections ;
23+ import java .util .List ;
2124import java .util .Map ;
25+ import java .util .Optional ;
2226
2327import org .apache .sling .api .SlingHttpServletRequest ;
2428import org .apache .sling .api .resource .Resource ;
@@ -48,6 +52,9 @@ public class FileInputImplV3 extends FileInputImplV2 {
4852 @ Default (values = FileInput .DEFAULT_DRAGDROP_TEXT )
4953 protected String dragDropTextV3 ;
5054
55+ @ ValueMapValue (injectionStrategy = InjectionStrategy .OPTIONAL , name = ReservedProperties .PN_FILE_ACCEPT_EXTENSIONS )
56+ protected String [] acceptExtensions ;
57+
5158 @ Override
5259 public String getDragDropText () {
5360 return dragDropTextV3 ;
@@ -60,4 +67,11 @@ public String getDragDropText() {
6067 customProperties .put (ReservedProperties .PN_DRAG_DROP_TEXT_V3 , getDragDropText ());
6168 return customProperties ;
6269 }
70+
71+ @ Override
72+ public List <String > getAcceptExtensions () {
73+ return Optional .ofNullable (acceptExtensions )
74+ .map (Arrays ::asList )
75+ .orElse (Collections .emptyList ());
76+ }
6377}
Original file line number Diff line number Diff line change @@ -57,6 +57,13 @@ default List<String> getAccept() {
5757 return DEFAULT_ACCEPT ;
5858 }
5959
60+ /**
61+ * Returns the list of file extensions which field can accept. The constraint is
62+ * applicable for file attachment field
63+ *
64+ * @return the list of extensions supported by the field
65+ * @since com.adobe.cq.forms.core.components.models.form 0.0.1
66+ */
6067 default List <String > getAcceptExtensions () {
6168 return Collections .emptyList ();
6269 }
Original file line number Diff line number Diff line change 1515 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
1616package com .adobe .cq .forms .core .components .models .form ;
1717
18+ import java .util .Collections ;
19+ import java .util .List ;
20+
1821import org .osgi .annotation .versioning .ConsumerType ;
1922
2023import com .fasterxml .jackson .annotation .JsonIgnore ;
@@ -40,6 +43,17 @@ default Boolean isMultiple() {
4043 return false ;
4144 }
4245
46+ /**
47+ * Returns the list of file extensions which field can accept. The constraint is
48+ * applicable for file attachment field
49+ *
50+ * @return the list of extensions supported by the field
51+ */
52+ @ JsonIgnore
53+ default List <String > getAcceptExtensions () {
54+ return Collections .emptyList ();
55+ }
56+
4357 /**
4458 * Returns the text to be displayed on the file input button
4559 *
Original file line number Diff line number Diff line change 108108 name =" ./acceptExtensions"
109109 jcr : primaryType =" nt:unstructured"
110110 sling : resourceType =" granite/ui/components/coral/foundation/form/textfield" />
111+ <granite : rendercondition
112+ jcr : primaryType =" nt:unstructured"
113+ sling : resourceType =" granite/ui/components/renderconditions/featuretoggle"
114+ toggleName =" FT_FORMS-18927" />
111115 </extensions >
112116 <acceptMessage
113117 jcr : primaryType =" nt:unstructured"
You can’t perform that action at this time.
0 commit comments