MidgardWorkspaceManager

MidgardWorkspaceManager

Synopsis

#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_move_content
                                                        (const MidgardWorkspaceManager *self,
                                                         const gchar *type,
                                                         MidgardWorkspace *src,
                                                         MidgardWorkspace *dest,
                                                         GError **error);

Object Hierarchy

  GObject
   +----MidgardWorkspaceManager

Properties

  "connection"               MidgardConnection*    : Write / Construct Only

Description

Details

MidgardWorkspaceManager

typedef struct _MidgardWorkspaceManager MidgardWorkspaceManager;


struct MidgardWorkspaceManagerClass

struct MidgardWorkspaceManagerClass {
	GObjectClass parent;
};


midgard_workspace_manager_new ()

MidgardWorkspaceManager * midgard_workspace_manager_new (MidgardConnection *mgd);

mgd :

MidgardConnection instance

Returns :

new MidgardWorkspaceManager object

Since 10.05.5


midgard_workspace_manager_get_workspace_by_path ()

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 )

self :

MidgardWorkspaceManager instance

ws :

MidgardWorkspaceStorage instance

path :

workspace path

error :

pointer to store error. [error-domains MIDGARD_WORKSPACE_STORAGE_ERROR]

Returns :

TRUE on success, FALSE otherwise

Since 10.05.5


midgard_workspace_manager_create_workspace ()

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 )

self :

MidgardWorkspaceManager instance

ws :

MidgardWorkspaceStorage instance to create

path :

path at which workspace object should be created

error :

pointer to store error. [error-domains MIDGARD_WORKSPACE_STORAGE_ERROR]

Returns :

TRUE on success, FALSE otherwise

Since 10.05.5


midgard_workspace_manager_update_workspace ()

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 )

self :

MidgardWorkspaceManager instance

ws :

MidgardWorkspaceStorage instance

error :

pointer to store error. [error-domains MIDGARD_WORKSPACE_STORAGE_ERROR]

Returns :

TRUE on success, FALSE otherwise

Since 10.05.5


midgard_workspace_manager_path_exists ()

gboolean            midgard_workspace_manager_path_exists
                                                        (const MidgardWorkspaceManager *self,
                                                         const gchar *path);

Check if given path exists.

self :

MidgardWorkspaceManager instance

path :

A path to check

Returns :

TRUE on success, FALSE otherwise

Since 10.05.5


midgard_workspace_manager_purge_workspace ()

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 )

self :

MidgardWorkspaceManager instance

ws :

MidgardWorkspaceStorage instance

error :

pointer to store error. [error-domains MIDGARD_WORKSPACE_STORAGE_ERROR]

Returns :

TRUE on success, FALSE otherwise

Since 10.05.5


midgard_workspace_manager_move_content ()

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.

self :

MidgardWorkspaceManager instance

type :

the type name

src :

source MidgardWorkspace

dest :

destination MidgardWorkspace

Returns :

TRUE on success, FALSE otherwise

Since 10.05.5

Property Details

The "connection" property

  "connection"               MidgardConnection*    : Write / Construct Only

Pointer to a connection, WorkspaceManager has been initialized for.