Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.

 

Robert Svallin
Nov 29, 2024
  547
(3 votes)

DAM integration new major version, performance improvements and Library Picker folder selection

As you might already have seen we have decided to delist the EPiServer.CMS.WelcomeIntegration version 1.4.0 where we introduced Graph support. Unfortunately a return type was changed that we didn’t catch which means that it became a breaking change. We have decided to delist 1.4.0 and release the performance improvements we have been working on as a new major. We apologize for any inconvenience this has caused and suggest that you either downgrade to 1.3.9 and rely on the CMP API instead of Graph, or upgrade to 2.0.0 instead. We recommend to upgrade to 2.0.0 for the best performance.

Performance

The integration between CMS and CMP uses a combination of the CMP Library Picker, in which the editor selects the asset to reference and, either the CMP´s REST API, or indexed assets in Graph. The API or Graph is used to pull metadata regarding the assets such as sizing or alt texts. The integration with REST API has been around for quite some time and the Graph integration was released in the previous version, 1.4.0, and we described how to configure it in this blog post by Bartosz Sekula.

We are now releasing a change in how metadata is cached in the CMS for assets referenced from CMP DAM. Moving forward from version 2.0.0 the cache will move to the database and stored permanently. This removes the need for any page request that contain CMP DAM assets to perform outbound network requests to retrieve that metadata when cache has expired.

The metadata will be fetched for Image assets from CMP when a content that contains references to those images is published. So metadata will be available once the page starts to receive traffic. Please note that fetching the metadata is handled in the background to not block the editor from interacting with the UI. If the images are already referenced by other pages or block then the already existing metadata will be used.

Should for some reason the metadata not have been populated then the image will still render but with the public URL which was stored the first time the asset was referenced, instead of the latest URL provided by CMP through the metadata.

Renditions of Images is a bit different and a topic to which we will return. Currently the renditions for an image asset will render without alt-text. As already stated, we are working on resolving that. The HtmlHelper and TagHelper as well as DamImageAssetViewComponent will still render the correct rendition.

Example of using HtmlHelper

@model PageViewModel<StandardPage>
@using EPiServer.Cms.WelcomeIntegration.UI.Helpers

@await Html.RenderTagWithMetadata(p => p.CurrentPage.Image)

Example of using TagHelper

@model PageViewModel<StandardPage>
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

<dam-asset content-reference="@Model.CurrentPage.Image" />

Maintaining asset metadata

Since the metadata for Images now have moved to the database, how does it get updated? A new scheduled job has been created which will, on schedule, pull metadata from CMP DAM for all assets and update in CMS. This job can be executed manually should the need arise to sync metadata between CMP and CMS.

The scheduled job for maintaining CMP DAM asset metadata in CMS

Metrics from testing scenarios indicate big performance improvements when serving content with DAM assets to visitors.

Asset Library folder selection

CMP has the possibility to organize content in folder structures and it is now possible configure either globally or by type which folder to open in the CMP Library Picker. Configuration is done at startup or appSettings as usual.

.AddDAMUi(o => {
    o.Enabled = true;
    o.GlobalRootFolderGuid = "a7fd6357c13d49829715f38fe8114c40";
    o.RootFolderForTypes = new Dictionary<string, IEnumerable<Type>>
    {
        { "57523add60d04e328d7fc1e02c05ed40", new Type[] { typeof(DAMImageAsset) } },
        { "7bce1de28e66411590ac32896eff2ce1", new Type[] { typeof(DAMVideoAsset) } },
        { "72b89ab1b83041acaab861a035db7e7b", new Type[] { typeof(DAMAsset) } }
    };
});
Nov 29, 2024

Comments

Mike Malloy
Mike Malloy Dec 2, 2024 08:22 PM

You should add an Admin page to Settings that allows a single asset to be updated. Otherwise the user has to wait for the job to finish.

Robert Svallin
Robert Svallin Dec 2, 2024 09:57 PM

Yes you are correct and we plan on improving this aspect. For the time being, metadata is pulled from CMP when publishing content that references assets in CMP or through the daily job. I dont have an ETA on improvements to the sync just yet, but we are planning for it.

Please login to comment.
Latest blogs
Optimizely Content Graph on mobile application

CG everywhere! I pull schema from our default index https://cg.optimizely.com/app/graphiql?auth=eBrGunULiC5TziTCtiOLEmov2LijBf30obh0KmhcBlyTktGZ in...

Cuong Nguyen Dinh | Jan 20, 2025

Image Analyzer with AI Assistant for Optimizely

The Smart Image Analyzer is a new feature in the Epicweb AI Assistant for Optimizely CMS that automates the management of image metadata, such as...

Luc Gosso (MVP) | Jan 16, 2025 | Syndicated blog

How to: create Decimal metafield with custom precision

If you are using catalog system, the way of creating metafields are easy – in fact, you can forget about “metafields”, all you should be using is t...

Quan Mai | Jan 16, 2025 | Syndicated blog

Level Up with Optimizely's Newly Relaunched Certifications!

We're thrilled to announce the relaunch of our Optimizely Certifications—designed to help partners, customers, and developers redefine what it mean...

Satata Satez | Jan 14, 2025

Introducing AI Assistance for DBLocalizationProvider

The LocalizationProvider for Optimizely has long been a powerful tool for enhancing the localization capabilities of Optimizely CMS. Designed to ma...

Luc Gosso (MVP) | Jan 14, 2025 | Syndicated blog

Order tabs with drag and drop - Blazor

I have started to play around a little with Blazor and the best way to learn is to reimplement some old stuff for CMS12. So I took a look at my old...

Per Nergård (MVP) | Jan 14, 2025