檢查及啟用最適化Forms核心元件 enable-headless-adaptive-forms-on-aem-forms-cloud-service

版本
文章連結
AEM 6.5
按一下這裡
AEM as a Cloud Service
本文章

最適化Forms核心元件和Headless最適化Forms已針對大多數AEM Forms as a Cloud Service客戶啟用。 這可讓您使用AEM Forms Cloud Service例項來建立、發佈及傳遞核心元件式的最適化Forms和Headless Forms至多個管道。

檢查最適化Forms核心元件是否已啟用 check-if-enabled

在執行任何啟用步驟之前,請檢查是否已針對您的環境啟用最適化Forms核心元件:

適用於新的AEM Forms as a Cloud Service計畫

當您建立全新的AEM Forms as a Cloud Service程式時,已針對您的環境啟用最適化Forms核心元件和Headless最適化Forms 。

適用於現有Cloud Service環境

如果您現有的Cloud Service環境提供建立以核心元件為基礎的調適型Forms的選項,表示已針對您的環境啟用調適型Forms核心元件和Headless調適型Forms。

檢查您的存放庫以進行驗證

若要確認已針對您的環境啟用最適化Forms核心元件:

  1. 複製AEM Forms as a Cloud Service存放庫。

  2. 開啟您 AEM Forms Cloud Service Git 存放庫的 [AEM Repository Folder]/all/pom.xml 檔案。

  3. 搜尋以下相依性:

    • core-forms-components-af-core
    • core-forms-components-core
    • core-forms-components-apps
    • core-forms-components-af-apps
    • core-forms-components-examples-apps
    • core-forms-components-examples-content

    尋找 core-forms-components-af-core artifact in all/pom.xml

    如果這些相依性存在,系統就會為您的環境啟用最適化Forms核心元件。

當需要手動啟用時 when-manual-enablement-needed

只有在您有舊版Forms as a Cloud Service程式未啟用核心元件(由上面的檢查確認)時,您才會需要手動將Adaptive Forms核心元件相依性新增到AEM as a Cloud Service存放庫,並將存放庫部署到Cloud Service環境。

手動啟用步驟
note warning
WARNING
如果上述驗證檢查確認您的環境未啟用最適化Forms核心元件,請僅依照這些步驟操作。

依照所列順序,執行以下步驟,為AEM Forms as a Cloud Service環境啟用最適化Forms核心元件和Headless最適化Forms:

啟用核心元件和Headless最適化表單

​1. 原地複製您的 AEM Forms as a Cloud Service Git 存放庫 clone-git-repository

  1. 登入 Cloud Manager,並選取您的組織和計劃。

  2. 從​ 計劃概觀 ​頁面瀏覽至​ 管道 ​卡,按一下「存取存放庫資訊」按鈕,以存取和管理您的 Git 存放庫。 此頁面包括以下資訊:

    • Cloud Manager Git 存放庫的 URL。
    • Git 存儲庫認證 (使用者名稱和密碼) Git 使用者名稱。

    按一下「生成密碼」,查看或生成密碼。

  3. 在本機電腦上開啟終端或命令提示並執行以下命令:

    code language-shell
    git clone [Git Repository URL]
    

    出現提示時,提供認證。 原地複製 存放庫至本機電腦。

