简体   繁体   English

使用cURL禁用AEM的墨水检查器

[英]Disable AEM's ink checker using cURL

As per this article - https://helpx.adobe.com/experience-manager/kb/DisableLinkChecker.html to disable link checker in AEM we need to follow these steps - 按这篇文章- https://helpx.adobe.com/experience-manager/kb/DisableLinkChecker.html禁用链接检查在AEM我们需要遵循这些步骤-

Disable all link checking by configuration 通过配置禁用所有链接检查

  1. Go to /system/console/configMgr and login as admin. 转到/ system / console / configMgr并以管理员身份登录。
  2. Find the "Link Checker Transformer" 找到“链接检查器变压器”
  3. Check the "Disable Checking" box and save 选中“禁用检查”框并保存
  4. Go to /crx/explorer and login as admin 转到/ crx / explorer并以管理员身份登录
  5. Open "Content Explorer" 打开“内容资源管理器”
  6. Browse to /var/linkchecker 浏览到/ var / linkchecker
  7. Right click the node and select "Delete Recursively" 右键单击该节点,然后选择“递归删除”
  8. Click "Save All" 点击“全部保存”

I want to include disabling link checker as a part of my AEM server's deployment/setup script. 我想将禁用链接检查器作为AEM服务器的部署/设置脚本的一部分。 Is there a way to do this using cURL? 有没有办法使用cURL做到这一点?

Thanks 谢谢

  • Steps 1 to 4 步骤1至4

To check the Disable Checking box using cURL, this should do the trick: 要使用cURL选中“ Disable Checking框,应执行以下操作:

curl -u admin:admin http://localhost:4502/system/console/configMgr/com.day.cq.rewriter.linkchecker.impl.LinkCheckerTransformerFactory --data 
"apply=true&action=ajaxConfigManager&%24location=launchpad%3Aresources%2Finstall%2F0%2Fcq-rewriter-5.9.30.jar&linkcheckertransformer.disableRewriting=false&linkcheckertransformer.disableChecking=true&linkcheckertransformer.mapCacheSize=5000&linkcheckertransformer.strictExtensionCheck=false&linkcheckertransformer.stripHtmltExtension=false&linkcheckertransformer.rewriteElements=a%3Ahref&linkcheckertransformer.rewriteElements=area%3Ahref&linkcheckertransformer.rewriteElements=form%3Aaction&propertylist=linkcheckertransformer.disableRewriting%2Clinkcheckertransformer.disableChecking%2Clinkcheckertransformer.mapCacheSize%2Clinkcheckertransformer.strictExtensionCheck%2Clinkcheckertransformer.stripHtmltExtension%2Clinkcheckertransformer.rewriteElements"

I used firefox network tab (firebug) to capture the above payload. 我使用firefox的“网络”标签(firebug)捕获了上述负载。 You can do this as well, just check the box and hit save in configMgr and capture the corresponding network req. 您也可以执行此操作,只需选中该复选框,然后在configMgr中单击保存并捕获相应的网络要求。 There is an option to Edit and Resend a request, click that and you'll see the url encoded request body. 有一个选项可以Edit and Resend请求,单击该选项,您将看到URL编码的请求正文。


Better way to do this - 更好的方法是-

The above cURL updates the field in configMgr (applies to the entire server) and is generally not recommended. 上面的cURL更新configMgr中的字段(适用于整个服务器),通常不建议这样做。

Instead create a run mode config and modify this field there. 而是创建一个运行模式配置并在那里修改该字段。 This cURL should help you with that. 此cURL应该可以帮助您。 This creates a sling:OsgiConfig node under your apps config node. 这将在您的应用程序config节点下创建一个sling:OsgiConfig节点。

curl  -F "jcr:primaryType=sling:OsgiConfig"  -F linkcheckertransformer.disableChecking=true -F "linkcheckertransformer.disableChecking@TypeHint=Boolean" -u admin:admin  http://localhost:4502/apps/<<YOUR_APP>>/config/com.day.cq.rewriter.linkchecker.impl.LinkCheckerTransformerFactory

  • Steps 5 to 8 步骤5至8

curl -u admin:admin -X DELETE http://localhost:4502/var/linkchecker

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM