Skip to content

Commit

Permalink
Forms 3632 (#1047)
Browse files Browse the repository at this point in the history
* FORMS-3632 include adaptive forms core components in 6.5

* FORMS-3632 include adaptive forms core components in 6.5

* FORMS-3632 include adaptive forms core components in 6.5

* FORMS-3632 include adaptive forms core components in 6.5

* FORMS-3632 include adaptive forms core components in 6.5

* FORMS-3632 include adaptive forms core components in 6.5

* FORMS-3632 include adaptive forms core components in 6.5

* FORMS-3632 include adaptive forms core components in 6.5

* FORMS-3632 exclude portal components for 6.5

* FORMS-3632  exclude only formsportal

* FORMS-3632 fetch latest sdk version for 6.5

* FORMS-3632 fetch latest sdk version for 6.5

* FORMS-3632 fix cm build for ui.frontend.react.forms.af

---------

Co-authored-by: barshatr <barshatr@adobe.com>
Co-authored-by: Rishi Mehta <69448117+rismehta@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 2, 2023
1 parent d9f6c99 commit 4f891d4
Show file tree
Hide file tree
Showing 9 changed files with 94 additions and 35 deletions.
23 changes: 18 additions & 5 deletions src/main/archetype/all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<target>/apps/${appId}-vendor-packages/application/install</target>
</embedded>
#end
#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y") and $aemVersion == "cloud")
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
<embedded>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-af-apps</artifactId>
Expand All @@ -186,6 +186,19 @@
<artifactId>core-forms-components-af-core</artifactId>
<target>/apps/${appId}-vendor-packages/application/install</target>
</embedded>
#if ( $aemVersion != "cloud" )
<embedded>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-apps</artifactId>
<type>zip</type>
<target>/apps/${appId}-vendor-packages/application/install</target>
</embedded>
<embedded>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-core</artifactId>
<target>/apps/${appId}-vendor-packages/application/install</target>
</embedded>
#end
#if ($includeExamples == "y")
<embedded>
<groupId>com.adobe.aem</groupId>
Expand Down Expand Up @@ -396,12 +409,12 @@
<type>zip</type>
</dependency>
#end
#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y") and $aemVersion == "cloud" )
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
<!-- AEM Forms Dependencies -->
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-apps</artifactId>
<type>zip</type>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-apps</artifactId>
<type>zip</type>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
Expand Down
21 changes: 14 additions & 7 deletions src/main/archetype/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,22 @@ Import-Package: javax.annotation;version=0.0.0,*
</dependency>
#end

#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y") and $aemVersion == "cloud")
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
<!-- AEM Forms Dependencies -->
#if ($aemVersion == "cloud")
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>aem-forms-sdk-api</artifactId>
</dependency>
#else
<dependency>
<groupId>com.adobe.aemfd</groupId>
<artifactId>aemfd-client-sdk</artifactId>
</dependency>
#end
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>aem-forms-sdk-api</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-core</artifactId>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-core</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
Expand Down
21 changes: 17 additions & 4 deletions src/main/archetype/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,14 @@
<aem.cif.sdk.api>2022.08.02.00</aem.cif.sdk.api>
#end

#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y") and $aemVersion == "cloud" )
<core.forms.components.version>2.0.4</core.forms.components.version>
<core.forms.components.af.version>2.0.4</core.forms.components.af.version>
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
#if ($aemVersion == "cloud")
<core.forms.components.version>2.0.6</core.forms.components.version>
<core.forms.components.af.version>2.0.6</core.forms.components.af.version>
#else
<core.forms.components.version>1.1.12</core.forms.components.version>
<core.forms.components.af.version>1.1.12</core.forms.components.af.version>
#end
<aem.forms.sdk.api>SDK_FORMS_VERSION</aem.forms.sdk.api>
#end
<bnd.version>5.1.2</bnd.version>
Expand Down Expand Up @@ -863,13 +868,21 @@ Bundle-DocURL:
<scope>provided</scope>
</dependency>
#end
#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y") and $aemVersion == "cloud")
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
<!-- AEM Forms Dependencies -->
#if ($aemVersion == "cloud")
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>aem-forms-sdk-api</artifactId>
<version>${aem.forms.sdk.api}</version>
</dependency>
#else
<dependency>
<groupId>com.adobe.aemfd</groupId>
<artifactId>aemfd-client-sdk</artifactId>
<version>${aem.forms.sdk.api}</version>
</dependency>
#end
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-apps</artifactId>
Expand Down
27 changes: 17 additions & 10 deletions src/main/archetype/ui.apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,27 @@ Require-Capability: osgi.extender;filter:="(&(osgi.extender=sling.scripting)(ver
<scope>provided</scope>
</dependency>
#end
#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y") and $aemVersion == "cloud")
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
<!-- AEM Forms Dependencies -->
#if ($aemVersion == "cloud")
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>aem-forms-sdk-api</artifactId>
</dependency>
#else
<dependency>
<groupId>com.adobe.aemfd</groupId>
<artifactId>aemfd-client-sdk</artifactId>
</dependency>
#end
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>aem-forms-sdk-api</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-apps</artifactId>
<type>zip</type>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-apps</artifactId>
<type>zip</type>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-core</artifactId>
<groupId>com.adobe.aem</groupId>
<artifactId>core-forms-components-core</artifactId>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:fd="http://www.adobe.com/aemfd/fd/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:description="Adaptive Form Container component"
jcr:primaryType="cq:Component"
jcr:title="Adaptive Form Container"
fd:version="2.1"
sling:resourceSuperType="core/fd/components/form/container/v2/container"
componentGroup=".${appTitle} - Adaptive Form"/>
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
#if ( $includeCommerce == "y" and $aemVersion != "cloud")
<filter root="/var/commerce/products/${appId}-default" mode="merge"/>
#end
#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y" ) and $aemVersion == "cloud")
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
<filter root="/content/dam/formsanddocuments-themes/${appId}" mode="merge"/>
<filter root="/content/dam/formsanddocuments-fdm/${appId}" mode="merge"/>
<filter root="/content/dam/${appId}/sample_logo.png" mode="merge"/>
<filter root="/content/dam/${appId}/sample_terms.png" mode="merge"/>
#end
#if ( ($includeFormsheadless == "y" ) and $aemVersion == "cloud")
#if ($includeFormsheadless == "y" )
<filter root="/content/dam/${appId}/af_model_sample.json" mode="merge"/>
#end
</workspaceFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
jcr:mixinTypes="[rep:AccessControllable]"
jcr:primaryType="cq:Page">
<rep:policy/>
#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y") and $aemVersion == "cloud")
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
<fd jcr:primaryType="nt:unstructured">
<af jcr:primaryType="nt:unstructured">
<components jcr:primaryType="nt:unstructured">
Expand Down Expand Up @@ -561,7 +561,7 @@
</teaser>
</commerce>
#end
#if ( ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y") and $aemVersion == "cloud")
#if ($includeForms == "y" or $includeFormsenrollment == "y" or $includeFormscommunications == "y" or $includeFormsheadless == "y")
<adaptiveForm jcr:primaryType="nt:unstructured">
<formcontainer jcr:primaryType="nt:unstructured">
<jcr:content
Expand Down
4 changes: 2 additions & 2 deletions src/main/archetype/ui.frontend.react.forms.af/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<configuration>
<nodeVersion>v18.9.0</nodeVersion>
<npmVersion>8.19.1</npmVersion>
<nodeVersion>v16.17.0</nodeVersion>
<npmVersion>8.15.0</npmVersion>
</configuration>
<executions>
<execution>
Expand Down
22 changes: 20 additions & 2 deletions src/main/resources/META-INF/archetype-post-generate.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ if (includeForms == "n" && includeFormsenrollment == "n" && includeFormscommunic
assert new File("$confFolder/settings/wcm/templates/blank-af-v2").deleteDir()
assert new File("$confFolder/forms").deleteDir()
}
if ((includeForms == "y" || includeFormsenrollment == "y" || includeFormscommunications == "y" || includeFormsheadless == "y") && aemVersion != "cloud") {
assert new File("$appsFolder/components/formsandcommunicationportal").deleteDir();
}


// For Headless Only
if (includeFormsheadless == "n") {
Expand All @@ -216,10 +220,15 @@ if (includeFormsheadless == "n") {
}

// if forms is included and aem version is set to cloud, set the forms sdk version
if ((includeForms == "y" || includeFormsenrollment == "y" || includeFormscommunications == "y" || includeFormsheadless == "y") && aemVersion == "cloud") {
if (includeForms == "y" || includeFormsenrollment == "y" || includeFormscommunications == "y" || includeFormsheadless == "y") {
if (sdkFormsVersion == "latest") {
println "No Forms SDK version specified, trying to fetch latest"
sdkFormsVersion = getLatestFormsSDK(request.getArchetypeVersion())
if (aemVersion == "cloud") {
sdkFormsVersion = getLatestFormsSDK(request.getArchetypeVersion())
} else {
sdkFormsVersion = getLatestNonCloudFormsSDK(request.getArchetypeVersion());
}

}
println "Using AEM Forms as a Cloud Service SDK version: " + sdkFormsVersion
rootPom.text = rootPom.text.replaceAll('SDK_FORMS_VERSION', sdkFormsVersion.toString())
Expand Down Expand Up @@ -392,3 +401,12 @@ def getLatestFormsSDK(archetypeVersion) {
}
return sdkVersion
}

def getLatestNonCloudFormsSDK(archetypeVersion) {
def metadata = new XmlSlurper().parse("https://repo1.maven.org/maven2/com/adobe/aemfd/aemfd-client-sdk/maven-metadata.xml")
def sdkVersion = metadata.versioning.latest
if (sdkVersion == null || sdkVersion == "") {
sdkVersion = System.console().readLine("Cannot get latest SDK version, please provide it manually: ")
}
return sdkVersion
}

0 comments on commit 4f891d4

Please sign in to comment.