/usr/include/libcmis-0.5/libcmis/object.hxx is in libcmis-dev 0.5.1+git20160603-3build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | /* libcmis
* Version: MPL 1.1 / GPLv2+ / LGPLv2+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2011 SUSE <cbosdonnat@suse.com>
*
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPLv2+"), or
* the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
* in which case the provisions of the GPLv2+ or the LGPLv2+ are applicable
* instead of those above.
*/
#ifndef _OBJECT_HXX_
#define _OBJECT_HXX_
#include <ctime>
#include <map>
#include <string>
#include <vector>
#ifndef __cplusplus
#include <stdbool.h>
#endif
#include <boost/date_time.hpp>
#include <boost/shared_ptr.hpp>
#include <libxml/tree.h>
#include "allowable-actions.hxx"
#include "exception.hxx"
#include "object-type.hxx"
#include "property.hxx"
#include "xmlserializable.hxx"
#include "rendition.hxx"
namespace libcmis
{
class Folder;
class Session;
/** Class representing any CMIS object.
*/
class Object : public XmlSerializable
{
protected:
Session* m_session;
ObjectTypePtr m_typeDescription;
time_t m_refreshTimestamp;
/** Type id used as cache before we get it as a property
*/
std::string m_typeId;
std::map< std::string, PropertyPtr > m_properties;
boost::shared_ptr< AllowableActions > m_allowableActions;
std::vector< RenditionPtr > m_renditions;
void initializeFromNode( xmlNodePtr node );
public:
Object( Session* session );
Object( Session* session, xmlNodePtr node );
Object( const Object& copy );
virtual ~Object( ) { }
Object& operator=( const Object& copy );
virtual std::string getId( );
virtual std::string getName( );
virtual std::string getStringProperty( const std::string& propertyName );
/** Computes the paths for the objects.
Note that folders will have only path, documents may have
several ones and there may be cases where there is no path
at all (unfilled objects);
*/
virtual std::vector< std::string > getPaths( );
virtual std::string getBaseType( );
virtual std::string getType( );
virtual std::string getCreatedBy( );
virtual boost::posix_time::ptime getCreationDate( );
virtual std::string getLastModifiedBy( );
virtual boost::posix_time::ptime getLastModificationDate( );
virtual std::string getChangeToken( );
virtual bool isImmutable( );
virtual std::vector< std::string > getSecondaryTypes();
/** Convenience function adding a secondary type to the object.
Behind the scene this function is basically computing the
properties and sets them for you to avoid reading the CMIS
1.1 specification, section 2.1.9.
\param id
the identifier of the secondary type to add
\param properties
the properties coming with the secondary type
\return
the updated object. Note that it may represent the same
object on the server but it still is a different object
instance (see updateProperties method).
\throw Exception
if anything wrong happens. Note that the server is likely
to throw a constraint exception if it doesn't allow the
operation.
*/
virtual boost::shared_ptr< Object > addSecondaryType(
std::string id,
PropertyPtrMap properties )
throw ( Exception );
/** Convenience function removing a secondary type from the object.
Behind the scene this function is basically computing the
correct property and sets it for you to avoid reading the
CMIS 1.1 specification, section 2.1.9.
The server should remove the related properties, there is
normally no need to worry about them.
\param id
the identifier of the secondary type to remove
\return
the updated object. Note that it may represent the same
object on the server but it still is a different object
instance (see updateProperties method).
\throw Exception
if anything wrong happens. Note that the server is likely
to throw a constraint exception if it doesn't allow the
operation.
*/
virtual boost::shared_ptr< Object > removeSecondaryType( std::string id )
throw ( Exception );
/** Gives access to the properties of the object.
\attention
API users should consider this method as read-only as the
changed properties won't be updated to the server. Updating
the returned map may lead to changes loss when calling
updateProperties.
\sa updateProperties to change properties on the server
*/
virtual libcmis::PropertyPtrMap& getProperties( );
/** Get the renditions of the object.
\param filter is defined by the CMIS spec section 2.2.1.2.4.1.
By default, this value is just ignored, but some bindings and servers
may use it.
\attention
The streamId of the rendition is used in getContentStream( )
*/
virtual std::vector< RenditionPtr> getRenditions( std::string filter = std::string( ) )
throw ( Exception );
virtual AllowableActionsPtr getAllowableActions( ) { return m_allowableActions; }
/** Update the object properties and return the updated object.
\attention
even if the returned object may have the same Id than 'this'
and thus representing the same object on the server, those
are still two different instances to ease memory handling.
*/
virtual boost::shared_ptr< Object > updateProperties(
const PropertyPtrMap& properties ) throw ( Exception ) = 0;
virtual ObjectTypePtr getTypeDescription( );
/** Reload the data from the server.
*/
virtual void refresh( ) throw ( Exception ) = 0;
virtual time_t getRefreshTimestamp( ) { return m_refreshTimestamp; }
virtual void remove( bool allVersions = true ) throw ( Exception ) = 0;
virtual void move( boost::shared_ptr< Folder > source, boost::shared_ptr< Folder > destination ) throw ( Exception ) = 0;
virtual std::string getThumbnailUrl( ) throw ( Exception );
/** Dump the object as a string for debugging or display purpose.
*/
virtual std::string toString( );
void toXml( xmlTextWriterPtr writer );
};
typedef ::boost::shared_ptr< Object > ObjectPtr;
}
#endif
|