Expand my Community achievements bar.

SOLVED

DAM Embargoed asset pop-up (asset publish only when on time reached)

Avatar

Level 7

Hi Team,

 

When author activates the asset, and the effective publish date is not reached, a popup will display.

 

So here, we have an option in metadata of an asset is "effective date" it is a date field.

image.png

 

Now the requirement if we publish the asset only when it reach effective dates, it we try to publish asset before effective date then it'll show a pop-up,

Asset will not be published until effective date is reached.."

 

Give option to Cancel or Proceed with in Pop-up.  Proceed will activate the asset.

 

Not sure how to do this, we need to write a JS, but which OOTB JS we need to overlay for asset metadata, or how to do this?

 

Note : here "Effective dates" is a custom date field in metadaschema.

Scenario : Suppose, if author set Effective date as 30-Dec-2020 and want to activate the asset before mention effective date 30-Dec-2020, then instead of publishing it'll show the pop-up 

"Asset will not be published until effective date is reached.."

Give option to Cancel or Proceed with in Pop-up.  Proceed will activate the asset.

 

@arunpatidar  @Vijayalakshmi_S  @kautuk_sahni @Theo_Pendle   @Nikhil-Kumar 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @tushaar_srivastava,

OOB Default Metadata Schema doesn't has this field named "Effective Dates". (Per 6.5.0)

Is it a custom field you have as part of your project specific schema?

 

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

Hi @tushaar_srivastava,

OOB Default Metadata Schema doesn't has this field named "Effective Dates". (Per 6.5.0)

Is it a custom field you have as part of your project specific schema?

 

Yes Effective Dates is a custom field and example is author set effective date as 15-sept-2020 and if want to publish before 15-sept-2020 then it'll not publish the asset instead will show the pop-up

 

Updated the same in above question, thank you 

Avatar

Community Advisor
Thanks for the details. I will check in my local and respond.

Avatar

Community Advisor

Hi @tushaar_srivastava,

Below mentioned details are per AEM 6.5.0

JS responsible for Quick Publish : 

  • /libs/dam/gui/coral/components/admin/publish/clientlibs/publishasset/publishasset.js

JS for Manage Publication :

  •  /libs/dam/gui/coral/components/admin/managepublication/clientlibs/managepublication/js/managepublication.js

Steps for Overlay:

  • You need to overlay the publishasset node to apps (Right click on the publishasset node from libs path -> Overlay node -> Check "Match node types")
  • Copy paste the publishasset.js and js.txt file to /apps
  • Amend the publishasset.js in the apps path (Understand the complete flow of existing JS and introduce pop up accordingly)

Code responsible for pop up:

 

var ui = $(window).adaptTo("foundation-ui");
            		ui.prompt("Asset Quick Publish", message.html(), "notice", [{
                	text: "CANCEL"
            		}, {
                	text: "PUBLISH",
                	primary: true,
                	handler: function() {
                    	replicateToPublish(activator);
                	}
            		}]);

 

foundation-ui JS component's prompt is responsible for pop up

https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/granite-ui...

Logic related to asset's Effective date:

You can introduce above prompt snippet within the desired effective date condition. (Selected asset path can be accessed as below)

 

var $collection = $(".cq-damadmin-admin-childpages.foundation-collection");
        	var items = $collection.find(".foundation-selections-item");
			var assetPath = $(items[0]).data("foundation-collection-item-id");

 

I suggest to understand the existing logic in JS files shared and incorporate the code accordingly. 

Will try to cover it in my blog post with detailed steps. 

Please update this thread in case of clarification. 

Hi @Vijayalakshmi_S, Thank you for details, I have analyzed it and got the way how to do, It will be very helpful if you cover this with detailed steps .to your blog : https://myaemlearnings.blogspot.com/