Options
All
  • Public
  • Public/Protected
  • All
Menu

Unsupported Items

The IViewerCardConfig.supportsItem method is used to determine whether a viewer type supports a specific item in the queue. When a viewer type indicates that it doesn't support a queue item, the viewer collection can handle the situation in a multiple ways depending on the viewer tab visibility mode. For information about viewer tab visibility mode, see Viewer Tabs .

Additionally, the Relativity Review Interface allows extensions to configure how this situation is handled.

This page contains the following information:

Viewer tabs

By default, the tab for a viewer type handles unsupported items by changing its text to read: No [viewer title here].

Custom viewer types can override this default text by setting the IViewerCardInstance.unsupportedTabTitle property. When this property is defined, the viewer collection uses the value as the tab text for the unsupported queue items.

If this property is undefined, then the viewer collection uses the default text.

Viewer card overlays

By default, if a user loads an unsupported queue item into a viewer, the viewer collection overlays the viewer card content with a special card. This card indicates to the user that the viewer type doesn't support the item.

Note: The cardLoadItem() method of the viewer card instance won't be invoked in these situations.

Custom viewer types can override this default content by setting the IViewerCardInstance.cardCreateUnsupportedOverlayCard property. This method takes a set of parameters describing the scenario and returns a card that displays over the content in the viewer card. For information about custom cards, see Cards.

The following code sample illustrates how this method can create an overlay card. First, register the custom unsupported item card in the extension config:

{
    id: "custom.viewer.unsupported",
    title: "Custom Viewer Unsupported",
    loader: {
        iframe: {
            // HTML page for the card uploaded as a resource file
            fileName: "unsupported-item-card.html"
        }
    }
    // Note that there is no default location property defined.
}

Next, return a new instance of the card from the cardCreateUnsupportedOverlayCard() method:

function CustomViewerCardInstance() {
  return {
    cardCreateUnsupportedOverlayCard: function (api, card, item) {
      // Note that no location parameter is provided to the createCard method.
      var unsupportedItemCard = api.cards.createCard(
        "custom.viewer.unsupported"
      );
      return Promise.resolve(unsupportedItemCard);
    },
  };
}