1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_report_XDatabaseDataProvider_idl__
25#define __com_sun_star_report_XDatabaseDataProvider_idl__
26
27#ifndef __com_sun_star_container_NoSuchElementException_idl__
28#include <com/sun/star/container/NoSuchElementException.idl>
29#endif
30#include <com/sun/star/beans/XPropertySet.idl>
31#include <com/sun/star/beans/UnknownPropertyException.idl>
32#include <com/sun/star/lang/XInitialization.idl>
33#include <com/sun/star/lang/XComponent.idl>
34#include <com/sun/star/sdbc/XConnection.idl>
35#include <com/sun/star/sdbc/XParameters.idl>
36#include <com/sun/star/sdbc/XRowSet.idl>
37#include <com/sun/star/chart2/data/XDataProvider.idl>
38#include <com/sun/star/chart2/data/XRangeXMLConversion.idl>
39
40//=============================================================================
41
42 module com {  module sun {  module star {  module chart2 { module data {
43
44//=============================================================================
45
46/** identifies a <type>XDataProvider</type> for result sets.
47
48	@see XDataProvider
49    @see DataProvider
50 */
51interface XDatabaseDataProvider
52{
53	/** For accessing data a component provides for being used by
54        charts.
55     */
56	interface XDataProvider;
57
58    /** allows you to convert the ranges a data provider deals with
59        internally into valid XML.
60     */
61    interface XRangeXMLConversion;
62
63    /** allows access to the properties of the instance.
64	*/
65	interface com::sun::star::lang::XInitialization;
66
67    /** allows life-time control of the database data provider.
68	 */
69    interface com::sun::star::lang::XComponent;
70
71	/** allows access to the properties of the instance.
72	*/
73	interface com::sun::star::beans::XPropertySet;
74
75    interface com::sun::star::sdbc::XParameters;
76    interface com::sun::star::sdbc::XRowSet;
77
78    /** is used for subreports and contains the names of columns of the parent report.
79	<p> These columns are typically the foreign key fields of the parent report.
80	The values of theses columns are used to identify the data for the subreport.
81	Each time the parent report changes it's current row, the subreport requires
82	its data based on the values of the master fields.</p>
83	<p>If the report is no sub report (e.g. its parent is not a report itself), this
84	property is not evaluated.</p>
85
86	*/
87    [attribute,bound] sequence<string> MasterFields;
88
89	/**is used for subreports and contains the names of the columns of the subreport
90	which are related to the master fields of the parent report.
91	<p>Entries in this sequence can either denote column names in the sub report,
92	or parameter names.<br/>
93	For instance, you could base the report on the SQL statement
94	<code>SELECT * FROM invoices WHERE cust_ref = :cid</code>, and add <code>cid</code>
95	to the DetailFields property. In this case, the parameter will be filled from
96	the corresponding master field.<br/>
97	Alternatively, you could simply base your report on the table <code>invoices</code>,
98	and add the column name <code>cust_ref</code> to the DetailFields. In this case,
99	and implicit filter clause <code>WHERE cust_ref = :&lt;new_param_name&gt;</code> will
100	be created, and the artificial parameter will be filled from the corresponding
101	master field.<br/>
102	If a string in this property denotes both a column name and a parameter name, it
103	is undefined which way it is interpreted, but implementations of the service are required
104	to either decide for the parameter or the column, and proceed as usual.
105	</p>
106	<p>The columns specified herein typically represent a part of the primary key
107	fields or their aliases of the detail report.</p>
108	<p>If the report is no sub report (e.g. it's parent is not a report itself), this
109	property is not evaluated.</p>
110	*
111	*/
112    [attribute,bound] sequence<string> DetailFields;
113
114    /** is the command which should be executed, the type of command depends
115	on the CommandType.
116	<p>In case of a <member>CommandType</member> of <member>CommandType::COMMAND</member>,
117	means in case the <member>Command</member> specifies an SQL statement, the inherited
118	<member scope="com::sun::star::sdbc">RowSet::EscapeProcessing</member>
119	becomes relevant:<br/>
120	It then can be to used to specify whether the SQL statement should be analyzed on the
121	client side before sending it to the database server.<br/>
122	The default value for <member scope="com::sun::star::sdbc">RowSet::EscapeProcessing</member>
123	is <TRUE/>. By switching it to <FALSE/>, you can pass backend-specific SQL statements,
124	which are not standard SQL, to your database.</p>
125
126
127	@see com::sun::star::sdb::CommandType
128	*/
129    [attribute,bound] string Command;
130
131	/** specifies the type of the command to be executed to retrieve a result set.
132
133		<p><member>Command</member> needs to be interpreted depending on the value of this property.</p>
134
135		<p>This property is only meaningful together with the <member>Command</member>
136		property, thus either <em>both</em> or <em>none</em> of them are present.</p>
137
138		@see com::sun::star::sdb::CommandType
139	 */
140    [attribute,bound] long CommandType;
141
142	/** specifies an additional filter to optionally use.
143
144		<p>The Filter string has to form a SQL WHERE-clause, <em>without</em> the WHERE-string itself.</p>
145
146		<p>If a <member>DataSourceName</member>, <member>Command</member> and <member>CommandType</member>
147		are specified, a <type>RowSet</type> can be created with this information. If the results provided by the
148		row set are to be additionally filtered, the Filter property can be used.</p>
149
150		<p>Note that the Filter property does not make sense if a <member>ResultSet</member> has been specified
151		in the DataAccessDescriptor.</p>
152
153		@see com::sun::star::sdb::RowSet
154		@see ResultSet
155	*/
156	[attribute,bound] string Filter;
157
158    /** indicates whether the filter should be applied or not,
159		default is <FALSE/>.
160	 */
161	[attribute,bound] boolean ApplyFilter;
162
163    /** additional having clause for the row set
164	 */
165	[attribute,bound] string HavingClause
166    {
167        set raises (com::sun::star::beans::UnknownPropertyException);
168    };
169
170	/** additional group by for the row set
171	 */
172	[attribute,bound] string GroupBy
173    {
174        set raises (com::sun::star::beans::UnknownPropertyException);
175    };
176
177	/** is a additional sort order definition for a row set.
178	 */
179	[attribute,bound] string Order;
180
181	/** specifies if the <member>Command</member> should be analyzed on the client side before sending it
182		to the database server.
183
184		<p>The default value of this property is <TRUE/>. By switching it to <FALSE/>, you can pass
185		backend-specific SQL statements, which are not standard SQL, to your database.</p>
186
187		<p>This property is usually present together with the <member>Command</member> and
188		<member>CommandType</member> properties, and is evaluated if and only if <member>CommandType</member>
189		equals <member>CommandType::COMMAND</member>.</p>
190	*/
191	[attribute,bound] boolean EscapeProcessing;
192
193    /** specifies the maximal count of rows which should be fetched.
194        <p>A value of zero implies that no limit exists.</p>
195    */
196    [attribute,bound] long RowLimit;
197
198    /** specifies the active connection which is used to create the resulting report.
199	*/
200    [attribute,bound] com::sun::star::sdbc::XConnection ActiveConnection
201    {
202        set raises (com::sun::star::lang::IllegalArgumentException);
203    };
204    /** is the name of the datasource to use, this could be a named datasource
205		or the URL of a data access component.
206	 */
207	[attribute,bound] string DataSourceName;
208};
209
210//=============================================================================
211
212 }; }; }; };  };
213
214/*=============================================================================
215
216=============================================================================*/
217#endif
218