Replicating AEM file tree | Community
Skip to main content
TheBigRed
Level 4
January 21, 2016

Replicating AEM file tree

  • January 21, 2016
  • 2 replies
  • 5142 views

Hello,

 

I have page where I want users to select a folder to do a process with it.

Instead of entering the path can this be done by using AEM's file tree structure

Where is the JS I can use or library I can extend for my use?

Here is an image of what I mean:

 

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

smacdonald2008
Level 10
January 21, 2016

I recommend that you follow the official AEM documentation on how to replicate pages. This is documented here: 

https://docs.adobe.com/docs/en/aem/6-1/author/page-authoring/publishing-pages.html

https://docs.adobe.com/docs/en/aem/6-1/author/page-authoring/publishing-pages.html#Publishing a Page

If you want to replicate a lot of pages at once - see: 

https://docs.adobe.com/docs/en/cq/5-6-1/wcm/page_publish.html#How to activate a complete section (tree) of your website

Amit_Kumar
Level 10
January 21, 2016

Option 1: You can write a publish workflow to publish your content based on the selection you can calculate the payload under that file struture or folder 

sample code :

var replicator = sling.getService(Packages.com.day.cq.replication.Replicator); var session = workflowSession.getSession(); // get list of paths to replicate (no resource collection: size == 1 //@param: pathList for (var aPath: pathList) { replicator.replicate(session, Packages.com.day.cq.replication.ReplicationActionType.ACTIVATE, aPath); // CUSTOMIZED CODE.... }

Option 2: If you want to go with java and modify things on your own than read https://docs.adobe.com/docs/en/aem/6-0/develop/ref/javadoc/com/day/cq/replication/package-use.html

Option 3: if you have loads of data under selection than use vlt rcp this will be a tricky thing as you have to run a command like this every time you publish something

sample command: vlt rcp -b 100 -r -u -n http://admin:admin@localhost:4502/crx/-/jcr:root/content/dam/Test-1 http://admin:admin@localhost:4503/crx/-/jcr:root/content/dam/Test-1

readmore http://cq-ops.tumblr.com/post/43179911102/how-to-efficiently-copy-large-amounts-of-content

TheBigRed
TheBigRedAuthor
Level 4
January 22, 2016

Hey guys sorry that's not what I meant.

What I want to do is click a search icon on an custom built HTML page.

And have that icon display all the folders in AEM exactly like the image attached.

Based on what ever folder they picked, I need it to also return the absolute path.

That image is from a AEM page. I just want the javascript/function that this is based off.

Don't need anything on replicating pages.

 

Hope this helps

Thanks!

edubey
Level 10
January 22, 2016

Hi TheBigRed,

I think this is what you are after: /libs/cq/ui/widgets/source/widgets/BrowseDialog.js

Thanks