com.plumtree.portalpages.condition.conditiontypes
Class ConditionTypeAdminFolderID

java.lang.Object
  extended by com.plumtree.portaluiinfrastructure.condition.AConditionType
      extended by com.plumtree.portaluiinfrastructure.condition.ARegularConditionType
          extended by com.plumtree.portalpages.condition.conditiontypes.ConditionTypeAdminFolderID

public class ConditionTypeAdminFolderID
extends ARegularConditionType

Author:
okana

Field Summary
 
Fields inherited from class com.plumtree.portaluiinfrastructure.condition.AConditionType
CONDITION_LIST_CONSTANT, log, PHASE_TYPE_GUEST, PHASE_TYPE_REGULAR, ruleDebugger
 
Constructor Summary
ConditionTypeAdminFolderID()
           
 
Method Summary
 void AddItemToMyConditionsList(java.lang.Object objItem, ExpListModel myListModel, IPTSession ptSession)
          Overriding Parent's implementation to use a different expandable list
 boolean Compare(XPHashtable htUserEnvironment, IValue conditionValue, XPStringBuilder sbDebugText)
           
 java.lang.Object GetConditionValue(int nRow, IPTGrowableSortedArrayWrapperRO saData)
          To return the condition value, we have to retrieve the data from the list using the nRow and saData variables.
 int GetConditionValueType()
          Each condition type has an expectation of what type of value they are to receive.
 void GetCurrentValue(AActivitySpace asCurrentSpace, IXPRequest xpRequest, IPTSession userSession, XPHashtable htUserEnvironment)
          GetCurrentValue 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)
          The Add label specifies what text will be displayed on the Add button.
 PTImageType GetMyConditionsListIcon()
          This method specifies what icon will be displayed on the add button.
 java.lang.String GetMyConditionsListSectionSubTitle(XPResourceManager xpRM, java.lang.String strLanguage)
          This method specifies what text will be displayed on the section sub title.
 java.lang.String GetMyConditionsListSectionTitle(XPResourceManager xpRM, java.lang.String strLanguage)
          This method specifies what text will be displayed on the section title.
 int GetTypeID()
           
 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.
 void InitializeMyConditionsList(ExpListModel myListModel, java.lang.String strLanguage)
          Overriding Parent's implementation to use a different expandable list
 void RegisterMyConditionsList(AActivitySpace asCurrentSpace)
          Overriding Parent's implementation to use a different expandable list
 
Methods inherited from class com.plumtree.portaluiinfrastructure.condition.ARegularConditionType
GetPhaseType
 
Methods inherited from class com.plumtree.portaluiinfrastructure.condition.AConditionType
GetConditionTypeIdentifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionTypeAdminFolderID

public ConditionTypeAdminFolderID()
Method Detail

GetTypeID

public int GetTypeID()

Compare

public boolean Compare(XPHashtable htUserEnvironment,
                       IValue conditionValue,
                       XPStringBuilder sbDebugText)

GetCurrentValue

public void GetCurrentValue(AActivitySpace asCurrentSpace,
                            IXPRequest xpRequest,
                            IPTSession userSession,
                            XPHashtable htUserEnvironment)
Description copied from class: ARegularConditionType
GetCurrentValue determines the condition type's current value, and adds it to the htUserEnvironment. This is important since the Compare method is relying for the correct current value to be in the htUserEnvironment. If the current value is missing or incorrect, then the execution of the rules might return erroneous values. NOTE: Any exception thrown from this method will be caught and discarded.

Specified by:
GetCurrentValue in class ARegularConditionType
Parameters:
asCurrentSpace - - the user's current activity space after all the controls have processed the parameters in the query string and initialized all models
xpRequest - - http request's wrapper
userSession - - the current user's ptSession
htUserEnvironment - - the user's environment of current values for condition types

GetMyConditionsListSectionTitle

