com.aurel.track.fieldType.runtime.base
Class AbstractFieldTypeRT

java.lang.Object
  extended by com.aurel.track.fieldType.runtime.base.AbstractFieldTypeRT
All Implemented Interfaces:
IFieldTypeRT, ILucene
Direct Known Subclasses:
CustomCompositeBaseRT, OutputFieldTypeRT

public abstract class AbstractFieldTypeRT
extends java.lang.Object
implements IFieldTypeRT

The base class for runtime field types with typical default implementations

Author:
Tamas Ruff

Constructor Summary
AbstractFieldTypeRT()
           
 
Method Summary
 java.util.Map getInternalDependences(java.lang.Integer fieldID)
          Get the map of internal dependences - key: a String of fieldID and parameterCode combination (parameterCode is null for system-, or custom single fields) - value: List of parameterCodes as Integers which defines the internal dependencies for this key i.e. the indexes inside the composite this part depends on Important: This makes sense only for parts of a custom composite field and for the custom composite itself Do not override for system or custom single fields
 java.lang.String getLuceneValue(java.lang.Object value)
          Typically the value itself converted to string But there are some exceptions where the toString() doesn't work as expected.
 MatcherConverter getMatcherConverter()
          Gets the Matcher converter corresponding to the type
 java.util.List getMatcherDataSource(java.lang.Integer fieldID, java.lang.Integer personID, java.util.Locale locale)
          Loads the datasource for the matcher
 IMatcherDT getMatcherDT(java.lang.Integer fieldID)
          Creates the matcher object for configuring the matcher
 IMatcherRT getMatcherRT(java.lang.Integer fieldID, int relation, java.lang.Object matchValue, MatcherContext replacementContext)
          Creates the matcher object for executing the matcher
 java.lang.String getShowISOValue(java.lang.Integer fieldID, java.lang.Integer parameterCode, java.lang.Object value, DropDownContainer dropDownContainer)
          Get the ISO value to be shown typically the show ISO value is the show value This map is typically used for date and number values formatted by iso format for locale independent exporting to xml
 java.lang.String getShowValue(java.lang.Integer fieldID, java.lang.Integer parameterCode, java.lang.Object value, DropDownContainer dropDownContainer)
          Get the value to be shown For text fields typically the field value itself For selects the (eventaully localized) label corresponding to the value
 java.lang.String getShowValue(java.lang.Object value, java.util.Locale locale)
          Get the value to be shown For text fields typically the field value itself For selects the (eventually localized) label corresponding to the value
 java.lang.Object getSortOrderValue(java.lang.Integer fieldID, java.lang.Integer parameterCode, java.lang.Object value, DropDownContainer dropDownContainer)
          Get the sort order related to the value Not defined for every field, only a few select fields has extra sortOrder columns
 java.util.Map getSystemDependences(java.lang.Integer fieldID)
          Get the map of system dependences - key: a String of fieldID and parameterCode combination (parameterCode is null for system-, or custom single fields) - value: List of system fieldsIDs as Integers which defines the system dependencies for this part Important: The dependences on project and issueType are hardcoded so only the other system dependences should be specified
 java.util.Map getValidators(java.lang.Integer fieldID, TFieldConfigBean fieldConfigBean, java.lang.Integer parameterCode, java.lang.Object settingsObject, TWorkItemBean workItemBean)
          It would be enough to introduce getValidators() only at InputFieldType level (and return a null from procesLoadValidators() of this class) but than the composite fields (implementing CustomCompositeFieldTypeRT) would not call the getValidators() defined in them because CustomCompositeFieldTypeRT does not implement InputFieldType just AbstractFieldTypeRT and the procesLoadValidators() from this class would return always null
 boolean isCalculated(java.lang.Integer fieldID, java.lang.Integer parameterCode)
          Whether this field is a calculated field If calculated and dependent from other fields then changing the dependee should trigger the recalculation of this field
 boolean isGroupable()
          Whether the field should appear in the groupable fields list Typically fields which are typically unique should not be groupable
 boolean isLong()
          Whether this field is a long text because then the read only rendering (on the report overview, printItem, etc.)
 boolean isoDiffersFromLocaleSpecific()
          Returns whether the iso show value differs from the locale specific show value for this field type.
 boolean isUserPicker()
          Whether this field is a UserPicker Special care should be taken by user pickers because of the notification (automail) A person may receive an automail just because he/she is selected in a userPicker
 java.util.Map procesLoadValidators(java.lang.Integer fieldID, TFieldConfigBean fieldConfigBean, java.lang.Integer parameterCode, java.lang.Object settingsObject, TWorkItemBean workItemBean)
          Validates an attribute for a field and returns the resource key(s) in case of validation error
 void processDefaultValue(java.lang.Integer fieldID, java.lang.Integer parameterCode, java.lang.Integer validConfig, java.util.Map fieldSettings, TWorkItemBean workItemBean)
          Loads a default attribute for a new issue
 void processLoadDataSource(SelectContext selectContext, DropDownContainer dropDownContainer)
          Actualizes the dropDownContainer with the datasource for a select type field by editing an existing issue or creating a new issue.
 IMatcherDT processLoadMatcherDT(java.lang.Integer fieldID)
          Loads the matcher object for configuring the matcher
 IMatcherRT processLoadMatcherRT(java.lang.Integer fieldID, int relation, java.lang.Object matchValue, MatcherContext matcherContext)
          Loads the matcher object for executing the matcher fieldID would suffice as parameter for loading the specific Matcher, while the other parameters could be set after the matcher is loaded.
 void processSave(java.lang.Integer fieldID, java.lang.Integer parameterCode, TWorkItemBean workItemBean, TWorkItemBean workItemBeanOriginal)
          Saves a custom attribute to the database
 boolean valueModified(java.lang.Object newValue, java.lang.Object oldValue)
          Whether the value have been modified Considered by assembling the history and mail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.aurel.track.fieldType.runtime.base.IFieldTypeRT
