14#include <com/sun/star/ucb/ContentCreationException.hpp>
15#include <com/sun/star/ucb/IllegalIdentifierException.hpp>
25uno::Reference< css::ucb::XContent > SAL_CALL
27 const uno::Reference< css::ucb::XContentIdentifier >& Identifier )
39 if ( aUrl.getRepositoryId( ).isEmpty( ) )
41 xContent =
new RepoContent(
m_xContext,
this, Identifier );
50 catch ( css::ucb::ContentCreationException
const & )
52 throw css::ucb::IllegalIdentifierException();
55 if ( !xContent->getIdentifier().is() )
56 throw css::ucb::IllegalIdentifierException();
63 libcmis::Session* pSession =
nullptr;
64 std::map< std::pair< OUString, OUString >, libcmis::Session* >::iterator it
65 =
m_aSessionCache.find( std::pair< OUString, OUString >( sBindingUrl, sUsername ) );
68 pSession = it->second;
75 m_aSessionCache.insert( std::pair< std::pair< OUString, OUString >, libcmis::Session* >
77 std::pair< OUString, OUString >( sBindingUrl, sUsername ),
83 const uno::Reference< uno::XComponentContext >& rxContext )
84: ::
ucbhelper::ContentProviderImplHelper( rxContext )
96 OWeakObject::acquire();
102 OWeakObject::release();
108 static_cast< lang::XTypeProvider*
>(
this),
109 static_cast< lang::XServiceInfo*
>(
this),
110 static_cast< css::ucb::XContentProvider*
>(
this)
112 return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
118 css::ucb::XContentProvider );
126 return "com.sun.star.comp.CmisContentProvider";
130 return {
"com.sun.star.ucb.CmisContentProvider" };
135extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
137 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
constexpr OUStringLiteral sServiceName
ContentProvider(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
void registerSession(const OUString &sBindingUrl, const OUString &sUsername, libcmis::Session *pSession)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual OUString SAL_CALL getImplementationName() override
std::map< std::pair< OUString, OUString >, libcmis::Session * > m_aSessionCache
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
libcmis::Session * getSession(const OUString &sBindingUrl, const OUString &sUsername)
virtual void SAL_CALL release() noexcept override
virtual ~ContentProvider() override
virtual css::uno::Reference< css::ucb::XContent > SAL_CALL queryContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier) override
rtl::Reference< ContentImplHelper > queryExistingContent(const css::uno::Reference< css::ucb::XContentIdentifier > &Identifier)
void registerNewContent(const css::uno::Reference< css::ucb::XContent > &xContent)
css::uno::Reference< css::uno::XComponentContext > m_xContext
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * ucb_cmis_ContentProvider_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
XTYPEPROVIDER_IMPL_3(ContentProvider, lang::XTypeProvider, lang::XServiceInfo, css::ucb::XContentProvider)
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)