Module: alfresco/services/NodePreviewService

alfresco/services/NodePreviewService

This service can be included in pages to handle the displaying previews of Nodes. By default the LightboxService will be used to preview images and all other Nodes will be shown using the AlfDocumentPreview via the DialogService. It is possible to override the services used through the configuration of this service to publish alternative payloads on alternative [topics]{@link module:alfresco/preview/AlfDocumentPreview#publishTopic}. It is also possible to pass additional configuration to the AlfDocumentPreview widget.
Since:
  • 1.0.59
Author:
  • Dave Draper
License:
Source:

Members

i18nRequirements :object[]

An array of the i18n files to use with this widget.
Type:
  • object[]
Default Value:
  • [{i18nFile: "./i18n/NodePreviewService.properties"}]
Source:

imageTitleProperty :string

The property to use for the image title. This will be displayed on lightboxes or dialogs used to show previews by default.
Type:
  • string
Default Value:
  • "displayName"
Source:

pluginConditionsOverrides :object[]

Defines any condition overrides for the previewer. This data is passed directly to the previewer configuration.
Type:
  • object[]
Default Value:
  • null
Source:

proxy :string

The proxy to use for the rest api call for the node's content or thumbnails. This is passed directly to the previewer configuration.
Type:
  • string
Default Value:
  • "alfresco"
Source:

publishPayload :object

This is an alternative payload that will be published when showing a preview. This is the payload that will be published on the topic published by showPreview.
Type:
  • object
Default Value:
  • null
Source:

publishTopic :string

The topic to publish when displaying a preview. By default this publishes a request that is expected to be handled by the DialogService, however this could be configured to be an alternative topic to ensure that previews are displayed differently. If this configuration is changed from the default then it is likely that the publishPayload will also need to be configured for the new topic.
Type:
  • string
Default Value:
  • CREATE_DIALOG
Source:

rawData :boolean

Indicates whether or not XHR requests should be rooted directly to the Alfresco Repository and bypass the Share web-tier.
Type:
  • boolean
Default Value:
  • true
Source:

useLightboxForImages :boolean

Indicates whether or not the LightboxService (or equivalent service) should be used for displaying image previews (i.e. Nodes that have a MIME type that contains the text "image/").
Type:
  • boolean
Default Value:
  • true
Source:

widgetsForPluginsOverrides :object[]

Defines any plugin overrides for the previewer. This data is passed directly to the previewer configuration.
Type:
  • object[]
Default Value:
  • null
Source:

Methods

checkNodeMetadata(payload)

Checks the node provided in the payload argument. If no "node.mimetype" attribute is provided then is will be necessary to load the full metadata for the Node (assuming that a "nodeRef" attribute has been provided.)
Parameters:
Name Type Description
payload object The payload for the show preview request.
Source:

onLoadNode(nodeRef)

Makes a request to load full metadata for the node. This is required for preview actions when MIME type data is not available in the currentItem object.
Parameters:
Name Type Description
nodeRef string The nodeRef to reqeuest the details for
Source:
Fires:
  • module:alfresco/core/topics#event:GET_DOCUMENT

onNodeLoaded(payload)

Handles the loading of the complete node metadat issued from onLoadNode.
Parameters:
Name Type Description
payload object
Source:

registerSubscriptions()

Sets up the subscriptions for the TagService
Source:
Listens to Events:

showPreview(previewData)

Shows the preview of the Node.
Parameters:
Name Type Description
previewData object The data object for showing the preview
Properties
Name Type Description
item object The item to be previewed (used for custom payloads)
nodeRef string The nodeRef of the node to preview
mimetype string The mimetype of the node
title string The mimetype of the node
Source:
Fires: