diff options
Diffstat (limited to 'offapi/com/sun/star/sdb/tools')
-rw-r--r-- | offapi/com/sun/star/sdb/tools/CompositionType.idl | 89 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XConnectionSupplier.idl | 67 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XConnectionTools.idl | 146 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XDataSourceMetaData.idl | 53 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XIndexAlteration.idl | 96 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XKeyAlteration.idl | 96 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XObjectNames.idl | 179 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XTableAlteration.idl | 115 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XTableName.idl | 154 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XTableRename.idl | 78 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/XViewAccess.idl | 88 | ||||
-rw-r--r-- | offapi/com/sun/star/sdb/tools/makefile.mk | 59 |
12 files changed, 1220 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 000000000000..750df9b5e0d7 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/CompositionType.idl @@ -0,0 +1,89 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_CompositionRule_idl__ +#define __com_sun_star_sdb_tools_CompositionRule_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 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 000000000000..c0ec570ccf60 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XConnectionSupplier.idl @@ -0,0 +1,67 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XConnectionSupplier.idl,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XConnectionSupplier_idl__ +#define __com_sun_star_sdb_tools_XConnectionSupplier_idl__ + +#include <com/sun/star/sdbc/XConnection.idl> +#ifndef __com_sun_star_lang_XInitialization_idl__ +#include <com/sun/star/lang/XInitialization.idl> +#endif +#ifndef __com_sun_star_beans_XPropertySet_idl__ +#include <com/sun/star/beans/XPropertySet.idl> +#endif + +//============================================================================= +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 + 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 000000000000..29e47c597e09 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XConnectionTools.idl @@ -0,0 +1,146 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XConnectionTools_idl__ +#define __com_sun_star_sdb_tools_XConnectionTools_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif +#ifndef __com_sun_star_sdbc_SQLException_idl__ +#include <com/sun/star/sdbc/SQLException.idl> +#endif + +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 + <type scope="com::sun::star::sdb">Connection</type> + + <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 <type>XConnectionTools</type> instance is the + <type scope="com::sun::star::sdb">Connection</type> 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 <type>XTableName</type> interface, + which can be used to manipulate table names for various purposes. + + <p>The returned object is guanrateed to not be <NULL/>.</p> + */ + XTableName createTableName(); + + /** returns an instance supporting the <type>XObjectNames</type> interface, + which provides access to functionality around table and query names. + + <p>The returned object is guanrateed 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 (<type scope="com.sun.star.sdb">Connection</type></li> + <li>a string specifying the name of an object relative to the connection</li> + <li>a <type scope="com.sun.star.sdb">CommandType</type> value specifying the type + of the object</type></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 <arg>_nCommandType</arg> + + @param _rxCollectionOner + If (and only if) <arg>CommandType</arg> 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 transfered 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 <arg>_nCommandType</arg> + @return + the composer filled with command and command type. + */ + ::com::sun::star::sdb::XSingleSelectQueryComposer getComposer([in] long commandType,[in] string command); +}; + +//============================================================================= +}; }; }; }; }; +//============================================================================= + +#endif 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 000000000000..b2b00c758250 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XDataSourceMetaData.idl @@ -0,0 +1,53 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XDataSourceMetaData_idl__ +#define __com_sun_star_sdb_tools_XDataSourceMetaData_idl__ + +#ifndef __com_sun_star_uno_XInterface_idl__ +#include <com/sun/star/uno/XInterface.idl> +#endif + +//============================================================================= +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( ); +}; + +//============================================================================= +}; }; }; }; }; +//============================================================================= + +#endif + + 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 000000000000..fdc7ce517ca8 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XIndexAlteration.idl @@ -0,0 +1,96 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XIndexAlteration.idl,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XIndexAlteration_idl__ +#define __com_sun_star_sdb_tools_XIndexAlteration_idl__ + +#ifndef __com_sun_star_sdbc_SQLException_idl__ +#include <com/sun/star/sdbc/SQLException.idl> +#endif +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#ifndef __com_sun_star_lang_XInitialization_idl__ +#include <com/sun/star/lang/XInitialization.idl> +#endif +#ifndef __com_sun_star_beans_XPropertySet_idl__ +#include <com/sun/star/beans/XPropertySet.idl> +#endif + +//============================================================================= +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 + 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 000000000000..44389dfe64fd --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XKeyAlteration.idl @@ -0,0 +1,96 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XKeyAlteration.idl,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XKeyAlteration_idl__ +#define __com_sun_star_sdb_tools_XKeyAlteration_idl__ + +#ifndef __com_sun_star_sdbc_SQLException_idl__ +#include <com/sun/star/sdbc/SQLException.idl> +#endif +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#ifndef __com_sun_star_lang_XInitialization_idl__ +#include <com/sun/star/lang/XInitialization.idl> +#endif +#ifndef __com_sun_star_beans_XPropertySet_idl__ +#include <com/sun/star/beans/XPropertySet.idl> +#endif + +//============================================================================= +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 + 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 000000000000..16b2bae93baa --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XObjectNames.idl @@ -0,0 +1,179 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XObjectNames_idl__ +#define __com_sun_star_sdb_tools_XObjectNames_idl__ + +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif + +#ifndef __com_sun_star_sdbc_SQLException_idl__ +#include <com/sun/star/sdbc/SQLException.idl> +#endif + +//============================================================================= +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 specialities.</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> + statment'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 <type scope="com::sun::star::sdb">Connection</type> + service.</p> + + <p>The component itself does not have life-time control mechanimns, i.e. you + cannot explicitly dispose it (<member scope="com::sun::star::lang">XComponent::dispose</member>), + 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 <type scope="com::sun::star::lang">DisposedException</type> + 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 uniquey 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 <type scope="com::sun::star::sdb">CommandType</type> of the object for which + a unique name is to be generated. Must be either <member scope="com::sun::star::sdb">CommandType::TABLE</member> + or <member scope="com::sun::star::sdb">CommandType::QUERY</member>. + + @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 <arg>CommandType</arg> specifies an invalid command type. + */ + string suggestName( [in] long CommandType, [in] string BaseName ) + raises ( com::sun::star::lang::IllegalArgumentException ); + + /** 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 <type scope="com::sun::star::sdb">CommandType</type> of the object whose + name should be checked. Must be either <member scope="com::sun::star::sdb">CommandType::TABLE</member> + or <member scope="com::sun::star::sdb">CommandType::QUERY</member>. + + @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 <arg>CommandType</arg> specifies an invalid command type. + + @see checkNameIsUsed + */ + boolean isNameUsed( [in] long CommandType, [in] string Name ) + raises ( com::sun::star::lang::IllegalArgumentException ); + + /** 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 <member>isNameUsed</member> and + <member>isNameValid</member>. 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 + 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 000000000000..fe0fe494fead --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XTableAlteration.idl @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XTableAlteration.idl,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XTableAlteration_idl__ +#define __com_sun_star_sdb_tools_XTableAlteration_idl__ + +#ifndef __com_sun_star_sdbc_SQLException_idl__ +#include <com/sun/star/sdbc/SQLException.idl> +#endif +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#ifndef __com_sun_star_lang_XInitialization_idl__ +#include <com/sun/star/lang/XInitialization.idl> +#endif +#ifndef __com_sun_star_beans_XPropertySet_idl__ +#include <com/sun/star/beans/XPropertySet.idl> +#endif + +//============================================================================= +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 + 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 000000000000..48070da02fe6 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XTableName.idl @@ -0,0 +1,154 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XTableName_idl__ +#define __com_sun_star_sdb_tools_XTableName_idl__ + +#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ +#include <com/sun/star/lang/IllegalArgumentException.idl> +#endif + +#ifndef __com_sun_star_container_NoSuchElementException_idl__ +#include <com/sun/star/container/NoSuchElementException.idl> +#endif + +#ifndef __com_sun_star_beans_XPropertySet_idl__ +#include <com/sun/star/beans/XPropertySet.idl> +#endif + +//============================================================================= +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 <type>XTableName</type> interface eases this and other, similar tasks around table + names.</p> + + <p>The component itself does not have life-time control mechanimns, i.e. you + cannot explicitly dispose it (<member scope="com::sun::star::lang">XComponent::dispose</member>), + 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 <type scope="com::sun::star::lang">DisposedException</type> + 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 databases'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 <arg>Type</arg> does not denote a valid <type>CompositionType</type> + */ + 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 <type scope="com::sun::star::sdb">Table</type> object specified + by the current name. + + <p>Retrieving this attribute is equivalent to obtaining the tables + container from the connection (via <type scope="com::sun::star::sdbcx">XTablesSupplier</type>), + and calling its <member scope="com::sun::star::container">XNameAccess::getByName</member> + 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 + 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 000000000000..f61d736bae8c --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XTableRename.idl @@ -0,0 +1,78 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XTableRename.idl,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XTableRename_idl__ +#define __com_sun_star_sdb_tools_XTableRename_idl__ + +#ifndef __com_sun_star_sdbc_SQLException_idl__ +#include <com/sun/star/sdbc/SQLException.idl> +#endif +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#ifndef __com_sun_star_lang_XInitialization_idl__ +#include <com/sun/star/lang/XInitialization.idl> +#endif +#ifndef __com_sun_star_beans_XPropertySet_idl__ +#include <com/sun/star/beans/XPropertySet.idl> +#endif + +//============================================================================= +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 + 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 000000000000..e64727341e81 --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/XViewAccess.idl @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XViewAccess.idl,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_sdb_tools_XViewAccess_idl__ +#define __com_sun_star_sdb_tools_XViewAccess_idl__ + +#ifndef __com_sun_star_sdbc_SQLException_idl__ +#include <com/sun/star/sdbc/SQLException.idl> +#endif +#include <com/sun/star/sdb/tools/XConnectionSupplier.idl> +#ifndef __com_sun_star_lang_XInitialization_idl__ +#include <com/sun/star/lang/XInitialization.idl> +#endif +#ifndef __com_sun_star_beans_XPropertySet_idl__ +#include <com/sun/star/beans/XPropertySet.idl> +#endif + +//============================================================================= +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 + diff --git a/offapi/com/sun/star/sdb/tools/makefile.mk b/offapi/com/sun/star/sdb/tools/makefile.mk new file mode 100644 index 000000000000..1bc7e6b11c7d --- /dev/null +++ b/offapi/com/sun/star/sdb/tools/makefile.mk @@ -0,0 +1,59 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org 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 version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/..$/..$/.. + +PRJNAME=offapi + +TARGET=csssdbtools +PACKAGE=com$/sun$/star$/sdb$/tools + +# --- Settings ----------------------------------------------------- +.INCLUDE : $(PRJ)$/util$/makefile.pmk + + +UNOIDLDEFS += -w + +# ------------------------------------------------------------------------ +IDLFILES=\ + CompositionType.idl \ + XConnectionTools.idl \ + XDataSourceMetaData.idl \ + XObjectNames.idl \ + XTableName.idl \ + XTableRename.idl \ + XViewAccess.idl \ + XTableAlteration.idl \ + XKeyAlteration.idl \ + XIndexAlteration.idl \ + XConnectionSupplier.idl + +# ------------------------------------------------------------------ +.INCLUDE : target.mk +.INCLUDE : $(PRJ)$/util$/target.pmk + + |