dist/dynamicContent/dynamicContent.service.js
/**
   * Link the component on the canvas with the item in the HTML store
   * If it does not exist, create a new store item
   */
Link the component on the canvas with the item in the HTML store
If it does not exist, create a new store item
Link the component on the canvas with the item in the HTML store If it does not exist create a new store item
linkComponentToStoreItem(component) {
    let decId = DynamicContentService.getDataParamDecid(component);
    if (decId > 0) {
      this.logger.debug('DC: Already wired up', {
        decId
      });
      return decId;
    } 
    const tokenName = this.getTokenName(component);
    const tokenNr = DynamicContentService.getDecId(tokenName);
    decId = tokenNr;
    if (decId > 0) {
      this.logger.debug('DC: Using decId from token nr', {
        tokenName,
        decId
      });
      return decId;
    } 
    if (!this.getStoreItem(decId)) {
      this.createNewStoreItem(component);
    } 
    return DynamicContentService.getDataParamDecid(component);
  }
linkComponentToStoreItem ( component ) { let decId = DynamicContentService . getDataParamDecid ( component ) ; if ( decId > 0 ) { this . logger . debug ( 'DC: Already wired up' , { decId } ) ; return decId ; } const tokenName = this . getTokenName ( component ) ; const tokenNr = DynamicContentService . getDecId ( tokenName ) ; decId = tokenNr ; if ( decId > 0 ) { this . logger . debug ( 'DC: Using decId from token nr' , { tokenName , decId } ) ; return decId ; } if ( ! this . getStoreItem ( decId ) ) { this . createNewStoreItem ( component ) ; } return DynamicContentService . getDataParamDecid ( component ) ; }
Link the component on the canvas with the item in the HTML store
 If it does not exist, create a new store item
Link the component on the canvas with the item in the HTML store If it does not exist create a new store item
// get components data-param-dec-id (can come from token from db) // not wired up yet - get component token id // double check if a store item exists - if not found - create new store item // return components dec-id (also from the new one)