com.sas.dataselectors.filters
Class BusinessQueryToAdvancedFilterModelAdapter

com.sas.dataselectors.filters.BusinessQueryToAdvancedFilterModelAdapter
All Implemented Interfaces:
AdvancedFilterDefinitionModelInterface, AdvancedFilterModelInterface, PersistentFilterProviderModelInterface, com.sas.dataselectors.filters.PromptValueProviderModelInterface, com.sas.dataselectors.filters.SearchValueProviderModelInterface, SimpleFilterDefinitionModelInterface, SimpleFilterListEditorModelInterface, com.sas.dataselectors.filters.SystemVariableProviderInterface

public class BusinessQueryToAdvancedFilterModelAdapter

This adapter is intended for use at run-time or anytime a full BusinessQuery model is to be filtered.


Field Summary
 
Fields inherited from class com.sas.dataselectors.filters.DefaultAdvancedFilterModelAdapter
_businessModel, _businessQuery, _expressionValueEditor, _filterDescription, _filterItemEditor, _filterLabel, _filterObjectFactory, _filterQualifierEditor, _initialFilterObject, _locale, _logicTree, _newFilter, _promptMap, _promptValueEditor, _revertToFilterObject, _systemVariableMap, environment, rootFilterObject
 
Fields inherited from class com.sas.dataselectors.filters.SimpleFilterListEditorModelBase
_adapter, _filterLogicList, _selectionIndex, _selectionModel
 
Constructor Summary
BusinessQueryToAdvancedFilterModelAdapter()
          Constructs an adapter without an input model.
BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery)
          Constructs a new adapter from the given model.
BusinessQueryToAdvancedFilterModelAdapter(com.sas.storage.iquery.BusinessQueryAdapter adapter)
          Constructs a new filter adapter using the model embedded in the supplied BusinessQueryAdapter.
BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery, int environment)
          Constructs a new adapter from the given model.
BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery, java.lang.Object initialFilter)
          Constructs a new adapter from the given model and uses the specified object for the source of the filter to create or modify.
BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery, java.lang.Object initialFilter, int environment)
          Constructs a new adapter from the given model and uses the specified object for the source of the filter to create or modify.
BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery, java.lang.Object initialFilter, java.util.Locale locale)
          Constructs a new adapter from the given model and uses the specified object for the source of the filter to create or modify.
BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.intelligentquery.BusinessQueryProviderInterface bqProvider)
          Constructs a new filter adapter using the model provided by the given provider.
 
Method Summary
protected  java.lang.String getFilterQualifierSkipID(java.lang.Object nativeItem)
          Returns the identifier for the given native object that the filter qualifier editor will expect to receive to properly display and function.
 java.lang.Object getRootFilterObject()
          Returns the root filter object in the native model.
protected  boolean isFilterImportable(java.util.List testNodeList)
           
 boolean isValidFilter(FilterLogicTestNodeInterface testNode)
          Attempts to validate the filter represented by the given test node.
 
Methods inherited from class com.sas.dataselectors.filters.DefaultAdvancedFilterModelAdapter
addSelection, applyExpressionValueEditorChanges, applyFilterDescription, applyFilterItemEditorChanges, applyFilterLabel, applyFilterQualifierEditorChanges, applyFilterQualifierEditorChanges, applyPromptValueEditorChanges, applyPromptValueEditorChanges, cancel, clear, clear, commitChanges, getBaseModel, getBusinessModel, getBusinessQuery, getEnvironment, getExpressionValueEditor, getFilterableStep, getFilterDescription, getFilterItemAttributeType, getFilterItemEditor, getFilterItemSQLType, getFilterLabel, getFilterObjectFactory, getFilterQualifierEditor, getLocale, getMaxOutputObservations, getPersistentFilterList, getPromptedValueByName, getPromptRangeValueList, getPromptValueEditor, getPromptValueList, getPromptValueMap, getSelectionTree, getSelectionTree, getSharedPromptSelector, getSystemVariableValueList, getValueProvider, isCascadable, isCascadingPrompts, isEditedExpressionValue, isEnforcingPromptCascades, isFilterImportable, isOLAP, isPromptedRangeValue, isPromptedValue, isPromptMultipleSelection, isQuotedValue, isSystemVariableValue, isUserCreatedValue, isValidPromptType, refreshPromptValueMap, removeSelection, setApplicationData, setBusinessModel, setBusinessQuery, setEnforcePromptCascades, setEnvironment, setExpressionValueEditor, setExpressionValueEditorInfo, setFilterDescription, setFilterItemEditor, setFilterItemEditorInfo, setFilterLabel, setFilterObjectFactory, setFilterQualifierEditor, setFilterQualifierEditorInfo, setLocale, setMaxOutputObservations, setModel, setModel, setPromptValueEditor, setPromptValueEditorInfo, setPromptValueEditorInfo, setPromptValueEditorInfo, setSelection, setSelectionCursor, setSharedPromptSelector
 
