ImagingTools Core SDK
Protected Member Functions | Protected Attributes | List of all members
imtrepo::CFileCollectionCompBaseabstract

#include <CFileCollectionCompBase.h>

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

Protected Member Functions

virtual istd::IChangeableUniquePtr CreateDataObject (const QByteArray &typeId) const
 
virtual istd::IChangeableUniquePtr CreateObjectFromFile (const QString &filePath, const QByteArray &typeId) const
 
QString SaveCollectionItem (const CFileCollectionItem &repositoryItem, const QString &dataFilePath=QString()) const
 
virtual bool SaveMetaInfo (const idoc::IDocumentMetaInfo &metaInfo, const QString &metaInfoFilePath) const
 
virtual bool LoadMetaInfo (idoc::IDocumentMetaInfo &metaInfo, const QString &metaInfoFilePath) const
 
bool IsPathInsideRepository (const QString &filePath) const
 
int GetFileIndexById (const QByteArray &fileId) const
 
int GetFileIndexByName (const QString &fileName) const
 
virtual idoc::MetaInfoPtr CreateItemMetaInfo (const QString &dataObjectFilePath, const QByteArray &typeId) const
 
bool CreateItemMetaInfoFile (const QString &dataObjectFilePath, const QByteArray &typeId, const QString &metaInfoFilePath) const
 
void UpdateItemMetaInfo (CFileCollectionItem &item) const
 
virtual QString CalculateFolderPathInRepository (const QString &localFilePath, const QString &resourceName, const QByteArray &typeId, ilog::IMessageConsumer *messageConsumerPtr) const =0
 

Protected Attributes

ResourceTypeConstraintsModel m_resourceTypeConstraints
 
Files m_files
 

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 }
 
- Public Member Functions inherited from imtbase::IObjectCollection
template<typename Interface >
const Interface * GetObjectPtr (const Id &objectId) const
 
virtual void ResetObjectIds ()
 
- Public Member Functions inherited from imtrepo::IFileCollectionInfo
virtual FileCollectionLayout GetCollectionFileLayout () const =0
 

Detailed Description

Base class of the file collection. General implementation

Definition at line 80 of file CFileCollectionCompBase.h.

Member Function Documentation

◆ CalculateFolderPathInRepository()

virtual QString imtrepo::CFileCollectionCompBase::CalculateFolderPathInRepository ( const QString &  localFilePath,
const QString &  resourceName,
const QByteArray &  typeId,
ilog::IMessageConsumer *  messageConsumerPtr 
) const
protectedpure virtual

Calculate path in file collection for the local file path

◆ CreateDataObject()

virtual istd::IChangeableUniquePtr imtrepo::CFileCollectionCompBase::CreateDataObject ( const QByteArray &  typeId) const
protectedvirtual

Create data object for the given type.

◆ CreateItemMetaInfo()

virtual idoc::MetaInfoPtr imtrepo::CFileCollectionCompBase::CreateItemMetaInfo ( const QString &  dataObjectFilePath,
const QByteArray &  typeId 
) const
protectedvirtual

Create meta-info object for a given file in the file collection.

Returns
The instance of the meta-information object, or NULL of no meta-info was created for the given file.

◆ CreateItemMetaInfoFile()

bool imtrepo::CFileCollectionCompBase::CreateItemMetaInfoFile ( const QString &  dataObjectFilePath,
const QByteArray &  typeId,
const QString &  metaInfoFilePath 
) const
protected

Create the meta information file.

◆ CreateObjectFromFile()

virtual istd::IChangeableUniquePtr imtrepo::CFileCollectionCompBase::CreateObjectFromFile ( const QString &  filePath,
const QByteArray &  typeId 
) const
protectedvirtual

Create object data from the file.

◆ GetFileIndexById()

int imtrepo::CFileCollectionCompBase::GetFileIndexById ( const QByteArray &  fileId) const
protected

Get the index of the file by file ID. If the file was not found, the method will return a negative number.

◆ GetFileIndexByName()

int imtrepo::CFileCollectionCompBase::GetFileIndexByName ( const QString &  fileName) const
protected

Get the index of the file by file (resource) name. If the file was not found, the method will return a negative number.

◆ IsPathInsideRepository()

bool imtrepo::CFileCollectionCompBase::IsPathInsideRepository ( const QString &  filePath) const
protected

Check if the path to the file is inside of repository folder.

◆ LoadMetaInfo()

virtual bool imtrepo::CFileCollectionCompBase::LoadMetaInfo ( idoc::IDocumentMetaInfo &  metaInfo,
const QString &  metaInfoFilePath 
) const
protectedvirtual

Load file's meta info.

Parameters
metaInfoMeta info of the resource file.
filePathPath to the meta info file.
Returns
true of the operation was sucessfull, or false otherwise.

◆ SaveCollectionItem()

QString imtrepo::CFileCollectionCompBase::SaveCollectionItem ( const CFileCollectionItem repositoryItem,
const QString &  dataFilePath = QString() 
) const
protected

Write a file collection item to file system.

Parameters
repositoryItemcollection item
dataFilePathtarget file path for the data item. If this parameter is empty file path defined in repositoryItem will be used.
Todo:
Refactor this method --> liquid shit in the brain of the programmer!

◆ SaveMetaInfo()

virtual bool imtrepo::CFileCollectionCompBase::SaveMetaInfo ( const idoc::IDocumentMetaInfo &  metaInfo,
const QString &  metaInfoFilePath 
) const
protectedvirtual

Save file's meta info.

Parameters
metaInfoMeta info of the resource file.
filePathOptionally defined name of the meta info file. If not specified, the file path will be calculated automatically.
Returns
true of the operation was sucessfull, or false otherwise.

◆ UpdateItemMetaInfo()

void imtrepo::CFileCollectionCompBase::UpdateItemMetaInfo ( CFileCollectionItem item) const
protected

Update the meta informations for the existing item.

Member Data Documentation

◆ m_files

Files imtrepo::CFileCollectionCompBase::m_files
mutableprotected

Collection data. Mutex used for locking the collection items.

Definition at line 451 of file CFileCollectionCompBase.h.

◆ m_resourceTypeConstraints

ResourceTypeConstraintsModel imtrepo::CFileCollectionCompBase::m_resourceTypeConstraints
protected

Supported types of the objects in the collection.

Definition at line 445 of file CFileCollectionCompBase.h.