xref: /AOO41X/main/offapi/com/sun/star/sdb/DataSource.idl (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir/*************************************************************************
2*cdf0e10cSrcweir *
3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir *
5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir *
7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir *
9*cdf0e10cSrcweir * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir *
11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir *
15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir *
21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir *
26*cdf0e10cSrcweir ************************************************************************/
27*cdf0e10cSrcweir#ifndef __com_sun_star_sdb_DataSource_idl__
28*cdf0e10cSrcweir#define __com_sun_star_sdb_DataSource_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_io_XPersistObject_idl__
31*cdf0e10cSrcweir#include <com/sun/star/io/XPersistObject.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir
34*cdf0e10cSrcweir#ifndef __com_sun_star_beans_XPropertySet_idl__
35*cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
36*cdf0e10cSrcweir#endif
37*cdf0e10cSrcweir
38*cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__
39*cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl>
40*cdf0e10cSrcweir#endif
41*cdf0e10cSrcweir
42*cdf0e10cSrcweir#ifndef __com_sun_star_util_XFlushable_idl__
43*cdf0e10cSrcweir#include <com/sun/star/util/XFlushable.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir
46*cdf0e10cSrcweir#ifndef __com_sun_star_util_XNumberFormatsSupplier_idl__
47*cdf0e10cSrcweir#include <com/sun/star/util/XNumberFormatsSupplier.idl>
48*cdf0e10cSrcweir#endif
49*cdf0e10cSrcweir
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir module com {  module sun {  module star {  module sdbc {
52*cdf0e10cSrcweir	 published interface XIsolatedConnection;
53*cdf0e10cSrcweir	 published interface XDataSource;
54*cdf0e10cSrcweir };};};};
55*cdf0e10cSrcweir
56*cdf0e10cSrcweir
57*cdf0e10cSrcweir module com {  module sun {  module star {  module sdb {
58*cdf0e10cSrcweir
59*cdf0e10cSrcweir published interface XCompletedConnection;
60*cdf0e10cSrcweir published interface XQueryDefinitionsSupplier;
61*cdf0e10cSrcweir published interface XBookmarksSupplier;
62*cdf0e10cSrcweir
63*cdf0e10cSrcweir
64*cdf0e10cSrcweir/** is a factory to establish database connections. It should be registered at
65*cdf0e10cSrcweir	a <type scope="com::sun::star::uno">NamingService</type>.
66*cdf0e10cSrcweir	@see com::sun::star::sdb::DatabaseContext
67*cdf0e10cSrcweir */
68*cdf0e10cSrcweirpublished service DataSource
69*cdf0e10cSrcweir{
70*cdf0e10cSrcweir	interface com::sun::star::beans::XPropertySet;
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir
73*cdf0e10cSrcweir	/** useful for establishing connections with the completion of connection parameters
74*cdf0e10cSrcweir				provided during user interaction.
75*cdf0e10cSrcweir	 */
76*cdf0e10cSrcweir	interface XCompletedConnection;
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir	/** useful for establishing isolated connections which are not shared among others
79*cdf0e10cSrcweir		as it is the case when using <type>XCompletedConnection</type> or <type scope="com::sun::star::sdbc">XDataSource</type>.
80*cdf0e10cSrcweir		@see XCompletedConnection
81*cdf0e10cSrcweir		@see com::sun::star::sdbc::XDataSource
82*cdf0e10cSrcweir		@since OOo 1.1.2
83*cdf0e10cSrcweir	 */
84*cdf0e10cSrcweir	interface com::sun::star::sdbc::XIsolatedConnection;
85*cdf0e10cSrcweir
86*cdf0e10cSrcweir
87*cdf0e10cSrcweir	/** is provided to flush a DataSource within to a Database Context.
88*cdf0e10cSrcweir	 */
89*cdf0e10cSrcweir	interface com::sun::star::util::XFlushable;
90*cdf0e10cSrcweir
91*cdf0e10cSrcweir
92*cdf0e10cSrcweir	/** provides the access to DataSource related queries.
93*cdf0e10cSrcweir		<p>
94*cdf0e10cSrcweir		The object returned by the
95*cdf0e10cSrcweir		<method scope="com::sun::star::sdb">XQueryDefinitionsSupplier::getQueryDefinitions()</method>
96*cdf0e10cSrcweir		supports the
97*cdf0e10cSrcweir		<type scope="com::sun::star::sdb">DefinitionContainer</type>
98*cdf0e10cSrcweir		service.
99*cdf0e10cSrcweir		</p>
100*cdf0e10cSrcweir	 */
101*cdf0e10cSrcweir	interface XQueryDefinitionsSupplier;
102*cdf0e10cSrcweir
103*cdf0e10cSrcweir	/* useful for establishing connections and to get and set the login timeout.
104*cdf0e10cSrcweir	*/
105*cdf0e10cSrcweir	interface com::sun::star::sdbc::XDataSource;
106*cdf0e10cSrcweir
107*cdf0e10cSrcweir	/** provides access to bookmarks to documents associated with the data source
108*cdf0e10cSrcweir		<p>
109*cdf0e10cSrcweir		The object returned by the
110*cdf0e10cSrcweir		<method scope="com::sun::star::sdb">XBookmarksSupplier::getBookmarks()</method>
111*cdf0e10cSrcweir		supports the
112*cdf0e10cSrcweir		<type scope="com::sun::star::sdb">DefinitionContainer</type>
113*cdf0e10cSrcweir		service.
114*cdf0e10cSrcweir		</p>
115*cdf0e10cSrcweir	 */
116*cdf0e10cSrcweir	[optional] interface XBookmarksSupplier;
117*cdf0e10cSrcweir
118*cdf0e10cSrcweir	/** is the name of the data source.
119*cdf0e10cSrcweir
120*cdf0e10cSrcweir        <p>If the data source is registered at the database context, then the <code>Name</code> property
121*cdf0e10cSrcweir        denotes the registration name. Otherwise, the name property contains the URL of the file which the
122*cdf0e10cSrcweir        database document associated with the data source is based on.</p>
123*cdf0e10cSrcweir
124*cdf0e10cSrcweir        <p>If the same data source is registered under different names, the value of the <code>Name</code>
125*cdf0e10cSrcweir        property is not defined.</p>
126*cdf0e10cSrcweir	 */
127*cdf0e10cSrcweir	[readonly, property] string Name;
128*cdf0e10cSrcweir
129*cdf0e10cSrcweir
130*cdf0e10cSrcweir	/** indicates a database url of the form <br>
131*cdf0e10cSrcweir		<code> jdbc:<em>subprotocol</em>:<em>subname</em></code>
132*cdf0e10cSrcweir		or
133*cdf0e10cSrcweir		<code>sdbc:<em>subprotocol</em>:<em>subname</em></code>
134*cdf0e10cSrcweir	 */
135*cdf0e10cSrcweir	[property] string URL;
136*cdf0e10cSrcweir
137*cdf0e10cSrcweir
138*cdf0e10cSrcweir	/** is a list of arbitrary string tag/value pairs as connection arguments
139*cdf0e10cSrcweir
140*cdf0e10cSrcweir        <p>The <type>DataSource</type> itself does not attempt to interpret any of those values.</p>
141*cdf0e10cSrcweir
142*cdf0e10cSrcweir        <p>Instead, the values in this property have two use cases:
143*cdf0e10cSrcweir        <ul><li>Upon creating a connection, for every value in this sequence it's checked
144*cdf0e10cSrcweir                whether the <type scope="com::sun::star::sdbc">XDriver</type> which is to provide
145*cdf0e10cSrcweir                the connection supports a setting with the respective name, using its
146*cdf0e10cSrcweir                <member scope="com::sun::star::sdbc">XDriver::getPropertyInfo<member> method.br/>
147*cdf0e10cSrcweir                If so, the settings is passed to the drivers's
148*cdf0e10cSrcweir                <member scope="com::sun::star::sdbc">XDriver::connect<member> method. If not,
149*cdf0e10cSrcweir                the setting is ignored.</li>
150*cdf0e10cSrcweir            <li>External components may use the settings to carry arbitrary information with
151*cdf0e10cSrcweir                the data source. Usually, this is used to control the behaviour of components
152*cdf0e10cSrcweir                working with the data source.</li>
153*cdf0e10cSrcweir        </ul>
154*cdf0e10cSrcweir    */
155*cdf0e10cSrcweir	[property] sequence<com::sun::star::beans::PropertyValue> Info;
156*cdf0e10cSrcweir
157*cdf0e10cSrcweir    /** is a convenience wrapper around the <member>Info</member> property.
158*cdf0e10cSrcweir
159*cdf0e10cSrcweir        <p>Since fiddling around with a sequence of property values is somewhat uncomfortable
160*cdf0e10cSrcweir        in all known UNO language bindings (especially for tasks like simply changing the value
161*cdf0e10cSrcweir        of an existing value), the <member>Settings</member> property wraps the <member>Info</member>
162*cdf0e10cSrcweir        property for easier single-value access.</p>
163*cdf0e10cSrcweir
164*cdf0e10cSrcweir        <p>You should use the <member>Setting</member> property if you need to access a few properties only,
165*cdf0e10cSrcweir        and the <member>Info</member> property if you need access to all existent settings at once.</p>
166*cdf0e10cSrcweir
167*cdf0e10cSrcweir        <p>The object represented by this property supports the <type scope="com::sun::star::beans">PropertyBag</type>
168*cdf0e10cSrcweir        service. That is, you can at runtime add arbitrary new properties to the bag.</p>
169*cdf0e10cSrcweir
170*cdf0e10cSrcweir        <p>Additionally, the property bag supports default values of properties, and thus the
171*cdf0e10cSrcweir        <type scope="com::sun::star::beans">XPropertyState</type> interface. If you add an own property to
172*cdf0e10cSrcweir        the bag using <member scope="com::sun::star::beans">XPropertyContainer::addProperty</member>, you need
173*cdf0e10cSrcweir        to specifiy an initial value, which is also used as default value (exceptions see below).</p>
174*cdf0e10cSrcweir
175*cdf0e10cSrcweir        <p>Effectively, the property bag represented by <code>Settings</code> contains two classes of properties:
176*cdf0e10cSrcweir        Pre-defined ones and user-defined ones.</p>
177*cdf0e10cSrcweir
178*cdf0e10cSrcweir        <p><em>Pre-defined</em> properties are properties which are potentially used by the data source, the
179*cdf0e10cSrcweir        application UI for the data source, or a particular backend driver employed by the data source. There's
180*cdf0e10cSrcweir        a large set of such properties, no all of them are effectively used for a concrete data source, nonetheless,
181*cdf0e10cSrcweir        they're all present in the <code>Settings</code>.<br/>
182*cdf0e10cSrcweir        Such properties are not removeable from the bag, that is, their
183*cdf0e10cSrcweir        <member scope="com::sun::star::beans">PropertyAttribute::REMOVEABLE</member> attribute is <em>not</em> set.<br/>
184*cdf0e10cSrcweir        Usually, you'll find that all of this properties have the
185*cdf0e10cSrcweir        <member scope="com::sun::star::beans::">PropertyState::PropertyState_DEFAULT_VALUE</member> state.</p>
186*cdf0e10cSrcweir
187*cdf0e10cSrcweir        <p><em>User-defined</em> properties are the ones which are added at runtime by any instance. They might or might
188*cdf0e10cSrcweir        not be removeable, this depends on whether or not the code adding them specifies the
189*cdf0e10cSrcweir        <member scope="com::sun::star::beans">PropertyAttribute::REMOVEABLE</member> attribute. Also, they might
190*cdf0e10cSrcweir        or might not have a default value, determined by the
191*cdf0e10cSrcweir        <member scope="com::sun::star::beans">PropertyAttribute::MAYBEDEFAULT</member> attribute at the time they're added
192*cdf0e10cSrcweir        to the bag.</p>
193*cdf0e10cSrcweir
194*cdf0e10cSrcweir        <p>When a data source is made persistent, then properties which are not removeable (which are assumed to be the
195*cdf0e10cSrcweir        pre-defined properties) are ignored when they are in <code>DEFAULT</code> state. All other properties are
196*cdf0e10cSrcweir        always made persistent, except when an explicit
197*cdf0e10cSrcweir        <member scope="com::sun::star::beans">PropertyAttribute::TRANSIENT</member> attribute prohibits this.</p>
198*cdf0e10cSrcweir
199*cdf0e10cSrcweir        <p>Similar, when you obtain the <member>Info</member> property of a <code>DataSource</code>, the
200*cdf0e10cSrcweir        <code>Settings</code> bag is asked for all its property values, and the ones which are removeable and
201*cdf0e10cSrcweir        in state default are stripped, and <em>not</em> returned in the <code>Info</code> sequence.</p>
202*cdf0e10cSrcweir    */
203*cdf0e10cSrcweir    [property, readonly, optional] com::sun::star::beans::XPropertySet Settings;
204*cdf0e10cSrcweir
205*cdf0e10cSrcweir	/** determines a users login name.
206*cdf0e10cSrcweir	 */
207*cdf0e10cSrcweir	[property] string User;
208*cdf0e10cSrcweir
209*cdf0e10cSrcweir
210*cdf0e10cSrcweir	/** determines a users password. The password is not persistent.
211*cdf0e10cSrcweir	 */
212*cdf0e10cSrcweir	[property] string Password;
213*cdf0e10cSrcweir
214*cdf0e10cSrcweir
215*cdf0e10cSrcweir	/** indicates that a password is always necessary.
216*cdf0e10cSrcweir	 */
217*cdf0e10cSrcweir	[property] boolean IsPasswordRequired;
218*cdf0e10cSrcweir
219*cdf0e10cSrcweir
220*cdf0e10cSrcweir	/** indicates that components displaying data obtained from this
221*cdf0e10cSrcweir		data source should suppress columns used for versioning.
222*cdf0e10cSrcweir	 */
223*cdf0e10cSrcweir	[property] boolean SuppressVersionColumns;
224*cdf0e10cSrcweir
225*cdf0e10cSrcweir
226*cdf0e10cSrcweir	/** determines whether modifications on the data source are allowed or not.
227*cdf0e10cSrcweir	 */
228*cdf0e10cSrcweir	[readonly, property] boolean IsReadOnly;
229*cdf0e10cSrcweir
230*cdf0e10cSrcweir
231*cdf0e10cSrcweir	/** provides an object for formatting numbers.
232*cdf0e10cSrcweir	 */
233*cdf0e10cSrcweir	[readonly, property] com::sun::star::util::XNumberFormatsSupplier
234*cdf0e10cSrcweir						NumberFormatsSupplier;
235*cdf0e10cSrcweir
236*cdf0e10cSrcweir
237*cdf0e10cSrcweir	/** defines a list of tables, on which the DataSource should have it's focus.
238*cdf0e10cSrcweir		If empty, all tables are rejected.
239*cdf0e10cSrcweir
240*cdf0e10cSrcweir	*/
241*cdf0e10cSrcweir	[property] sequence<string> TableFilter;
242*cdf0e10cSrcweir
243*cdf0e10cSrcweir
244*cdf0e10cSrcweir	/** defines a list of table types, on which the DataSource should have it's focus.
245*cdf0e10cSrcweir			 If empty, all table types are rejected.
246*cdf0e10cSrcweir
247*cdf0e10cSrcweir	*/
248*cdf0e10cSrcweir	[property] sequence<string> TableTypeFilter;
249*cdf0e10cSrcweir};
250*cdf0e10cSrcweir
251*cdf0e10cSrcweir//=============================================================================
252*cdf0e10cSrcweir
253*cdf0e10cSrcweir}; }; }; };
254*cdf0e10cSrcweir
255*cdf0e10cSrcweir#endif
256