context.arch.widget
Class WTourRegistration

java.lang.Object
  |
  +--context.arch.BaseObject
        |
        +--context.arch.widget.Widget
              |
              +--context.arch.widget.WPersonPresence
                    |
                    +--context.arch.widget.WTourRegistration

public class WTourRegistration
extends WPersonPresence
implements java.awt.event.ActionListener

This class is a context widget that provides information on the presence of a person at tour registration and their contact info and interest info. The information is in the form of a location and a user id. It has the following callbacks: UPDATE. It supports polling and subscriptions. Currently it uses the WPersonPresence as a means of providing presence.

See Also:
WPersonPresence

Field Summary
static java.lang.String AFFILIATION
          Tag for affiliation
static java.lang.String CLASSNAME
          Name of widget
static java.lang.String CONTACT_INFO
          Tag for contact info
static int DEFAULT_PORT
          Default port this widget runs on
static java.lang.String DISPLAY_DEVICE
          Tag for Display device
static java.lang.String EMAIL
          Tag for email address
static java.lang.String INTERESTS
          Tag for INTERESTS
static java.lang.String NAME
          Tag for user name
static java.lang.String NO_INTERESTS
          Tag for NO_INTERESTS
 java.lang.String VERSION_NUMBER
          Widget version number
 
Fields inherited from class context.arch.widget.WPersonPresence
ANIND_OFFICE, CLASSNAME, COMMON_AREA, DANIEL_OFFICE, DEFAULT_PORT, FCL, GREGORY_OFFICE, ibutton, LOCATION, USERID, VERSION_NUMBER
 
Fields inherited from class context.arch.widget.Widget
attributes, attributeTypes, callbacks, CLASS, CurrentOffset, DEFAULT_PORT, id, PUT_DATA, PUT_DATA_REPLY, QUERY, QUERY_ATTRIBUTES, QUERY_ATTRIBUTES_REPLY, QUERY_CALLBACKS, QUERY_CALLBACKS_REPLY, QUERY_REPLY, QUERY_SERVICES, QUERY_SERVICES_REPLY, QUERY_VERSION, QUERY_VERSION_REPLY, services, SPACER, storage, subscribers, TIMESTAMP, UPDATE, UPDATE_AND_QUERY, UPDATE_AND_QUERY_REPLY, VERSION, VERSION_NUMBER
 
Fields inherited from class context.arch.BaseObject
communications, EXIT_OK, handlers, ID, parser, PING, PING_REPLY, serviceHandlers
 
Constructor Summary
WTourRegistration(java.lang.String location)
          Constructor that creates the widget at the given location and monitors communications on the DEFAULT_PORT.
WTourRegistration(java.lang.String location, boolean storageFlag)
          Constructor that creates the widget at the given location and monitors communications on the DEFAULT_PORT.
WTourRegistration(java.lang.String location, int port)
          Constructor that creates the widget at the given location and monitors communications on the given port .
WTourRegistration(java.lang.String location, int port, boolean storageFlag)
          Constructor that creates the widget at the given location and monitors communications on the given port .
WTourRegistration(java.lang.String location, int port, java.lang.String id, boolean storageFlag)
          Constructor that creates the widget at the given location and monitors communications on the given port It also sets the id of this widget to the given id with storage functionality set to storageFlag
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          This method is used to implement the ActionListener interface.
static void main(java.lang.String[] argv)
          Temporary main method to create a widget with location and port specified by command line arguments
 void notify(java.lang.String event, java.lang.Object data)
          Called by the generator class when a significant event has occurred.
protected  Attributes setAttributes()
          This method implements the abstract method Widget.setAttributes().
protected  Callbacks setCallbacks()
          This method implements the abstract method Widget.setCallbacks().
 
Methods inherited from class context.arch.widget.WPersonPresence
IButtonData2Attributes, queryGenerator, setServices
 
Methods inherited from class context.arch.widget.Widget
addSubscriber, canHandle, canHandle, canHandle, canHandle, executeService, getAttributeType, getCurrentTime, getNewOffset, getNewOffsetNoDelay, isAttribute, isCallback, processCallbackReply, putData, queryAttributes, queryCallbacks, queryServices, queryWidget, removeSubscriber, retrieveData, runUserMethod, runWidgetMethod, sendToSubscribers, setAttribute, store, store, updateWidgetInformation
 
