2000-09-18 23:16:46 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-08 12:28:51 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
2005-09-08 12:28:51 +00:00
|
|
|
* $RCSfile: datasource.cxx,v $
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
2006-01-25 12:44:20 +00:00
|
|
|
* $Revision: 1.66 $
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
2006-01-25 12:44:20 +00:00
|
|
|
* last change: $Author: hr $ $Date: 2006-01-25 13:44:20 $
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
2005-09-08 12:28:51 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-08 12:28:51 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
2005-09-08 12:28:51 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
2005-09-08 12:28:51 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
2005-09-08 12:28:51 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 23:16:46 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _DBA_COREDATAACCESS_DATASOURCE_HXX_
|
|
|
|
#include "datasource.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBA_CORE_USERINFORMATION_HXX_
|
|
|
|
#include "userinformation.hxx"
|
|
|
|
#endif
|
2004-08-02 14:09:24 +00:00
|
|
|
#ifndef _DBA_COREDATAACCESS_COMMANDCONTAINER_HXX_
|
|
|
|
#include "commandcontainer.hxx"
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
#ifndef _TOOLS_DEBUG_HXX
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#endif
|
2005-12-21 12:35:18 +00:00
|
|
|
#ifndef TOOLS_DIAGNOSE_EX_H
|
|
|
|
#include <tools/diagnose_ex.h>
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
|
|
|
|
#include <cppuhelper/typeprovider.hxx>
|
|
|
|
#endif
|
2001-08-30 06:59:18 +00:00
|
|
|
#ifndef _COMPHELPER_SEQSTREAM_HXX
|
|
|
|
#include <comphelper/seqstream.hxx>
|
|
|
|
#endif
|
2000-10-25 06:42:28 +00:00
|
|
|
#ifndef DBACCESS_SHARED_DBASTRINGS_HRC
|
|
|
|
#include "dbastrings.hrc"
|
2000-09-18 23:16:46 +00:00
|
|
|
#endif
|
2001-08-28 14:59:32 +00:00
|
|
|
#ifndef _DBA_CORE_RESOURCE_HXX_
|
|
|
|
#include "core_resource.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _DBA_CORE_RESOURCE_HRC_
|
|
|
|
#include "core_resource.hrc"
|
|
|
|
#endif
|
2000-10-11 10:21:40 +00:00
|
|
|
#ifndef _COMPHELPER_SEQUENCE_HXX_
|
|
|
|
#include <comphelper/sequence.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
#endif
|
2000-10-11 10:21:40 +00:00
|
|
|
#ifndef _COMPHELPER_PROPERTY_HXX_
|
|
|
|
#include <comphelper/property.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
#endif
|
2001-03-15 07:29:16 +00:00
|
|
|
#ifndef _COMPHELPER_EXTRACT_HXX_
|
|
|
|
#include <comphelper/extract.hxx>
|
2000-09-18 23:16:46 +00:00
|
|
|
#endif
|
2001-08-28 14:59:32 +00:00
|
|
|
#ifndef _COM_SUN_STAR_SDBC_XDRIVERACCESS_HPP_
|
|
|
|
#include <com/sun/star/sdbc/XDriverAccess.hpp>
|
|
|
|
#endif
|
2000-09-18 23:16:46 +00:00
|
|
|
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
|
|
|
|
#include <com/sun/star/lang/DisposedException.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_SDBC_XDRIVERMANAGER_HPP_
|
|
|
|
#include <com/sun/star/sdbc/XDriverManager.hpp>
|
|
|
|
#endif
|
2000-12-12 11:20:31 +00:00
|
|
|
#ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
|
|
|
|
#endif
|
2000-11-08 15:05:02 +00:00
|
|
|
#ifndef _COM_SUN_STAR_UCB_XINTERACTIONSUPPLYAUTHENTICATION_HPP_
|
|
|
|
#include <com/sun/star/ucb/XInteractionSupplyAuthentication.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_UCB_AUTHENTICATIONREQUEST_HPP_
|
|
|
|
#include <com/sun/star/ucb/AuthenticationRequest.hpp>
|
|
|
|
#endif
|
2002-08-12 07:54:24 +00:00
|
|
|
#ifndef _COM_SUN_STAR_REFLECTION_XPROXYFACTORY_HPP_
|
|
|
|
#include <com/sun/star/reflection/XProxyFactory.hpp>
|
|
|
|
#endif
|
2000-10-13 15:00:03 +00:00
|
|
|
#ifndef _TYPELIB_TYPEDESCRIPTION_HXX_
|
|
|
|
#include <typelib/typedescription.hxx>
|
|
|
|
#endif
|
2000-11-06 16:48:22 +00:00
|
|
|
#ifndef _DBHELPER_DBEXCEPTION_HXX_
|
|
|
|
#include <connectivity/dbexception.hxx>
|
|
|
|
#endif
|
2000-11-08 15:05:02 +00:00
|
|
|
#ifndef _COMPHELPER_INTERACTION_HXX_
|
|
|
|
#include <comphelper/interaction.hxx>
|
|
|
|
#endif
|
2000-10-18 15:16:39 +00:00
|
|
|
#ifndef _DBA_CORE_CONNECTION_HXX_
|
|
|
|
#include "connection.hxx"
|
2000-09-18 23:16:46 +00:00
|
|
|
#endif
|
2001-05-17 08:09:05 +00:00
|
|
|
#ifndef _COMPHELPER_GUARDING_HXX_
|
|
|
|
#include <comphelper/guarding.hxx>
|
|
|
|
#endif
|
2002-08-12 07:54:24 +00:00
|
|
|
#ifndef DBA_CORE_SHARED_CONNECTION_HXX
|
|
|
|
#include "SharedConnection.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef _RTL_DIGEST_H_
|
|
|
|
#include <rtl/digest.h>
|
|
|
|
#endif
|
2004-08-02 14:09:24 +00:00
|
|
|
#ifndef _COM_SUN_STAR_EMBED_XTRANSACTEDOBJECT_HPP_
|
|
|
|
#include <com/sun/star/embed/XTransactedObject.hpp>
|
|
|
|
#endif
|
2005-07-08 09:36:39 +00:00
|
|
|
#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTSUBSTORAGESUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
|
|
|
|
#endif
|
2005-03-10 15:34:20 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/document/XEventBroadcaster.hpp>
|
|
|
|
#include <com/sun/star/view/XPrintable.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
|
|
|
|
|
2001-11-01 15:45:25 +00:00
|
|
|
#include <algorithm>
|
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
using namespace ::com::sun::star::sdbc;
|
2000-12-12 11:20:31 +00:00
|
|
|
using namespace ::com::sun::star::sdbcx;
|
2000-09-18 23:16:46 +00:00
|
|
|
using namespace ::com::sun::star::sdb;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::lang;
|
2004-08-02 14:09:24 +00:00
|
|
|
using namespace ::com::sun::star::embed;
|
2000-09-18 23:16:46 +00:00
|
|
|
using namespace ::com::sun::star::container;
|
|
|
|
using namespace ::com::sun::star::util;
|
|
|
|
using namespace ::com::sun::star::io;
|
2000-11-08 15:05:02 +00:00
|
|
|
using namespace ::com::sun::star::task;
|
|
|
|
using namespace ::com::sun::star::ucb;
|
2004-08-02 14:09:24 +00:00
|
|
|
using namespace ::com::sun::star::frame;
|
2002-08-12 07:54:24 +00:00
|
|
|
using namespace ::com::sun::star::reflection;
|
2000-09-18 23:16:46 +00:00
|
|
|
using namespace ::cppu;
|
|
|
|
using namespace ::osl;
|
|
|
|
using namespace ::vos;
|
2000-11-06 16:48:22 +00:00
|
|
|
using namespace ::dbtools;
|
2000-11-08 15:05:02 +00:00
|
|
|
using namespace ::comphelper;
|
2005-03-04 08:43:20 +00:00
|
|
|
namespace css = ::com::sun::star;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2000-10-18 15:16:39 +00:00
|
|
|
//........................................................................
|
|
|
|
namespace dbaccess
|
|
|
|
{
|
|
|
|
//........................................................................
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2005-10-24 07:28:36 +00:00
|
|
|
//============================================================
|
|
|
|
//= FlushNotificationAdapter
|
|
|
|
//============================================================
|
|
|
|
typedef ::cppu::WeakImplHelper1< XFlushListener > FlushNotificationAdapter_Base;
|
|
|
|
/** helper class which implements a XFlushListener, and forwards all
|
|
|
|
notification events to another XFlushListener
|
|
|
|
|
|
|
|
The speciality is that the foreign XFlushListener instance, to which
|
|
|
|
the notifications are forwarded, is held weak.
|
|
|
|
|
|
|
|
Thus, the class can be used with XFlushable instance which hold
|
|
|
|
their listeners with a hard reference, if you simply do not *want*
|
|
|
|
to be held hard-ref-wise.
|
|
|
|
*/
|
|
|
|
class FlushNotificationAdapter : public FlushNotificationAdapter_Base
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
WeakReference< XFlushable > m_aBroadcaster;
|
|
|
|
WeakReference< XFlushListener > m_aListener;
|
|
|
|
|
|
|
|
public:
|
|
|
|
static void installAdapter( const Reference< XFlushable >& _rxBroadcaster, const Reference< XFlushListener >& _rxListener )
|
|
|
|
{
|
|
|
|
Reference< XFlushListener > xAdapter( new FlushNotificationAdapter( _rxBroadcaster, _rxListener ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
FlushNotificationAdapter( const Reference< XFlushable >& _rxBroadcaster, const Reference< XFlushListener >& _rxListener );
|
|
|
|
~FlushNotificationAdapter();
|
|
|
|
|
|
|
|
void SAL_CALL impl_dispose( bool _bRevokeListener );
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// XFlushListener
|
|
|
|
virtual void SAL_CALL flushed( const ::com::sun::star::lang::EventObject& rEvent ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
// XEventListener
|
|
|
|
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
};
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
DBG_NAME( FlushNotificationAdapter )
|
|
|
|
//------------------------------------------------------------
|
|
|
|
FlushNotificationAdapter::FlushNotificationAdapter( const Reference< XFlushable >& _rxBroadcaster, const Reference< XFlushListener >& _rxListener )
|
|
|
|
:m_aBroadcaster( _rxBroadcaster )
|
|
|
|
,m_aListener( _rxListener )
|
|
|
|
{
|
|
|
|
DBG_CTOR( FlushNotificationAdapter, NULL );
|
|
|
|
DBG_ASSERT( _rxBroadcaster.is(), "FlushNotificationAdapter::FlushNotificationAdapter: invalid flushable!" );
|
|
|
|
|
|
|
|
osl_incrementInterlockedCount( &m_refCount );
|
|
|
|
{
|
|
|
|
if ( _rxBroadcaster.is() )
|
|
|
|
_rxBroadcaster->addFlushListener( this );
|
|
|
|
}
|
|
|
|
osl_decrementInterlockedCount( &m_refCount );
|
|
|
|
DBG_ASSERT( m_refCount == 1, "FlushNotificationAdapter::FlushNotificationAdapter: broadcaster isn't holding by hard ref!?" );
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------
|
|
|
|
FlushNotificationAdapter::~FlushNotificationAdapter()
|
|
|
|
{
|
|
|
|
DBG_DTOR( FlushNotificationAdapter, NULL );
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
void SAL_CALL FlushNotificationAdapter::impl_dispose( bool _bRevokeListener )
|
|
|
|
{
|
|
|
|
Reference< XFlushListener > xKeepAlive( this );
|
|
|
|
|
|
|
|
if ( _bRevokeListener )
|
|
|
|
{
|
|
|
|
Reference< XFlushable > xFlushable( m_aBroadcaster );
|
|
|
|
if ( xFlushable.is() )
|
|
|
|
xFlushable->removeFlushListener( this );
|
|
|
|
}
|
|
|
|
|
|
|
|
m_aListener = Reference< XFlushListener >();
|
|
|
|
m_aBroadcaster = Reference< XFlushable >();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
void SAL_CALL FlushNotificationAdapter::flushed( const EventObject& rEvent ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
Reference< XFlushListener > xListener( m_aListener );
|
|
|
|
if ( xListener.is() )
|
|
|
|
xListener->flushed( rEvent );
|
|
|
|
else
|
|
|
|
impl_dispose( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------
|
|
|
|
void SAL_CALL FlushNotificationAdapter::disposing( const EventObject& Source ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
DBG_ASSERT( Source.Source == m_aBroadcaster.get(), "FlushNotificationAdapter::disposing: where did this come from?" );
|
|
|
|
|
|
|
|
Reference< XFlushListener > xListener( m_aListener );
|
|
|
|
if ( xListener.is() )
|
|
|
|
xListener->disposing( Source );
|
|
|
|
|
|
|
|
impl_dispose( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================
|
|
|
|
//= OAuthenticationContinuation
|
|
|
|
//============================================================
|
2000-11-08 15:05:02 +00:00
|
|
|
class OAuthenticationContinuation : public OInteraction< XInteractionSupplyAuthentication >
|
|
|
|
{
|
|
|
|
sal_Bool m_bDatasourceReadonly : 1; // if sal_True, the data source using this continuation
|
|
|
|
// is readonly, which means that no user can be set and
|
|
|
|
// the password can't be remembered
|
|
|
|
sal_Bool m_bRemberPassword : 1; // remember the password for this session ?
|
|
|
|
|
|
|
|
::rtl::OUString m_sUser; // the user
|
|
|
|
::rtl::OUString m_sPassword; // the user's password
|
|
|
|
|
|
|
|
public:
|
2001-05-15 10:24:21 +00:00
|
|
|
OAuthenticationContinuation(sal_Bool _bReadOnlyDS = sal_False);
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
sal_Bool SAL_CALL canSetRealm( ) throw(RuntimeException);
|
|
|
|
void SAL_CALL setRealm( const ::rtl::OUString& Realm ) throw(RuntimeException);
|
|
|
|
sal_Bool SAL_CALL canSetUserName( ) throw(RuntimeException);
|
|
|
|
void SAL_CALL setUserName( const ::rtl::OUString& UserName ) throw(RuntimeException);
|
|
|
|
sal_Bool SAL_CALL canSetPassword( ) throw(RuntimeException);
|
|
|
|
void SAL_CALL setPassword( const ::rtl::OUString& Password ) throw(RuntimeException);
|
|
|
|
Sequence< RememberAuthentication > SAL_CALL getRememberPasswordModes( RememberAuthentication& Default ) throw(RuntimeException);
|
|
|
|
void SAL_CALL setRememberPassword( RememberAuthentication Remember ) throw(RuntimeException);
|
|
|
|
sal_Bool SAL_CALL canSetAccount( ) throw(RuntimeException);
|
|
|
|
void SAL_CALL setAccount( const ::rtl::OUString& Account ) throw(RuntimeException);
|
|
|
|
Sequence< RememberAuthentication > SAL_CALL getRememberAccountModes( RememberAuthentication& Default ) throw(RuntimeException);
|
|
|
|
void SAL_CALL setRememberAccount( RememberAuthentication Remember ) throw(RuntimeException);
|
2000-11-08 15:05:02 +00:00
|
|
|
|
|
|
|
::rtl::OUString getUser() const { return m_sUser; }
|
|
|
|
::rtl::OUString getPassword() const { return m_sPassword; }
|
|
|
|
sal_Bool getRememberPassword() const { return m_bRemberPassword; }
|
|
|
|
};
|
|
|
|
|
2001-05-15 10:24:21 +00:00
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
OAuthenticationContinuation::OAuthenticationContinuation(sal_Bool _bReadOnlyDS)
|
|
|
|
:m_bDatasourceReadonly(_bReadOnlyDS)
|
|
|
|
,m_bRemberPassword(sal_True) // TODO: a meaningfull default
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2000-11-08 15:05:02 +00:00
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OAuthenticationContinuation::canSetRealm( ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OAuthenticationContinuation::setRealm( const ::rtl::OUString& Realm ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
DBG_ERROR("OAuthenticationContinuation::setRealm: not supported!");
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OAuthenticationContinuation::canSetUserName( ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
return !m_bDatasourceReadonly;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OAuthenticationContinuation::setUserName( const ::rtl::OUString& _rUser ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
m_sUser = _rUser;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OAuthenticationContinuation::canSetPassword( ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OAuthenticationContinuation::setPassword( const ::rtl::OUString& _rPassword ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
m_sPassword = _rPassword;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
2000-11-21 13:09:35 +00:00
|
|
|
Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getRememberPasswordModes( RememberAuthentication& _reDefault ) throw(RuntimeException)
|
2000-11-08 15:05:02 +00:00
|
|
|
{
|
2000-11-21 13:09:35 +00:00
|
|
|
Sequence< RememberAuthentication > aReturn(1);
|
2001-02-27 07:44:41 +00:00
|
|
|
_reDefault = aReturn[0] = (m_bDatasourceReadonly ? RememberAuthentication_NO : RememberAuthentication_SESSION);
|
2000-11-21 13:09:35 +00:00
|
|
|
return aReturn;
|
2000-11-08 15:05:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OAuthenticationContinuation::setRememberPassword( RememberAuthentication _eRemember ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
m_bRemberPassword = (RememberAuthentication_NO != _eRemember);
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
sal_Bool SAL_CALL OAuthenticationContinuation::canSetAccount( ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
return sal_False;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OAuthenticationContinuation::setAccount( const ::rtl::OUString& ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
DBG_ERROR("OAuthenticationContinuation::setAccount: not supported!");
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
2000-11-21 12:44:03 +00:00
|
|
|
Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getRememberAccountModes( RememberAuthentication& _reDefault ) throw(RuntimeException)
|
2000-11-08 15:05:02 +00:00
|
|
|
{
|
|
|
|
Sequence < RememberAuthentication > aReturn(1);
|
|
|
|
aReturn[0] = RememberAuthentication_NO;
|
2000-11-21 12:44:03 +00:00
|
|
|
_reDefault = RememberAuthentication_NO;
|
2000-11-08 15:05:02 +00:00
|
|
|
return aReturn;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
void SAL_CALL OAuthenticationContinuation::setRememberAccount( RememberAuthentication Remember ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
DBG_ERROR("OAuthenticationContinuation::setRememberAccount: not supported!");
|
|
|
|
}
|
|
|
|
|
2002-08-12 07:54:24 +00:00
|
|
|
/** The class OSharedConnectionManager implements a structure to share connections.
|
|
|
|
It owns the master connections which will be disposed when the last connection proxy is gone.
|
|
|
|
*/
|
2002-08-12 08:21:59 +00:00
|
|
|
typedef ::cppu::WeakImplHelper1< XEventListener > OConnectionHelper_BASE;
|
2002-08-13 12:26:58 +00:00
|
|
|
// need to hold the digest
|
|
|
|
struct TDigestHolder
|
|
|
|
{
|
|
|
|
sal_uInt8 m_pBuffer[RTL_DIGEST_LENGTH_SHA1];
|
|
|
|
TDigestHolder()
|
|
|
|
{
|
|
|
|
m_pBuffer[0] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2002-08-12 08:21:59 +00:00
|
|
|
class OSharedConnectionManager : public OConnectionHelper_BASE
|
2002-08-12 07:54:24 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
// contains the currently used master connections
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Reference< XConnection > xMasterConnection;
|
|
|
|
oslInterlockedCount nALiveCount;
|
|
|
|
} TConnectionHolder;
|
|
|
|
|
|
|
|
// the less-compare functor, used for the stl::map
|
|
|
|
struct TDigestLess : public ::std::binary_function< TDigestHolder, TDigestHolder, bool>
|
|
|
|
{
|
|
|
|
bool operator() (const TDigestHolder& x, const TDigestHolder& y) const
|
|
|
|
{
|
|
|
|
sal_uInt32 i;
|
|
|
|
for(i=0;i < RTL_DIGEST_LENGTH_SHA1 && (x.m_pBuffer[i] >= y.m_pBuffer[i]); ++i)
|
|
|
|
;
|
|
|
|
return i < RTL_DIGEST_LENGTH_SHA1;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef ::std::map< TDigestHolder,TConnectionHolder,TDigestLess> TConnectionMap; // holds the master connections
|
|
|
|
typedef ::std::map< Reference< XConnection >,TConnectionMap::iterator> TSharedConnectionMap;// holds the shared connections
|
|
|
|
|
|
|
|
::osl::Mutex m_aMutex;
|
|
|
|
TConnectionMap m_aConnections; // remeber the master connection in conjunction with the digest
|
|
|
|
TSharedConnectionMap m_aSharedConnection; // the shared connections with conjunction with an iterator into the connections map
|
|
|
|
Reference< XProxyFactory > m_xProxyFactory;
|
|
|
|
|
|
|
|
protected:
|
2005-03-10 15:34:20 +00:00
|
|
|
~OSharedConnectionManager();
|
2002-08-12 07:54:24 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
OSharedConnectionManager(const Reference< XMultiServiceFactory >& _rxServiceFactory);
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException);
|
2002-08-12 07:54:24 +00:00
|
|
|
Reference<XConnection> getConnection( const rtl::OUString& url,
|
|
|
|
const rtl::OUString& user,
|
|
|
|
const rtl::OUString& password,
|
|
|
|
Sequence< PropertyValue >& _aInfo,
|
|
|
|
ODatabaseSource* _pDataSource);
|
|
|
|
void addEventListener(const Reference<XConnection>& _rxConnection,TConnectionMap::iterator& _rIter);
|
|
|
|
};
|
|
|
|
|
2004-08-02 14:09:24 +00:00
|
|
|
DBG_NAME(OSharedConnectionManager)
|
2002-08-12 07:54:24 +00:00
|
|
|
OSharedConnectionManager::OSharedConnectionManager(const Reference< XMultiServiceFactory >& _rxServiceFactory)
|
|
|
|
{
|
2004-08-02 14:09:24 +00:00
|
|
|
DBG_CTOR(OSharedConnectionManager,NULL);
|
|
|
|
m_xProxyFactory.set(_rxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),UNO_QUERY);
|
|
|
|
}
|
|
|
|
|
|
|
|
OSharedConnectionManager::~OSharedConnectionManager()
|
|
|
|
{
|
|
|
|
DBG_DTOR(OSharedConnectionManager,NULL);
|
2002-08-12 07:54:24 +00:00
|
|
|
}
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
void SAL_CALL OSharedConnectionManager::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException)
|
2002-08-12 07:54:24 +00:00
|
|
|
{
|
|
|
|
MutexGuard aGuard(m_aMutex);
|
|
|
|
Reference<XConnection> xConnection(Source.Source,UNO_QUERY);
|
|
|
|
TSharedConnectionMap::iterator aFind = m_aSharedConnection.find(xConnection);
|
|
|
|
if ( m_aSharedConnection.end() != aFind )
|
|
|
|
{
|
|
|
|
osl_decrementInterlockedCount(&aFind->second->second.nALiveCount);
|
|
|
|
if ( !aFind->second->second.nALiveCount )
|
|
|
|
{
|
|
|
|
::comphelper::disposeComponent(aFind->second->second.xMasterConnection);
|
|
|
|
m_aConnections.erase(aFind->second);
|
|
|
|
}
|
2005-03-23 08:46:37 +00:00
|
|
|
m_aSharedConnection.erase(aFind);
|
2002-08-12 07:54:24 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference<XConnection> OSharedConnectionManager::getConnection( const rtl::OUString& url,
|
|
|
|
const rtl::OUString& user,
|
|
|
|
const rtl::OUString& password,
|
|
|
|
Sequence< PropertyValue >& _aInfo,
|
|
|
|
ODatabaseSource* _pDataSource)
|
|
|
|
{
|
|
|
|
MutexGuard aGuard(m_aMutex);
|
|
|
|
TConnectionMap::key_type nId;
|
2002-08-21 09:27:46 +00:00
|
|
|
Sequence< PropertyValue > aInfoCopy(_aInfo);
|
|
|
|
sal_Int32 nPos = aInfoCopy.getLength();
|
|
|
|
aInfoCopy.realloc( nPos + 2 );
|
|
|
|
aInfoCopy[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableFilter"));
|
2005-03-10 15:34:20 +00:00
|
|
|
aInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableFilter;
|
2002-08-21 09:27:46 +00:00
|
|
|
aInfoCopy[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableTypeFilter"));
|
2005-03-10 15:34:20 +00:00
|
|
|
aInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableTypeFilter; // #22377# OJ
|
2002-08-21 09:27:46 +00:00
|
|
|
|
|
|
|
::rtl::OUString sUser = user;
|
|
|
|
::rtl::OUString sPassword = password;
|
2005-03-10 15:34:20 +00:00
|
|
|
if ((0 == sUser.getLength()) && (0 == sPassword.getLength()) && (0 != _pDataSource->m_pImpl->m_sUser.getLength()))
|
2002-08-21 09:27:46 +00:00
|
|
|
{ // ease the usage of this method. data source which are intended to have a user automatically
|
|
|
|
// fill in the user/password combination if the caller of this method does not specify otherwise
|
|
|
|
// 86951 - 05/08/2001 - frank.schoenheit@germany.sun.com
|
2005-03-10 15:34:20 +00:00
|
|
|
sUser = _pDataSource->m_pImpl->m_sUser;
|
|
|
|
if (0 != _pDataSource->m_pImpl->m_aPassword.getLength())
|
|
|
|
sPassword = _pDataSource->m_pImpl->m_aPassword;
|
2002-08-21 09:27:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
::connectivity::OConnectionWrapper::createUniqueId(url,aInfoCopy,nId.m_pBuffer,sUser,sPassword);
|
2002-08-12 07:54:24 +00:00
|
|
|
TConnectionMap::iterator aIter = m_aConnections.find(nId);
|
|
|
|
|
|
|
|
if ( m_aConnections.end() == aIter )
|
|
|
|
{
|
|
|
|
TConnectionHolder aHolder;
|
|
|
|
aHolder.nALiveCount = 0; // will be incremented by addListener
|
|
|
|
aHolder.xMasterConnection = _pDataSource->buildIsolatedConnection(user,password);
|
|
|
|
aIter = m_aConnections.insert(TConnectionMap::value_type(nId,aHolder)).first;
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference<XConnection> xRet;
|
|
|
|
if ( aIter->second.xMasterConnection.is() )
|
|
|
|
{
|
|
|
|
Reference< XAggregation > xConProxy = m_xProxyFactory->createProxy(aIter->second.xMasterConnection.get());
|
|
|
|
xRet = new OSharedConnection(xConProxy);
|
|
|
|
m_aSharedConnection.insert(TSharedConnectionMap::value_type(xRet,aIter));
|
|
|
|
addEventListener(xRet,aIter);
|
|
|
|
}
|
|
|
|
|
|
|
|
return xRet;
|
|
|
|
}
|
|
|
|
void OSharedConnectionManager::addEventListener(const Reference<XConnection>& _rxConnection,TConnectionMap::iterator& _rIter)
|
|
|
|
{
|
|
|
|
Reference<XComponent> xComp(_rxConnection,UNO_QUERY);
|
|
|
|
xComp->addEventListener(this);
|
|
|
|
OSL_ENSURE( m_aConnections.end() != _rIter , "Iterator is end!");
|
|
|
|
osl_incrementInterlockedCount(&_rIter->second.nALiveCount);
|
|
|
|
}
|
2002-08-12 08:21:59 +00:00
|
|
|
|
2004-08-02 14:09:24 +00:00
|
|
|
namespace
|
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
Sequence< PropertyValue > lcl_filterDriverProperties(const Reference< XDriver >& _xDriver,const ::rtl::OUString& _sUrl,const Sequence< PropertyValue >& _rDataSourceSettings)
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
|
|
|
if ( _xDriver.is() )
|
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
Sequence< DriverPropertyInfo > aDriverInfo(_xDriver->getPropertyInfo(_sUrl,_rDataSourceSettings));
|
|
|
|
const char* pKnownSettings[] = {
|
|
|
|
// known JDBC settings
|
|
|
|
"JavaDriverClass",
|
|
|
|
// known settings for file-based drivers
|
|
|
|
"Extension", "CharSet", "HeaderLine",
|
|
|
|
"FieldDelimiter", "StringDelimiter", "DecimalDelimiter",
|
|
|
|
"ThousandDelimiter", "ShowDeleted",
|
|
|
|
// known ODBC settings
|
|
|
|
"SystemDriverSettings", "UseCatalog",
|
|
|
|
// settings related to auto increment handling
|
|
|
|
"AutoIncrementCreation", "AutoRetrievingStatement", "IsAutoRetrievingEnabled",
|
|
|
|
// known Adabas driver setting
|
|
|
|
"ShutdownDatabase", "DataCacheSizeIncrement", "DataCacheSize",
|
|
|
|
"ControlUser", "ControlPassword",
|
|
|
|
// known LDAP driver settings
|
|
|
|
"HostName", "PortNumber", "BaseDN", "MaxRowCount"
|
|
|
|
// misc known driver settings
|
|
|
|
"ParameterNameSubstitution", "AddIndexAppendix",
|
|
|
|
// known SDB level settings
|
|
|
|
"IgnoreDriverPrivileges", "NoNameLengthLimit", "AppendTableAliasName",
|
|
|
|
"EnableSQL92Check", "BooleanComparisonMode", "TableTypeFilterMode",
|
|
|
|
"RespectDriverResultSetType", "UseSchemaInSelect", "UseCatalogInSelect"
|
2004-08-02 14:09:24 +00:00
|
|
|
};
|
2005-03-10 15:34:20 +00:00
|
|
|
sal_Int32 nKnownSettings = sizeof(pKnownSettings) / sizeof(pKnownSettings[0]);
|
2004-08-02 14:09:24 +00:00
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
const PropertyValue* pDataSourceSetting = _rDataSourceSettings.getConstArray();
|
|
|
|
const PropertyValue* pEnd = pDataSourceSetting + _rDataSourceSettings.getLength();
|
2004-08-02 14:09:24 +00:00
|
|
|
|
|
|
|
::std::vector< PropertyValue > aRet;
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
for ( ; pDataSourceSetting != pEnd ; ++pDataSourceSetting )
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
sal_Bool bAllowSetting = sal_False;
|
2004-08-02 14:09:24 +00:00
|
|
|
sal_Int32 i;
|
2005-03-10 15:34:20 +00:00
|
|
|
for ( i=0; i < nKnownSettings; ++i )
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( !pDataSourceSetting->Name.compareToAscii( pKnownSettings[i] ) )
|
|
|
|
{ // the particular setting is known
|
|
|
|
|
|
|
|
const DriverPropertyInfo* pAllowedDriverSetting = aDriverInfo.getConstArray();
|
|
|
|
const DriverPropertyInfo* pDriverSettingsEnd = pAllowedDriverSetting + aDriverInfo.getLength();
|
|
|
|
for ( ; pAllowedDriverSetting != pDriverSettingsEnd; ++pAllowedDriverSetting )
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( !pAllowedDriverSetting->Name.compareToAscii( pKnownSettings[i] ) )
|
|
|
|
{ // the driver also allows this setting
|
|
|
|
bAllowSetting = sal_True;
|
2004-08-02 14:09:24 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( bAllowSetting || ( i == nKnownSettings ) )
|
|
|
|
{ // if the driver allows this particular setting, or if the setting is completely unknown,
|
|
|
|
// we pass it to the driver
|
|
|
|
aRet.push_back( *pDataSourceSetting );
|
2004-08-02 14:09:24 +00:00
|
|
|
}
|
|
|
|
}
|
2006-01-25 12:44:20 +00:00
|
|
|
if ( !aRet.empty() )
|
|
|
|
return Sequence< PropertyValue >(&(*aRet.begin()),aRet.size());
|
2004-08-02 14:09:24 +00:00
|
|
|
}
|
|
|
|
return Sequence< PropertyValue >();
|
|
|
|
}
|
|
|
|
}
|
2000-10-18 15:16:39 +00:00
|
|
|
//============================================================
|
|
|
|
//= ODatabaseContext
|
|
|
|
//============================================================
|
2000-10-24 14:00:08 +00:00
|
|
|
DBG_NAME(ODatabaseSource)
|
2000-09-18 23:16:46 +00:00
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
extern "C" void SAL_CALL createRegistryInfo_ODatabaseSource()
|
|
|
|
{
|
|
|
|
static OMultiInstanceAutoRegistration< ODatabaseSource > aAutoRegistration;
|
|
|
|
}
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
Reference< XInterface > ODatabaseSource_CreateInstance(const Reference< XMultiServiceFactory >& _rxFactory)
|
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
Reference< XSingleServiceFactory > xDb(_rxFactory->createInstance(SERVICE_SDB_DATABASECONTEXT),UNO_QUERY);
|
|
|
|
return xDb->createInstance( );
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
2005-03-10 15:34:20 +00:00
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
//--------------------------------------------------------------------------
|
2005-03-10 15:34:20 +00:00
|
|
|
ODatabaseSource::ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl)
|
2005-12-21 12:35:18 +00:00
|
|
|
:ModelDependentComponent( _pImpl )
|
|
|
|
,OSubComponent( getMutex(), Reference< XInterface >() )
|
2000-09-18 23:16:46 +00:00
|
|
|
,OPropertySetHelper(OComponentHelper::rBHelper)
|
2005-12-21 12:35:18 +00:00
|
|
|
,m_aBookmarks( *this, getMutex() )
|
|
|
|
,m_aFlushListeners( getMutex() )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2000-10-11 10:21:40 +00:00
|
|
|
// some kind of default
|
2001-07-26 08:15:31 +00:00
|
|
|
DBG_CTOR(ODatabaseSource,NULL);
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
ODatabaseSource::~ODatabaseSource()
|
|
|
|
{
|
|
|
|
DBG_DTOR(ODatabaseSource,NULL);
|
2004-08-02 14:09:24 +00:00
|
|
|
if ( !OComponentHelper::rBHelper.bInDispose && !OComponentHelper::rBHelper.bDisposed )
|
|
|
|
{
|
|
|
|
acquire();
|
|
|
|
dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void ODatabaseSource::setMeAsParent(const Reference< XNameAccess >& _xName)
|
|
|
|
{
|
|
|
|
Reference<XChild> xChild(_xName,UNO_QUERY);
|
|
|
|
xChild->setParent(*this);
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
// com::sun::star::lang::XTypeProvider
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
Sequence< Type > ODatabaseSource::getTypes() throw (RuntimeException)
|
|
|
|
{
|
2001-01-23 07:32:02 +00:00
|
|
|
OTypeCollection aPropertyHelperTypes( ::getCppuType( (const Reference< XFastPropertySet > *)0 ),
|
|
|
|
::getCppuType( (const Reference< XPropertySet > *)0 ),
|
|
|
|
::getCppuType( (const Reference< XMultiPropertySet > *)0 ));
|
|
|
|
|
|
|
|
return ::comphelper::concatSequences(
|
|
|
|
::comphelper::concatSequences(
|
|
|
|
OSubComponent::getTypes(),
|
|
|
|
aPropertyHelperTypes.getTypes()
|
|
|
|
),
|
2005-03-10 15:34:20 +00:00
|
|
|
ODatabaseSource_Base::getTypes()
|
2001-01-23 07:32:02 +00:00
|
|
|
);
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
2004-08-02 14:09:24 +00:00
|
|
|
Sequence< sal_Int8 > ODatabaseSource::getImplementationId() throw (RuntimeException)
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
|
|
|
static OImplementationId * pId = 0;
|
|
|
|
if (! pId)
|
|
|
|
{
|
|
|
|
MutexGuard aGuard( Mutex::getGlobalMutex() );
|
|
|
|
if (! pId)
|
|
|
|
{
|
|
|
|
static OImplementationId aId;
|
|
|
|
pId = &aId;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return pId->getImplementationId();
|
|
|
|
}
|
|
|
|
|
|
|
|
// com::sun::star::uno::XInterface
|
|
|
|
//--------------------------------------------------------------------------
|
|
|
|
Any ODatabaseSource::queryInterface( const Type & rType ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
Any aIface = OSubComponent::queryInterface( rType );
|
|
|
|
if (!aIface.hasValue())
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
2000-09-18 23:16:46 +00:00
|
|
|
aIface = ODatabaseSource_Base::queryInterface( rType );
|
2004-08-02 14:09:24 +00:00
|
|
|
if ( !aIface.hasValue() )
|
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
aIface = ::cppu::queryInterface(
|
|
|
|
rType,
|
|
|
|
static_cast< XPropertySet* >( this ),
|
|
|
|
static_cast< XFastPropertySet* >( this ),
|
|
|
|
static_cast< XMultiPropertySet* >( this ));
|
2004-08-02 14:09:24 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
return aIface;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
2001-11-01 15:29:21 +00:00
|
|
|
void ODatabaseSource::acquire() throw ()
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
|
|
|
OSubComponent::acquire();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------
|
2001-11-01 15:29:21 +00:00
|
|
|
void ODatabaseSource::release() throw ()
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
|
|
|
OSubComponent::release();
|
|
|
|
}
|
2000-11-14 12:32:59 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
2002-08-12 07:54:24 +00:00
|
|
|
void SAL_CALL ODatabaseSource::disposing( const ::com::sun::star::lang::EventObject& Source ) throw(RuntimeException)
|
2000-11-14 12:32:59 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( m_pImpl.is() )
|
|
|
|
m_pImpl->disposing(Source);
|
2000-11-14 12:32:59 +00:00
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
// XServiceInfo
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
rtl::OUString ODatabaseSource::getImplementationName( ) throw(RuntimeException)
|
|
|
|
{
|
|
|
|
return getImplementationName_Static();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
rtl::OUString ODatabaseSource::getImplementationName_Static( ) throw(RuntimeException)
|
|
|
|
{
|
2001-01-05 09:49:38 +00:00
|
|
|
return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseSource");
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames( ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return getSupportedServiceNames_Static();
|
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Reference< XInterface > ODatabaseSource::Create(const Reference< XMultiServiceFactory >& _rxFactory)
|
|
|
|
{
|
|
|
|
return ODatabaseSource_CreateInstance(_rxFactory);
|
|
|
|
}
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
|
2000-09-18 23:16:46 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames_Static( ) throw (RuntimeException)
|
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
Sequence< ::rtl::OUString > aSNS( 2 );
|
2000-09-18 23:16:46 +00:00
|
|
|
aSNS[0] = SERVICE_SDB_DATASOURCE;
|
2005-03-10 15:34:20 +00:00
|
|
|
aSNS[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DocumentDataSource"));
|
2000-09-18 23:16:46 +00:00
|
|
|
return aSNS;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
sal_Bool ODatabaseSource::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException)
|
|
|
|
{
|
2000-10-11 10:21:40 +00:00
|
|
|
return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
// OComponentHelper
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODatabaseSource::disposing()
|
|
|
|
{
|
2004-08-02 14:09:24 +00:00
|
|
|
OSubComponent::disposing();
|
2000-09-18 23:16:46 +00:00
|
|
|
OPropertySetHelper::disposing();
|
|
|
|
|
2004-08-02 14:09:24 +00:00
|
|
|
EventObject aDisposeEvent(static_cast<XWeak*>(this));
|
2004-10-22 07:59:06 +00:00
|
|
|
m_aFlushListeners.disposeAndClear( aDisposeEvent );
|
2005-03-10 15:34:20 +00:00
|
|
|
m_pImpl.clear();
|
2004-08-02 14:09:24 +00:00
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const ::rtl::OUString& _rUid, const ::rtl::OUString& _rPwd)
|
|
|
|
{
|
|
|
|
Reference< XConnection > xReturn;
|
2005-03-10 15:34:20 +00:00
|
|
|
Reference< XDriverManager > xManager(m_pImpl->m_xServiceFactory->createInstance(SERVICE_SDBC_CONNECTIONPOOL)
|
2001-04-26 08:18:16 +00:00
|
|
|
, UNO_QUERY);
|
2001-05-08 12:27:16 +00:00
|
|
|
|
|
|
|
::rtl::OUString sUser(_rUid);
|
|
|
|
::rtl::OUString sPwd(_rPwd);
|
2005-03-10 15:34:20 +00:00
|
|
|
if ((0 == sUser.getLength()) && (0 == sPwd.getLength()) && (0 != m_pImpl->m_sUser.getLength()))
|
2001-05-08 12:27:16 +00:00
|
|
|
{ // ease the usage of this method. data source which are intended to have a user automatically
|
|
|
|
// fill in the user/password combination if the caller of this method does not specify otherwise
|
|
|
|
// 86951 - 05/08/2001 - frank.schoenheit@germany.sun.com
|
2005-03-10 15:34:20 +00:00
|
|
|
sUser = m_pImpl->m_sUser;
|
|
|
|
if (0 != m_pImpl->m_aPassword.getLength())
|
|
|
|
sPwd = m_pImpl->m_aPassword;
|
2001-05-08 12:27:16 +00:00
|
|
|
}
|
|
|
|
|
2001-08-28 14:59:32 +00:00
|
|
|
sal_uInt16 nExceptionMessageId = RID_STR_COULDNOTCONNECT_UNSPECIFIED;
|
2000-09-18 23:16:46 +00:00
|
|
|
if (xManager.is())
|
|
|
|
{
|
|
|
|
sal_Int32 nAdditionalArgs(0);
|
2001-05-08 12:27:16 +00:00
|
|
|
if (sUser.getLength()) ++nAdditionalArgs;
|
|
|
|
if (sPwd.getLength()) ++nAdditionalArgs;
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
Sequence< PropertyValue > aUserPwd(nAdditionalArgs);
|
2002-02-06 11:50:25 +00:00
|
|
|
sal_Int32 nArgPos = 0;
|
2001-05-08 12:27:16 +00:00
|
|
|
if (sUser.getLength())
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2002-02-06 11:50:25 +00:00
|
|
|
aUserPwd[ nArgPos ].Name = ::rtl::OUString::createFromAscii("user");
|
|
|
|
aUserPwd[ nArgPos ].Value <<= sUser;
|
|
|
|
++nArgPos;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
2001-05-08 12:27:16 +00:00
|
|
|
if (sPwd.getLength())
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2002-02-06 11:50:25 +00:00
|
|
|
aUserPwd[ nArgPos ].Name = ::rtl::OUString::createFromAscii("password");
|
|
|
|
aUserPwd[ nArgPos ].Value <<= sPwd;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
2004-08-02 14:09:24 +00:00
|
|
|
Reference< XDriver > xDriver;
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Reference< XDriverAccess > xAccessDrivers( xManager, UNO_QUERY );
|
|
|
|
if ( xAccessDrivers.is() )
|
2005-03-10 15:34:20 +00:00
|
|
|
xDriver = xAccessDrivers->getDriverByURL( m_pImpl->m_sConnectURL );
|
2004-08-02 14:09:24 +00:00
|
|
|
}
|
|
|
|
catch( const Exception& )
|
|
|
|
{
|
|
|
|
DBG_ERROR( "ODatabaseSource::buildLowLevelConnection: got a strange exception while analyzing the error!" );
|
|
|
|
}
|
|
|
|
if ( !xDriver.is() )
|
|
|
|
nExceptionMessageId = RID_STR_COULDNOTCONNECT_NODRIVER;
|
2000-09-18 23:16:46 +00:00
|
|
|
else
|
2001-08-28 14:59:32 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
Sequence< PropertyValue > aDriverInfo = lcl_filterDriverProperties(xDriver,m_pImpl->m_sConnectURL,m_pImpl->m_aInfo);
|
2001-08-28 14:59:32 +00:00
|
|
|
|
2005-03-23 08:46:37 +00:00
|
|
|
if ( m_pImpl->isEmbeddedDatabase() )
|
2004-11-09 11:25:39 +00:00
|
|
|
{
|
|
|
|
sal_Int32 nCount = aDriverInfo.getLength();
|
|
|
|
aDriverInfo.realloc(nCount + 2 );
|
|
|
|
aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"));
|
2005-03-10 15:34:20 +00:00
|
|
|
aDriverInfo[nCount++].Value <<= m_pImpl->getURL();
|
2004-11-09 11:25:39 +00:00
|
|
|
aDriverInfo[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Storage"));
|
2005-07-08 09:36:39 +00:00
|
|
|
Reference< css::document::XDocumentSubStorageSupplier> xDocSup( m_pImpl->getDocumentSubStorageSupplier() );
|
|
|
|
aDriverInfo[nCount++].Value <<= xDocSup->getDocumentSubStorage(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("database")),ElementModes::READWRITE);
|
2004-11-09 11:25:39 +00:00
|
|
|
}
|
2004-08-02 14:09:24 +00:00
|
|
|
if (nAdditionalArgs)
|
2005-03-10 15:34:20 +00:00
|
|
|
xReturn = xManager->getConnectionWithInfo(m_pImpl->m_sConnectURL, ::comphelper::concatSequences(aUserPwd,aDriverInfo));
|
2004-08-02 14:09:24 +00:00
|
|
|
else
|
2005-03-10 15:34:20 +00:00
|
|
|
xReturn = xManager->getConnectionWithInfo(m_pImpl->m_sConnectURL,aDriverInfo);
|
2005-10-24 07:28:36 +00:00
|
|
|
|
|
|
|
if ( m_pImpl->isEmbeddedDatabase() )
|
|
|
|
{
|
|
|
|
// see ODatabaseSource::flushed for comment on why we register as FlushListener
|
|
|
|
// at the connection
|
|
|
|
Reference< XFlushable > xFlushable( xReturn, UNO_QUERY );
|
|
|
|
if ( xFlushable.is() )
|
|
|
|
FlushNotificationAdapter::installAdapter( xFlushable, this );
|
|
|
|
}
|
2001-08-28 14:59:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
nExceptionMessageId = RID_STR_COULDNOTLOAD_MANAGER;
|
|
|
|
|
|
|
|
if ( !xReturn.is() )
|
|
|
|
{
|
|
|
|
::rtl::OUString sMessage = DBACORE_RESSTRING( nExceptionMessageId );
|
|
|
|
|
|
|
|
SQLContext aContext;
|
2005-03-10 15:34:20 +00:00
|
|
|
aContext.Message = m_pImpl->m_sConnectURL;
|
2001-08-28 14:59:32 +00:00
|
|
|
|
|
|
|
throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) );
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return xReturn;
|
|
|
|
}
|
|
|
|
|
|
|
|
// OPropertySetHelper
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Reference< XPropertySetInfo > ODatabaseSource::getPropertySetInfo() throw (RuntimeException)
|
|
|
|
{
|
|
|
|
return createPropertySetInfo( getInfoHelper() ) ;
|
|
|
|
}
|
|
|
|
|
2000-10-11 10:21:40 +00:00
|
|
|
// comphelper::OPropertyArrayUsageHelper
|
2000-09-18 23:16:46 +00:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
::cppu::IPropertyArrayHelper* ODatabaseSource::createArrayHelper( ) const
|
|
|
|
{
|
2001-02-28 09:24:28 +00:00
|
|
|
BEGIN_PROPERTY_HELPER(12)
|
2004-08-02 14:09:24 +00:00
|
|
|
DECL_PROP1(INFO, Sequence< PropertyValue >,BOUND);
|
2000-09-18 23:16:46 +00:00
|
|
|
DECL_PROP1_BOOL(ISPASSWORDREQUIRED, BOUND);
|
|
|
|
DECL_PROP1_BOOL(ISREADONLY, READONLY);
|
2004-08-02 14:09:24 +00:00
|
|
|
DECL_PROP1(LAYOUTINFORMATION, Sequence< ::com::sun::star::beans::PropertyValue >,BOUND);
|
2000-09-18 23:16:46 +00:00
|
|
|
DECL_PROP1(NAME, ::rtl::OUString, READONLY);
|
2001-08-30 13:50:17 +00:00
|
|
|
DECL_PROP2_IFACE(NUMBERFORMATSSUPPLIER, XNumberFormatsSupplier, READONLY, TRANSIENT);
|
2000-11-09 06:31:10 +00:00
|
|
|
DECL_PROP1(PASSWORD, ::rtl::OUString, TRANSIENT);
|
2000-10-20 08:52:06 +00:00
|
|
|
DECL_PROP1_BOOL(SUPPRESSVERSIONCL, BOUND);
|
2000-09-18 23:16:46 +00:00
|
|
|
DECL_PROP1(TABLEFILTER, Sequence< ::rtl::OUString >,BOUND);
|
|
|
|
DECL_PROP1(TABLETYPEFILTER, Sequence< ::rtl::OUString >,BOUND);
|
2004-08-02 14:09:24 +00:00
|
|
|
DECL_PROP1(URL, ::rtl::OUString, BOUND);
|
2000-09-18 23:16:46 +00:00
|
|
|
DECL_PROP1(USER, ::rtl::OUString, BOUND);
|
|
|
|
END_PROPERTY_HELPER();
|
|
|
|
}
|
|
|
|
|
|
|
|
// cppu::OPropertySetHelper
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
::cppu::IPropertyArrayHelper& ODatabaseSource::getInfoHelper()
|
|
|
|
{
|
|
|
|
return *getArrayHelper();
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any & rOldValue, sal_Int32 nHandle, const Any& rValue ) throw( IllegalArgumentException )
|
|
|
|
{
|
|
|
|
sal_Bool bModified(sal_False);
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( m_pImpl.is() )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if (m_pImpl->m_bReadOnly)
|
|
|
|
throw IllegalArgumentException();
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
switch (nHandle)
|
|
|
|
{
|
|
|
|
case PROPERTY_ID_TABLEFILTER:
|
|
|
|
bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_pImpl->m_aTableFilter);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_TABLETYPEFILTER:
|
|
|
|
bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_pImpl->m_aTableTypeFilter);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_USER:
|
|
|
|
bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_pImpl->m_sUser);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_PASSWORD:
|
|
|
|
bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_pImpl->m_aPassword);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_ISPASSWORDREQUIRED:
|
|
|
|
bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_pImpl->m_bPasswordRequired);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_SUPPRESSVERSIONCL:
|
|
|
|
bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_pImpl->m_bSuppressVersionColumns);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_LAYOUTINFORMATION:
|
|
|
|
bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_pImpl->m_aLayoutInformation);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_URL:
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
bModified = ::comphelper::tryPropertyValue(rConvertedValue, rOldValue, rValue, m_pImpl->m_sConnectURL);
|
|
|
|
} break;
|
|
|
|
case PROPERTY_ID_INFO:
|
|
|
|
{
|
|
|
|
Sequence<PropertyValue> aValues;
|
|
|
|
if (!(rValue >>= aValues))
|
2002-08-19 10:53:58 +00:00
|
|
|
throw IllegalArgumentException();
|
2004-08-02 14:09:24 +00:00
|
|
|
|
|
|
|
const PropertyValue* pBegin = aValues.getConstArray();
|
|
|
|
const PropertyValue* pEnd = pBegin + aValues.getLength();
|
2005-03-10 15:34:20 +00:00
|
|
|
for (;pBegin != pEnd ; ++pBegin)
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( !pBegin->Name.getLength() )
|
|
|
|
throw IllegalArgumentException();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bModified = m_pImpl->m_aInfo.getLength() != aValues.getLength();
|
|
|
|
if ( !bModified )
|
|
|
|
{
|
|
|
|
const PropertyValue* pInfoIter = m_pImpl->m_aInfo.getConstArray();
|
|
|
|
const PropertyValue* pBegin = aValues.getConstArray();
|
|
|
|
const PropertyValue* pEnd = pBegin + aValues.getLength();
|
|
|
|
for (;!bModified && pBegin != pEnd ; ++pBegin,++pInfoIter)
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
bModified = pBegin->Name != pInfoIter->Name;
|
|
|
|
if ( !bModified )
|
|
|
|
{
|
|
|
|
bModified = !::comphelper::compare(pBegin->Value,pInfoIter->Value);
|
|
|
|
}
|
2004-08-02 14:09:24 +00:00
|
|
|
}
|
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
rConvertedValue = rValue;
|
|
|
|
rOldValue <<= m_pImpl->m_aInfo;
|
|
|
|
} break;
|
|
|
|
default:
|
|
|
|
DBG_ERROR("unknown Property");
|
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
return bModified;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODatabaseSource::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue ) throw (Exception)
|
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( m_pImpl.is() )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
switch(nHandle)
|
|
|
|
{
|
|
|
|
case PROPERTY_ID_TABLEFILTER:
|
|
|
|
rValue >>= m_pImpl->m_aTableFilter;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_TABLETYPEFILTER:
|
|
|
|
rValue >>= m_pImpl->m_aTableTypeFilter;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_USER:
|
|
|
|
rValue >>= m_pImpl->m_sUser;
|
|
|
|
// if the user name changed, reset the password
|
|
|
|
m_pImpl->m_aPassword = ::rtl::OUString();
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_PASSWORD:
|
|
|
|
rValue >>= m_pImpl->m_aPassword;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_ISPASSWORDREQUIRED:
|
|
|
|
m_pImpl->m_bPasswordRequired = any2bool(rValue);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_SUPPRESSVERSIONCL:
|
|
|
|
m_pImpl->m_bSuppressVersionColumns = any2bool(rValue);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_URL:
|
|
|
|
rValue >>= m_pImpl->m_sConnectURL;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_INFO:
|
|
|
|
rValue >>= m_pImpl->m_aInfo;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_LAYOUTINFORMATION:
|
|
|
|
rValue >>= m_pImpl->m_aLayoutInformation;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
m_pImpl->setModified(sal_True);
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODatabaseSource::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const
|
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( m_pImpl.is() )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
switch (nHandle)
|
|
|
|
{
|
|
|
|
case PROPERTY_ID_TABLEFILTER:
|
|
|
|
rValue <<= m_pImpl->m_aTableFilter;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_TABLETYPEFILTER:
|
|
|
|
rValue <<= m_pImpl->m_aTableTypeFilter;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_USER:
|
|
|
|
rValue <<= m_pImpl->m_sUser;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_PASSWORD:
|
|
|
|
rValue <<= m_pImpl->m_aPassword;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_ISPASSWORDREQUIRED:
|
|
|
|
rValue = bool2any(m_pImpl->m_bPasswordRequired);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_SUPPRESSVERSIONCL:
|
|
|
|
rValue = bool2any(m_pImpl->m_bSuppressVersionColumns);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_ISREADONLY:
|
|
|
|
rValue = bool2any(m_pImpl->m_bReadOnly);
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_INFO:
|
|
|
|
rValue <<= m_pImpl->m_aInfo;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_URL:
|
|
|
|
rValue <<= m_pImpl->m_sConnectURL;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_NUMBERFORMATSSUPPLIER:
|
|
|
|
rValue <<= m_pImpl->getNumberFormatsSupplier();
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_NAME:
|
|
|
|
rValue <<= m_pImpl->m_sName;
|
|
|
|
break;
|
|
|
|
case PROPERTY_ID_LAYOUTINFORMATION:
|
|
|
|
rValue <<= m_pImpl->m_aLayoutInformation;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
DBG_ERROR("unknown Property");
|
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// XDataSource
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
void ODatabaseSource::setLoginTimeout(sal_Int32 seconds) throw( SQLException, RuntimeException )
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2005-03-10 15:34:20 +00:00
|
|
|
m_pImpl->m_nLoginTimeout = seconds;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
sal_Int32 ODatabaseSource::getLoginTimeout(void) throw( SQLException, RuntimeException )
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2005-03-10 15:34:20 +00:00
|
|
|
return m_pImpl->m_nLoginTimeout;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
2000-11-08 15:05:02 +00:00
|
|
|
|
|
|
|
// XCompletedConnection
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Reference< XConnection > SAL_CALL ODatabaseSource::connectWithCompletion( const Reference< XInteractionHandler >& _rxHandler ) throw(SQLException, RuntimeException)
|
2002-08-12 07:54:24 +00:00
|
|
|
{
|
|
|
|
return connectWithCompletion(_rxHandler,sal_False);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XConnection > ODatabaseSource::getConnection(const rtl::OUString& user, const rtl::OUString& password) throw( SQLException, RuntimeException )
|
|
|
|
{
|
|
|
|
return getConnection(user,password,sal_False);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XConnection > SAL_CALL ODatabaseSource::getIsolatedConnection( const ::rtl::OUString& user, const ::rtl::OUString& password ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return getConnection(user,password,sal_True);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XConnection > SAL_CALL ODatabaseSource::getIsolatedConnectionWithCompletion( const Reference< XInteractionHandler >& _rxHandler ) throw(SQLException, RuntimeException)
|
|
|
|
{
|
|
|
|
return connectWithCompletion(_rxHandler,sal_True);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XConnection > SAL_CALL ODatabaseSource::connectWithCompletion( const Reference< XInteractionHandler >& _rxHandler,sal_Bool _bIsolated ) throw(SQLException, RuntimeException)
|
2000-11-08 15:05:02 +00:00
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2000-11-08 15:05:02 +00:00
|
|
|
|
|
|
|
if (!_rxHandler.is())
|
|
|
|
{
|
|
|
|
DBG_ERROR("ODatabaseSource::connectWithCompletion: invalid interaction handler!");
|
2005-03-10 15:34:20 +00:00
|
|
|
return getConnection(m_pImpl->m_sUser, m_pImpl->m_aPassword,_bIsolated);
|
2000-11-08 15:05:02 +00:00
|
|
|
}
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
::rtl::OUString sUser(m_pImpl->m_sUser), sPassword(m_pImpl->m_aPassword);
|
2000-11-09 06:31:10 +00:00
|
|
|
sal_Bool bNewPasswordGiven = sal_False;
|
2000-11-08 15:05:02 +00:00
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
if (m_pImpl->m_bPasswordRequired && (0 == sPassword.getLength()))
|
2000-11-08 15:05:02 +00:00
|
|
|
{ // we need a password, but don't have one yet.
|
|
|
|
// -> ask the user
|
|
|
|
|
|
|
|
// build an interaction request
|
|
|
|
// two continuations (Ok and Cancel)
|
|
|
|
OInteractionAbort* pAbort = new OInteractionAbort;
|
2005-03-10 15:34:20 +00:00
|
|
|
OAuthenticationContinuation* pAuthenticate = new OAuthenticationContinuation(m_pImpl->m_bReadOnly);
|
2001-05-15 10:24:21 +00:00
|
|
|
|
2000-11-08 15:05:02 +00:00
|
|
|
// the request
|
|
|
|
AuthenticationRequest aRequest;
|
2005-03-10 15:34:20 +00:00
|
|
|
aRequest.ServerName = m_pImpl->m_sName;
|
2000-11-08 15:05:02 +00:00
|
|
|
aRequest.HasRealm = aRequest.HasAccount = sal_False;
|
|
|
|
aRequest.HasUserName = aRequest.HasPassword = sal_True;
|
2005-03-10 15:34:20 +00:00
|
|
|
aRequest.UserName = m_pImpl->m_sUser;
|
|
|
|
aRequest.Password = m_pImpl->m_aPassword;
|
2000-11-08 15:05:02 +00:00
|
|
|
OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest));
|
|
|
|
Reference< XInteractionRequest > xRequest(pRequest);
|
|
|
|
// some knittings
|
|
|
|
pRequest->addContinuation(pAbort);
|
|
|
|
pRequest->addContinuation(pAuthenticate);
|
|
|
|
|
|
|
|
// handle the request
|
|
|
|
try
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
MutexRelease aRelease( getMutex() );
|
2001-05-17 08:09:05 +00:00
|
|
|
// release the mutex when calling the handler, it may need to lock the SolarMutex
|
2000-11-08 15:05:02 +00:00
|
|
|
_rxHandler->handle(xRequest);
|
|
|
|
}
|
|
|
|
catch(Exception&)
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
DBG_UNHANDLED_EXCEPTION();
|
2000-11-08 15:05:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!pAuthenticate->wasSelected())
|
|
|
|
return Reference< XConnection >();
|
|
|
|
|
|
|
|
// get the result
|
2005-03-10 15:34:20 +00:00
|
|
|
sUser = m_pImpl->m_sUser = pAuthenticate->getUser();
|
2000-11-08 15:05:02 +00:00
|
|
|
sPassword = pAuthenticate->getPassword();
|
|
|
|
|
|
|
|
if (pAuthenticate->getRememberPassword())
|
2000-11-09 06:31:10 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
m_pImpl->m_aPassword = pAuthenticate->getPassword();
|
2000-11-09 06:31:10 +00:00
|
|
|
bNewPasswordGiven = sal_True;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
2002-08-12 07:54:24 +00:00
|
|
|
return getConnection(sUser, sPassword,_bIsolated);
|
2000-11-09 06:31:10 +00:00
|
|
|
}
|
|
|
|
catch(Exception&)
|
|
|
|
{
|
|
|
|
if (bNewPasswordGiven)
|
|
|
|
// assume that we had an authentication problem. Without this we may, after an unsucessfull connect, while
|
|
|
|
// the user gave us a password an the order to remember it, never allow an password input again (at least
|
|
|
|
// not without restarting the session)
|
2005-03-10 15:34:20 +00:00
|
|
|
m_pImpl->m_aPassword = ::rtl::OUString();
|
2000-11-09 06:31:10 +00:00
|
|
|
throw;
|
2000-11-08 15:05:02 +00:00
|
|
|
}
|
|
|
|
|
2000-11-09 06:31:10 +00:00
|
|
|
DBG_ERROR("ODatabaseSource::connectWithCompletion: reached the unreacable!");
|
|
|
|
return Reference< XConnection >();
|
2000-11-08 15:05:02 +00:00
|
|
|
}
|
2002-08-12 07:54:24 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
Reference< XConnection > ODatabaseSource::buildIsolatedConnection(const rtl::OUString& user, const rtl::OUString& password)
|
|
|
|
{
|
|
|
|
Reference< XConnection > xConn;
|
|
|
|
Reference< XConnection > xSdbcConn = buildLowLevelConnection(user, password);
|
2005-03-23 08:46:37 +00:00
|
|
|
DBG_ASSERT( xSdbcConn.is(), "ODatabaseSource::buildIsolatedConnection: invalid return value of buildLowLevelConnection!" );
|
2002-08-12 07:54:24 +00:00
|
|
|
// buildLowLevelConnection is expected to always succeed
|
|
|
|
if ( xSdbcConn.is() )
|
|
|
|
{
|
|
|
|
// build a connection server and return it (no stubs)
|
2005-03-10 15:34:20 +00:00
|
|
|
xConn = new OConnection(*this, xSdbcConn, m_pImpl->m_xServiceFactory);
|
2002-08-12 07:54:24 +00:00
|
|
|
}
|
|
|
|
return xConn;
|
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
//------------------------------------------------------------------------------
|
2002-08-12 07:54:24 +00:00
|
|
|
Reference< XConnection > ODatabaseSource::getConnection(const rtl::OUString& user, const rtl::OUString& password,sal_Bool _bIsolated) throw( SQLException, RuntimeException )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
Reference< XConnection > xConn;
|
2002-08-12 07:54:24 +00:00
|
|
|
if ( _bIsolated )
|
2000-11-14 12:32:59 +00:00
|
|
|
{
|
2002-08-12 07:54:24 +00:00
|
|
|
xConn = buildIsolatedConnection(user,password);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // create a new proxy for the connection
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( !m_pImpl->m_xSharedConnectionManager.is() )
|
2001-08-28 14:59:32 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
m_pImpl->m_pSharedConnectionManager = new OSharedConnectionManager(m_pImpl->m_xServiceFactory);
|
|
|
|
m_pImpl->m_xSharedConnectionManager = m_pImpl->m_pSharedConnectionManager;
|
2001-08-28 14:59:32 +00:00
|
|
|
}
|
2005-03-10 15:34:20 +00:00
|
|
|
xConn = m_pImpl->m_pSharedConnectionManager->getConnection(m_pImpl->m_sConnectURL,user,password,m_pImpl->m_aInfo,this);
|
2002-08-12 07:54:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( xConn.is() )
|
|
|
|
{
|
|
|
|
Reference< XComponent> xComp(xConn,UNO_QUERY);
|
|
|
|
if ( xComp.is() )
|
2005-10-24 07:28:36 +00:00
|
|
|
xComp->addEventListener( static_cast< XContainerListener* >( this ) );
|
2005-03-10 15:34:20 +00:00
|
|
|
m_pImpl->m_aConnections.push_back(OWeakConnection(xConn));
|
2000-11-14 12:32:59 +00:00
|
|
|
}
|
2000-09-18 23:16:46 +00:00
|
|
|
|
|
|
|
return xConn;
|
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2001-04-26 10:27:16 +00:00
|
|
|
Reference< XNameAccess > SAL_CALL ODatabaseSource::getBookmarks( ) throw (RuntimeException)
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2001-04-26 10:27:16 +00:00
|
|
|
return static_cast< XNameContainer* >(&m_aBookmarks);
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Reference< XNameAccess > SAL_CALL ODatabaseSource::getQueryDefinitions( ) throw(RuntimeException)
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
Reference< XNameAccess > xContainer = m_pImpl->m_xCommandDefinitions;
|
2004-08-02 14:09:24 +00:00
|
|
|
if ( !xContainer.is() )
|
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( !m_pImpl->m_aContainer[ODatabaseModelImpl::E_QUERY].get() )
|
2004-08-02 14:09:24 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
m_pImpl->m_aContainer[ODatabaseModelImpl::E_QUERY] = TContentPtr(new ODefinitionContainer_Impl);
|
2004-08-02 14:09:24 +00:00
|
|
|
}
|
2005-03-10 15:34:20 +00:00
|
|
|
xContainer = new OCommandContainer(m_pImpl->m_xServiceFactory,*this,m_pImpl->m_aContainer[ODatabaseModelImpl::E_QUERY],sal_False);
|
|
|
|
m_pImpl->m_xCommandDefinitions = xContainer;
|
2004-08-02 14:09:24 +00:00
|
|
|
}
|
|
|
|
return xContainer;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
2004-08-02 14:09:24 +00:00
|
|
|
// XTablesSupplier
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
Reference< XNameAccess > ODatabaseSource::getTables() throw( RuntimeException )
|
2000-09-18 23:16:46 +00:00
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
Reference< XNameAccess > xContainer = m_pImpl->m_xTableDefinitions;
|
2004-08-02 14:09:24 +00:00
|
|
|
if ( !xContainer.is() )
|
2000-10-13 15:00:03 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( !m_pImpl->m_aContainer[ODatabaseModelImpl::E_TABLE].get() )
|
2000-10-13 15:00:03 +00:00
|
|
|
{
|
2005-03-10 15:34:20 +00:00
|
|
|
m_pImpl->m_aContainer[ODatabaseModelImpl::E_TABLE] = TContentPtr(new ODefinitionContainer_Impl);
|
2000-10-13 15:00:03 +00:00
|
|
|
}
|
2005-03-10 15:34:20 +00:00
|
|
|
xContainer = new OCommandContainer(m_pImpl->m_xServiceFactory,*this,m_pImpl->m_aContainer[ODatabaseModelImpl::E_TABLE]);
|
|
|
|
m_pImpl->m_xTableDefinitions = xContainer;
|
2000-10-13 15:00:03 +00:00
|
|
|
}
|
2004-08-02 14:09:24 +00:00
|
|
|
return xContainer;
|
2000-09-18 23:16:46 +00:00
|
|
|
}
|
2005-03-10 15:34:20 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseSource::flush( ) throw (RuntimeException)
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2005-03-10 15:34:20 +00:00
|
|
|
try
|
|
|
|
{
|
2005-09-23 11:05:24 +00:00
|
|
|
SharedModel xModel( impl_getModel( true ) );
|
|
|
|
Reference< css::frame::XStorable> xStorable( xModel, UNO_QUERY );
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( xStorable.is() )
|
|
|
|
xStorable->store();
|
|
|
|
|
2005-12-21 12:35:18 +00:00
|
|
|
css::lang::EventObject aFlushedEvent(*this);
|
|
|
|
aGuard.clear();
|
|
|
|
m_aFlushListeners.notifyEach( &XFlushListener::flushed, aFlushedEvent );
|
2005-03-10 15:34:20 +00:00
|
|
|
}
|
|
|
|
catch(Exception&)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
2005-10-24 07:28:36 +00:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseSource::flushed( const EventObject& rEvent ) throw (RuntimeException)
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2005-10-24 07:28:36 +00:00
|
|
|
|
|
|
|
// Okay, this is some hack.
|
|
|
|
//
|
|
|
|
// In general, we have the problem that embedded databases write into their underlying storage, which
|
|
|
|
// logically is one of our sub storage, and practically is a temporary file maintained by the
|
|
|
|
// package implementation. As long as we did not commit this storage and our main storage,
|
|
|
|
// the changes made by the embedded database engine is not really reflected in the database document
|
|
|
|
// file. This is Bad (TM) for a "real" database application - imagine somebody entering some
|
|
|
|
// data, and then crashing: For a database application, you would expect that the data still is present
|
|
|
|
// when you connect to the database next time.
|
|
|
|
//
|
|
|
|
// Since this is a conceptual problem as long as we do use those ZIP packages (in fact, we *cannot*
|
|
|
|
// provide the desired functionality as long as we do not have a package format which allows O(1) writes),
|
|
|
|
// we cannot completely fix this. However, we can relax the problem by commiting more often - often
|
|
|
|
// enough so that data loss is more seldom, and seldom enough so that there's no noticable performance
|
|
|
|
// decrease.
|
|
|
|
//
|
|
|
|
// For this, we introduced a few places which XFlushable::flush their connections, and register as
|
|
|
|
// XFlushListener at the embedded connection (which needs to provide the XFlushable functionality).
|
|
|
|
// Then, when the connection is flushed, we commit both the database storage and our main storage.
|
|
|
|
//
|
|
|
|
// #i55274# / 2005-09-30 / frank.schoenheit@sun.com
|
|
|
|
|
|
|
|
OSL_ENSURE( m_pImpl->isEmbeddedDatabase(), "ODatabaseSource::flushed: no embedded database?!" );
|
|
|
|
sal_Bool bWasModified = m_pImpl->m_bModified;
|
|
|
|
m_pImpl->commitEmbeddedStorage();
|
|
|
|
m_pImpl->setModified( bWasModified );
|
|
|
|
}
|
|
|
|
|
2005-03-10 15:34:20 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseSource::addFlushListener( const Reference< ::com::sun::star::util::XFlushListener >& _xListener ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
m_aFlushListeners.addInterface(_xListener);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseSource::removeFlushListener( const Reference< ::com::sun::star::util::XFlushListener >& _xListener ) throw (RuntimeException)
|
|
|
|
{
|
|
|
|
m_aFlushListeners.removeInterface(_xListener);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseSource::elementInserted( const ContainerEvent& Event ) throw (RuntimeException)
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( m_pImpl.is() )
|
|
|
|
m_pImpl->setModified(sal_True);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseSource::elementRemoved( const ContainerEvent& Event ) throw (RuntimeException)
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( m_pImpl.is() )
|
|
|
|
m_pImpl->setModified(sal_True);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
void SAL_CALL ODatabaseSource::elementReplaced( const ContainerEvent& Event ) throw (RuntimeException)
|
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2005-03-10 15:34:20 +00:00
|
|
|
if ( m_pImpl.is() )
|
|
|
|
m_pImpl->setModified(sal_True);
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-09-23 11:05:24 +00:00
|
|
|
ODatabaseSource::SharedModel ODatabaseSource::impl_getModel( bool _bTakeOwnershipIfNewlyCreated )
|
2005-07-08 09:36:39 +00:00
|
|
|
{
|
2005-09-23 11:05:24 +00:00
|
|
|
SharedModel xModel;
|
2005-07-08 09:36:39 +00:00
|
|
|
if ( m_pImpl.is() )
|
|
|
|
{
|
2005-09-23 11:05:24 +00:00
|
|
|
xModel.reset( m_pImpl->getModel_noCreate(), SharedModel::NoTakeOwnership );
|
2005-07-08 09:36:39 +00:00
|
|
|
if ( !xModel.is() )
|
2005-09-23 11:05:24 +00:00
|
|
|
xModel.reset( m_pImpl->createNewModel_deliverOwnership(), _bTakeOwnershipIfNewlyCreated ? SharedModel::TakeOwnership : SharedModel::NoTakeOwnership );
|
2005-07-08 09:36:39 +00:00
|
|
|
}
|
|
|
|
return xModel;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-03-10 15:34:20 +00:00
|
|
|
// XDocumentDataSource
|
2005-07-08 09:36:39 +00:00
|
|
|
Reference< XOfficeDatabaseDocument > SAL_CALL ODatabaseSource::getDatabaseDocument() throw (RuntimeException)
|
2005-03-10 15:34:20 +00:00
|
|
|
{
|
2005-12-21 12:35:18 +00:00
|
|
|
ModelMethodGuard aGuard( *this );
|
2005-09-23 11:05:24 +00:00
|
|
|
return Reference< XOfficeDatabaseDocument >( impl_getModel( false ), UNO_QUERY );
|
|
|
|
// by definition, clients of getDatabaseDocument are responsible for the model they obtain,
|
|
|
|
// including responsibility for (attempting to) close the model when they don't need it anymore.
|
|
|
|
// Thus the "false" parameter in the call to impl_getModel: We don't take the ownership
|
|
|
|
// of the model, even if it had to be newly created during this call.
|
2005-03-10 15:34:20 +00:00
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2005-12-21 12:35:18 +00:00
|
|
|
Reference< XInterface > ODatabaseSource::getThis()
|
|
|
|
{
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------
|
2000-10-18 15:16:39 +00:00
|
|
|
//........................................................................
|
|
|
|
} // namespace dbaccess
|
|
|
|
//........................................................................
|
|
|
|
|
2005-03-04 08:43:20 +00:00
|
|
|
|