INTEGRATION: CWS dba24b (1.18.28); FILE MERGED

2007/08/28 13:26:46 fs 1.18.28.4: authentication information now available at the data source meta data
2007/08/27 20:31:00 fs 1.18.28.3: #i80930# fillDetailIds renamed to getSupportedIndirectSettings + now partly based on DataSourceUI, to avoid duplicated hard-coded data
2007/08/27 13:30:35 fs 1.18.28.2: #i80930# allow for no detail ids (fillDetailids)
2007/08/27 10:45:06 fs 1.18.28.1: re-factoring for #i80930#: made getDataSourceType static
This commit is contained in:
Jens-Heiner Rechtien 2007-11-01 14:06:03 +00:00
parent d6e47a21e9
commit 1b676a065b

View file

@ -4,9 +4,9 @@
* *
* $RCSfile: DbAdminImpl.cxx,v $ * $RCSfile: DbAdminImpl.cxx,v $
* *
* $Revision: 1.18 $ * $Revision: 1.19 $
* *
* last change: $Author: rt $ $Date: 2007-07-06 08:11:06 $ * last change: $Author: hr $ $Date: 2007-11-01 15:06:03 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@ -36,9 +36,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove // MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_dbaccess.hxx" #include "precompiled_dbaccess.hxx"
#ifndef _DBAUI_DBADMINIMPL_HXX_
#include "DbAdminImpl.hxx" #include "DbAdminImpl.hxx"
#endif #include "dsmeta.hxx"
#ifndef _SFXPOOLITEM_HXX #ifndef _SFXPOOLITEM_HXX
#include <svtools/poolitem.hxx> #include <svtools/poolitem.hxx>
#endif #endif
@ -232,6 +232,7 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_AUTORETRIEVEENABLED, INFO_AUTORETRIEVEENABLED)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_AUTORETRIEVEENABLED, INFO_AUTORETRIEVEENABLED));
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_APPEND_TABLE_ALIAS, INFO_APPEND_TABLE_ALIAS)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_APPEND_TABLE_ALIAS, INFO_APPEND_TABLE_ALIAS));
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_AS_BEFORE_CORRNAME, INFO_AS_BEFORE_CORRELATION_NAME ) ); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_AS_BEFORE_CORRNAME, INFO_AS_BEFORE_CORRELATION_NAME ) );
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CHECK_REQUIRED_FIELDS, INFO_FORMS_CHECK_REQUIRED_FIELDS ) );
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_PARAMETERNAMESUBST, INFO_PARAMETERNAMESUBST)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_PARAMETERNAMESUBST, INFO_PARAMETERNAMESUBST));
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_IGNOREDRIVER_PRIV, INFO_IGNOREDRIVER_PRIV)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_IGNOREDRIVER_PRIV, INFO_IGNOREDRIVER_PRIV));
m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_BOOLEANCOMPARISON, PROPERTY_BOOLEANCOMPARISONMODE)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_BOOLEANCOMPARISON, PROPERTY_BOOLEANCOMPARISONMODE));
@ -470,23 +471,27 @@ Reference< XPropertySet > ODbDataSourceAdministrationHelper::getCurrentDataSourc
return m_xDatasource; return m_xDatasource;
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
DATASOURCE_TYPE ODbDataSourceAdministrationHelper::getDatasourceType(const SfxItemSet& _rSet) const DATASOURCE_TYPE ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet )
{ {
SFX_ITEMSET_GET(_rSet, pConnectURL, SfxStringItem, DSID_CONNECTURL, sal_True); SFX_ITEMSET_GET( _rSet, pConnectURL, SfxStringItem, DSID_CONNECTURL, sal_True );
SFX_ITEMSET_GET(_rSet, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); SFX_ITEMSET_GET( _rSet, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True );
DBG_ASSERT(pConnectURL && pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); DBG_ASSERT( pConnectURL && pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" );
if ( !pConnectURL || !pTypeCollection )
return DST_UNKNOWN;
String sConnectURL = pConnectURL->GetValue(); String sConnectURL = pConnectURL->GetValue();
ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); ODsnTypeCollection* pCollection = pTypeCollection->getCollection();
DBG_ASSERT(pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!"); DBG_ASSERT( pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!" );
return pCollection->getType(sConnectURL); if ( !pCollection )
return DST_UNKNOWN;
return pCollection->getType( sConnectURL );
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
sal_Bool ODbDataSourceAdministrationHelper::hasAuthentication(const SfxItemSet& _rSet) const sal_Bool ODbDataSourceAdministrationHelper::hasAuthentication(const SfxItemSet& _rSet) const
{ {
DATASOURCE_TYPE eType = getDatasourceType(_rSet); return DataSourceMetaData::getAuthentication( getDatasourceType( _rSet ) ) != AuthNone;
SFX_ITEMSET_GET(_rSet, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True);
return pTypeCollection->getCollection()->hasAuthentication(eType);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
String ODbDataSourceAdministrationHelper::getConnectionURL() const String ODbDataSourceAdministrationHelper::getConnectionURL() const
@ -764,9 +769,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
// first determine which of all the items are relevant for the data source (depends on the connection url) // first determine which of all the items are relevant for the data source (depends on the connection url)
DATASOURCE_TYPE eType = getDatasourceType(_rSource); DATASOURCE_TYPE eType = getDatasourceType(_rSource);
::std::vector< sal_Int32> aDetailIds; ::std::vector< sal_Int32> aDetailIds;
ODriversSettings::fillDetailIds(eType,aDetailIds); ODriversSettings::getSupportedIndirectSettings(eType,aDetailIds);
DBG_ASSERT(!aDetailIds.empty(), "ODbDataSourceAdministrationHelper::fillDatasourceInfo: invalid item ids got from the page!");
// collect the translated property values for the relevant items // collect the translated property values for the relevant items
PropertyValueSet aRelevantSettings; PropertyValueSet aRelevantSettings;