Skip to main content
October 16, 2015
解決済み

Version-ing of image under /etc/design... much like versioned clientlibs

  • October 16, 2015
  • 1 の返信
  • 520 ビュー

Hi,

We have a requirement where we would like to version images under /etc/design. Basically, what we want to do is that if the image has been modified or republished a new version should be created and therefore the image could be cached on the dispatcher for a longer TTL like an year or so.

I thought of extending the AbstractImageServlet but since the images under /etc are nt:resource so they can't adapt To Asset class and the ImageContext gives NPE on adapting it to anything.

Any pointers on how this can be done would be appreciated.

Thanks

このトピックへの返信は締め切られました。
ベストアンサー Mshaji

Here is one way to do this

You need to create an event listener that listens to events under the node you are looking for (/etc/design)

http://blogs.adobe.com/experiencedelivers/experience-management/event_handling_incq/

If this event is triggered then call the following code to create version

var params = {};
    params["path"] = path;
    params["_charset_"] = "utf-8";
    params["cmd"] = "createVersion";

    params["comment"] = comment;

  
    CQ.HTTP.post("/bin/wcmcommand", null, params);

1 の返信

MshajiCommunity Advisor回答
Community Advisor
October 16, 2015

Here is one way to do this

You need to create an event listener that listens to events under the node you are looking for (/etc/design)

http://blogs.adobe.com/experiencedelivers/experience-management/event_handling_incq/

If this event is triggered then call the following code to create version

var params = {};
    params["path"] = path;
    params["_charset_"] = "utf-8";
    params["cmd"] = "createVersion";

    params["comment"] = comment;

  
    CQ.HTTP.post("/bin/wcmcommand", null, params);