CURL command for Merge Mode in AEM 6.5 | Adobe Higher Education
Skip to main content
Level 2
November 16, 2022
解決済み

CURL command for Merge Mode in AEM 6.5

  • November 16, 2022
  • 2 の返信
  • 1297 ビュー

Hello everyone, 

We have a special request from the client where in we need change the mode in which package is created and installed using curl command to "Merge". Currently, we are using curl commands via Jenkins Groovy to create the package and install them from one instance to another. But since we don't specify any mode , the default behaviour is "Replace" for the contents which get installed on a specific instance. 

 

Is there a way we can achieve this workspace filter using curl command ?

 

@arunpatidar @venkateshsh1 

このトピックへの返信は締め切られました。
ベストアンサー aanchal-sikka

Hello @anirudhanand 

 

Its not possible to append the merge mode via curl command.

 

You can use the below steps to append mode to filter:

  • Unzip the package zip file on your computer - jar -xvf append_mode-1.0.zip META-INF/vault/filter.xml
  • Open the file META-INF/vault/filter.xml in a text editor.
  • Add mode="merge" to the <filter ...> tag. Example:

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/content/we-retail/us/en/products/women" mode="merge" />
</workspaceFilter>

 

  • Re-zip the modified package contents so it includes the change - jar -uvf  append_mode-1.0.zip META-INF/vault/filter.xml

 

2 の返信

SantoshSai
Community Advisor
Community Advisor
November 16, 2022

HI @anirudhanand ,

I believe, you can achieve this by setting up flag -F

curl -u <user>:<password> -F cmd=install -F mode=merge http://localhost:4502/crx/packmgr/service/.json/etc/packages/my_packages/test.zip

Hope that helps!

Regards,

Santosh

Santosh Sai
anirudhanand作成者
Level 2
November 17, 2022

Hi Santosh,

 

Thank you so much for this solution but this doesn't seem to work for me. When I tried the same the the content does get replaced. Also will there be any update on the filter.xml on using the -F mode=merge since I couldn't find it to be updated?

 

Could you please guide here.

 

Thanks,

Anirudh

aanchal-sikka
Community Advisor
Community Advisor
September 5, 2023

Hello @anirudhanand 

 

Its not possible to append the merge mode via curl command.

 

You can use the below steps to append mode to filter:

  • Unzip the package zip file on your computer - jar -xvf append_mode-1.0.zip META-INF/vault/filter.xml
  • Open the file META-INF/vault/filter.xml in a text editor.
  • Add mode="merge" to the <filter ...> tag. Example:

<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
    <filter root="/content/we-retail/us/en/products/women" mode="merge" />
</workspaceFilter>

 

  • Re-zip the modified package contents so it includes the change - jar -uvf  append_mode-1.0.zip META-INF/vault/filter.xml

 

Aanchal Sikka