Source code of replaying visitor's actions

 The replayer of the Web Access Recorder uses Javascript to control the popup window from the parent window.

Source code Location

The source code is in the "[ALINOUS_HOME]/admin/player/" folder.

Location source code

In this folder, there are source code files of function written in Replay visitor's actions.

In this page, explain about how to play the visitor's action by using Javascript and server-side program.

Javascript to relay actions

 The detail of how to replay the visitor's action is written at Replay visitor's actions.

select playing access log

By clicking the "play" button of the record, a new popup window is opend and the user actions are played.

The source code of the Javascript is "play.js" and it plays the recorded actions by using popup window.

Player's Javascript

 When the user push "play" button, then the "play()" function is called with "use_id" and "access_id" parameter.

This function access the server-side program, whichi is "/admin/player/playhelper.alns", and succeeded in it, open a new popup window and set the event handler for the "onload" event.

Onload event handler

 The event handler for the "onload" event makes a mouse indicator, and call the "fetchEvents()" function.

 The "fetchEvents()" function is to access the url of server-side program to fetch the records in the database, and start player.

If the next actions are there, it calls "doPlay()" function to continue playing actions. If not exists, show alert in the popup window and finish.

Play an Action

 The "doPlay()" function is to play the fetched event.

The fetched actions are stored in "playActions" variable and if play all the actions, call the "fetchEvents()" function again.

Server side program

 The server side program of this player is

  • playhelper.alns
  • fetchCommands.alns

These program process the data in the server side.

Make playable data

The "playhelper.alns" extract the archived action logs.

The number of actions are so many that this application stores archived log in the "wic_user_motion_archive" table. The archived logs are separated with " "(space). The "extractArchive()" function split them and insert each log into the "wic_user_motion" table.

Get actions from database

 The "fetchCommands.alns" is accessed from "fetchEvents()" function in the Javascript.

This function query the extracted data, convert it into Json string, and return it.


Go to Top