Oracle Forms 9i Samples and Demos


oracle.forms.demos.beans
Class CookieHandler

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--oracle.ewt.lwAWT.LWComponent
                    |
                    +--oracle.ewt.lwAWT.LWContainer
                          |
                          +--oracle.forms.ui.VBean
                                |
                                +--oracle.forms.demos.beans.CookieHandler
All Implemented Interfaces:
javax.accessibility.Accessible, oracle.ewt.lwAWT.DoubleBufferer, oracle.ewt.help.HelpCapable, java.awt.image.ImageObserver, oracle.ewt.lwAWT.ImmediatePainter, oracle.forms.ui.IView, oracle.ewt.lwAWT.KeyProcessor, java.awt.MenuContainer, java.io.Serializable, oracle.ewt.lwAWT.VirtualComponent

public class CookieHandler
extends oracle.forms.ui.VBean

Oracle Forms Server 9i JavaBean Example

A CookieHandler is a JavaBean that can be used from Forms to read and write cookies in the Browser. The Bean can be used to set and get cookies and supports both temporary and persistant cookies The value of the cookie is always is passed as a string to and from Forms. To create a cookie with a key/value pair you will create and pass a delimited with the delimiter between Key and value ":" and the delimiter between pairs "/" e.g. Pass "username:scott/password:tiger" to store username=scott and password=tiger as a cookie value. The CookieHandler Bean supports the following Custom Properties:
normal The default state of the hyperlink when the user has/had no interaction[s] with it.
active The state of the hyperlink when the user has moved the mouse over it.
visited The state of the hyperlink when the user clicked on the hyperlink component during this particular application session. Will expire when the user ends the application.

The hyperlink will not perform any default actions when the user clicks on it. Any component that is interested in the actions of the hyperlink must register itself as an ActionListener with the hyperlink. The hyperlink will notify the interested parties when it has been clicked through an ActionEvent

Version:
9.0 22/Feb/2002
Author:
Frank Nimphius, Duncan Mills
See Also:
Serialized Form

Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static oracle.forms.properties.ID COOKIE_ERROR
          The property that represents an error to be raised via When-Custom-Item-Event if there is a problem with setting ot getting the cookie
static oracle.forms.properties.ID COOKIE_ERROR_MESSAGE
          The property registered to contain the error value if an error event is raises
static oracle.forms.properties.ID DEBUGMESSAGES
          Forms property used to indicate that we want the utility to switch Messaging on to the Java Console so we can see what is going on.
static oracle.forms.properties.ID GETCOOKIE
          The property registered to return value of the named cookie supplied in the GETCOOKIE_NAME property Used with GET_CUSTOM_PROPERTY() from the Form
static oracle.forms.properties.ID GETCOOKIE_NAME
          The property registered to set the name of the cookie that GETCOOKIE will return the value of Used with SET_CUSTOM_PROPERTY() from the Form
static oracle.forms.properties.ID SETCOOKIE
          The property registered to set cookie in the browser Used with SET_CUSTOM_PROPERTY() from the Form
 
Fields inherited from class oracle.forms.ui.VBean
BEAN_NAME, DEBUG_MODE, DELIVER_EVENT, FOCUS_EVENT, KEY_EVENT
 
Fields inherited from class oracle.ewt.lwAWT.LWComponent
DEFAULT_BORDERPAINTER, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_PAINTER, MNEMONIC_CHAR_NONE, MNEMONIC_INDEX_NONE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface oracle.forms.ui.IView
DEFAULT_COLOR
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CookieHandler()
           
 
Method Summary
 java.lang.Object getProperty(oracle.forms.properties.ID property)
          Implementation of IView interface which gets the value of a requested property In this case you can get the current value of DEBUGMESSAGES
 void init(oracle.forms.handler.IHandler handler)
          Implementation of IView interface init is called when the bean is first instanciated we use this to st up information such as the browser type and hooks into the DOM
 void log(java.lang.String msg)
          Convenience method to display an message out to the console.
 boolean setProperty(oracle.forms.properties.ID property, java.lang.Object value)
          Implementation of IView interface which sets a requested property to a given value In this case we also use this call to execute the methods for setting and getting cookies.
 
Methods inherited from class oracle.forms.ui.VBean
add, addCustomListener, addListener, addNotify, destroy, dispatchCustomEvent, getBean, getHandler, initializeBean, remove, removeAll, removeCustomListener, removeListener, repaint
 
Methods inherited from class oracle.ewt.lwAWT.LWContainer
getBorderPainter, setBorderPainter
 