​2. 將調適型核心元件的相依性新增至您的 Git 存放庫 add-adaptive-forms-core-components-dependencies

  1. 在純文字程式碼編輯器中開啟 Git 存放庫資料夾。 例如 VS Code。

  2. 閇啟 [AEM Repository Folder]\pom.xml 檔案進行編輯。

  3. 核心元件文件中指定的版本取代 core.forms.components.versioncore.forms.components.af.versioncore.wcm.components.version 等版本元件。如果該元件不存在,請新增這些元件。

    code language-xml
    <!-- Replace the version with the latest released version at https://github.com/adobe/aem-core-forms-components/tags -->
    
    <properties>
        <core.wcm.components.version>2.22.10</core.wcm.components.version>
        <core.forms.components.version>2.0.18</core.forms.components.version>
        <core.forms.components.af.version>2.0.18</core.forms.components.af.version>
    </properties>
    

    提及最新版本的表單核心元件

  4. [AEM Repository Folder]\pom.xml 檔案的相依性部份中,新增以下相依性並儲存檔案。

    code language-xml
        <!-- WCM Core Component Examples Dependencies -->
            <dependency>
                <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.examples.ui.apps</artifactId>
                <type>zip</type>
                <version>${core.wcm.components.version}</version>
            </dependency>
            <dependency>
                <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.examples.ui.content</artifactId>
                <type>zip</type>
                <version>${core.wcm.components.version}</version>
            </dependency>
            <dependency>
                <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.examples.ui.config</artifactId>
                <version>${core.wcm.components.version}</version>
                <type>zip</type>
            </dependency>
            <!-- End of WCM Core Component Examples Dependencies -->
            <!-- Forms Core Component Dependencies -->
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-core</artifactId>
                <version>${core.forms.components.version}</version>
            </dependency>
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-apps</artifactId>
                <version>${core.forms.components.version}</version>
                <type>zip</type>
            </dependency>
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-af-core</artifactId>
                <version>${core.forms.components.version}</version>
            </dependency>
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-af-apps</artifactId>
                <version>${core.forms.components.version}</version>
                <type>zip</type>
            </dependency>
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-examples-apps</artifactId>
                <type>zip</type>
                <version>${core.forms.components.version}</version>
            </dependency>
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-examples-content</artifactId>
                <type>zip</type>
                <version>${core.forms.components.version}</version>
            </dependency>
    <!-- End of AEM Forms Core Component Dependencies -->
    
  5. 開啟 [AEM Repository Folder]/all/pom.xml 檔案進行編輯。 在 <embeddeds> 部份新增以下相依性並儲存檔案。

    code language-xml
    <!-- WCM Core Component Examples Dependencies -->
    
    <!-- inside plugin config of filevault-package-maven-plugin -->
    <!-- embed wcm core components examples artifacts -->
    
    <embedded>
        <groupId>com.adobe.cq</groupId>
        <artifactId>core.wcm.components.examples.ui.apps</artifactId>
        <type>zip</type>
        <target>/apps/${appId}-vendor-packages/content/install</target>
    </embedded>
    <embedded>
        <groupId>com.adobe.cq</groupId>
        <artifactId>core.wcm.components.examples.ui.content</artifactId>
        <type>zip</type>
        <target>/apps/${appId}-vendor-packages/content/install</target>
    </embedded>
    <embedded>
        <groupId>com.adobe.cq</groupId>
        <artifactId>core.wcm.components.examples.ui.config</artifactId>
        <type>zip</type>
        <target>/apps/${appId}-vendor-packages/content/install</target>
    </embedded>
    <!-- embed forms core components artifacts -->
    <embedded>
        <groupId>com.adobe.aem</groupId>
        <artifactId>core-forms-components-af-apps</artifactId>
        <type>zip</type>
        <target>/apps/${appId}-vendor-packages/application/install</target>
    </embedded>
    <embedded>
        <groupId>com.adobe.aem</groupId>
        <artifactId>core-forms-components-af-core</artifactId>
        <target>/apps/${appId}-vendor-packages/application/install</target>
    </embedded>
    <embedded>
        <groupId>com.adobe.aem</groupId>
        <artifactId>core-forms-components-examples-apps</artifactId>
        <type>zip</type>
        <target>/apps/${appId}-vendor-packages/content/install</target>
    </embedded>
    <embedded>
        <groupId>com.adobe.aem</groupId>
        <artifactId>core-forms-components-examples-content</artifactId>
        <type>zip</type>
        <target>/apps/${appId}-vendor-packages/content/install</target>
    </embedded>
    
    note note
    NOTE
    以您的 appld 取代 ${appId}
    若要尋找你的 ${appId} (在 [AEM Repository Folder]/all/pom.xml 檔案內),搜尋 -packages/application/install 一詞。在 -packages/application/install 一詞以前的文字是您的 ${appId}。 例如,以下程式碼 myheadlessform${appId}
    code language-none
    
    
    
    
    com.myheadlessform
    
    myheadlessform.ui.apps
    
    zip
    
    /apps/myheadlessform-packages/application install
    
  6. [AEM Repository Folder]/all/pom.xml 檔案的 <dependencies> 部份中,新增以下相依性並儲存檔案:

    code language-xml
            <!-- Other existing dependencies -->
            <!-- wcm core components examples dependencies -->
            <dependency>
                <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.examples.ui.apps</artifactId>
                <type>zip</type>
            </dependency>
            <dependency>
                <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.examples.ui.config</artifactId>
                <type>zip</type>
                </dependency>
            <dependency>
                <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.examples.ui.content</artifactId>
                <type>zip</type>
            </dependency>
                <!-- forms core components dependencies -->
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-af-apps</artifactId>
                <type>zip</type>
            </dependency>
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-examples-apps</artifactId>
                <type>zip</type>
            </dependency>
                <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>core-forms-components-examples-content</artifactId>
                <type>zip</type>
            </dependency>
    
  7. 開啟 [AEM Repository Folder]/ui.apps/pom.xml 進行編輯。 新增 af-core bundle 相依性並儲存檔案。

    code language-xml
        <dependency>
        <groupId>com.adobe.aem</groupId>
        <artifactId>core-forms-components-af-core</artifactId>
        </dependency>
    
    note note
    NOTE
    確保您的專案中不包含以下調適型表單核心元件的成品。
    <dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>core-forms-components-apps</artifactId>
    </dependency>
    <dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>core-forms-components-core</artifactId>
    </dependency>
  8. 儲存並關閉檔案。

​3. 建立並部署更新的程式碼

將更新後的程式碼部署到您的本機開發環境和 Cloud Service 環境,以在這兩個環境中啟用核心元件:

在本機開發環境中建立和部署更新的程式碼 core-components-on-aem-forms-local-sdk

  1. 開啟命令提示或終端機。

  2. 瀏覽至 Git 存放庫專案的根目錄。

  3. 執行以下命令為您的環境建立套件:

    code language-shell
        mvn clean install
    

    建立好套件後,你可以在 [Git 存放庫資料夾]\all\target[appid].all-[version].zip 中找到套件

  4. 使用套件管理員,在本機開發環境中部署 [AEM Archetype 專案資料夾]\all\target[appid].all-[version].zip 套件。

在 AEM Forms as a Cloud Service 環境中建立和部署更新的程式碼 core-components-on-aem-forms-cs

  1. 開啟終端機或命令提示。

  2. 瀏覽至您的 [AEM Repository Folder],並依所列順序執行以下命令

    code language-shell
     git add pom.xml
     git add all/pom.xml
     git add ui.apps/pom.xml
     git commit -m "Added dependencies for Adaptive Forms Core Components"
     git push origin
    
  3. 將檔案提交到 Git 存放庫後,執行管道

    執行好管道後,為對應環境啟用調適型表單核心元件。 此外,調適型表單 (核心元件) 範本和 Canvas 3.0 主題新增至您的 Forms as a Cloud Service 環境中,為您提供自訂和建以核心元件為主調適型表單的選項。

常見問答 faq

核心元件有哪些? core-components

核心元件 是一組適用於 AEM 的標準化網站內容管理 (WCM) 元件,可加快開發時間並降低網站的維護成本。

啟用核心元件時新增哪些功能? core-components-capabilities

當為您的環境啟用調適型表單核心元件時,一個以核心元件為主的調適型表單空白範本和 Canvas 3.0 主題會新增至您的環境中。為您的環境啟用調適型表單核心元件後,您可以:

我該如何確認自己是否需要手動啟用最適化Forms核心元件? manual-enablement-needed-faq

大部分客戶已啟用最適化Forms核心元件。 只有符合以下條件時,才需要手動啟用它們:

  1. 您在自動包含核心元件之前已建立舊版的Forms as a Cloud Service程式
  2. 檢查最適化Forms核心元件是否已啟用區段的驗證檢查,會確認您的存放庫中缺少必要的相依性

如果您不確定,請依照上文檢查最適化Forms核心元件是否已啟用一節中的驗證步驟操作。

核心元件型表單為何無法在專案中呈現?

由於Forms核心元件套件和專案原型中包含的版本不符,核心元件型表單可能無法呈現。 此問題通常發生在專案原型中指定的版本等於或高於Forms核心元件套件隨附的版本時。 若要解決此問題,請執行下列任一項作業:

  • 在專案原型中使用較低版本的Forms核心元件套件。
  • 從專案原型中移除Forms核心元件相依性,因為AEM as a Cloud Service已包含所需版本。 Forms核心元件套件自發行說20133開始與AEM as a Cloud SDK搭配,例如AEM SDK v2025.3.20133.20250325T063357Z-250300
recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab