roviz  0.7
Code Documentation of roviz
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
AbstractWorkspace Class Referenceabstract

#include <abstract_workspace.h>

Inheritance diagram for AbstractWorkspace:
Inheritance graph
Collaboration diagram for AbstractWorkspace:
Collaboration graph

Signals

void workspaceUpdated ()
 
void isValidChanged (bool isValid)
 
void workspaceNameChanged (const QString &workspaceName)
 
void workspaceConnectionChanged (const QString &workspaceConnection)
 
void workspaceDescriptionChanged (const QString &workspaceDescription)
 
void projectDomDocumentChanged (const QSharedPointer< AbstractProject > &project)
 

Public Member Functions

virtual void init ()=0
 Initialize the Workspace and set isValid flag. This function must be called, otherwise the workspace can't be valid. More...
 
virtual void update ()=0
 Update the workspace after property changes. More...
 
virtual bool compare (const QSharedPointer< AbstractWorkspace > &otherWorkspace) const =0
 Compare a other Workspace source with this Workspace source (not the Object adress). More...
 
virtual bool save ()=0
 Save workspace with all settings. More...
 
virtual bool test ()=0
 Workspace test procedure. The Test-Procedure is defined by the specific workspace class, which inherits from AbstractWorkspace class. More...
 
virtual bool deleteWorkspace (bool deleteProjects=false)=0
 Delete workspace. The function deletes this workspace and all included projects, if the deleteProjects flag is set true. More...
 
virtual bool deleteProject (const QSharedPointer< AbstractProject > &project)=0
 Delete a project and remove it from workspace. More...
 
bool removeProject (const QSharedPointer< AbstractProject > &project)
 Remove a project from workspace. The project will not be deleted. More...
 
bool removeProjects ()
 Remove all projects from workspace. The projects will not be deleted. More...
 
bool saveProjects () const
 Save all projects in workspace. More...
 
bool saveExternChangedProjects () const
 Save all projects in workspace which are changed by extern. More...
 
void resetProjects () const
 Reset all projects in workspace. Reload the complete project structure from xml. All settings, which are not saved will be discarded and the project isDirty flag will be set to false.
 
void resetExternChangedProjects () const
 Reset all projects in workspace which are changed by extern. More...
 
QStringList projectNames () const
 
bool validateWorkspaceDomDocument (const QDomDocument &domDocument)
 Validate a workspace DomDocument. More...
 
QDomDocument workspaceDomDocument () const
 
QString name () const
 
void setName (const QString &name)
 Set the workspace name. More...
 
bool isDefault () const
 
void setDefault (bool isDefault)
 Set workspace as default workspace. On Traviz start this workspace will be loaded directly. No workspace manager will be shown. More...
 
QString version () const
 
void setVersion (const QString &version)
 Set the workspace version. If the version is not compatible with the application condition the workspace could not be loaded. More...
 
int majorWorkspaceVersion () const
 
void setMajorWorkspaceVersion (int majorWorkspaceVersion)
 Set the workspace major version. If the version is not compatible with the application condition the workspace could not be loaded. More...
 
int minorWorkspaceVersion () const
 
void setMinorWorkspaceVersion (int minorWorkspaceVersion)
 Set the workspace minor version. If the version is not compatible with the application condition the workspace could not be loaded. More...
 
QVector< QSharedPointer< AbstractProject > > projects () const
 
QSharedPointer< AbstractProjectproject (QString connectionString) const
 
bool addProject (const QSharedPointer< AbstractProject > &project)
 Add a project into workspace. More...
 
void setProjects (const QVector< QSharedPointer< AbstractProject >> &projects)
 Set the vector of projects for a workspace. More...
 
int projectCount () const
 
void setConnectionString (const QString &connectionString)
 Set the Workspace connection string. The connectionString is unique source identifier inside a running Traviz application. More...
 
QString connectionString () const
 The Workspace connection string holds the source connection information (e.g File-Workspace -> filename, Sql-Workspace -> Server and user information). The connectionString is unique inside a running Traviz application and can be used to identifier a workspace. More...
 
