Skip to content

Commit bd0aab0

Browse files
authored
Merge pull request #1183 from adobe/devToMaster11Apr
Dev to master11 apr
2 parents ac6f9b7 + b9c6fa3 commit bd0aab0

File tree

34 files changed

+3182
-47
lines changed

34 files changed

+3182
-47
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public interface FormContainer extends Container {
6464
*/
6565
String PN_CLIENT_LIB_REF = GuideConstants.CLIENT_LIB_REF;
6666

67-
String DEFAULT_FORMS_SPEC_VERSION = "0.12.5";
67+
String DEFAULT_FORMS_SPEC_VERSION = "0.13.0";
6868

6969
/**
7070
* Returns form metadata {@link FormMetaData}

bundles/af-core/src/test/java/com/adobe/cq/forms/core/Utils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ public static void testSchemaValidation(@NotNull Object model) {
125125
// create an instance of the JsonSchemaFactory using version flag
126126
JsonSchemaFactory schemaFactory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7);
127127
try {
128-
InputStream schemaStream = Utils.class.getResourceAsStream("/schema/0.12.5/adaptive-form.schema.json");
128+
InputStream schemaStream = Utils.class.getResourceAsStream("/schema/0.13.0/adaptive-form.schema.json");
129129
JsonSchema schema = schemaFactory.getSchema(schemaStream);
130130
// read data from the stream and store it into JsonNode
131131
JsonNode json = objectMapper.readTree(jsonStream);
132132
// if there is a version bump of schema, then it needs to be validated against its corresponding sling model here
133133
// by explicitly checking the model implementation
134134
if (!(model instanceof FormContainerImpl)) {
135-
InputStream formContainerTemplate = Utils.class.getResourceAsStream("/schema/0.12.5/form.json");
135+
InputStream formContainerTemplate = Utils.class.getResourceAsStream("/schema/0.13.0/form.json");
136136
JsonNode formContainerTemplateNode = objectMapper.readTree(formContainerTemplate);
137137
((ObjectNode) formContainerTemplateNode).putArray("items").add(json);
138138
json = formContainerTemplateNode;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void testGetAdaptiveFormCustomVersion() throws Exception {
150150
void testGetAdaptiveFormDefaultVersion() throws Exception {
151151
FormContainer formContainer = Utils.getComponentUnderTest(PATH_FORM_1, FormContainer.class, context);
152152
assertNotNull(formContainer.getAdaptiveFormVersion());
153-
assertEquals("0.12.5", formContainer.getAdaptiveFormVersion());
153+
assertEquals("0.13.0", formContainer.getAdaptiveFormVersion());
154154
}
155155

156156
@Test

bundles/af-core/src/test/resources/form/formcontainer/exporter-formcontainerv2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
":itemsOrder": [
2121
"textinput"
2222
],
23-
"adaptiveform": "0.12.5",
23+
"adaptiveform": "0.13.0",
2424
"metadata": {
2525
"version": "1.0.0",
2626
"grammar": "json-formula-1.0.0"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$id": "classpath:/schema/0.13.0/adaptive-form-aem-allowed-components.schema.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"type": "object",
5+
"title": "Allowed Components object for the current panel.",
6+
"description": "This is applicable only if the panel's layout is grid system. This property is useful if needs to show list of allowed components in the client while authoring the panel.",
7+
"properties": {
8+
"components": {
9+
"type": "array",
10+
"title": "List of simple objects representing all Allowed Components for the given panel"
11+
},
12+
"applicable": {
13+
"type": "boolean",
14+
"title": "Is the given panel contained by a page, with authored template structure and is the given panel set as editable (unlocked)",
15+
"description": "true if the template has structure support and the panel is editable, false otherwise"
16+
}
17+
}
18+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$id": "classpath:/schema/0.13.0/adaptive-form-aem-responsive-grid-properties.schema.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"type": "object",
5+
"properties": {
6+
"allowedComponents": {
7+
"$ref": "./adaptive-form-aem-allowed-components.schema.json"
8+
},
9+
"appliedCssClassNames": {
10+
"title": "CSS classes delimited using a SPACE character",
11+
"description": "Describes the style system information associated with the current form element",
12+
"type": "string",
13+
"examples": [
14+
{
15+
"appliedCssClassNames": "outlined red-border"
16+
}
17+
]
18+
},
19+
"gridClassNames": {
20+
"title": "The CSS class names to be applied to the current panel delimited using a SPACE character",
21+
"description": "This is applicable only if the panel's layout is grid system.",
22+
"type": "string",
23+
"examples": [
24+
{
25+
"gridClassNames": "aem-Grid aem-Grid--12 aem-Grid--default--12"
26+
}
27+
]
28+
},
29+
"columnClassNames": {
30+
"title": "The CSS class names associated with each responsive grid column and listed by column name",
31+
"description": "This is applicable only if the panel's layout is grid system.",
32+
"type": "object",
33+
"examples": [
34+
{
35+
"columnClassNames": {
36+
"title_v3": "aem-GridColumn aem-GridColumn--default--12"
37+
}
38+
}
39+
]
40+
},
41+
"columnCount": {
42+
"title": "The number of columns available for direct children in the panel.",
43+
"description": "This is applicable only if the panel's layout is grid system.",
44+
"type": "number",
45+
"examples": [
46+
{
47+
"columnCount": 12
48+
}
49+
]
50+
}
51+
}
52+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"$id": "classpath:/schema/0.13.0/adaptive-form-container-dor-properties.schema.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"type": "object",
5+
"additionalProperties": false,
6+
"properties": {
7+
"dorType": {
8+
"title": "DOR Type",
9+
"description": "Describes the type of Document of Record (DOR)",
10+
"type": "string",
11+
"enum": [
12+
"generate",
13+
"select"
14+
],
15+
"examples": [
16+
{
17+
"dorType": "generate"
18+
}
19+
]
20+
},
21+
"dorTemplateRef": {
22+
"title": "DOR Template Reference",
23+
"description": "Reference to the template for the Document of Record (DOR).",
24+
"type": "string",
25+
"examples": [
26+
{
27+
"dorTemplateRef": "/content/dam/formsanddocuments/acro form conversion.pdf"
28+
}
29+
]
30+
},
31+
"dorTemplateType": {
32+
"title": "DOR Template Type",
33+
"description": "Type of the template for the Document of Record (DOR).",
34+
"enum": [
35+
"acroform",
36+
"xfa"
37+
],
38+
"type": "string"
39+
}
40+
}
41+
}
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
{
2+
"$id": "classpath:/schema/0.13.0/adaptive-form-data-constraints.schema.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"title": "Constraints applicable to fields",
5+
"type": "object",
6+
"properties": {
7+
"accept": {
8+
"title": "The constraint is applicable for fields having type file or with fields having type string and format as data-url / binary. It signifies the list of IANA media types that fields can accept.",
9+
"type": "array",
10+
"items": {
11+
"type": "string"
12+
}
13+
},
14+
"enforceEnum": {
15+
"title": "Whether a user can enter a value that is not present in the enum array",
16+
"description": "If set to true, a user will be able to enter any other value that is not in the list of enum. That generally means that enum is used a aid for users to enter the value but is not a validation constraint.",
17+
"type": "boolean"
18+
},
19+
"exclusiveMaximum": {
20+
"title": "maximum value or date (exclusive)",
21+
"oneOf": [
22+
{
23+
"type": "string",
24+
"format": "date"
25+
},
26+
{
27+
"type": "number"
28+
}
29+
]
30+
},
31+
"exclusiveMinimum": {
32+
"title": "minimum value or date (exclusive)",
33+
"oneOf": [
34+
{
35+
"type": "string",
36+
"format": "date"
37+
},
38+
{
39+
"type": "number"
40+
}
41+
]
42+
},
43+
"format": {
44+
"title": "formats as specified in JSON Schema. The constraint is applicable only for string data types",
45+
"type": "string",
46+
"enum": [
47+
"date",
48+
"email",
49+
"date-time",
50+
"data-url"
51+
]
52+
},
53+
"maxFileSize": {
54+
"title": "The constraint is applicable for fields having type file or with fields having type string and format as data-url / binary. It signifies the maximum file size as per IEC specification",
55+
"type": "string"
56+
},
57+
"maximum": {
58+
"title": "maximum value or date (inclusive)",
59+
"oneOf": [
60+
{
61+
"type": "string",
62+
"format": "date"
63+
},
64+
{
65+
"type": "number"
66+
}
67+
]
68+
},
69+
"maxItems": {
70+
"title": "Maximum number of items in a field/panel capturing array data",
71+
"type": "number"
72+
},
73+
"maxOccur": {
74+
"title": "Maximum number of occurrence of repeating panel - capturing array data,",
75+
"type": "number"
76+
},
77+
"maxLength": {
78+
"title": "Maximum Length of the data. The constraint is applicable only for string data types",
79+
"type": "number"
80+
},
81+
"minimum": {
82+
"title": "minimum value or date (inclusive)",
83+
"oneOf": [
84+
{
85+
"type": "string",
86+
"format": "date"
87+
},
88+
{
89+
"type": "number"
90+
}
91+
]
92+
},
93+
"minItems": {
94+
"title": "Minimum number of items in a field/panel capturing array data",
95+
"type": "number"
96+
},
97+
"minOccur": {
98+
"title": "Minimum number of occurrence of repeating panel - capturing array data",
99+
"type": "number"
100+
},
101+
"minLength": {
102+
"title": "Minimum Length of the data. The constraint is applicable only for string data types",
103+
"type": "number"
104+
},
105+
"pattern": {
106+
"title": "The regular expression against which the value will be compared against",
107+
"type": "string",
108+
"format": "regex"
109+
},
110+
"required": {
111+
"type": "boolean",
112+
"title": "Indicates whether the value is required or not"
113+
},
114+
"step": {
115+
"title": "The constraint is applicable for fields having type number. It signifies the value should be a multipleOf some number",
116+
"type": "number"
117+
},
118+
"type": {
119+
"title": "Data Type of the value that this field captures. When submitting the value will be coerced into the format specified by the type",
120+
"type": "string",
121+
"enum": [
122+
"string",
123+
"file",
124+
"number",
125+
"array",
126+
"object",
127+
"string[]",
128+
"file[]",
129+
"number[]",
130+
"boolean[]",
131+
"boolean"
132+
]
133+
},
134+
"uniqueItems": {
135+
"title": "Array items must be unique",
136+
"type": "boolean"
137+
},
138+
"validationExpression": {
139+
"type": "string",
140+
"format": "json-formula"
141+
}
142+
}
143+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"$id": "classpath:/schema/0.13.0/adaptive-form-data-layer.schema.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"type": "object",
5+
"properties": {
6+
"@id": {
7+
"type": "string",
8+
"title": "Id of the form element"
9+
},
10+
"@type": {
11+
"type": "string",
12+
"title": "Type of the form element used in the data layer"
13+
},
14+
"repo:modifyDate": {
15+
"type": "string",
16+
"title": "Last modified date using ISO 8601 standard"
17+
},
18+
"parentId": {
19+
"type": "string",
20+
"title": "Parent id of the form element"
21+
},
22+
"dc:title": {
23+
"type": "string",
24+
"title": "Label of the form element used in the data layer"
25+
},
26+
"dc:description": {
27+
"type": "string",
28+
"title": "Description of the form element used in the data layer"
29+
},
30+
"xdm:text": {
31+
"type": "string",
32+
"title": "Text of the form element used in the data layer"
33+
},
34+
"xdm:linkURL": {
35+
"type": "string",
36+
"title": "Link URL of the form element used in the data layer"
37+
},
38+
"fieldType": {
39+
"title": "Type of widget to show to the user for capturing the data",
40+
"enum": [
41+
"text-input",
42+
"number-input",
43+
"date-input",
44+
"file-input",
45+
"multiline-input",
46+
"drop-down",
47+
"radio-group",
48+
"checkbox-group",
49+
"checkbox",
50+
"switch",
51+
"plain-text",
52+
"button",
53+
"panel",
54+
"image",
55+
"email",
56+
"captcha"
57+
]
58+
}
59+
}
60+
}

0 commit comments

Comments
 (0)