Methods inherited from class oracle.ewt.lwAWT.LWComponent
accessAccessibleContext, addAnyEventListener, addImpl, addPostKeyListener, addPreKeyListener, clipToParents, contains, convertInnerToOuterSize, convertInteriorToOuter, convertOuterToInterior, createAccessibleContext, disable, doLayout, enable, eventMatchesMnemonic, eventMatchesMnemonic, freezeRepaints, getAccessibleContext, getActualAlignment, getActualReadingDirection, getAlignment, getBackground, getBaseClassName, getBorderContext, getBorderInsets, getClientProperty, getColorScheme, getDefaultHelpProvider, getDefaultName, getDocumentSize, getDoubleBuffer, getEWTDropTarget, getFill, getFocusedComponent, getFont, getForeground, getGraphics, getHelpBook, getHelpProvider, getHelpTopic, getInnerBounds, getInnerHeight, getInnerOrigin, getInnerSize, getInnerWidth, getInsets, getInteriorAlignmentX, getInteriorAlignmentY, getInvalidateFlags, getLookAndFeel, getMnemonicChar, getMnemonicIndex, getMnemonicString, getName, getPageBounds, getPaintContext, getPaintData, getPaintState, getPrintPaintContext, getReadingDirection, getRepaintFlags, getToolTipValue, getUI, getUIClassID, getUIDefaults, hasFocus, hasGlobalFocus, hasMnemonicModifier, hasWindowFocus, hide, imageUpdate, insets, interiorContains, invalidate, invalidateAndRepaintIfNecessary, isActive, isBorderTransparent, isChildClipped, isClippedBySibling, isFocusTraversable, isInteriorTransparent, isLocaleDefaulted, isPaintPropagationRequired, isReadingDirectionDefaulted, isTransparent, paint, paintAll, paintImmediate, paintImmediate, paintImmediateInterior, paintImmediateInterior, paintImmediateUnclipped, paintInterior, paintOverChildren, paramString, pointInInterior, pointIsInChild, postProcessKey, print, printAll, printPage, processEvent, processEventImpl, processFocusEvent, processMouseEvent, putClientProperty, redispatchEvent, remove, removeAnyEventListener, removeClientProperty, removeNotify, removePostKeyListener, removePreKeyListener, repaint, repaintInterior, repaintInterior, reshape, setAlignment, setBackground, setColorScheme, setDefaultHelpProvider, setEnabled, setEWTDropTarget, setFill, setFont, setForeground, setHelpBook, setHelpProvider, setHelpTopic, setLocale, setLookAndFeel, setMnemonicChar, setMnemonicIndex, setReadingDirection, setToolTipValue, setToolTipValue, setUI, setVisible, shiftFrozenDamage, showHelp, unfreezeRepaints, update, updateAlignment, updateLocale, updateReadingDirection, updateUI, updateUI, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFontMetrics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, inside, isDisplayable, isDoubleBuffered, isEnabled, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.forms.ui.IView
contains, paint
 
Methods inherited from interface oracle.ewt.lwAWT.VirtualComponent
getBounds, getSize
 

Field Detail

GETCOOKIE

public static final oracle.forms.properties.ID GETCOOKIE
The property registered to return value of the named cookie supplied in the GETCOOKIE_NAME property Used with GET_CUSTOM_PROPERTY() from the Form

GETCOOKIE_NAME

public static final oracle.forms.properties.ID GETCOOKIE_NAME
The property registered to set the name of the cookie that GETCOOKIE will return the value of Used with SET_CUSTOM_PROPERTY() from the Form

SETCOOKIE

public static final oracle.forms.properties.ID SETCOOKIE
The property registered to set cookie in the browser Used with SET_CUSTOM_PROPERTY() from the Form

DEBUGMESSAGES

public static final oracle.forms.properties.ID DEBUGMESSAGES
Forms property used to indicate that we want the utility to switch Messaging on to the Java Console so we can see what is going on. Used with SET_CUSTOM_PROPERTY() from the Form

COOKIE_ERROR_MESSAGE

public static final oracle.forms.properties.ID COOKIE_ERROR_MESSAGE
The property registered to contain the error value if an error event is raises

COOKIE_ERROR

public static final oracle.forms.properties.ID COOKIE_ERROR
The property that represents an error to be raised via When-Custom-Item-Event if there is a problem with setting ot getting the cookie
Constructor Detail

CookieHandler

public CookieHandler()
Method Detail

init

public void init(oracle.forms.handler.IHandler handler)
Implementation of IView interface init is called when the bean is first instanciated we use this to st up information such as the browser type and hooks into the DOM
Overrides:
init in class oracle.forms.ui.VBean
See Also:
IView

setProperty

public boolean setProperty(oracle.forms.properties.ID property,
                           java.lang.Object value)
Implementation of IView interface which sets a requested property to a given value In this case we also use this call to execute the methods for setting and getting cookies.
Overrides:
setProperty in class oracle.forms.ui.VBean
Parameters:
property - property to be set.
value - value of the property id.
Returns:
true if the property could be set, false otherwise.
See Also:
IView

getProperty

public java.lang.Object getProperty(oracle.forms.properties.ID property)
Implementation of IView interface which gets the value of a requested property In this case you can get the current value of DEBUGMESSAGES
Overrides:
getProperty in class oracle.forms.ui.VBean
Parameters:
property - property to be gotten.
Returns:
value of the property
See Also:
IView

log

public void log(java.lang.String msg)
Convenience method to display an message out to the console. Examines the m_Debug and m_DebugALL settings to see if it should output the message. Outputs message in format
Parameters:
the - message to be output

Oracle Forms 9i Samples and Demos