summaryrefslogtreecommitdiff
path: root/libcmis/libcmis-0.3.0-lotus-live-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libcmis/libcmis-0.3.0-lotus-live-fix.patch')
-rw-r--r--libcmis/libcmis-0.3.0-lotus-live-fix.patch122
1 files changed, 0 insertions, 122 deletions
diff --git a/libcmis/libcmis-0.3.0-lotus-live-fix.patch b/libcmis/libcmis-0.3.0-lotus-live-fix.patch
deleted file mode 100644
index 2aca934df806..000000000000
--- a/libcmis/libcmis-0.3.0-lotus-live-fix.patch
+++ /dev/null
@@ -1,122 +0,0 @@
-diff --git src/libcmis/atom-folder.cxx src/libcmis/atom-folder.cxx
-index 68fb124..2756a5d 100644
---- src/libcmis/atom-folder.cxx
-+++ src/libcmis/atom-folder.cxx
-@@ -57,8 +57,11 @@ vector< libcmis::ObjectPtr > AtomFolder::getChildren( ) throw ( libcmis::Excepti
- {
- AtomLink* childrenLink = getLink( "down", "application/atom+xml;type=feed" );
-
-+ // Some servers aren't giving the GetChildren properly... if not defined, we need to try
-+ // as we may have the right to proceed.
- if ( ( NULL == childrenLink ) || ( getAllowableActions( ).get() &&
-- !getAllowableActions()->isAllowed( libcmis::ObjectAction::GetChildren ) ) )
-+ ( !getAllowableActions()->isAllowed( libcmis::ObjectAction::GetChildren ) &&
-+ getAllowableActions()->isDefined( libcmis::ObjectAction::GetChildren ) ) ) )
- throw libcmis::Exception( string( "GetChildren not allowed on node " ) + getId() );
-
- vector< libcmis::ObjectPtr > children;
-@@ -182,7 +185,8 @@ libcmis::DocumentPtr AtomFolder::createDocument( const map< string, libcmis::Pro
- AtomLink* childrenLink = getLink( "down", "application/atom+xml;type=feed" );
-
- if ( ( NULL == childrenLink ) || ( getAllowableActions( ).get() &&
-- !getAllowableActions()->isAllowed( libcmis::ObjectAction::CreateDocument ) ) )
-+ !getAllowableActions()->isAllowed( libcmis::ObjectAction::CreateDocument ) &&
-+ getAllowableActions()->isDefined( libcmis::ObjectAction::CreateDocument ) ) )
- throw libcmis::Exception( string( "CreateDocument not allowed on folder " ) + getId() );
-
- xmlBufferPtr buf = xmlBufferCreate( );
-@@ -210,9 +214,37 @@ libcmis::DocumentPtr AtomFolder::createDocument( const map< string, libcmis::Pro
- }
-
- string respBuf = response->getStream( )->str( );
-- xmlDocPtr doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), getInfosUrl().c_str(), NULL, 0 );
-+ xmlDocPtr doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), getInfosUrl().c_str(), NULL, XML_PARSE_NOERROR );
- if ( NULL == doc )
-- throw libcmis::Exception( "Failed to parse object infos" );
-+ {
-+ // We may not have the created document entry in the response body: this is
-+ // the behaviour of some servers, but the standard says we need to look for
-+ // the Location header.
-+ map< string, string >& headers = response->getHeaders( );
-+ map< string, string >::iterator it = headers.find( "Location" );
-+
-+ // Some servers like Lotus Live aren't sending Location header, but Content-Location
-+ if ( it == headers.end( ) )
-+ it = headers.find( "Content-Location" );
-+
-+ if ( it != headers.end() )
-+ {
-+ try
-+ {
-+ response = getSession( )->httpGetRequest( it->second );
-+ respBuf = response->getStream( )->str( );
-+ doc = xmlReadMemory( respBuf.c_str(), respBuf.size(), getInfosUrl().c_str(), NULL, XML_PARSE_NOERROR );
-+ }
-+ catch ( const CurlException& e )
-+ {
-+ throw e.getCmisException( );
-+ }
-+ }
-+
-+ // if doc is still NULL after that, then throw an exception
-+ if ( NULL == doc )
-+ throw libcmis::Exception( "Missing expected response from server" );
-+ }
-
- libcmis::ObjectPtr created = getSession( )->createObjectFromEntryDoc( doc );
- xmlFreeDoc( doc );
-diff --git src/libcmis/atom-object.cxx src/libcmis/atom-object.cxx
-index b7b3b4a..812951d 100644
---- src/libcmis/atom-object.cxx
-+++ src/libcmis/atom-object.cxx
-@@ -140,6 +140,34 @@ libcmis::ObjectPtr AtomObject::updateProperties( const map< string, libcmis::Pro
- return updated;
- }
-
-+libcmis::AllowableActionsPtr AtomObject::getAllowableActions( )
-+{
-+ if ( !m_allowableActions )
-+ {
-+ // For some reason we had no allowable actions before, get them now.
-+ AtomLink* link = getLink( "http://docs.oasis-open.org/ns/cmis/link/200908/allowableactions", "application/cmisallowableactions+xml" );
-+ if ( link )
-+ {
-+ try
-+ {
-+ libcmis::HttpResponsePtr response = getSession()->httpGetRequest( link->getHref() );
-+ string buf = response->getStream()->str();
-+ xmlDocPtr doc = xmlReadMemory( buf.c_str(), buf.size(), link->getHref().c_str(), NULL, 0 );
-+ xmlNodePtr actionsNode = xmlDocGetRootElement( doc );
-+ if ( actionsNode )
-+ m_allowableActions.reset( new libcmis::AllowableActions( actionsNode ) );
-+
-+ xmlFreeDoc( doc );
-+ }
-+ catch ( libcmis::Exception& )
-+ {
-+ }
-+ }
-+ }
-+
-+ return libcmis::Object::getAllowableActions();
-+}
-+
- void AtomObject::refreshImpl( xmlDocPtr doc ) throw ( libcmis::Exception )
- {
- bool createdDoc = ( NULL == doc );
-diff --git src/libcmis/atom-object.hxx src/libcmis/atom-object.hxx
-index 2d1761d..452b4f5 100644
---- src/libcmis/atom-object.hxx
-+++ src/libcmis/atom-object.hxx
-@@ -69,6 +69,8 @@ class AtomObject : public virtual libcmis::Object
- virtual libcmis::ObjectPtr updateProperties(
- const std::map< std::string, libcmis::PropertyPtr >& properties ) throw ( libcmis::Exception );
-
-+ virtual libcmis::AllowableActionsPtr getAllowableActions( );
-+
- /** Reload the data from the server.
- */
- virtual void refresh( ) throw ( libcmis::Exception ) { refreshImpl( NULL ); }
---
-1.7.10.4
-