22 #ifndef ctkXnatObject_h
23 #define ctkXnatObject_h
25 #include "ctkXNATCoreExport.h"
36 class ctkXnatObjectPrivate;
53 virtual QString
id()
const;
57 virtual void setId(
const QString&
id);
64 virtual QString
name()
const;
67 virtual void setName(
const QString& name);
120 void fetch(
bool forceFetch =
false);
128 void save(
bool overwrite =
true);
143 QString format =
"", QString content =
"", QString tags =
"");
160 static const QString
ID;
184 const QScopedPointer<ctkXnatObjectPrivate>
d_ptr;
188 friend class ctkXnatSessionPrivate;
190 void setSchemaType(
const QString& schemaType);
193 virtual void fetchImpl() = 0;
196 virtual void downloadImpl(
const QString&) = 0;
202 virtual void saveImpl(
bool overwrite =
true);
QList< ctkXnatObject * > children() const
Gets the children of the object.
void setParent(ctkXnatObject *parent)
Sets the parent of the object in the data hierarchy.
ctkXnatObject(const ctkXnatObject &)
QString schemaType() const
virtual QString id() const
Gets the global ID of the object.
virtual QString resourceUri() const =0
void setProperty(const QString &name, const QVariant &value)
Sets the value of the property with the given name.
QString property(const QString &name) const
Gets the value of the property with the given name.
ctkXnatObject(ctkXnatObject *parent=0, const QString &schemaType=QString::null)
Constructs the ctkXnatObject.
void setLastModifiedTime(const QDateTime &lastModifiedTime)
Sets the last modfication time on the server.
ctkXnatObject(ctkXnatObjectPrivate &dd, ctkXnatObject *parent=0, const QString &schemaType=QString::null)
Constructs the ctkXnatObject with the given private part.
virtual QString childDataType() const
Gets a human readable name of the child object type.
ctkXnatObject * parent() const
void fetch(bool forceFetch=false)
Fetches the children and the properties of the object.
virtual void setName(const QString &name)
Sets the name of the object.
static const QString XSI_SCHEMA_TYPE
ctkXnatSession * session() const
void add(ctkXnatObject *child)
Adds an object to the children of the current one.
void setDescription(const QString &description)
Sets the description of the object.
virtual QString name() const
Gets the name of the object.
const QMap< QString, QString > & properties() const
Gets the properties of the object.
void remove(ctkXnatObject *child)
Removes the object from the children of the current object.
void download(const QString &)
virtual void fetchResources(const QString &path="/resources")
Fetches the resources of the object.
virtual QDateTime lastModifiedTimeOnServer()
Gets the last modification time from the server.
static const QString NAME
static const QString LABEL
bool isFetched() const
Tells if the children and the properties of the objects have been fetched.
bool exists() const
Checks if the object exists on the XNAT server.
void save(bool overwrite=true)
virtual ctkXnatResource * addResourceFolder(QString foldername, QString format="", QString content="", QString tags="")
virtual ~ctkXnatObject()
Destructs the ctkXnatObject.
void erase()
Deletes the object on the XNAT server and removes it from its parent.
virtual void setId(const QString &id)
QString description() const
Gets the description of the object.
const QScopedPointer< ctkXnatObjectPrivate > d_ptr
The private implementation part of the object.
The ctkXnatSession class reprents a session object associated with a specific XNAT connection.
Q_DECLARE_METATYPE(ctkDICOMPersonName)