Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Replicating AEM file tree

TheBigRed
Level 4
Level 4

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

8 Replies
smacdonald2008
Level 10
Level 10

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
Community Advisor
Community Advisor

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
Level 4
Level 4

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
Level 10

Hi TheBigRed,

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

Thanks

TheBigRed
Level 4
Level 4

edubey wrote...

Hi TheBigRed,

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

Thanks

 


Right this is what I wanted. I'm not sure how I would call this dialog though on lets say button click event through JS.

Any examples please?

edubey
Level 10
Level 10

Prior to that can you elaborate this in your question "Instead of entering the path can this be done by using AEM's file tree structure"

TheBigRed
Level 4
Level 4

edubey wrote...

Prior to that can you elaborate this in your question "Instead of entering the path can this be done by using AEM's file tree structure"

 

I want to use that JS to return a path using that little widget window. 

edubey
Level 10
Level 10

Any specific reason you do not want to use xtype pathfield already available?