ImagingTools Core SDK
Public Member Functions | List of all members
imtrepo::IFileObjectCollectionabstract

#include <IFileObjectCollection.h>

Inheritance diagram for imtrepo::IFileObjectCollection:
imtbase::IObjectCollection imtrepo::IFileCollectionInfo imtbase::IObjectCollectionInfo imtbase::ICollectionInfo imtrepo::CFileCollectionCompBase imtrepo::CFileRepositoryComp

Public Member Functions

virtual QString GetFile (const QByteArray &objectId, const QString &targetFilePath=QString()) const =0
 
virtual QByteArray InsertFile (const QString &filePath, const QByteArray &objectTypeId=QByteArray(), const QString &objectName=QString(), const QString &objectDescription=QString(), const QByteArray &proposedObjectId=QByteArray(), const idoc::IDocumentMetaInfo *dataMetaInfoPtr=nullptr, const idoc::IDocumentMetaInfo *collectionItemMetaInfoPtr=nullptr)=0
 
virtual bool UpdateFile (const QString &filePath, const QByteArray &objectId)=0
 
- Public Member Functions inherited from imtbase::IObjectCollection
virtual const IRevisionControllerGetRevisionController () const =0
 
virtual const ICollectionDataControllerGetDataController () const =0
 
virtual int GetOperationFlags (const Id &elementId=Id()) const =0
 
virtual Id InsertNewObject (const QByteArray &typeId, const QString &name, const QString &description, const istd::IChangeable *defaultValuePtr=nullptr, const Id &proposedElementId=Id(), const idoc::IDocumentMetaInfo *dataMetaInfoPtr=nullptr, const idoc::IDocumentMetaInfo *elementMetaInfoPtr=nullptr, const IOperationContext *operationContextPtr=nullptr)=0
 
virtual bool RemoveElements (const Ids &elementIds, const IOperationContext *operationContextPtr=nullptr)=0
 
virtual bool RemoveElementSet (const iprm::IParamsSet *selectionParamsPtr=nullptr, const IOperationContext *operationContextPtr=nullptr)=0
 
virtual bool RestoreObjects (const Ids &objectIds, const IOperationContext *operationContextPtr=nullptr)=0
 
virtual bool RestoreObjectSet (const iprm::IParamsSet *selectionParamsPtr=nullptr, const IOperationContext *operationContextPtr=nullptr)=0
 
virtual const istd::IChangeable * GetObjectPtr (const Id &objectId) const =0
 
template<typename Interface >
const Interface * GetObjectPtr (const Id &objectId) const
 
virtual bool GetObjectData (const Id &objectId, DataPtr &dataPtr, const iprm::IParamsSet *dataConfigurationPtr=nullptr) const =0
 
virtual bool SetObjectData (const Id &objectId, const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS, const IOperationContext *operationContextPtr=nullptr)=0
 
virtual istd::TUniqueInterfacePtr< IObjectCollectionCreateSubCollection (int offset=0, int count=-1, const iprm::IParamsSet *selectionParamsPtr=nullptr) const =0
 
virtual imtbase::IObjectCollectionIteratorCreateObjectCollectionIterator (const QByteArray &objectId=QByteArray(), int offset=0, int count=-1, const iprm::IParamsSet *selectionParamsPtr=nullptr) const =0
 
virtual void ResetObjectIds ()
 
- Public Member Functions inherited from imtbase::IObjectCollectionInfo
virtual const iprm::IOptionsList * GetObjectTypesInfo () const =0
 
virtual Id GetObjectTypeId (const Id &objectId) const =0
 
virtual idoc::MetaInfoPtr GetDataMetaInfo (const Id &objectId) const =0
 
- Public Member Functions inherited from imtbase::ICollectionInfo
virtual int GetElementsCount (const iprm::IParamsSet *selectionParamsPtr=nullptr, ilog::IMessageConsumer *logPtr=nullptr) const =0
 
virtual Ids GetElementIds (int offset=0, int count=-1, const iprm::IParamsSet *selectionParamsPtr=nullptr, ilog::IMessageConsumer *logPtr=nullptr) const =0
 
virtual bool GetSubsetInfo (ICollectionInfo &subsetInfo, int offset=0, int count=-1, const iprm::IParamsSet *selectionParamsPtr=nullptr, ilog::IMessageConsumer *logPtr=nullptr) const =0
 
virtual QVariant GetElementInfo (const Id &elementId, int infoType, ilog::IMessageConsumer *logPtr=nullptr) const =0
 
virtual idoc::MetaInfoPtr GetElementMetaInfo (const Id &elementId, ilog::IMessageConsumer *logPtr=nullptr) const =0
 