QString description () const
 
void setDescription (const QString &description)
 Set the workspace description. More...
 
bool isOpen () const
 
virtual void setOpen (bool isOpen)
 Set the workspace open (in use) state. More...
 
QString className () const
 
SettingsScopesettingsScope ()
 
QString typeString () const
 
bool isValid () const
 
const QString lastError () const
 
void clearLastError ()
 
bool contains (const QSharedPointer< AbstractProject > &project) const
 
QString lastUsedDateTime () const
 
void setLastUsedDateTime (const QString &lastUsedDateTime)
 Set the workspace last used date value ("MM/dd/yyyy hh:mm:ss") More...
 

Static Public Member Functions

static QDomDocument workspaceDomDocumentTemplate (const QString &name, const QString &version, const QString &description)
 This static function creates a clean workspace DomDocument. More...
 

Protected Member Functions

 AbstractWorkspace (const QString &typeString)
 AbstractWorkspace constructor with typeString definition (e,g. File, Sql). More...
 
void setValid (bool isValid)
 Set the workspace valid. This property decides if a workspace is loadable or not. More...
 
void setLastError (const QString &lastError)
 Set the last occured workspace error string. More...
 
bool setWorkspaceProperties (const QDomDocument &domDocument)
 Set the workspace properties. The properties will be read from domDocument. More...
 
void setWorkspaceDomDocument (const QDomDocument &workspaceDomDocument)
 Set the workspace dom document. The domdocument hold all information about the workspace (e.g version, name, last used date, projects). More...
 

Properties

bool isDefault
 

Detailed Description

The AbstractWorkspace class defines a functional basic class for e.g. a file and sql workspace. A workspace can handle Traviz projects.

This class is part of the projectmanager feature.

Constructor & Destructor Documentation

◆ AbstractWorkspace()

AbstractWorkspace::AbstractWorkspace ( const QString &  typeString)
protected

AbstractWorkspace constructor with typeString definition (e,g. File, Sql).

Parameters
typeStringDefine the type of workspace.
See also
typeString
Here is the call graph for this function:

Member Function Documentation

◆ addProject()

bool AbstractWorkspace::addProject ( const QSharedPointer< AbstractProject > &  project)

Add a project into workspace.

Parameters
projectThe abstract project which should be inserted.
Returns
Returns true if the process was successfull, otherwise returns false.
See also
setProjects
projects
projectCount
deleteProject
removeProject
Here is the call graph for this function:

◆ className()

QString AbstractWorkspace::className ( ) const
Returns
Returns the metaObject className.

◆ clearLastError()

void AbstractWorkspace::clearLastError ( )
Returns
Clear the lastError string.
See also
lastError

◆ compare()

virtual bool AbstractWorkspace::compare ( const QSharedPointer< AbstractWorkspace > &  otherWorkspace) const
pure virtual

Compare a other Workspace source with this Workspace source (not the Object adress).

Parameters
otherWorkspaceThe Workspace to compare with.
Returns
Returns true if the other Workspace is equil (e.g. File-Workspace: same file), otherwise returns false.

Implemented in SqlWorkspace, and FileWorkspace.

◆ connectionString()

QString AbstractWorkspace::connectionString ( ) const

The Workspace connection string holds the source connection information (e.g File-Workspace -> filename, Sql-Workspace -> Server and user information). The connectionString is unique inside a running Traviz application and can be used to identifier a workspace.

Returns
Returns the workspace connection string.
See also
projectConnectionString
Here is the caller graph for this function:

◆ contains()

bool AbstractWorkspace::contains ( const QSharedPointer< AbstractProject > &  project) const
Parameters
projectThe abstract project.
Returns
Returns true if the workspace contains an occurrence of project;, otherwise returns false.
See also
projectCount
Here is the caller graph for this function:

◆ deleteProject()

