~ubuntu-branches/ubuntu/trusty/libcmis/trusty

« back to all changes in this revision

Viewing changes to src/libcmis/ws-object.cxx

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher
  • Date: 2014-02-05 14:41:34 UTC
  • mfrom: (1.1.5) (2.1.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140205144134-ffvov1moblfapn82
Tags: 0.4.1-3ubuntu1
* Resynchronize on Debian, remaining change:
* debian/patches/powerpc64le.diff: build on ppc64el

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "ws-object.hxx"
30
30
 
31
31
using namespace std;
 
32
using libcmis::PropertyPtrMap;
32
33
 
33
34
WSObject::WSObject( WSSession* session ) :
34
35
    libcmis::Object( session )
60
61
    return *this;
61
62
}
62
63
 
 
64
vector< libcmis::RenditionPtr > WSObject::getRenditions( string filter ) throw ( libcmis::Exception )
 
65
{
 
66
    // Check that the server supports that optional feature. There is no need to check it
 
67
    // when getting the object as we may get them by shear luck
 
68
    libcmis::RepositoryPtr repo = getSession( )->getRepository( );
 
69
    bool isCapable = repo && repo->getCapability( libcmis::Repository::Renditions ) == "read";
 
70
 
 
71
    if ( m_renditions.empty() && isCapable )
 
72
    {
 
73
        string repoId = getSession( )->getRepositoryId( );
 
74
        m_renditions = getSession( )->getObjectService( ).getRenditions( repoId, this->getId( ), filter );
 
75
    }
 
76
    return m_renditions;
 
77
}
 
78
 
63
79
libcmis::ObjectPtr WSObject::updateProperties(
64
 
        const map< string, libcmis::PropertyPtr >& properties ) throw ( libcmis::Exception )
 
80
        const PropertyPtrMap& properties ) throw ( libcmis::Exception )
65
81
{
66
82
    string repoId = getSession( )->getRepositoryId( );
67
83
    return getSession( )->getObjectService( ).updateProperties( repoId, this->getId( ), properties, this->getChangeToken( ) );