Giter Club home page Giter Club logo

aemaacs_postman_collection's Introduction

AEMaaCS Postman Collection

(Hopefully) growing Postman Collection for various AEM operations.

The Postman collection is a starting point for AEM developers and consultants. It should help you during, setup, migration, debugging and hotfixes. All commands were tested in AEM as a Cloud Service.

Together with the Postman Runner its also a valid bulk edit/migration tool.

Collaboration

If you want to add a CURL command, i guess its the easiest way to create an Issue. I will add it to the collection. Please test it on a working cloud environment first (not localhost!). Also: if you notice commands do not work let me know as well.

Why

There are several reasons why i created the repo.

  • Since CRXDE Lite is blocked in AEMaaCS its sometimes tough to do certain "stuff". Like quickly edit a property or delete a "nasty" node. Normally i use the AEMaaCS Repo Browser to find the culprit, then do the necessary changes via the collection.
  • Create custom packages (eg. use the aem querybuilder to find the needed assets for the package and use that payload to create the custom package.)
  • Mass creation of pages for eg. migration support with the help of the postman runner
  • Upload of assets (Also a valid runner (See "Runner Tasks" below) task if you want to upload multiple assets)
  • Mass change of user groups (Also a valid runner task)

Current CURL Commands

image image image

How to use

  • Create a classic (non IMS user) within AEM. I might add IMS support in the future.
  • Install the collection
  • Setup a new Postman Environment. The "Path" Variable is optional and only used for Postman Runner Tasks. It should look like this: image
  • Set the Environment
  • Have Fun

Runner Tasks

As stated above the Postman Runner is a valid tool for bulk/mass operations. Attached is a video of what I once did for content fragments (to create them in bulk based on a .csv). You don't see the AEM Collection in the video, but the logic is exactly the same. The variable settings in minute 0:30 are best not as seen in the video but set up in the environment.

Example

Lets assume you want to bulk change a certain property (lets say the jcr:title) for a subset of pages.

  • First you do the necessary JCR query to get the pages you need. (eg. get all pages that are under /path/to/content. See JCR Query Examples in the collection). Eg: image
  • You convert it to csv using https://www.convertcsv.com/json-to-csv.htm ( i know you can directly use a .json in the runner, so you can also do that)
  • You add the needed property per row to the .csv
  • Once you have the JCR Query output converted to csv you can use the runner to iterate through the pages and edit the needed property (See Video above)

The used csv. could look like this:

Path to property New Title
/content/page1/jcr:content New Title 1
/content/page2/jcr:content New Title 2

What is not working in the cloud (or untested)

Tree Activation

Tree Activation - Will not work in cloud since path is blocked curl -u admin:admin -F cmd=activate -F ignoredeactivated=true -F onlymodified=true -F path=/content/geometrixx http://localhost:4502/etc/replication/treeactivation.html

Create Replication Agents

curl -u admin:admin ‘http://localhost:4502/bin/wcmcommand’ -H ‘Content-Type: application/x-www-form-urlencoded; charset=UTF-8’ --data ‘cmd=createPage&charset=utf-8&parentPath=/etc/replication/agents.author&title=ReplicationAgentTest&label=&template=/libs/cq/replication/templates/agent’

BUNDLES:

Uninstall a bundle

curl -u admin:admin -daction=uninstall http://localhost:4502/system/console/bundles/“name of bundle”

Install a bundle

    curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
    bundlefile=@“name of jar.jar” http://localhost:4502/system/console/bundles

Build a bundle

    curl -u admin:admin -F bundleHome=/apps/centrica/bundles/name of bundle -F
    descriptor=/apps/centrica/bundles/com.centrica.cq.wcm.core-bundle/name_of_bundle.bnd
    http://localhost:4502/libs/crxde/build

Stop a bundle

    curl -u admin:admin http://localhost:4502/system/console/bundles/org.apache.sling.scripting.jsp
    -F action=stop

Start a bundle

    curl -u admin:admin http://localhost:4502/system/console/bundles/org.apache.sling.scripting.jsp
    -F action=start

Delete a bundle

     curl -u admin:admin -X DELETE http://localhost:4502/apps/localhost/install/com.localhost.core-6.2.26-SNAPSHOT.jar

BACKUP

curl -u admin:admin -X POST http://localhost:4502/system/console/jmx/com.adobe.granite:type=Repository/a/BackupDelay?value=0

curl -u admin:admin -X POST http://localhost:4502/system/console/jmx/com.adobe.granite%3Atype%3DRepository/op/startBackup/java.lang.String?target=mvtest

aemaacs_postman_collection's People

Contributors

frappierer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.