Methods inherited from class context.arch.BaseObject
askInterpreter, decodeData, encodeData, executeAsynchronousWidgetService, executeSynchronousWidgetService, getHostAddress, getId, getVersion, getVersion, getWidgetAttributes, getWidgetCallbacks, getWidgetServices, pingComponent, pollWidget, putDataInWidget, queryVersion, quit, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, retrieveDataFrom, returnPing, runComponentMethod, runMethod, serviceResult, setId, setVersion, subscribeTo, subscribeTo, subscribeTo, subscribeTo, unsubscribeFrom, updateAndPollWidget, userCallback, userRequest, userRequest, userRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_NUMBER

public java.lang.String VERSION_NUMBER
Widget version number

CONTACT_INFO

public static final java.lang.String CONTACT_INFO
Tag for contact info

NAME

public static final java.lang.String NAME
Tag for user name

EMAIL

public static final java.lang.String EMAIL
Tag for email address

AFFILIATION

public static final java.lang.String AFFILIATION
Tag for affiliation

INTERESTS

public static final java.lang.String INTERESTS
Tag for INTERESTS

NO_INTERESTS

public static final java.lang.String NO_INTERESTS
Tag for NO_INTERESTS

DISPLAY_DEVICE

public static final java.lang.String DISPLAY_DEVICE
Tag for Display device

CLASSNAME

public static final java.lang.String CLASSNAME
Name of widget

DEFAULT_PORT

public static final int DEFAULT_PORT
Default port this widget runs on
Constructor Detail

WTourRegistration

public WTourRegistration(java.lang.String location)
Constructor that creates the widget at the given location and monitors communications on the DEFAULT_PORT. It also sets the id of this widget to CLASSNAME_ with storage enabled.
Parameters:
location - Location the widget is "monitoring"

WTourRegistration

public WTourRegistration(java.lang.String location,
                         boolean storageFlag)
Constructor that creates the widget at the given location and monitors communications on the DEFAULT_PORT. It also sets the id of this widget to CLASSNAME_ with storage functionality set to storageFlag
Parameters:
location - Location the widget is "monitoring"
storageFlag - Flag to indicate whether storage is enabled

WTourRegistration

public WTourRegistration(java.lang.String location,
                         int port)
Constructor that creates the widget at the given location and monitors communications on the given port . It also sets the id of this widget to CLASSNAME_ with storage enabled.
Parameters:
location - Location the widget is "monitoring"
port - Port to run the widget on

WTourRegistration

public WTourRegistration(java.lang.String location,
                         int port,
                         boolean storageFlag)
Constructor that creates the widget at the given location and monitors communications on the given port . It also sets the id of this widget to CLASSNAME_ with storage functionality set to storageFlag
Parameters:
location - Location the widget is "monitoring"
port - Port to run the widget on
storageFlag - Flag to indicate whether storage is enabled

WTourRegistration

public WTourRegistration(java.lang.String location,
                         int port,
                         java.lang.String id,
                         boolean storageFlag)
Constructor that creates the widget at the given location and monitors communications on the given port It also sets the id of this widget to the given id with storage functionality set to storageFlag
Parameters:
location - Location the widget is "monitoring"
port - Port to run the widget on
id - Widget id
storageFlag - Flag to indicate whether storage is enabled
Method Detail

setAttributes

protected Attributes setAttributes()
This method implements the abstract method Widget.setAttributes(). It defines the attributes for the widget as: TIMESTAMP, USERID, LOCATION, INTERESTS, and CONTACT_INFO(NAME,EMAIL,AFFILIATION)
Overrides:
setAttributes in class WPersonPresence
Returns:
the Attributes used by this widget

setCallbacks

protected Callbacks setCallbacks()
This method implements the abstract method Widget.setCallbacks(). It defines the callbacks for the widget as: UPDATE with the attributes TIMESTAMP, USERID, LOCATION, CONTACT_INFO(NAME,EMAIL,AFFILIATION), INTERESTS and DISPLAY_DEVICE
Overrides:
setCallbacks in class WPersonPresence
Returns:
the Callbacks used by this widget

notify

public void notify(java.lang.String event,
                   java.lang.Object data)
Called by the generator class when a significant event has occurred. It creates a frame to collect data from the registrant.
Overrides:
notify in class WPersonPresence
Parameters:
event - Name of the event that has occurred
data - Object containing relevant event data
See Also:
Widget.sendToSubscribers(String, AttributeNameValues), Widget.store(AttributeNameValues)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
This method is used to implement the ActionListener interface. It is called when the user submits or cancels the interaction with the registration frame. If the user submits their registration information, the information is collected and sent to subscribers. The frame is disposed of.
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - ActionEvent caused by interaction with a button

main

public static void main(java.lang.String[] argv)
Temporary main method to create a widget with location and port specified by command line arguments