virtual bool AbstractWorkspace::deleteProject ( const QSharedPointer< AbstractProject > &  project)
pure virtual

Delete a project and remove it from workspace.

Parameters
projectThe project which should be deleted.
Returns
Returns true if the process was successfull, otherwise returns false.
See also
removeProject
removeProjects
saveProjects

Implemented in SqlWorkspace, and FileWorkspace.

◆ deleteWorkspace()

virtual bool AbstractWorkspace::deleteWorkspace ( bool  deleteProjects = false)
pure virtual

Delete workspace. The function deletes this workspace and all included projects, if the deleteProjects flag is set true.

Parameters
deleteProjectsThe delete all projects flag (default = false).
Returns
Returns true if the process was successfull, otherwise returns false.
See also
deleteProject

Implemented in SqlWorkspace, and FileWorkspace.

◆ description()

QString AbstractWorkspace::description ( ) const
Returns
Returns the workspace description.
See also
setDescription
Here is the caller graph for this function:

◆ init()

virtual void AbstractWorkspace::init ( )
pure virtual

Initialize the Workspace and set isValid flag. This function must be called, otherwise the workspace can't be valid.

See also
update

Implemented in FileWorkspace, and SqlWorkspace.

◆ isDefault()

bool AbstractWorkspace::isDefault ( ) const
Returns
Returns true if the workspace is set as default workspace, otherwise returns false.
See also
setDefault
Here is the caller graph for this function:

◆ isOpen()

bool AbstractWorkspace::isOpen ( ) const
Returns
Returns true if the workspace is open (in use), otherwise it returns false.
See also
setOpen
Here is the caller graph for this function:

◆ isValid()

bool AbstractWorkspace::isValid ( ) const
Returns
Returns true if the workspace is valid, otherwise it returns false.
Here is the caller graph for this function:

◆ lastError()

const QString AbstractWorkspace::lastError ( ) const
Returns
Returns the last occured error as a string.

sa clearLastError

Here is the caller graph for this function:

◆ lastUsedDateTime()

QString AbstractWorkspace::lastUsedDateTime ( ) const
Returns
Returns the last used date time of the workspace as string.
See also
setLastUsedDateTime

◆ majorWorkspaceVersion()

int AbstractWorkspace::majorWorkspaceVersion ( ) const
Returns
Returns the workspace major version.
See also
version
setVersion
setMajorWorkspaceVersion
minorWorkspaceVersion
setMinorWorkspaceVersion
Here is the caller graph for this function:

◆ minorWorkspaceVersion()

int AbstractWorkspace::minorWorkspaceVersion ( ) const
Returns
Returns the workspace minor version.
See also
version
setVersion
majorWorkspaceVersion
setMajorWorkspaceVersion
setMinorWorkspaceVersion
Here is the caller graph for this function:

◆ name()

QString AbstractWorkspace::name ( ) const
Returns
Returns the workspace name.
See also
setName
Here is the caller graph for this function:

◆ project()

QSharedPointer< AbstractProject > AbstractWorkspace::project ( QString  connectionString) const
Returns
Returns the project based on his connectionString. Returns a Null QSharedPointer, if connectionString did not match.
See also
setProjects
projectCount
projects
connectionString
Here is the call graph for this function:
Here is the caller graph for this function:

◆ projectCount()

int AbstractWorkspace::projectCount ( ) const
Returns
Returns the number of projects in this workspace.
See also
projects
setProjects

◆ projectNames()

QStringList AbstractWorkspace::projectNames ( ) const
Returns
Returns a stringlist containing all project names, which are existent in workspace.
Here is the call graph for this function:

◆ projects()

QVector< QSharedPointer< AbstractProject > > AbstractWorkspace::projects ( ) const
Returns
Returns a vector of shared pointer to all available projects in this workspace.
See also
setProjects
projectCount
Here is the caller graph for this function:

◆ removeProject()

bool AbstractWorkspace::removeProject ( const QSharedPointer< AbstractProject > &  project)

Remove a project from workspace. The project will not be deleted.

