com.plumtree.portalpages.condition.conditiontypes
Class ConditionTypeUserAgent

java.lang.Object
  extended by com.plumtree.portaluiinfrastructure.condition.AConditionType
      extended by com.plumtree.portaluiinfrastructure.condition.AGuestConditionType
          extended by com.plumtree.portalpages.condition.conditiontypes.ConditionTypeUserAgent

public class ConditionTypeUserAgent
extends AGuestConditionType

This basic implementation of AGuestConditionType defines how to retrieve and evaluate a current user's browser type. It also defines methods to display conditions that have been defined


Field Summary
 
Fields inherited from class com.plumtree.portaluiinfrastructure.condition.AConditionType
CONDITION_LIST_CONSTANT, log, PHASE_TYPE_GUEST, PHASE_TYPE_REGULAR, ruleDebugger
 
Constructor Summary
ConditionTypeUserAgent()
           
 
Method Summary
 void AddItemToMyConditionsList(java.lang.Object objItem, ExpListModel myListModel, IPTSession ptSession)
          Adds objItem to the list of conditions of this condition type that is stored in myListModel
 boolean Compare(XPHashtable htUserEnvironment, IValue conditionValue, XPStringBuilder sbDebugText)
          Returns the result of comparing the condition value specified by conditionValue to the current value of the condition type found in htUserEnvironment.
 java.lang.Object GetConditionValue(int nRow, IPTGrowableSortedArrayWrapperRO saData)
          Returns the condition value stored in the nRow row of saData.
 int GetConditionValueType()
          Returns the value type of the codition expected by this condition type.
 void GetCurrentValue(XPLimitedRequest xpRequest, IPTSession guestReadOnlySession, XPHashtable htUserEnvironment)
          Determines the condition type's current value, and adds it to the htUserEnvironment.
 java.lang.String GetDescriptionString(IValue ConditionValue, IPTSession ptSession)
          Constructs the string to be set in an expression's description.
 java.lang.String GetMyConditionsListAddLabel(XPResourceManager xpRM, java.lang.String strLanguage)
          Returns the String that will be displayed as the Add Label for this condition type in the Subportal Rules Editor.
 PTImageType GetMyConditionsListIcon()
          Returns the Icon to be associated with this condition type.
 java.lang.String GetMyConditionsListSectionSubTitle(XPResourceManager xpRM, java.lang.String strLanguage)
          Returns the String that will be displayed as the Section SubTitle for this condition type in the Subportal Rules Editor.
 java.lang.String GetMyConditionsListSectionTitle(XPResourceManager xpRM, java.lang.String strLanguage)
          Returns the String that will be displayed as the Section Title for this condition type in the Subportal Rules Editor.
 int GetTypeID()
          Returns the unique ID of this condition type, which is used to store the list of condition types implemented.
 java.lang.String GetValidationFailedString(XPResourceManager xpRM, java.lang.String strLanguage)
          If a ValidationFailedException occurs, the RulesEditorModel will call this method to retrieve the appropriete error message.
 
Methods inherited from class com.plumtree.portaluiinfrastructure.condition.AGuestConditionType
GetPhaseType
 
Methods inherited from class com.plumtree.portaluiinfrastructure.condition.AConditionType
GetConditionTypeIdentifier, InitializeMyConditionsList, RegisterMyConditionsList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionTypeUserAgent

public ConditionTypeUserAgent()
Method Detail

GetTypeID

public int GetTypeID()
Returns the unique ID of this condition type, which is used to store the list of condition types implemented.

See Also:
com.plumtree.server.condition.IConditionServerType#GetTypeID()

Compare

public boolean Compare(XPHashtable htUserEnvironment,
                       IValue conditionValue,
                       XPStringBuilder sbDebugText)
Returns the result of comparing the condition value specified by conditionValue to the current value of the condition type found in htUserEnvironment.

See Also:
com.plumtree.server.condition.IConditionServerType#Compare(com.plumtree.openfoundation.util.XPHashtable, com.plumtree.server.condition.IValue, com.plumtree.openfoundation.util.XPStringBuilder)

GetCurrentValue

public void GetCurrentValue(XPLimitedRequest xpRequest,
                            IPTSession guestReadOnlySession,
                            XPHashtable htUserEnvironment)
Determines the condition type's current value, and adds it to the htUserEnvironment.

Specified by:
GetCurrentValue in class AGuestConditionType
Parameters:
xpRequest - - http request's wrapper. This is actually another wrapper that conceals the real XPRequest object. The reason is that at the Guest/Login Phase, the XPRequest's body cannot be parsed. Therefore, any attempt to get the XPRequest's parameter names or values will result in an exception being thrown.
htUserEnvironment - - the user's environment of current values for condition types
See Also:
com.plumtree.portaluiinfrastructure.condition.AGuestConditionType#GetCurrentValue(com.plumtree.portaluiinfrastructure.condition.XPLimitedRequest, com.plumtree.server.IPTSession, com.plumtree.openfoundation.util.XPHashtable)

GetMyConditionsListSectionTitle

public java.lang.String GetMyConditionsListSectionTitle(XPResourceManager xpRM,
                                                        java.lang.String strLanguage)
