ContentSelectorTag Class

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

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.


Hierarchy
Object
  TagSupport
    TagSupport
      ContentTagSupport
        ContentSelectorTag
All Implemented Interfaces

IterationTag, Serializable, Tag

Field Summary

protected String
appendQuery
The query appended on to the end of the content selector query.
protected String
home
The name of the content home bean.
protected String
id
To store the value of id attribute.
protected long
max
Limits the number of content items returned.
protected String
query
A content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.
protected String
selector
The name of the selector rule in the rule set.
protected String
sortBy
A list of document attributes to sort the content by.
   
Fields from  com.bea.p13n.servlets.jsp.taglib.ContentTagSupport
cacheId, cacheScope, cacheTimeout, contextParams, useCache
 
Fields from  javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 

Constructor Summary

ContentSelectorTag()

 

Method Summary

public int
doStartTag()
Processes the start tag.
public String
getAppendQuery()
Gets the appendQuery that is added to the content selector query.
public String
getContentHome()
The name of the content home bean.
protected Node[]
getDocuments()
Get the array of content documents.
public String
getId()
Gets the id to assign the results to.
public String
getMax()
The the max number of content items returned.
public 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 RULES_RULENAME_TO_FIRE
  • A RULES_FILTER_CLASS_NAME
public String
getRule()
Get name of the selector rule in the ruleSet.
public String
getSortBy()
Gets the list of document attributes to sort the content by.
public void
release()
Reinitializes the instance data in this object.
public void
setAppendQuery(String anAppendQuery)
Sets the appendQuery to add to the content selector query.
public void
setContentHome(String aHome)
Sets the name of the content home bean.
public void
setId(String anId)
Sets the id to assign the results to.
public void
setMax(String aNumber)
Sets the max number of content items returned.
public void
setMax(long max)
Sets the max number of content items returned.
public void
setQuery(String aQuery)
Sets the content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.
public void
setRule(String aSelector)
Set name of the selector rule in the rule set.
public void
setSortBy(String anOrderbyClause)
Sets the list of document attributes to sort the content by.
 
Methods from  com.bea.p13n.servlets.jsp.taglib.ContentTagSupport
checkContentCache, getCacheId, getCacheScope, getCacheTimeout, getContextParams, getUseCache, initRepositoryManager, setCacheId, setCacheScope, setCacheTimeout, setCacheTimeout, setContextParams, setContextParams, setInContentCache, setUseCache, setUseCache
 
Methods from  com.bea.p13n.servlets.jsp.TagSupport
createAdviceRequest, createAdvisor
 
Methods from  javax.servlet.jsp.tagext.TagSupport
doAfterBody, doEndTag, findAncestorWithClass, getParent, getValue, getValues, release, removeValue, setPageContext, setParent, setValue
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods from interface javax.servlet.jsp.tagext.Tag
doEndTag, doStartTag, getParent, release, setPageContext, setParent
 

Field Detail

appendQuery

protected String appendQuery
The query appended on to the end of the content selector query.


home

protected 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 String id
To store the value of id attribute.


max

protected long max
Limits the number of content items returned.


query

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


selector

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


sortBy

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

 

Constructor Detail

ContentSelectorTag

public ContentSelectorTag()
 

Method Detail

doStartTag() Method

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

Overrides
TagSupport.doStartTag()

Returns

The SKIP_BODY constant since this tag does not have a body.

Exceptions

JspException
if an error. occurrs during content retrieval.

getAppendQuery() Method

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

Returns

The appendQuery.

getContentHome() Method

DEPRECATED No longer used.

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

Returns

The home name of the content manager bean.

getDocuments() Method

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

Returns

An array of content objects found. Returns an empty array if none found.

Exceptions

JspException
If unable to get advice or if incomplete advice is received.

getId() Method

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

Overrides
TagSupport.getId()

Returns

The id for the results.

getMax() Method

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


getQuery() Method

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

getRequest() Method

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

Returns

A ContentSelector AdviceRequest.

Exceptions

JspException
If there is a problem creating the request.

getRule() Method

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

Returns

String The name of the selector rule.

getSortBy() Method

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

Returns

The order by clause to use to sort the results.

release() Method

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

Overrides
ContentTagSupport.release()

setAppendQuery(String) Method

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


setContentHome(String) Method

DEPRECATED No longer used.

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

Parameters

aHome
The home name of the content manager bean.

setId(String) Method

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

Overrides
TagSupport.setId(String)

Parameters

anId
The id for the results.

setMax(String) Method

public void setMax(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(long) Method

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.

setQuery(String) Method

public void setQuery(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.

setRule(String) Method

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

Parameters

aSelector
The name of the selector rule.

setSortBy(String) Method

public void setSortBy(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.