/* -*- 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_application_CopyTableWizard_idl__
#define __com_sun_star_sdb_application_CopyTableWizard_idl__
#include There are various cases where the wizard needs to interact with the user (except of
course the obvious case to display and operate the wizard dialog itself). For those cases,
an interaction handler is needed, which is used for
SQLException
, usually) that happened.
When you do not specify an interaction handler by using the
createWithInteractionHandler() constructor, the wizard will use the interaction
handler associated with the copy target, i.e. the interaction handler specified when loading
the document which the copy target refers to. If the copy target cannot be associated with
a database document (e.g. because it is a mere ConnectionResource
, or a connection
not obtained from a data source), or if the copy target's database document cannot provide
an interaction handler, a newly-created instance of an interaction handler is used.
There's one exception to the above, however: Upon creating the copy table wizard, the copy source and the copy target descriptors are used to create a Connection. For any interaction during this phase - including, for instance, necessary authentication -, the interaction handler of the respective data source is used, no matter what you specified in createWithInteractionHandler(). Only if there is no such interaction handler, the processing described above, to find another handler, is applied.
@see ::com::sun::star::sdb::ParametersRequest @see XCopyTableWizard::addCopyTableListener @see CopyTableContinuation @see ::com::sun::star::document::MediaDescriptor::InteractionHandler @see ::com::sun::star::sdb::DatabaseDocument @see ::com::sun::star::sdb::DataSource @see ::com::sun::star::sdb::DataAccessDescriptor::ConnectionResource @see ::com::sun::star::sdb::InteractionHandler @since OOo 2.4 */ service CopyTableWizard : XCopyTableWizard { /** creates an executable wizard dialog, which is to guide the user through copying a table from one database to another.At creation time, an attempt will be made to obtain the connections described by Source resp. Dest. Failing to do so will result in an exception.
If the connection has been newly created by the wizard (e.g. because the
data access descriptor specified a DataSource
instead of an ActiveConnection
),
then this connection will be disposed upon disposal of the wizard.
The following members of the DataAccessDescriptor
are supported, and evaluated
in the given order:
ActiveConnection
DataSourceName
DatabaseLocation
ConnectionResource
ConnectionInfo
Command
CommandType
Command
and CommandType
are required.
Additionally to the obvious restrictions (such as that creating a view is not possible if the copy source and the copy destination denote different databases), the following restrictions apply to the settings, and possible combinations:
ConnectionResource
, or an
ActiveConnection
which implements a com::sun::star::sdbc::Connection only
(as opposed to a com::sun::star::sdb::Connection), then the resulting connection is
not able to provide queries, thus a command type QUERY
will be rejected.Filter
, Order
, HavingClause
and GroupBy
are unsupported at the moment.Only DataSourceName
, DatabaseLocation
, ActiveConnection
are supported, effectively describing the target connection to copy the data to. They're evaluated
in the order mentioned here, so if multiple of the are present, only the first one is evaluated.
Also, at the moment the connection which is implied by either of the settings above must support the com::sun::star::sdb::Connection service. In particular, it is not sufficient to pass an SDBC-level connection.
Note that creating a view (see CopyTableOperation::CreateAsView) is not supported if the target connection is an SDBC-level connection only.
@throws ::com::sun::star::lang::IllegalArgumentException ifSource
or Destination
is `NULL`Source
or Destination
are not sufficient
to describe a database connection.Source
is not sufficient to describe the to-be-copied dataSource
or Destination
contain unsupported settings.DataSourceName
member.
@see ::com::sun::star::sdb::DataAccessDescriptor
*/
create(
[in] ::com::sun::star::beans::XPropertySet Source,
[in] ::com::sun::star::beans::XPropertySet Destination
)
raises ( ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::sdbc::SQLException
, ::com::sun::star::lang::WrappedTargetException
);
/** creates an executable wizard dialog, which is to guide the user through copying
a table from one database to another.
The only difference to the create() constructor is that
createWithInteractionHandler
takes an additional argument, which
can be used to intercept interactions (such as error messages) during the wizard
run.
When specifying this parameter, you should use an implementation supporting the com::sun::star::sdb::InteractionHandler, since the general-purpose com::sun::star::task::InteractionHandler cannot handle all requests described above.
@see ::com::sun::star::sdb::InteractionHandler */ createWithInteractionHandler( [in] ::com::sun::star::beans::XPropertySet Source, [in] ::com::sun::star::beans::XPropertySet Destination, [in] ::com::sun::star::task::XInteractionHandler InteractionHandler ) raises ( ::com::sun::star::lang::IllegalArgumentException , ::com::sun::star::sdbc::SQLException , ::com::sun::star::lang::WrappedTargetException ); }; }; }; }; }; }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */