Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.ad
Class AdHelper

    java.lang.Object
      com.bea.p13n.ad.AdHelper

All Implemented Interfaces
  AdConstants

    public class AdHelper

extends Object
implements AdConstants

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

Field Summary

Fields inherited from interface com.bea.p13n.ad.AdConstants
`AD_EVENT_TRACKING, AD_RENDERING, AD_SERVICE_NAME, ADBUCKET_SERVICE_NAME, CONFLICT_RESOLVER_NAME, EVENT_SERVICE_NAME, GLOBAL_ADBUCKET_NAME`

Constructor Summary
`AdHelper()`

Method Summary
`static String` | `getAdContent(String adQuery, long identifier, String containerUID, String contextUID, String placeholder, String userId, String servletBase, Request request, AdService as, int height, int width)` Deprecated This method moved to `AdService`.
`static AdService` | `getAdService()` Deprecated Use <ejb-ref> instead.
`static AdService` | `getAdService(String name)` Get an AdService instance from the specified JNDI name.
`static BinaryValue` | `getBinaryValue(Property p)` Get the BinaryValue of the first non-null value of the property.
`static Node` | `getContent(AdService as, String path)` Deprecated Use getContent(AdService, String, Request) instead.
`static Node` | `getContent(AdService as, String path, Request request)` Return the content object for the passed content path.
`static String` | `getDefaultAdBucketServiceName()` Get the default AdBucketService JNDI name for the current application.
`static String` | `getDefaultAdServiceName()` Get the default AdService JNDI name for the current application.
`static AdEventTracker` | `getEventTracker()` Deprecated No longer publically available.
`static int` | `getNextRandom(int max)` Deprecated No longer used here (use java.util.Random)
`static BinaryValue` | `getPrimaryContentBinaryValue(Node c)` Deprecated
`static BinaryValue` | `getPrimaryContentBinaryValue(RenderableContent c)` Get the BinaryValue of the first non-null value of the node's primary content property.
`static int` | `getPrimaryFileSize(Node c, int def)` Deprecated
`static int` | `getPrimaryFileSize(RenderableContent c, int def)` Get the size of the primary content property.
`static String` | `getPrimaryMimeType(Node c)` Deprecated
`static String` | `getPrimaryMimeType(RenderableContent c)` Get the mime type of the primary content property.
`static Property` | `getPrimaryProperty(Node c)` Deprecated
`static Property` | `getPrimaryProperty(RenderableContent c)` Get the primary content property to use for rendering.
`static int` | `getPropertyAsInt(Node c, String propName, int def)` Deprecated
`static int` | `getPropertyAsInt(RenderableContent c, String propName, int def)` Utility to retrieve the first value of a content property and convert it (if needed) into an int.
`static Object` | `getPropertyValue(Node c, String propName)` Deprecated
`static Object` | `getPropertyValue(RenderableContent c, String propName)` Utility to retrieve the first non-null Object value of a content property.
`static String` | `getPropertyValueString(Node c, String propName)` Deprecated
`static String` | `getPropertyValueString(RenderableContent c, String propName)` Utility to retrieve the first non-null Object value of a content property as a String.
`static AdContentProvider` | `getRendering()` Deprecated No longer publically available.
`static String` | `pathInfoEncode(String pathInfo)` Correctly URLEncode a path-info string.
`static void` | `raiseClickThruEvent(String userId, javax.servlet.http.HttpServletRequest request, String containerUID, String contextUID, String placeholder, String contId)` Deprecated No longer publically available.
`static void` | `raiseDisplayEvent(String userId, javax.servlet.http.HttpServletRequest request, String containerUID, String contextUID, String placeholder, String contId)` Deprecated No longer publically available.
`static String` | `toHTML(String in)` Convert an arbitrary string to HTML which will display as the original string intended.

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 String getAdContent(String adQuery,
                                      long identifier,
                                      String containerUID,
                                      String contextUID,
                                      String placeholder,
                                      String userId,
                                      String servletBase,
                                      Request request,
                                      AdService as,
                                      int height,
                                      int width)
                               throws AdContentException,
                                      javax.ejb.CreateException

  Deprecated This method moved to `AdService`.

  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
    `AdContentException` - if there is a problem getting the content
    `javax.ejb.CreateException`

### getContent

    public static Node getContent(AdService as,
                                  String path)

  Deprecated Use getContent(AdService, String, Request) instead.

  return the content object for the passed content path.

  Parameters
    `as` - the AdService EJB
    `path` - the path of the content being requested
  Returns
    a Node object if the content is found, null otherwise.
  See Also
    `getContent(com.bea.p13n.ad.AdService, java.lang.String, com.bea.p13n.http.Request)`

