1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: resultsetforroot.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_xmlhelp.hxx"
33 #include <com/sun/star/ucb/Command.hpp>
34 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
35 #include <com/sun/star/ucb/XCommandProcessor.hpp>
37 #include "resultsetforroot.hxx"
38 #include "databases.hxx"
40 using namespace chelp
;
41 using namespace com::sun::star
;
42 using namespace com::sun::star::ucb
;
46 ResultSetForRoot::ResultSetForRoot( const uno::Reference
< lang::XMultiServiceFactory
>& xMSF
,
47 const uno::Reference
< XContentProvider
>& xProvider
,
49 const uno::Sequence
< beans::Property
>& seq
,
50 const uno::Sequence
< NumberedSortingInfo
>& seqSort
,
51 URLParameter
& aURLParameter
,
52 Databases
* pDatabases
)
53 : ResultSetBase( xMSF
,xProvider
,nOpenMode
,seq
,seqSort
),
54 m_aURLParameter( aURLParameter
),
55 m_pDatabases( pDatabases
)
57 m_aPath
= m_pDatabases
->getModuleList( m_aURLParameter
.get_language() );
58 m_aItems
.resize( m_aPath
.size() );
59 m_aIdents
.resize( m_aPath
.size() );
62 aCommand
.Name
= rtl::OUString::createFromAscii( "getPropertyValues" );
63 aCommand
.Argument
<<= m_sProperty
;
65 for( sal_uInt32 i
= 0; i
< m_aPath
.size(); ++i
)
68 rtl::OUString::createFromAscii( "vnd.sun.star.help://" ) +
70 rtl::OUString::createFromAscii( "?Language=" ) +
71 m_aURLParameter
.get_language() +
72 rtl::OUString::createFromAscii( "&System=" ) +
73 m_aURLParameter
.get_system();
75 m_nRow
= sal_Int32( i
);
77 uno::Reference
< XContent
> content
= queryContent();
80 uno::Reference
< XCommandProcessor
> cmd( content
,uno::UNO_QUERY
);
81 cmd
->execute( aCommand
,0,uno::Reference
< XCommandEnvironment
>( 0 ) ) >>= m_aItems
[i
]; //TODO: check return value of operator >>=