1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
21 module com
{ module sun
{ module star
{ module sdbc
{
22 published
interface XIsolatedConnection
;
23 published
interface XDataSource
;
27 module com
{ module sun
{ module star
{ module sdb
{
29 published
interface XCompletedConnection
;
30 published
interface XQueryDefinitionsSupplier
;
31 published
interface XBookmarksSupplier
;
34 /** is a factory to establish database connections. It should be registered at
35 a com::sun::star::uno::NamingService.
36 @see com::sun::star::sdb::DatabaseContext
38 published service DataSource
40 interface com
::sun
::star
::beans
::XPropertySet
;
43 /** useful for establishing connections with the completion of connection parameters
44 provided during user interaction.
46 interface XCompletedConnection
;
48 /** useful for establishing isolated connections which are not shared among others
49 as it is the case when using XCompletedConnection or com::sun::star::sdbc::XDataSource.
50 @see XCompletedConnection
51 @see com::sun::star::sdbc::XDataSource
54 interface com
::sun
::star
::sdbc
::XIsolatedConnection
;
57 /** is provided to flush a DataSource within to a Database Context.
59 interface com
::sun
::star
::util
::XFlushable
;
62 /** provides the access to DataSource related queries.
64 The object returned by the
65 com::sun::star::sdb::XQueryDefinitionsSupplier::getQueryDefinitions()
67 com::sun::star::sdb::DefinitionContainer
71 interface XQueryDefinitionsSupplier
;
73 /* useful for establishing connections and to get and set the login timeout.
75 interface com
::sun
::star
::sdbc
::XDataSource
;
77 /** provides access to bookmarks to documents associated with the data source
79 The object returned by the
80 com::sun::star::sdb::XBookmarksSupplier::getBookmarks()
82 com::sun::star::sdb::DefinitionContainer
86 [optional] interface XBookmarksSupplier
;
88 /** is the name of the data source.
90 <p>If the data source is registered at the database context, then the <code>Name</code> property
91 denotes the registration name. Otherwise, the name property contains the URL of the file which the
92 database document associated with the data source is based on.</p>
94 <p>If the same data source is registered under different names, the value of the <code>Name</code>
95 property is not defined.</p>
97 [readonly, property
] string Name
;
100 /** indicates a database url of the form <br>
101 <code> jdbc:<em>subprotocol</em>:<em>subname</em></code>
103 <code>sdbc:<em>subprotocol</em>:<em>subname</em></code>
105 [property
] string URL
;
108 /** is a list of arbitrary string tag/value pairs as connection arguments
110 <p>The DataSource itself does not attempt to interpret any of those values.</p>
112 <p>Instead, the values in this property have two use cases:
113 <ul><li>Upon creating a connection, for every value in this sequence it's checked
114 whether the com::sun::star::sdbc::XDriver which is to provide
115 the connection supports a setting with the respective name, using its
116 com::sun::star::sdbc::XDriver::getPropertyInfo() method.br/>
117 If so, the settings is passed to the driver's
118 com::sun::star::sdbc::XDriver::connect() method. If not,
119 the setting is ignored.</li>
120 <li>External components may use the settings to carry arbitrary information with
121 the data source. Usually, this is used to control the behavior of components
122 working with the data source.</li>
125 [property
] sequence
<com
::sun
::star
::beans
::PropertyValue
> Info
;
127 /** is a convenience wrapper around the #Info property.
129 <p>Since fiddling around with a sequence of property values is somewhat uncomfortable
130 in all known UNO language bindings (especially for tasks like simply changing the value
131 of an existing value), the #Settings property wraps the #Info
132 property for easier single-value access.</p>
134 <p>You should use the #Settings property if you need to access a few properties only,
135 and the #Info property if you need access to all existent settings at once.</p>
137 <p>The object represented by this property supports the com::sun::star::beans::PropertyBag
138 service. That is, you can at runtime add arbitrary new properties to the bag.</p>
140 <p>Additionally, the property bag supports default values of properties, and thus the
141 com::sun::star::beans::XPropertyState interface. If you add an own property to
142 the bag using com::sun::star::beans::XPropertyContainer::addProperty(), you need
143 to specify an initial value, which is also used as default value (exceptions see below).</p>
145 <p>Effectively, the property bag represented by <code>Settings</code> contains two classes of properties:
146 Pre-defined ones and user-defined ones.</p>
148 <p><em>Pre-defined</em> properties are properties which are potentially used by the data source, the
149 application UI for the data source, or a particular backend driver employed by the data source. There's
150 a large set of such properties, no all of them are effectively used for a concrete data source, nonetheless,
151 they're all present in the <code>Settings</code>.<br/>
152 Such properties are not removable from the bag, that is, their
153 com::sun::star::beans::PropertyAttribute::REMOVABLE attribute is <em>not</em> set.<br/>
154 Usually, you'll find that all of this properties have the
155 com::sun::star::beans::PropertyState::PropertyState_DEFAULT_VALUE state.</p>
157 <p><em>User-defined</em> properties are the ones which are added at runtime by any instance. They might or might
158 not be removable, this depends on whether or not the code adding them specifies the
159 com::sun::star::beans::PropertyAttribute::REMOVABLE attribute. Also, they might
160 or might not have a default value, determined by the
161 com::sun::star::beans::PropertyAttribute::MAYBEDEFAULT attribute at the time they're added
164 <p>When a data source is made persistent, then properties which are not removable (which are assumed to be the
165 pre-defined properties) are ignored when they are in <code>DEFAULT</code> state. All other properties are
166 always made persistent, except when an explicit
167 com::sun::star::beans::PropertyAttribute::TRANSIENT attribute prohibits this.</p>
169 <p>Similar, when you obtain the #Info property of a <code>DataSource</code>, the
170 <code>Settings</code> bag is asked for all its property values, and the ones which are removable and
171 in state default are stripped, and <em>not</em> returned in the <code>Info</code> sequence.</p>
173 [property
, readonly, optional] com
::sun
::star
::beans
::XPropertySet Settings
;
175 /** determines a users login name.
177 [property
] string User
;
180 /** determines a users password. The password is not persistent.
182 [property
] string Password
;
185 /** indicates that a password is always necessary.
187 [property
] boolean IsPasswordRequired
;
190 /** indicates that components displaying data obtained from this
191 data source should suppress columns used for versioning.
193 [property
] boolean SuppressVersionColumns
;
196 /** determines whether modifications on the data source are allowed or not.
198 [readonly, property
] boolean IsReadOnly
;
201 /** provides an object for formatting numbers.
203 [readonly, property
] com
::sun
::star
::util
::XNumberFormatsSupplier
204 NumberFormatsSupplier
;
207 /** defines a list of tables, on which the DataSource should have it's focus.
208 If empty, all tables are rejected.
211 [property
] sequence
<string> TableFilter
;
214 /** defines a list of table types, on which the DataSource should have it's focus.
215 If empty, all table types are rejected.
218 [property
] sequence
<string> TableTypeFilter
;
224 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */