config_host/config_oauth2.h.in | 10 configure.ac | 35 + download.lst | 2 external/libcmis/StaticLibrary_cmis.mk | 19 external/libcmis/UnpackedTarball_cmis.mk | 4 external/libcmis/libcmis-0.4.1-empty-path.patch | 13 external/libcmis/libcmis-0.4.1-properties-fix.patch | 280 ---------- external/libcmis/libcmis-0.4.1-unreferenced-local-variable.patch | 96 --- external/libcmis/libcmis-0.4.1.patch | 95 --- external/libcmis/libcmis-libxml2_compatibility.patch | 2 include/ucbhelper/authenticationfallback.hxx | 52 + include/ucbhelper/interactionrequest.hxx | 34 + offapi/UnoApi_offapi.mk | 2 offapi/com/sun/star/ucb/AuthenticationFallbackRequest.idl | 35 + offapi/com/sun/star/ucb/XInteractionAuthFallback.idl | 32 + officecfg/registry/data/org/openoffice/Office/Common.xcu | 4 svtools/source/dialogs/ServerDetailsControls.cxx | 6 ucb/source/ucp/cmis/auth_provider.cxx | 48 + ucb/source/ucp/cmis/auth_provider.hxx | 11 ucb/source/ucp/cmis/cmis_content.cxx | 9 ucb/source/ucp/cmis/cmis_repo_content.cxx | 9 ucbhelper/Library_ucbhelper.mk | 1 ucbhelper/source/provider/authenticationfallback.cxx | 35 + ucbhelper/source/provider/interactionrequest.cxx | 56 ++ uui/Library_uui.mk | 1 uui/UIConfig_uui.mk | 1 uui/source/authfallbackdlg.cxx | 63 ++ uui/source/authfallbackdlg.hxx | 44 + uui/source/iahndl-authentication.cxx | 23 uui/source/iahndl.cxx | 9 uui/source/iahndl.hxx | 6 uui/uiconfig/ui/authfallback.ui | 96 +++ 32 files changed, 640 insertions(+), 493 deletions(-)
New commits: commit f31568f5ca97ec9765e68477e4d11c6aeba73235 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Mon Dec 15 11:05:28 2014 +0100 we need system libcmis 0.5.0 now Change-Id: I2bbac86709669bf67fc71d08075abd4afc19525a diff --git a/configure.ac b/configure.ac index c1adcfa..2b1a0a2 100644 --- a/configure.ac +++ b/configure.ac @@ -7538,7 +7538,7 @@ dnl Check for system libcmis dnl =================================================================== # libcmis requires curl and we can't build curl for iOS if test $_os != iOS; then - libo_CHECK_SYSTEM_MODULE([libcmis],[CMIS],[libcmis-0.4 >= 0.4.0]) + libo_CHECK_SYSTEM_MODULE([libcmis],[CMIS],[libcmis-0.5 >= 0.5.0]) ENABLE_CMIS=TRUE else ENABLE_CMIS= commit 3ec288f401a1aff83ef2fd1a5ecf19a7ee855528 Author: Mihai Varga <mihai.m...@gmail.com> Date: Sun Dec 14 12:17:04 2014 +0100 Fixed OneDrive scope to enable content access Change-Id: I1956db7dc46e710c1fb44281afaeef6843303944 diff --git a/config_host/config_oauth2.h.in b/config_host/config_oauth2.h.in index 72c19a8..f3616ee 100644 --- a/config_host/config_oauth2.h.in +++ b/config_host/config_oauth2.h.in @@ -41,7 +41,7 @@ #define ONEDRIVE_AUTH_URL "https://login.live.com/oauth20_authorize.srf" #define ONEDRIVE_TOKEN_URL "https://login.live.com/oauth20_token.srf" #define ONEDRIVE_REDIRECT_URI "https://login.live.com/oauth20_desktop.srf" -#define ONEDRIVE_SCOPE "wl.offline_access" +#define ONEDRIVE_SCOPE "wl.skydrive_update wl.offline_access" #endif commit fdb58084b1a6bbeb01a767048980e5172d5b819b Author: Mihai Varga <mihai.m...@gmail.com> Date: Mon Aug 11 13:23:53 2014 +0300 SharePoint binding settings, part 2 Change-Id: If4e08c851fd721252c0cf6ae05c85b88cd9ef8e7 diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu index fd51b4b..8895602 100644 --- a/officecfg/registry/data/org/openoffice/Office/Common.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu @@ -581,6 +581,7 @@ <it>http://<host>/_vti_bin/CMISSoapwsdl.aspx</it> <it>https://www.googleapis.com/drive/v2</it> <it>https://apis.live.net/v5.0</it> + <it>http://<host>/_api/Web</it> </value> </prop> <prop oor:name="CmisServersNames"> @@ -596,6 +597,7 @@ <it>SharePoint 2010</it> <it>Google Drive</it> <it>OneDrive</it> + <it>SharePoint 2013</it> </value> </prop> </node> commit ac5bdc79cde62d41b35af0fa9cc5226504928c91 Author: Mihai Varga <mihai.m...@gmail.com> Date: Fri Aug 1 12:51:45 2014 +0300 OneDrive auth fallback dialog makefile Change-Id: I5e759248ae5c461c7e47fefac894c314451810be diff --git a/uui/UIConfig_uui.mk b/uui/UIConfig_uui.mk index 41dc9e5..f0986cd 100644 --- a/uui/UIConfig_uui.mk +++ b/uui/UIConfig_uui.mk @@ -11,6 +11,7 @@ $(eval $(call gb_UIConfig_UIConfig,uui)) $(eval $(call gb_UIConfig_add_uifiles,uui,\ uui/uiconfig/ui/filterselect \ + uui/uiconfig/ui/authfallback \ uui/uiconfig/ui/logindialog \ uui/uiconfig/ui/macrowarnmedium \ uui/uiconfig/ui/masterpassworddlg \ commit 30298bc388f3e7c5b180904a8ad4f671e7b8b52b Author: Mihai Varga <mihai.m...@gmail.com> Date: Thu Jul 31 12:07:56 2014 +0300 OneDrive authfallback request is now issued Change-Id: I9ee1f087322d80cbdf8ca369fccb6b6b0336062e diff --git a/ucb/source/ucp/cmis/auth_provider.cxx b/ucb/source/ucp/cmis/auth_provider.cxx index bd00986..63e742f 100644 --- a/ucb/source/ucp/cmis/auth_provider.cxx +++ b/ucb/source/ucp/cmis/auth_provider.cxx @@ -13,6 +13,7 @@ #include <com/sun/star/task/XInteractionHandler.hpp> #include <ucbhelper/simpleauthenticationrequest.hxx> +#include <ucbhelper/authenticationfallback.hxx> #include "auth_provider.hxx" @@ -21,6 +22,8 @@ using namespace std; namespace cmis { + com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment> + AuthProvider::sm_xEnv; bool AuthProvider::authenticationQuery( string& username, string& password ) { if ( m_xEnv.is() ) @@ -62,6 +65,51 @@ namespace cmis } return false; } + + char* AuthProvider::onedriveAuthCodeFallback( const char* url, + const char* /*username*/, + const char* /*password*/ ) + { + OUString instructions = "Please open the following link in your browser and\n" + "paste the code from the URL you have been redirected to\n" + "in the box bellow. For example:\n" + "https://login.live.com/oauth20_desktop.srf?code=YOUR_CODE&lc=1033"; + OUString url_oustr( url, strlen( url ), RTL_TEXTENCODING_UTF8 ); + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment> xEnv = getXEnv( ); + + if ( xEnv.is() ) + { + uno::Reference< task::XInteractionHandler > xIH + = xEnv->getInteractionHandler(); + + if ( xIH.is() ) + { + rtl::Reference< ucbhelper::AuthenticationFallbackRequest > xRequest + = new ucbhelper::AuthenticationFallbackRequest ( + instructions, url_oustr ); + + xIH->handle( xRequest.get() ); + + rtl::Reference< ucbhelper::InteractionContinuation > xSelection + = xRequest->getSelection(); + + if ( xSelection.is() ) + { + // Handler handled the request. + const rtl::Reference< ucbhelper::InteractionAuthFallback >& + xAuthFallback = xRequest->getAuthFallbackInter( ); + if ( xAuthFallback.is() ) + { + OUString code = xAuthFallback->getCode( ); + return strdup( OUSTR_TO_STDSTR( code ).c_str( ) ); + } + } + } + } + + return strdup( "" ); + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/source/ucp/cmis/auth_provider.hxx b/ucb/source/ucp/cmis/auth_provider.hxx index f36d9a7..9fbf599 100644 --- a/ucb/source/ucp/cmis/auth_provider.hxx +++ b/ucb/source/ucp/cmis/auth_provider.hxx @@ -18,6 +18,7 @@ namespace cmis class AuthProvider : public libcmis::AuthProvider { const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment>& m_xEnv; + static com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment> sm_xEnv; OUString m_sUrl; OUString m_sBindingUrl; @@ -29,6 +30,16 @@ namespace cmis m_xEnv( xEnv ), m_sUrl( sUrl ), m_sBindingUrl( sBindingUrl ) { } bool authenticationQuery( std::string& username, std::string& password ) SAL_OVERRIDE; + + static char* onedriveAuthCodeFallback( const char* url, + const char* /*username*/, + const char* /*password*/ ); + + static void setXEnv( const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment>& xEnv ) { sm_xEnv = xEnv; } + + static com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment> getXEnv( ) { return sm_xEnv; } }; } diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index ad9fda4..80c7ca1 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -336,6 +336,7 @@ namespace cmis // Get the auth credentials AuthProvider authProvider( xEnv, m_xIdentifier->getContentIdentifier( ), m_aURL.getBindingUrl( ) ); + AuthProvider::setXEnv( xEnv ); string rUsername = OUSTR_TO_STDSTR( m_aURL.getUsername( ) ); string rPassword = OUSTR_TO_STDSTR( m_aURL.getPassword( ) ); @@ -354,10 +355,13 @@ namespace cmis ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI, ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) ); if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL ) + { + libcmis::SessionFactory::setOAuth2AuthCodeProvider( authProvider.onedriveAuthCodeFallback ); oauth2Data.reset( new libcmis::OAuth2Data( ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL, ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI, ONEDRIVE_CLIENT_ID, ONEDRIVE_CLIENT_SECRET ) ); + } m_pSession = libcmis::SessionFactory::createSession( OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ), diff --git a/ucb/source/ucp/cmis/cmis_repo_content.cxx b/ucb/source/ucp/cmis/cmis_repo_content.cxx index bb31b84..f140a15 100644 --- a/ucb/source/ucp/cmis/cmis_repo_content.cxx +++ b/ucb/source/ucp/cmis/cmis_repo_content.cxx @@ -159,6 +159,7 @@ namespace cmis // Get the auth credentials AuthProvider authProvider( xEnv, m_xIdentifier->getContentIdentifier( ), m_aURL.getBindingUrl( ) ); + AuthProvider::setXEnv( xEnv ); string rUsername = OUSTR_TO_STDSTR( m_aURL.getUsername( ) ); string rPassword = OUSTR_TO_STDSTR( m_aURL.getPassword( ) ); @@ -179,10 +180,13 @@ namespace cmis ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI, ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) ); if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL ) + { + libcmis::SessionFactory::setOAuth2AuthCodeProvider( authProvider.onedriveAuthCodeFallback ); oauth2Data.reset( new libcmis::OAuth2Data( ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL, ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI, ONEDRIVE_CLIENT_ID, ONEDRIVE_CLIENT_SECRET ) ); + } boost::scoped_ptr<libcmis::Session> session(libcmis::SessionFactory::createSession( OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ), commit a3b93ed6d8adc562687cbe419a1006660926164b Author: Mihai Varga <mihai.m...@gmail.com> Date: Thu Jul 31 11:41:20 2014 +0300 OneDrive authentication fallback request handler To fix build, squashed in: Author: Mihai Varga <mihai.m...@gmail.com> Date: Sun Dec 14 12:11:29 2014 +0100 Added namespace for vcl::Window Change-Id: I136912073582c29f68b25787b69f7cc117fb4a6a diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 81cd93a..fc5ea18 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/task/XInteractionPassword.hpp> #include <com/sun/star/task/XInteractionPassword2.hpp> #include <com/sun/star/task/XInteractionRetry.hpp> +#include <com/sun/star/ucb/XInteractionAuthFallback.hpp> #include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp> #include <com/sun/star/ucb/URLAuthenticationRequest.hpp> @@ -39,6 +40,7 @@ #include <vcl/abstdlg.hxx> #include <vcl/svapp.hxx> +#include "authfallbackdlg.hxx" #include "ids.hrc" #include "getcontinuations.hxx" #include "passwordcontainer.hxx" @@ -744,4 +746,25 @@ UUIInteractionHelper::handlePasswordRequest( return false; } +bool +UUIInteractionHelper::handleAuthFallbackRequest( OUString & instructions, + OUString & url, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations ) +{ + vcl::Window * pParent = getParentProperty( ); + AuthFallbackDlg *dlg = new AuthFallbackDlg( pParent, instructions, url ); + int retCode = dlg->Execute( ); + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< ucb::XInteractionAuthFallback > xAuthFallback; + getContinuations(rContinuations, &xAbort, &xAuthFallback); + + if( retCode == RET_OK && xAuthFallback.is( ) ) + { + xAuthFallback->setCode( dlg->GetCode( ) ); + xAuthFallback->select( ); + } + + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index d3563d0..6178d59 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/task/XInteractionHandler2.hpp> #include <com/sun/star/task/XInteractionRequest.hpp> #include <com/sun/star/task/XInteractionRetry.hpp> +#include <com/sun/star/ucb/AuthenticationFallbackRequest.hpp> #include <com/sun/star/ucb/InteractiveAppException.hpp> #include <com/sun/star/ucb/InteractiveLockingLockedException.hpp> #include <com/sun/star/ucb/InteractiveLockingNotLockedException.hpp> @@ -805,6 +806,14 @@ UUIInteractionHelper::handleRequest_impl( if (!bObtainErrorStringOnly) { + ucb::AuthenticationFallbackRequest anAuthFallbackRequest; + if ( aAnyRequest >>= anAuthFallbackRequest ) + { + handleAuthFallbackRequest( anAuthFallbackRequest.instructions, + anAuthFallbackRequest.url, rRequest->getContinuations() ); + return true; + } + if ( handleAuthenticationRequest( rRequest ) ) return true; diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 68e6b638..c207092 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -285,6 +285,12 @@ private: const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& i_rRequest, const OUString& i_rServiceName ) const; + + bool + handleAuthFallbackRequest( + OUString & instructions, + OUString & url, + Continuations const & rContinuations ); }; class ErrorResource: private Resource commit 4998e6a361252529cabcaac37b0f03bbed173544 Author: Mihai Varga <mihai.m...@gmail.com> Date: Thu Jul 31 11:33:02 2014 +0300 Authentication fallback request for the OneDrive connection To fix build, also squashed in: Author: Mihai Varga <mihai.m...@gmail.com> Date: Fri Aug 1 12:50:23 2014 +0300 OneDrive auth fallback dialog interaction continuation Change-Id: Id37f502217da3fde55ae93a6e1c01409509d657c diff --git a/include/ucbhelper/authenticationfallback.hxx b/include/ucbhelper/authenticationfallback.hxx new file mode 100644 index 0000000..5e7bb47 --- /dev/null +++ b/include/ucbhelper/authenticationfallback.hxx @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_UCBHELPER_AUTHENTICATIONFALLBACK_HXX +#define INCLUDED_UCBHELPER_AUTHENTICATIONFALLBACK_HXX + +#include <rtl/ref.hxx> +#include <ucbhelper/interactionrequest.hxx> +#include <ucbhelper/ucbhelperdllapi.h> +#include <com/sun/star/ucb/AuthenticationFallbackRequest.hpp> + + +namespace ucbhelper { + +/** + * This class implements a simple authentication interaction request used + * when programmatically authentication cannot succeed. + * + * Read-only values : instructions, url + * Read-write values: code + */ +class UCBHELPER_DLLPUBLIC AuthenticationFallbackRequest : public ucbhelper::InteractionRequest +{ +private: + rtl::Reference< ucbhelper::InteractionAuthFallback > m_xAuthFallback; + +public: + /** + * Constructor. + * + * @param rInstructions instructions to be followed by the user + * @param rURL contains a URL for which authentication is requested. + */ + AuthenticationFallbackRequest( const OUString & rInstructions, + const OUString & rURL ); + + const rtl::Reference< ucbhelper::InteractionAuthFallback >& + getAuthFallbackInter( ) const { return m_xAuthFallback; } + +}; + +} // namespace ucbhelper + +#endif /* ! INCLUDED_UCBHELPER_AUTHENTICATIONFALLBACK_HXX*/ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/ucbhelper/interactionrequest.hxx b/include/ucbhelper/interactionrequest.hxx index 84e0ca5..2138983 100644 --- a/include/ucbhelper/interactionrequest.hxx +++ b/include/ucbhelper/interactionrequest.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/task/XInteractionRetry.hpp> #include <com/sun/star/task/XInteractionApprove.hpp> #include <com/sun/star/task/XInteractionDisapprove.hpp> +#include <com/sun/star/ucb/XInteractionAuthFallback.hpp> #include <com/sun/star/ucb/XInteractionReplaceExistingData.hpp> #include <com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp> #include <rtl/ref.hxx> @@ -660,6 +661,39 @@ public: throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; }; +class UCBHELPER_DLLPUBLIC InteractionAuthFallback: + public InteractionContinuation, + public com::sun::star::ucb::XInteractionAuthFallback +{ + OUString m_aCode; + +public: + InteractionAuthFallback( InteractionRequest * pRequest ) + : InteractionContinuation( pRequest ) {} + + // XInterface + virtual com::sun::star::uno::Any SAL_CALL + queryInterface( const com::sun::star::uno::Type & rType ) + throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + virtual void SAL_CALL acquire() + throw() SAL_OVERRIDE; + virtual void SAL_CALL release() + throw() SAL_OVERRIDE; + + // XInteractionContinuation + virtual void SAL_CALL select() + throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE; + + // XAuthFallback + virtual void SAL_CALL setCode( const OUString& code ) + throw (::css::uno::RuntimeException, ::std::exception); + virtual OUString SAL_CALL getCode() + throw (::css::uno::RuntimeException, ::std::exception); + + +}; + + } // namespace ucbhelper #endif /* ! INCLUDED_UCBHELPER_INTERACTIONREQUEST_HXX */ diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 680a692..0028b46 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -3938,6 +3938,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/ucb,\ XFetchProvider \ XFetchProviderForContentAccess \ XFileIdentifierConverter \ + XInteractionAuthFallback \ XInteractionHandlerSupplier \ XInteractionReplaceExistingData \ XInteractionSupplyAuthentication \ diff --git a/offapi/com/sun/star/ucb/XInteractionAuthFallback.idl b/offapi/com/sun/star/ucb/XInteractionAuthFallback.idl new file mode 100644 index 0000000..cf0f2ec --- /dev/null +++ b/offapi/com/sun/star/ucb/XInteractionAuthFallback.idl @@ -0,0 +1,32 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef __com_sun_star_task_XInteractionApprove_idl__ +#define __com_sun_star_task_XInteractionApprove_idl__ + +#include <com/sun/star/task/XInteractionContinuation.idl> + + + + module com { module sun { module star { module ucb { + +/** An interaction continuation specifying authentication success. + */ +published interface XInteractionAuthFallback: com::sun::star::task::XInteractionContinuation +{ + /* Authentication code submited by the user */ + void setCode( [in] string code ); + string getCode( ); +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucbhelper/Library_ucbhelper.mk b/ucbhelper/Library_ucbhelper.mk index 8d1d805..6787db1 100644 --- a/ucbhelper/Library_ucbhelper.mk +++ b/ucbhelper/Library_ucbhelper.mk @@ -33,6 +33,7 @@ $(eval $(call gb_Library_add_exception_objects,ucbhelper,\ ucbhelper/source/client/fileidentifierconverter \ ucbhelper/source/client/interceptedinteraction \ ucbhelper/source/client/proxydecider \ + ucbhelper/source/provider/authenticationfallback \ ucbhelper/source/provider/cancelcommandexecution \ ucbhelper/source/provider/contenthelper \ ucbhelper/source/provider/contentidentifier \ diff --git a/ucbhelper/source/provider/authenticationfallback.cxx b/ucbhelper/source/provider/authenticationfallback.cxx new file mode 100644 index 0000000..5d8d0e2 --- /dev/null +++ b/ucbhelper/source/provider/authenticationfallback.cxx @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <ucbhelper/authenticationfallback.hxx> + +using namespace com::sun::star; +using namespace ucbhelper; + +AuthenticationFallbackRequest::AuthenticationFallbackRequest( + const OUString & rInstructions, + const OUString & rURL ) +{ + + ucb::AuthenticationFallbackRequest aRequest; + aRequest.instructions = rInstructions; + aRequest.url = rURL; + + setRequest( uno::makeAny( aRequest ) ); + m_xAuthFallback = new InteractionAuthFallback( this ); + + uno::Sequence< + uno::Reference< task::XInteractionContinuation > > aContinuations( 2 ); + aContinuations[ 0 ] = new InteractionAbort( this ); + aContinuations[ 1 ] = m_xAuthFallback.get( ); + + setContinuations( aContinuations ); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucbhelper/source/provider/interactionrequest.cxx b/ucbhelper/source/provider/interactionrequest.cxx index 8e3b68a..c36c2a6 100644 --- a/ucbhelper/source/provider/interactionrequest.cxx +++ b/ucbhelper/source/provider/interactionrequest.cxx @@ -940,4 +940,60 @@ void SAL_CALL InteractionReplaceExistingData::select() recordSelection(); } +// InteractionAuthFallback Implementation + +// XInterface methods. + +// virtual +void SAL_CALL InteractionAuthFallback::acquire() + throw() +{ + OWeakObject::acquire(); +} + +// virtual +void SAL_CALL InteractionAuthFallback::release() + throw() +{ + OWeakObject::release(); +} + +// virtual +uno::Any SAL_CALL +InteractionAuthFallback::queryInterface( const uno::Type & rType ) + throw ( uno::RuntimeException, std::exception ) +{ + uno::Any aRet = cppu::queryInterface( rType, + static_cast< task::XInteractionContinuation * >( this ), + static_cast< ucb::XInteractionAuthFallback * >( this )); + + return aRet.hasValue() + ? aRet : InteractionContinuation::queryInterface( rType ); +} + +// XInteractionContinuation methods. + +// virtual +void SAL_CALL InteractionAuthFallback::select() + throw( uno::RuntimeException, std::exception ) +{ + recordSelection(); +} + +// XInteractionAuthFallback methods + +// virtual +void SAL_CALL InteractionAuthFallback::setCode( const OUString& code ) + throw ( uno::RuntimeException, std::exception ) +{ + m_aCode = code; +} + +// virtual +OUString SAL_CALL InteractionAuthFallback::getCode( ) + throw ( uno::RuntimeException, std::exception ) +{ + return m_aCode; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit fc79b871ecfa351c5ac2587d95d8f65bae811621 Author: Mihai Varga <mihai.m...@gmail.com> Date: Thu Jul 31 11:20:37 2014 +0300 IDL definition for the auth fallback request Change-Id: Id47bf660c44e2df54c21b9b945b4be57799e4ec6 diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 781a9ba..680a692 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -3797,6 +3797,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/text,\ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/ucb,\ AlreadyInitializedException \ AuthenticationRequest \ + AuthenticationFallbackRequest \ CheckinArgument \ CertificateValidationRequest \ Command \ diff --git a/offapi/com/sun/star/ucb/AuthenticationFallbackRequest.idl b/offapi/com/sun/star/ucb/AuthenticationFallbackRequest.idl new file mode 100644 index 0000000..c92660e --- /dev/null +++ b/offapi/com/sun/star/ucb/AuthenticationFallbackRequest.idl @@ -0,0 +1,35 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ +#ifndef __com_sun_star_ucb_AuthenticationFallbackRequest_idl__ +#define __com_sun_star_ucb_AuthenticationFallbackRequest_idl__ + +#include <com/sun/star/task/ClassifiedInteractionRequest.idl> + +module com { module sun { module star { module ucb { + +/** An interaction continuation handing back some authentication data. +*/ +published exception AuthenticationFallbackRequest: com::sun::star::task::ClassifiedInteractionRequest +{ + /** Instructions to be followed by the user + */ + string instructions; + + /** url to be opened in browser + */ + string url; +}; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 1ef156897f0fb447b7ace271dbfd95beb8f1a859 Author: Mihai Varga <mihai.m...@gmail.com> Date: Thu Jul 31 11:10:07 2014 +0300 Authentication fallback dialog for the OneDrive connection It asks the user to access an URL in his browser and provide a code from the URL he has been redirected to diff --git a/uui/Library_uui.mk b/uui/Library_uui.mk index 4ad7de5..c1054aa 100644 --- a/uui/Library_uui.mk +++ b/uui/Library_uui.mk @@ -38,6 +38,7 @@ $(eval $(call gb_Library_use_libraries,uui,\ $(eval $(call gb_Library_add_exception_objects,uui,\ uui/source/alreadyopen \ + uui/source/authfallbackdlg \ uui/source/filechanged \ uui/source/fltdlg \ uui/source/iahndl \ diff --git a/uui/source/authfallbackdlg.cxx b/uui/source/authfallbackdlg.cxx new file mode 100644 index 0000000..5f1548d --- /dev/null +++ b/uui/source/authfallbackdlg.cxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "authfallbackdlg.hxx" + +#include <vcl/msgbox.hxx> +#include <iostream> + +using namespace boost; + +AuthFallbackDlg::AuthFallbackDlg( Window* pParent ) : + ModalDialog( pParent, "AuthFallbackDlg", "uui/ui/authfallback.ui" ) +{ + get( m_pTVInstructions, "instructions" ); + get( m_pEDUrl, "url" ); + get( m_pEDCode, "code" ); + get( m_pBTOk, "ok" ); + get( m_pBTCancel, "cancel" ); + + m_pBTOk->SetClickHdl( LINK( this, AuthFallbackDlg, OKHdl) ); + m_pBTOk->Enable( false ); +} + +AuthFallbackDlg::AuthFallbackDlg( Window* pParent, + const OUString& instructions, + const OUString& url ) : + ModalDialog( pParent, "AuthFallbackDlg", "uui/ui/authfallback.ui" ) +{ + get( m_pTVInstructions, "instructions" ); + get( m_pEDUrl, "url" ); + get( m_pEDCode, "code" ); + get( m_pBTOk, "ok" ); + get( m_pBTCancel, "cancel" ); + + m_pBTOk->SetClickHdl( LINK( this, AuthFallbackDlg, OKHdl) ); + m_pBTCancel->SetClickHdl( LINK( this, AuthFallbackDlg, CancelHdl) ); + m_pBTOk->Enable( true ); + + m_pTVInstructions->SetText( instructions ); + m_pEDUrl->SetText( url ); +} + +AuthFallbackDlg::~AuthFallbackDlg( ) +{ +} + +IMPL_LINK ( AuthFallbackDlg, OKHdl, Button *, EMPTYARG ) +{ + EndDialog( RET_OK ); + return 1; +} + +IMPL_LINK ( AuthFallbackDlg, CancelHdl, Button *, EMPTYARG ) +{ + EndDialog( RET_CANCEL ); + return 0; +} diff --git a/uui/source/authfallbackdlg.hxx b/uui/source/authfallbackdlg.hxx new file mode 100644 index 0000000..d068f48 --- /dev/null +++ b/uui/source/authfallbackdlg.hxx @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_SVTOOLS_AUTHFALLBACKDLG_HXX +#define INCLUDED_SVTOOLS_AUTHFALLBACKDLG_HXX + +#include <vcl/button.hxx> +#include <vcl/dialog.hxx> +#include <vcl/edit.hxx> +#include <vcl/vclmedit.hxx> + + +class AuthFallbackDlg : public ModalDialog +{ +private : + + VclMultiLineEdit* m_pTVInstructions; + Edit* m_pEDUrl; + Edit* m_pEDCode; + PushButton* m_pBTOk; + PushButton* m_pBTCancel; + +public : + + AuthFallbackDlg( Window* pParent); + AuthFallbackDlg(Window* pParent, const OUString& instructions, + const OUString& url ); + virtual ~AuthFallbackDlg(); + + OUString GetCode() { return m_pEDCode->GetText(); } + +private: + + DECL_LINK ( OKHdl, Button * ); + DECL_LINK ( CancelHdl, Button * ); +}; + +#endif // INCLUDED_SVTOOLS_AUTHFALLBACKDLG_HXX diff --git a/uui/uiconfig/ui/authfallback.ui b/uui/uiconfig/ui/authfallback.ui new file mode 100644 index 0000000..6e79a4c --- /dev/null +++ b/uui/uiconfig/ui/authfallback.ui @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="AuthFallbackDlg"> + <property name="can_focus">False</property> + <property name="title" translatable="yes">OneDrive authentication code</property> + <property name="default_width">400</property> + <property name="default_height">270</property> + <child> + <object class="GtkBox" id="box"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <child> + <object class="GtkTextView" id="instructions"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="pixels_below_lines">4</property> + <property name="editable">False</property> + <property name="cursor_visible">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="url"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">â</property> + <property name="editable">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="code"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="invisible_char">â</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkButtonBox" id="buttonbox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">46</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label" translatable="yes">Ok</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label" translatable="yes">Cancel</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="receives_default">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="padding">6</property> + <property name="position">3</property> + </packing> + </child> + </object> + </child> + </object> +</interface> commit fc1bfd9e6d774917bd90d67b1135402d2d33ef6b Author: Mihai Varga <mihai.m...@gmail.com> Date: Mon Jun 23 19:14:08 2014 +0300 OneDrive binding settings Change-Id: I72c97931098c1a029d39532e3433c0aeaba73e3f diff --git a/config_host/config_oauth2.h.in b/config_host/config_oauth2.h.in index 40c57a8..72c19a8 100644 --- a/config_host/config_oauth2.h.in +++ b/config_host/config_oauth2.h.in @@ -33,6 +33,16 @@ #define ALFRESCO_CLOUD_REDIRECT_URI "http://127.0.0.1/Callback" #define ALFRESCO_CLOUD_SCOPE "public_api" + +/* OneDrive */ +#define ONEDRIVE_BASE_URL "https://apis.live.net/v5.0" +#define ONEDRIVE_CLIENT_ID "" +#define ONEDRIVE_CLIENT_SECRET "" +#define ONEDRIVE_AUTH_URL "https://login.live.com/oauth20_authorize.srf" +#define ONEDRIVE_TOKEN_URL "https://login.live.com/oauth20_token.srf" +#define ONEDRIVE_REDIRECT_URI "https://login.live.com/oauth20_desktop.srf" +#define ONEDRIVE_SCOPE "wl.offline_access" + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configure.ac b/configure.ac index 72ef58c..c1adcfa 100644 --- a/configure.ac +++ b/configure.ac @@ -2225,6 +2225,19 @@ AC_ARG_WITH(alfresco-cloud-client-secret, --with-alfresco-cloud-client-id is empty, the feature will be disabled]), ) +AC_ARG_WITH(onedrive-client-id, + AS_HELP_STRING([--with-onedrive-client-id], + [Provides the client id of the application for OAuth2 authentication + on OneDrive. If either this or --with-onedrive-client-secret is + empty, the feature will be disabled]), +) + +AC_ARG_WITH(onedrive-client-secret, + AS_HELP_STRING([--with-onedrive-client-secret], + [Provides the client secret of the application for OAuth2 + authentication on OneDrive. If either this or + --with-onedrive-client-id is empty, the feature will be disabled]), +) dnl =================================================================== dnl Do we want to use pre-build binary tarball for recompile dnl =================================================================== @@ -12361,6 +12374,26 @@ fi AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID) AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET) +AC_MSG_CHECKING([for OneDrive client id and secret]) +ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\"" +ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\"" +if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then + ONEDRIVE_CLIENT_ID="\"\"" +fi + +if test "$with_onedrive_client_secret" = "no" -o -z "$with_onedrive_client_secret"; then + ONEDRIVE_CLIENT_SECRET="\"\"" +fi + +if test -z "$ONEDRIVE_CLIENT_ID" -o -z "$ONEDRIVE_CLIENT_SECRET"; then + AC_MSG_RESULT([not set]) +else + AC_MSG_RESULT([set]) +fi +AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID) +AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET) + + # =================================================================== # De- or increase default verbosity of build process # =================================================================== diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu index 6cd4e22..fd51b4b 100644 --- a/officecfg/registry/data/org/openoffice/Office/Common.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu @@ -580,6 +580,7 @@ <it>http://ec2-184-72-233-127.compute-1.amazonaws.com/ot-cmis/services/RepositoryService?wsdl</it> <it>http://<host>/_vti_bin/CMISSoapwsdl.aspx</it> <it>https://www.googleapis.com/drive/v2</it> + <it>https://apis.live.net/v5.0</it> </value> </prop> <prop oor:name="CmisServersNames"> @@ -594,6 +595,7 @@ <it>OpenText ELS 10.2.0</it> <it>SharePoint 2010</it> <it>Google Drive</it> + <it>OneDrive</it> </value> </prop> </node> diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index 4bc907c..1c72356 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -283,6 +283,9 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) : OUString( GDRIVE_CLIENT_SECRET ).isEmpty(); bool bSkipAlfresco = OUString( ALFRESCO_CLOUD_CLIENT_ID ).isEmpty() || OUString( ALFRESCO_CLOUD_CLIENT_SECRET ).isEmpty(); + bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() || + OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty(); + Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) ); Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) ); @@ -290,7 +293,8 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) : { OUString sUrl = aTypesUrlsList[i]; if ( !( sUrl == GDRIVE_BASE_URL && bSkipGDrive ) && - !( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) ) + !( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) && + !( sUrl == ONEDRIVE_BASE_URL && bSkipOneDrive ) ) { m_pLBServerType->InsertEntry( aTypesNamesList[i] ); m_aServerTypesURLs.push_back( sUrl ); diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 08d01a8..ad9fda4 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -353,6 +353,11 @@ namespace cmis ALFRESCO_CLOUD_AUTH_URL, ALFRESCO_CLOUD_TOKEN_URL, ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI, ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) ); + if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL ) + oauth2Data.reset( new libcmis::OAuth2Data( + ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL, + ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI, + ONEDRIVE_CLIENT_ID, ONEDRIVE_CLIENT_SECRET ) ); m_pSession = libcmis::SessionFactory::createSession( OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ), diff --git a/ucb/source/ucp/cmis/cmis_repo_content.cxx b/ucb/source/ucp/cmis/cmis_repo_content.cxx index 5dc1ae1..bb31b84 100644 --- a/ucb/source/ucp/cmis/cmis_repo_content.cxx +++ b/ucb/source/ucp/cmis/cmis_repo_content.cxx @@ -178,6 +178,11 @@ namespace cmis ALFRESCO_CLOUD_AUTH_URL, ALFRESCO_CLOUD_TOKEN_URL, ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI, ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) ); + if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL ) + oauth2Data.reset( new libcmis::OAuth2Data( + ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL, + ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI, + ONEDRIVE_CLIENT_ID, ONEDRIVE_CLIENT_SECRET ) ); boost::scoped_ptr<libcmis::Session> session(libcmis::SessionFactory::createSession( OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ), commit a7b86c0e647bef6da677fa71aa921976bd165138 Author: Mihai Varga <mihai.m...@gmail.com> Date: Mon Jun 23 11:44:40 2014 +0300 Updated CMIS patches and the makefile for the OneDrive binding To fix build, also squashed in: Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sun Dec 14 15:18:58 2014 +0100 upload libcmis 0.5.0 Author: Mihai Varga <mihai.m...@gmail.com> Date: Mon Aug 11 13:23:53 2014 +0300 SharePoint binding settings, part 1 Conflicts: officecfg/registry/data/org/openoffice/Office/Common.xcu Change-Id: I45eb81a0139c42864f93ad89c4a31185f3ac5bd6 diff --git a/download.lst b/download.lst index b2cda7b..9afac7b 100644 --- a/download.lst +++ b/download.lst @@ -21,7 +21,7 @@ export CAIRO_TARBALL := f101a9e88b783337b20b2e26dfd26d5f-cairo-1.10.2.tar.gz export CDR_MD5SUM := b33fd0be3befdd1b37777e08ce058bd9 export CDR_TARBALL := libcdr-0.1.1.tar.bz2 export CLUCENE_TARBALL := 48d647fbd8ef8889e5a7f422c1bfda94-clucene-core-2.3.3.4.tar.gz -export CMIS_TARBALL := 22f8a85daf4a012180322e1f52a7563b-libcmis-0.4.1.tar.gz +export CMIS_TARBALL := 5821b806a98e6c38370970e682ce76e8-libcmis-0.5.0.tar.gz export COINMP_MD5SUM := 1cce53bf4b40ae29790d2c5c9f8b1129 export COINMP_TARBALL := CoinMP-1.7.6.tgz export COLLADA2GLTF_TARBALL := 4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2 diff --git a/external/libcmis/StaticLibrary_cmis.mk b/external/libcmis/StaticLibrary_cmis.mk index f87df26..76c0866 100644 --- a/external/libcmis/StaticLibrary_cmis.mk +++ b/external/libcmis/StaticLibrary_cmis.mk @@ -46,17 +46,34 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,cmislib,\ UnpackedTarball/cmis/src/libcmis/gdrive-repository \ UnpackedTarball/cmis/src/libcmis/gdrive-session \ UnpackedTarball/cmis/src/libcmis/gdrive-utils \ + UnpackedTarball/cmis/src/libcmis/http-session \ UnpackedTarball/cmis/src/libcmis/json-utils \ UnpackedTarball/cmis/src/libcmis/oauth2-data \ UnpackedTarball/cmis/src/libcmis/oauth2-handler \ UnpackedTarball/cmis/src/libcmis/oauth2-providers \ UnpackedTarball/cmis/src/libcmis/object \ UnpackedTarball/cmis/src/libcmis/object-type \ - UnpackedTarball/cmis/src/libcmis/property-type \ + UnpackedTarball/cmis/src/libcmis/onedrive-document \ + UnpackedTarball/cmis/src/libcmis/onedrive-folder \ + UnpackedTarball/cmis/src/libcmis/onedrive-object \ + UnpackedTarball/cmis/src/libcmis/onedrive-object-type \ + UnpackedTarball/cmis/src/libcmis/onedrive-property \ + UnpackedTarball/cmis/src/libcmis/onedrive-repository \ + UnpackedTarball/cmis/src/libcmis/onedrive-session \ + UnpackedTarball/cmis/src/libcmis/onedrive-utils \ UnpackedTarball/cmis/src/libcmis/property \ + UnpackedTarball/cmis/src/libcmis/property-type \ UnpackedTarball/cmis/src/libcmis/rendition \ UnpackedTarball/cmis/src/libcmis/repository \ UnpackedTarball/cmis/src/libcmis/session-factory \ + UnpackedTarball/cmis/src/libcmis/sharepoint-document \ + UnpackedTarball/cmis/src/libcmis/sharepoint-folder \ + UnpackedTarball/cmis/src/libcmis/sharepoint-object \ + UnpackedTarball/cmis/src/libcmis/sharepoint-object-type \ + UnpackedTarball/cmis/src/libcmis/sharepoint-property \ + UnpackedTarball/cmis/src/libcmis/sharepoint-repository \ + UnpackedTarball/cmis/src/libcmis/sharepoint-session \ + UnpackedTarball/cmis/src/libcmis/sharepoint-utils \ UnpackedTarball/cmis/src/libcmis/ws-document \ UnpackedTarball/cmis/src/libcmis/ws-folder \ UnpackedTarball/cmis/src/libcmis/ws-navigationservice \ diff --git a/external/libcmis/UnpackedTarball_cmis.mk b/external/libcmis/UnpackedTarball_cmis.mk index 1ee253d..16d4400 100644 --- a/external/libcmis/UnpackedTarball_cmis.mk +++ b/external/libcmis/UnpackedTarball_cmis.mk @@ -14,11 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,cmis,$(CMIS_TARBALL))) $(eval $(call gb_UnpackedTarball_set_patchlevel,cmis,0)) $(eval $(call gb_UnpackedTarball_add_patches,cmis, \ - external/libcmis/libcmis-0.4.1.patch \ - external/libcmis/libcmis-0.4.1-empty-path.patch \ - external/libcmis/libcmis-0.4.1-properties-fix.patch \ external/libcmis/libcmis-libxml2_compatibility.patch \ - external/libcmis/libcmis-0.4.1-unreferenced-local-variable.patch \ )) ifeq ($(OS)$(COM),WNTMSC) diff --git a/external/libcmis/libcmis-0.4.1-empty-path.patch b/external/libcmis/libcmis-0.4.1-empty-path.patch deleted file mode 100644 index c48265d2..0000000 --- a/external/libcmis/libcmis-0.4.1-empty-path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git src/libcmis/document.cxx src/libcmis/document.cxx -index 1af0d63..7ecfd24 100644 ---- src/libcmis/document.cxx -+++ src/libcmis/document.cxx -@@ -44,6 +44,8 @@ namespace libcmis - it != parents.end(); ++it ) - { - string path = ( *it )->getPath( ); -+ if ( path.empty() ) -+ continue; - if ( path[path.size() - 1] != '/' ) - path += "/"; - path += getName( ); diff --git a/external/libcmis/libcmis-0.4.1-properties-fix.patch b/external/libcmis/libcmis-0.4.1-properties-fix.patch deleted file mode 100644 index b3739e9..0000000 --- a/external/libcmis/libcmis-0.4.1-properties-fix.patch +++ /dev/null @@ -1,280 +0,0 @@ -From 958b3c763fb52d1bf2ad88c177e7e4f426aab354 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbo...@users.sourceforge.net> -Date: Wed, 4 Dec 2013 10:44:37 +0100 -Subject: [PATCH] Object creation mixed relationship properties with document - properties - -Added a Unit test to show the problem. We surely don't want the -relationship cmis:properties to be read as properties. This bug caused -some problems with other operations like checkout. ---- - .../data/atom/test-document-relationships.xml | 179 +++++++++++++++++++++ - qa/libcmis/test-atom.cxx | 34 ++++ - src/libcmis/object.cxx | 4 +- - 3 files changed, 215 insertions(+), 2 deletions(-) - create mode 100644 qa/libcmis/data/atom/test-document-relationships.xml - -diff --git qa/libcmis/data/atom/test-document-relationships.xml qa/libcmis/data/atom/test-document-relationships.xml -new file mode 100644 -index 0000000..bacfda8 ---- /dev/null -+++ qa/libcmis/data/atom/test-document-relationships.xml -@@ -0,0 +1,179 @@ -+<?xml version="1.0" encoding="UTF-8"?> -+<atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/" xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" xmlns:app="http://www.w3.org/2007/app"> -+ <atom:author> -+ <atom:name>unknown</atom:name> -+ </atom:author> -+ <atom:id>Some obscure Id</atom:id> -+ <atom:published>2013-01-28T14:10:06Z</atom:published> -+ <atom:title>Test Document</atom:title> -+ <app:edited>2013-01-28T14:10:06Z</app:edited> -+ <atom:updated>2013-01-28T14:10:06Z</atom:updated> -+ <atom:content src="http://mockup/mock/content/data.txt?id=test-document" type="text/plain"/> -+ <cmisra:object xmlns:ns3="http://docs.oasis-open.org/ns/cmis/messaging/200908/"> -+ <cmis:properties> -+ <cmis:propertyInteger queryName="cmis:contentStreamLength" displayName="Content Length" localName="cmis:contentStreamLength" propertyDefinitionId="cmis:contentStreamLength"> -+ <cmis:value>12345</cmis:value> -+ </cmis:propertyInteger> -+ <cmis:propertyId queryName="cmis:objectTypeId" displayName="Type-Id" localName="cmis:objectTypeId" propertyDefinitionId="cmis:objectTypeId"> -+ <cmis:value>DocumentLevel2</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyString queryName="cmis:versionSeriesCheckedOutBy" displayName="Checked Out By" localName="cmis:versionSeriesCheckedOutBy" propertyDefinitionId="cmis:versionSeriesCheckedOutBy"/> -+ <cmis:propertyHtml queryName="HtmlProp" displayName="Sample Html Property" localName="HtmlProp" propertyDefinitionId="HtmlProp"/> -+ <cmis:propertyId queryName="cmis:versionSeriesCheckedOutId" displayName="Checked Out Id" localName="cmis:versionSeriesCheckedOutId" propertyDefinitionId="cmis:versionSeriesCheckedOutId"/> -+ <cmis:propertyId queryName="IdProp" displayName="Sample Id Property" localName="IdProp" propertyDefinitionId="IdProp"/> -+ <cmis:propertyUri queryName="UriProp" displayName="Sample Uri Property" localName="UriProp" propertyDefinitionId="UriProp"/> -+ <cmis:propertyDateTime queryName="DateTimePropMV" displayName="Sample DateTime multi-value Property" localName="DateTimePropMV" propertyDefinitionId="DateTimePropMV"/> -+ <cmis:propertyId queryName="cmis:versionSeriesId" displayName="Version Series Id" localName="cmis:versionSeriesId" propertyDefinitionId="cmis:versionSeriesId"/> -+ <cmis:propertyDecimal queryName="DecimalProp" displayName="Sample Decimal Property" localName="DecimalProp" propertyDefinitionId="DecimalProp"/> -+ <cmis:propertyUri queryName="UriPropMV" displayName="Sample Uri multi-value Property" localName="UriPropMV" propertyDefinitionId="UriPropMV"/> -+ <cmis:propertyBoolean queryName="cmis:isLatestVersion" displayName="Is Latest Version" localName="cmis:isLatestVersion" propertyDefinitionId="cmis:isLatestVersion"> -+ <cmis:value>true</cmis:value> -+ </cmis:propertyBoolean> -+ <cmis:propertyString queryName="cmis:versionLabel" displayName="Version Label" localName="cmis:versionLabel" propertyDefinitionId="cmis:versionLabel"/> -+ <cmis:propertyBoolean queryName="BooleanProp" displayName="Sample Boolean Property" localName="BooleanProp" propertyDefinitionId="BooleanProp"/> -+ <cmis:propertyBoolean queryName="cmis:isVersionSeriesCheckedOut" displayName="Checked Out" localName="cmis:isVersionSeriesCheckedOut" propertyDefinitionId="cmis:isVersionSeriesCheckedOut"> -+ <cmis:value>false</cmis:value> -+ </cmis:propertyBoolean> -+ <cmis:propertyString queryName="cmis:lastModifiedBy" displayName="Modified By" localName="cmis:lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy"> -+ <cmis:value>unknown</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyString queryName="cmis:createdBy" displayName="Created By" localName="cmis:createdBy" propertyDefinitionId="cmis:createdBy"> -+ <cmis:value>unknown</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyId queryName="IdPropMV" displayName="Sample Id Html multi-value Property" localName="IdPropMV" propertyDefinitionId="IdPropMV"/> -+ <cmis:propertyString queryName="PickListProp" displayName="Sample Pick List Property" localName="PickListProp" propertyDefinitionId="PickListProp"> -+ <cmis:value>blue</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyHtml queryName="HtmlPropMV" displayName="Sample Html multi-value Property" localName="HtmlPropMV" propertyDefinitionId="HtmlPropMV"/> -+ <cmis:propertyInteger queryName="IntProp" displayName="Sample Int Property" localName="IntProp" propertyDefinitionId="IntProp"/> -+ <cmis:propertyBoolean queryName="cmis:isLatestMajorVersion" displayName="Is Latest Major Version" localName="cmis:isLatestMajorVersion" propertyDefinitionId="cmis:isLatestMajorVersion"> -+ <cmis:value>true</cmis:value> -+ </cmis:propertyBoolean> -+ <cmis:propertyString queryName="cmis:contentStreamId" displayName="Stream Id" localName="cmis:contentStreamId" propertyDefinitionId="cmis:contentStreamId"/> -+ <cmis:propertyString queryName="cmis:name" displayName="Name" localName="cmis:name" propertyDefinitionId="cmis:name"> -+ <cmis:value>Test Document</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyString queryName="cmis:contentStreamMimeType" displayName="Mime Type" localName="cmis:contentStreamMimeType" propertyDefinitionId="cmis:contentStreamMimeType"> -+ <cmis:value>text/plain</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyString queryName="StringProp" displayName="Sample String Property" localName="StringProp" propertyDefinitionId="StringProp"> -+ <cmis:value>My Doc StringProperty 6</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyDateTime queryName="cmis:creationDate" displayName="Creation Date" localName="cmis:creationDate" propertyDefinitionId="cmis:creationDate"> -+ <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> -+ </cmis:propertyDateTime> -+ <cmis:propertyString queryName="cmis:changeToken" displayName="Change Token" localName="cmis:changeToken" propertyDefinitionId="cmis:changeToken"> -+ <cmis:value>1359382206736</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyDecimal queryName="DecimalPropMV" displayName="Sample Decimal multi-value Property" localName="DecimalPropMV" propertyDefinitionId="DecimalPropMV"/> -+ <cmis:propertyDateTime queryName="DateTimeProp" displayName="Sample DateTime Property" localName="DateTimeProp" propertyDefinitionId="DateTimeProp"/> -+ <cmis:propertyBoolean queryName="BooleanPropMV" displayName="Sample Boolean multi-value Property" localName="BooleanPropMV" propertyDefinitionId="BooleanPropMV"/> -+ <cmis:propertyString queryName="cmis:checkinComment" displayName="Checkin Comment" localName="cmis:checkinComment" propertyDefinitionId="cmis:checkinComment"/> -+ <cmis:propertyId queryName="cmis:objectId" displayName="Object Id" localName="cmis:objectId" propertyDefinitionId="cmis:objectId"> -+ <cmis:value>test-document</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyBoolean queryName="cmis:isImmutable" displayName="Immutable" localName="cmis:isImmutable" propertyDefinitionId="cmis:isImmutable"> -+ <cmis:value>false</cmis:value> -+ </cmis:propertyBoolean> -+ <cmis:propertyBoolean queryName="cmis:isMajorVersion" displayName="Is Major Version" localName="cmis:isMajorVersion" propertyDefinitionId="cmis:isMajorVersion"> -+ <cmis:value>true</cmis:value> -+ </cmis:propertyBoolean> -+ <cmis:propertyId queryName="cmis:baseTypeId" displayName="Base-Type-Id" localName="cmis:baseTypeId" propertyDefinitionId="cmis:baseTypeId"> -+ <cmis:value>cmis:document</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyInteger queryName="IntPropMV" displayName="Sample Int multi-value Property" localName="IntPropMV" propertyDefinitionId="IntPropMV"/> -+ <cmis:propertyString queryName="cmis:contentStreamFileName" displayName="File Name" localName="cmis:contentStreamFileName" propertyDefinitionId="cmis:contentStreamFileName"> -+ <cmis:value>data.txt</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyDateTime queryName="cmis:lastModificationDate" displayName="Modification Date" localName="cmis:lastModificationDate" propertyDefinitionId="cmis:lastModificationDate"> -+ <cmis:value>2013-01-28T14:10:06.736Z</cmis:value> -+ </cmis:propertyDateTime> -+ </cmis:properties> -+ <cmis:allowableActions> -+ <cmis:canDeleteObject>true</cmis:canDeleteObject> -+ <cmis:canUpdateProperties>true</cmis:canUpdateProperties> -+ <cmis:canGetFolderTree>false</cmis:canGetFolderTree> -+ <cmis:canGetProperties>true</cmis:canGetProperties> -+ <cmis:canGetObjectRelationships>false</cmis:canGetObjectRelationships> -+ <cmis:canGetObjectParents>true</cmis:canGetObjectParents> -+ <cmis:canGetFolderParent>false</cmis:canGetFolderParent> -+ <cmis:canGetDescendants>false</cmis:canGetDescendants> -+ <cmis:canMoveObject>true</cmis:canMoveObject> -+ <cmis:canDeleteContentStream>true</cmis:canDeleteContentStream> -+ <cmis:canCheckOut>true</cmis:canCheckOut> -+ <cmis:canCancelCheckOut>false</cmis:canCancelCheckOut> -+ <cmis:canCheckIn>false</cmis:canCheckIn> -+ <cmis:canSetContentStream>true</cmis:canSetContentStream> -+ <cmis:canGetAllVersions>true</cmis:canGetAllVersions> -+ <cmis:canAddObjectToFolder>true</cmis:canAddObjectToFolder> -+ <cmis:canRemoveObjectFromFolder>true</cmis:canRemoveObjectFromFolder> -+ <cmis:canGetContentStream>true</cmis:canGetContentStream> -+ <cmis:canApplyPolicy>false</cmis:canApplyPolicy> -+ <cmis:canGetAppliedPolicies>false</cmis:canGetAppliedPolicies> -+ <cmis:canRemovePolicy>false</cmis:canRemovePolicy> -+ <cmis:canGetChildren>false</cmis:canGetChildren> -+ <cmis:canCreateDocument>false</cmis:canCreateDocument> -+ <cmis:canCreateFolder>false</cmis:canCreateFolder> -+ <cmis:canCreateRelationship>false</cmis:canCreateRelationship> -+ <cmis:canDeleteTree>false</cmis:canDeleteTree> -+ <cmis:canGetRenditions>false</cmis:canGetRenditions> -+ <cmis:canGetACL>false</cmis:canGetACL> -+ <cmis:canApplyACL>false</cmis:canApplyACL> -+ </cmis:allowableActions> -+ <exampleExtension:exampleExtension xmlns="http://mockup/cmis/extension" xmlns:exampleExtension="http://mockup/cmis/extension"> -+ <objectId xmlns:ns0="http://mockup/cmis/extension" ns0:type="DocumentLevel2">test-document</objectId> -+ <name>Test Document</name> -+ </exampleExtension:exampleExtension> -+ <cmis:relationship> -+ <cmis:properties> -+ <cmis:propertyId displayName="Target Id" localName="targetId" propertyDefinitionId="cmis:targetId" queryName="cmis:targetId"> -+ <cmis:value>workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70;2.2</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyId displayName="Object Type Id" localName="objectTypeId" propertyDefinitionId="cmis:objectTypeId" queryName="cmis:objectTypeId"> -+ <cmis:value>R:cm:original</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyString displayName="Last Modified By" localName="lastModifiedBy" propertyDefinitionId="cmis:lastModifiedBy" queryName="cmis:lastModifiedBy"> -+ <cmis:value>admin</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyId displayName="Source Id" localName="sourceId" propertyDefinitionId="cmis:sourceId" queryName="cmis:sourceId"> -+ <cmis:value>workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70;pwc</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyString displayName="Name" localName="name" propertyDefinitionId="cmis:name" queryName="cmis:name"> -+ <cmis:value>75|workspace://SpacesStore/3885d9a2-0540-41ab-810a-38ccb1b160d6|workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70|{http://www.alfresco.org/model/content/1.0}original</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyString displayName="Created by" localName="createdBy" propertyDefinitionId="cmis:createdBy" queryName="cmis:createdBy"> -+ <cmis:value>admin</cmis:value> -+ </cmis:propertyString> -+ <cmis:propertyId displayName="Object Id" localName="objectId" propertyDefinitionId="cmis:objectId" queryName="cmis:objectId"> -+ <cmis:value>assoc:75</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyDateTime displayName="Creation Date" localName="creationDate" propertyDefinitionId="cmis:creationDate" queryName="cmis:creationDate"> -+ <cmis:value>2010-05-01T00:00:00+02:00</cmis:value> -+ </cmis:propertyDateTime> -+ <cmis:propertyString displayName="Change token" localName="changeToken" propertyDefinitionId="cmis:changeToken" queryName="cmis:changeToken"/> -+ <cmis:propertyId displayName="Base Type Id" localName="baseTypeId" propertyDefinitionId="cmis:baseTypeId" queryName="cmis:baseTypeId"> -+ <cmis:value>cmis:relationship</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyId displayName="Alfresco Node Ref" localName="nodeRef" propertyDefinitionId="alfcmis:nodeRef" queryName="alfcmis:nodeRef"> -+ <cmis:value>75|workspace://SpacesStore/3885d9a2-0540-41ab-810a-38ccb1b160d6|workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70|{http://www.alfresco.org/model/content/1.0}original</cmis:value> -+ </cmis:propertyId> -+ <cmis:propertyString displayName="Description" localName="description" propertyDefinitionId="cmis:description" queryName="cmis:description"/> -+ <cmis:propertyDateTime displayName="Last Modified Date" localName="lastModificationDate" propertyDefinitionId="cmis:lastModificationDate" queryName="cmis:lastModificationDate"> -+ <cmis:value>2010-05-01T00:00:00+02:00</cmis:value> -+ </cmis:propertyDateTime> -+ </cmis:properties> -+ </cmis:relationship> -+ </cmisra:object> -+ <atom:link rel="service" href="http://mockup/mock" type="application/atomsvc+xml"/> -+ <atom:link rel="self" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry" cmisra:id="test-document"/> -+ <atom:link rel="enclosure" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> -+ <atom:link rel="edit" href="http://mockup/mock/id?id=test-document" type="application/atom+xml;type=entry"/> -+ <atom:link rel="describedby" href="http://mockup/mock/type?id=DocumentLevel2" type="application/atom+xml;type=entry"/> -+ <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions" href="http://mockup/mock/allowableactions?id=test-document" type="application/cmisallowableactions+xml"/> -+ <atom:link rel="up" href="http://mockup/mock/parents?id=test-document" type="application/atom+xml;type=feed"/> -+ <atom:link rel="edit-media" href="http://mockup/mock/content?id=test-document" type="text/plain"/> -+ <atom:link rel="http://docs.oasis-open.org/ns/cmis/link/200908/acl" href="http://mockup/mock/acl?id=test-document" type="application/cmisacl+xml"/> -+ <atom:link rel="version-history" href="http://mockup/mock/versions?id=test-document" type="application/atom+xml;type=feed"/> -+ <atom:link rel="alternate" href="http://mockup/mock/renditions?id=test-document-rendition1" type="image/png" cmisra:renditionKind="cmis:thumbnail" title="picture" length="40385"/> -+ <atom:link rel="alternate" href="http://mockup/mock/renditions?id=test-document-rendition2" type="application/pdf" cmisra:renditionKind="pdf" title="Doc as PDF"/> -+</atom:entry> -diff --git qa/libcmis/test-atom.cxx qa/libcmis/test-atom.cxx -index 57864d9..af16616 100644 ---- qa/libcmis/test-atom.cxx -+++ qa/libcmis/test-atom.cxx -@@ -64,6 +64,7 @@ class AtomTest : public CppUnit::TestFixture - void getTypeChildrenTest( ); - void getObjectTest( ); - void getDocumentTest( ); -+ void getDocumentRelationshipsTest( ); - void getUnexistantObjectTest( ); - void getFolderTest( ); - void getFolderBadTypeTest( ); -@@ -101,6 +102,7 @@ class AtomTest : public CppUnit::TestFixture - CPPUNIT_TEST( getTypeChildrenTest ); - CPPUNIT_TEST( getObjectTest ); - CPPUNIT_TEST( getDocumentTest ); -+ CPPUNIT_TEST( getDocumentRelationshipsTest ); - CPPUNIT_TEST( getUnexistantObjectTest ); - CPPUNIT_TEST( getFolderTest ); - CPPUNIT_TEST( getFolderBadTypeTest ); -@@ -441,6 +443,38 @@ void AtomTest::getDocumentTest( ) - CPPUNIT_ASSERT_MESSAGE( "Content length is missing", 12345 == document->getContentLength( ) ); - } - -+void AtomTest::getDocumentRelationshipsTest( ) -+{ -+ curl_mockup_reset( ); -+ curl_mockup_addResponse( "http://mockup/mock/id", "id=test-document", "GET", DATA_DIR "/atom/test-document-relationships.xml" ); -+ curl_mockup_addResponse( "http://mockup/mock/type", "id=DocumentLevel2", "GET", DATA_DIR "/atom/type-docLevel2.xml" ); -+ curl_mockup_setCredentials( SERVER_USERNAME, SERVER_PASSWORD ); -+ -+ AtomPubSession session = getTestSession( SERVER_USERNAME, SERVER_PASSWORD ); -+ -+ string expectedId( "test-document" ); -+ libcmis::ObjectPtr actual = session.getObject( expectedId ); -+ -+ // Do we have a document? -+ libcmis::DocumentPtr document = boost::dynamic_pointer_cast< libcmis::Document >( actual ); -+ CPPUNIT_ASSERT_MESSAGE( "Fetched object should be an instance of libcmis::DocumentPtr", -+ NULL != document ); -+ -+ // Test the document properties -+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document ID", expectedId, document->getId( ) ); -+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document name", string( "Test Document" ), document->getName( ) ); -+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong document type", string( "text/plain" ), document->getContentType( ) ); -+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong base type", string( "cmis:document" ), document->getBaseType( ) ); -+ -+ CPPUNIT_ASSERT_MESSAGE( "CreatedBy is missing", !document->getCreatedBy( ).empty( ) ); -+ CPPUNIT_ASSERT_MESSAGE( "CreationDate is missing", !document->getCreationDate( ).is_not_a_date_time() ); -+ CPPUNIT_ASSERT_MESSAGE( "LastModifiedBy is missing", !document->getLastModifiedBy( ).empty( ) ); -+ CPPUNIT_ASSERT_MESSAGE( "LastModificationDate is missing", !document->getLastModificationDate( ).is_not_a_date_time() ); -+ CPPUNIT_ASSERT_MESSAGE( "ChangeToken is missing", !document->getChangeToken( ).empty( ) ); -+ -+ CPPUNIT_ASSERT_MESSAGE( "Content length is missing", 12345 == document->getContentLength( ) ); -+} -+ - void AtomTest::getFolderTest( ) - { - curl_mockup_reset( ); -diff --git src/libcmis/object.cxx src/libcmis/object.cxx -index 538c98e..d5e0c7a 100644 ---- src/libcmis/object.cxx -+++ src/libcmis/object.cxx -@@ -105,10 +105,10 @@ namespace libcmis - xmlXPathFreeObject( xpathObj ); - - // First get the type id as it will give us the property definitions -- string typeIdReq( "//cmis:propertyId[@propertyDefinitionId='cmis:objectTypeId']/cmis:value/text()" ); -+ string typeIdReq( "/*/cmis:properties/cmis:propertyId[@propertyDefinitionId='cmis:objectTypeId']/cmis:value/text()" ); - m_typeId = libcmis::getXPathValue( xpathCtx, typeIdReq ); - -- string propertiesReq( "//cmis:properties/*" ); -+ string propertiesReq( "/*/cmis:properties/*" ); - xpathObj = xmlXPathEvalExpression( BAD_CAST( propertiesReq.c_str() ), xpathCtx ); - if ( NULL != xpathObj && NULL != xpathObj->nodesetval ) - { --- -1.8.4.4 - diff --git a/external/libcmis/libcmis-0.4.1-unreferenced-local-variable.patch b/external/libcmis/libcmis-0.4.1-unreferenced-local-variable.patch deleted file mode 100644 index 453d1b7..0000000 --- a/external/libcmis/libcmis-0.4.1-unreferenced-local-variable.patch +++ /dev/null @@ -1,96 +0,0 @@ ---- src/libcmis/base-session.cxx -+++ src/libcmis/base-session.cxx -@@ -281,7 +281,7 @@ - httpRunRequest( url ); - response->getData( )->finish( ); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - // If the access token is expired, we get 401 error, - // Need to use the refresh token to get a new one. -@@ -351,7 +351,7 @@ - httpRunRequest( url, headers ); - response->getData( )->finish(); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - long status = getHttpStatus( ); - /** If we had a HTTP 417 response, this is likely to be due to some -@@ -438,7 +438,7 @@ - httpRunRequest( url, headers, redirect ); - response->getData( )->finish(); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - - long status = getHttpStatus( ); -@@ -495,7 +495,7 @@ - { - httpRunRequest( url ); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - // If the access token is expired, we get 401 error, - // Need to use the refresh token to get a new one. ---- src/libcmis/oauth2-handler.cxx -+++ src/libcmis/oauth2-handler.cxx -@@ -104,7 +104,7 @@ - resp = m_session->httpPostRequest ( m_data->getTokenUrl(), is, - "application/x-www-form-urlencoded" ); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - throw libcmis::Exception( - "Couldn't get tokens from the authorization code "); -@@ -131,7 +131,7 @@ - resp = m_session->httpPostRequest( m_data->getTokenUrl( ), is, - "application/x-www-form-urlencoded" ); - } -- catch (const CurlException& e ) -+ catch (const CurlException& ) - { - throw libcmis::Exception( "Couldn't refresh token "); - } ---- src/libcmis/oauth2-providers.cxx -+++ src/libcmis/oauth2-providers.cxx -@@ -44,7 +44,7 @@ - { - res = session->httpGetRequest( authUrl )->getStream( )->str( ); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - return string( ); - } -@@ -65,7 +65,7 @@ - loginRes = session->httpPostRequest ( loginLink, loginIs, CONTENT_TYPE ) - ->getStream( )->str( ); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - return string( ); - } -@@ -105,7 +105,7 @@ - { - res = session->httpGetRequest( authUrl )->getStream( )->str( ); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - return string( ); - } -@@ -131,7 +131,7 @@ - // Alfresco code is in the redirect link - resp = session->httpPostRequest( loginLink, loginIs, CONTENT_TYPE, false ); - } -- catch ( const CurlException& e ) -+ catch ( const CurlException& ) - { - return string( ); - } diff --git a/external/libcmis/libcmis-0.4.1.patch b/external/libcmis/libcmis-0.4.1.patch deleted file mode 100644 index 214475f..0000000 --- a/external/libcmis/libcmis-0.4.1.patch +++ /dev/null @@ -1,95 +0,0 @@ -diff --git src/libcmis/json-utils.cxx src/libcmis/json-utils.cxx -index b537a09..b4e037d 100644 ---- src/libcmis/json-utils.cxx -+++ src/libcmis/json-utils.cxx -@@ -213,48 +213,54 @@ Json::Type Json::parseType( ) - { - Type type = json_string; - string str = toString( ); -- boost::posix_time::ptime time = libcmis::parseDateTime( str ); -- if ( !time.is_not_a_date_time( ) ) -- type = json_datetime; -- else -+ if ( str.empty( ) ) -+ return type; -+ try - { -- Type backupType = type; -- type = json_bool; -- try -- { -- parseBool( str ); -- } -- catch (...) -+ boost::posix_time::ptime time = libcmis::parseDateTime( str ); -+ if ( !time.is_not_a_date_time( ) ) -+ return json_datetime; -+ } -+ catch (...) -+ { -+ // Try other types -+ } -+ Type backupType = type; -+ type = json_bool; -+ try -+ { -+ parseBool( str ); -+ } -+ catch (...) -+ { -+ type = backupType; -+ } -+ if ( type != json_bool ) -+ { -+ if ( str.find('.') == string::npos ) - { -- type = backupType; -+ backupType = type; -+ type = json_int; -+ try -+ { -+ parseInteger( str ); -+ } -+ catch(...) -+ { -+ type = backupType; -+ } - } -- if ( type != json_bool ) -+ else - { -- if ( str.find('.') == string::npos ) -+ backupType = type; -+ type = json_double; -+ try - { -- backupType = type; -- type = json_int; -- try -- { -- parseInteger( str ); -- } -- catch(...) -- { -- type = backupType; -- } -+ parseDouble( str ); - } -- else -- { -- backupType = type; -- type = json_double; -- try -- { -- parseDouble( str ); -- } -- catch(...) -- { -- type = backupType; -- } -+ catch(...) -+ { -+ type = backupType; - } - } - } diff --git a/external/libcmis/libcmis-libxml2_compatibility.patch b/external/libcmis/libcmis-libxml2_compatibility.patch index 85db97e..aeb492b 100644 --- a/external/libcmis/libcmis-libxml2_compatibility.patch +++ b/external/libcmis/libcmis-libxml2_compatibility.patch @@ -9,6 +9,6 @@ +#define HTML_PARSE_RECOVER 0 +#endif + - string OAuth2Providers::OAuth2Gdrive( BaseSession* session, const string& authUrl, + string OAuth2Providers::OAuth2Gdrive( HttpSession* session, const string& authUrl, const string& username, const string& password ) {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits