com.sas.prompts.definitions
Class DataSourceColumnDefinition

com.sas.prompts.definitions.DataSourceColumnDefinition
All Implemented Interfaces:
com.sas.models.VersionInterface, com.sas.prompts.definitions.DataSourceColumnDefinitionInterface, com.sas.prompts.definitions.HintableDefinitionInterface, com.sas.prompts.definitions.MutableDataSourceColumnDefinitionInterface, com.sas.prompts.definitions.MutableHintableDefinitionInterface, com.sas.prompts.definitions.MutablePromptDefinitionInterface, com.sas.prompts.definitions.MutablePromptDefinitionV2Interface, MutableSelectableDefinitionInterface, PromptDefinitionInterface, com.sas.prompts.definitions.PromptDefinitionV2Interface, SelectableDefinitionInterface, com.sas.prompts.IdentifiablePromptInterface, com.sas.prompts.MutableIdentifiablePromptInterface, com.sas.PublicClonable, com.sas.storage.editableproperties.LocalizableProperties, com.sas.storage.editableproperties.MultiLocaleProperties, com.sas.uiconfig.ContextEnabledObject, com.sas.util.AttributeConfigurationInterface, com.sas.util.AttributeDescription, com.sas.util.log.ComponentLogFactoryInterface, com.sas.util.macrovar.MacroVariableListOptionInterface, com.sas.util.macrovar.MacroVariableOptionInterface, com.sas.util.macrovar.MutableMacroVariableListOptionInterface, com.sas.util.macrovar.MutableMacroVariableOptionInterface, com.sas.util.ResourceReferencesInterface, com.sas.util.xmlpersist.PersistenceInterface, java.io.Externalizable, java.io.Serializable, java.lang.Cloneable

public class DataSourceColumnDefinition
implements com.sas.prompts.definitions.MutableDataSourceColumnDefinitionInterface

DataSourceColumnDefinition is a prompt type which allows the specification of one or more columns from a physical table or DataItems from an InformationMap registered in metadata.

See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Fields inherited from interface com.sas.prompts.definitions.SelectableDefinitionInterface
MULTIPLE_SELECTION, ORDERED_MULTIPLE_SELECTION, SINGLE_SELECTION
 