### getContent

    public static Node getContent(AdService as,
                                  String path,
                                  Request request)

  Return the content object for the passed content path.

  Parameters
    `as` - the AdService EJB
    `path` - the path of the content being requested
  Returns
    a Node object if the content is found, null otherwise.

### getAdService

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

  Deprecated Use <ejb-ref> instead.

  return the currently active AdService EJB

  Throws
    `NamingException`
    `javax.ejb.CreateException`

### getAdService

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

  Get an AdService instance from the specified JNDI name.

  Throws
    `NamingException`
    `javax.ejb.CreateException`

### getDefaultAdServiceName

    public static String getDefaultAdServiceName()

  Get the default AdService JNDI name for the current application.

### getDefaultAdBucketServiceName

    public static String getDefaultAdBucketServiceName()

  Get the default AdBucketService JNDI name for the current application.

### getRendering

    public static AdContentProvider getRendering()

  Deprecated No longer publically available.

  Return the global ad renderer to use.

### getEventTracker

    public static AdEventTracker getEventTracker()

  Deprecated No longer publically available.

  Return the ad event tracker to use.

### raiseDisplayEvent

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

  Deprecated No longer publically available.

  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

### raiseClickThruEvent

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

  Deprecated No longer publically available.

  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

### getNextRandom

    public static int getNextRandom(int max)

  Deprecated No longer used here (use java.util.Random)

  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

### pathInfoEncode

    public static String pathInfoEncode(String pathInfo)

  Correctly URLEncode a path-info string.

  This can be used to pass a contentId as Path-Info to the ShowDocServlet.

  This will url encode the pathInfo, but will leave "/"'s alone.

### getPropertyValue

    public static Object getPropertyValue(Node c,
                                          String propName)
                                   throws RepositoryException

  Deprecated

  Utility to retrieve the first non-null Object value of a content property.

  Returns
    the object value (e.g. Value.getValue()), or null if not Values for properties.
  Throws
    `RepositoryException`

### getPropertyValue

    public static Object getPropertyValue(RenderableContent c,
                                          String propName)
                                   throws RepositoryException

  Utility to retrieve the first non-null Object value of a content property.

  Returns
    the object value (e.g. Value.getValue()), or null if not Values for properties.
  Throws
    `RepositoryException`

### getPropertyValueString

    public static String getPropertyValueString(Node c,
                                                String propName)
                                         throws RepositoryException

  Deprecated

  Utility to retrieve the first non-null Object value of a content property as a String.

  Returns
    the object value (e.g. Value.getValue().toString()), or null if not Values for properties.
  Throws
    `RepositoryException`

### getPropertyValueString

    public static String getPropertyValueString(RenderableContent c,
                                                String propName)
                                         throws RepositoryException

  Utility to retrieve the first non-null Object value of a content property as a String.

  Returns
    the object value (e.g. Value.getValue().toString()), or null if not Values for properties.
  Throws
    `RepositoryException`

### getPropertyAsInt

    public static int getPropertyAsInt(Node c,
                                       String propName,
                                       int def)
                                throws RepositoryException

  Deprecated

  Utility to retrieve the first value of a content property and convert it (if needed) into an int.

  Parameters
    `c` - the content object
    `propName` - the name of the content propery.
    `def` - the default value to return if the property doesn't exist or doesn't have any values or isn't a number or can't be converted to a nubmer
  Returns
    the int value, or def.
  Throws
    `RepositoryException`

### getPropertyAsInt

    public static int getPropertyAsInt(RenderableContent c,
                                       String propName,
                                       int def)
                                throws RepositoryException

  Utility to retrieve the first value of a content property and convert it (if needed) into an int.

  Parameters
    `c` - the content object
    `propName` - the name of the content propery.
    `def` - the default value to return if the property doesn't exist or doesn't have any values or isn't a number or can't be converted to a nubmer
  Returns
    the int value, or def.
  Throws
    `RepositoryException`

### getPrimaryProperty

    public static Property getPrimaryProperty(Node c)
                                       throws RepositoryException

  Deprecated

  Get the primary content property to use for rendering. This will return the Node's primary property. If not set, it will find the first binary property. If no binary properties, it will find the first String property. Otherwise, it will return null.

  Throws
    `RepositoryException`

### getPrimaryProperty

    public static Property getPrimaryProperty(RenderableContent c)
                                       throws RepositoryException

  Get the primary content property to use for rendering. This will return the Node's primary property. If not set, it will find the first binary property. If no binary properties, it will find the first String property. Otherwise, it will return null.

  Throws
    `RepositoryException`

