1*2f86921cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2f86921cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2f86921cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2f86921cSAndrew Rist  * distributed with this work for additional information
6*2f86921cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2f86921cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2f86921cSAndrew Rist  * "License"); you may not use this file except in compliance
9*2f86921cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2f86921cSAndrew Rist  *
11*2f86921cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2f86921cSAndrew Rist  *
13*2f86921cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2f86921cSAndrew Rist  * software distributed under the License is distributed on an
15*2f86921cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2f86921cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*2f86921cSAndrew Rist  * specific language governing permissions and limitations
18*2f86921cSAndrew Rist  * under the License.
19*2f86921cSAndrew Rist  *
20*2f86921cSAndrew Rist  *************************************************************/
21*2f86921cSAndrew Rist 
22*2f86921cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "precompiled_ucb.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "ucpext_datasupplier.hxx"
27cdf0e10cSrcweir #include "ucpext_content.hxx"
28cdf0e10cSrcweir #include "ucpext_provider.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /** === begin UNO includes === **/
31cdf0e10cSrcweir #include <com/sun/star/deployment/XPackageInformationProvider.hpp>
32cdf0e10cSrcweir /** === end UNO includes === **/
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #include <ucbhelper/contentidentifier.hxx>
35cdf0e10cSrcweir #include <comphelper/componentcontext.hxx>
36cdf0e10cSrcweir #include <ucbhelper/providerhelper.hxx>
37cdf0e10cSrcweir #include <ucbhelper/content.hxx>
38cdf0e10cSrcweir #include <ucbhelper/propertyvalueset.hxx>
39cdf0e10cSrcweir #include <tools/diagnose_ex.h>
40cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir #include <vector>
43cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
44cdf0e10cSrcweir 
45cdf0e10cSrcweir //......................................................................................................................
46cdf0e10cSrcweir namespace ucb { namespace ucp { namespace ext
47cdf0e10cSrcweir {
48cdf0e10cSrcweir //......................................................................................................................
49cdf0e10cSrcweir 
50cdf0e10cSrcweir 	/** === begin UNO using === **/
51cdf0e10cSrcweir 	using ::com::sun::star::uno::Reference;
52cdf0e10cSrcweir 	using ::com::sun::star::uno::XInterface;
53cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_QUERY;
54cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_QUERY_THROW;
55cdf0e10cSrcweir 	using ::com::sun::star::uno::UNO_SET_THROW;
56cdf0e10cSrcweir 	using ::com::sun::star::uno::Exception;
57cdf0e10cSrcweir 	using ::com::sun::star::uno::RuntimeException;
58cdf0e10cSrcweir 	using ::com::sun::star::uno::Any;
59cdf0e10cSrcweir 	using ::com::sun::star::uno::makeAny;
60cdf0e10cSrcweir 	using ::com::sun::star::uno::Sequence;
61cdf0e10cSrcweir 	using ::com::sun::star::uno::Type;
62cdf0e10cSrcweir     using ::com::sun::star::ucb::XContent;
63cdf0e10cSrcweir     using ::com::sun::star::ucb::XContentIdentifier;
64cdf0e10cSrcweir     using ::com::sun::star::sdbc::XRow;
65cdf0e10cSrcweir     using ::com::sun::star::lang::XMultiServiceFactory;
66cdf0e10cSrcweir     using ::com::sun::star::ucb::IllegalIdentifierException;
67cdf0e10cSrcweir     using ::com::sun::star::ucb::ResultSetException;
68cdf0e10cSrcweir     using ::com::sun::star::deployment::XPackageInformationProvider;
69cdf0e10cSrcweir     using ::com::sun::star::beans::Property;
70cdf0e10cSrcweir     using ::com::sun::star::sdbc::XResultSet;
71cdf0e10cSrcweir     using ::com::sun::star::sdbc::XRow;
72cdf0e10cSrcweir     using ::com::sun::star::ucb::XCommandEnvironment;
73cdf0e10cSrcweir 	/** === end UNO using === **/
74cdf0e10cSrcweir     //==================================================================================================================
75cdf0e10cSrcweir     //= ResultListEntry
76cdf0e10cSrcweir     //==================================================================================================================
77cdf0e10cSrcweir     struct ResultListEntry
78cdf0e10cSrcweir     {
79cdf0e10cSrcweir         ::rtl::OUString					sId;
80cdf0e10cSrcweir 	    Reference< XContentIdentifier > xId;
81cdf0e10cSrcweir         ::rtl::Reference< Content >     pContent;
82cdf0e10cSrcweir 	    Reference< XRow > 			    xRow;
83cdf0e10cSrcweir     };
84cdf0e10cSrcweir 
85cdf0e10cSrcweir     typedef ::std::vector< ResultListEntry >    ResultList;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     //==================================================================================================================
88cdf0e10cSrcweir     //= DataSupplier_Impl
89cdf0e10cSrcweir     //==================================================================================================================
90cdf0e10cSrcweir     struct DataSupplier_Impl
91cdf0e10cSrcweir     {
92cdf0e10cSrcweir         ::osl::Mutex                                m_aMutex;
93cdf0e10cSrcweir         ResultList					                m_aResults;
94cdf0e10cSrcweir         ::rtl::Reference< Content >                 m_xContent;
95cdf0e10cSrcweir         Reference< XMultiServiceFactory >           m_xSMgr;
96cdf0e10cSrcweir         sal_Int32                                   m_nOpenMode;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir         DataSupplier_Impl( const Reference< XMultiServiceFactory >& i_rORB, const ::rtl::Reference< Content >& i_rContent,
99cdf0e10cSrcweir 					       const sal_Int32 i_nOpenMode )
100cdf0e10cSrcweir 	        :m_xContent( i_rContent )
101cdf0e10cSrcweir             ,m_xSMgr( i_rORB )
102cdf0e10cSrcweir             ,m_nOpenMode( i_nOpenMode )
103cdf0e10cSrcweir         {
104cdf0e10cSrcweir         }
105cdf0e10cSrcweir 	    ~DataSupplier_Impl();
106cdf0e10cSrcweir     };
107cdf0e10cSrcweir 
108cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
109cdf0e10cSrcweir     DataSupplier_Impl::~DataSupplier_Impl()
110cdf0e10cSrcweir     {
111cdf0e10cSrcweir     }
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     //==================================================================================================================
114cdf0e10cSrcweir     //= helper
115cdf0e10cSrcweir     //==================================================================================================================
116cdf0e10cSrcweir     namespace
117cdf0e10cSrcweir     {
118cdf0e10cSrcweir         ::rtl::OUString lcl_compose( const ::rtl::OUString& i_rBaseURL, const ::rtl::OUString& i_rRelativeURL )
119cdf0e10cSrcweir         {
120cdf0e10cSrcweir             ENSURE_OR_RETURN( i_rBaseURL.getLength(), "illegal base URL", i_rRelativeURL );
121cdf0e10cSrcweir 
122cdf0e10cSrcweir             ::rtl::OUStringBuffer aComposer( i_rBaseURL );
123cdf0e10cSrcweir             if ( i_rBaseURL.getStr()[ i_rBaseURL.getLength() - 1 ] != '/' )
124cdf0e10cSrcweir                 aComposer.append( sal_Unicode( '/' ) );
125cdf0e10cSrcweir             aComposer.append( i_rRelativeURL );
126cdf0e10cSrcweir             return aComposer.makeStringAndClear();
127cdf0e10cSrcweir         }
128cdf0e10cSrcweir     }
129cdf0e10cSrcweir 
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     //==================================================================================================================
132cdf0e10cSrcweir     //= DataSupplier
133cdf0e10cSrcweir     //==================================================================================================================
134cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
135cdf0e10cSrcweir     DataSupplier::DataSupplier( const Reference< XMultiServiceFactory >& i_rORB,
136cdf0e10cSrcweir 							    const ::rtl::Reference< Content >& i_rContent,
137cdf0e10cSrcweir 							    const sal_Int32 i_nOpenMode )
138cdf0e10cSrcweir         :m_pImpl( new DataSupplier_Impl( i_rORB, i_rContent, i_nOpenMode ) )
139cdf0e10cSrcweir     {
140cdf0e10cSrcweir     }
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
143cdf0e10cSrcweir     void DataSupplier::fetchData()
144cdf0e10cSrcweir     {
145cdf0e10cSrcweir         try
146cdf0e10cSrcweir         {
147cdf0e10cSrcweir             const ::comphelper::ComponentContext aContext( m_pImpl->m_xSMgr );
148cdf0e10cSrcweir             const Reference< XPackageInformationProvider > xPackageInfo(
149cdf0e10cSrcweir                 aContext.getSingleton( "com.sun.star.deployment.PackageInformationProvider" ), UNO_QUERY_THROW );
150cdf0e10cSrcweir 
151cdf0e10cSrcweir             const ::rtl::OUString sContentIdentifier( m_pImpl->m_xContent->getIdentifier()->getContentIdentifier() );
152cdf0e10cSrcweir 
153cdf0e10cSrcweir             switch ( m_pImpl->m_xContent->getExtensionContentType() )
154cdf0e10cSrcweir             {
155cdf0e10cSrcweir             case E_ROOT:
156cdf0e10cSrcweir             {
157cdf0e10cSrcweir                 Sequence< Sequence< ::rtl::OUString > > aExtensionInfo( xPackageInfo->getExtensionList() );
158cdf0e10cSrcweir                 for (   const Sequence< ::rtl::OUString >* pExtInfo = aExtensionInfo.getConstArray();
159cdf0e10cSrcweir                         pExtInfo != aExtensionInfo.getConstArray() + aExtensionInfo.getLength();
160cdf0e10cSrcweir                         ++pExtInfo
161cdf0e10cSrcweir                     )
162cdf0e10cSrcweir                 {
163cdf0e10cSrcweir                     ENSURE_OR_CONTINUE( pExtInfo->getLength() > 0, "illegal extension info" );
164cdf0e10cSrcweir 
165cdf0e10cSrcweir                     const ::rtl::OUString& rLocalId = (*pExtInfo)[0];
166cdf0e10cSrcweir                     ResultListEntry aEntry;
167cdf0e10cSrcweir                     aEntry.sId = ContentProvider::getRootURL() + Content::encodeIdentifier( rLocalId ) + ::rtl::OUString( sal_Unicode( '/' ) );
168cdf0e10cSrcweir                     m_pImpl->m_aResults.push_back( aEntry );
169cdf0e10cSrcweir                 }
170cdf0e10cSrcweir             }
171cdf0e10cSrcweir             break;
172cdf0e10cSrcweir             case E_EXTENSION_ROOT:
173cdf0e10cSrcweir             case E_EXTENSION_CONTENT:
174cdf0e10cSrcweir             {
175cdf0e10cSrcweir                 const ::rtl::OUString sPackageLocation( m_pImpl->m_xContent->getPhysicalURL() );
176cdf0e10cSrcweir                 ::ucbhelper::Content aWrappedContent( sPackageLocation, getResultSet()->getEnvironment() );
177cdf0e10cSrcweir 
178cdf0e10cSrcweir                 // obtain the properties which our result set is set up for from the wrapped content
179cdf0e10cSrcweir                 Sequence< ::rtl::OUString > aPropertyNames(1);
180cdf0e10cSrcweir                 aPropertyNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
181cdf0e10cSrcweir 
182cdf0e10cSrcweir                 const Reference< XResultSet > xFolderContent( aWrappedContent.createCursor( aPropertyNames ), UNO_SET_THROW );
183cdf0e10cSrcweir                 const Reference< XRow > xContentRow( xFolderContent, UNO_QUERY_THROW );
184cdf0e10cSrcweir                 while ( xFolderContent->next() )
185cdf0e10cSrcweir                 {
186cdf0e10cSrcweir                     ResultListEntry aEntry;
187cdf0e10cSrcweir                     aEntry.sId = lcl_compose( sContentIdentifier, xContentRow->getString( 1 ) );
188cdf0e10cSrcweir                     m_pImpl->m_aResults.push_back( aEntry );
189cdf0e10cSrcweir                 }
190cdf0e10cSrcweir             }
191cdf0e10cSrcweir             break;
192cdf0e10cSrcweir             default:
193cdf0e10cSrcweir                 OSL_ENSURE( false, "DataSupplier::fetchData: unimplemented content type!" );
194cdf0e10cSrcweir                 break;
195cdf0e10cSrcweir             }
196cdf0e10cSrcweir         }
197cdf0e10cSrcweir         catch( const Exception& )
198cdf0e10cSrcweir         {
199cdf0e10cSrcweir         	DBG_UNHANDLED_EXCEPTION();
200cdf0e10cSrcweir         }
201cdf0e10cSrcweir     }
202cdf0e10cSrcweir 
203cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
204cdf0e10cSrcweir     DataSupplier::~DataSupplier()
205cdf0e10cSrcweir     {
206cdf0e10cSrcweir     }
207cdf0e10cSrcweir 
208cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
209cdf0e10cSrcweir     ::rtl::OUString DataSupplier::queryContentIdentifierString( sal_uInt32 i_nIndex )
210cdf0e10cSrcweir     {
211cdf0e10cSrcweir 	    ::osl::Guard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
212cdf0e10cSrcweir 
213cdf0e10cSrcweir 	    if ( i_nIndex < m_pImpl->m_aResults.size() )
214cdf0e10cSrcweir 	    {
215cdf0e10cSrcweir             const ::rtl::OUString sId = m_pImpl->m_aResults[ i_nIndex ].sId;
216cdf0e10cSrcweir 		    if ( sId.getLength() )
217cdf0e10cSrcweir 			    return sId;
218cdf0e10cSrcweir 	    }
219cdf0e10cSrcweir 
220cdf0e10cSrcweir         OSL_ENSURE( false, "DataSupplier::queryContentIdentifierString: illegal index, or illegal result entry id!" );
221cdf0e10cSrcweir 	    return ::rtl::OUString();
222cdf0e10cSrcweir     }
223cdf0e10cSrcweir 
224cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
225cdf0e10cSrcweir     Reference< XContentIdentifier > DataSupplier::queryContentIdentifier( sal_uInt32 i_nIndex )
226cdf0e10cSrcweir     {
227cdf0e10cSrcweir 	    ::osl::Guard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 	    if ( i_nIndex < m_pImpl->m_aResults.size() )
230cdf0e10cSrcweir 	    {
231cdf0e10cSrcweir 		    Reference< XContentIdentifier > xId( m_pImpl->m_aResults[ i_nIndex ].xId );
232cdf0e10cSrcweir 		    if ( xId.is() )
233cdf0e10cSrcweir 			    return xId;
234cdf0e10cSrcweir 	    }
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	    ::rtl::OUString sId = queryContentIdentifierString( i_nIndex );
237cdf0e10cSrcweir 	    if ( sId.getLength() )
238cdf0e10cSrcweir 	    {
239cdf0e10cSrcweir 		    Reference< XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( sId );
240cdf0e10cSrcweir 		    m_pImpl->m_aResults[ i_nIndex ].xId = xId;
241cdf0e10cSrcweir 		    return xId;
242cdf0e10cSrcweir 	    }
243cdf0e10cSrcweir 
244cdf0e10cSrcweir 	    return Reference< XContentIdentifier >();
245cdf0e10cSrcweir     }
246cdf0e10cSrcweir 
247cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
248cdf0e10cSrcweir     Reference< XContent > DataSupplier::queryContent( sal_uInt32 i_nIndex )
249cdf0e10cSrcweir     {
250cdf0e10cSrcweir         ::osl::Guard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
251cdf0e10cSrcweir         ENSURE_OR_RETURN( i_nIndex < m_pImpl->m_aResults.size(), "illegal index!", NULL );
252cdf0e10cSrcweir 
253cdf0e10cSrcweir 
254cdf0e10cSrcweir         ::rtl::Reference< Content > pContent( m_pImpl->m_aResults[ i_nIndex ].pContent );
255cdf0e10cSrcweir 	    if ( pContent.is() )
256cdf0e10cSrcweir 		    return pContent.get();
257cdf0e10cSrcweir 
258cdf0e10cSrcweir 	    Reference< XContentIdentifier > xId( queryContentIdentifier( i_nIndex ) );
259cdf0e10cSrcweir 	    if ( xId.is() )
260cdf0e10cSrcweir 	    {
261cdf0e10cSrcweir 		    try
262cdf0e10cSrcweir 		    {
263cdf0e10cSrcweir 			    Reference< XContent > xContent( m_pImpl->m_xContent->getProvider()->queryContent( xId ) );
264cdf0e10cSrcweir                 pContent.set( dynamic_cast< Content* >( xContent.get() ) );
265cdf0e10cSrcweir                 OSL_ENSURE( pContent.is() || !xContent.is(), "DataSupplier::queryContent: invalid content implementation!" );
266cdf0e10cSrcweir 			    m_pImpl->m_aResults[ i_nIndex ].pContent = pContent;
267cdf0e10cSrcweir 			    return pContent.get();
268cdf0e10cSrcweir 
269cdf0e10cSrcweir 		    }
270cdf0e10cSrcweir 		    catch ( const IllegalIdentifierException& )
271cdf0e10cSrcweir 		    {
272cdf0e10cSrcweir                 DBG_UNHANDLED_EXCEPTION();
273cdf0e10cSrcweir 		    }
274cdf0e10cSrcweir 	    }
275cdf0e10cSrcweir 
276cdf0e10cSrcweir 	    return Reference< XContent >();
277cdf0e10cSrcweir     }
278cdf0e10cSrcweir 
279cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
280cdf0e10cSrcweir     sal_Bool DataSupplier::getResult( sal_uInt32 i_nIndex )
281cdf0e10cSrcweir     {
282cdf0e10cSrcweir 	    ::osl::ClearableGuard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
283cdf0e10cSrcweir 
284cdf0e10cSrcweir 	    if ( m_pImpl->m_aResults.size() > i_nIndex )
285cdf0e10cSrcweir 		    // result already present.
286cdf0e10cSrcweir 		    return sal_True;
287cdf0e10cSrcweir 
288cdf0e10cSrcweir         return sal_False;
289cdf0e10cSrcweir     }
290cdf0e10cSrcweir 
291cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
292cdf0e10cSrcweir     sal_uInt32 DataSupplier::totalCount()
293cdf0e10cSrcweir     {
294cdf0e10cSrcweir 	    ::osl::ClearableGuard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
295cdf0e10cSrcweir 	    return m_pImpl->m_aResults.size();
296cdf0e10cSrcweir     }
297cdf0e10cSrcweir 
298cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
299cdf0e10cSrcweir     sal_uInt32 DataSupplier::currentCount()
300cdf0e10cSrcweir     {
301cdf0e10cSrcweir 	    return m_pImpl->m_aResults.size();
302cdf0e10cSrcweir     }
303cdf0e10cSrcweir 
304cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
305cdf0e10cSrcweir     sal_Bool DataSupplier::isCountFinal()
306cdf0e10cSrcweir     {
307cdf0e10cSrcweir 	    return sal_True;
308cdf0e10cSrcweir     }
309cdf0e10cSrcweir 
310cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
311cdf0e10cSrcweir     Reference< XRow > DataSupplier::queryPropertyValues( sal_uInt32 i_nIndex  )
312cdf0e10cSrcweir     {
313cdf0e10cSrcweir 	    ::osl::MutexGuard aGuard( m_pImpl->m_aMutex );
314cdf0e10cSrcweir         ENSURE_OR_RETURN( i_nIndex < m_pImpl->m_aResults.size(), "DataSupplier::queryPropertyValues: illegal index!", NULL );
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 	    Reference< XRow > xRow = m_pImpl->m_aResults[ i_nIndex ].xRow;
317cdf0e10cSrcweir 	    if ( xRow.is() )
318cdf0e10cSrcweir 		    return xRow;
319cdf0e10cSrcweir 
320cdf0e10cSrcweir         ENSURE_OR_RETURN( queryContent( i_nIndex ).is(), "could not retrieve the content", NULL );
321cdf0e10cSrcweir 
322cdf0e10cSrcweir         switch ( m_pImpl->m_xContent->getExtensionContentType() )
323cdf0e10cSrcweir         {
324cdf0e10cSrcweir         case E_ROOT:
325cdf0e10cSrcweir         {
326cdf0e10cSrcweir             const ::rtl::OUString& rId( m_pImpl->m_aResults[ i_nIndex ].sId );
327cdf0e10cSrcweir             const ::rtl::OUString sRootURL( ContentProvider::getRootURL() );
328cdf0e10cSrcweir             ::rtl::OUString sTitle = Content::decodeIdentifier( rId.copy( sRootURL.getLength() ) );
329cdf0e10cSrcweir             if ( ( sTitle.getLength() > 0 ) && ( sTitle[ sTitle.getLength() - 1 ] == '/' ) )
330cdf0e10cSrcweir                 sTitle = sTitle.copy( 0, sTitle.getLength() - 1 );
331cdf0e10cSrcweir             xRow = Content::getArtificialNodePropertyValues( m_pImpl->m_xSMgr, getResultSet()->getProperties(), sTitle );
332cdf0e10cSrcweir         }
333cdf0e10cSrcweir         break;
334cdf0e10cSrcweir 
335cdf0e10cSrcweir         case E_EXTENSION_ROOT:
336cdf0e10cSrcweir         case E_EXTENSION_CONTENT:
337cdf0e10cSrcweir         {
338cdf0e10cSrcweir             xRow = m_pImpl->m_aResults[ i_nIndex ].pContent->getPropertyValues(
339cdf0e10cSrcweir                 getResultSet()->getProperties(), getResultSet()->getEnvironment() );
340cdf0e10cSrcweir         }
341cdf0e10cSrcweir         break;
342cdf0e10cSrcweir         default:
343cdf0e10cSrcweir             OSL_ENSURE( false, "DataSupplier::queryPropertyValues: unhandled case!" );
344cdf0e10cSrcweir             break;
345cdf0e10cSrcweir         }
346cdf0e10cSrcweir 
347cdf0e10cSrcweir         m_pImpl->m_aResults[ i_nIndex ].xRow = xRow;
348cdf0e10cSrcweir 	    return xRow;
349cdf0e10cSrcweir     }
350cdf0e10cSrcweir 
351cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
352cdf0e10cSrcweir     void DataSupplier::releasePropertyValues( sal_uInt32 i_nIndex )
353cdf0e10cSrcweir     {
354cdf0e10cSrcweir 	    ::osl::Guard< ::osl::Mutex > aGuard( m_pImpl->m_aMutex );
355cdf0e10cSrcweir 
356cdf0e10cSrcweir 	    if ( i_nIndex < m_pImpl->m_aResults.size() )
357cdf0e10cSrcweir 		    m_pImpl->m_aResults[ i_nIndex ].xRow.clear();
358cdf0e10cSrcweir     }
359cdf0e10cSrcweir 
360cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
361cdf0e10cSrcweir     void DataSupplier::close()
362cdf0e10cSrcweir     {
363cdf0e10cSrcweir     }
364cdf0e10cSrcweir 
365cdf0e10cSrcweir     //------------------------------------------------------------------------------------------------------------------
366cdf0e10cSrcweir     void DataSupplier::validate() throw( ResultSetException )
367cdf0e10cSrcweir     {
368cdf0e10cSrcweir     }
369cdf0e10cSrcweir 
370cdf0e10cSrcweir //......................................................................................................................
371cdf0e10cSrcweir } } }   // namespace ucp::ext
372cdf0e10cSrcweir //......................................................................................................................
373