processLoad
 
Methods inherited from interface com.aurel.track.fieldType.runtime.callbackInterfaces.ILucene
getLookupEntityType, getLuceneStored, getLuceneTokenized
 

Constructor Detail

AbstractFieldTypeRT

public AbstractFieldTypeRT()
Method Detail

processSave

public void processSave(java.lang.Integer fieldID,
                        java.lang.Integer parameterCode,
                        TWorkItemBean workItemBean,
                        TWorkItemBean workItemBeanOriginal)
Saves a custom attribute to the database

Specified by:
processSave in interface IFieldTypeRT
Parameters:
fieldID -
parameterCode -
workItemBean -
workItemBeanOriginal -

isCalculated

public boolean isCalculated(java.lang.Integer fieldID,
                            java.lang.Integer parameterCode)
Whether this field is a calculated field If calculated and dependent from other fields then changing the dependee should trigger the recalculation of this field

Specified by:
isCalculated in interface IFieldTypeRT
Parameters:
fieldID -
parameterCode -

valueModified

public boolean valueModified(java.lang.Object newValue,
                             java.lang.Object oldValue)
Whether the value have been modified Considered by assembling the history and mail

Specified by:
valueModified in interface IFieldTypeRT
Parameters:
newValue -
oldValue -
Returns:

processDefaultValue

public void processDefaultValue(java.lang.Integer fieldID,
                                java.lang.Integer parameterCode,
                                java.lang.Integer validConfig,
                                java.util.Map fieldSettings,
                                TWorkItemBean workItemBean)
Loads a default attribute for a new issue

Specified by:
processDefaultValue in interface IFieldTypeRT
Parameters:
fieldID -
parameterCode -
validConfig -
fieldSettings -
workItemBean -

processLoadDataSource

public void processLoadDataSource(SelectContext selectContext,
                                  DropDownContainer dropDownContainer)
