27#include <osl/diagnose.h>
28#include <com/sun/star/container/XNamed.hpp>
29#include <com/sun/star/ucb/IllegalIdentifierException.hpp>
30#include <com/sun/star/ucb/ResultSetException.hpp>
38#include "../inc/urihelper.hxx"
46DataSupplier::DataSupplier(
47 uno::Reference< uno::XComponentContext > xContext,
50 m_xFolderEnum( rContent->getIterator() ),
51 m_bCountFinal( !m_xFolderEnum.is() ), m_bThrowException( m_bCountFinal )
57DataSupplier::~DataSupplier()
91uno::Reference< ucb::XContentIdentifier >
98uno::Reference< ucb::XContentIdentifier >
103 uno::Reference< ucb::XContentIdentifier >& xId
113 if ( !aId.isEmpty() )
115 uno::Reference< ucb::XContentIdentifier > xId
116 = new ::ucbhelper::ContentIdentifier( aId );
120 return uno::Reference< ucb::XContentIdentifier >();
128 std::unique_lock aGuard(
m_aMutex );
132 uno::Reference< ucb::XContent >& xContent
141 uno::Reference< ucb::XContentIdentifier > xId
147 uno::Reference< ucb::XContent > xContent
148 =
m_xContent->getProvider()->queryContent( xId );
153 catch ( ucb::IllegalIdentifierException
const & )
157 return uno::Reference< ucb::XContent >();
164 std::unique_lock aGuard(
m_aMutex );
185 sal_uInt32
nPos = nOldCount;
191 uno::Reference< container::XNamed > xNamed;
196 OSL_FAIL(
"DataSupplier::getResult - Got no XNamed!" );
200 OUString
aName = xNamed->getName();
202 if (
aName.isEmpty() )
204 OSL_FAIL(
"DataSupplier::getResult - Empty name!" );
222 catch ( container::NoSuchElementException
const & )
227 catch ( lang::WrappedTargetException
const & )
238 if ( xResultSet.is() )
244 xResultSet->rowCountChanged(
248 xResultSet->rowCountFinal();
260 std::unique_lock aGuard(
m_aMutex );
271 uno::Reference< container::XNamed > xNamed;
276 OSL_FAIL(
"DataSupplier::getResult - Got no XNamed!" );
280 OUString
aName = xNamed->getName();
282 if (
aName.isEmpty() )
284 OSL_FAIL(
"DataSupplier::getResult - Empty name!" );
293 catch ( container::NoSuchElementException
const & )
298 catch ( lang::WrappedTargetException
const & )
308 if ( xResultSet.is() )
314 xResultSet->rowCountChanged(
317 xResultSet->rowCountFinal();
342 std::unique_lock aGuard(
m_aMutex );
366 return uno::Reference< sdbc::XRow >();
373 std::unique_lock aGuard(
m_aMutex );
390 throw ucb::ResultSetException();
398 =
m_xContent->getIdentifier()->getContentIdentifier();
399 sal_Int32 nParam = aContURL.indexOf(
'?' );
402 aURL = aContURL.copy( 0, nParam );
404 sal_Int32 nPackageUrlEnd =
aURL.lastIndexOf(
'/' );
405 if ( nPackageUrlEnd !=
aURL.getLength() - 1 )
409 aContURL.subView( nParam );
415 sal_Int32 nPackageUrlEnd =
aURL.lastIndexOf(
'/' );
416 if ( nPackageUrlEnd !=
aURL.getLength() - 1 )
uno::Reference< ucb::XContent > m_xContent
Reference< XComponentContext > m_xContext
static css::uno::Reference< css::sdbc::XRow > getPropertyValues(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Sequence< css::beans::Property > &rProperties, const ContentProperties &rData, const rtl::Reference< ::ucbhelper::ContentProviderImplHelper > &rProvider, const OUString &rContentId)
rtl::Reference< Content > m_xContent
OUString queryContentIdentifierStringImpl(std::unique_lock< std::mutex > &, sal_uInt32 nIndex)
virtual css::uno::Reference< css::ucb::XContentIdentifier > queryContentIdentifier(sal_uInt32 nIndex) override
css::uno::Reference< css::container::XEnumeration > m_xFolderEnum
virtual css::uno::Reference< css::sdbc::XRow > queryPropertyValues(sal_uInt32 nIndex) override
virtual void validate() override
virtual css::uno::Reference< css::ucb::XContent > queryContent(sal_uInt32 nIndex) override
std::vector< ResultListEntry > m_aResults
OUString assembleChildURL(const OUString &aName)
virtual OUString queryContentIdentifierString(sal_uInt32 nIndex) override
virtual sal_uInt32 currentCount() override
virtual bool isCountFinal() override
virtual sal_uInt32 totalCount() override
virtual bool getResult(sal_uInt32 nIndex) override
virtual void close() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
css::uno::Reference< css::ucb::XContentIdentifier > queryContentIdentifierImpl(std::unique_lock< std::mutex > &, sal_uInt32 nIndex)
bool getResultImpl(std::unique_lock< std::mutex > &, sal_uInt32 nIndex)
virtual void releasePropertyValues(sal_uInt32 nIndex) override
rtl::Reference< ResultSet > getResultSet() const
OUString encodeSegment(const OUString &rSegment)