Default encoding is UTF-8. Set NULL @encoding if such is required. Instatiate new Midgard Blob object for the given midgard_attachment object. This is almost the same constructor as g_object_new, but unlike that one, midgard_blob_new requires MidgardObject (midgard_attachment) object's pointer. This constructor defines new relative path for attachment, if midgard_attachment is associated with midgard_blob and its location is empty. In any other case, location is not changed. newly instatiated #MidgardBlob object or %NULL on failure #MidgardObject of MIDGARD_TYPE_ATTACHMENT type. file encoding Returned content should be freed when no longer needed. This function should be used to get content of small files. For large and huge ones midgard_blob_get_handler should be used to get file handle. content of the file, or %NULL on failure number of bytes read Write given @content to a file. %TRUE if content has been written to file, %FALSE otherwise. content which should be written to file. Deletes a file which is associated with blob and located at attachment's location which is initialized for blob. #midgard_blob_exists should be invoked if file may be already deleted, for example when one file is shared among many attachments. %TRUE on success, %FALSE otherwise Check if file associated with midgard_blob exists. This function will also return FALSE, if file is not yet associated. %TRUE if file exists, %FALSE otherwise The main idea is to get file handler. On C level it returns GIOChannel, but language bindings could return typical file handler or anything else which is needed for particular language. Returned channel is owned by midgard_blob and should not be freed or unreferenced. GIOChannel or %NULL fopen mode (r, w, a, b). Default is 'w'. Returned content should be freed when no longer needed. This function should be used to get content of small files. For large and huge ones midgard_blob_get_handler should be used to get file handle. content of the file, or %NULL on failure number of bytes read Write given @content to a file. %TRUE if content has been written to file, %FALSE otherwise. content which should be written to file. The main idea is to get file handler. On C level it returns GIOChannel, but language bindings could return typical file handler or anything else which is needed for particular language. Returned channel is owned by midgard_blob and should not be freed or unreferenced. GIOChannel or %NULL fopen mode (r, w, a, b). Default is 'w'. Check if file associated with midgard_blob exists. This function will also return FALSE, if file is not yet associated. %TRUE if file exists, %FALSE otherwise Deletes a file which is associated with blob and located at attachment's location which is initialized for blob. #midgard_blob_exists should be invoked if file may be already deleted, for example when one file is shared among many attachments. %TRUE on success, %FALSE otherwise content of the file, or %NULL on failure number of bytes read %TRUE if content has been written to file, %FALSE otherwise. content which should be written to file. %TRUE on success, %FALSE otherwise %TRUE if file exists, %FALSE otherwise GIOChannel or %NULL fopen mode (r, w, a, b). Default is 'w'. unique per object or record. In other words, @domain is a common property (and value) for group of objects expected in collection. If you need reuse given value, make a copy. Cases to return NULL: <itemizedlist> <listitem><para> </para></listitem> <listitem><para> </para></listitem> <listitem><para> </para></listitem> <listitem><para> </para></listitem> </itemizedlist> #MidgardCollector instance, or %NULL on failure #MidgardConnection instance name of given class, which collector is initialized for collection' domain domain's constraint value Cases to return FALSE: <itemizedlist> <listitem><para> </para></listitem> <listitem><para> </para></listitem> </itemizedlist> Number of value properties added to Midgard Collector is limited by the number of properties registered for type which has been initialized for the given #MidgardCollector instance. %TRUE if named value property has been added, %FALSE otherwise property name Cases to return FALSE: <itemizedlist> <listitem><para> </para></listitem> <listitem><para> </para></listitem> <listitem><para> </para></listitem> </itemizedlist> If the key is already added to MidgardCollector then its value (as subkey&value pair) is destroyed and new one is set. In other case new key and its subkey&value pair is added to collector. Key used in this function is a value returned ( or set ) for collector's key. Keys are collection of values returned from property fields. Subkey is an explicit property name. GValue @value argument is owned by MidgardCollector. If value should be reused, its copy should be passed as method argument. %TRUE, if key's value has been set, %FALSE otherwise key name for which @subkey&@value pair should be set property name which is a subkey value for given @subkey GData keys ( collector's subkeys ) are inserted to GData as Quarks , so you must call g_quark_to_string if you need to get strings ( e.g. implementing hash table for language bindings ). #GData for the given key or %NULL if key is not found in collection name of the key to look for subkey's #GValue value or %NULL if not found name of the key name of key's subkey to look for If third overwrite parameter is set as TRUE then all keys which exists in @self and @mc collector's instance will be oberwritten in @self colection instance. If set as FALSE , only those keys will be added, which do not exist in @self collection and exist in @mc collection. Cases to return FALSE: <itemizedlist> <listitem><para> Second argument is not valid #MidgardCollector </para></listitem> <listitem><para> </para></listitem> </itemizedlist> %TRUE if collections has been merged, %FALSE otherwise #MidgardCollector instance whether overwrite collector's keys Removes key and associated value from the given #MidgardCollector instance. %TRUE if key (and its value) has been removed from collection, %FALSE otherwise name of the key in collector's collection Executes SQL query and set internal keys&values collection. Overwritten #MidgardQueryBuilder execute method. Unlike QB's execute method this one returns boolean value. Resultset is stored inernally by #MidgardCollector instance. Cases to return FALSE: <itemizedlist> <listitem><para> No key is associated, midgard_collector_set_key_property() </para></listitem> <listitem><para> No value property is associated, midgard_collector_add_value_property() </para></listitem> <listitem><para> Database provider returned SQL query syntax error </para></listitem> <listitem><para> No record(s) matched </para></listitem> </itemizedlist> %TRUE in success, %FALSE otherwise Cases to return FALSE: <itemizedlist> <listitem><para> </para></listitem> <listitem><para> </para></listitem> </itemizedlist> Number of value properties added to Midgard Collector is limited by the number of properties registered for type which has been initialized for the given #MidgardCollector instance. %TRUE if named value property has been added, %FALSE otherwise property name Cases to return FALSE: <itemizedlist> <listitem><para> </para></listitem> <listitem><para> </para></listitem> <listitem><para> </para></listitem> </itemizedlist> If the key is already added to MidgardCollector then its value (as subkey&value pair) is destroyed and new one is set. In other case new key and its subkey&value pair is added to collector. Key used in this function is a value returned ( or set ) for collector's key. Keys are collection of values returned from property fields. Subkey is an explicit property name. GValue @value argument is owned by MidgardCollector. If value should be reused, its copy should be passed as method argument. %TRUE, if key's value has been set, %FALSE otherwise key name for which @subkey&@value pair should be set property name which is a subkey value for given @subkey GData keys ( collector's subkeys ) are inserted to GData as Quarks , so you must call g_quark_to_string if you need to get strings ( e.g. implementing hash table for language bindings ). #GData for the given key or %NULL if key is not found in collection name of the key to look for subkey's #GValue value or %NULL if not found name of the key name of key's subkey to look for If third overwrite parameter is set as TRUE then all keys which exists in @self and @mc collector's instance will be oberwritten in @self colection instance. If set as FALSE , only those keys will be added, which do not exist in @self collection and exist in @mc collection. Cases to return FALSE: <itemizedlist> <listitem><para> Second argument is not valid #MidgardCollector </para></listitem> <listitem><para> </para></listitem> </itemizedlist> %TRUE if collections has been merged, %FALSE otherwise #MidgardCollector instance whether overwrite collector's keys Removes key and associated value from the given #MidgardCollector instance. %TRUE if key (and its value) has been removed from collection, %FALSE otherwise name of the key in collector's collection Executes SQL query and set internal keys&values collection. Overwritten #MidgardQueryBuilder execute method. Unlike QB's execute method this one returns boolean value. Resultset is stored inernally by #MidgardCollector instance. Cases to return FALSE: <itemizedlist> <listitem><para> No key is associated, midgard_collector_set_key_property() </para></listitem> <listitem><para> No value property is associated, midgard_collector_add_value_property() </para></listitem> <listitem><para> Database provider returned SQL query syntax error </para></listitem> <listitem><para> No record(s) matched </para></listitem> </itemizedlist> %TRUE in success, %FALSE otherwise %TRUE if named value property has been added, %FALSE otherwise property name %TRUE, if key's value has been set, %FALSE otherwise key name for which @subkey&@value pair should be set property name which is a subkey value for given @subkey #GData for the given key or %NULL if key is not found in collection name of the key to look for subkey's #GValue value or %NULL if not found name of the key name of key's subkey to look for %TRUE if collections has been merged, %FALSE otherwise #MidgardCollector instance whether overwrite collector's keys %TRUE if key (and its value) has been removed from collection, %FALSE otherwise name of the key in collector's collection %TRUE in success, %FALSE otherwise Initializes new instance of MidgardConfig object type. NULL is returned when object can not be initialized. pointer to @MidgardConfig object or %NULL on failure. List all available configuration files. If @user value is set to %TRUE, all available files from ~/.midgard/conf.d will be listed. Only system files ( usually from /etc/midgard/conf.d ) will be listed if @user value is set to %FALSE. Returned array should be freed when no longer needed. newly allocated and %NULL terminated array of file names. boolean switch for system or user's config files This method reads configuration file from the given name and sets MidgardConfig object's properties. Such initialized MidgardConfig instance may be reused among midgard-core and midgard-php extension for example, without any need to re-read configuration file and without any need to re-initalize #MidgardConfig object instance. Set %TRUE as @user boolean value to read files from user's home directory. %TRUE when file has been read , %FALSE otherwise. name of the file to read boolean switch for system or user's config files %TRUE if file has been read, %FALSE otherwise a path to read file from %TRUE if data has been read, %FALSE otherwise a NULL-terminated buffer containing the configuration Saves configuration file for the given #MidgardConfig. This method saves configuration file with the given name. If third user parameter is set to %TRUE, then configuration file will be saved in ~/.midgard2/conf.d directory. User's conf.d directory will be created if doesn't exist. directory doesn't exist or file can not be saved. %TRUE on success or %FALSE ( with propper warning message ) if system wide configuration filename system or home directory switch Creates directories for blobs %TRUE on success, %FALSE otherwise. deep copy of given #MidgardConfig object Initializes new instance of MidgardConnection object type. MidgardConnectionClass has no properties registered as class members. Every internal data of MidgardConnection object is accessible with API functions, and is not settable or gettable as property's value. Particular methods should be implemented for language bindings. #MidgardConnection objects holds runtime ( or request ) non persistent data like authentication type, debug level, etc. Persistent data like database name, blobs directory are associated with #MidgardConfig object. pointer to #MidgardConnection object or %NULL on failure. Every key is configuration name, and value is #MidgardConnection object. Use g_hash_table_destroy to free hashtable and all opened connections. Newly allocated full #GHashTable. switch to read configuration from system or user's directory Opens a connection to the database, which is defined in named configuration. The configuration file is read from the system configuration directory directory is taken into account if library is compiled with `/usr' prefix, `/usr/local/etc` if compiled with `/usr/local` prefix, etc. Consider using midgard_connection_open_config(), if you need to open connection to database which is configured in user's home directory. If the named database configuration can not be read or the connection fails, then %FALSE is returned and an error message is written to the global midgard error state. It also initializes #MidgardSchema object (which is encapsulated by implementation ) and register all MgdSchema, #MidgardObjectClass derived classes defined by user. This happens only when basic Midgard classes are not registered in GType system. This is recommended way to initialize MgdSchema types. %TRUE if the operation succeeded, %FALSE otherwise. configuration file name Opens a #MidgardConnection with the given configuration. Take a look at midgard_connection_open() wrt #MidgardSchema. If #MidgardConnection is already associated with given config, method returns %TRUE. If associated with another one, %FALSE is returned and MGD_ERR_INTERNAL error is set. %TRUE on success, %FALSE otherwise #MidgardConfig object Opens a connection to the database. The configuration file is read from given filepath. Take a look at midgard_connection_open() wrt #MidgardSchema. %TRUE if the operation succeeded, %FALSE otherwise. configuration file path %TRUE if database connection is established, %FALSE otherwise Sets log level of the given MidgardConnection. Overwrites internal #MidgardConnection's log level defined in configuration file. By default MidgardConnection holds loglevel which is associated with ( and duplicated from ) #MidgardConfig. #MidgardConfig object's log level isn't changed by this function This method is a shortcut which sets correctly loghandler,loglevel is defined. Core's default function is #midgard_error_default_log. warn is default loglevel, SQL queries are logged with debug level. With info level, function names ( and classes' names ) are ( at least should be) logged in language bindings %TRUE if debug level is set, %FALSE otherwise Loglevel string log handler function unsigned integer flag specified by GLogLevelFlags. Sets internal loghandler id associated with G_LOG_DOMAIN and loglevel. Caller is responsible to remove loghandler using g_log_remove_handler when new loglevel for G_LOG_DOMAIN is set. loghandler id MidgardConnection's loglevel currently set. unsigned integer value which is associated with G_LOG_DOMAIN and Error id may be one of set by #midgard_error. Last error id set Valid #errcode is one defined in #MgdErrorGeneric. error code Error string may be one set by #midgard_error. last error string NULL is explicitly returned if there's no midgard_user logged in for the given MidgardConnection. See also #MidgardUser methods if you need midgard_person associated with user. A pointer to MidgardUser instance or %NULL This function duplicates given #MidgardConnection. It doesn't make deep copy. All persistant data are kept unchanged, but runtime related members are reset to default state. This function is helpful if application is forking and new processes might have different environment variables. Call g_object_unref if returned object is no longer needed. Newly allocated and duplicated #MidgardConnection This is MySQL optimized workaround for lost connection event. %TRUE on success, %FALSE otherwise List available and registered authentication types. Use g_free() to free returned array. NULL terminated array with authentication types. a pointer to store number of returned types Enable or disable quota table usage. If enabled, every base operation (create, update, delete) will be recorded in quota table, limiting particular types usage. quota enable, disable toggle Enable or disable repligard table usage. If enabled, every base operation (create, update, delete) will be recorded in repligard table. replication enable, disable toggle Enable or disable dbus messages send for basic operation dbus enable, disable toggle %TRUE, if quota is enabled, %FALSE otherwise %TRUE, if replication is enabled, %FALSE otherwise %TRUE, if dbus is enabled, %FALSE otherwise Creates new midgard_metadata instance for the given #MidgardObject instance. Do not use g_object_new() as metadata constructor. #MidgardObject pointer is internally assigned as a pointer to midgard object for which particular metadata object instance was created. #MidgardMetadata object has two "kinds" of properties. The first one is settable ( and overwritten ) only by metadata implementation. The second one is freely settable by application. In this case midgard core keep value of such property "as is". Do not free #MidgardMetadata object's memory as it is automatically freed when particular #MidgardObject object's instance memory is freed. newly allocated midgard_metadata instance #MidgardObject for which metadata is created Creates new MidgardObject object instance. This function is mandatory one for new midgard object initialization. Unlike g_object_new ( which is typical function to create new GObject instance ), midgard_object_new initializes data which are accessible internally by object instance itself or by object's class: - midgard connection handler is associated with object Sitegroup value is returned from midgard connection handler and may be overwritten only by SG0 Midgard Administrator only when object is created. Setting this property is forbidden when object is already fetched from database. Object's contructor tries to determine third optional parameter value. If it's of #G_TYPE_STRING type , then midgard_is_guid() is called to check weather passed string is a guid , in any other case id property is used with #G_TYPE_UINT type. New "empty" instance is created (without fetching data from database) if @value parameter is explicitly set to NULL. Any object instance created with this function should be freed using typical #g_object_unref function. Cases to return %NULL: <itemizedlist> <listitem><para> </para></listitem> <listitem><para> </para></listitem> <listitem><para> unspecified internal error ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> New #MidgardObject object or %NULL on failure #MidgardConnection handler name of the class optional value which holds id or guid of an object Fetch object's record(s) from database using 'id' property. This is common practice to use 'id' property with integer type when table's id column stores unique, primary key value which identifies object and its record(s). However primary property with integer type is freely defined by user. MidgardObject object instance must be created with midgard_object_new function. When midgard connection handler is not associated with object instance, application is terminated with 'assertion fails' error message being logged. Object instance created with this function should be freed using #g_object_unref. Cases to return %FALSE: <itemizedlist> <listitem><para> There's no 'id' primary property registered for object's class ( MGD_ERR_INTERNAL ) </para></listitem> <listitem><para> Object's record can not be fetched from database ( MGD_ERR_NOT_EXISTS ) </para></listitem> <listitem><para> unspecified internal error ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> %TRUE if object is successfully fetched from database, %FALSE otherwise. object's integer identifier Fetch object's record(s) from database using 'guid' property constraint. MidgardObject object instance must be created with midgard_object_new function. When midgard connection handler is not associated with object instance, application is terminated with 'assertion fails' error message being logged. Object instance created with this function should be freed using g_object_unref. Cases to return %FALSE: <itemizedlist> <listitem><para> Object's record can not be fetched from database ( MGD_ERR_NOT_EXISTS ) </para></listitem> <listitem><para> unspecified internal error ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> %TRUE if object is successfully fetched from database, %FALSE otherwise. string value which should identify object Update object's record(s). Internally such metadata properties are set (overwritten): <itemizedlist> <listitem><para> revisor </para></listitem> <listitem><para> revision ( increased by one ) </para></listitem> <listitem><para> revised </para></listitem> </itemizedlist> Cases to return %FALSE: <itemizedlist> <listitem><para> Property registered with #MGD_TYPE_GUID doesn't hold valid guid ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> Object's class is registered with tree facilities and there is already such object in midgard tree ( MGD_ERR_DUPLICATE ) </para></listitem> <listitem><para> Quota is activated and its limit is reached ( MGD_ERR_QUOTA ) </para></listitem> <listitem><para> Unspecified internal error ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> %TRUE if object's record(s) is successfully updated, %FALSE otherwise. Creates new database record(s) for object. Internally such properties are set (overwritten): <itemizedlist> <listitem><para> guid (if not set by root) </para></listitem> <listitem><para> id (if set as primary property) </para></listitem> </itemizedlist> Metadata overwritten properties: <itemizedlist> <listitem><para> creator </para></listitem> <listitem><para> created </para></listitem> <listitem><para> revisor </para></listitem> <listitem><para> revised </para></listitem> <listitem><para> revision </para></listitem> <listitem><para> published ( set only, if not defined by user ) </para></listitem> </itemizedlist> Cases to return %FALSE: <itemizedlist> <listitem><para> Property registered with #MGD_TYPE_GUID doesn't hold valid guid ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> Object's class is registered with tree facilities and there is already object with the same name in midgard tree. ( MGD_ERR_DUPLICATE ) </para></listitem> <listitem><para> Object has guid property set already. ( MGD_ERR_DUPLICATE ) </para></listitem> <listitem><para> Quota is activated and its limit is reached ( MGD_ERR_QUOTA ) </para></listitem> <listitem><para> Unspecified internal error ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise Delete object's record(s) from database, but object's record is not fully deleted from database. Instead, it is marked as deleted , thus it is possible to undelete object later with midgard_schema_object_factory_object_undelete(). If @check_dependents toggle is %TRUE, parameters and attachments storage will be queried, if any of such exist and depend on deleted object. If given object's class has no metadata defined, object will be purged. Use midgard_object_purge() if you need to purge object's data from database. Cases to return %FALSE: <itemizedlist> <listitem><para> Object's has no storage defined ( MGD_ERR_OBJECT_NO_STORAGE ) </para></listitem> <listitem><para> Object's property guid is empty ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> There are still dependent objects in database ( MGD_ERR_HAS_DEPENDENTS ) </para></listitem> <listitem><para> Unspecified internal error ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> %TRUE if object is successfully marked as deleted, %FALSE otherwise. dependents' check toggle Purge object's record(s) from database. If @check_dependents toggle is %TRUE, parameters and attachments storage will be queried, if any of such exist and depend on deleted object. Object's record(s) are purged from database without any possibility to recover. After successfull call, only repligard table holds information about object's state. Use midgard_object_delete(), if undelete facility is needed. Cases to return %FALSE: <itemizedlist> <listitem><para> Object has no storage defined ( MGD_ERR_OBJECT_NO_STORAGE ) </para></listitem> <listitem><para> Object's property guid value is empty ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> There are still dependent objects in database ( MGD_ERR_HAS_DEPENDANTS ) </para></listitem> <listitem><para> No record has been deleted from database ( MGD_ERR_NOT_EXISTS ) </para></listitem> <listitem><para> Unspecified internal error ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> %TRUE if object has been succesfully purged from database, %FALSE otherwise. dependents' check toggle Checks whether object has dependent objects. Check is done with such particular order: <itemizedlist> <listitem><para> Objects of the same type </para></listitem> <listitem><para> Children objects </para></listitem> <listitem><para> Parameters </para></listitem> <listitem><para> Attachments </para></listitem> </itemizedlist> Sets object's guid Cases to return %FALSE: <itemizedlist> <listitem><para> given guid already exists in database ( MGD_ERR_DUPLICATE ) </para></listitem> <listitem><para> given guid is invalid ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> object has already set guid property ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise guid to set Returned #MidgardConnection is owned by core, and should not be freed. pointer to #MidgardConnection associated with given object. Approve object. Approval functionality is not used by midgard core itself. Instead, it supports higher level's applications. It means, that there are no core methods ( like update or delete ) which do real check if object is approved. You should create own approval midgard_object_unapprove() and this one. revisor, revised, revision, approver and approved. Cases to return %FALSE: <itemizedlist> <listitem><para> No user logged in ( MGD_ERR_ACCESS_DENIED ) </para></listitem> <listitem><para> No active person ( MGD_ERR_INTERNAL ) </para></listitem> <listitem><para> Object is already approved </para></listitem> </itemizedlist> %TRUE if object has been approved, FALSE otherwise Check whether object is approved. %TRUE if object is approved, %FALSE otherwise Simply unapprove object. It doesn't affect any core functionality, like midgard_object_approve(). This method updates metadata properties: revisor, revised, revision, approver and approved Cases to return %FALSE: <itemizedlist> <listitem><para> No user logged in ( MGD_ERR_ACCESS_DENIED ) </para></listitem> <listitem><para> Object is not approved </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise Lock object. This method doesn't affect any core's functionality like midgard_object_approve. You should create own locking workflow and logic with methods: midgard_object_is_locked(), midgard_object_unlock() and this one. Updates metadata properties: locker, locked, revisor, revised and revision Cases to return %FALSE: <itemizedlist> <listitem><para> No user logged in ( MGD_ERR_ACCESS_DENIED ) </para></listitem> <listitem><para> Metadata class not defined for given object's class ( MGD_ERR_NO_METADATA ) </para></listitem> <listitem><para> Object is already locked ( MGD_ERR_OBJECT_IS_LOCKED ) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise Check whether object is locked Cases to return %FALSE: <itemizedlist> <listitem><para> Metadata class not defined for given object's class ( MGD_ERR_NO_METADATA ) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise Unlock object. Cases to return %FALSE: <itemizedlist> <listitem><para> No user logged in ( MGD_ERR_ACCESS_DENIED ) </para></listitem> <listitem><para> Object is not locked ( FIXME ) </para></listitem> <listitem><para> Metadata class not defined for given object's class ( MGD_ERR_NO_METADATA ) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise Creates object's parameter object if it doesn't exists, updates otherwise. %TRUE on success, %FALSE otherwise parameter's domain string parameter's name string a GValue value which should be set for domain&name pair Returned objects are midgard_parameter class. Parameter objects are fetched from database unconditionally if domain i sexplicitly set to NULL. That is, only those which parent guid property matches object's guid. Returned array should be freed when no longer needed. Newly allocated and NULL terminated array of midgard_parameter objects. optional paramaters' domain Delete object's parameter(s) which match given properties' values. Properties list in @parameters is optional. All object's parameters are deleted ( if exist ) if @parameters is explicitly set to %NULL. %TRUE on success, %FALSE if at least one of the parameters could not be deleted number of properties properties list Purge object's parameter(s) which match given properties' values. Properties list in @parameters is optional. All object's parameters are purged ( if exist ) if @parameters is explicitly set to %NULL. %TRUE on success, %FALSE if at least one of the parameters could not be purged number of properties properties list Find object's parameter(s) with matching given properties. returned ( if exist ) if @parameters is explicitly set to %NULL. newly created, NULL terminated array of #MidgardObject ( midgard_parameter class ) or %NULL on failure number of properties properties list %TRUE if object has paramateres, %FALSE otherwise. Returned objects are midgard_attachment class. Attachments objects are fetched from database unconditionally. That is, only those which parent guid property matches object's guid. Returned array should be freed when no longer needed. Newly allocated and NULL terminated array of midgard_attachment objects. Creates object's attachment using given properties. Any property may be explicitly set to NULL. newly created #MidgardObject of midgard_attachment class or %NULL on failure name for attachment its title and mimetype Delete object's attachments(s) which match given properties' values. Properties list in @parameters is optional. All object's attachments are deleted ( if exist ) if @parameters is explicitly set to %NULL. %TRUE on success, %FALSE if at least one of the attachment could not be deleted number of properties properties list Purge object's attachments(s) which match given properties' values. Properties list in @parameters is optional. All object's attachments are purged ( if exist ) if @parameters is explicitly set to %NULL. to blob located on filesystem ( it should be set to %TRUE by default ). However, if midgard_attachment is created for blobs sharing and file should not be deleted, @delete_blob should be set to %FALSE. There's no way to determine if midgard_attachment is sharing blob, so aplication itelf is responsible to create such own logic. %TRUE on success, %FALSE if at least one of the attachment could not be purged whether blob should be deleted as well number of properties properties list Find object's attachment(s) with matching given properties. returned ( if exist ) if @parameters is explicitly set to %NULL. newly created, NULL terminated array of #MidgardObject ( midgard_attachment class ) or %NULL on failure number of properties properties list %TRUE if object has attachments, %FALSE otherwise. Adds named property constraint to the given query builder. Unlike add_constraint method, this one accepts property name instead of scalar value. The difference is that with add_constraint method you can compare property with particular value, while using add_constraint_with_property method you can compare two different properties without any need to know their values. For example, you should use this method if you want to select only those objects which has been revised after publication time, and particular date doesn't matter. <example> <programlisting> midgard_query_builder_add_constraint_with_property(builder, "metadata.revised", ">", "metadata.published"); </programlisting> </example> %TRUE if properties' names are valid, %FALSE otherwise property name comparison operator property name Starts a constraint group of the given type. A conjunctive constraint group @type (AND) requires that all component constraints match the queried objects, while a disjunctive group @type (OR) requires just one of the component constraints to match. %TRUE if the @type is valid, %FALSE otherwise group type Closes the most recently opened constraint group. The client should ensure proper nesting by closing all constraint groups before the containing query is executed. open constraint groups were found %TRUE if a constraint group was closed, or %FALSE if no Adds an ordering constraint to the query. An ordering constraint consists of a property name and a sort direction. The objects returned by this query will be sorted by the given property in the given direction (ascending or descending). Multiple ordering constraints are applied in the order they were added. Property name pattern is described in midgard_query_builder_add_constraint() %TRUE if the ordering constraint is valid, %FALSE otherwise property name sort direction Sets the start @offset of the objects to return when the query is executed. The start @offset is applied after all the matching objects have been identified and sorted according to the given ordering constraints. The first @offset objects are skipped and only the remaining (if any) objects are returned to the client. Setting a start offset is normally only reasonable when one or more ordering constraints are applied to the query. A start offset is usually accompanied by a limit setting. query offset Sets the maximum number of objects to return when the query is executed. A query will by default return all matching objects, but the @limit setting can be used to restrict the potentially large number of returned objects. The @limit is applied only after the matching objects have been identified and sorted and after the optional start offset has been applied. Setting a @limit on the number of returned objects is normally only reasonable when one or more ordering constraints and optionally an offset setting are applied to the query. query limit Query all objects, deleted and undeleted. Executes the built query. Objects in returned array are #MidgardDBObject derived ones, and typecasted to base GObject. You can safely typecast them to the type, which #MidgardQueryBuilder has been initialized for. In case of any error, #MidgardConnection error is set. NULL terminated array of objects, or NULL if none found a pointer to store number of returned objects Adds named property constraint to the given query builder. Unlike add_constraint method, this one accepts property name instead of scalar value. The difference is that with add_constraint method you can compare property with particular value, while using add_constraint_with_property method you can compare two different properties without any need to know their values. For example, you should use this method if you want to select only those objects which has been revised after publication time, and particular date doesn't matter. <example> <programlisting> midgard_query_builder_add_constraint_with_property(builder, "metadata.revised", ">", "metadata.published"); </programlisting> </example> %TRUE if properties' names are valid, %FALSE otherwise property name comparison operator property name Starts a constraint group of the given type. A conjunctive constraint group @type (AND) requires that all component constraints match the queried objects, while a disjunctive group @type (OR) requires just one of the component constraints to match. %TRUE if the @type is valid, %FALSE otherwise group type Closes the most recently opened constraint group. The client should ensure proper nesting by closing all constraint groups before the containing query is executed. open constraint groups were found %TRUE if a constraint group was closed, or %FALSE if no Adds an ordering constraint to the query. An ordering constraint consists of a property name and a sort direction. The objects returned by this query will be sorted by the given property in the given direction (ascending or descending). Multiple ordering constraints are applied in the order they were added. Property name pattern is described in midgard_query_builder_add_constraint() %TRUE if the ordering constraint is valid, %FALSE otherwise property name sort direction Sets the start @offset of the objects to return when the query is executed. The start @offset is applied after all the matching objects have been identified and sorted according to the given ordering constraints. The first @offset objects are skipped and only the remaining (if any) objects are returned to the client. Setting a start offset is normally only reasonable when one or more ordering constraints are applied to the query. A start offset is usually accompanied by a limit setting. query offset Sets the maximum number of objects to return when the query is executed. A query will by default return all matching objects, but the @limit setting can be used to restrict the potentially large number of returned objects. The @limit is applied only after the matching objects have been identified and sorted and after the optional start offset has been applied. Setting a @limit on the number of returned objects is normally only reasonable when one or more ordering constraints and optionally an offset setting are applied to the query. query limit Executes the built query. Objects in returned array are #MidgardDBObject derived ones, and typecasted to base GObject. You can safely typecast them to the type, which #MidgardQueryBuilder has been initialized for. In case of any error, #MidgardConnection error is set. NULL terminated array of objects, or NULL if none found a pointer to store number of returned objects Returns type name of the type which is currently used by Query Builder. This function should be used on language binding level , when internal Query Builder's instance is already created and language binding object should be instanciated. Returned type name is a pointer and is owned by GLib system. Caller shouldn't free it. name of the class, which query builder is initialized for. Query all objects, deleted and undeleted. %TRUE if properties' names are valid, %FALSE otherwise property name comparison operator property name %TRUE if the @type is valid, %FALSE otherwise group type %TRUE if a constraint group was closed, or %FALSE if no %TRUE if the ordering constraint is valid, %FALSE otherwise property name sort direction query offset query limit NULL terminated array of objects, or NULL if none found a pointer to store number of returned objects new #MidgardQueryConstraint instance, or %NULL on failure #MidgardQueryProperty instance constraint operator #MidgardQueryHolder instance optional #MidgardQueryStorage to use with constraint #MidgardQueryStorage associated with constraint or %NULL %TRUE on success, %FALSE otherwise #MidgardQueryStorage to associate with @self constraint #MidgardQueryProperty associated with @self constraint, or %NULL %TRUE on success, %FALSE otherwise #MidgardQueryProperty to associate with @self constraint operator type associated with @self constraint, or %NULL Check midgard_query_constraint_new() for valid operator types. %TRUE on success, %FALSE otherwise operator to associate with constraint Create new #MidgardQueryConstraintGroup instance with default "AND" group type. #MidgardQueryConstraintGroup instance or %NULL This is C convinient function. It's not designed for language bindings. #MidgardQueryConstraintGroup instance or %NULL constraints group type ('OR' or 'AND') list of constraints to add to group or NULL #MidgardQueryConstraintGroup instance or %NULL constraints group type an array of #MidgardQueryConstraintSimple constraints the length of given constraints array group type ('OR' or 'AND') %TRUE if type is set, %FALSE otherwise group type to set ('OR' or 'AND') %TRUE on success, %FALSE otherwise list of #MidgardQueryConstraintSimple constraint(s) to add to constraint group array of #MidgardQueryConstraintSimple instances pointer to store numer of returned objects Set constraint object which will be used for query execution %TRUE on success, %FALSE otherwise #MidgardConstraintSimple instance %TRUE on success, %FALSE otherwise execution limit %TRUE on success, %FALSE otherwise execution offset %TRUE on success, %FALSE otherwise execution order %TRUE on success, %FALSE otherwise number of objects or records returned from execution Set constraint object which will be used for query execution %TRUE on success, %FALSE otherwise #MidgardConstraintSimple instance %TRUE on success, %FALSE otherwise execution limit %TRUE on success, %FALSE otherwise execution offset %TRUE on success, %FALSE otherwise execution order %TRUE on success, %FALSE otherwise number of objects or records returned from execution %TRUE on success, %FALSE otherwise #MidgardConstraintSimple instance %TRUE on success, %FALSE otherwise execution limit %TRUE on success, %FALSE otherwise execution offset %TRUE on success, %FALSE otherwise execution order %TRUE on success, %FALSE otherwise number of objects or records returned from execution pointer to store returned value %TRUE on success, %FALSE otherwise value to set new #MidgardQueryProperty instance or NULL on failure name of the property optional storage for given property #MidgardStorage @storage represents storage which is queried during execution new #MidgardQuerySelect instance or %NULL on failure #MidgardConnection instance #MidgardStorage instance List all objects for which data has been returned during execution. newly allocated array of #MidgardDBObject pointer to store number of returned objects This method switch #MidgardQuerySelect to read only mode. It should be enabled when returned objects will be used only to read properties. It improves performance, but it's impossible to write returned object's properties. enables or disables read only mode List all objects for which data has been returned during execution. newly allocated array of #MidgardDBObject pointer to store number of returned objects This method switch #MidgardQuerySelect to read only mode. It should be enabled when returned objects will be used only to read properties. It improves performance, but it's impossible to write returned object's properties. enables or disables read only mode newly allocated array of #MidgardDBObject pointer to store number of returned objects enables or disables read only mode Initializes new object which represents #MidgardDBObject derived one's storage new #MidgardQueryStorage or %NULL on failure name of the #MidgardDBObject derived class new #MidgardQueryValue or %NULL on failure a #GValue value Name of property which is defined as primary for given class or %NULL. Name of the class Name of property which is defined as 'up' for given class or %NULL. Name of the class Name of property which is defined as 'parent' for given class or %NULL. Name of the class Name of property which is defined unique for given class, or %NULL. Name of the class Returns newly allocated, children ( in midgard tree ) classes' names. Returned array should be freed if no longer needed without freeing array's elements. array of strings or %NULL. Name of the class pointer to store number of children classes Name of the metadata class of the given one or %NULL. Name of the class value of given node's name or %NULL. Name of the class node's name declared for given @klass newly initialized #MidgardReflectorProperty instance or %NULL on failure. Name of #MidgardDBObject (or derived) class type (#GType) of the property or %NULL if property is not registered for given class. property name which is registered for #MidgardDBObjectClass Checks whether property is a link. %TRUE if property is registered as link, %FALSE otherwise (or in case if property is not registered for given class. property name Checks if property is linked with another type. %FALSE is returned if property is not linked or is not registered for given class. %TRUE if property is linked with another type (property of another class is defined as a link to given one). property name the pointer to the #MidgardDBObjectClass, a given property is a link to. property name Or %NULL if property is not a link or given property is not registered for given class. The name of the class, the given property is a link to. property name Or %NULL if property is not a link or it's not registered for given class. The name of the property, the given one is a link to. property name description of the given property or %NULL. property name value for user defined field, or NULL if none found property to look value for name of user defined field %TRUE, if propery is defined private, %FALSE otherwise property name to check %TRUE, if property is defined as unique, %FALSE otherwise property name to check %TRUE, if property is primary, %FALSE otherwise property name to check %TRUE, if property has default value, %FALSE otherwise property name to check so it should be unset when no longer needed. %TRUE, if property has default value and its copy has been made, %FALSE otherwise property name to check value which stores default value defined for given property serialized objects as xml content or %NULL on failure. GObject (or derived class) instance Given object is not serialized. Its storage record is marked as exported. %TRUE on success, %FALSE otherwise. #MidgardDBObject instance Exports all purged objects of given class. If @startdate or @enddate are not NULL, all objects which were purged between dates will be exported. xml buffer with serialized objects or %NULL if there are no objects matching given criteria. #MidgardConnection instance name of #MidgardObjectClass derived one optional start date optional end date Serialize midgard_blob binary data. Newly allocated xml buffer, which holds blob data base64 encoded, or %NULL. #MidgardObject of MIDGARD_TYPE_ATTACHMENT type Alias for midgard_replicator_serialize_blob(). serialized object as xml data #MidgardObject of MIDGARD_TYPE_ATTACHMENT type Marks object's storage record as exported. Cases to return %FALSE: <itemizedlist> <listitem><para> Given guid is NULL or empty string (MGD_ERR_INVALID_PROPERTY_VALUE) </para></listitem> <listitem><para> Object identified by given guid doesn't exist (MGD_ERR_NOT_EXISTS) </para></listitem> <listitem><para> Object identified by given guid is purged (MGD_ERR_OBJECT_PURGED) </para></listitem> <listitem><para> Internal storage error (MGD_ERR_INTERNAL) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise #MidgardConnection instance guid which identifies object to be exported Newly allocated array of GObjects #MidgardConnection instance xml buffer which holds serialized object toggle to force unserialization Imports given object to underlying storage Cases to return %FALSE: <itemizedlist> <listitem><para> Given guid is NULL or empty string (MGD_ERR_INVALID_PROPERTY_VALUE) </para></listitem> <listitem><para> Object is already imported (MGD_ERR_OBJECT_IMPORTED) </para></listitem> <listitem><para> Object identified is deleted (MGD_ERR_OBJECT_DELETED) </para></listitem> </itemizedlist> Set @force toggle if you want to import object even if it's already imported or deleted. %TRUE on success, %FALSE otherwise #MidgardDBObject instance toggle to force import This method tries to import all objects which could be unserialized from gievn xml. It's not atomic. Check error code returned from midgard_connection_get_error(). #MidgardConnection instance data buffer which holds serialized object toggle to force import Creates new instance of the class defined in Midgard Schema. Cases to return %NULL: <itemizedlist> <listitem><para> Given guid is not a valid guid (MGD_ERR_NOT_EXISTS) </para></listitem> <listitem><para> There's no object identified by given guid (MGD_ERR_NOT_EXISTS) </para></listitem> <listitem><para> Object identified by given guid is deleted (MGD_ERR_OBJECT_DELETED) </para></listitem> <listitem><para> Object identified by given guid is purged (MGD_ERR_OBJECT_PURGED) </para></listitem> </itemizedlist> #MidgardObject derived new instance or %NULL on failure #MidgardConnection instance guid which identifies object to look for Get object by path. Path elements are objects' names. To get top object with empty name use "/" path. Cases to return %NULL: <itemizedlist> <listitem><para> Object identified by given path doesn't exist (MGD_ERR_NOT_EXISTS) </para></listitem> <listitem><para> Given @classname doesn't support tree functionality (MGD_ERR_NOT_INTERNAL) </para></listitem> <listitem><para> Given @classname doesn't provide 'id' or unique named property (MGD_ERR_NOT_INTERNAL) </para></listitem> </itemizedlist> #MidgardObject derived, new @classname instance or %NULL #MidgardConnection instance name of the class, new instance should be created for path which identifies object Cases to return %FALSE: <itemizedlist> <listitem><para> Object identified by given guid doesn't exist (MGD_ERR_NOT_EXISTS) </para></listitem> <listitem><para> Object identified by given guid is purged (MGD_ERR_OBJECT_PURGED) </para></listitem> <listitem><para> Object identified by given guid is not deleted (MGD_ERR_USER_DATA) </para></listitem> <listitem><para> Either object's or repligard's record couldn't be updated (MGD_ERR_INTERNAL) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise #MidgardConnection instance guid which identifies object to undelete %TRUE, if given @object exists under @parent_object in tree. %FALSE otherwise. #MidgardObject instance to check existance in tree parent #MidgardObject instance classname which, in tree is a parent one for given @object #MidgardObject instance Get tree parent object, of the given @object. parent object or %NULL #MidgardObject instance List tree children objects, of given @object type. newly allocated array of #MidgardObject objects #MidgardObject instance pointer to store number of returned objects List all @classname objects, if exist and are tree children of given @object. array of #MidgardObject objects, or %NULL. #MidgardObject instance name of the tree child class pointer to store number of returned objects Creates storage for base Midgard classes. %TRUE if tables has been created, %FALSE otherwise. #MidgardConnection instance Creates underlying storage (e.g. table in database) for class which is identified by given @name. It may be class which represents any underlying storage type (database table or view, for example). If underlying storage already exists, this method silently ignore creation and returns %TRUE. Such case is not considered an error. This method also creates metadata storage if given class uses such. Indexes are created if: <itemizedlist> <listitem><para> property is a link type </para></listitem> <listitem><para> property is linked to another property </para></listitem> <listitem><para> property is either parent or up </para></listitem> <listitem><para> property holds guid value </para></listitem> </itemizedlist> Auto increment (and primary key ) field is created if property is defined as primaryproperty, and it's integer ( or unsigned one ) type %TRUE on success, %FALSE otherwise #MidgardConnection instance name of #MidgardDBObjectClass derived class Update underlying storage. This method doesn't create storage. It creates new columns if are defined for class properties and do not exist in storage yet. See midgard_storage_create() if you need more info about indexes. %TRUE on success, %FALSE otherwise #MidgardConnection instance Name of #MidgardDBObjectClass derived class. Checks whether storage for given class exists. %TRUE if storage exists, %FALSE otherwise #MidgardConnection instance Name of #MidgardDBObjectClass derived class Delete storage for given class. %TRUE on success, %FALSE otherwise #MidgardConnection instance name of #MidgardDBObjectClass derived class. New #MidgardTransaction instance or NULL on failure Begins new, underlying database provider's transaction. In case of error, #MidgardConnection error is set to MGD_ERR_INTERNAL. %TRUE on success, %FALSE otherwise. In case of error, #MidgardConnection error is set to MGD_ERR_INTERNAL. %TRUE on success, %FALSE otherwise In case of error, #MidgardConnection error is set to MGD_ERR_INTERNAL %TRUE on success, %FALSE otherwise. Returns transaction status. %FALSE means, any transaction operation failed. No #MidgardConnection error is set in case of error. %TRUE on success, %FALSE otherwise unique name which identifies given transaction. Begins new, underlying database provider's transaction. In case of error, #MidgardConnection error is set to MGD_ERR_INTERNAL. %TRUE on success, %FALSE otherwise. In case of error, #MidgardConnection error is set to MGD_ERR_INTERNAL. %TRUE on success, %FALSE otherwise In case of error, #MidgardConnection error is set to MGD_ERR_INTERNAL %TRUE on success, %FALSE otherwise. Returns transaction status. %FALSE means, any transaction operation failed. No #MidgardConnection error is set in case of error. %TRUE on success, %FALSE otherwise unique name which identifies given transaction. %TRUE on success, %FALSE otherwise. %TRUE on success, %FALSE otherwise %TRUE on success, %FALSE otherwise. %TRUE on success, %FALSE otherwise unique name which identifies given transaction. in constructor if @parameters argument will be set to not %NULL value. #MidgardUser object or %NULL on failure #MidgardConnection instance number of parameters #GParameter with #MidgardUser properties Fetch #MidgardUser object from storage. At least 'login' and 'authtype' property are required to be set in parameters. Cases to return %NULL: <itemizedlist> <listitem><para> 'login' or 'authtype' properties do not exist in given parameters (MGD_ERR_INVALID_PROPERTY_VALUE) </para></listitem> <listitem><para> There's no user object which match given parameters (MGD_ERR_NOT_EXISTS) </para></listitem> <listitem><para> More than one record found in database (MGD_ERR_INTERNAL) </para></listitem> </itemizedlist> Since 9.09 new #MidgardUser instance or %NULL in case of failure #MidgardConnection instance number of parameters #GParameter with #MidgardUser properties Returned object should not be unref. #MidgardObject of "midgard_person" type, of %NULL if none associated. Cases to return %FALSE: <itemizedlist> <listitem><para> There's no user logged in (MGD_ERR_INTERNAL) </para></listitem> <listitem><para> User is not recently logged in (MGD_ERR_INTERNAL) </para></listitem> </itemizedlist> %TRUE if user successfully logs out, %FALSE otherwise Updates user storage record Cases to return %FALSE: <itemizedlist> <listitem><para> User with such login and authentication type already exists ( MGD_ERR_DUPLICATE ) </para></listitem> <listitem><para> User's guid is not set ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> 'authtype' property is empty or NULL ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> User record hasn't been found ( MGD_ERR_INTERNAL ) </para></listitem> <listitem><para> Failed to update storage record ( MGD_ERR_INTERNAL ) </para></listitem> <listitem><para> 'authtype' property value is invalid ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise Checks if given user is a user. For example, function will return FALSE for user who is logged in as admin or root. %TRUE if user is a user, %FALSE otherwise Checks if given user is an admin. %TRUE if user is an admin, %FALSE otherwise Updates user storage record Cases to return %FALSE: <itemizedlist> <listitem><para> User with such login and authentication type already exists ( MGD_ERR_DUPLICATE ) </para></listitem> <listitem><para> User's guid is not set ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> 'authtype' property is empty or NULL ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> User record hasn't been found ( MGD_ERR_INTERNAL ) </para></listitem> <listitem><para> Failed to update storage record ( MGD_ERR_INTERNAL ) </para></listitem> <listitem><para> 'authtype' property value is invalid ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> %TRUE on success, %FALSE otherwise Delete user's storage record. Cases to return %FALSE: <itemizedlist> <listitem><para> User's guid is not set ( MGD_ERR_INVALID_PROPERTY_VALUE ) </para></listitem> <listitem><para> Failed to delete storage record ( MGD_ERR_INTERNAL ) </para></listitem> </itemizedlist> @TRUE on success, @FALSE otherwise Checks if given user is a user. For example, function will return FALSE for user who is logged in as admin or root. %TRUE if user is a user, %FALSE otherwise Checks if given user is an admin. %TRUE if user is an admin, %FALSE otherwise Returned object should not be unref. #MidgardObject of "midgard_person" type, of %NULL if none associated. Associates given #MidgardObject person with @self #MidgardUser. Sets person property and updates user storage record. #MidgardUser @self takes ownership of the given #MidgardPerson reference, which should be not unref any more. See midgard_user_update() for returned error details. %TRUE on success, %FALSE otherwise #MidgardObject instance Cases to return %FALSE: <itemizedlist> <listitem><para> There's no user logged in (MGD_ERR_INTERNAL) </para></listitem> <listitem><para> User is not recently logged in (MGD_ERR_INTERNAL) </para></listitem> </itemizedlist> %TRUE if user successfully logs out, %FALSE otherwise #MidgardObject of "midgard_person" type, of %NULL if none associated. %TRUE if user successfully logs out, %FALSE otherwise %TRUE on success, %FALSE otherwise %TRUE if user is a user, %FALSE otherwise %TRUE if user is an admin, %FALSE otherwise new #MidgardDBus instance, %NULL otherwise #MidgardConnection instance a path at which D-Bus object exists whether to use session bus Emits 'Notified' signal on objects at given @path and sends given message. #MidgardConnection instance dbus path at which we expect recipients a message to be sent whether to use system or session bus Get message associated with givven instance. pointer to object's message or %NULL structure. This function checks pointer type using MIDGARD_IS_CONNECTION convention macro. Next midgard_connection_get_loglevel is called to get loglevel. If MidgardConnection check fails , a typecast to MidgardTypeHolder is made. In this case, level member is used to get loglevel. You are responsible to correctly set MidgardConnection or MidgardTypeHolder before passing ptr argument. The main approach is to follow configuration's loglevel even if MidgardConnection pointer is not yet available. domain for the given log message GLogLevelFlags log message pointer to structure which holds loglevel GQuark for Midgard Error. It's used by Midgard Error implementation, and probably not needed to use by any application. MGD_GENERIC_ERROR GQuark This function returns level registered in GLib. #GLogLevelFlags or -1 on failure string which should be parsed Get error message for the given error code. error messages which is owned by midgard-core and should not be freed. GQuark which represents MidgardError domain. MidgardErrorGeneric enum value. Deprecated:10.05 newly initialized #MidgardReflectionProperty instance or %NULL on failure. #MidgardDBObjectClass pointer Deprecated:10.05 type (#GType) of the property or %NULL if property is not registered for given class. property name which is registered for #MidgardDBObjectClass Checks whether property is a link. Deprecated:10.05 %TRUE if property is registered as link, %FALSE otherwise (or in case if property is not registered for given class. property name Checks if property is linked with another type. %FALSE is returned if property is not linked or is not registered for given class. Deprecated:10.05 %TRUE if property is linked with another type (property of another class is defined as a link to given one). property name Returns the pointer to the #MidgardDBObjectClass, a given property is a link to. Deprecated:10.05 property name Or %NULL if property is not a link or given property is not registered for given class. Deprecated:10.05 The name of the class, the given property is a link to. property name Or %NULL if property is not a link or it's not registered for given class. Deprecated:10.05 The name of the property, the given one is a link to. property name Deprecated:10.05 description of the given property or %NULL. property name Deprecated:10.05 value for user defined field, or NULL if none found property to look value for name of user defined field Deprecated:10.05 %TRUE, if propery is defined private, %FALSE otherwise property name to check This function sets internal error constant, and creates new error message. User defined message is appended to internal one. Any message created by application ( and its corresponding constant ) are destroyed and reset to MGD_ERR_OK when any API function is invoked. Second @domain parameter is optional , and can be safely defined as NULL for MGD_GENERIC_ERROR domain. <example> <programlisting> void set_wrong_property(MidgardConnection *mgd, gchar *prop) { midgard_set_error(mgd, NULL, MGD_ERR_INVALID_PROPERTY_VALUE, "My application doesn't accept %s property", prop); } </programlisting> </example> #MidgardConnection instance GQuark which represents MidgardError domain #MidgardErrorGeneric enum value a message which should be appended to string represented by errcode