Parameters
projectThe project which should be removed.
Returns
Returns true if the process was successfull, otherwise returns false.
See also
deleteProject
removeProjects
saveProjects
Here is the call graph for this function:

◆ removeProjects()

bool AbstractWorkspace::removeProjects ( )

Remove all projects from workspace. The projects will not be deleted.

Returns
Returns true if the process was successfull, otherwise returns false.
See also
removeProject
deleteProject
saveProjects
Here is the call graph for this function:

◆ resetExternChangedProjects()

void AbstractWorkspace::resetExternChangedProjects ( ) const

Reset all projects in workspace which are changed by extern.

See also
resetProjects
saveExternChangedProjects
saveProjects
Here is the call graph for this function:

◆ save()

virtual bool AbstractWorkspace::save ( )
pure virtual

Save workspace with all settings.

Returns
Returns true if the Workspace was successfully saved, otherwise returns false.

Implemented in SqlWorkspace, and FileWorkspace.

Here is the caller graph for this function:

◆ saveExternChangedProjects()

bool AbstractWorkspace::saveExternChangedProjects ( ) const

Save all projects in workspace which are changed by extern.

Returns
Returns true if the process was successfull, otherwise returns false.
See also
saveProjects
resetExternChangedProjects
resetProjects
Here is the call graph for this function:

◆ saveProjects()

bool AbstractWorkspace::saveProjects ( ) const

Save all projects in workspace.

Returns
Returns true if the process was successfull, otherwise returns false.
See also
removeProject
removeProjects
deleteProject
Here is the call graph for this function:

◆ setConnectionString()

void AbstractWorkspace::setConnectionString ( const QString &  connectionString)

Set the Workspace connection string. The connectionString is unique source identifier inside a running Traviz application.

Parameters
connectionStringThe connection string.
See also
connectionString
Here is the call graph for this function:

◆ setDefault()

void AbstractWorkspace::setDefault ( bool  isDefault)

Set workspace as default workspace. On Traviz start this workspace will be loaded directly. No workspace manager will be shown.

Parameters
isDefaultThe enable bool flag.
See also
isDefault
Here is the call graph for this function:

◆ setDescription()

void AbstractWorkspace::setDescription ( const QString &  description)

Set the workspace description.

Parameters
descriptionThe workspace description.
See also
description
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLastError()

void AbstractWorkspace::setLastError ( const QString &  lastError)
protected

Set the last occured workspace error string.

Parameters
lastErrorThe error string.
See also
lastError
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLastUsedDateTime()

void AbstractWorkspace::setLastUsedDateTime ( const QString &  lastUsedDateTime)

Set the workspace last used date value ("MM/dd/yyyy hh:mm:ss")

Parameters
lastUsedDateTimeThe last used date time of the workspace.
See also
lastUsedDateTime

◆ setMajorWorkspaceVersion()

void AbstractWorkspace::setMajorWorkspaceVersion ( int  majorWorkspaceVersion)

Set the workspace major version. If the version is not compatible with the application condition the workspace could not be loaded.

Parameters
versionThe version value string.
See also
version
setVersion
majorWorkspaceVersion
minorWorkspaceVersion
setMinorWorkspaceVersion
Here is the call graph for this function:

◆ setMinorWorkspaceVersion()

void AbstractWorkspace::setMinorWorkspaceVersion ( int  minorWorkspaceVersion)

Set the workspace minor version. If the version is not compatible with the application condition the workspace could not be loaded.

Parameters
versionThe version value string.
See also
version
setVersion
majorWorkspaceVersion
setMajorWorkspaceVersion
minorWorkspaceVersion
Here is the call graph for this function:

◆ setName()

void AbstractWorkspace::setName ( const QString &  name)

Set the workspace name.

Parameters
nameThe name for the workspace.
See also
name
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOpen()

void AbstractWorkspace::setOpen ( bool  isOpen)
virtual

Set the workspace open (in use) state.

Parameters
isOpenThe open flag.
See also
isOpen