Methods inherited from class com.sas.dataselectors.filters.SimpleFilterListEditorModelBase
getApplicationData, getChangableSelectionModel, getDataSource, getFilterLogicList, getSelection, getSelectionCount, getSelectionCursor, setAdapter
 
Methods inherited from interface com.sas.dataselectors.filters.AdvancedFilterModelInterface
getFilterLogicList, getSelectionCount, getSelectionCursor
 
Methods inherited from interface com.sas.dataselectors.filters.SimpleFilterDefinitionModelInterface
getApplicationData, getDataSource, getSelection
 

Constructor Detail

BusinessQueryToAdvancedFilterModelAdapter

public BusinessQueryToAdvancedFilterModelAdapter()
Constructs an adapter without an input model.


BusinessQueryToAdvancedFilterModelAdapter

public BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery)
Constructs a new adapter from the given model.

Parameters:
businessQuery - the native model

BusinessQueryToAdvancedFilterModelAdapter

public BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery,
                                                 int environment)
Constructs a new adapter from the given model.

Parameters:
businessQuery - the native model
environment - the operating environment (e.g. Swing,JSP)

BusinessQueryToAdvancedFilterModelAdapter

public BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery,
                                                 java.lang.Object initialFilter)
Constructs a new adapter from the given model and uses the specified object for the source of the filter to create or modify.

Parameters:
businessQuery - the native model
initialFilter - the source of the filter to edit

BusinessQueryToAdvancedFilterModelAdapter

public BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery,
                                                 java.lang.Object initialFilter,
                                                 java.util.Locale locale)
Constructs a new adapter from the given model and uses the specified object for the source of the filter to create or modify.

Parameters:
businessQuery - the native model
initialFilter - the source of the filter to edit
locale - the Locale to use to format values

BusinessQueryToAdvancedFilterModelAdapter

public BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.metadata.business.BusinessQuery businessQuery,
                                                 java.lang.Object initialFilter,
                                                 int environment)
Constructs a new adapter from the given model and uses the specified object for the source of the filter to create or modify.

Parameters:
businessQuery - the native model
initialFilter - the source of the filter to edit
environment - the operating environment (e.g. Swing,JSP)

BusinessQueryToAdvancedFilterModelAdapter

public BusinessQueryToAdvancedFilterModelAdapter(com.sas.storage.iquery.BusinessQueryAdapter adapter)
Constructs a new filter adapter using the model embedded in the supplied BusinessQueryAdapter.

Parameters:
adapter - the adapter holding the BusinessQuery model

BusinessQueryToAdvancedFilterModelAdapter

public BusinessQueryToAdvancedFilterModelAdapter(com.sas.iquery.intelligentquery.BusinessQueryProviderInterface bqProvider)
Constructs a new filter adapter using the model provided by the given provider.

Parameters:
bqProvider - the provider holding the BusinessQuery adapter
Method Detail

getFilterQualifierSkipID

protected java.lang.String getFilterQualifierSkipID(java.lang.Object nativeItem)
                                             throws FilterException
Returns the identifier for the given native object that the filter qualifier editor will expect to receive to properly display and function. The native object should be the object wrapped in the currently selected filter item.

Overrides:
getFilterQualifierSkipID in class DefaultAdvancedFilterModelAdapter
Parameters:
nativeItem - the item to process
Returns:
the identifier for the qualifier editor
Throws:
FilterException - for any errors encountered while deriving the identifier

getRootFilterObject

public java.lang.Object getRootFilterObject()
Description copied from class: DefaultAdvancedFilterModelAdapter
Returns the root filter object in the native model.

Specified by:
getRootFilterObject in interface SimpleFilterDefinitionModelInterface
Overrides:
getRootFilterObject in class DefaultAdvancedFilterModelAdapter
Returns:
the root filter object (a single filter item or a List)

isValidFilter

public boolean isValidFilter(FilterLogicTestNodeInterface testNode)
                      throws FilterException
Attempts to validate the filter represented by the given test node. The return value will be TRUE if the test succeeds and FALSE otherwise. Any errors that occur during the validation will be rethrown as a FilterException.

Specified by:
isValidFilter in interface AdvancedFilterModelInterface
Overrides:
isValidFilter in class DefaultAdvancedFilterModelAdapter
Parameters:
testNode - the test node representing the filter to validate
Returns:
TRUE if the filter is valid, FALSE otherwise
Throws:
FilterException - as a wrapper for any errors encountered while testing the filter

isFilterImportable

protected boolean isFilterImportable(java.util.List testNodeList)
Overrides:
isFilterImportable in class DefaultAdvancedFilterModelAdapter
Parameters:
testNodeList - the list of test nodes representing the candidate filter
Returns:
true if the filter is importable after examining the given list of test nodes, false otherwise



Copyright © 2009 SAS Institute Inc. All Rights Reserved.