Midgard2 Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#include <midgard/midgard.h> MidgardWorkspaceManager; struct MidgardWorkspaceManagerClass; MidgardWorkspaceManager * midgard_workspace_manager_new (MidgardConnection *mgd
); gboolean midgard_workspace_manager_get_workspace_by_path (const MidgardWorkspaceManager *self
,MidgardWorkspaceStorage *ws
,const gchar *path
,GError **error
); gboolean midgard_workspace_manager_create_workspace (const MidgardWorkspaceManager *self
,MidgardWorkspaceStorage *ws
,const gchar *path
,GError **error
); gboolean midgard_workspace_manager_update_workspace (const MidgardWorkspaceManager *self
,MidgardWorkspaceStorage *ws
,GError **error
); gboolean midgard_workspace_manager_path_exists (const MidgardWorkspaceManager *self
,const gchar *path
); gboolean midgard_workspace_manager_purge_workspace (const MidgardWorkspaceManager *self
,MidgardWorkspaceStorage *ws
,GError **error
); gboolean midgard_workspace_manager_purge_content (const MidgardWorkspaceManager *self
,const gchar *type
,MidgardWorkspace *ws
,GError **error
); gboolean midgard_workspace_manager_move_content (const MidgardWorkspaceManager *self
,const gchar *type
,MidgardWorkspace *src
,MidgardWorkspace *dest
,GError **error
);
MidgardWorkspaceManager * midgard_workspace_manager_new (MidgardConnection *mgd
);
|
MidgardConnection instance |
Returns : |
new MidgardWorkspaceManager object |
Since 10.05.5
gboolean midgard_workspace_manager_get_workspace_by_path (const MidgardWorkspaceManager *self
,MidgardWorkspaceStorage *ws
,const gchar *path
,GError **error
);
Get given workspace by given path.
Cases to return FALSE
:
Invalid path given ( MIDGARD_WORKSPACE_STORAGE_ERROR_INVALID_PATH )
Given workspace object doesn't exist in storage ( MIDGARD_WORKSPACE_STORAGE_ERROR_OBJECT_NOT_EXISTS )
|
MidgardWorkspaceManager instance |
|
MidgardWorkspaceStorage instance |
|
workspace path |
|
pointer to store error. [error-domains MIDGARD_WORKSPACE_STORAGE_ERROR] |
Returns : |
TRUE on success, FALSE otherwise |
Since 10.05.5
gboolean midgard_workspace_manager_create_workspace (const MidgardWorkspaceManager *self
,MidgardWorkspaceStorage *ws
,const gchar *path
,GError **error
);
Create given MidgardWorkspaceStorage instance in underlying storage. If given MidgardWorkspaceStorage is MidgardWorkspaceContext, then it's created at given path and context's path is set. If it's MidgardWorkspace, it's created at given path with its name, which also creates new context. (e.g. if the path is '/Organization/Branch' and workspace name is 'Private', then its accessible with '/Organization/Branch/Private' path.)
Cases to return FALSE
:
Invalid path given ( MIDGARD_WORKSPACE_STORAGE_ERROR_INVALID_PATH )
Workspace at path already exists ( MIDGARD_WORKSPACE_STORAGE_ERROR_NAME_EXISTS )
Workspace at path already exists ( MIDGARD_WORKSPACE_STORAGE_ERROR_PATH_EXISTS )
|
MidgardWorkspaceManager instance |
|
MidgardWorkspaceStorage instance to create |
|
path at which workspace object should be created |
|
pointer to store error. [error-domains MIDGARD_WORKSPACE_STORAGE_ERROR] |
Returns : |
TRUE on success, FALSE otherwise |
Since 10.05.5
gboolean midgard_workspace_manager_update_workspace (const MidgardWorkspaceManager *self
,MidgardWorkspaceStorage *ws
,GError **error
);
Update MidgardWorkspaceStorage instance in underlying storage.
A valid path should be set for given ws
workspace object, and ws
should be fetched from database.
Cases to return FALSE
:
Invalid path given ( MIDGARD_WORKSPACE_STORAGE_ERROR_INVALID_PATH )
Workspace at path already exists ( MIDGARD_WORKSPACE_STORAGE_ERROR_PATH_EXISTS )
Given workspace object doesn't exist in storage ( MIDGARD_WORKSPACE_STORAGE_ERROR_OBJECT_NOT_EXISTS )
|
MidgardWorkspaceManager instance |
|
MidgardWorkspaceStorage instance |
|
pointer to store error. [error-domains MIDGARD_WORKSPACE_STORAGE_ERROR] |
Returns : |
TRUE on success, FALSE otherwise |
Since 10.05.5
gboolean midgard_workspace_manager_path_exists (const MidgardWorkspaceManager *self
,const gchar *path
);
Check if given path
exists.
|
MidgardWorkspaceManager instance |
|
A path to check |
Returns : |
TRUE on success, FALSE otherwise |
Since 10.05.5
gboolean midgard_workspace_manager_purge_workspace (const MidgardWorkspaceManager *self
,MidgardWorkspaceStorage *ws
,GError **error
);
Purge MidgardWorkspaceStorage instance from underlying storage.
Given ws
workspace object should be fetched from database.
Cases to return FALSE
:
Given workspace object doesn't exist in storage ( MIDGARD_WORKSPACE_STORAGE_ERROR_OBJECT_NOT_EXISTS )
|
MidgardWorkspaceManager instance |
|
MidgardWorkspaceStorage instance |
|
pointer to store error. [error-domains MIDGARD_WORKSPACE_STORAGE_ERROR] |
Returns : |
TRUE on success, FALSE otherwise |
Since 10.05.5
gboolean midgard_workspace_manager_purge_content (const MidgardWorkspaceManager *self
,const gchar *type
,MidgardWorkspace *ws
,GError **error
);
From given ws
workspace, removes entire content of given type
name.
There's no undelete available for this operation.
|
MidgardWorkspaceManager instance |
|
the type name |
|
MidgardWorkspace instance |
|
pointer to store returned error |
Returns : |
TRUE on success, FALSE otherwise |
Since 10.05.5
gboolean midgard_workspace_manager_move_content (const MidgardWorkspaceManager *self
,const gchar *type
,MidgardWorkspace *src
,MidgardWorkspace *dest
,GError **error
);
Moves the content of given type name from src
, source MidgardWorkspace to
dest
, destination one.
|
MidgardWorkspaceManager instance |
|
the type name |
|
source MidgardWorkspace |
|
destination MidgardWorkspace |
|
pointer to store returned error |
Returns : |
TRUE on success, FALSE otherwise |
Since 10.05.5
"connection"
property"connection" MidgardConnection* : Write / Construct Only
Pointer to a connection, manager
has been initialized for