public java.lang.String GetMyConditionsListSectionTitle(XPResourceManager xpRM,
                                                        java.lang.String strLanguage)
Description copied from class: AConditionType
This method specifies what text will be displayed on the section title. Use the Resource Manager and the string language to localize. NOTE: The string returned by this method is not HTMLEncoded Examples:

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:
"The base URL is ANY of the following URLs:", "The user's IP is ANY of the following IPs:", "The user is in ANY of the following Communities:", "The user is in ANY of the following Groups:"

GetMyConditionsListSectionSubTitle

public java.lang.String GetMyConditionsListSectionSubTitle(XPResourceManager xpRM,
                                                           java.lang.String strLanguage)
Description copied from class: AConditionType
This method specifies what text will be displayed on the section sub title. Use the Resource Manager and the string language to localize. NOTE: The string returned by this method is not HTMLEncoded Examples:

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:
"URL Domains", "Client IP Addresses", "Community Name", "Group Name"

GetMyConditionsListAddLabel

public java.lang.String GetMyConditionsListAddLabel(XPResourceManager xpRM,
                                                    java.lang.String strLanguage)
Description copied from class: AConditionType
The Add label specifies what text will be displayed on the Add button. Use the Resource Manager and the string language to localize. NOTE: The string returned by this method is not HTMLEncoded Examples:

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:
"Add URL", "Add an IP Address", "Add Communities", "Add Groups"

GetMyConditionsListIcon

public PTImageType GetMyConditionsListIcon()
Description copied from class: AConditionType
This method specifies what icon will be displayed on the add button. Use the PTImageType class to select an icon.

Specified by:
GetMyConditionsListIcon in class AConditionType

GetConditionValueType

public int GetConditionValueType()
Description copied from class: AConditionType
Each condition type has an expectation of what type of value they are to receive. A condition on url domain most likey will expect its value type to be of string, while a condition on community ID would have a value of type integer.

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.

GetConditionValue

public java.lang.Object GetConditionValue(int nRow,
                                          IPTGrowableSortedArrayWrapperRO saData)
Description copied from class: AConditionType
To return the condition value, we have to retrieve the data from the list using the nRow and saData variables. Then it needs to be converted to the value type that is expected. The default list used is the Growable List, which is what the URL condition type uses. To retrieve the data from the Growable List, use the GrowableListModel.EXPLIST_SORTEDARRAY_PROPID_INPUTTEXT constant: Object result = saData.GetItem(nRow, GrowableListModel.EXPLIST_SORTEDARRAY_PROPID_INPUTTEXT); At this point, the result has been retrieved as a String. The next step would be to convert the string object to the type returned by GetConditionValueType(). This method is also where validation of the value occurs. If the value is suppose to be an integer, validate that it is and throw a ValidationFailedException if it's not.

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:
ConditionTypeURLDomain

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

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"

RegisterMyConditionsList

public void RegisterMyConditionsList(AActivitySpace asCurrentSpace)
Overriding Parent's implementation to use a different expandable list

Overrides:
RegisterMyConditionsList in class AConditionType
Parameters:
asCurrentSpace - - the activityspace the expandable list will be registered to

InitializeMyConditionsList

public void InitializeMyConditionsList(ExpListModel myListModel,
                                       java.lang.String strLanguage)
Overriding Parent's implementation to use a different expandable list

Overrides:
InitializeMyConditionsList in class AConditionType
Parameters:
myListModel - - the model of the expandable list registered with this condition type. The list's initialization method resides in the model. To be able to call the correct initialization method, casting the ExpListModel to the correct type may be needed.
strLanguage - - this is the laguange of the current user that is trying to create or edit an expression.

AddItemToMyConditionsList

public void AddItemToMyConditionsList(java.lang.Object objItem,
                                      ExpListModel myListModel,
                                      IPTSession ptSession)
Overriding Parent's implementation to use a different expandable list

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:
ConditionTypeURLDomain



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