2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 22:04:38 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 15:18:56 +00:00
|
|
|
|
2017-10-27 19:27:55 +02:00
|
|
|
#include <ado/AUsers.hxx>
|
|
|
|
#include <ado/AUser.hxx>
|
|
|
|
#include <ado/ATable.hxx>
|
|
|
|
#include <ado/AConnection.hxx>
|
2000-09-18 15:18:56 +00:00
|
|
|
#include <com/sun/star/sdbc/XRow.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XResultSet.hpp>
|
2014-06-04 15:29:58 +02:00
|
|
|
#include <connectivity/sdbcx/IRefreshable.hxx>
|
2001-11-09 06:05:38 +00:00
|
|
|
#include <comphelper/types.hxx>
|
2006-07-10 13:24:28 +00:00
|
|
|
#include <connectivity/dbexception.hxx>
|
2017-10-27 19:27:55 +02:00
|
|
|
#include <strings.hrc>
|
2001-04-12 11:33:30 +00:00
|
|
|
|
2001-11-09 06:05:38 +00:00
|
|
|
using namespace comphelper;
|
2005-03-10 14:24:01 +00:00
|
|
|
using namespace connectivity;
|
2000-09-18 15:18:56 +00:00
|
|
|
using namespace connectivity::ado;
|
|
|
|
using namespace com::sun::star::uno;
|
|
|
|
using namespace com::sun::star::lang;
|
|
|
|
using namespace com::sun::star::beans;
|
|
|
|
using namespace com::sun::star::sdbc;
|
|
|
|
using namespace com::sun::star::container;
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
sdbcx::ObjectType OUsers::createObject(const OUString& _rName)
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2001-11-09 06:05:38 +00:00
|
|
|
return new OAdoUser(m_pCatalog,isCaseSensitive(),_rName);
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
void OUsers::impl_refresh()
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2001-11-09 06:05:38 +00:00
|
|
|
m_aCollection.Refresh();
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2006-07-10 13:24:28 +00:00
|
|
|
Reference< XPropertySet > OUsers::createDescriptor()
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2001-11-09 06:05:38 +00:00
|
|
|
return new OUserExtend(m_pCatalog,isCaseSensitive());
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
// XAppend
|
2013-04-07 12:06:47 +02:00
|
|
|
sdbcx::ObjectType OUsers::appendObject( const OUString& _rForName, const Reference< XPropertySet >& descriptor )
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2016-10-14 16:57:58 +02:00
|
|
|
OUserExtend* pUser = nullptr;
|
|
|
|
if ( !getImplementation( pUser, descriptor ) || pUser == nullptr )
|
2008-10-01 12:28:29 +00:00
|
|
|
m_pCatalog->getConnection()->throwGenericSQLException( STR_INVALID_USER_DESCRIPTOR_ERROR,static_cast<XTypeProvider*>(this) );
|
2006-07-10 13:24:28 +00:00
|
|
|
|
2016-10-14 16:57:58 +02:00
|
|
|
ADOUsers* pUsers = static_cast<ADOUsers*>(m_aCollection);
|
2016-10-11 15:39:25 +02:00
|
|
|
pUsers->Append(OLEVariant(pUser->getImpl()),OLEString(pUser->getPassword()).asBSTR());
|
2006-07-10 13:24:28 +00:00
|
|
|
|
|
|
|
return createObject( _rForName );
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2000-09-18 15:18:56 +00:00
|
|
|
// XDrop
|
2014-03-14 07:46:08 +02:00
|
|
|
void OUsers::dropObject(sal_Int32 /*_nPos*/,const OUString& _sElementName)
|
2000-09-18 15:18:56 +00:00
|
|
|
{
|
2001-11-09 06:05:38 +00:00
|
|
|
m_aCollection.Delete(_sElementName);
|
2000-09-18 15:18:56 +00:00
|
|
|
}
|
2014-02-22 21:20:15 +01:00
|
|
|
|
2001-03-30 13:08:05 +00:00
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|