Fields inherited from interface com.sas.prompts.definitions.PromptDefinitionInterface
PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM, PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM_DECIMAL_PLACES, PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM_LINES, PROMPT_VALIDATION_ERROR_ABOVE_MAXIMUM_VALUE_COUNT, PROMPT_VALIDATION_ERROR_BELOW_MINIMUM, PROMPT_VALIDATION_ERROR_BELOW_MINIMUM_LENGTH, PROMPT_VALIDATION_ERROR_BELOW_MINIMUM_VALUE_COUNT, PROMPT_VALIDATION_ERROR_DATA_SOURCE_COLUMN_TYPE_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_DATA_SOURCE_CONTAINS_NO_DATA_ITEMS, PROMPT_VALIDATION_ERROR_DATA_SOURCE_NOT_AVAILABLE, PROMPT_VALIDATION_ERROR_DATA_SOURCE_TYPE_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_EMPTY_STATIC_LIST_AND_REQUIRED_WITH_NO_ADDITIONAL_VALUES_ALLOWED, PROMPT_VALIDATION_ERROR_ERROR_LOADING_SHARED_PROMPT, PROMPT_VALIDATION_ERROR_FILE_TYPE_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_FROM_SCRIPT, PROMPT_VALIDATION_ERROR_INCORRECT_RELATIVE_DATE_VALUE, PROMPT_VALIDATION_ERROR_INPUT_DOES_NOT_MATCH_PATTERN, PROMPT_VALIDATION_ERROR_INVALID_INPUT_PATTERN, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_ABOVE_MAXIMUM, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_ABOVE_UPPER_RANGE_VALUE, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_BELOW_MINIMUM, PROMPT_VALIDATION_ERROR_LOWER_RANGE_VALUE_BELOW_MINIMUM_LENGTH, PROMPT_VALIDATION_ERROR_MASKED_HIDDEN_REQUIRED, PROMPT_VALIDATION_ERROR_MAX_DECIMAL_PLACES_ABOVE_MAX_PERCISION, PROMPT_VALIDATION_ERROR_MAXIMUM_LENGTH_BELOW_ZERO, PROMPT_VALIDATION_ERROR_MIN_DECIMAL_PLACES_ABOVE_MAX_PERCISION, PROMPT_VALIDATION_ERROR_MINIMUM_ABOVE_MAXIMUM, PROMPT_VALIDATION_ERROR_MINIMUM_ABOVE_MAXIMUM_DECIMAL_PLACES, PROMPT_VALIDATION_ERROR_MINIMUM_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_MINIMUM_ABOVE_MAXIMUM_VALUE_COUNT, PROMPT_VALIDATION_ERROR_MINIMUM_LENGTH_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_MINIMUM_LENGTH_BELOW_ZERO, PROMPT_VALIDATION_ERROR_MORE_THAN_ONE_SPECIAL_VALUE_SPECIFIED, PROMPT_VALIDATION_ERROR_MULTIPLE_DATA_SOURCES_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_NO_DATA_SOURCE, PROMPT_VALIDATION_ERROR_NON_EDITABLE_REQUIRED_WITH_NO_DEFAULT_NOT_ALLOWED, PROMPT_VALIDATION_ERROR_NOT_VALID_OBJECT, PROMPT_VALIDATION_ERROR_ONLY_DIRECTORIES_ALLOWED, PROMPT_VALIDATION_ERROR_ONLY_FILES_ALLOWED, PROMPT_VALIDATION_ERROR_PERIOD_ENDS_200_YEARS_AHEAD, PROMPT_VALIDATION_ERROR_PERIOD_STARTS_200_YEARS_AGO, PROMPT_VALIDATION_ERROR_SPECIAL_VALUE_MIXED_WITH_OTHER_VALUES, PROMPT_VALIDATION_ERROR_STATIC_VALUE_INVALID, PROMPT_VALIDATION_ERROR_UPPER_RANGE_VALUE_ABOVE_MAXIMUM, PROMPT_VALIDATION_ERROR_UPPER_RANGE_VALUE_ABOVE_MAXIMUM_LENGTH, PROMPT_VALIDATION_ERROR_UPPER_RANGE_VALUE_BELOW_MINIMUM, PROMPT_VALIDATION_ERROR_UPPER_RANGE_VALUE_BELOW_MINIMUM_LENGTH, PROMPT_VALIDATION_NO_ERRORS
 
Constructor Summary
DataSourceColumnDefinition()
          Constructor
DataSourceColumnDefinition(java.lang.String promptName)
          Constructor
 
Method Summary
 void configureAttributes(java.util.Map<java.lang.String,?> options, java.util.Map<java.lang.String,?> context)
           
 long getAllowedColumnTypes()
          Returns a long with bit flags set to indicate what types of columns or DataItems are allowed.
 long getAllowedDataSourceTypes()
          Returns either a long containing bit flags representing the allowed data source types or null.
 java.util.List getAttributeDescriptors(java.util.Locale locale)
           
protected  java.util.Map<java.lang.String,java.lang.String> getConstraints(java.util.Locale locale)
           
 java.util.List getDataSources()
          Returns a List of data sources to allow the selection of columns or DataItems from.
 int getMaximumValueCount()
          Returns the maximum number of values the user is allowed to select.
 int getMinimumValueCount()
          Returns the minimum number of values the user is allowed to select.
 com.sas.datatypes.DataTypeInterface getPromptDataType()
          Returns an instance of com.sas.datatypes.DataSourceColumnType or com.sas.datatypes.CollectionType that can be used to process values for this prompt.
 java.util.Collection<ValidationEntry> getPromptValueValidationErrors(java.lang.Object value, java.util.Locale locale)
          Returns a Collection containing the set of ValidationEntry objects or an empty collection if no errors were found.
 int getSelectionType()
          Returns the type of selection that the prompt supports.
 boolean isAllowMultipleDataSources()
          Returns whether items can be specified from multiple data sources at the same time or if all items must be from the same data source.
 boolean isDataSourceTypeAllowed(long dataSourceType)
          Returns true if the specified data source type is allowed
 boolean isPromptValueValid(java.lang.Object value, java.util.Locale locale)
          Returns whether the value passed in meets the constraints of the prompt definition.
 boolean isRequired()
          Returns whether the user will be required to enter a value for this prompt before continuing in the application
 boolean isSelectionOrdered()
          Returns whether the values the user selects should be ordered.
 void setAllowedColumnTypes(long allowedColumnTypes)
          Sets a long with bit flags set to indicate what types of columns or DataItems are allowed.
 void setAllowedDataSourceTypes(long allowedDataSourceTypes)
          Sets a long containing bit flags representing the allowed data source types or null.
 void setAllowMultipleDataSources(boolean allowMultipleDataSources)
          Sets whether items can be specified from multiple data sources at the same time or if all items must be from the same data source.
 void setDataSources(java.util.List dataSources)
          Sets a List of data sources to allow the selection of columns or DataItems from.
 void setMaximumValueCount(int maximumValueCount)
          Sets the maximum number of valid values for a prompt.
 void setMinimumValueCount(int minimumValueCount)
          Sets the minimum number of valid values for a prompt.
 void setSelectionOrdered(boolean selectionOrdered)
          Sets whether the order in which values are selected should be retained.
 java.util.Collection<ValidationEntry> validateDefinition(java.util.Locale locale)
          This method is used to validate that the various attributes of the definition all contain valid values.
 boolean validIndividualValue(java.lang.Object value)
          Return whether the value passed in is valid according to the current constraints.
 boolean validIndividualValue(java.lang.Object value, java.util.Locale locale)
           
 
