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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Asset replication with tags

Avatar

Level 2

I am trying to replicate Assets with associated tags. But only assets are getting Activated. So I  separately replicated tags first and then the assets. Is this an expected behavior?

0 Replies

Avatar

Level 1

Yes. As you need separate set of permissions to replicate assets and tags. In your case you have permission to replicate both assets and tags. But that is always not the case.

Avatar

Employee Advisor

If you have the right set of permissions, you should see all the tags that would be replicated with the asset.

pub-tags.PNG

Avatar

Level 2

Thank you. I tried your solution and it works as you mentioned while doing it manually. But I am trying to replicate asset with tags programatically. In that case I could not see the tags getting replicated with assets. I have given enough permissions to the system user.

Avatar

Community Advisor

Hi,

You may need to replicate tags separately then. You can get assets tags using TagManager com.day.cq.tagging.TagManager  and Replicated them also.

Avatar

Level 4

Hi,

If you are using workflow to activate the pages/assets, the best practice is create custom process to activate the page/assets associated resources.

You can use the ResourceCollectionUtil to collect the resources associated given page.

Ex:

ResourceCollection rcCollection = ResourceCollectionUtil.getResourceCollection((Node)session.getItem(path), rcManager);

List resPaths = rcCollection.list(new String[] {  "dam:Asset","cq:tags" });

iterate resPaths to get the node path and replicate.

Thanks!