© 2001 BEA Systems, Inc.

com.bea.commerce.platform.ad
Class AdHelper

java.lang.Object
  |
  +--com.bea.commerce.platform.ad.AdHelper
All Implemented Interfaces:
AdConstants

public class AdHelper
extends java.lang.Object
implements AdConstants

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


Fields inherited from interface com.bea.commerce.platform.ad.AdConstants
AD_EVENT_TRACKING, AD_RENDERING, AD_SERVICE_NAME, ADBUCKET_DB_NAME, ADBUCKET_SERVICE_NAME, ADCOUNT_DB_NAME, CONFLICT_RESOLVER_NAME, EVENT_SERVICE_NAME, GLOBAL_ADBUCKET_NAME
 
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()
          return the currently active AdService EJB
static Content getContent(AdService as, java.lang.String contentId)
          return the Content object for the passed content id.
static java.lang.String getMimeRenderingClass(java.lang.String mimeType)
          Return the name of a class that may handle rendering for an unsupported mime type
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 env-entry which defines if global ads are being mixed with context and container based ads.
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
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
 
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

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.ejb.CreateException
return the currently active AdService EJB

getRendering

public static AdContentProvider getRendering()
return the env-entry which defines if global ads are being mixed with context and container based ads.

getMimeRenderingClass

public static java.lang.String getMimeRenderingClass(java.lang.String mimeType)
Return the name of a class that may handle rendering for an unsupported mime type
Parameters:
mimetype - the mimetype

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
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

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
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

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

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved