summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-09-29 15:10:49 +0200
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2011-10-01 15:59:50 +0200
commit61db713ee57d6ed27936ab30b1946590b3cb3df4 (patch)
tree88d28ae47d6135be76133cbf61fa21b8f15ac524 /ucb
parentcd5f71c90663714939cb51b2a8a4aa8b86e3fea2 (diff)
CMIS: added libcmis module and created empty cmis UCP shell
Diffstat (limited to 'ucb')
-rw-r--r--ucb/prj/build.lst3
-rw-r--r--ucb/prj/d.lst1
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx553
-rw-r--r--ucb/source/ucp/cmis/cmis_content.hxx179
-rw-r--r--ucb/source/ucp/cmis/cmis_provider.cxx127
-rw-r--r--ucb/source/ucp/cmis/cmis_provider.hxx67
-rw-r--r--ucb/source/ucp/cmis/makefile.mk70
-rw-r--r--ucb/source/ucp/cmis/ucpcmis.component34
-rw-r--r--ucb/source/ucp/cmis/ucpcmis.xml126
9 files changed, 1159 insertions, 1 deletions
diff --git a/ucb/prj/build.lst b/ucb/prj/build.lst
index 7c4e3bccf142..34ea2bccb2d4 100644
--- a/ucb/prj/build.lst
+++ b/ucb/prj/build.lst
@@ -1,4 +1,4 @@
-uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 LIBXSLT:libxslt offapi sal salhelper ucbhelper udkapi comphelper tools NULL
+uc ucb : cppuhelper CURL:curl OPENSSL:openssl NEON:neon LIBXML2:libxml2 LIBXSLT:libxslt libcmis offapi sal salhelper ucbhelper udkapi comphelper tools NULL
uc ucb usr1 - all uc_mkout NULL
uc ucb\inc nmake - all uc_inc NULL
uc ucb\source\regexp nmake - all uc_regexp uc_inc NULL
@@ -16,6 +16,7 @@ uc ucb\source\ucp\tdoc nmake - all uc_tdoc uc_inc NULL
uc ucb\source\ucp\expand nmake - all uc_expand uc_inc NULL
uc ucb\source\ucp\ext nmake - all uc_ext uc_inc NULL
uc ucb\source\ucp\odma nmake - w uc_odma uc_inc NULL
+uc ucb\source\ucp\cmis nmake - all uc_cmis uc_inc NULL
#uc ucb\qa\complex\ucb nmake - all uc_complex_ucb uc_inc NULL
# fails, please fix
# uc ucb\qa\complex\tdoc nmake - all uc_complex_tdoc uc_complex_tdoc_interfaces uc_inc NULL
diff --git a/ucb/prj/d.lst b/ucb/prj/d.lst
index db5b2903041d..1351c77cb6fa 100644
--- a/ucb/prj/d.lst
+++ b/ucb/prj/d.lst
@@ -40,6 +40,7 @@
..\%__SRC%\misc\ucpgvfs.component %_DEST%\xml\ucpgvfs.component
..\%__SRC%\misc\ucpgio.component %_DEST%\xml\ucpgio.component
+..\%__SRC%\misc\ucpcmis.component %_DEST%\xml\ucpcmis.component
..\%__SRC%\misc\cached1.component %_DEST%\xml\cached1.component
..\%__SRC%\misc\srtrs1.component %_DEST%\xml\srtrs1.component
..\%__SRC%\misc\ucb1.component %_DEST%\xml\ucb1.component
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
new file mode 100644
index 000000000000..31f49a943abc
--- /dev/null
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -0,0 +1,553 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <cstdio>
+
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#include <com/sun/star/ucb/ContentInfoAttribute.hpp>
+#include <com/sun/star/ucb/InsertCommandArgument.hpp>
+#include <com/sun/star/ucb/XCommandInfo.hpp>
+
+#include <ucbhelper/cancelcommandexecution.hxx>
+#include <ucbhelper/contentidentifier.hxx>
+#include <ucbhelper/propertyvalueset.hxx>
+
+#include "cmis_content.hxx"
+#include "cmis_provider.hxx"
+
+using namespace com::sun::star;
+
+namespace cmis
+{
+ Content::Content( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr,
+ ContentProvider *pProvider, const uno::Reference< ucb::XContentIdentifier >& Identifier)
+ throw ( ucb::ContentCreationException )
+ : ContentImplHelper( rxSMgr, pProvider, Identifier ),
+ m_pProvider( pProvider )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf(stderr, "TODO - New Content ('%s')\n", rtl::OUStringToOString(m_xIdentifier->getContentIdentifier(), RTL_TEXTENCODING_UTF8).getStr());
+#endif
+ // TODO Implement me
+ }
+
+ Content::Content( const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider,
+ const uno::Reference< ucb::XContentIdentifier >& Identifier,
+ sal_Bool /*bIsFolder*/)
+ throw ( ucb::ContentCreationException )
+ : ContentImplHelper( rxSMgr, pProvider, Identifier ),
+ m_pProvider( pProvider )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf(stderr, "TODO - Create Content ('%s')\n", rtl::OUStringToOString(m_xIdentifier->getContentIdentifier(), RTL_TEXTENCODING_UTF8).getStr());
+#endif
+ // TODO Implement me
+ }
+
+ Content::~Content()
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::~Content()\n" );
+#endif
+ // TODO Implement me
+ }
+
+ bool Content::isFolder(const uno::Reference< ucb::XCommandEnvironment >& /*xEnv*/)
+ {
+ bool bRet = false;
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::isFolder()\n" );
+#endif
+ // TODO Implement me
+
+ return bRet;
+ }
+
+ uno::Any Content::getBadArgExcept()
+ {
+ return uno::makeAny( lang::IllegalArgumentException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Wrong argument type!")),
+ static_cast< cppu::OWeakObject * >( this ), -1) );
+ }
+
+ uno::Reference< sdbc::XRow > Content::getPropertyValues(
+ const uno::Sequence< beans::Property >& /*rProperties*/,
+ const uno::Reference< ucb::XCommandEnvironment >& /*xEnv*/ )
+ {
+ uno::Reference< sdbc::XRow > rRow;
+
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::getPropertyValues()\n" );
+#endif
+ // TODO Implement me
+
+ return rRow;
+ }
+
+ void Content::queryChildren( ContentRefList& /*rChildren*/ )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::queryChildren()\n" );
+#endif
+ // TODO Implement me
+ }
+
+ uno::Any Content::open(const ucb::OpenCommandArgument2 & /*rArg*/,
+ const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
+ throw( uno::Exception )
+ {
+ uno::Any aRet;
+
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::open()\n" );
+#endif
+ // TODO Implement me
+
+ return aRet;
+ }
+
+ void Content::transfer( const ucb::TransferInfo& /*rTransferInfo*/,
+ const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
+ throw( uno::Exception )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::transfer()\n" );
+#endif
+ // TODO Implement me
+ }
+
+ void Content::insert( const uno::Reference< io::XInputStream > & /*xInputStream*/,
+ sal_Bool /*bReplaceExisting*/, const uno::Reference< ucb::XCommandEnvironment >& /*xEnv*/ )
+ throw( uno::Exception )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::insert()\n" );
+#endif
+ // TODO Implement me
+ }
+
+ void Content::destroy( sal_Bool /*bDeletePhysical*/ ) throw( uno::Exception )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::destroy()\n" );
+#endif
+ // TODO Implement me
+ }
+
+ const int TRANSFER_BUFFER_SIZE = 65536;
+
+ void Content::copyData(
+ uno::Reference< io::XInputStream > xIn,
+ uno::Reference< io::XOutputStream > xOut )
+ {
+ uno::Sequence< sal_Int8 > theData( TRANSFER_BUFFER_SIZE );
+
+ while ( xIn->readBytes( theData, TRANSFER_BUFFER_SIZE ) > 0 )
+ xOut->writeBytes( theData );
+
+ xOut->closeOutput();
+ }
+
+ uno::Sequence< uno::Any > Content::setPropertyValues(
+ const uno::Sequence< beans::PropertyValue >& rValues,
+ const uno::Reference< ucb::XCommandEnvironment >& )
+ {
+ sal_Int32 nCount = rValues.getLength();
+ uno::Sequence< uno::Any > aRet( nCount );
+
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::setPropertyValue()\n" );
+#endif
+ // TODO Implement me
+
+ return aRet;
+ }
+
+ sal_Bool Content::feedSink( uno::Reference< uno::XInterface> /*aSink*/,
+ const uno::Reference< ucb::XCommandEnvironment >& /*xEnv*/ )
+ {
+ sal_Bool bRet = sal_False;
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::feedSink()\n" );
+#endif
+ // TODO Implement me
+
+ return bRet;
+ }
+
+ sal_Bool Content::exchangeIdentity( const uno::Reference< ucb::XContentIdentifier >& /*xNewId*/ )
+ {
+ sal_Bool bRet = sal_False;
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::exchangeIdentity()\n" );
+#endif
+ // TODO Implement me
+
+ return bRet;
+ }
+
+ uno::Sequence< beans::Property > Content::getProperties(
+ const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
+ {
+ static const beans::Property aGenericProperties[] =
+ {
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
+ -1, getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
+ -1, getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
+ -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
+ beans::PropertyAttribute::BOUND ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ),
+ -1, getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ),
+ -1, getCppuType( static_cast< const util::DateTime * >( 0 ) ),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateModified" ) ),
+ -1, getCppuType( static_cast< const util::DateTime * >( 0 ) ),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ),
+ -1, getCppuType( static_cast< const sal_Int64 * >( 0 ) ),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ),
+ };
+
+ const int nProps = SAL_N_ELEMENTS(aGenericProperties);
+ return uno::Sequence< beans::Property > ( aGenericProperties, nProps );
+ }
+
+ uno::Sequence< ucb::CommandInfo > Content::getCommands(
+ const uno::Reference< ucb::XCommandEnvironment > & xEnv )
+ {
+ static ucb::CommandInfo aCommandInfoTable[] =
+ {
+ // Required commands
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
+ -1, getCppuVoidType() ),
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
+ -1, getCppuVoidType() ),
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
+ -1, getCppuType( static_cast<uno::Sequence< beans::Property > * >( 0 ) ) ),
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
+ -1, getCppuType( static_cast<uno::Sequence< beans::PropertyValue > * >( 0 ) ) ),
+
+ // Optional standard commands
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
+ -1, getCppuBooleanType() ),
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
+ -1, getCppuType( static_cast<ucb::InsertCommandArgument * >( 0 ) ) ),
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
+ -1, getCppuType( static_cast<ucb::OpenCommandArgument2 * >( 0 ) ) ),
+
+ // Folder Only, omitted if not a folder
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ),
+ -1, getCppuType( static_cast<ucb::TransferInfo * >( 0 ) ) ),
+ ucb::CommandInfo
+ ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
+ -1, getCppuType( static_cast<ucb::ContentInfo * >( 0 ) ) )
+ };
+
+ const int nProps = SAL_N_ELEMENTS(aCommandInfoTable);
+ return uno::Sequence< ucb::CommandInfo >(aCommandInfoTable, isFolder(xEnv) ? nProps : nProps - 2);
+ }
+
+ ::rtl::OUString Content::getParentURL()
+ {
+ rtl::OUString sRet;
+
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::getParentURL()\n" );
+#endif
+ // TODO Implement me
+
+ return sRet;
+ }
+
+ XTYPEPROVIDER_COMMON_IMPL( Content );
+
+ void SAL_CALL Content::acquire() throw()
+ {
+ ContentImplHelper::acquire();
+ }
+
+ void SAL_CALL Content::release() throw()
+ {
+ ContentImplHelper::release();
+ }
+
+ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) throw ( uno::RuntimeException )
+ {
+ uno::Any aRet = cppu::queryInterface( rType, static_cast< ucb::XContentCreator * >( this ) );
+ return aRet.hasValue() ? aRet : ContentImplHelper::queryInterface(rType);
+ }
+
+ rtl::OUString SAL_CALL Content::getImplementationName() throw( uno::RuntimeException )
+ {
+ return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.CmisContent"));
+ }
+
+ uno::Sequence< rtl::OUString > SAL_CALL Content::getSupportedServiceNames()
+ throw( uno::RuntimeException )
+ {
+ uno::Sequence< rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[ 0 ] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.CmisContent"));
+ return aSNS;
+ }
+
+ rtl::OUString SAL_CALL Content::getContentType() throw( uno::RuntimeException )
+ {
+ return isFolder(uno::Reference< ucb::XCommandEnvironment >())
+ ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CMIS_FOLDER_TYPE ))
+ : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CMIS_FILE_TYPE ));
+ }
+
+ uno::Any SAL_CALL Content::execute(
+ const ucb::Command& aCommand,
+ sal_Int32 /*CommandId*/,
+ const uno::Reference< ucb::XCommandEnvironment >& xEnv )
+ throw( uno::Exception, ucb::CommandAbortedException, uno::RuntimeException )
+ {
+ uno::Any aRet;
+
+ if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "getPropertyValues" ) ))
+ {
+ uno::Sequence< beans::Property > Properties;
+ if ( !( aCommand.Argument >>= Properties ) )
+ ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
+ aRet <<= getPropertyValues( Properties, xEnv );
+ }
+ else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "getPropertySetInfo" ) ))
+ aRet <<= getPropertySetInfo( xEnv, sal_False );
+ else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "getCommandInfo" ) ))
+ aRet <<= getCommandInfo( xEnv, sal_False );
+ else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "open" ) ))
+ {
+ ucb::OpenCommandArgument2 aOpenCommand;
+ if ( !( aCommand.Argument >>= aOpenCommand ) )
+ ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
+ aRet = open( aOpenCommand, xEnv );
+ }
+ else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "transfer" ) ))
+ {
+ ucb::TransferInfo transferArgs;
+ if ( !( aCommand.Argument >>= transferArgs ) )
+ ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
+ transfer( transferArgs, xEnv );
+ }
+ else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "setPropertyValues" ) ))
+ {
+ uno::Sequence< beans::PropertyValue > aProperties;
+ if ( !( aCommand.Argument >>= aProperties ) || !aProperties.getLength() )
+ ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
+ aRet <<= setPropertyValues( aProperties, xEnv );
+ }
+ else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) )
+ && isFolder( xEnv ) )
+ {
+ ucb::ContentInfo arg;
+ if ( !( aCommand.Argument >>= arg ) )
+ ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
+ aRet <<= createNewContent( arg );
+ }
+ else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "insert" ) ))
+ {
+ ucb::InsertCommandArgument arg;
+ if ( !( aCommand.Argument >>= arg ) )
+ ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
+ insert( arg.Data, arg.ReplaceExisting, xEnv );
+ }
+ else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "delete" ) ))
+ {
+ sal_Bool bDeletePhysical = sal_False;
+ aCommand.Argument >>= bDeletePhysical;
+
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::execute() - delete\n" );
+#endif
+ // TODO Actually delete it
+
+ destroy( bDeletePhysical );
+ }
+ else
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "cmis::Content::execute() - UNKNOWN COMMAND\n" );
+#endif
+
+ ucbhelper::cancelCommandExecution
+ ( uno::makeAny( ucb::UnsupportedCommandException
+ ( rtl::OUString(),
+ static_cast< cppu::OWeakObject * >( this ) ) ),
+ xEnv );
+ }
+
+ return aRet;
+ }
+
+ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) throw( uno::RuntimeException )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "TODO - cmis::Content::abort()\n" );
+#endif
+ // TODO Implement me
+ }
+
+ uno::Sequence< ucb::ContentInfo > SAL_CALL Content::queryCreatableContentsInfo()
+ throw( uno::RuntimeException )
+ {
+ return queryCreatableContentsInfo( uno::Reference< ucb::XCommandEnvironment >() );
+ }
+
+ uno::Reference< ucb::XContent > SAL_CALL Content::createNewContent(
+ const ucb::ContentInfo& Info ) throw( uno::RuntimeException )
+ {
+ bool create_document;
+ const char *name;
+
+ if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMIS_FILE_TYPE ) ) )
+ create_document = true;
+ else if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMIS_FOLDER_TYPE ) ) )
+ create_document = false;
+ else
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "Failed to create new content '%s'",
+ rtl::OUStringToOString(Info.Type, RTL_TEXTENCODING_UTF8).getStr() );
+#endif
+ return uno::Reference< ucb::XContent >();
+ }
+
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr, "createNewContent (%d)", (int) create_document );
+#endif
+
+ rtl::OUString aURL = m_xIdentifier->getContentIdentifier();
+
+ if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() )
+ aURL += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+
+ name = create_document ? "[New_Content]" : "[New_Collection]";
+ aURL += rtl::OUString::createFromAscii( name );
+
+ uno::Reference< ucb::XContentIdentifier > xId(new ::ucbhelper::ContentIdentifier(m_xSMgr, aURL));
+
+ try
+ {
+ return new ::cmis::Content( m_xSMgr, m_pProvider, xId, !create_document );
+ } catch ( ucb::ContentCreationException & )
+ {
+ return uno::Reference< ucb::XContent >();
+ }
+ }
+
+ uno::Sequence< uno::Type > SAL_CALL Content::getTypes() throw( uno::RuntimeException )
+ {
+ if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) )
+ {
+ static cppu::OTypeCollection aFolderCollection
+ (CPPU_TYPE_REF( lang::XTypeProvider ),
+ CPPU_TYPE_REF( lang::XServiceInfo ),
+ CPPU_TYPE_REF( lang::XComponent ),
+ CPPU_TYPE_REF( ucb::XContent ),
+ CPPU_TYPE_REF( ucb::XCommandProcessor ),
+ CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ),
+ CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ),
+ CPPU_TYPE_REF( beans::XPropertyContainer ),
+ CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ),
+ CPPU_TYPE_REF( container::XChild ),
+ CPPU_TYPE_REF( ucb::XContentCreator ) );
+ return aFolderCollection.getTypes();
+ }
+ else
+ {
+ static cppu::OTypeCollection aFileCollection
+ (CPPU_TYPE_REF( lang::XTypeProvider ),
+ CPPU_TYPE_REF( lang::XServiceInfo ),
+ CPPU_TYPE_REF( lang::XComponent ),
+ CPPU_TYPE_REF( ucb::XContent ),
+ CPPU_TYPE_REF( ucb::XCommandProcessor ),
+ CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ),
+ CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ),
+ CPPU_TYPE_REF( beans::XPropertyContainer ),
+ CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ),
+ CPPU_TYPE_REF( container::XChild ) );
+
+ return aFileCollection.getTypes();
+ }
+ }
+
+
+ uno::Sequence< ucb::ContentInfo > Content::queryCreatableContentsInfo(
+ const uno::Reference< ucb::XCommandEnvironment >& xEnv)
+ throw( uno::RuntimeException )
+ {
+ if ( isFolder( xEnv ) )
+ {
+ uno::Sequence< ucb::ContentInfo > seq(2);
+
+ // Minimum set of props we really need
+ uno::Sequence< beans::Property > props( 1 );
+ props[0] = beans::Property(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")),
+ -1,
+ getCppuType( static_cast< rtl::OUString* >( 0 ) ),
+ beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND );
+
+ // file
+ seq[0].Type = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CMIS_FILE_TYPE ));
+ seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM |
+ ucb::ContentInfoAttribute::KIND_DOCUMENT );
+ seq[0].Properties = props;
+
+ // folder
+ seq[1].Type = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CMIS_FOLDER_TYPE ));
+ seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER;
+ seq[1].Properties = props;
+
+ return seq;
+ }
+ else
+ {
+ return uno::Sequence< ucb::ContentInfo >();
+ }
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/cmis/cmis_content.hxx b/ucb/source/ucp/cmis/cmis_content.hxx
new file mode 100644
index 000000000000..20171a606155
--- /dev/null
+++ b/ucb/source/ucp/cmis/cmis_content.hxx
@@ -0,0 +1,179 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef CMIS_CONTENT_HXX
+#define CMIS_CONTENT_HXX
+
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XOutputStream.hpp>
+#include <com/sun/star/ucb/ContentCreationException.hpp>
+#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
+#include <com/sun/star/ucb/TransferInfo.hpp>
+#include <com/sun/star/ucb/XContentCreator.hpp>
+#include <ucbhelper/contenthelper.hxx>
+#include <libcmis/session-factory.hxx>
+
+#include <list>
+
+namespace com { namespace sun { namespace star {
+ namespace beans {
+ struct Property;
+ struct PropertyValue;
+ }
+ namespace sdbc {
+ class XRow;
+ }
+}}}
+namespace ucbhelper
+{
+ class Content;
+}
+
+
+namespace cmis
+{
+
+#define CMIS_FILE_TYPE "application/vnd.sun.staroffice.cmis-file"
+#define CMIS_FOLDER_TYPE "application/vnd.sun.staroffice.cmis-folder"
+
+class ContentProvider;
+class ContentProperties;
+class Content : public ::ucbhelper::ContentImplHelper, public com::sun::star::ucb::XContentCreator
+{
+private:
+ ContentProvider *m_pProvider;
+
+ bool isFolder(const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv);
+
+ com::sun::star::uno::Any getBadArgExcept();
+
+ com::sun::star::uno::Reference< com::sun::star::sdbc::XRow >
+ getPropertyValues(
+ const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& rProperties,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv );
+private:
+ typedef rtl::Reference< Content > ContentRef;
+ typedef std::list< ContentRef > ContentRefList;
+
+ void queryChildren( ContentRefList& rChildren );
+
+ com::sun::star::uno::Any open(const com::sun::star::ucb::OpenCommandArgument2 & rArg,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv )
+ throw( com::sun::star::uno::Exception );
+
+ void transfer( const com::sun::star::ucb::TransferInfo& rTransferInfo,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv )
+ throw( com::sun::star::uno::Exception );
+
+ void insert( const com::sun::star::uno::Reference< com::sun::star::io::XInputStream > & xInputStream,
+ sal_Bool bReplaceExisting, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv )
+ throw( com::sun::star::uno::Exception );
+
+ void destroy( sal_Bool bDeletePhysical ) throw( com::sun::star::uno::Exception );
+
+ void copyData( com::sun::star::uno::Reference< com::sun::star::io::XInputStream > xIn,
+ com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > xOut );
+
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any >
+ setPropertyValues( const com::sun::star::uno::Sequence<
+ com::sun::star::beans::PropertyValue >& rValues,
+ const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >& xEnv );
+
+ sal_Bool feedSink( com::sun::star::uno::Reference< com::sun::star::uno::XInterface> aSink,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv );
+
+ sal_Bool exchangeIdentity(const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xNewId);
+
+public:
+ Content( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier)
+ throw ( com::sun::star::ucb::ContentCreationException );
+
+ Content( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier,
+ sal_Bool bIsFolder)
+ throw ( com::sun::star::ucb::ContentCreationException );
+
+ virtual ~Content();
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property >
+ getProperties( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv );
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo >
+ getCommands( const com::sun::star::uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment > & xEnv );
+
+ virtual ::rtl::OUString getParentURL();
+
+ XINTERFACE_DECL()
+
+ XTYPEPROVIDER_DECL()
+
+ virtual ::rtl::OUString SAL_CALL
+ getImplementationName()
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+ getSupportedServiceNames()
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual rtl::OUString SAL_CALL
+ getContentType()
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Any SAL_CALL
+ execute( const com::sun::star::ucb::Command& aCommand,
+ sal_Int32 CommandId,
+ const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& Environment )
+ throw( com::sun::star::uno::Exception, com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::RuntimeException );
+
+ virtual void SAL_CALL abort( sal_Int32 CommandId )
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo >
+ SAL_CALL queryCreatableContentsInfo()
+ throw( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent >
+ SAL_CALL createNewContent( const com::sun::star::ucb::ContentInfo& Info )
+ throw( com::sun::star::uno::RuntimeException );
+
+ com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo >
+ queryCreatableContentsInfo( const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv )
+ throw( com::sun::star::uno::RuntimeException );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/cmis/cmis_provider.cxx b/ucb/source/ucp/cmis/cmis_provider.cxx
new file mode 100644
index 000000000000..122f8fead402
--- /dev/null
+++ b/ucb/source/ucp/cmis/cmis_provider.cxx
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <ucbhelper/contentidentifier.hxx>
+#include <ucbhelper/contenthelper.hxx>
+#include <com/sun/star/ucb/ContentCreationException.hpp>
+#include "cmis_provider.hxx"
+#include "cmis_content.hxx"
+
+#include <stdio.h>
+
+using namespace com::sun::star;
+
+namespace cmis
+{
+uno::Reference< com::sun::star::ucb::XContent > SAL_CALL
+ContentProvider::queryContent(
+ const uno::Reference<
+ com::sun::star::ucb::XContentIdentifier >& Identifier )
+ throw( com::sun::star::ucb::IllegalIdentifierException,
+ uno::RuntimeException )
+{
+#ifdef DEBUG
+ fprintf(stderr, "QueryContent: '%s'",
+ (const sal_Char *)rtl::OUStringToOString
+ (Identifier->getContentIdentifier(), RTL_TEXTENCODING_UTF8));
+#endif
+
+ osl::MutexGuard aGuard( m_aMutex );
+
+ // Check, if a content with given id already exists...
+ uno::Reference< ucb::XContent > xContent = queryExistingContent( Identifier ).get();
+ if ( xContent.is() )
+ return xContent;
+
+ try
+ {
+ xContent = new ::cmis::Content(m_xSMgr, this, Identifier);
+ }
+ catch ( com::sun::star::ucb::ContentCreationException const & )
+ {
+ throw com::sun::star::ucb::IllegalIdentifierException();
+ }
+
+ if ( !xContent->getIdentifier().is() )
+ throw com::sun::star::ucb::IllegalIdentifierException();
+
+ return xContent;
+}
+
+ContentProvider::ContentProvider(
+ const uno::Reference< lang::XMultiServiceFactory >& rSMgr )
+: ::ucbhelper::ContentProviderImplHelper( rSMgr )
+{
+}
+
+ContentProvider::~ContentProvider()
+{
+}
+
+XINTERFACE_IMPL_3( ContentProvider,
+ lang::XTypeProvider,
+ lang::XServiceInfo,
+ com::sun::star::ucb::XContentProvider );
+
+XTYPEPROVIDER_IMPL_3( ContentProvider,
+ lang::XTypeProvider,
+ lang::XServiceInfo,
+ com::sun::star::ucb::XContentProvider );
+
+XSERVICEINFO_IMPL_1( ContentProvider,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.CmisContentProvider" )),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb.CmisContentProvider" )) );
+
+ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider );
+
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char *pImplName,
+ void *pServiceManager, void * )
+{
+ void * pRet = 0;
+
+ uno::Reference< lang::XMultiServiceFactory > xSMgr
+ (reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) );
+ uno::Reference< lang::XSingleServiceFactory > xFactory;
+
+ if ( !::cmis::ContentProvider::getImplementationName_Static().compareToAscii( pImplName ) )
+ xFactory = ::cmis::ContentProvider::createServiceFactory( xSMgr );
+
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+
+ return pRet;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/cmis/cmis_provider.hxx b/ucb/source/ucp/cmis/cmis_provider.hxx
new file mode 100644
index 000000000000..090cde0f1ddf
--- /dev/null
+++ b/ucb/source/ucp/cmis/cmis_provider.hxx
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef CMIS_PROVIDER_HXX
+#define CMIS_PROVIDER_HXX
+
+#include <com/sun/star/beans/Property.hpp>
+#include <ucbhelper/providerhelper.hxx>
+
+namespace cmis
+{
+
+class ContentProvider : public ::ucbhelper::ContentProviderImplHelper
+{
+public:
+ ContentProvider( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::lang::XMultiServiceFactory >& rSMgr );
+ virtual ~ContentProvider();
+
+ // XInterface
+ XINTERFACE_DECL()
+
+ // XTypeProvider
+ XTYPEPROVIDER_DECL()
+
+ // XServiceInfo
+ XSERVICEINFO_DECL()
+
+ // XContentProvider
+ virtual ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContent > SAL_CALL
+ queryContent( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::ucb::XContentIdentifier >& Identifier )
+ throw( ::com::sun::star::ucb::IllegalIdentifierException,
+ ::com::sun::star::uno::RuntimeException );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/cmis/makefile.mk b/ucb/source/ucp/cmis/makefile.mk
new file mode 100644
index 000000000000..d30a116e45c0
--- /dev/null
+++ b/ucb/source/ucp/cmis/makefile.mk
@@ -0,0 +1,70 @@
+#
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ]
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#
+
+PRJ=..$/..$/..
+PRJNAME=ucb
+# Version
+UCPCMIS_MAJOR=1
+TARGET=ucpcmis
+ENABLE_EXCEPTIONS=TRUE
+USE_DEFFILE=TRUE
+NO_BSYMBOLIC=TRUE
+
+.INCLUDE: settings.mk
+.IF "$(L10N_framework)"==""
+
+# no "lib" prefix
+DLLPRE =
+
+SLOFILES=$(SLO)$/cmis_provider.obj\
+ $(SLO)$/cmis_content.obj
+
+SHL1TARGET=$(TARGET)$(UCPCMIS_MAJOR).uno
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+SHL1LIBS=$(SLB)$/$(TARGET).lib
+SHL1IMPLIB=i$(TARGET)
+SHL1STDLIBS=\
+ $(CPPUHELPERLIB) \
+ $(CPPULIB) \
+ $(SALLIB) \
+ $(SALHELPERLIB) \
+ $(UCBHELPERLIB) \
+ $(CMISLIB)
+
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
+
+.ENDIF # L10N_framework
+
+.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/ucpcmis.component
+
+$(MISC)/ucpcmis.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
+ ucpcmis.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt ucpcmis.component
diff --git a/ucb/source/ucp/cmis/ucpcmis.component b/ucb/source/ucp/cmis/ucpcmis.component
new file mode 100644
index 000000000000..0d617800e76c
--- /dev/null
+++ b/ucb/source/ucp/cmis/ucpcmis.component
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.CmisContentProvider">
+ <service name="com.sun.star.ucb.CmisContentProvider"/>
+ </implementation>
+</component>
diff --git a/ucb/source/ucp/cmis/ucpcmis.xml b/ucb/source/ucp/cmis/ucpcmis.xml
new file mode 100644
index 000000000000..b5fa1bbf9b75
--- /dev/null
+++ b/ucb/source/ucp/cmis/ucpcmis.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ]
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+**********************************************************************-->
+<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
+<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
+
+ <module-name>
+ ucpcmis
+ </module-name>
+
+ <component-description>
+ <author>
+ Cédric Bosdonnat
+ </author>
+ <name>
+ com.sun.star.comp.ucb.CmisContentProvider
+ </name>
+ <description>
+ This component implements a Content Provider for the Universal
+ Content Broker. It provides access to contents stored on a
+ CMIS-enabled server.
+ </description>
+ <loader-name>
+ com.sun.star.loader.SharedLibrary
+ </loader-name>
+ <language>
+ c++
+ </language>
+ <status value="final"/>
+ <supported-service>
+ com.sun.star.ucb.CmisContentProvider
+ </supported-service>
+
+ <service-dependency>
+ com.sun.star.configuration.ConfigurationAccess
+ </service-dependency>
+ <service-dependency>
+ com.sun.star.configuration.ConfigurationProvider
+ </service-dependency>
+ </component-description>
+
+ <project-build-dependency> external </project-build-dependency>
+ <project-build-dependency> sal </project-build-dependency>
+ <project-build-dependency> cppu </project-build-dependency>
+ <project-build-dependency> cppuhelper </project-build-dependency>
+ <project-build-dependency> ucbhelper </project-build-dependency>
+
+ <runtime-module-dependency> sal3 </runtime-module-dependency>
+ <runtime-module-dependency> cppu3 </runtime-module-dependency>
+ <runtime-module-dependency> cppuhelper3$(COM) </runtime-module-dependency>
+ <runtime-module-dependency> ucbhelper4$(COM) </runtime-module-dependency>
+
+ <type> com.sun.star.beans.PropertyAttribute </type>
+ <type> com.sun.star.beans.PropertyValue </type>
+ <type> com.sun.star.beans.XPropertiesChangeNotifier </type>
+ <type> com.sun.star.beans.XPropertyAccess </type>
+ <type> com.sun.star.beans.XPropertyContainer </type>
+ <type> com.sun.star.beans.XPropertySetInfoChangeNotifier </type>
+ <type> com.sun.star.container.XChild </type>
+ <type> com.sun.star.container.XNameAccess </type>
+ <type> com.sun.star.io.XActiveDataSink </type>
+ <type> com.sun.star.io.XInputStream </type>
+ <type> com.sun.star.io.XOutputStream </type>
+ <type> com.sun.star.io.XSeekable </type>
+ <type> com.sun.star.lang.IllegalAccessException </type>
+ <type> com.sun.star.lang.XComponent </type>
+ <type> com.sun.star.lang.XMultiServiceFactory </type>
+ <type> com.sun.star.lang.XServiceInfo </type>
+ <type> com.sun.star.lang.XSingleServiceFactory </type>
+ <type> com.sun.star.lang.XTypeProvider </type>
+ <type> com.sun.star.registry.XRegistryKey </type>
+ <type> com.sun.star.sdbc.XCloseable </type>
+ <type> com.sun.star.sdbc.XColumnLocate </type>
+ <type> com.sun.star.sdbc.XResultSetMetaDataSupplier </type>
+ <type> com.sun.star.sdbc.XRow </type>
+ <type> com.sun.star.ucb.ContentCreationException </type>
+ <type> com.sun.star.ucb.ContentInfoAttribute </type>
+ <type> com.sun.star.ucb.InsertCommandArgument </type>
+ <type> com.sun.star.ucb.MissingInputStreamException </type>
+ <type> com.sun.star.ucb.MissingPropertiesException </type>
+ <type> com.sun.star.ucb.NameClash </type>
+ <type> com.sun.star.ucb.NameClashException </type>
+ <type> com.sun.star.ucb.OpenCommandArgument2 </type>
+ <type> com.sun.star.ucb.OpenMode </type>
+ <type> com.sun.star.ucb.PostCommandArgument2 </type>
+ <type> com.sun.star.ucb.RememberAuthentication </type>
+ <type> com.sun.star.ucb.ResultSetException </type>
+ <type> com.sun.star.ucb.TransferInfo </type>
+ <type> com.sun.star.ucb.XCommandEnvironment </type>
+ <type> com.sun.star.ucb.UnsupportedCommandException </type>
+ <type> com.sun.star.ucb.UnsupportedDataSinkException </type>
+ <type> com.sun.star.ucb.UnsupportedNameClashException </type>
+ <type> com.sun.star.ucb.UnsupportedOpenModeException </type>
+ <type> com.sun.star.ucb.XCommandInfo </type>
+ <type> com.sun.star.ucb.XCommandInfoChangeNotifier </type>
+ <type> com.sun.star.ucb.XCommandProcessor </type>
+ <type> com.sun.star.ucb.XContentAccess </type>
+ <type> com.sun.star.ucb.XContentProvider </type>
+ <type> com.sun.star.ucb.XDynamicResultSet </type>
+ <type> com.sun.star.ucb.XPersistentPropertySet </type>
+ <type> com.sun.star.util.DateTime </type>
+</module-description>