virtual bool SetElementName (const Id &elementId, const QString &name, ilog::IMessageConsumer *logPtr=nullptr)=0
 
virtual bool SetElementDescription (const Id &elementId, const QString &description, ilog::IMessageConsumer *logPtr=nullptr)=0
 
virtual bool SetElementEnabled (const Id &elementId, bool isEnabled=true, ilog::IMessageConsumer *logPtr=nullptr)=0
 
- Public Member Functions inherited from imtrepo::IFileCollectionInfo
virtual const ifile::IFileResourceTypeConstraints * GetFileTypeConstraints () const =0
 
virtual bool GetFileInfo (const QByteArray &objectId, IFileCollectionItem &collectionItem) const =0
 
virtual FileCollectionLayout GetCollectionFileLayout () const =0
 
virtual QString GetCollectionRootFolder () const =0
 
virtual int GetRepositoryRevision () const =0
 

Additional Inherited Members

- Public Types inherited from imtbase::IObjectCollection
enum  OperationalFlags {
  OF_SUPPORT_RENAME = 1 , OF_SUPPORT_INSERT = 2 , OF_SUPPORT_DELETE = 4 , OF_SUPPORT_EDIT = 8 ,
  OF_SUPPORT_USING = 16 , OF_SUPPORT_PAGINATION = 32 , OF_ALL = OF_SUPPORT_RENAME | OF_SUPPORT_INSERT | OF_SUPPORT_DELETE | OF_SUPPORT_EDIT | OF_SUPPORT_USING | OF_SUPPORT_PAGINATION
}
 
- Public Types inherited from imtbase::ICollectionInfo
enum  ChangeFlags {
  CF_ADDED = 10000 , CF_ELEMENT_RENAMED , CF_ELEMENT_DESCRIPTION_CHANGED , CF_ELEMENT_STATE ,
  CF_REMOVED , CF_RESTORED , CF_LAST
}
 
enum  ElementInfoType { EIT_NAME , EIT_DESCRIPTION , EIT_ENABLED , EIT_USER = 1000 }
 
enum  MetaInfoType {
  MIT_INSERTION_USER = idoc::IDocumentMetaInfo::MIT_USER + 10000 , MIT_INSERTION_TIME , MIT_LAST_OPERATION_USER , MIT_LAST_OPERATION_TIME ,
  MIT_PREVIEW_THUMBNAIL , MIT_REVISION = idoc::IDocumentMetaInfo::MIT_USER + 20000
}
 
- Public Types inherited from imtrepo::IFileCollectionInfo
enum  FileCollectionLayout { FCL_FLAT , FCL_FOLDER }
 

Detailed Description

Common interface for an object collection, where the objects are stored in the file system.

Definition at line 22 of file IFileObjectCollection.h.

Member Function Documentation

◆ GetFile()

virtual QString imtrepo::IFileObjectCollection::GetFile ( const QByteArray &  objectId,
const QString &  targetFilePath = QString() 
) const
pure virtual

Get file from the collection.

Parameters
objectIdID of the file object.
targetFilePathPath to the location where the file should be stored. If the path is empty, the implementation should define the location of the file automatically.
Returns
Path to the file on the local system or an empty string if the operation has been failed.

◆ InsertFile()

virtual QByteArray imtrepo::IFileObjectCollection::InsertFile ( const QString &  filePath,
const QByteArray &  objectTypeId = QByteArray(),
const QString &  objectName = QString(),
const QString &  objectDescription = QString(),
const QByteArray &  proposedObjectId = QByteArray(),
const idoc::IDocumentMetaInfo *  dataMetaInfoPtr = nullptr,
const idoc::IDocumentMetaInfo *  collectionItemMetaInfoPtr = nullptr 
)
pure virtual

Add a file to the collection

Parameters
filePathPath to the file.
objectTypeIdType-ID of the file object.
See also
GetFileTypeConstraints
Parameters
objectNameName of the file object used for human readable representation. If no name was set, the file name will be used.
objectDescriptionDescription of the file object.
proposedObjectIdUser-defined object-ID. If this parameter is not set, the implementation should generate a ID automatically.
Returns
ID of the file object. If the operation was not successful, the method returns an empty collection ID.

◆ UpdateFile()

virtual bool imtrepo::IFileObjectCollection::UpdateFile ( const QString &  filePath,
const QByteArray &  objectId 
)
pure virtual

Update file in the collection.

Parameters
filePathPath to the file containing the new data content.
objectIdID of the object to be updated in the collection.
Returns
true if the file object was successfully updated or false otherwise.