From a7b86c0e647bef6da677fa71aa921976bd165138 Mon Sep 17 00:00:00 2001 From: Mihai Varga Date: Mon, 23 Jun 2014 11:44:40 +0300 Subject: Updated CMIS patches and the makefile for the OneDrive binding To fix build, also squashed in: Author: Miklos Vajna Date: Sun Dec 14 15:18:58 2014 +0100 upload libcmis 0.5.0 Author: Mihai Varga 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 --- external/libcmis/StaticLibrary_cmis.mk | 19 +- external/libcmis/UnpackedTarball_cmis.mk | 4 - external/libcmis/libcmis-0.4.1-empty-path.patch | 13 - .../libcmis/libcmis-0.4.1-properties-fix.patch | 280 --------------------- ...libcmis-0.4.1-unreferenced-local-variable.patch | 96 ------- external/libcmis/libcmis-0.4.1.patch | 95 ------- .../libcmis/libcmis-libxml2_compatibility.patch | 2 +- 7 files changed, 19 insertions(+), 490 deletions(-) delete mode 100644 external/libcmis/libcmis-0.4.1-empty-path.patch delete mode 100644 external/libcmis/libcmis-0.4.1-properties-fix.patch delete mode 100644 external/libcmis/libcmis-0.4.1-unreferenced-local-variable.patch delete mode 100644 external/libcmis/libcmis-0.4.1.patch (limited to 'external/libcmis') diff --git a/external/libcmis/StaticLibrary_cmis.mk b/external/libcmis/StaticLibrary_cmis.mk index f87df26dea9f..76c0866c289c 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 1ee253d3f207..16d440054f2d 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 c48265d21681..000000000000 --- 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 b3739e9511f2..000000000000 --- 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?= -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 @@ -+ -+ -+ -+ unknown -+ -+ Some obscure Id -+ 2013-01-28T14:10:06Z -+ Test Document -+ 2013-01-28T14:10:06Z -+ 2013-01-28T14:10:06Z -+ -+ -+ -+ -+ 12345 -+ -+ -+ DocumentLevel2 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ true -+ -+ -+ -+ -+ false -+ -+ -+ unknown -+ -+ -+ unknown -+ -+ -+ -+ blue -+ -+ -+ -+ -+ true -+ -+ -+ -+ Test Document -+ -+ -+ text/plain -+ -+ -+ My Doc StringProperty 6 -+ -+ -+ 2013-01-28T14:10:06.736Z -+ -+ -+ 1359382206736 -+ -+ -+ -+ -+ -+ -+ test-document -+ -+ -+ false -+ -+ -+ true -+ -+ -+ cmis:document -+ -+ -+ -+ data.txt -+ -+ -+ 2013-01-28T14:10:06.736Z -+ -+ -+ -+ true -+ true -+ false -+ true -+ false -+ true -+ false -+ false -+ true -+ true -+ true -+ false -+ false -+ true -+ true -+ true -+ true -+ true -+ false -+ false -+ false -+ false -+ false -+ false -+ false -+ false -+ false -+ false -+ false -+ -+ -+ test-document -+ Test Document -+ -+ -+ -+ -+ workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70;2.2 -+ -+ -+ R:cm:original -+ -+ -+ admin -+ -+ -+ workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70;pwc -+ -+ -+ 75|workspace://SpacesStore/3885d9a2-0540-41ab-810a-38ccb1b160d6|workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70|{http://www.alfresco.org/model/content/1.0}original -+ -+ -+ admin -+ -+ -+ assoc:75 -+ -+ -+ 2010-05-01T00:00:00+02:00 -+ -+ -+ -+ cmis:relationship -+ -+ -+ 75|workspace://SpacesStore/3885d9a2-0540-41ab-810a-38ccb1b160d6|workspace://SpacesStore/5d8908d9-1b4a-4265-b1de-5d7244fcea70|{http://www.alfresco.org/model/content/1.0}original -+ -+ -+ -+ 2010-05-01T00:00:00+02:00 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -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 453d1b78e751..000000000000 --- 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 214475fc575d..000000000000 --- 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 85db97eab3ed..aeb492b25753 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 ) { -- cgit