Methods inherited from class com.sas.prompts.definitions.PromptDefinition
addUserInfo, clearDefaultValue, getApplicationContext, getCustomErrorMessage, getCustomErrorMessages, getDefaultValue, getDependentPromptsForAttributes, getHint, getHints, getInlineHint, getInlineHints, getLabelPlacement, getLocalizableProperties, getMutableUserInfo, getPromptDescription, getPromptDescriptions, getPromptID, getPromptLabel, getPromptLabels, getPromptName, getScript, getScripts, getUIConfiguration, getUserInfo, getUserInfoAsText, getVersion, isDefaultValueSet, isDisplayDefaultValueAsBlank, isFixed, isHidden, isPromptValueValid, isValueClearedForNonSelectedModalChoiceGroup, removeScript, removeUserInfo, setAdditionalCascadeDependencies, setApplicationContext, setCustomErrorMessage, setCustomErrorMessages, setDefaultValue, setDependentPromptsForAttributes, setDisplayDefaultValueAsBlank, setFixed, setHidden, setHint, setHints, setInlineHint, setInlineHints, setLabelPlacement, setLocalizableProperties, setPromptDescription, setPromptDescriptions, setPromptLabel, setPromptLabels, setPromptName, setScript, setUIConfiguration, setUserInfo, setValueClearedForNonSelectedModalChoiceGroup, toString
 
Methods inherited from interface com.sas.prompts.definitions.PromptDefinitionInterface
clearDefaultValue, getDefaultValue, getPromptDescription, getPromptDescriptions, getPromptLabel, getPromptLabels, getPromptName, getUserInfo, isDefaultValueSet, isFixed, isHidden, isPromptValueValid
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

DataSourceColumnDefinition

public DataSourceColumnDefinition()
Constructor


DataSourceColumnDefinition

public DataSourceColumnDefinition(java.lang.String promptName)
Constructor

Parameters:
promptName - The name of the prompt.
Method Detail

isRequired

public boolean isRequired()
Returns whether the user will be required to enter a value for this prompt before continuing in the application

Specified by:
isRequired in interface PromptDefinitionInterface
Specified by:
isRequired in class PromptDefinition
Returns:
whether the user will be required to enter a value for this prompt before continuing in the application
See Also:
PromptDefinitionInterface.isRequired()

validIndividualValue

public boolean validIndividualValue(java.lang.Object value)
Return whether the value passed in is valid according to the current constraints.

Specified by:
validIndividualValue in interface SelectableDefinitionInterface
Parameters:
value - The value to validate
Returns:
whether the value passed in is valid according to the current constraints.

isPromptValueValid

public boolean isPromptValueValid(java.lang.Object value,
                                  java.util.Locale locale)
Returns whether the value passed in meets the constraints of the prompt definition.

Specified by:
isPromptValueValid in interface com.sas.prompts.definitions.PromptDefinitionV2Interface
Overrides:
isPromptValueValid in class PromptDefinition
Returns:
whether the value passed in meets the constraints of the prompt definition.
See Also:
PromptDefinitionV2Interface.isPromptValueValid(java.lang.Object, java.util.Locale)

getPromptValueValidationErrors

public java.util.Collection<ValidationEntry> getPromptValueValidationErrors(java.lang.Object value,
                                                                            java.util.Locale locale)
Returns a Collection containing the set of ValidationEntry objects or an empty collection if no errors were found.

Specified by:
getPromptValueValidationErrors in interface PromptDefinitionInterface
Overrides:
getPromptValueValidationErrors in class PromptDefinition
Parameters:
value - The value to check for errors
locale - The locale to return the error messages in
Returns:
A Collection containing the set of ValidationEntry objects or an empty collection if no errors were found.
See Also:
PromptDefinitionInterface.getPromptValueValidationErrors(Object, Locale)

validateDefinition

public java.util.Collection<ValidationEntry> validateDefinition(java.util.Locale locale)
This method is used to validate that the various attributes of the definition all contain valid values. If the definition is valid, and empty collection will be returned, otherwise the collection with contain ValidationEntry objects for each error. This method should be called before the definition is to be used. Subclasses should override this method to return the appropriate validation errors.

Specified by:
validateDefinition in interface PromptDefinitionInterface
Overrides:
validateDefinition in class PromptDefinition
Parameters:
locale - Locale
Returns:
A Collection containing the set of ValidationEntry objects or an empty collection if no errors were found.
See Also:
PromptDefinitionInterface.validateDefinition(Locale)

getPromptDataType

public com.sas.datatypes.DataTypeInterface getPromptDataType()
Returns an instance of com.sas.datatypes.DataSourceColumnType or com.sas.datatypes.CollectionType that can be used to process values for this prompt.

Specified by:
getPromptDataType in interface PromptDefinitionInterface
Specified by:
getPromptDataType in class PromptDefinition
Returns:
an instance of com.sas.datatypes.DataSourceColumnType or com.sas.datatypes.CollectionType.
See Also:
PromptDefinitionInterface.getPromptDataType()

getAllowedDataSourceTypes

public long getAllowedDataSourceTypes()
Returns either a long containing bit flags representing the allowed data source types or null. See com.sas.models.datasources.DataSourceInterface for valid types.

Specified by:
getAllowedDataSourceTypes in interface com.sas.prompts.definitions.DataSourceColumnDefinitionInterface
Returns:
either a long containing bit flags representing the allowed data source types or null

setAllowedDataSourceTypes

public void setAllowedDataSourceTypes(long allowedDataSourceTypes)
Sets a long containing bit flags representing the allowed data source types or null. See com.sas.models.datasources.DataSourceInterface for valid types.

Specified by:
setAllowedDataSourceTypes in interface com.sas.prompts.definitions.MutableDataSourceColumnDefinitionInterface
Parameters:
allowedDataSourceTypes - either a long containing bit flags representing the allowed data source types or null

isDataSourceTypeAllowed

public boolean isDataSourceTypeAllowed(long dataSourceType)
Returns true if the specified data source type is allowed

Parameters:
dataSourceType - the data source type to check
Returns:
true if the type is allowed, otherwise false

getDataSources

public java.util.List getDataSources()
Returns a List of data sources to allow the selection of columns or DataItems from.

Specified by:
getDataSources in interface com.sas.prompts.definitions.DataSourceColumnDefinitionInterface
Returns:
a List of data sources to allow the selection of columns or DataItems from.

setDataSources

public void setDataSources(java.util.List dataSources)
Sets a List of data sources to allow the selection of columns or DataItems from.

Specified by:
setDataSources in interface com.sas.prompts.definitions.MutableDataSourceColumnDefinitionInterface
Parameters:
dataSources - a List of data sources to allow the selection of columns or DataItems from.

getAllowedColumnTypes

public long getAllowedColumnTypes()
Returns a long with bit flags set to indicate what types of columns or DataItems are allowed.

Specified by:
getAllowedColumnTypes in interface com.sas.prompts.definitions.DataSourceColumnDefinitionInterface
Returns:
a long with bit flags set to indicate what types of columns or DataItems are allowed.

setAllowedColumnTypes

public void setAllowedColumnTypes(long allowedColumnTypes)
Sets a long with bit flags set to indicate what types of columns or DataItems are allowed.

Specified by:
setAllowedColumnTypes in interface com.sas.prompts.definitions.MutableDataSourceColumnDefinitionInterface
Parameters:
allowedColumnTypes - a long with bit flags set to indicate what types of columns or DataItems are allowed.

