2021-08-11
AEM - Get incoming links to a page

Ubuntu 16.04.4 LTS AEM 6.4

  • Use Python script to get the Reference of a page in AEM
    • Use your own AEM admin password HTTPBasicAuth('admin', 'password')
    • XPath to get all incomingLinks
    • Install lxml (please refer to Use Python to read HTML element by XPath)
      test.py
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      from lxml import html
      import requests

      # print (requestURL)
      page = requests.get("http://localhost:4502/mnt/overlay/wcm/core/content/sites/jcr:content/rails/references/items/references.provider.html?item=/content/mysite/intl/en/test", auth=requests.auth.HTTPBasicAuth('admin', 'password'))
      # print (page.content)
      content = html.fromstring(page.content)
      links = content.xpath('//section[@data-type="incomingLinks")]/@data-path')
      # Remove duplicate links
      links = list(set(links))

      for link in links:
      print (link)

  • Run the script
    1
    python3 test.py
Read More

2021-07-22
AEM - setup cold standy author

On Standby

  1. Stop the synchronization process
  2. Stop AEM service
    sudo service aem stop`
  3. Check AEM java process is terminated
    $ ps -ef | grep java
    calviny  10755 10409  0 11:55 tty1     00:00:00 grep --color=auto java
  4. scp -pr /aem/author.primary aem-user@author2:/aem/author.standby
  5. Delete sling.id.file
    $ cd crx-quickstart/launchpad
    $ find . -name sling.id.file
    ./felix/bundle12/data/sling.id.file
    $ rm ./felix/bundle12/data/sling.id.file
    
  6. Update the run mode to standby in crx-quickstart/bin/start
    CQ_RUNMODE='author,nosamplecontent,prod,standby,aws'
  7. Start AEM service
    sudo service aem start`
Read More