### getPrimaryContentBinaryValue

    public static BinaryValue getPrimaryContentBinaryValue(Node c)
                                                    throws RepositoryException

  Deprecated

  Get the BinaryValue of the first non-null value of the node's primary content property.

  Returns
    null on no non-null binary value.
  Throws
    `RepositoryException`
  See Also
    `getPrimaryProperty(com.bea.content.Node)`

### getPrimaryContentBinaryValue

    public static BinaryValue getPrimaryContentBinaryValue(RenderableContent c)
                                                    throws RepositoryException

  Get the BinaryValue of the first non-null value of the node's primary content property.

  Returns
    null on no non-null binary value.
  Throws
    `RepositoryException`
  See Also
    `getPrimaryProperty(com.bea.content.Node)`

### getBinaryValue

    public static BinaryValue getBinaryValue(Property p)

  Get the BinaryValue of the first non-null value of the property.

  Returns
    null on no non-null binary value.

### getPrimaryMimeType

    public static String getPrimaryMimeType(Node c)
                                     throws RepositoryException

  Deprecated

  Get the mime type of the primary content property. If the primary property is not binary then `text/plain` will be returned. If the primary property is a binary property then the mime type of the first non-null `BinaryValue` will be returned. If the primary property is binary but does not contain a non-null `BinaryValue`, null will be returned.

  Parameters
    `c` - the content object.
  Returns
    the mimeType. `text/plain` is returned if the primary property is not binary. If the primary property is binary then return the mime type of the first non-null binary or null if no non-null `BinaryValue` is found.
  Throws
    `RepositoryException`
  See Also
    `getPrimaryProperty(com.bea.content.Node)`, `getBinaryValue(com.bea.content.Property)`

### getPrimaryMimeType

    public static String getPrimaryMimeType(RenderableContent c)
                                     throws RepositoryException

  Get the mime type of the primary content property. If the primary property is not binary then `text/plain` will be returned. If the primary property is a binary property then the mime type of the first non-null `BinaryValue` will be returned. If the primary property is binary but does not contain a non-null `BinaryValue`, null will be returned.

  Parameters
    `c` - the content object.
  Returns
    the mimeType. `text/plain` is returned if the primary property is not binary. If the primary property is binary then return the mime type of the first non-null binary or null if no non-null `BinaryValue` is found.
  Throws
    `RepositoryException`
  See Also
    `getPrimaryProperty(com.bea.content.Node)`, `getBinaryValue(com.bea.content.Property)`

### getPrimaryFileSize

    public static int getPrimaryFileSize(Node c,
                                         int def)
                                  throws RepositoryException

  Deprecated

  Get the size of the primary content property. If the primary property is not binary then return the number of `Value` objects contained in the primary `Property`. If the primary property is binary then return the file size of the first non-null `BinaryValue`. If the primary property is binary and a non-null `BinaryValue`s can not be found or no primary property can be found then the value of the parameter `def` is returned.

  Parameters
    `c` - the content object.
    `def` - the value to return if the primary property is binary and a `BinaryValue` can't be found.
  Returns
    the size. If the primary property is not binary then return the number of `Value`s for the primary. If the primary property is binary then return the file size of the first non-null `BinaryValue`. If no primary property can be found or if the primary property is binary and no non-null `BinaryValue`s can be found, then `def` is returned.
  Throws
    `RepositoryException`
  See Also
    `getPrimaryProperty(com.bea.content.Node)`, `getBinaryValue(com.bea.content.Property)`

### getPrimaryFileSize

    public static int getPrimaryFileSize(RenderableContent c,
                                         int def)
                                  throws RepositoryException

  Get the size of the primary content property. If the primary property is not binary then return the number of `Value` objects contained in the primary `Property`. If the primary property is binary then return the file size of the first non-null `BinaryValue`. If the primary property is binary and a non-null `BinaryValue`s can not be found or no primary property can be found then the value of the parameter `def` is returned.

  Parameters
    `c` - the content object.
    `def` - the value to return if the primary property is binary and a `BinaryValue` can't be found.
  Returns
    the size. If the primary property is not binary then return the number of `Value`s for the primary. If the primary property is binary then return the file size of the first non-null `BinaryValue`. If no primary property can be found or if the primary property is binary and no non-null `BinaryValue`s can be found, then `def` is returned.
  Throws
    `RepositoryException`
  See Also
    `getPrimaryProperty(com.bea.content.Node)`, `getBinaryValue(com.bea.content.Property)`

### toHTML

    public static String toHTML(String in)

  Convert an arbitrary string to HTML which will display as the original string intended.

  This will replace the characters '&', '"', '<', and '>' with '&amp;', &quot;', '&lt;', and '&gt;', respectively.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2008, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.