1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 #include "cmis_url.hxx"
13 #include "children_provider.hxx"
15 #include <com/sun/star/io/XInputStream.hpp>
16 #include <com/sun/star/io/XOutputStream.hpp>
17 #include <com/sun/star/ucb/ContentCreationException.hpp>
18 #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
19 #include <com/sun/star/ucb/TransferInfo.hpp>
20 #include <com/sun/star/ucb/XContentCreator.hpp>
21 #include <ucbhelper/contenthelper.hxx>
22 #include <libcmis/libcmis.hxx>
27 namespace com::sun::star
{
44 #define CMIS_REPO_TYPE "application/vnd.libreoffice.cmis-repository"
46 class ContentProvider
;
47 class RepoContent
: public ::ucbhelper::ContentImplHelper
,
48 public ChildrenProvider
51 ContentProvider
* m_pProvider
;
53 OUString m_sRepositoryId
;
55 std::vector
< libcmis::RepositoryPtr
> m_aRepositories
;
59 css::uno::Any
getBadArgExcept();
61 css::uno::Reference
< css::sdbc::XRow
>
63 const css::uno::Sequence
< css::beans::Property
>& rProperties
,
64 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
);
67 * Call me to ensure the repositories have been fetched
69 void getRepositories( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
);
71 libcmis::RepositoryPtr
getRepository( const css::uno::Reference
< css::ucb::XCommandEnvironment
>& xEnv
);
74 /// @throws css::ucb::ContentCreationException
75 RepoContent( const css::uno::Reference
<
76 css::uno::XComponentContext
>& rxContext
, ContentProvider
*pProvider
,
77 const css::uno::Reference
< css::ucb::XContentIdentifier
>& Identifier
,
78 std::vector
< libcmis::RepositoryPtr
> const & aRepos
= std::vector
< libcmis::RepositoryPtr
> ( ) );
80 virtual ~RepoContent() override
;
82 virtual css::uno::Sequence
< css::beans::Property
>
83 getProperties( const css::uno::Reference
< css::ucb::XCommandEnvironment
> & xEnv
) override
;
85 virtual css::uno::Sequence
< css::ucb::CommandInfo
>
86 getCommands( const css::uno::Reference
< css::ucb::XCommandEnvironment
> & xEnv
) override
;
88 virtual OUString
getParentURL() override
;
92 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
93 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
95 virtual OUString SAL_CALL
96 getImplementationName() override
;
98 virtual css::uno::Sequence
< OUString
> SAL_CALL
99 getSupportedServiceNames() override
;
101 virtual OUString SAL_CALL
102 getContentType() override
;
104 virtual css::uno::Any SAL_CALL
105 execute( const css::ucb::Command
& aCommand
,
107 const css::uno::Reference
< css::ucb::XCommandEnvironment
>& Environment
) override
;
109 virtual void SAL_CALL
abort( sal_Int32 CommandId
) override
;
111 virtual std::vector
< css::uno::Reference
< css::ucb::XContent
> > getChildren( ) override
;
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */