Navigation History Widget

The Navigation History widget stores any communication going through. It enables direct switching to any of the items that were viewed previously.

The widget registers as a listener on all defined virtual input sockets. Every message received from all of those sockets is put into history queue. It can be sent further through configured virtual output socket (depending on widget instance settings). You can display the history that is saved, and choose to resend any of the stored communications. If so, then stored messages are sent through appropriate output, and then the chosen item is displayed.

Widget Definition

Name Navigation History
ID com.hybris.cockpitng.navigationhistory
Category Navigation
Description Stores the history of sockets communication and allows resending of any of the stored messages.
Applied In Not applicable
Based On Not applicable
Author SAP
Inputs Details of input socket:
  • resetHistory
    • Type: java.lang.Object
    • Multiplicity: Single
    • Description: Any message received causes the history to be cleared. The received value is ignored.
  • emptyHistoryEvaluationTarget
    • Type: java.lang.Object
    • Multiplicity: Single
    • Description: object received on this socked is used to evaluate emptyHistoryBackButtonPressed socket output value with SpEL expression defined in emptyHistoryOutputValueEval.
  • doBack
    • Type: java.lang.Object
    • Multiplicity: Single
    • Description: Allows to perform back using a socket. The behavior is as if a User clicked the Back button in the UI.
  • removeItem
    • Type: java.lang.Object
    • Multiplicity: Collection
    • Description: Causes the widget to remove all occurrences of a received object in the navigation history.
Outputs Details of output socket:
  • emptyHistoryBackButtonPressed
    • Type: java.lang.Object
    • Multiplicity: Single
    • Description: sends emptyHistoryBackButtonPressed output socket with value evaluated with Spring Expression Language when back button is pressed and history is empty. SpEL uses expression defined in the emptyHistoryOutputValueEval setting and emptyHistoryEvaluationTarget as evaluation target, if it was received. If not, then the widget model is the evaluation target. If emptyHistoryBackOutputValue setting is empty then socket is not sent. The Back button is inactive. You can also see an example of this usage when you send perspective name to View Switcher Widget to switch perspectives.
Generated Events Not applicable

Configuration

Not applicable.

Widget Preview

General widget preview:

The widget consists of a Back button and history stack button with a three dots image

A widget preview with no history stored. When you enter editor area of the first product, the widget looks inactive as no data is stored yet. After you move between your products, the widget becomes active as it starts gathering the data.

The widget stores data of the items you viewed. You can either click the Back button and move to the last viewed item or you can click the Three Dots icon (history stack) and choose the item you what to view again. When you click the chosen item, the Navigation History widget clears data of the items you viewed in between (visible above on the list). However, it still keeps the data of the items seen before the one you chose (visible below on the list).

Settings

Setting Type Description
historyLength java.lang.Integer Maximum number of messages stored in history. Default value: 10.
defaultOutput java.lang.String Name of virtual output socket that should be used if no other is configured.
proxyEnabled java.lang.Boolean If true then any message received on any input sockets is immediately sent through appropriate output socket. Otherwise it is only stored in communication history. Default value: Maximum number of messages stored in history. Default value: false.
emptyHistoryOutputValueEval java.lang.String Value of this setting is used as SPEL expression. The SPEL expression is used to evaluate the value sent on socketemptyHistoryBackButtonPressed socket when Back button is clicked and history is empty.

Whenever input message is received from input socket and proxy is enabled, widget looks for a setting called %INPUT_SOCKET_NAME%_output. It assumes that a value would be a name of output socket that should be used to send this message further. If not found, then value from defaultOutput is taken. The same mechanism is used when you click any element of history and/or Back button.

Widget Slots

slotID Multiplicity Type Slots Composition
cockpitWidgetChildrenInvisible multi Not applicable A general-purpose slot available for widgets. Any widget placed on this slot is not displayed in the application view but can be accessed through its socket API.