PrizmDoc® Viewer v14.0 Release - Updated
PrizmDoc Viewer / API Reference / E-Signature Controls / Module: event-store
In This Topic
    Module: event-store
    In This Topic

    Module: event-store

    An event API. This event store is used internally by the viewer, and should not need to be initialized outside of that usage.

    Example

    var EventStore = require('event-store.js');
    
    // a generic Viewer constructor
    function Viewer(opts) {
        // other modules will expect this to be present
        this.eventStore = EventStore(this);
    }
    

    (require("event-store"))()

    Example

    var eventStore = require('event-store.js')(viewerInstance);
    

    Events

    AccessGlobalSettings

    Indicates that the user needs to access the global settings dialog for modifying the various global settings available for the templates.

    See:
    • module:event-store~eventCallback

    AlignFields

    Triggers alignment of the given fields.

    Example

    viewer.eventStore.trigger('AlignFields', {
        alignment: 'horizontal-left',
        markIds: viewer.viewerControl.getSelectedMarks()
    });
    
    Properties:
    Name Type Description
    alignment string

    The plane and direction of the alignment operation.

    markIds Array

    An array of Mark IDs to align.

    See:
    • module:event-store~eventCallback

    BurnForm

    Indicates that the user wants to burn the signatures to the form.

    See:
    • module:event-store~eventCallback

    CreateDate

    Triggers a user request to select a date.

    Properties:
    Name Type Attributes Description
    position Object

    The position to locate the UI, relative to a rectangle on the window.

    Properties
    Name Type Description
    x number

    The x-axis location.

    y number

    The y-axis location.

    width number

    The width of the rectangle.

    height number

    The height of the rectangle.

    onDone string <optional>

    An event name to trigger, in the style of module:event-store~onDoneCallback. It should provide a date string as the event's data attribute.

    See:
    • module:event-store~eventCallback
    • module:event-store~onDoneCallback

    CreateSignature

    Triggers a user request to apply a signature to a field.

    Properties:
    Name Type Attributes Description
    category string <optional>

    The field type that this signature belongs to. If undefined, no category will be assigned. Known values for this are signature and initials.

    signatureType string <optional>

    The type of signature being created, as represented by the target mark. Possible values are FreehandSignature and TextSignature. When this value is not defined, a good experience would be to allow the user to choose.

    onDone string <optional>

    An event name to trigger, in the style of module:event-store~onDoneCallback. It should provide a signature object as the data attribute with the data returned from PCCViewer.SignatureControl, or undefined to signal that the user cancelled the action.

    See:
    • module:event-store~eventCallback
    • module:event-store~onDoneCallback

    DeleteFields

    Triggers deletion of the given fields.

    Example

    viewer.eventStore.trigger('DeleteFields', {
        markIds: [1, 2, 3]
    });
    
    Properties:
    Name Type Description
    markIds Array

    An array of Mark IDs to delete.

    See:
    • module:event-store~eventCallback

    DeselectAllTemplateFields

    Indicates that all previously selected fields are now deselected.

    See:
    • module:event-store~eventCallback

    DisplayForm

    Indicates that a module:state-store~FormDefinition is available for displaying on the document.

    Example

    viewer.eventStore.on('DisplayForm', function(ev, formDefinition) {
        // logic to convert the form data to visible marks on the document
        createMarksForFormData(formDefinition.formData);
    });
    
    Properties:
    Name Type Description
    formDefinition module:state-store~FormDefinition

    Provides the form definition as the data parameter.

    See:
    • module:event-store~eventCallback

    DuplicateFields

    Triggers duplication of the given fields.

    Example

    viewer.eventStore.trigger('DuplicateFields', {
        markIds: [1, 2, 3]
    });
    
    Properties:
    Name Type Description
    markIds Array

    An array of Mark IDs to duplicate.

    See:
    • module:event-store~eventCallback

    FocusChecklistItem

    Indicates that an item in the checklist has been focused.

    Properties:
    Name Type Attributes Description
    markId string <optional>

    The ID of the mark that corresponds to the focused checklist item.

    See:
    • module:event-store~eventCallback

    FormatDate

    Triggers a request to format a given date using the default format.

    Properties:
    Name Type Attributes Description
    data Date

    The Date object to convert to the signatureDateFormat. This format can be defined in the form definition. If signatureDateFormat is not defined, MM/DD/YYYY is used.

    onDone string <optional>

    An event name to trigger, in the style of module:event-store~onDoneCallback. It should provide a date string as the event's data attribute.

    See:

    FormCopied

    Indicates that the current form has successfully been copied.

    See:
    • module:event-store~eventCallback

    FormLoaded

    Indicates that a form has been loaded from the server.

    See:
    • module:event-store~eventCallback

    KeyCombinationsTriggered

    Indicates that the user pressed the keyboard key combinations.

    Properties:
    Name Type Description
    state string

    This should always be defined as the string "KeyCombinationsTriggered".

    stateValue Object

    An object containing data about the key combination.

    Properties
    Name Type Description
    keyCombinations string

    A string property containing keyboard keyCombinations that were pressed by the user.

    See:

    ManageSignatures

    Triggers a user request to manage signatures in a list.

    Properties:
    Name Type Attributes Description
    category string <optional>

    The field type that this signature belongs to. When defined, only the signatures belonging to that category should be displayed. If undefined, all known signatures should be displayed. Known values for this are signature and initials.

    selectedSignature Object <optional>

    An object, consisting of the signature data (as returned by PCCViewer.SignatureControl), defining the signature that the user has selected. Unless the user changes the signature, this data should be returned in the onDone event as the signature data.

    onDone string <optional>

    An event name to trigger, in the style of module:event-store~onDoneCallback. It should provide a signature object as the data attribute with the data returned from PCCViewer.SignatureControl, or undefined to signal that the user has removed the selected signature.

    See:
    • module:event-store~eventCallback
    • module:event-store~onDoneCallback

    MatchSizeFields

    Triggers changing width or height depending on direction (horizontal/vertical) of all selected fields to match that dimension of a field, selected first.

    Example

    viewer.eventStore.trigger('MatchSizeFields', {
        markIds: [1, 2, 3],
        direction: 'vertical'
    });
    
    Properties:
    Name Type Description
    markIds Array

    An array of Mark IDs to apply the change to.

    direction string

    Determines which dimension (width or height) to change.

    See:
    • module:event-store~eventCallback

    ModifyMultipleTemplateFields

    Indicates that multiple template fields need to be modified.

    Properties:
    Name Type Description
    markIds array

    An array of currently selected Mark IDs.

    See:
    • module:event-store~eventCallback

    ModifyState

    Indicates that a module or external code would like to modify a known state value. Generally, a module should not listen to this event. It is handled by StateStore, which will in turn fire module:event-store#event:StateModified, to notify all other modules that a new state value is available.

    Properties:
    Name Type Attributes Default Description
    state string

    The name of the state being modified.

    stateValue *

    The new value of the state.

    operation string <optional>
    "extend"

    Specifies how the modification should occur. By default, any modification will extend the current state, merging any additional values from stateValue into the current state that is stored in the State Store. You can also specify "replace" as the operation value, causing the old state to be discarded, and the exact value of stateValue to become the current state.

    See:

    ModifyTemplateField

    Indicates that a template field needs to be modified.

    Properties:
    Name Type Description
    markId string

    The ID of the mark that corresponds to the template field.

    See:
    • module:event-store~eventCallback

    Notify

    Triggers a notification.

    Example

    viewer.eventStore.trigger('Notify', {
        type: 'error',
        message: 'An error occurred.'
    });
    
    Properties:
    Name Type Attributes Default Description
    type String

    The type of notification, either "error" or "success".

    message String

    The message of the notification.

    displayTime Number <optional>
    0

    The amount of time (in milliseconds) to display the notification. If a positive number is not specified, then the notification is displayed until the user closes it.

    See:
    • module:event-store~eventCallback

    PersistSignatures

    Triggers a manual save of the signatures. It will save all signatures currently in the PCCViewer.Signatures collection.

    See:
    • module:event-store~eventCallback

    RegisterKeyCombinations

    Requests registration of a new keyboard key combination.

    Properties:
    Name Type Description
    state string

    This should always be defined as the string "KeyCombinations".

    stateValue Object

    An object containing data about the key combination.

    Properties
    Name Type Description
    keyCombinations string

    Keyboard key combinations when pressed would trigger KeyCombinationsTriggered event.

    See:

    SaveTemplate

    Indicates that the user needs to save the form template in its current state.

    See:
    • module:event-store~eventCallback

    SaveTemplateCopy

    Indicates that the user needs to save a new copy of the form template in its current state. This event is implemented to convert the viewer into using the newly created copy when the copying is complete.

    See:
    • module:event-store~eventCallback

    SelectTemplateField

    Indicates that a template field needs to be selected.

    Properties:
    Name Type Description
    markId string

    The ID of the mark that corresponds to the template field.

    See:
    • module:event-store~eventCallback

    StateModified

    Indicates that a state value has been modified. This event should only be fired by the StateStore module. It has the following data properties:

    Example

    viewer.eventStore.on('StateModified', function(ev, data){
        if (data.state !== 'MyStateKey') { return; }
    
        // handle the state change here
    });
    
    Properties:
    Name Type Description
    state string

    The name of the state that was modified.

    stateValue *

    The current value of the state that was modified.

    See:

    TemplateSaved

    Indicates that a template successfully saved.

    Example

    viewer.eventStore.trigger('TemplateSaved');
    
    See:
    • module:event-store~eventCallback

    TemplateSaveFailed

    Indicates that a template failed to save.

    Example

    viewer.eventStore.trigger('TemplateSaveFailed');
    
    See:
    • module:event-store~eventCallback

    ToggleChecklist

    Triggers the checklist to toggle open or closed.

    See:
    • module:event-store~eventCallback

    Documentation generated by JSDoc 3.5.5 on Sun Feb 25 2024 15:33:01 GMT-0500 (Eastern Standard Time)