Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.ad
Class AdHelper

    java.lang.Object
      |
      +--com.bea.p13n.ad.AdHelper

public class AdHelper
extends java.lang.Object
implements AdConstants

A set of static methods which perform provide utilities services to the ad package.

Constructor Summary
`AdHelper()`

Method Summary
`static java.lang.String` | `getAdContent(java.lang.String adQuery, long identifier, java.lang.String containerUID, java.lang.String contextUID, java.lang.String placeholder, java.lang.String userId, java.lang.String servletBase, Request request, AdService as, int height, int width)` Return the content for an ad Query as an XHTML string.
`static AdService` | `getAdService()` Deprecated. Use <ejb-ref> instead.
`static AdService` | `getAdService(java.lang.String name)` Get an AdService instance from the specified JNDI name.
`static Content` | `getContent(AdService as, java.lang.String contentId)` return the Content object for the passed content id.
`static AdEventTracker` | `getEventTracker()` Return the ad event tracker to use.
`static int` | `getNextRandom(int max)` Return a random number between [0,max)Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value max (exclusive).
`static AdContentProvider` | `getRendering()` Return the global ad renderer to use.
`static void` | `raiseClickThruEvent(java.lang.String userId, javax.servlet.http.HttpServletRequest request, java.lang.String containerUID, java.lang.String contextUID, java.lang.String placeholder, java.lang.String contId)` Raise a click thru event with the AdEventTracker
`static void` | `raiseDisplayEvent(java.lang.String userId, javax.servlet.http.HttpServletRequest request, java.lang.String containerUID, java.lang.String contextUID, java.lang.String placeholder, java.lang.String contId)` Raise an display event with the AdEventTracker.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AdHelper

    public AdHelper()

Method Detail

### getAdContent

    public static java.lang.String getAdContent(java.lang.String adQuery,
                                                long identifier,
                                                java.lang.String containerUID,
                                                java.lang.String contextUID,
                                                java.lang.String placeholder,
                                                java.lang.String userId,
                                                java.lang.String servletBase,
                                                Request request,
                                                AdService as,
                                                int height,
                                                int width)
                                         throws AdContentException,
                                                javax.ejb.CreateException

  Return the content for an ad Query as an XHTML string.

  Parameters:
    `adQuery` - the content management query
    `indentifier` - a indentifier for the content bucket the query is from
    `containerUID` - the UID of the container
    `contextUID` - the UID of the context
    `placeholder` - the name of the placeholder
    `userId` - the user Id
    `servletBase` - the Web App root for the click thru servlet
    `request` - the HTTP request
    `as` - the AdService EJB
    `height` - the suggested content height
    `width` - the suggested content width
  Returns:
    an XHMLT content descrption for the ad
  Throws:
    AdContent - if there is a problem getting the content
  See Also:
    `getRendering()`

### getContent

    public static Content getContent(AdService as,
                                     java.lang.String contentId)

  return the Content object for the passed content id.

  Parameters:
    `as` - the AdService EJB
    `contentId` - the identifier of the content being requested
  Returns:
    a Content object if the content is found, null otherwise.

### getAdService

    public static AdService getAdService()
                                  throws javax.naming.NamingException,
                                         javax.ejb.CreateException

  Deprecated. Use <ejb-ref> instead.
  return the currently active AdService EJB

### getAdService

    public static AdService getAdService(java.lang.String name)
                                  throws javax.naming.NamingException,
                                         javax.ejb.CreateException

  Get an AdService instance from the specified JNDI name.

### getRendering

    public static AdContentProvider getRendering()

  Return the global ad renderer to use.

  This will access the `AdServiceMBean` for the class name of the AdContentProvider to use.

### getEventTracker

    public static AdEventTracker getEventTracker()

  Return the ad event tracker to use.

  This will access the `AdServiceMBean` for the class name of the AdEventTracker to use.

### raiseDisplayEvent

    public static void raiseDisplayEvent(java.lang.String userId,
                                         javax.servlet.http.HttpServletRequest request,
                                         java.lang.String containerUID,
                                         java.lang.String contextUID,
                                         java.lang.String placeholder,
                                         java.lang.String contId)

  Raise an display event with the AdEventTracker.

  Parameters:
    `userId` - the user Id
    `request` - the HTTP request
    `containerUID` - the UID for the container
    `contextUID` - the UID for the context
    `placeholder` - the name of the placeholder
    `contId` - the content identifier
  See Also:
    `getEventTracker()`

### raiseClickThruEvent

    public static void raiseClickThruEvent(java.lang.String userId,
                                           javax.servlet.http.HttpServletRequest request,
                                           java.lang.String containerUID,
                                           java.lang.String contextUID,
                                           java.lang.String placeholder,
                                           java.lang.String contId)

  Raise a click thru event with the AdEventTracker

  Parameters:
    `userId` - the user Id
    `request` - the HTTP request
    `containerUID` - the UID for the container
    `contextUID` - the UID for the context
    `placeholder` - the name of the placeholder
    `contId` - the content identifier
  See Also:
    `getEventTracker()`

### getNextRandom

    public static int getNextRandom(int max)

  Return a random number between [0,max)Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value max (exclusive).

  Parameters:
    `max` - the max number to return

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2002 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 BEA Systems, Inc. All Rights Reserved