AIM Lite
"We are still cooking up some ideas so check back often for updates."
Note, you'll need v0.31 for this to work.
Double-click downloaded file to install

Sample plugins

Overview

AIM Lite plugins are OpenAIM plugins that are written in Boxely markup and Javascript. Each Boxely plugin is packaged as an AWI file, which is a ZIP file with an .awi extension. AWI files contain, at a minimum, a plugin.xml metadata file, and a content/ directory with a main.box Boxely file. The plugin.xml file contains a single "widget" element, similar to the following:

<?xml version="1.0" encoding="utf-8" ?>
    
<widget
    uuid = "{6A753147-414B-7766-594C-354738534E33}"
    version = "1.0"
    name = "My Cool Plugin"
    description = "This plugin does something nifty."
    vendor = "Coolness Inc."
/>

The uuid is a Open AIM plugin UUID, and the additional metadata is the other info used in AccPluginInfo.

The main.box file contains the main "scene" for the plugin. This scene can be a visible "widget", or it can be an invisible plugin that exposes no UI, or perhaps only opens visible scenes in response to an event. If the plugin is invisible, the .box file looks something like this:

<?xml version="1.0" encoding="utf-8" ?>
    
<window
    xmlns="http://www.aol.com/boxely/box.xsd"
    xmlns:s="http://www.aol.com/boxely/style.xsd"
    xmlns:on="http://www.aol.com/boxely/reaction.xsd"
    on:constructed="onConstructed();"
    on:destroyed="onDestroyed();"
    s:height="0"
    s:width="0"
    hidden="true"
    collapsed="true"
    floating="true">
    <code id="main" language="jscript" src="main.js"/>
</window>

This basically creates an empty scene that just runs the script in main.js. This file contains event handles for onConstructed and onDestroyed, events that are fired when the scene is created and destroyed. Typically, in onConstructed, the scene will want to access the AIMCC register for events, and possibly add plugin commands.

AIMCC objects are accessed in the scene via scene.paramsDictionary. The "session" key hold the IAccSession object, and the "pluginInfo" key holds the IAccPluginInfo object for the plugin. There correspond to the IAccSession and IAccPluginInfo objects that are typically passed into the IAccPlugin::Init method.

Event handling is done through typical connection point event sinking, meaning that the Boxely scene.connectObject API is used. The first parameter to connect object should be the IAccSession object obtained from the paramsDictionary, and the second parameter is a prefix to be used when defining the event callbacks, e.g. "session_" causes DAccEvents::OnStateChange to be fired as session_OnStateChange.

Adding commands is done as with COM AIMCC plugins, i.e. IAccPluginInfo::AddCommand. However, to receive commands from the application, the plugin must create a JavaScript object that implements the "QueryStatus" and "Exec" methods, and set this object to the "commandTarget" key of the supplied paramsDictionary.

The main.js shown below does all of these things:

function onConstructed()
{
  var dictionary = scene.paramsDictionary;
  var session = dictionary.valueForKey("session");
  var pluginInfo = dictionary.valueForKey("pluginInfo");
  var cmd = pluginInfo.addCommand(0);
  cmd.text = "Do it";
  dictionary.setValueForKey(new commandListener(), 
                              "commandTarget");
  scene.connectObject(session, "session_");
}

function onDestroyed()
{
  scene.disconnectObject("session_");
}

function session_OnStateChange(session, state, hr)
{
  shell.print("user "+session.Identity+" is now "+state);
}

function commandListener() {}
commandListener.prototype.QueryStatus=function(id, users)
{
  return (id==0) ? true : false;
}

commandListener.prototype.Exec=function(id, users)
{
  if (id==0)
    do.something();
}

Deployment of AIM Lite Plugins

Deploying a Boxely plugin consists of zipping up the desired files (including the required plugin.xml and main.box) into a ZIP file with an .awi extension, and placing that file in a public location. Assuming an Open AIM deploy guid/key is used, the AWI file must be hashed with acchash, and this hash entered into the AKES database via the developer.aim.com frontend.