|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.p13n.ad.AdHelper
public class AdHelper
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 |
---|
public AdHelper()
Method Detail |
---|
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
AdService
.
adQuery
- the content management queryindentifier
- a indentifier for the content bucket the query
is fromcontainerUID
- the UID of the containercontextUID
- the UID of the contextplaceholder
- the name of the placeholderuserId
- the user IdservletBase
- the Web App root for the click thru servletrequest
- the HTTP requestas
- the AdService EJBheight
- the suggested content heightwidth
- the suggested content width
AdContentException
- if there is a problem getting the content
javax.ejb.CreateException
public static Node getContent(AdService as, String path)
as
- the AdService EJBpath
- the path of the content being requested
getContent(com.bea.p13n.ad.AdService, java.lang.String, com.bea.p13n.http.Request)
public static Node getContent(AdService as, String path, Request request)
as
- the AdService EJBpath
- the path of the content being requested
public static AdService getAdService() throws NamingException, javax.ejb.CreateException
NamingException
javax.ejb.CreateException
public static AdService getAdService(String name) throws NamingException, javax.ejb.CreateException
NamingException
javax.ejb.CreateException
public static String getDefaultAdServiceName()
public static String getDefaultAdBucketServiceName()
public static AdContentProvider getRendering()
public static AdEventTracker getEventTracker()
public static void raiseDisplayEvent(String userId, javax.servlet.http.HttpServletRequest request, String containerUID, String contextUID, String placeholder, String contId)
userId
- the user Idrequest
- the HTTP requestcontainerUID
- the UID for the containercontextUID
- the UID for the contextplaceholder
- the name of the placeholdercontId
- the content identifierpublic static void raiseClickThruEvent(String userId, javax.servlet.http.HttpServletRequest request, String containerUID, String contextUID, String placeholder, String contId)
userId
- the user Idrequest
- the HTTP requestcontainerUID
- the UID for the containercontextUID
- the UID for the contextplaceholder
- the name of the placeholdercontId
- the content identifierpublic static int getNextRandom(int max)
max
- the max number to returnpublic static String pathInfoEncode(String pathInfo)
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.
public static Object getPropertyValue(Node c, String propName) throws RepositoryException
RepositoryException
public static Object getPropertyValue(RenderableContent c, String propName) throws RepositoryException
RepositoryException
public static String getPropertyValueString(Node c, String propName) throws RepositoryException
RepositoryException
public static String getPropertyValueString(RenderableContent c, String propName) throws RepositoryException
RepositoryException
public static int getPropertyAsInt(Node c, String propName, int def) throws RepositoryException
c
- the content objectpropName
- 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
RepositoryException
public static int getPropertyAsInt(RenderableContent c, String propName, int def) throws RepositoryException
c
- the content objectpropName
- 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
RepositoryException
public static Property getPrimaryProperty(Node c) throws RepositoryException
RepositoryException
public static Property getPrimaryProperty(RenderableContent c) throws RepositoryException
RepositoryException
public static BinaryValue getPrimaryContentBinaryValue(Node c) throws RepositoryException
RepositoryException
getPrimaryProperty(com.bea.content.Node)
public static BinaryValue getPrimaryContentBinaryValue(RenderableContent c) throws RepositoryException
RepositoryException
getPrimaryProperty(com.bea.content.Node)
public static BinaryValue getBinaryValue(Property p)
public static String getPrimaryMimeType(Node c) throws RepositoryException
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.
c
- the content object.
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.
RepositoryException
getPrimaryProperty(com.bea.content.Node)
,
getBinaryValue(com.bea.content.Property)
public static String getPrimaryMimeType(RenderableContent c) throws RepositoryException
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.
c
- the content object.
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.
RepositoryException
getPrimaryProperty(com.bea.content.Node)
,
getBinaryValue(com.bea.content.Property)
public static int getPrimaryFileSize(Node c, int def) throws RepositoryException
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.
c
- the content object.def
- the value to return if the primary property is binary
and a BinaryValue
can't be found.
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.
RepositoryException
getPrimaryProperty(com.bea.content.Node)
,
getBinaryValue(com.bea.content.Property)
public static int getPrimaryFileSize(RenderableContent c, int def) throws RepositoryException
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.
c
- the content object.def
- the value to return if the primary property is binary
and a BinaryValue
can't be found.
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.
RepositoryException
getPrimaryProperty(com.bea.content.Node)
,
getBinaryValue(com.bea.content.Property)
public static String toHTML(String in)
This will replace the characters '&', '"', '<', and '>' with '&', "', '<', and '>', respectively.
|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |