Highlighted

How to create folder from url

chung_yonge1684

02-11-2018

Hello Everyone,

I have a question.

When I publish after I select file(ex:BeSafeOutThereOnStarCanada_p240.mp4) on asset page like the below picture,

(This url is http://localhost-aem-dispatcher:4502/assets.html/content/dam/rcc-solution-poc/rcc-video)1612552_pastedImage_1.png

the file(ex:BeSafeOutThereOnStarCanada_p240.mp4) for dispatcher cache has been created successfully like the below picture.

1612562_pastedImage_4.png

But when I publish after I select folder(ex:rcc-video) on asset page like the below picture,

(This url is http://localhost-aem-dispatcher:4502/assets.html/content/dam/rcc-solution-poc)

1612563_pastedImage_5.pngthe folder(ex:rcc-video) for dispatcher cache does not create like the below picture.

1612564_pastedImage_6.png

I have implemented to create file and folder with HttpClient package when I publish on asset page.

The file caching works well.

But the folder caching does not work.

Also I tried it with curl command when I publish on asset page.

But file caching and folder caching did not work.

I have to implement to create folder only when I publish after I select the folder only on asset page.

Can you recommend me how to create folder(ex:rcc-video) from url(http://localhost-aem-dispatcher:4502/assets.html/content/dam/rcc-solution-poc/rcc-video) regardless of operating system (ex:windows, unix, max os) ?

Regards

Chung Yong.

Replies

Highlighted

smacdonald2008

02-11-2018

I am not clear at all on your use case - looks like you want to publish an asset from one AEM instance to another.

Also - if you need to perform some additional tasks when publishing an Asset/Page in AEM - i recommend that you look at using a workflow and purhaps the use of custom workflow step.

Highlighted

amitgupta_adbe

Employee

02-11-2018

a file is created in dispatcher cache because dispatcher is trying to cache the file, when you try to publish it or go to details page. Browser must be sending a get request for the file and dispatcher must be caching it.

In case of folder, there is no such file requested. dispatcher will not cache any thing.

Why do you want to rely on folder or file being created in dispatcher cache

Highlighted

chung_yonge1684

03-11-2018

This page is Asset Page.

1613597_pastedImage_0.png

This tree is /content/dam for Asset in CRXDE Lite.

1613598_pastedImage_1.png

When I unpublished parent folder(ex:parent) in Asset Page, all children folders(ex:child1, child2,) and all children files(ex:file01.doc, file02.txt, file03.pptx,file04.xlsx) unpublished automatically.

But when I published parent folder(ex:parent) in Asset Page, all children folders(ex:child1, child2,) and all children files(ex:file01.doc, file02.txt, file03.pptx,file04.xlsx) did not publish automatically.

Parent folder(ex:parent) published only.

I can not understand why.

So, Because of that,  child has activated  child only In  line 187 of my source code like below that.

1613599_pastedImage_3.png

In addition, In my source code,  I want to  implement  the method that activate all child folders and files  when parent folder activates in asset page.

How can I implement  it ?

Regards

Chung Yong.

Highlighted

Arun_Patidar

MVP

04-11-2018

To Activate child page automatically on activation of parents, you can write sling event listener which listen this nodes replication event and as soon as parent publish, children pages will also be published.