LibreOffice Module connectivity (master) 1
|
manages the filter of a database component with filter properties More...
#include <filtermanager.hxx>
Public Types | |
enum class | FilterComponent { PublicFilter , LinkFilter , PublicHaving , LinkHaving } |
Public Member Functions | |
FilterManager () | |
ctor More... | |
void | initialize (const css::uno::Reference< css::beans::XPropertySet > &_rxComponentAggregate) |
late ctor More... | |
void | dispose () |
makes the object forgetting the references to the database component More... | |
const OUString & | getFilterComponent (FilterComponent _eWhich) const |
void | setFilterComponent (FilterComponent _eWhich, const OUString &_rComponent) |
bool | isApplyPublicFilter () const |
void | setApplyPublicFilter (bool _bApply) |
Private Member Functions | |
OUString | getComposedFilter () const |
retrieves a filter which is a conjunction of all single filter components More... | |
OUString | getComposedHaving () const |
bool | isThereAtMostOneFilterComponent (OUString &o_singleComponent) const |
checks whether there is only one (or even no) non-empty filter component More... | |
bool | isThereAtMostOneHavingComponent (OUString &o_singleComponent) const |
Static Private Member Functions | |
static void | appendFilterComponent (OUStringBuffer &io_appendTo, std::u16string_view i_component) |
appends one filter component to the statement in our composer More... | |
Private Attributes | |
css::uno::Reference< css::beans::XPropertySet > | m_xComponentAggregate |
OUString | m_aPublicFilterComponent |
OUString | m_aPublicHavingComponent |
OUString | m_aLinkFilterComponent |
OUString | m_aLinkHavingComponent |
bool | m_bApplyPublicFilter |
manages the filter of a database component with filter properties
The idea is that the filter which a database component actually really uses is composed of several single filter components (which all are conjunctive).
First, there is a component which is visible to the clients of the database component itself - if they ask the database component for the Filter property, they will get this public filter.
Second, there is an implicit filter, which is (to be) created from the MasterFields and DetailFields property of the database component, if the latter denote columns.
For instance, if there is a link-pair CustomerID->cid, where |CustomerID| is a column of the master database component, and |cid| is a column of the detail database component (the database component we're responsible for), then there will be an implicit filter "cid = :param_cid_link" (or something like this), which is never visible to the clients of the database component, but nevertheless needs to be propagated to the aggregated RowSet.
Actually, this implicit filter is maintained by the FormParameterManager.
Potentially, there could be more filter components (for instance, you could imagine database component controls which act as live filter, which could be implemented with a third component), but at the moment there are only these two.
Definition at line 57 of file filtermanager.hxx.
|
strong |
Enumerator | |
---|---|
PublicFilter | |
LinkFilter | |
PublicHaving | |
LinkHaving |
Definition at line 60 of file filtermanager.hxx.
|
explicit |
ctor
Definition at line 40 of file filtermanager.cxx.
|
staticprivate |
appends one filter component to the statement in our composer
Definition at line 155 of file filtermanager.cxx.
Referenced by getComposedFilter(), and getComposedHaving().
void dbtools::FilterManager::dispose | ( | void | ) |
makes the object forgetting the references to the database component
Definition at line 56 of file filtermanager.cxx.
References m_xComponentAggregate.
|
private |
retrieves a filter which is a conjunction of all single filter components
Definition at line 217 of file filtermanager.cxx.
References appendFilterComponent(), isThereAtMostOneFilterComponent(), m_aLinkFilterComponent, m_aPublicFilterComponent, and m_bApplyPublicFilter.
Referenced by setApplyPublicFilter(), and setFilterComponent().
|
private |
Definition at line 234 of file filtermanager.cxx.
References appendFilterComponent(), isThereAtMostOneHavingComponent(), m_aLinkHavingComponent, m_aPublicHavingComponent, and m_bApplyPublicFilter.
Referenced by setApplyPublicFilter(), and setFilterComponent().
const OUString & dbtools::FilterManager::getFilterComponent | ( | FilterComponent | _eWhich | ) | const |
Definition at line 62 of file filtermanager.cxx.
References LinkFilter, LinkHaving, m_aLinkFilterComponent, m_aLinkHavingComponent, m_aPublicFilterComponent, m_aPublicHavingComponent, PublicFilter, and PublicHaving.
Referenced by setApplyPublicFilter().
void dbtools::FilterManager::initialize | ( | const css::uno::Reference< css::beans::XPropertySet > & | _rxComponentAggregate | ) |
late ctor
Definition at line 46 of file filtermanager.cxx.
References Any, connectivity::OMetaConnection::getPropMap(), m_xComponentAggregate, and PROPERTY_ID_APPLYFILTER.
|
inline |
Definition at line 90 of file filtermanager.hxx.
|
private |
checks whether there is only one (or even no) non-empty filter component
Definition at line 170 of file filtermanager.cxx.
References m_aLinkFilterComponent, m_aPublicFilterComponent, and m_bApplyPublicFilter.
Referenced by getComposedFilter().
|
private |
Definition at line 193 of file filtermanager.cxx.
References m_aLinkHavingComponent, m_aPublicHavingComponent, and m_bApplyPublicFilter.
Referenced by getComposedHaving().
void dbtools::FilterManager::setApplyPublicFilter | ( | bool | _bApply | ) |
Definition at line 130 of file filtermanager.cxx.
References Any, DBG_UNHANDLED_EXCEPTION, Exception, getComposedFilter(), getComposedHaving(), getFilterComponent(), connectivity::OMetaConnection::getPropMap(), m_bApplyPublicFilter, m_xComponentAggregate, PROPERTY_ID_FILTER, PROPERTY_ID_HAVINGCLAUSE, PublicFilter, and PublicHaving.
void dbtools::FilterManager::setFilterComponent | ( | FilterComponent | _eWhich, |
const OUString & | _rComponent | ||
) |
Definition at line 82 of file filtermanager.cxx.
References Any, DBG_UNHANDLED_EXCEPTION, Exception, getComposedFilter(), getComposedHaving(), connectivity::OMetaConnection::getPropMap(), LinkFilter, LinkHaving, m_aLinkFilterComponent, m_aLinkHavingComponent, m_aPublicFilterComponent, m_aPublicHavingComponent, m_bApplyPublicFilter, m_xComponentAggregate, PROPERTY_ID_FILTER, PROPERTY_ID_HAVINGCLAUSE, PublicFilter, and PublicHaving.
Referenced by dbtools::ParameterManager::analyzeFieldLinks().
|
private |
Definition at line 73 of file filtermanager.hxx.
Referenced by getComposedFilter(), getFilterComponent(), isThereAtMostOneFilterComponent(), and setFilterComponent().
|
private |
Definition at line 74 of file filtermanager.hxx.
Referenced by getComposedHaving(), getFilterComponent(), isThereAtMostOneHavingComponent(), and setFilterComponent().
|
private |
Definition at line 71 of file filtermanager.hxx.
Referenced by getComposedFilter(), getFilterComponent(), isThereAtMostOneFilterComponent(), and setFilterComponent().
|
private |
Definition at line 72 of file filtermanager.hxx.
Referenced by getComposedHaving(), getFilterComponent(), isThereAtMostOneHavingComponent(), and setFilterComponent().
|
private |
Definition at line 75 of file filtermanager.hxx.
Referenced by getComposedFilter(), getComposedHaving(), isThereAtMostOneFilterComponent(), isThereAtMostOneHavingComponent(), setApplyPublicFilter(), and setFilterComponent().
|
private |
Definition at line 70 of file filtermanager.hxx.
Referenced by dispose(), initialize(), setApplyPublicFilter(), and setFilterComponent().