How Tos

Last reviewed: 7/15/2011

Article ID: H071126

HOW: Developing Web applications that manage profiles

The information in this article applies to:

  • ProfileKit 4

Summary

You can develop web applications that manage speaker profiles using your favorite JavaScript and VBScript development tools.

More Information

ProfileKit class methods require enumeration constant values for some of the parameters. These constants are pre-defined in files chant.js and chant.vb. Copy the applicable file to the same folder as your web page from the following installation folder:

Program Files\Chant\ProfileKit 4\Win32\Web\include.

Access the constant values on your web page by including a reference to the file on your web page.

<head>
<script type="text/javascript" language="JavaScript" src="chant.js" />
... 
</head>
<body onload="onLoad()">
...
</body>

Object Declaration

Chant ProfileKit includes a Web component library that can be accessed via script code on a web page.

The ChantPM component can be accessed via JavaScript and VBScript code on a web page. The IE browser caches the component automatically for the web page.

Object Instantiation

The ChantPM class object is automatically instantiated when the web page loads. Access the instance of the ChantPM object from the document object. Set the CSPSerials property with your ProfileKit license serial number to unlock the component library for this web page. Even though you access the ChantPM object instance from as many functions as your application needs, you only need to set the CSPLicense once on page load.

<head>
<script type="text/javascript" language="JavaScript"><!--
    function onLoad() {
        // Get the object instance (Win32 and Win64)
        var chantPM = document.getElementById('WChantPM1');
        // Get the object instance (WinCE)
        var chantPM = document.all['WChantPM1'];

        // Set license property
        chantPM.SetStringProperty(CSPSerials,"LicenseSerialNumber");

        ...
    }
//-->
</script>
</head>
<body onload="onLoad()">
...
</body>

Event Callbacks

Event callbacks are the mechanism in which the component library sends information back to the application such as import/export operation state, training state, or there was an error.

<script type="text/javascript" language="JavaScript" for="WChantPM1" event="HasEvent"><!--
    var wChantPMEvent;

    var chantPM = document.getElementById('WChantPM1');
    // Get the number of events
    numberOfEvents = chantPM.GetResourceCount(CSREvent);
    for (i = 0; i < numberOfEvents; i++)
    {
        // Get the event from the event queue
        wChantPMEvent = chantPM.GetResource(CSREvent, 0);
        switch (wChantPMEvent.ChantCallback)
        {
            case CCSRProgress:
                {
                    ...       
                }
            default:
                break;
        }
        // Remove the event from the event queue
        chantPM.RemoveResource(CSREvent, 0, 0, "");
    }
//-->
</script>

Deployment Checklist

When you are ready to deploy your application, you need to ensure you have a valid license, bundle the correct Chant component libraries, and configure your installation properly on the target system. Review the following checklist before deploying your applications:

  • You may deploy your web page to any domain with a valid license from the Chant.
  • Update the codebase tag in the <object> declaration with location of the ProfileKit cab file. This can be the Chant web location or the URL of that location on your website where you copy the licensed cab file.

Sample Projects

Web sample projects are installed at the following location:

  • My Documents\Chant ProfileKit 4\Win32\Web\JavaScript.