Class EffHelper
- All Implemented Interfaces:
Externalizable,Serializable,wt.services.applicationcontext.ApplicationContextChild
EffService via the
static reference EffHelper.service. Other functionality is
provided by EffConfigSpecAssistant and EffGroupAssistant.
Supported API: true
Extendable: false
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EffServiceGets the implementedwt.eff.EffServiceinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true if and only if the argument Eff objects are equal (that is, their respective range values are equal).getEffFormClassForEffType(EffType effType) Given an EffType, this method determines Effectivity Form class using Delegate registered for the EffType as selector.static ClassgetEffRange(Class effClass) For a given Eff class, returns the valid EffRange class.static ClassgetEffRangeType(Class rangeClass) For a given EffRange class, returns the datatype for start/end.static EffTypegetEffTypeForForm(Class<? extends EffForm> effFormClass) Given an Effectivity form class, this method determines EffType form using Delegate registered for the Form as selector.static StringgetFormDisplayName(Class<? extends EffForm> effFormClass) Given an Effectivity form class, this method finds out EffType using Delegate registered for the Form as selector and then gets the display name from the EffType short description from appropriate EffTypeRb.rbinfo for user session locale.static Class[]getValidEffectivities(Class parentType, EffContext context) Returns all EffRecord classes that are valid in the given context and of the specified parent type.static Class[]getValidEffectivities(EffContext context) Returns all Eff classes that are valid in the given context.getValidEffectivityForms(EffContext effContext) Returns array of valid EffForm classes for the passed in EffContext.getValidEffForms(EffContext effContext) Deprecated.static Class[]getValidEffs(Class parentType, EffContext context) Deprecated.Replaced bygetValidEffectivities(Class, EffContext)static Class[]getValidEffs(EffContext context) Deprecated.Replaced bygetValidEffectivities(EffContext)getValidTraceCodesForEffForm(Class<? extends EffForm> effFormClass) Given an Effectivity form class, this method finds out valid traces codes using Delegate registered for the Form as selector.static booleanisContainerAdministrator(WTPrincipal user, WTContainerRef container) returns a boolean value representing whether or not the user is an administrator for the current container
Supported API: truestatic booleanisContextRequired(Class effClass) Returns true if the Eff class requires a context (has cardinality 1).static booleanReturns true if and only if the argument Eff object is current (i.e., it has not been factually deleted and thus relegated to effectivity history).static BooleanisEffContextNullable(Class<? extends EffForm> effFormClass) Given an Effectivity form class, this method determines if effectivity context is nullable/optional for form using Delegate registered for the Form as selector.static BooleanisEffContextValidForEffForm(Class<? extends EffForm> effFormClass, EffContext effContext) Given an Effectivity form class and effecitivity context, this method determines if context is valid for form using Delegate registered for the Form as selector.static booleanReturns true if and only if the argument Eff object is legacy (i.e., it does not reference a valid creation EffChangeAudit object).static booleanreturns a boolean value representing whether or not the user is an administrator for the current organization
Supported API: truestatic booleanisValidEffTarget(String target) Returns true if the object passed in is a valid effectivity target.static booleanisValidEffTarget(Changeable2 changeable) Returns true if the changeable passed in is a valid effectivity target, and false otherwise.static booleanisValidEffTarget(EffManagedVersion effManagedVersion) Returns true if the object passed in is a valid effectivity target.static booleanvalidateIfEffContextIsValidForEffForm(Class effFormClass, EffContext effContext) This method checks whether the "effContext" is valid for the "effFormClass".
-
Field Details
-
service
Gets the implementedwt.eff.EffServiceinstance.
Supported API: true
-
-
Method Details
-
getValidEffs
Deprecated.Replaced bygetValidEffectivities(EffContext)Returns all Eff classes that are valid in the given context. If context is null, returns only effs that are optional (have a 0..1 cardinality). The ValidEffsDelegate is used to process this.
Supported API: true- Parameters:
context-- Returns:
- Class[]
-
getValidEffs
Deprecated.Replaced bygetValidEffectivities(Class, EffContext)Returns all EffRecord classes that are valid in the given context and of the specified parent type. If context is null, returns only eff record types that are optional (have a 0..1 cardinality). The ValidEffsDelegate is used to process this.
Supported API: true- Parameters:
parentType-context-- Returns:
- Class[]
-
getEffRange
For a given Eff class, returns the valid EffRange class. For first time call of given input effClass, Gets Effectivity Range from Range property on the mode and puts it into range cache which is class level concurrent hash map. subsequent calls for given input effClass will get it from range cache.
Supported API: true- Parameters:
effClass-- Returns:
- Class
-
getEffRangeType
For a given EffRange class, returns the datatype for start/end.
Supported API: true- Parameters:
rangeClass-- Returns:
- Class
-
isContextRequired
Returns true if the Eff class requires a context (has cardinality 1).
Supported API: true- Parameters:
effClass-- Returns:
- boolean
-
isCurrent
Returns true if and only if the argument Eff object is current (i.e., it has not been factually deleted and thus relegated to effectivity history).
Supported API: true- Parameters:
eff- Eff object whose status as current or historical is to be determined -- may not be null- Returns:
- boolean
-
isLegacy
Returns true if and only if the argument Eff object is legacy (i.e., it does not reference a valid creation EffChangeAudit object).
Supported API: true- Parameters:
eff- Eff object whose status as legacy is to be determined -- may not be null- Returns:
- boolean
-
equals
Returns true if and only if the argument Eff objects are equal (that is, their respective range values are equal).
Supported API: true- Parameters:
e1- Eff object to be compared to the other Eff argument for equality -- may not be nulle2- Eff object to be compared to the other Eff argument for equality -- may not be null- Returns:
- boolean
-
isValidEffTarget
Returns true if the changeable passed in is a valid effectivity target, and false otherwise. If the changeable implements EffManagedVersion, the method will delegate to the overloaded method taking an EffManagedVersion. Returns false otherwise.
Supported API: true- Parameters:
changeable- Changeable2 participating in change-related association- Returns:
- boolean
-
isValidEffTarget
Returns true if the object passed in is a valid effectivity target. For parts with itsnonEffectiveattribute set to true, the method returns false.
Supported API: true- Parameters:
effManagedVersion- Some EffManagedVersion object.- Returns:
- boolean
-
isValidEffTarget
Returns true if the object passed in is a valid effectivity target.
Supported API: true- Parameters:
String- target - Fully qualified class name eg. WTPart.class.getName()- Returns:
- boolean
-
getValidEffForms
Deprecated.Replaced bygetValidEffectivityForms(EffContext)Returns array of valid EffForm classes for the passed in EffContext. If the context is not null, a call to the ValidEffsDelegate will be made to obtain the valid forms for the context. The default delegate bases the result on the trace code ofWTPartMastercontexts, and returns a default set for other contexts. If the context is null, a set of valid forms for non-contextual effectivity forms is returned.
Supported API: true- Parameters:
effContext- effectivity context; may be null- Returns:
- Class<?extends EffForm>[]
-
getValidEffectivities
Returns all Eff classes that are valid in the given context. If context is null, returns only effs that are optional (have a 0..1 cardinality). The ValidEffsDelegate is used to process this.
Supported API: true- Parameters:
context-- Returns:
- Class[]
-
getValidEffectivities
Returns all EffRecord classes that are valid in the given context and of the specified parent type. If context is null, returns only eff record types that are optional (have a 0..1 cardinality). The ValidEffsDelegate is used to process this.
Supported API: true- Parameters:
parentType-context-- Returns:
- Class[]
-
getValidEffectivityForms
Returns array of valid EffForm classes for the passed in EffContext. If the context is not null, a call to the ValidEffsDelegate will be made to obtain the valid forms for the context. The Standard Delegate bases the result on the trace code ofWTPartMastercontexts and valid trace codes defined on the form and returns a default set for other contexts. If the context is null, a set of valid forms for non-contextual effectivity forms is returned as defined on the form.
Supported API: true- Parameters:
effContext- effectivity context; may be null- Returns:
- Class<?extends EffForm>[]
-
getEffTypeForForm
public static EffType getEffTypeForForm(Class<? extends EffForm> effFormClass) throws IllegalArgumentException Given an Effectivity form class, this method determines EffType form using Delegate registered for the Form as selector. If the delegate is not registered with form class as selector, this method returns null.Validates: a. If input interface is not null b. Input class is interface and child of EffForm. c. return type of invoked method is Boolean. If any validation fails then returns null.
- Parameters:
effFormClass-- Returns:
- EffType Supported API: true
- Throws:
IllegalArgumentException
-
isEffContextNullable
public static Boolean isEffContextNullable(Class<? extends EffForm> effFormClass) throws IllegalArgumentException Given an Effectivity form class, this method determines if effectivity context is nullable/optional for form using Delegate registered for the Form as selector. If the delegate is not registered with form class as selector, this method returns null.Validates: a. If input interface is not null b. Input class is interface and child of EffForm. If any validation fails then returns null.
- Parameters:
effFormClass-- Returns:
- Boolean Supported API: true
- Throws:
IllegalArgumentException
-
isEffContextValidForEffForm
public static Boolean isEffContextValidForEffForm(Class<? extends EffForm> effFormClass, EffContext effContext) throws IllegalArgumentException Given an Effectivity form class and effecitivity context, this method determines if context is valid for form using Delegate registered for the Form as selector. If the delegate is not registered with form class as selector, this method returns null.Validates: a. If input interface and context are not null b. Input class is interface and child of EffForm. If any validation fails then throws exception.
- Parameters:
effFormClass-effContext-- Returns:
- Boolean
- Throws:
IllegalArgumentException- Supported API: true
-
getValidTraceCodesForEffForm
public static Set<TraceCode> getValidTraceCodesForEffForm(Class<? extends EffForm> effFormClass) throws IllegalArgumentException Given an Effectivity form class, this method finds out valid traces codes using Delegate registered for the Form as selector. If the delegate is not registered with form class as selector, this method returns null.Validates: a. If input interface is not null b. Input class is interface and child of EffForm. If any validation fails then throws exception.
- Parameters:
effFormClass-- Returns:
- Set of valid trace codes for this form
- Throws:
IllegalArgumentException- Supported API: true
-
getFormDisplayName
public static String getFormDisplayName(Class<? extends EffForm> effFormClass) throws IllegalArgumentException Given an Effectivity form class, this method finds out EffType using Delegate registered for the Form as selector and then gets the display name from the EffType short description from appropriate EffTypeRb.rbinfo for user session locale. If the delegate is not registered with form class as selector, empty string will be returned as display name.Validates: a. If input interface is not null b. Input class is interface and child of EffForm. If any validation fails then throws exception.
If there is error retrieving locale, returns the display name for default locale if found. Supported API: true
- Parameters:
effFormClass-- Returns:
- String
- Throws:
IllegalArgumentException
-
getEffFormClassForEffType
public static Class<? extends EffForm> getEffFormClassForEffType(EffType effType) throws IllegalArgumentException Given an EffType, this method determines Effectivity Form class using Delegate registered for the EffType as selector. If the delegate is not registered with EffType as selector, this method returns null.Validates: a. If input interface is not null b. Input class is interface and child of EffForm. c. return type of invoked method is Boolean. If any validation fails then returns null.
- Parameters:
effFormClass-- Returns:
- EffType Supported API: true
- Throws:
IllegalArgumentException
-
validateIfEffContextIsValidForEffForm
public static boolean validateIfEffContextIsValidForEffForm(Class effFormClass, EffContext effContext) This method checks whether the "effContext" is valid for the "effFormClass".- Parameters:
effFormClass-effContext-- Returns:
- boolean True or False Supported API: true
-
isOrganizationAdministrator
returns a boolean value representing whether or not the user is an administrator for the current organization
Supported API: true- Parameters:
WTPrincipal- user- Returns:
- boolean
-
isContainerAdministrator
returns a boolean value representing whether or not the user is an administrator for the current container
Supported API: true- Parameters:
WTPrincipal- user- Returns:
- boolean
-
getValidEffectivityForms(EffContext)