Adobe DPS - Library and Store SDK 2.32

Class adobeDPS-FolioActivityService

Extends:
adobeDPS-FolioActivityService -> adobeDPS-Service -> adobeDPS-Class
Platforms:
iOS, Windows

This class defines the service to monitor folio activity events.
Accessible from adobeDPS.folioActivityService

Constructor

adobeDPS-FolioActivityService()
[inner] Create an instance of the FolioActivityService.

Static Fields

Field Defined By
adobeDPS-FolioActivityService.instance
The singleton of the FolioActivityService.
FolioActivityService

Fields

Field Defined By
The supported event names.
FolioActivityService
The supported event attributes.
FolioActivityService
The current recording identfier.
FolioActivityService
recordings : Array
The array of active recordings in the form of adobeDPS-FolioActivityRecording objects.
FolioActivityService
The signal used to indicate that the recording service state has changed.
FolioActivityService
The supported recording states as an enum object.
FolioActivityService
The supported error codes as an enum object.
FolioActivityService

Methods

Method Defined By
startRecording(recordingId:String, config:FolioActivityConfig, successCB:Function, errorCB:Function)
Initiates recording of user-generated folio events.
FolioActivityService
stopRecording(successCB:Function, errorCB:Function)
Function used to stop folio events recording for the current recording identifier.
FolioActivityService
getEvents(recordingId:String, successCB:Function, errorCB:Function)
Function used to retrieve the recorded events from the persistent storage for a given recording identifier.
FolioActivityService
deleteEvents(recordingId:String, successCB:Function, errorCB:Function)
Releases all activity history associated with the specified recording identifier from the persistent store.
FolioActivityService
resetService(successCB:Function, errorCB:Function)
Resets the state of FolioActivityService to initial conditions.
FolioActivityService
Inherited from adobeDPS-Class
Gets the string representation of this instance.
Class Detail
adobeDPS-FolioActivityService()
[inner] Create an instance of the FolioActivityService.
This is an internal constructor and shouldn't be called by regular users.
Static Field Details
adobeDPS-FolioActivityService.instance
The singleton of the FolioActivityService.
Platforms:
iOS, Windows
Field Details
supportedEventNames : Array
The supported event names. These are strings that can be used to filter for desired events by setting the eventsFilter field in adobeDPS-FolioActivityConfig.

The supported event names are:

supportedEventAttributes : Array
The supported event attributes. These are the keys (as strings) that will be present in the event objects return by getEvents(). If the attribute is not present then its value will be an empty string.

The supported event attributes are:

currentRecordingId : String
The current recording identfier. This is set to the recording in progress (started) or to the last known recording if it was stopped by app shutdown. It is always set to the last known recording identifier from the native side when the JavaScript service is initialized. The recording represented by this identifier is always part of the recordings array if the identifier is valid.
recordings : Array
The array of active recordings in the form of adobeDPS-FolioActivityRecording objects. This represents the history of recordings that still have events associated with them (eventsCount > 0). It contains previous non-empty recordings plus the current recording (started) in descending chronological order. Thus the first element in the array is the last recording (currently started or last stopped).
stateChangedSignal : Signal
The signal used to indicate that the recording service state has changed. The state changes in response to updates to any of the recording objects in the recordings field or currentRecordingId field.

This can be as a result of calling startRecording(), stopRecording(), deleteEvents(), and any errors they generate. An application may register a handler for this signal in order to track the state of the recording.

FolioActivityRecordingStates : Object
The supported recording states as an enum object.
FolioActivityErrorCodes : Object
The supported error codes as an enum object.
Method Details
startRecording(recordingId:String, config:FolioActivityConfig, successCB:Function, errorCB:Function)
Initiates recording of user-generated folio events. The specified recording identifier is associated with all subsequently generated events. The events and associated identifier are recorded in persistent non-encrypted storage.

If an event filter is not supplied in the config parameter or the events filter is an empty array, then all events are recorded; otherwise, only the event names in the filter are recorded.

Only one active recording is permitted. If startRecording() is called while a recording is in progress an error will be returned to the error handler with the code FolioActivityErrorCodes.RECORDING_ALREADY_STARTED.

The recordingId must be a valid non-empty JavaScript string of no more than 64 printable characters. The special characters \' \" \\ \n \r \t \b \f are not allowed in the recording identifier.

Parameters
recordingId String The recording identifier under which the events are stored.
config FolioActivityConfig The recording configuration. See adobeDPS-FolioActivityConfig
successCB Function The callback function that handles the success of the request.
Callback Signature: successCB()
errorCB Function The callback function that handles the error when request fails.
Callback Signature: errorCB({recordingId: String, error: Object})
Throws:
Error If the errorCB is invalid
Platforms:
iOS, Windows
stopRecording(successCB:Function, errorCB:Function)
Function used to stop folio events recording for the current recording identifier. If stopRecording() is called before any recording is started an error will be returned to the error handler with the code FolioActivityErrorCodes.RECORDING_NOT_STARTED.
Parameters
successCB Function The callback function that handles the success of the request.
Callback Signature: successCB()
errorCB Function The callback function that handles the error when request fails.
Callback Signature: errorCB({recordingId: String, error: Object})
Throws:
Error If the errorCB is invalid
Platforms:
iOS, Windows
getEvents(recordingId:String, successCB:Function, errorCB:Function)
Function used to retrieve the recorded events from the persistent storage for a given recording identifier. successCB() is called with an array of all currently recorded events that match the given recordingId.

This does not delete the events from the storage. In order to delete them from the storage deleteEvents() must be called.

The recordingId must be a valid non-empty JavaScript string of no more than 64 characters; otherwise an error is generated. The special characters \' \" \\ \n \r \t \b \f are not allowed in the recording identifier.

Parameters
recordingId String The recording identifier the events are requested for.
successCB Function The callback function that handles the success of the request.
Callback Signature: successCB({recordingId: String, events: Array of {attribute: value}) where attribute takes values from the supportedEventAttributes array. The eventName and eventTime attributes are mandatory and will be always present; the eventTime attribute is represented as a string in ISO-8601 format with a 0 time zone offset (UTC). The value takes string values specific to the attribute. The values for eventName attribute are from the supportedEventNames array.
errorCB Function The callback function that handles the error when request fails.
Callback Signature: errorCB({recordingId: String, error: Object})
Throws:
Error If the errorCB is invalid
Platforms:
iOS, Windows
deleteEvents(recordingId:String, successCB:Function, errorCB:Function)
Releases all activity history associated with the specified recording identifier from the persistent store. The recordingId string may be undefined or empty to completely delete the entire activity history for all recording identifiers, reducing the size of the activity history to zero.
Parameters
recordingId String The recording identifier the events are requested for.
successCB Function The callback function that handles the success of the request.
Callback Signature: successCB(recordingId)
errorCB Function The callback function that handles the error if the request fails.
Callback Signature: errorCB({recordingId: String, error: Object})
Throws:
Error If the errorCB is invalid
Platforms:
iOS, Windows
resetService(successCB:Function, errorCB:Function)
Resets the state of FolioActivityService to initial conditions. All persistent storage used by FolioActivityService – including the entire activity history, recording state, and error state – is deleted and reset to an empty state. Any recording in progress is stopped.

Calling this method should not normally be needed, but it may be useful during application development, or if storage I/O errors or other external problems affect the stability or integrity of the persistent storage.

Parameters
successCB Function The callback function that handles the success of the request.
Callback Signature: successCB()
errorCB Function The callback function that handles the error if the request fails.
Callback Signature: errorCB({recordingId: String, error: Object})
Throws:
Error If the errorCB is invalid
Platforms:
iOS, Windows
©2012-2013 Adobe Systems, inc
Documentation generated by JsDoc Toolkit 2.4.0 on Mon Aug 31 2015 09:23:26 GMT-0700 (PDT)