Actualizes the dropDownContainer with the datasource for a select type field by editing an existing issue or creating a new issue. The result might differ from loadCreateDataSource because it might be needed to add the current value from the workItem to the list entries (when right already revoked for the current value).

Specified by:
processLoadDataSource in interface IFieldTypeRT
Parameters:
selectContext -
dropDownContainer -

procesLoadValidators

public java.util.Map procesLoadValidators(java.lang.Integer fieldID,
                                          TFieldConfigBean fieldConfigBean,
                                          java.lang.Integer parameterCode,
                                          java.lang.Object settingsObject,
                                          TWorkItemBean workItemBean)
Validates an attribute for a field and returns the resource key(s) in case of validation error

Specified by:
procesLoadValidators in interface IFieldTypeRT
Parameters:
fieldConfigBean -
settingsObject - should be either TTextBoxSettingsBean, TOptionSettingsBean or TGeneralSettingsBean
attribute - the value to validate
Returns:

getValidators

public java.util.Map getValidators(java.lang.Integer fieldID,
                                   TFieldConfigBean fieldConfigBean,
                                   java.lang.Integer parameterCode,
                                   java.lang.Object settingsObject,
                                   TWorkItemBean workItemBean)
It would be enough to introduce getValidators() only at InputFieldType level (and return a null from procesLoadValidators() of this class) but than the composite fields (implementing CustomCompositeFieldTypeRT) would not call the getValidators() defined in them because CustomCompositeFieldTypeRT does not implement InputFieldType just AbstractFieldTypeRT and the procesLoadValidators() from this class would return always null

Parameters:
fieldID -
fieldConfigBean -
parameterCode -
settingsObject -
workItemBean -
Returns:

processLoadMatcherDT

public IMatcherDT processLoadMatcherDT(java.lang.Integer fieldID)
Loads the matcher object for configuring the matcher

Specified by:
processLoadMatcherDT in interface IFieldTypeRT
Parameters:
fieldID -

getMatcherDT

public IMatcherDT getMatcherDT(java.lang.Integer fieldID)
Creates the matcher object for configuring the matcher

Parameters:
fieldID -

processLoadMatcherRT

public IMatcherRT processLoadMatcherRT(java.lang.Integer fieldID,
                                       int relation,
                                       java.lang.Object matchValue,
                                       MatcherContext matcherContext)
Loads the matcher object for executing the matcher fieldID would suffice as parameter for loading the specific Matcher, while the other parameters could be set after the matcher is loaded. But we need the matchValue parameter in the getMatcher() already set in case of replacement parameters, to replace the symbolic value with the actual value The symbolic and replacement values will be stored in the replacementContext (ex. $USER for the current user as originator/manager/responsible: the symbolic value for $USER should be replaced with the value of the user currently logged in)

Specified by:
processLoadMatcherRT in interface IFieldTypeRT
Parameters:
fieldID -
relation -
matchValue -
matcherContext -

getMatcherRT

public IMatcherRT getMatcherRT(java.lang.Integer fieldID,
                               int relation,
                               java.lang.Object matchValue,
                               MatcherContext replacementContext)
Creates the matcher object for executing the matcher

Parameters:
fieldID -

getMatcherDataSource

public java.util.List getMatcherDataSource(java.lang.Integer fieldID,
                                           java.lang.Integer personID,
                                           java.util.Locale locale)
Loads the datasource for the matcher

Specified by:
getMatcherDataSource in interface IFieldTypeRT
Parameters:
fieldID -
personID -
locale -
Returns:

getShowValue

public java.lang.String getShowValue(java.lang.Integer fieldID,
                                     java.lang.Integer parameterCode,
                                     java.lang.Object value,
                                     DropDownContainer dropDownContainer)
Get the value to be shown For text fields typically the field value itself For selects the (eventaully localized) label corresponding to the value

Specified by:
getShowValue in interface IFieldTypeRT
Parameters:
fieldID -
parameterCode -
value -
dropDownContainer -
Returns:

getShowValue

public java.lang.String getShowValue(java.lang.Object value,
                                     java.util.Locale locale)
Get the value to be shown For text fields typically the field value itself For selects the (eventually localized) label corresponding to the value

Specified by:
getShowValue in interface IFieldTypeRT
Parameters:
value -
locale -
Returns:

getShowISOValue

public java.lang.String getShowISOValue(java.lang.Integer fieldID,
                                        java.lang.Integer parameterCode,
                                        java.lang.Object value,
                                        DropDownContainer dropDownContainer)
Get the ISO value to be shown typically the show ISO value is the show value This map is typically used for date and number values formatted by iso format for locale independent exporting to xml

Specified by:
getShowISOValue in interface IFieldTypeRT
Parameters:
fieldID -
parameterCode -
value -
dropDownContainer -
Returns:

isoDiffersFromLocaleSpecific

public boolean isoDiffersFromLocaleSpecific()
Returns whether the iso show value differs from the locale specific show value for this field type. This is needed to avoid loading the iso values by repeating the load for locale specific show value (which takes surprisingly long time)

Specified by:
isoDiffersFromLocaleSpecific in interface IFieldTypeRT
Returns:

getSortOrderValue

public java.lang.Object getSortOrderValue(java.lang.Integer fieldID,
                                          java.lang.Integer parameterCode,
                                          java.lang.Object value,
                                          DropDownContainer dropDownContainer)
Get the sort order related to the value Not defined for every field, only a few select fields has extra sortOrder columns

Specified by:
getSortOrderValue in interface IFieldTypeRT
Parameters:
fieldID -
parameterCode -
value - the value the sortorder is looked for
dropDownContainer -
Returns:

getSystemDependences

public java.util.Map getSystemDependences(java.lang.Integer fieldID)
Get the map of system dependences - key: a String of fieldID and parameterCode combination (parameterCode is null for system-, or custom single fields) - value: List of system fieldsIDs as Integers which defines the system dependencies for this part Important: The dependences on project and issueType are hardcoded so only the other system dependences should be specified

Specified by:
getSystemDependences in interface IFieldTypeRT
Returns:

getInternalDependences

public java.util.Map getInternalDependences(java.lang.Integer fieldID)
Get the map of internal dependences - key: a String of fieldID and parameterCode combination (parameterCode is null for system-, or custom single fields) - value: List of parameterCodes as Integers which defines the internal dependencies for this key i.e. the indexes inside the composite this part depends on Important: This makes sense only for parts of a custom composite field and for the custom composite itself Do not override for system or custom single fields

Specified by:
getInternalDependences in interface IFieldTypeRT
Returns:

getMatcherConverter

public MatcherConverter getMatcherConverter()
Gets the Matcher converter corresponding to the type

Specified by:
getMatcherConverter in interface IFieldTypeRT
Returns:

getLuceneValue

public java.lang.String getLuceneValue(java.lang.Object value)
Typically the value itself converted to string But there are some exceptions where the toString() doesn't work as expected. For example by custom select the value is an Integer[] and in this case it should be implemented specific to the lucene requirement to be indexable

Specified by:
getLuceneValue in interface ILucene
Parameters:
value -
Returns:

isUserPicker

public boolean isUserPicker()
Whether this field is a UserPicker Special care should be taken by user pickers because of the notification (automail) A person may receive an automail just because he/she is selected in a userPicker

Specified by:
isUserPicker in interface IFieldTypeRT
Returns:

isLong

public boolean isLong()
Whether this field is a long text because then the read only rendering (on the report overview, printItem, etc.) should be made different as the rest of the "short" fields This can be the case for Description, Comment and longtext custom fields

Specified by:
isLong in interface IFieldTypeRT
Returns:

isGroupable

public boolean isGroupable()
Whether the field should appear in the groupable fields list Typically fields which are typically unique should not be groupable

Specified by:
isGroupable in interface IFieldTypeRT
Returns:


Issue Tracking with Track+: Home Page      Copyright © 2008 Trackplus. All Rights Reserved.