Returns the String that will be displayed as the Section Title for this condition type in the Subportal Rules Editor. The title can be localized to strLanguage by using the resource manager: xpRM.

Specified by:
GetMyConditionsListSectionTitle in class AConditionType
Parameters:
xpRM - - the resource manager which can be used to localize strings.
strLanguage - - current user's language locale
See Also:
com.plumtree.portaluiinfrastructure.condition.AConditionType#GetMyConditionsListSectionTitle(com.plumtree.openfoundation.internationalization.XPResourceManager, java.lang.String)

GetMyConditionsListSectionSubTitle

public java.lang.String GetMyConditionsListSectionSubTitle(XPResourceManager xpRM,
                                                           java.lang.String strLanguage)
Returns the String that will be displayed as the Section SubTitle for this condition type in the Subportal Rules Editor. The subtitle can be localized to strLanguage by using the resource manager: xpRM.

Specified by:
GetMyConditionsListSectionSubTitle in class AConditionType
Parameters:
xpRM - - the resource manager which can be used to localize strings.
strLanguage - - current user's language locale
See Also:
com.plumtree.portaluiinfrastructure.condition.AConditionType#GetMyConditionsListSectionSubTitle(com.plumtree.openfoundation.internationalization.XPResourceManager, java.lang.String)

GetMyConditionsListAddLabel

public java.lang.String GetMyConditionsListAddLabel(XPResourceManager xpRM,
                                                    java.lang.String strLanguage)
Returns the String that will be displayed as the Add Label for this condition type in the Subportal Rules Editor. The label can be localized to strLanguage by using the resource manager: xpRM.

Specified by:
GetMyConditionsListAddLabel in class AConditionType
Parameters:
xpRM - - the resource manager which can be used to localize strings.
strLanguage - - current user's language locale
See Also:
com.plumtree.portaluiinfrastructure.condition.AConditionType#GetMyConditionsListAddLabel(com.plumtree.openfoundation.internationalization.XPResourceManager, java.lang.String)

GetMyConditionsListIcon

public PTImageType GetMyConditionsListIcon()
Returns the Icon to be associated with this condition type.

Specified by:
GetMyConditionsListIcon in class AConditionType
See Also:
AConditionType.GetMyConditionsListIcon()

GetConditionValueType

public int GetConditionValueType()
Returns the value type of the codition expected by this condition type.

Specified by:
GetConditionValueType in class AConditionType
Returns:
the condition value type that is expected by this condition type. The condition value types are specified in the ValueTypeEnum class.
See Also:
AConditionType.GetConditionValueType()

GetConditionValue

public java.lang.Object GetConditionValue(int nRow,
                                          IPTGrowableSortedArrayWrapperRO saData)
Returns the condition value stored in the nRow row of saData.

Specified by:
GetConditionValue in class AConditionType
Parameters:
nRow - - the row index of the object wanted
saData - - the list containing the object
Returns:
- the object at row nRow of saData formatted to the condition type's value type
See Also:
AConditionType.GetConditionValue(int, com.plumtree.uiinfrastructure.arraywrapper.IPTGrowableSortedArrayWrapperRO)

GetValidationFailedString

public java.lang.String GetValidationFailedString(XPResourceManager xpRM,
                                                  java.lang.String strLanguage)
Description copied from class: AConditionType
If a ValidationFailedException occurs, the RulesEditorModel will call this method to retrieve the appropriete error message. NOTE: The string returned by this method is not HTMLEncoded

Specified by:
GetValidationFailedString in class AConditionType
Parameters:
xpRM - - the resource manager which can be used to localize strings.
strLanguage - - current user's language locale
Returns:
the string that will be displayed as the error message

AddItemToMyConditionsList

public void AddItemToMyConditionsList(java.lang.Object objItem,
                                      ExpListModel myListModel,
                                      IPTSession ptSession)
Adds objItem to the list of conditions of this condition type that is stored in myListModel

Specified by:
AddItemToMyConditionsList in class AConditionType
Parameters:
objItem - - the condition value that needs to be added to the list.
myListModel - - the list model which holds the data of items in the list
ptSession - - the current user's session is provided in case it is needed
See Also:
com.plumtree.portaluiinfrastructure.condition.AConditionType#AddItemToMyConditionsList(java.lang.Object, com.plumtree.uiinfrastructure.expandablelist.ExpListModel, com.plumtree.server.IPTSession)

GetDescriptionString

public java.lang.String GetDescriptionString(IValue ConditionValue,
                                             IPTSession ptSession)
Description copied from class: AConditionType
Constructs the string to be set in an expression's description. Simply return a string describing the current condition. NOTE: The string returned by this method will be HTMLEncoded Example:

Specified by:
GetDescriptionString in class AConditionType
Parameters:
ConditionValue - - the condition value for this condition type
ptSession - - the current user's session is provided in case it is needed
Returns:
string containing the condition type's name and condition value name
See Also:
"URL Domain contains xxx", "Client IP Address matches xxx.xxx.xxx.xxx", "User is in Community: xxx", "User part of Group: xxx"



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.