© 2002 BEA Systems, Inc.


com.bea.p13n.servlets.jsp.taglib
Class ContentSelectorTag

java.lang.Object
  |
  +--javax.servlet.jsp.tagext.TagSupport
        |
        +--com.bea.p13n.servlets.jsp.TagSupport
              |
              +--com.bea.p13n.servlets.jsp.taglib.ContentTagSupport
                    |
                    +--com.bea.p13n.servlets.jsp.taglib.ContentSelectorTag

public class ContentSelectorTag
extends ContentTagSupport

The tag handler of the personalization jsp extension tag 'contentSelector'. The contentSelector tag allows arbitrary personalized content to be selected based on user profile.

See Also:
Serialized Form

Field Summary
protected  java.lang.String appendQuery
          The query appended on to the end of the content selector query.
protected  java.lang.String home
          The name of the content home bean.
protected  java.lang.String id
          To store the value of id attribute.
protected  long max
          Limits the number of content items returned.
protected  java.lang.String query
          A content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.
protected  java.lang.String selector
          The name of the selector rule in the rule set.
protected  java.lang.String sortBy
          A list of document attributes to sort the content by.
 
Fields inherited from class com.bea.p13n.servlets.jsp.taglib.ContentTagSupport
cacheId, cacheScope, cacheTimeout, contextParams, useCache
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Constructor Summary
ContentSelectorTag()
           
 
Method Summary
 int doStartTag()
          Processes the start tag.
 java.lang.String getAppendQuery()
          Gets the appendQuery that is added to the content selector query.
 java.lang.String getContentHome()
          The name of the content home bean.
protected  Content[] getDocuments()
          Get the array of content documents.
 java.lang.String getId()
          Gets the id to assign the results to.
 java.lang.String getMax()
          The the max number of content items returned.
 java.lang.String getQuery()
          Get the content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.
protected  AdviceRequest getRequest()
          Returns a ContentSelector AdviceRequest object after populating the following fields
The current HTTP Request The current HTTP Session The current User A new TimeInstant A new Time A new Date A CONTENT_QUERY_STRING A CONTENT_QUERY_MAX_ITEMS A CONTENT_QUERY_SORT_BY A CONTENT_MANAGER_HOME A RULES_RULENAME_TO_FIRE A RULES_FILTER_CLASS_NAME
 java.lang.String getRule()
          Get name of the selector rule in the ruleSet.
 java.lang.String getSortBy()
          Gets the list of document attributes to sort the content by.
 void release()
          Reinitializes the instance data in this object.
 void setAppendQuery(java.lang.String anAppendQuery)
          Sets the appendQuery to add to the content selector query.
 void setContentHome(java.lang.String aHome)
          Sets the name of the content home bean.
 void setId(java.lang.String anId)
          Sets the id to assign the results to.
 void setMax(long max)
          Sets the max number of content items returned.
 void setMax(java.lang.String aNumber)
          Sets the max number of content items returned.
 void setQuery(java.lang.String aQuery)
          Sets the content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.
 void setRule(java.lang.String aSelector)
          Set name of the selector rule in the rule set.
 void setSortBy(java.lang.String anOrderbyClause)
          Sets the list of document attributes to sort the content by.
 
Methods inherited from class com.bea.p13n.servlets.jsp.taglib.ContentTagSupport
checkContentCache, getCacheId, getCacheScope, getCacheTimeout, getContentManager, getContextParams, getUseCache, setCacheId, setCacheScope, setCacheTimeout, setCacheTimeout, setContextParams, setContextParams, setInContentCache, setUseCache, setUseCache
 
Methods inherited from class com.bea.p13n.servlets.jsp.TagSupport
createAdviceRequest, createAdvisor
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, removeValue, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selector

protected java.lang.String selector
The name of the selector rule in the rule set.

max

protected long max
Limits the number of content items returned.

sortBy

protected java.lang.String sortBy
A list of document attributes to sort the content by. The syntax follows the SQL 'order by' clause. The sort specification is limited to a list of the metadata attribute names and the keywords ASC and DESC.

query

protected java.lang.String query
A content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.

home

protected java.lang.String home
The name of the content home bean. This maps to a JNDI name for the content home that handles a specific type of content and its provider.

id

protected java.lang.String id
To store the value of id attribute.

appendQuery

protected java.lang.String appendQuery
The query appended on to the end of the content selector query.
Constructor Detail

ContentSelectorTag

public ContentSelectorTag()
Method Detail

setRule

public void setRule(java.lang.String aSelector)
Set name of the selector rule in the rule set.

Parameters:
aSelector - The name of the selector rule.

getRule

public java.lang.String getRule()
Get name of the selector rule in the ruleSet.

Returns:
String The name of the selector rule.

getMax

public java.lang.String getMax()
The the max number of content items returned.

Parameters:
Strin - The max number of content items that can be returned.

setMax

public void setMax(java.lang.String aNumber)
Sets the max number of content items returned.

Parameters:
aNumber - String representing a number. If it isn't a number, max is left at the default.

setMax

public void setMax(long max)
Sets the max number of content items returned.

Parameters:
max - A long that represents the max number of content items that can be returned.

setSortBy

public void setSortBy(java.lang.String anOrderbyClause)
Sets the list of document attributes to sort the content by.

Parameters:
anOrderByClause - The order by clause to use to sort the results.

getSortBy

public java.lang.String getSortBy()
Gets the list of document attributes to sort the content by.

Returns:
The order by clause to use to sort the results.

setQuery

public void setQuery(java.lang.String aQuery)
Sets the content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.

Parameters:
aQuery - The query string to append.

getQuery

public java.lang.String getQuery()
Get the content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.

Returns:
The query string to append.

setContentHome

public void setContentHome(java.lang.String aHome)
Sets the name of the content home bean.

Parameters:
aHome - The home name of the content manager bean.

getContentHome

public java.lang.String getContentHome()
The name of the content home bean.

Returns:
The home name of the content manager bean.

setId

public void setId(java.lang.String anId)
Sets the id to assign the results to.

Parameters:
anId - The id for the results.
Overrides:
setId in class javax.servlet.jsp.tagext.TagSupport

getId

public java.lang.String getId()
Gets the id to assign the results to.

Returns:
The id for the results.
Overrides:
getId in class javax.servlet.jsp.tagext.TagSupport

setAppendQuery

public void setAppendQuery(java.lang.String anAppendQuery)
Sets the appendQuery to add to the content selector query.

Parameters:
anAppendQuery -  

getAppendQuery

public java.lang.String getAppendQuery()
Gets the appendQuery that is added to the content selector query.

Returns:
The appendQuery.

getDocuments

protected Content[] getDocuments()
                          throws JspException
Get the array of content documents.

Returns:
An array of content objects found. Returns an empty array if none found.
Throws:
JspException - If unable to get advice or if incomplete advice is received.

getRequest

protected AdviceRequest getRequest()
                            throws JspException
Returns a ContentSelector AdviceRequest object after populating the following fields

Returns:
A ContentSelector AdviceRequest.
Throws:
JspException - If there is a problem creating the request.

doStartTag

public int doStartTag()
               throws JspException
Processes the start tag. Will set the 'id' to array of content objects found.

Returns:
The SKIP_BODY constant since this tag does not have a body.
Throws:
JspException - if an error. occurrs during content retrieval.
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport

release

public void release()
Reinitializes the instance data in this object.

Overrides:
release in class ContentTagSupport

© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved