Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

Integrate into almost any other application using the Unified DAM Connector. It will give you a head start on development efforts and reduce both implementation time and risk.

...

Code Block
  @HostListener('window:message', ['$event'])
  onMessageReceived(event: any) {
    console.log(`${this.onMessageReceived.name}`, event);

    if (event && event.data && event.data.messageType) {
      const message: DigizuitePostMessage = event.data;
      if (message.messageType === MessageType.SmartPickerInitialized) {
        this.initializeSmartPicker();
      } else if (message.messageType === MessageType.ChangeUrl) {
        const baseUrl = message.mmUrl.endsWith('/') ? message.mmUrl.slice(0, -1) : message.mmUrl;
        this.setNewTempUrl(baseUrl + '/embedded');
      } else if (message.messageType === MessageType.AssetMessage) {
        const asset = message.asset;
        this.assetReceived.emit(asset);
      }
    }
  }

Events

Insert event

Code Block
languagejs
export interface AssetMessage {
  assetId: number;
  assetType: string;
  selectedQualityId: number;
  itemId: number;
  title: string;
  description: string;
  downloadUrl: string;
  thumb: string;
  extension: string;
  lastModifiedTimeInMs: number;
  hashSha1: string;
  isCustomFormat: boolean;
}

export class DigizuiteAssetPostMessage implements DigizuitePostMessage {
  messageType = MessageType.AssetMessage;
  assets: AssetMessage[];

  constructor(assets: AssetMessage[]) {
    this.assets = assets;
  }
}


When the insert button is clicked on the asset card, the event emitted contains the following information about the asset