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 #include "precompiled_ucb.hxx"
25 
26 #include "ucpext_resultset.hxx"
27 #include "ucpext_content.hxx"
28 #include "ucpext_datasupplier.hxx"
29 
30 /** === begin UNO includes === **/
31 /** === end UNO includes === **/
32 
33 #include <ucbhelper/resultset.hxx>
34 
35 //......................................................................................................................
36 namespace ucb { namespace ucp { namespace ext
37 {
38 //......................................................................................................................
39 
40 	/** === begin UNO using === **/
41 	using ::com::sun::star::uno::Reference;
42 	using ::com::sun::star::uno::XInterface;
43 	using ::com::sun::star::uno::UNO_QUERY;
44 	using ::com::sun::star::uno::UNO_QUERY_THROW;
45 	using ::com::sun::star::uno::UNO_SET_THROW;
46 	using ::com::sun::star::uno::Exception;
47 	using ::com::sun::star::uno::RuntimeException;
48 	using ::com::sun::star::uno::Any;
49 	using ::com::sun::star::uno::makeAny;
50 	using ::com::sun::star::uno::Sequence;
51 	using ::com::sun::star::uno::Type;
52     using ::com::sun::star::lang::XMultiServiceFactory;
53     using ::com::sun::star::ucb::XContentIdentifier;
54     using ::com::sun::star::ucb::OpenCommandArgument2;
55     using ::com::sun::star::ucb::XCommandEnvironment;
56 	/** === end UNO using === **/
57 
58     //==================================================================================================================
59     //= ResultSet
60     //==================================================================================================================
61     //------------------------------------------------------------------------------------------------------------------
ResultSet(const Reference<XMultiServiceFactory> & i_rORB,const::rtl::Reference<Content> & i_rContent,const OpenCommandArgument2 & i_rCommand,const Reference<XCommandEnvironment> & i_rEnv)62     ResultSet::ResultSet( const Reference< XMultiServiceFactory >& i_rORB, const ::rtl::Reference< Content >& i_rContent,
63             const OpenCommandArgument2& i_rCommand, const Reference< XCommandEnvironment >& i_rEnv )
64         :ResultSetImplHelper( i_rORB, i_rCommand )
65         ,m_xEnvironment( i_rEnv )
66         ,m_xContent( i_rContent )
67     {
68     }
69 
70     //------------------------------------------------------------------------------------------------------------------
initStatic()71     void ResultSet::initStatic()
72     {
73         ::rtl::Reference< DataSupplier > pDataSupplier( new DataSupplier(
74             m_xSMgr,
75             m_xContent,
76             m_aCommand.Mode
77         ) );
78 	    m_xResultSet1 = new ::ucbhelper::ResultSet(
79             m_xSMgr,
80             m_aCommand.Properties,
81             pDataSupplier.get(),
82             m_xEnvironment
83         );
84         pDataSupplier->fetchData();
85     }
86 
87     //------------------------------------------------------------------------------------------------------------------
initDynamic()88     void ResultSet::initDynamic()
89     {
90         initStatic();
91 	    m_xResultSet2 = m_xResultSet1;
92     }
93 
94 //......................................................................................................................
95 } } }   // namespace ucp::ext
96 //......................................................................................................................
97