diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:06:44 +0000 |
commit | ed5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch) | |
tree | 7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /offapi/com/sun/star/sdb/tools | |
parent | Initial commit. (diff) | |
download | libreoffice-upstream.tar.xz libreoffice-upstream.zip |
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'offapi/com/sun/star/sdb/tools')
-rw-r--r-- | offapi/com/sun/star/sdb/tools/CompositionType.idl | 79 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/ConnectionTools.idl | 43 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XConnectionSupplier.idl | 48 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XConnectionTools.idl | 129 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XDataSourceMetaData.idl | 41 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XIndexAlteration.idl | 75 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XKeyAlteration.idl | 75 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XObjectNames.idl | 164 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XTableAlteration.idl | 94 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XTableName.idl | 134 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XTableRename.idl | 57 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XViewAccess.idl | 67 |
12 files changed, 1006 insertions, 0 deletions
diff --git a/offapi/com/sun/star/sdb/tools/CompositionType.idl b/offapi/com/sun/star/sdb/tools/CompositionType.idl new file mode 100644 index 000000000..868bfd064 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/CompositionType.idl @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_CompositionType_idl__ +#define __com_sun_star_sdb_tools_CompositionType_idl__ + +module com { module sun { module star { module sdb { module tools { + +/** specifies which composition should be used when composing a table + name. + + @see XTableName + + @since OOo 2.0.4 +*/ +constants CompositionType +{ + /** specifies composition of a name to be used in table definitions + + @see XDatabaseMetaData::supportsCatalogsInTableDefinitions + @see XDatabaseMetaData::supportsSchemasInTableDefinitions + */ + const long ForTableDefinitions = 0; + + /** specifies composition of a name to be used in index definitions + + @see XDatabaseMetaData::supportsCatalogsInIndexDefinitions + @see XDatabaseMetaData::supportsSchemasInIndexDefinitions + */ + const long ForIndexDefinitions = 1; + + /** specifies composition of a name to be used in data manipulation + + @see XDatabaseMetaData::supportsCatalogsInDataManipulation + @see XDatabaseMetaData::supportsSchemasInDataManipulation + */ + const long ForDataManipulation = 2; + + /** specifies composition of a name to be used in procedure calls + + @see XDatabaseMetaData::supportsCatalogsInProcedureCalls + @see XDatabaseMetaData::supportsSchemasInProcedureCalls + */ + const long ForProcedureCalls = 3; + + /** specifies composition of a name to be used in privilege definitions + + @see XDatabaseMetaData::supportsCatalogsInPrivilegeDefinitions + @see XDatabaseMetaData::supportsSchemasInPrivilegeDefinitions + */ + const long ForPrivilegeDefinitions = 4; + + /** specifies complete composition of a table name, including catalog and schema (if present), + disregarding any database support for catalog and schema in any particular statements + */ + const long Complete = 5; +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/ConnectionTools.idl b/offapi/com/sun/star/sdb/tools/ConnectionTools.idl new file mode 100644 index 000000000..3fc03a133 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/ConnectionTools.idl @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_ConnectionTools_idl__ +#define __com_sun_star_sdb_tools_ConnectionTools_idl__ + +#include <com/sun/star/sdb/tools/XConnectionTools.idl> + +module com { module sun { module star { module sdbc { + published interface XConnection; +};};};}; + +module com { module sun { module star { module sdb { module tools { + +/** + @since LibreOffice 4.1 +*/ +service ConnectionTools : XConnectionTools +{ + createWithConnection([in] com::sun::star::sdbc::XConnection Connection); +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XConnectionSupplier.idl b/offapi/com/sun/star/sdb/tools/XConnectionSupplier.idl new file mode 100644 index 000000000..8e54488d9 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XConnectionSupplier.idl @@ -0,0 +1,48 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XConnectionSupplier_idl__ +#define __com_sun_star_sdb_tools_XConnectionSupplier_idl__ + +#include <com/sun/star/sdbc/XConnection.idl> +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/beans/XPropertySet.idl> + +module com { module sun { module star { module sdb { module tools { + +/** allows to access the active connection + + @see com::sun::star::sdbcx::XConnection + + @since OOo 3.3 +*/ +interface XConnectionSupplier +{ + /** returns the source connection. + */ + [attribute, readonly] com::sun::star::sdbc::XConnection ActiveConnection; + + interface com::sun::star::lang::XInitialization; + +}; +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XConnectionTools.idl b/offapi/com/sun/star/sdb/tools/XConnectionTools.idl new file mode 100644 index 000000000..feb085e6a --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XConnectionTools.idl @@ -0,0 +1,129 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XConnectionTools_idl__ +#define __com_sun_star_sdb_tools_XConnectionTools_idl__ + +#include <com/sun/star/uno/XInterface.idl> +#include <com/sun/star/sdbc/SQLException.idl> + +module com { module sun { module star { + module container { + interface XNameAccess; + }; + module lang { + interface XComponent; + }; +};};}; +module com { module sun { module star { module sdb { + interface XSingleSelectQueryComposer; + module tools { + +interface XTableName; +interface XObjectNames; +interface XDataSourceMetaData; + +/** encapsulates various useful functionality around a + com::sun::star::sdb::Connection + + <p>Most of the functionality provided here is meaningful only relative to + a given database connection. For instance, for quoting table names, you need + the meta data instance of the connection. Thus, the entry point for obtaining + a XConnectionTools instance is the + com::sun::star::sdb::Connection service.</p> + + <p>Note that nearly all functionality provided by this interface is also + available by other means, it's only provided here for convenience purposes.</p> + + @since OOo 2.0.4 +*/ +interface XConnectionTools +{ + /** creates an instance supporting the XTableName interface, + which can be used to manipulate table names for various purposes. + + <p>The returned object is guaranteed to not be `NULL`.</p> + */ + XTableName createTableName(); + + /** returns an instance supporting the XObjectNames interface, + which provides access to functionality around table and query names. + + <p>The returned object is guaranteed to not be `NULL`.</p> + */ + XObjectNames getObjectNames(); + + /** provides access to the application-level data source meta data + */ + XDataSourceMetaData + getDataSourceMetaData(); + + /** get fields for a result set given by a "command descriptor" + + <p>A command descriptor here means: + <ul><li>a SDB-level connection (com.sun.star.sdb::Connection</li> + <li>a string specifying the name of an object relative to the connection</li> + <li>a com.sun.star.sdb::CommandType value specifying the type + of the object</li> + </ul> + </p> + + @param commandType + the type of the object + + @param command + the object. This may be a table name, a query name, or an SQL statement, depending on the value + of _nCommandType + + @param keepFieldsAlive + If (and only if) CommandType is CommandType.COMMAND, the fields collection which is returned + by this function here is a temporary object. It is kept alive by another object, which is to be + created temporarily, too. To ensure that the fields you get are valid as long as you need them, + the owner which controls their life time is transferred to this parameter upon return.<br/> + Your fields live as long as this component lives.<br/> + Additionally, you are encouraged to dispose this component as soon as you don't need the fields anymore. + It depends on the connection's implementation if this is necessary, but the is no guarantee, so to + be on the safe side with respect to resource leaks, you should dispose the component. + + @return + the container of the columns (aka fields) of the object + */ + ::com::sun::star::container::XNameAccess getFieldsByCommandDescriptor( [in] long commandType, + [in] string command, + [out] ::com::sun::star::lang::XComponent keepFieldsAlive + ) raises( com::sun::star::sdbc::SQLException ); + + /** get the composer initialized with a command and command type. + @param commandType + the type of the object + + @param command + the object. This may be a table name, a query name, or an SQL statement, depending on the value + of _nCommandType + @return + the composer filled with command and command type. + */ + ::com::sun::star::sdb::XSingleSelectQueryComposer getComposer([in] long commandType,[in] string command); +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XDataSourceMetaData.idl b/offapi/com/sun/star/sdb/tools/XDataSourceMetaData.idl new file mode 100644 index 000000000..eb7f48159 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XDataSourceMetaData.idl @@ -0,0 +1,41 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XDataSourceMetaData_idl__ +#define __com_sun_star_sdb_tools_XDataSourceMetaData_idl__ + +#include <com/sun/star/uno/XInterface.idl> +#include <com/sun/star/sdbc/SQLException.idl> + +module com { module sun { module star { module sdb { module tools { + +interface XDataSourceMetaData +{ + /** determines whether the data source supports queries in the <code>FROM</code> + part of a <code>SELECT</code> statement. + */ + boolean supportsQueriesInFrom() raises ( com::sun::star::sdbc::SQLException ); +}; + +}; }; }; }; }; + +#endif + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XIndexAlteration.idl b/offapi/com/sun/star/sdb/tools/XIndexAlteration.idl new file mode 100644 index 000000000..7cd7b240f --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XIndexAlteration.idl @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XIndexAlteration_idl__ +#define __com_sun_star_sdb_tools_XIndexAlteration_idl__ + +#include <com/sun/star/sdbc/SQLException.idl> +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/beans/XPropertySet.idl> + +module com { module sun { module star { module sdb { module tools { + +/** allows to alter the indexes of a table. + + @see com::sun::star::sdb::DataSource::Settings + @see com::sun::star::sdbcx::XAppend + @see com::sun::star::sdbcx::XDrop + + @since OOo 3.3 +*/ +interface XIndexAlteration +{ + interface XConnectionSupplier; + + /** drops an object of the related container identified by its name. + @param table + the table to be altered + @param index + the name of the column to be dropped + @throws com::sun::star::sdbc::SQLException + if a database access error occurs. + */ + void dropIndex([in] com::sun::star::beans::XPropertySet table,[in] string index) + raises ( com::sun::star::sdbc::SQLException); + + /** creates a new object using the given descriptor and appends it + to the related container. + <b> + Note: + </b> + The descriptor will not be changed and can be used again to append another object. + @param table + the table to be altered + @param descriptor + the descriptor which should be serve to append a new object + @throws com::sun::star::sdbc::SQLException + if a database access error occurs. + */ + void addIndex([in] com::sun::star::beans::XPropertySet table,[in]com::sun::star::beans::XPropertySet descriptor) + raises (com::sun::star::sdbc::SQLException); + + +}; +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XKeyAlteration.idl b/offapi/com/sun/star/sdb/tools/XKeyAlteration.idl new file mode 100644 index 000000000..961ec8c94 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XKeyAlteration.idl @@ -0,0 +1,75 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XKeyAlteration_idl__ +#define __com_sun_star_sdb_tools_XKeyAlteration_idl__ + +#include <com/sun/star/sdbc/SQLException.idl> +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/beans/XPropertySet.idl> + +module com { module sun { module star { module sdb { module tools { + +/** allows to alter the keys of a table. + + @see com::sun::star::sdb::DataSource::Settings + @see com::sun::star::sdbcx::XAppend + @see com::sun::star::sdbcx::XDrop + + @since OOo 3.3 +*/ +interface XKeyAlteration +{ + interface XConnectionSupplier; + + /** drops an object of the related container identified by its name. + @param table + the table to be altered + @param key + the key to be dropped + @throws com::sun::star::sdbc::SQLException + if a database access error occurs. + */ + void dropKey([in] com::sun::star::beans::XPropertySet table,[in] com::sun::star::beans::XPropertySet key) + raises ( com::sun::star::sdbc::SQLException); + + /** creates a new object using the given descriptor and appends it + to the related container. + <b> + Note: + </b> + The descriptor will not be changed and can be used again to append another object. + @param table + the table to be altered + @param descriptor + the descriptor which should be serve to append a new object + @throws com::sun::star::sdbc::SQLException + if a database access error occurs. + */ + void addKey([in] com::sun::star::beans::XPropertySet table,[in]com::sun::star::beans::XPropertySet descriptor) + raises (com::sun::star::sdbc::SQLException); + + +}; +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XObjectNames.idl b/offapi/com/sun/star/sdb/tools/XObjectNames.idl new file mode 100644 index 000000000..a82bd59a8 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XObjectNames.idl @@ -0,0 +1,164 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XObjectNames_idl__ +#define __com_sun_star_sdb_tools_XObjectNames_idl__ + +#include <com/sun/star/lang/IllegalArgumentException.idl> +#include <com/sun/star/sdbc/SQLException.idl> + +module com { module sun { module star { module sdb { module tools { + +/** encapsulates functionality which you might find useful when writing a + database application which deals with query and table names. + + <p>The most important task fulfilled by this instance is that it hides + different naming restrictions from you, which are caused by server-side + or client side specialties.</p> + + <p>For instance, it can validate names against + the characters allowed in the object names of a connection. Also, it + relieves you from caring whether a database supports queries in a <code>SELECT</code> + statement's <code>FROM</code> part (known as "queries in queries"). In such + databases, query and table names share a common namespace, thus they must be + unique. Using this interface, you can easily ensure this uniqueness.</p> + + <p>All of the functionality present in this interface depends on a connection, + thus it entry point for obtaining it is a com::sun::star::sdb::Connection + service.</p> + + <p>The component itself does not have life-time control mechanisms, i.e. you + cannot explicitly dispose it (com::sun::star::lang::XComponent::dispose()), + and you cannot be notified when it dies.<br/> + However, if your try to access any of its methods or attributes, after the + connection which was used to create it was closed, a com::sun::star::lang::DisposedException + will be thrown.</p> + + @see XConnectionTools + + @since OOo 2.0.4 +*/ +interface XObjectNames +{ + /** suggests a (unique) table or query name + + <p>If in the database, tables and queries share a common namespace, this will be respected + by this function.</p> + + <p>Note that in an multi-threaded environment, the name you obtain here is not absolutely + guaranteed to be unique. It is unique at the very moment the function returns to you. + But already when you evaluate the returned value, it might not be unique anymore, if + another process or thread created a query or table with this name.</p> + + <p>This implies that you cannot rely on the name's uniqueness, but you can use it as + first guess to present to the user. In most cases, it will still be sufficient when + you are actually creating the table respectively query.</p> + + @param CommandType + specifies the com::sun::star::sdb::CommandType of the object for which + a unique name is to be generated. Must be either com::sun::star::sdb::CommandType::TABLE + or com::sun::star::sdb::CommandType::QUERY. + + @param BaseName + specifies the base of the to-be-created object name. If empty, a default + base name will be used. + + @throws com::sun::star::lang::IllegalArgumentException + if CommandType specifies an invalid command type. + */ + string suggestName( [in] long CommandType, [in] string BaseName ) + raises ( com::sun::star::lang::IllegalArgumentException, + com::sun::star::sdbc::SQLException ); + + /** converts the given object name to a name which is valid in the database. + + <p>The conversion takes place by converting every character which is neither + allowed by the SQL-92 standard, nor part of the special characters supported + by the database, with an underscore character (_).</p> + + @see com::sun::star::sdbc::XDatabaseMetaData::getExtraNameCharacters + */ + string convertToSQLName( [in] string Name ); + + /** checks whether a given name is used as table respectively query name in the database. + + <p>If in the database, tables and queries share a common namespace, this will be respected + by this function.</p> + + <p>As before, the information you obtain by calling this method might be obsolete + in the very moment you evaluate this, in case another process or thread interferes. + However, it's usually sufficiently up-to-date for purpose of using it in a database + application driven by user interactions.</p> + + @param CommandType + specifies the com::sun::star::sdb::CommandType of the object whose + name should be checked. Must be either com::sun::star::sdb::CommandType::TABLE + or com::sun::star::sdb::CommandType::QUERY. + + @param Name + specifies the to-be-checked name of the object. + + @return + `TRUE` if and only if the given name is legitimate as table respectively query name + to be used in the database. + + @throws com::sun::star::lang::IllegalArgumentException + if CommandType specifies an invalid command type. + + @see checkNameIsUsed + */ + boolean isNameUsed( [in] long CommandType, [in] string Name ) + raises ( com::sun::star::lang::IllegalArgumentException, + com::sun::star::sdbc::SQLException ); + + /** checks whether a given name is valid as table or query name + + <p>For tables, the name must consist of characters allowed by the SQL-92 standard, + plus characters allowed by the connection as extra name characters.</p> + + <p>For queries, names are nearly arbitrary, except that usual quoting characters + must not be part of the name.</p> + + @see com::sun::star::sdbc::XDatabaseMetaData::getExtraNameCharacters + */ + boolean isNameValid( [in] long CommandType, [in] string Name ) + raises ( com::sun::star::lang::IllegalArgumentException ); + + /** checks whether a given name is allowed for a to-be-created table or query in the + database. + + <p>This method basically does the same checks as isNameUsed() and + isNameValid(). In case the given name is not allowed, it throws an + exception. This error can be presented to the user, to give it a common experience + in all cases where he's required to enter an object name.</p> + + @see isNameUsed + @see isNameValid + @see com::sun::star::sdb::ErrorMessageDialog + @see com::sun::star::sdb::InteractionHandler + */ + void checkNameForCreate( [in] long CommandType, [in] string Name ) + raises ( com::sun::star::sdbc::SQLException ); +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XTableAlteration.idl b/offapi/com/sun/star/sdb/tools/XTableAlteration.idl new file mode 100644 index 000000000..76ea4d5cf --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XTableAlteration.idl @@ -0,0 +1,94 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XTableAlteration_idl__ +#define __com_sun_star_sdb_tools_XTableAlteration_idl__ + +#include <com/sun/star/sdbc/SQLException.idl> +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/beans/XPropertySet.idl> + +module com { module sun { module star { module sdb { module tools { + +/** allows to alter a table. + + @see com::sun::star::sdb::DataSource::Settings + @see com::sun::star::sdbcx::ColumnDescriptor + @see com::sun::star::sdbcx::XAlterTable + @see com::sun::star::sdbcx::XAppend + @see com::sun::star::sdbcx::XDrop + + @since OOo 3.3 +*/ +interface XTableAlteration +{ + interface XConnectionSupplier; + + /** alter the column defined by name + + @param table + the table to be altered + + @param columnName + the name of the column to be changed + + @param columnDescriptor + the column descriptor with the information of the new column definition + + @throws com::sun::star::sdbc::SQLException + @see com::sun::star::sdbcx::XAlterTable + */ + void alterColumnByName( [in] com::sun::star::beans::XPropertySet table, [in] string columnName, [in] com::sun::star::beans::XPropertySet columnDescriptor) + raises ( com::sun::star::sdbc::SQLException ); + + /** creates a new object using the given descriptor and appends it + to the related container. + <b> + Note: + </b> + The descriptor will not be changed and can be used again to append another object. + @param table + the table to be altered + @param descriptor + the descriptor which should be serve to append a new object + @throws com::sun::star::sdbc::SQLException + if a database access error occurs. + @see com::sun::star::sdbcx::XAppend + */ + void addColumn([in] com::sun::star::beans::XPropertySet table,[in]com::sun::star::beans::XPropertySet descriptor) + raises (com::sun::star::sdbc::SQLException); + + /** drops an object of the related container identified by its name. + @param table + the table to be altered + @param columnName + the name of the column to be dropped + @throws com::sun::star::sdbc::SQLException + if a database access error occurs. + @see com::sun::star::sdbcx::XDrop + */ + void dropColumn([in] com::sun::star::beans::XPropertySet table,[in]string columnName) + raises ( com::sun::star::sdbc::SQLException); +}; +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XTableName.idl b/offapi/com/sun/star/sdb/tools/XTableName.idl new file mode 100644 index 000000000..4a196c429 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XTableName.idl @@ -0,0 +1,134 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XTableName_idl__ +#define __com_sun_star_sdb_tools_XTableName_idl__ + +#include <com/sun/star/lang/IllegalArgumentException.idl> +#include <com/sun/star/container/NoSuchElementException.idl> +#include <com/sun/star/beans/XPropertySet.idl> + +module com { module sun { module star { module sdb { module tools { + +/** allows to manipulate table names. + + <p>When, in a database application, dealing with table names, there's many degrees + of freedom to deal with. For instance, suppose you want to have the full name of a + table object, as it should be used in a <code>SELECT</code> statement's <code>FROM</code> + part. This requires you to evaluate whether or not the table has a catalog and/or schema + name, to combine the catalog, the schema, and the basic table name into one name, respecting + the database's quoting character, and the order in which all those parts should be combined. + Additionally, you have to respect the client-side settings which tell OpenOffice.org + to use or not use catalogs and schemas in <code>SELECT</code> at all.</p> + + <p>The XTableName interface eases this and other, similar tasks around table + names.</p> + + <p>The component itself does not have life-time control mechanisms, i.e. you + cannot explicitly dispose it (com::sun::star::lang::XComponent::dispose()), + and you cannot be notified when it dies.<br/> + However, if your try to access any of its methods or attributes, after the + connection which was used to create it was closed, a com::sun::star::lang::DisposedException + will be thrown.</p> + + @see XConnectionTools + @see com::sun::star::sdbc::XDatabaseMetaData + @see com::sun::star::sdb::DataSource::Settings + + @since OOo 2.0.4 +*/ +interface XTableName +{ + /** denotes the name of the catalog which the table is a part of + */ + [attribute] string CatalogName; + + /** denotes the name of the schema which the table is a part of + */ + [attribute] string SchemaName; + + /** denotes the mere, unqualified table name, excluding any catalog and + schema. + */ + [attribute] string TableName; + + /** returns the composed table name, including the catalog and schema name, + respecting the database's quoting requirements, plus + + @param Type + the type of name composition to be used. + + @param Quote + specifies whether the single parts of the table name should be quoted + + @see CompositionType + + @throws com::sun::star::IllegalArgumentException + if the given Type does not denote a valid CompositionType + */ + string getComposedName( [in] long Type, [in] boolean Quote ) + raises ( com::sun::star::lang::IllegalArgumentException ); + + + /** sets a new composed table name + @param ComposedName + specifies the composed table name + @param Type + specifies the composition type which was used to create the composed table name + */ + void setComposedName( [in] string ComposedName, [in] long Type ); + + /** represents the table name in a form to be used in a <code>SELECT</code> statement. + + <p>On a per-data-source basis, OpenOffice.org allows to override database meta + data information in that you can specify to not use catalog and or schema names + in <code>SELECT</code> statements. Using this attribute, you can generate a table + name which respects those settings.</p> + + @see com::sun::star::sdb::DataSource::Settings + */ + [attribute, readonly] string NameForSelect; + + /** is the com::sun::star::sdb::Table object specified + by the current name. + + <p>Retrieving this attribute is equivalent to obtaining the tables + container from the connection (via com::sun::star::sdbcx::XTablesSupplier), + and calling its com::sun::star::container::XNameAccess::getByName() + method with the ComposedName.</p> + + @throws com::sun::star::container::NoSuchElementException + if, upon getting the attribute value, the current composed table name + represented by this instance does not denote an existing table in the database. + @throws com::sun::star::lang::IllegalArgumentException + if you try to set an object which does not denote a table from the underlying + database. + */ + [attribute] ::com::sun::star::beans::XPropertySet Table + { + get raises ( com::sun::star::container::NoSuchElementException ); + set raises ( com::sun::star::lang::IllegalArgumentException ); + }; +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XTableRename.idl b/offapi/com/sun/star/sdb/tools/XTableRename.idl new file mode 100644 index 000000000..d6e955581 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XTableRename.idl @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XTableRename_idl__ +#define __com_sun_star_sdb_tools_XTableRename_idl__ + +#include <com/sun/star/sdbc/SQLException.idl> +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/beans/XPropertySet.idl> + +module com { module sun { module star { module sdb { module tools { + +/** allows to rename table. + + @see com::sun::star::sdb::DataSource::Settings + + @since OOo 3.3 +*/ +interface XTableRename +{ + interface XConnectionSupplier; + + /** rename the given table to the new name + + @param table + the table to be renamed + @param newName + the new name of the table + @throws com::sun::star::sdbc::SQLException + */ + void rename( [in] com::sun::star::beans::XPropertySet table, [in] string newName) + raises ( com::sun::star::sdbc::SQLException ); + + +}; +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/sdb/tools/XViewAccess.idl b/offapi/com/sun/star/sdb/tools/XViewAccess.idl new file mode 100644 index 000000000..5a7b4fb9a --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XViewAccess.idl @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * 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 . + */ + +#ifndef __com_sun_star_sdb_tools_XViewAccess_idl__ +#define __com_sun_star_sdb_tools_XViewAccess_idl__ + +#include <com/sun/star/sdbc/SQLException.idl> +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#include <com/sun/star/lang/XInitialization.idl> +#include <com/sun/star/beans/XPropertySet.idl> + +module com { module sun { module star { module sdb { module tools { + +/** allows to fetch and to change the sql statements of views + + @see com::sun::star::sdb::DataSource::Settings + @see com::sun::star::sdbcx::View + + @since OOo 3.3 +*/ +interface XViewAccess +{ + interface XConnectionSupplier; + + /** returns the SQL statement of the view + + @param view + the table to be renamed + @throws com::sun::star::sdbc::SQLException + */ + string getCommand( [in] com::sun::star::beans::XPropertySet view) + raises ( com::sun::star::sdbc::SQLException ); + + /** allows to alter the SQL statement of a view + + @param view + the view to be altered + + @param command + the new SQL statement + + @throws com::sun::star::sdbc::SQLException + */ + void alterCommand( [in] com::sun::star::beans::XPropertySet view, [in] string command) + raises ( com::sun::star::sdbc::SQLException ); +}; +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |