update dev300-m58
[ooovba.git] / connectivity / source / drivers / adabas / BGroups.cxx
blob49afc6e3a807ef11d07cade476886b8086f6b1d3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: BGroups.cxx,v $
10 * $Revision: 1.14 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_connectivity.hxx"
33 #include "adabas/BGroups.hxx"
34 #include "adabas/BGroup.hxx"
35 #include "adabas/BTable.hxx"
36 #include <com/sun/star/sdbc/XRow.hpp>
37 #include <com/sun/star/sdbc/XResultSet.hpp>
38 #include <comphelper/types.hxx>
40 using namespace ::comphelper;
41 using namespace connectivity;
42 using namespace connectivity::adabas;
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::beans;
45 // using namespace ::com::sun::star::sdbcx;
46 using namespace ::com::sun::star::sdbc;
47 using namespace ::com::sun::star::container;
48 using namespace ::com::sun::star::lang;
49 typedef connectivity::sdbcx::OCollection OCollection_TYPE;
50 // -------------------------------------------------------------------------
51 sdbcx::ObjectType OGroups::createObject(const ::rtl::OUString& _rName)
53 return new OAdabasGroup(m_pConnection,_rName);
55 // -------------------------------------------------------------------------
56 void OGroups::impl_refresh() throw(RuntimeException)
58 m_pParent->refreshGroups();
60 // -------------------------------------------------------------------------
61 Reference< XPropertySet > OGroups::createDescriptor()
63 // OAdabasGroup* pNew =
64 return new OAdabasGroup(m_pConnection);
66 // -------------------------------------------------------------------------
67 // XAppend
68 sdbcx::ObjectType OGroups::appendObject( const ::rtl::OUString& _rForName, const Reference< XPropertySet >& /*descriptor*/ )
70 ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("CREATE USERGROUP ");
71 ::rtl::OUString aQuote = m_pConnection->getMetaData()->getIdentifierQuoteString( );
73 aSql = aSql + aQuote + _rForName + aQuote;
75 Reference< XStatement > xStmt = m_pConnection->createStatement( );
76 xStmt->execute(aSql);
77 ::comphelper::disposeComponent(xStmt);
79 return createObject( _rForName );
81 // -------------------------------------------------------------------------
82 // XDrop
83 void OGroups::dropObject(sal_Int32 /*_nPos*/,const ::rtl::OUString _sElementName)
85 ::rtl::OUString aSql = ::rtl::OUString::createFromAscii("DROP USERGROUP ");
86 ::rtl::OUString aQuote = m_pConnection->getMetaData()->getIdentifierQuoteString( );
88 aSql = aSql + aQuote + _sElementName + aQuote;
90 Reference< XStatement > xStmt = m_pConnection->createStatement( );
91 xStmt->execute(aSql);
92 ::comphelper::disposeComponent(xStmt);
94 // -------------------------------------------------------------------------