public LongContainerView(
      T contentItem, Map<ContentItemType, List<BaseContentItem>> linkedContentItemsByType) {
    super(contentItem, linkedContentItemsByType);

    GlobalUtil.addIfNotNull(summary, createSummary());
    GlobalUtil.addIfNotNull(details, createDetails());
    GlobalUtil.addIfNotNull(narrativeLinks, createNarrativeLinks());
    createBackground();
    createReactions();
    createData();
    createNarratives();
    createImages();
    createAssets();
    GlobalUtil.addIfNotNull(map, createMap());
    createPlayers();
    createQuotes();
  }
  public BaseAssetPopupView(AssetContentItem contentItem) {
    initWidget(uiBinder.createAndBindUi(this));

    // Set the caption if there is one
    String captionText = contentItem.getCaption();
    if (!GlobalUtil.isContentEmpty(captionText)) {
      caption.appendChild(new ContentRenderer(captionText, false).getElement());
    }

    content.add(getContent(contentItem));

    // Add a byline if available
    if (contentItem.getAuthorsCount() > 0) {
      byline.add(new BylineWidget(contentItem, false));
    }
  }
  private void createImages() {
    List<AssetContentItem> linkedImages = linkedAssetsByType.get(AssetType.IMAGE);

    List<AssetContentItem> slideshowImages = new ArrayList<AssetContentItem>();
    List<AssetContentItem> thumbnailOnlyImages = new ArrayList<AssetContentItem>();

    for (AssetContentItem image : linkedImages) {
      if (GlobalUtil.isContentEmpty(image.getContent())) {
        thumbnailOnlyImages.add(image);
      } else {
        slideshowImages.add(image);
      }
    }

    if (!slideshowImages.isEmpty()) {
      AssetContentItem previewImage = slideshowImages.get(0);
      previewImage.setRelatedAssets(slideshowImages);
      Widget previewPanel =
          LinkedViewFactory.createView(previewImage, contentItem.getAuthorsString());
      if (previewImage.getImportance() == Importance.HIGH) {
        importantImages.add(previewPanel);
      } else {
        images.add(previewPanel);
        assignNavLinkString(images, AssetType.IMAGE.getNavLinkString());
      }
    }

    for (AssetContentItem image : thumbnailOnlyImages) {
      Widget previewPanel = LinkedViewFactory.createView(image, contentItem.getAuthorsString());
      if (image.getImportance() == Importance.HIGH) {
        importantImages.add(previewPanel);
      } else {
        images.add(previewPanel);
        assignNavLinkString(images, AssetType.IMAGE.getNavLinkString());
      }
    }
  }
  /**
   * A narrative that is linked to an event or another narrative and has to be rendered within it
   * has to be treated especially, because unlike with other linked content item types, we do want
   * to show the content items that have been linked to the narrative. We'll only show the linked
   * content items of the type: Multimedia, Quotes and Players.
   *
   * <p>TODO: Reuse the ContainerView here somehow, instead of reimplementing a bunch of stuff.
   */
  private Widget renderLinkedNarrative(NarrativeContentItem narrative) {
    // The left panel has the narrative headline, byline, summary and body
    Widget leftPanel = LinkedViewFactory.createView(narrative, contentItem.getAuthorsString());
    // The right panel has multimedia, players and quotes
    FlowPanel rightPanel = new FlowPanel();
    rightPanel.addStyleName(Resources.INSTANCE.css().linkedContentItemsPanel());

    // Create a map from the different types linked to the narrative to the widgets of content items
    // of those types that will be rendered
    Map<ContentItemType, List<Widget>> linkedWidgetsMap =
        new HashMap<ContentItemType, List<Widget>>();
    for (ContentItemType contentItemType : LINKED_TYPES_SHOWN_FOR_NARRATIVES) {
      linkedWidgetsMap.put(contentItemType, new ArrayList<Widget>());
    }
    List<AssetContentItem> linkedImages = new ArrayList<AssetContentItem>();

    for (BaseContentItem linkedContentItem : narrative.getLinkedContentItems()) {
      if (linkedContentItem != null) {
        ContentItemType linkedContentItemType = linkedContentItem.getContentItemType();
        if (linkedContentItemType == ContentItemType.ASSET
            && ((AssetContentItem) linkedContentItem).getAssetType() == AssetType.IMAGE) {
          // Collect all of the images in a list so that they can be shown in a slideshow
          linkedImages.add((AssetContentItem) linkedContentItem);
        } else if (LINKED_TYPES_SHOWN_FOR_NARRATIVES.contains(linkedContentItemType)) {
          // Create a widget for the linked content items and put it in the map
          linkedWidgetsMap
              .get(linkedContentItemType)
              .add(LinkedViewFactory.createView(linkedContentItem, narrative.getAuthorsString()));
        }
      }
    }
    // First render the images
    // TODO: this is mostly repeated from 'createImages' below, but
    // will go away once we get narratives rendering with a ContainerView as well.
    if (!linkedImages.isEmpty()) {
      List<AssetContentItem> slideshowImages = new ArrayList<AssetContentItem>();
      List<AssetContentItem> thumbnailOnlyImages = new ArrayList<AssetContentItem>();

      for (AssetContentItem image : linkedImages) {
        if (GlobalUtil.isContentEmpty(image.getContent())) {
          thumbnailOnlyImages.add(image);
        } else {
          slideshowImages.add(image);
        }
      }

      if (!slideshowImages.isEmpty()) {
        AssetContentItem previewImage = slideshowImages.get(0);
        previewImage.setRelatedAssets(slideshowImages);
        Widget previewPanel =
            LinkedViewFactory.createView(previewImage, contentItem.getAuthorsString());
        rightPanel.add(previewPanel);
      }

      for (AssetContentItem image : thumbnailOnlyImages) {
        rightPanel.add(LinkedViewFactory.createView(image, contentItem.getAuthorsString()));
      }
    }
    // Then render the rest of the linked content items
    for (List<Widget> widgetList : linkedWidgetsMap.values()) {
      for (Widget widget : widgetList) {
        rightPanel.add(widget);
      }
    }

    FlowPanel linkedNarrativePanel = new FlowPanel();
    if (rightPanel.getWidgetCount() > 0) {
      linkedNarrativePanel.add(rightPanel);
    }
    linkedNarrativePanel.add(leftPanel);

    narrativeWidgetsById.put(narrative.getId(), linkedNarrativePanel);

    return linkedNarrativePanel;
  }