Class sap.apf.ui.representations.representationInterfaceModule: sap/apf/ui/representations/representationInterface


This is not a runtime class, but it describes the interface that a representation (chart) has to implement for to interact with the APF.

Experimental API:The complete interface is subject to ongoing work and not yet stable (as of Version 1.24.0).

Constructor Summary
Method Summary
adoptSelection(oSourceRepresentation)Called on representation by binding when a representation type is set.
deserialize(oSerializationInformation)This method uses the serialization information from serialized data and sets the selection to representation based on mode and selection string returned.
getAlternateRepresentation()Returns the alternate representation of current step (i.e.
getData()Returns data for representation type
getFilterMethodType()This method has to be implemented so that binding can determine which method has to be used for the filter retrieval from a representations.
getMainContent()This method holds the logic to draw the content to be shown on main representation area.
getMetaData()Returns meta data for representation type
getParameter()The method returns the constructor arguments which will be used to create toggle representation.
getPrintContent()This method holds the logic to draw the content to be printed.
getRequestOptions()Additionally to parameters being set in the request configuration and filter values that are derived from the path logic, a request can be enriched with additional options such as $top, $skip and $orderby.
getSelectionAsArray()This is the basic method with which the step can detect data selected in the chart.
getThumbnailContent()This method holds the logic to draw the content to be shown on thumbnail area.
getTooltipContent()This method holds the logic to draw the content to be shown as tooltip for a thumbnail.
removeAllSelection()This method holds the logic to remove all selection from the chart.
serialize()This method returns the selection for serialization.
setData(oMetadata, aDataResponse)The binding sets the data (received from the request) that has to be visualized.
Constructor Detail
new sap.apf.ui.representations.representationInterface(dependencies, configuration)
Parameters:
{sap.apf.ui.representations.RepresentationInterfaceProxy}dependencies specific interface proxy for communication between the representation and APF.
{object}configuration Configuration object that allows to define representation specific configuration values.
Fixed interface property names:
  • alternateRepresentationTypeId: A reference to a representation type in analytical configuration
  • alternateRepresentationType: A property dynamically added to the parameter object by APF core based on reference in alternateRepresentationTypeId and containing configuration values of the representation type ID referenced by alternateRepresentationTypeId.
Method Detail
adoptSelection(oSourceRepresentation)
Called on representation by binding when a representation type is set. Intention is to trigger transfer of selections that might exist on a representation (source) that is replaced by the "new" representation (target) to be set. Therefore the target representation receives a reference pointing to the source representation. In order to check whether selection transfer is possible the target representation initiates a negotiation process with the source representations (3-way-handshake). If a common method can be determined between target and source representation the selection will be exchanged.
Parameters:
{object}oSourceRepresentation Source representation implementing the representationInterface.
deserialize(oSerializationInformation)
This method uses the serialization information from serialized data and sets the selection to representation based on mode and selection string returned.
Parameters:
{object}oSerializationInformation
getAlternateRepresentation(): object
Returns the alternate representation of current step (i.e. list representation for the charts)
Returns:
{object} oAlternateRepresentation
getData(): array
Returns data for representation type
Returns:
{array} aDataResponse
getFilterMethodType(): sap.apf.constants.filterMethodTypes
This method has to be implemented so that binding can determine which method has to be used for the filter retrieval from a representations.
Returns:
{sap.apf.constants.filterMethodTypes} The filter method type the representation supports
getMainContent(): object
This method holds the logic to draw the content to be shown on main representation area.
Returns:
{object} oUiObject The UI object that has to be shown in main representation area. Example: Line chart instance for a line chart representation.
getMetaData(): sap.apf.core.EntityTypeMetadata
Returns meta data for representation type
Returns:
{sap.apf.core.EntityTypeMetadata} metadata
getParameter(): object
The method returns the constructor arguments which will be used to create toggle representation.
Returns:
{object} oParameters
getPrintContent(): object
This method holds the logic to draw the content to be printed.
Returns:
{object} oUiObject The UI object that has to be printed. Example: Line chart instance for a line chart representation.
getRequestOptions(): object
Additionally to parameters being set in the request configuration and filter values that are derived from the path logic, a request can be enriched with additional options such as $top, $skip and $orderby.

Dependent on the actual options a representation may require for a request, an object containing the correspondent properties may be returned by this method.
In case no additional options are required an empty object should be returned.

The supported optional properties of the return object are:

  • paging: An object containing optional properties
    • top for OData system query option $top
      A numeric value is expected
    • skip for query string option $skip
      A numeric value is expected
    • inlineCount for OData system query option $inlineCount
      A boolean value 'true' is expected if inline count is requested
  • orderby for OData system query option $orderby: Values could be of type
    • string that holds a property name (in this case the default sort order 'ascending' is applied)
    • object with properties:
      • 'property' A string containing the property name is expected.
      • 'descending' A boolean value 'true' is expected, if descending sort order is required for the property. If omitted default sort order 'ascending' is applied.
    • array holding objects with properties 'property' and 'descending' as described above.
Returns:
{object} Example:
{ paging : {
		top : 10,
		skip : 30,
		inlineCount : true
 },
 orderby : [ 
		{ property : "nameProperty1",
		}, {
		property : "nameProperty2",
		descending : true
		}
 ]
}
See also http://www.odata.org/documentation/odata-version-2-0/uri-conventions/
getSelectionAsArray(): number[]
This is the basic method with which the step can detect data selected in the chart.
Returns:
{number[]} An array with indices is returned.
E.g. if the first and the third line of the array aDataResponse have been selected, then aIndices = [0, 2]. Counting of indices start from 0. If all data has been selected, and aDataResponse.length == 4, then the array [0,1,2,3] is returned. In general [ 0 .. aDataResponse.length - 1] If no data has been selected at all, then [] is returned. In case of an empty selection, the value undefined has to be returned. An empty selection may occur, when selections in the previous step has been changed, so that the visual selection on the chart is now empty (empty rectangle).
getThumbnailContent(): object
This method holds the logic to draw the content to be shown on thumbnail area.
Returns:
{object} oUiObject The UI object that has to be shown in thumbnail area. Example: Line chart instance for a line chart representation.
getTooltipContent(): object
This method holds the logic to draw the content to be shown as tooltip for a thumbnail. It will be shown inside a tooltip Popup when the thumbnail content overflows the thumbnail container area with a gradient effect to indicate that it is overflowing.
Returns:
{object} oUiObject The UI object that has to be shown as tooltip for a thumbnail. Example: Detailed content of a form representation.
removeAllSelection()
This method holds the logic to remove all selection from the chart. It also updates the step.
serialize(): object
This method returns the selection for serialization. This is required for the Persisting selection of current representation. It includes selection mode and selections.
Returns:
{object} oSerializationInformation
setData(oMetadata, aDataResponse)
The binding sets the data (received from the request) that has to be visualized. The array aDataResponse is shared between all representations of a step and the binding. When lines are moved, deleted or changed, you modify the visualization of the original data! When displaying the data, one can determine which record is selected by aSelectedIndices.
Parameters:
{sap.apf.core.Metadata}oMetadata oMetadata holds meta information about the received data.
{array}aDataResponse Data response from the request.