Reimplemented in FileWorkspace.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setProjects()

void AbstractWorkspace::setProjects ( const QVector< QSharedPointer< AbstractProject >> &  projects)

Set the vector of projects for a workspace.

Parameters
projectsThe vector of shared pointer to projects.
See also
projects
projectCount
Here is the call graph for this function:

◆ settingsScope()

SettingsScope * AbstractWorkspace::settingsScope ( )
Returns
Returns the workspace settings scope.

◆ setValid()

void AbstractWorkspace::setValid ( bool  isValid)
protected

Set the workspace valid. This property decides if a workspace is loadable or not.

Parameters
isValidThe valid flag.
See also
isValid
Here is the call graph for this function:

◆ setVersion()

void AbstractWorkspace::setVersion ( const QString &  version)

Set the workspace version. If the version is not compatible with the application condition the workspace could not be loaded.

Parameters
versionThe version value string.
See also
version
majorWorkspaceVersion
setMajorWorkspaceVersion
minorWorkspaceVersion
setMinorWorkspaceVersion
Here is the call graph for this function:

◆ setWorkspaceDomDocument()

void AbstractWorkspace::setWorkspaceDomDocument ( const QDomDocument &  workspaceDomDocument)
protected

Set the workspace dom document. The domdocument hold all information about the workspace (e.g version, name, last used date, projects).

Parameters
workspaceDomDocumentThe domdocument.
See also
workspaceDomDocument
validateWorkspaceDomDocument
Here is the call graph for this function:

◆ setWorkspaceProperties()

bool AbstractWorkspace::setWorkspaceProperties ( const QDomDocument &  domDocument)
protected

Set the workspace properties. The properties will be read from domDocument.

Parameters
domDocumentHold the workspace properties.
fallbackNameIf no workspace name is set, the workspace fallback name will be used.
Returns
Returns true if the workspace properties are set and workspace is valid, otherwise it returns false.
Here is the call graph for this function:

◆ test()

virtual bool AbstractWorkspace::test ( )
pure virtual

Workspace test procedure. The Test-Procedure is defined by the specific workspace class, which inherits from AbstractWorkspace class.

Returns
Returns true if the process was successfull, otherwise returns false.

Implemented in SqlWorkspace, and FileWorkspace.

◆ typeString()

QString AbstractWorkspace::typeString ( ) const
Returns
Returns the type string of a workspace (e,g. File, Sql).
Here is the caller graph for this function:

◆ update()

virtual void AbstractWorkspace::update ( )
pure virtual

Update the workspace after property changes.

See also
init

Implemented in FileWorkspace, and SqlWorkspace.

◆ validateWorkspaceDomDocument()

bool AbstractWorkspace::validateWorkspaceDomDocument ( const QDomDocument &  domDocument)

Validate a workspace DomDocument.

Parameters
domDocumentThe Workspace DomDocument.
Returns
Returns true if the DomDocument is valid, otherwise returns false.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ version()

QString AbstractWorkspace::version ( ) const
Returns
Returns the workspace version.
See also
setVersion
majorWorkspaceVersion
setMajorWorkspaceVersion
minorWorkspaceVersion
setMinorWorkspaceVersion
Here is the caller graph for this function:

◆ workspaceDomDocument()

QDomDocument AbstractWorkspace::workspaceDomDocument ( ) const
Returns
Returns the workspace dom document.
See also
validateWorkspaceDomDocument
workspaceDomDocumentTemplate
Here is the caller graph for this function:

◆ workspaceDomDocumentTemplate()

QDomDocument AbstractWorkspace::workspaceDomDocumentTemplate ( const QString &  name,
const QString &  version,
const QString &  description 
)
static

This static function creates a clean workspace DomDocument.

Parameters
nameThe Workspace name.
versionThe Workspace version.
descriptionThe Workspace description.
Returns
Returns a clean workspace DomDocument.
Here is the call graph for this function:

The documentation for this class was generated from the following files: