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

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.bea.p13n.servlets.jsp.TagSupport
          extended by com.bea.p13n.servlets.jsp.taglib.ContentTagSupport
              extended by com.bea.p13n.servlets.jsp.taglib.ContentSelectorTag
All Implemented Interfaces
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

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  String appendQuery
          The query appended on to the end of the content selector query.
protected  String home
          Deprecated No longer used.
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 inherited from class com.bea.p13n.servlets.jsp.taglib.ContentTagSupport
cacheId, cacheScope, cacheTimeout, contextParams, searchPaths, useCache, versionedContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ContentSelectorTag()
           
 
Method Summary
 int doStartTag()
          Processes the start tag.
 String getAppendQuery()
          Gets the appendQuery that is added to the content selector query.
 String getContentHome()
          Deprecated No longer used.
protected  Node[] getDocuments()
          Get the array of content documents.
 String getId()
          Gets the id to assign the results to.
 String getMax()
          The the max number of content items returned.
 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
 String getRule()
          Get name of the selector rule in the ruleSet.
 String getSortBy()
          Gets the list of document attributes to sort the content by.
protected  Version[] getVersionedDocuments()
          Get the array of content documents.
 void release()
          Reinitializes the instance data in this object.
 void setAppendQuery(String anAppendQuery)
          Sets the appendQuery to add to the content selector query.
 void setContentHome(String aHome)
          Deprecated No longer used.
 void setId(String anId)
          Sets the id to assign the results to.
 void setMax(long max)
          Sets the max number of content items returned.
 void setMax(String aNumber)
          Sets the max number of content items returned.
 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.
 void setRule(String aSelector)
          Set name of the selector rule in the rule set.
 void setSortBy(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, getContextParams, getSearchPaths, getUseCache, getVersionedContent, initRepositoryManager, secureContentResults, secureContentResults, setCacheId, setCacheScope, setCacheTimeout, setCacheTimeout, setContextParams, setContextParams, setInContentCache, setSearchPaths, setSearchPaths, setUseCache, setUseCache, setVersionedContent
 
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 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 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 String query
A content query string that can be appended as an 'and' phrase to the content query in the contentSelector rule.


home

protected String home
Deprecated No longer used.
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.


appendQuery

protected 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(String aSelector)
Set name of the selector rule in the rule set.

Parameters
aSelector - The name of the selector rule.

getRule

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

Returns
String The name of the selector rule.

getMax

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


setMax

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

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(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 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(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 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(String aHome)
Deprecated No longer used.

Sets the name of the content home bean.

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

getContentHome

public String getContentHome()
Deprecated No longer used.

The name of the content home bean.

Returns
The home name of the content manager bean.

setId

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

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

getId

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

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

setAppendQuery

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

Parameters
anAppendQuery -

getAppendQuery

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

Returns
The appendQuery.

getDocuments

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.
Throws
JspException - If unable to get advice or if incomplete advice is received.

getVersionedDocuments

protected Version[] getVersionedDocuments()
                                   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.

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

release

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

Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class ContentTagSupport


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.