setAllowMultipleDataSources

public void setAllowMultipleDataSources(boolean allowMultipleDataSources)
Sets whether items can be specified from multiple data sources at the same time or if all items must be from the same data source.

Specified by:
setAllowMultipleDataSources in interface com.sas.prompts.definitions.MutableDataSourceColumnDefinitionInterface
Parameters:
allowMultipleDataSources - whether items can be specified from multiple data sources at the same time or if all items must be from the same data source.

isAllowMultipleDataSources

public boolean isAllowMultipleDataSources()
Returns whether items can be specified from multiple data sources at the same time or if all items must be from the same data source.

Specified by:
isAllowMultipleDataSources in interface com.sas.prompts.definitions.DataSourceColumnDefinitionInterface
Returns:
whether items can be specified from multiple data sources at the same time or if all items must be from the same data source.

getMaximumValueCount

public int getMaximumValueCount()
Description copied from interface: SelectableDefinitionInterface
Returns the maximum number of values the user is allowed to select.

Specified by:
getMaximumValueCount in interface SelectableDefinitionInterface
Returns:
the maximum number of values the user is allowed to select

getMinimumValueCount

public int getMinimumValueCount()
Description copied from interface: SelectableDefinitionInterface
Returns the minimum number of values the user is allowed to select.

Specified by:
getMinimumValueCount in interface SelectableDefinitionInterface
Returns:
the minimum number of values the user is allowed to select

getSelectionType

public int getSelectionType()
Description copied from interface: SelectableDefinitionInterface
Returns the type of selection that the prompt supports. SINGLE_SELECTION indicates that the user will only be able to select 1 value at a time. MULTIPLE_SELECTION indicates that the user will be able to select multiple values (subject to the maximum value count). ORDERED_MULTIPLE_SELECTION indicates that the user will be able to select multiple values (subject to the maximum value count) and that they will be able to reorder the selected values.

Specified by:
getSelectionType in interface SelectableDefinitionInterface
Returns:
An integer corresponding to SINGLE_SELECTION, MULTIPLE_SELECTION, ORDERED_MULTIPLE_SELECTION

isSelectionOrdered

public boolean isSelectionOrdered()
Description copied from interface: SelectableDefinitionInterface
Returns whether the values the user selects should be ordered.

Specified by:
isSelectionOrdered in interface SelectableDefinitionInterface
Returns:
whether the values the user selects should be ordered.

setMaximumValueCount

public void setMaximumValueCount(int maximumValueCount)
Description copied from interface: MutableSelectableDefinitionInterface
Sets the maximum number of valid values for a prompt.

Specified by:
setMaximumValueCount in interface MutableSelectableDefinitionInterface
Parameters:
maximumValueCount - the maximum number of valid values for a prompt.

setMinimumValueCount

public void setMinimumValueCount(int minimumValueCount)
Description copied from interface: MutableSelectableDefinitionInterface
Sets the minimum number of valid values for a prompt.

Specified by:
setMinimumValueCount in interface MutableSelectableDefinitionInterface
Parameters:
minimumValueCount - the minimum number of valid values for a prompt.

setSelectionOrdered

public void setSelectionOrdered(boolean selectionOrdered)
Description copied from interface: MutableSelectableDefinitionInterface
Sets whether the order in which values are selected should be retained.

Specified by:
setSelectionOrdered in interface MutableSelectableDefinitionInterface
Parameters:
selectionOrdered - whether the order in which values are selected should be retained.

configureAttributes

public void configureAttributes(java.util.Map<java.lang.String,?> options,
                                java.util.Map<java.lang.String,?> context)
Specified by:
configureAttributes in interface com.sas.util.AttributeConfigurationInterface
Overrides:
configureAttributes in class PromptDefinition

getAttributeDescriptors

public java.util.List getAttributeDescriptors(java.util.Locale locale)
Specified by:
getAttributeDescriptors in interface com.sas.util.AttributeDescription
Overrides:
getAttributeDescriptors in class PromptDefinition

getConstraints

protected java.util.Map<java.lang.String,java.lang.String> getConstraints(java.util.Locale locale)
Overrides:
getConstraints in class PromptDefinition

validIndividualValue

public boolean validIndividualValue(java.lang.Object value,
                                    java.util.Locale locale)



Copyright © 2009 SAS Institute Inc. All Rights Reserved.