tracker r2464 - in branches/libtracker-data: . src/libtracker-data src/trackerd
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2464 - in branches/libtracker-data: . src/libtracker-data src/trackerd
- Date: Thu, 6 Nov 2008 10:34:17 +0000 (UTC)
Author: juergbi
Date: Thu Nov 6 10:34:16 2008
New Revision: 2464
URL: http://svn.gnome.org/viewvc/tracker?rev=2464&view=rev
Log:
2008-11-06 JÃrg Billeter <j bitron ch>
* src/libtracker-data/Makefile.am:
* src/libtracker-data/tracker-data-live-search.c:
* src/libtracker-data/tracker-data-manager.c:
* src/libtracker-data/tracker-data-manager.h:
* src/libtracker-data/tracker-data-query.c:
* src/libtracker-data/tracker-data-schema.c:
* src/libtracker-data/tracker-data-schema.h:
* src/libtracker-data/tracker-data-search.c:
* src/libtracker-data/tracker-rdf-query.c:
* src/libtracker-data/tracker-xesam-query.c:
* src/trackerd/tracker-keywords.c:
* src/trackerd/tracker-search.c:
Move Schema API to tracker-data-schema.[ch]
Added:
branches/libtracker-data/src/libtracker-data/tracker-data-schema.c
branches/libtracker-data/src/libtracker-data/tracker-data-schema.h
Modified:
branches/libtracker-data/ChangeLog
branches/libtracker-data/src/libtracker-data/Makefile.am
branches/libtracker-data/src/libtracker-data/tracker-data-live-search.c
branches/libtracker-data/src/libtracker-data/tracker-data-manager.c
branches/libtracker-data/src/libtracker-data/tracker-data-manager.h
branches/libtracker-data/src/libtracker-data/tracker-data-query.c
branches/libtracker-data/src/libtracker-data/tracker-data-search.c
branches/libtracker-data/src/libtracker-data/tracker-rdf-query.c
branches/libtracker-data/src/libtracker-data/tracker-xesam-query.c
branches/libtracker-data/src/trackerd/tracker-keywords.c
branches/libtracker-data/src/trackerd/tracker-search.c
Modified: branches/libtracker-data/src/libtracker-data/Makefile.am
==============================================================================
--- branches/libtracker-data/src/libtracker-data/Makefile.am (original)
+++ branches/libtracker-data/src/libtracker-data/Makefile.am Thu Nov 6 10:34:16 2008
@@ -15,6 +15,7 @@
tracker-data-manager.c \
tracker-data-metadata.c \
tracker-data-query.c \
+ tracker-data-schema.c \
tracker-data-search.c \
tracker-data-update.c \
tracker-query-tree.c \
@@ -26,6 +27,7 @@
tracker-data-manager.h \
tracker-data-metadata.h \
tracker-data-query.h \
+ tracker-data-schema.h \
tracker-data-search.h \
tracker-data-update.h \
tracker-query-tree.h \
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-live-search.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-live-search.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-live-search.c Thu Nov 6 10:34:16 2008
@@ -28,6 +28,7 @@
#include "tracker-data-live-search.h"
#include "tracker-data-manager.h"
+#include "tracker-data-schema.h"
static gboolean
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-manager.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-manager.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-manager.c Thu Nov 6 10:34:16 2008
@@ -72,23 +72,6 @@
}
-GArray *
-tracker_db_create_array_of_services (const gchar *service,
- gboolean basic_services)
-{
- GArray *array;
-
- if (service) {
- array = tracker_ontology_get_subcategory_ids (service);
- } else if (basic_services) {
- array = tracker_ontology_get_subcategory_ids ("Files");
- } else {
- array = tracker_ontology_get_subcategory_ids ("*");
- }
-
- return array;
-}
-
void
tracker_data_manager_init (TrackerConfig *config,
TrackerLanguage *language,
@@ -228,144 +211,6 @@
return result_set;
}
-gchar *
-tracker_db_get_field_name (const gchar *service,
- const gchar *meta_name)
-{
- gint key_field;
-
- /* Replace with tracker_ontology_get_field_name_by_service_name */
- key_field = tracker_ontology_service_get_key_metadata (service, meta_name);
-
- if (key_field > 0) {
- return g_strdup_printf ("KeyMetadata%d", key_field);
- }
-
- if (strcasecmp (meta_name, "File:Path") == 0) return g_strdup ("Path");
- if (strcasecmp (meta_name, "File:Name") == 0) return g_strdup ("Name");
- if (strcasecmp (meta_name, "File:Mime") == 0) return g_strdup ("Mime");
- if (strcasecmp (meta_name, "File:Size") == 0) return g_strdup ("Size");
- if (strcasecmp (meta_name, "File:Rank") == 0) return g_strdup ("Rank");
- if (strcasecmp (meta_name, "File:Modified") == 0) return g_strdup ("IndexTime");
-
- return NULL;
-}
-
-gchar *
-tracker_db_metadata_get_field_related_names (TrackerDBInterface *iface,
- const gchar *name)
-{
- TrackerDBResultSet *result_set;
-
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- result_set = tracker_data_manager_exec_proc (iface,
- "GetMetadataAliasesForName",
- name,
- name,
- NULL);
-
- if (result_set) {
- GString *s = NULL;
- gboolean valid = TRUE;
- gint id;
-
- while (valid) {
- tracker_db_result_set_get (result_set, 1, &id, -1);
-
- if (s) {
- g_string_append_printf (s, ", %d", id);
- } else {
- s = g_string_new ("");
- g_string_append_printf (s, "%d", id);
- }
-
- valid = tracker_db_result_set_iter_next (result_set);
- }
-
- g_object_unref (result_set);
-
- return g_string_free (s, FALSE);
- }
-
- return NULL;
-}
-
-TrackerDBResultSet *
-tracker_db_xesam_get_metadata_names (TrackerDBInterface *iface,
- const gchar *name)
-{
- TrackerDBResultSet *result_set;
-
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- result_set = tracker_data_manager_exec_proc (iface,
- "GetXesamMetaDataLookups",
- name,
- NULL);
-
- return result_set;
-}
-
-TrackerDBResultSet *
-tracker_db_xesam_get_all_text_metadata_names (TrackerDBInterface *iface)
-{
- TrackerDBResultSet *result_set;
-
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
-
- result_set = tracker_data_manager_exec_proc (iface,
- "GetXesamMetaDataTextLookups",
- NULL);
-
- return result_set;
-}
-
-TrackerDBResultSet *
-tracker_db_xesam_get_service_names (TrackerDBInterface *iface,
- const gchar *name)
-{
- TrackerDBResultSet *result_set;
-
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
- g_return_val_if_fail (name != NULL, NULL);
-
- result_set = tracker_data_manager_exec_proc (iface,
- "GetXesamServiceLookups",
- name,
- NULL);
-
- return result_set;
-}
-
-const gchar *
-tracker_db_metadata_get_field_table (TrackerFieldType type)
-{
- switch (type) {
- case TRACKER_FIELD_TYPE_INDEX:
- case TRACKER_FIELD_TYPE_STRING:
- case TRACKER_FIELD_TYPE_DOUBLE:
- return "ServiceMetaData";
-
- case TRACKER_FIELD_TYPE_INTEGER:
- case TRACKER_FIELD_TYPE_DATE:
- return "ServiceNumericMetaData";
-
- case TRACKER_FIELD_TYPE_BLOB:
- return "ServiceBlobMetaData";
-
- case TRACKER_FIELD_TYPE_KEYWORD:
- return "ServiceKeywordMetaData";
-
- default:
- break;
- }
-
- return NULL;
-}
-
void
tracker_db_xesam_delete_handled_events (TrackerDBInterface *iface)
{
@@ -374,87 +219,6 @@
tracker_data_manager_exec (iface, "DELETE FROM Events WHERE BeingHandled = 1");
}
-TrackerFieldData *
-tracker_db_get_metadata_field (TrackerDBInterface *iface,
- const gchar *service,
- const gchar *field_name,
- gint field_count,
- gboolean is_select,
- gboolean is_condition)
-{
- TrackerFieldData *field_data = NULL;
- TrackerField *def;
-
- g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
- g_return_val_if_fail (service != NULL, NULL);
- g_return_val_if_fail (field_name != NULL, NULL);
-
- def = tracker_ontology_get_field_by_name (field_name);
-
- if (def) {
- gchar *alias;
- const gchar *table_name;
- gchar *this_field_name;
- gchar *where_field;
-
- field_data = g_object_new (TRACKER_TYPE_FIELD_DATA,
- "is-select", is_select,
- "is-condition", is_condition,
- "field-name", field_name,
- NULL);
-
- alias = g_strdup_printf ("M%d", field_count);
- table_name = tracker_db_metadata_get_field_table (tracker_field_get_data_type (def));
-
- g_debug ("Field_name: %s :table_name is: %s for data_type: %i",
- field_name,
- table_name,
- tracker_field_get_data_type(def));
-
- tracker_field_data_set_alias (field_data, alias);
- tracker_field_data_set_table_name (field_data, table_name);
- tracker_field_data_set_id_field (field_data, tracker_field_get_id (def));
- tracker_field_data_set_data_type (field_data, tracker_field_get_data_type (def));
- tracker_field_data_set_multiple_values (field_data, tracker_field_get_multiple_values (def));
-
- this_field_name = tracker_db_get_field_name (service, field_name);
-
- if (this_field_name) {
- gchar *str;
-
- str = g_strdup_printf (" S.%s ", this_field_name);
- tracker_field_data_set_select_field (field_data, str);
- tracker_field_data_set_needs_join (field_data, FALSE);
- g_free (str);
- g_free (this_field_name);
- } else {
- gchar *str;
- gchar *display_field;
-
- display_field = tracker_ontology_field_get_display_name (def);
- str = g_strdup_printf ("M%d.%s", field_count, display_field);
- tracker_field_data_set_select_field (field_data, str);
- tracker_field_data_set_needs_join (field_data, TRUE);
- g_free (str);
- g_free (display_field);
- }
-
- if ((tracker_field_get_data_type (def) == TRACKER_FIELD_TYPE_DOUBLE) ||
- (tracker_field_get_data_type (def) == TRACKER_FIELD_TYPE_INDEX) ||
- (tracker_field_get_data_type (def) == TRACKER_FIELD_TYPE_STRING)) {
- where_field = g_strdup_printf ("M%d.MetaDataDisplay", field_count);
- } else {
- where_field = g_strdup_printf ("M%d.MetaDataValue", field_count);
- }
-
- tracker_field_data_set_where_field (field_data, where_field);
- g_free (where_field);
- g_free (alias);
- }
-
- return field_data;
-}
-
gint
tracker_data_manager_get_db_option_int (const gchar *option)
{
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-manager.h
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-manager.h (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-manager.h Thu Nov 6 10:34:16 2008
@@ -46,9 +46,6 @@
TrackerConfig * tracker_data_manager_get_config (void);
TrackerLanguage * tracker_data_manager_get_language (void);
-GArray * tracker_db_create_array_of_services (const gchar *service,
- gboolean basic_services);
-
/* Operations for TrackerDBInterface */
TrackerDBResultSet *tracker_data_manager_exec_proc (TrackerDBInterface *iface,
const gchar *procedure,
@@ -63,28 +60,8 @@
void tracker_data_manager_set_db_option_int (const gchar *option,
gint value);
-/* Metadata API */
-gchar * tracker_db_metadata_get_field_related_names (TrackerDBInterface *iface,
- const gchar *name);
-const gchar * tracker_db_metadata_get_field_table (TrackerFieldType type);
-
-/* Miscellaneous API */
-gchar * tracker_db_get_field_name (const gchar *service,
- const gchar *meta_name);
-TrackerFieldData * tracker_db_get_metadata_field (TrackerDBInterface *iface,
- const gchar *service,
- const gchar *field_name,
- gint field_count,
- gboolean is_select,
- gboolean is_condition);
-
/* XESAM API */
void tracker_db_xesam_delete_handled_events (TrackerDBInterface *iface);
-TrackerDBResultSet *tracker_db_xesam_get_metadata_names (TrackerDBInterface *iface,
- const char *name);
-TrackerDBResultSet *tracker_db_xesam_get_all_text_metadata_names (TrackerDBInterface *iface);
-TrackerDBResultSet *tracker_db_xesam_get_service_names (TrackerDBInterface *iface,
- const char *name);
G_END_DECLS
#endif /* __TRACKER_DATA_MANAGER_H__ */
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-query.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-query.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-query.c Thu Nov 6 10:34:16 2008
@@ -40,6 +40,7 @@
#include "tracker-data-manager.h"
#include "tracker-data-query.h"
+#include "tracker-data-schema.h"
TrackerDBResultSet *
tracker_data_query_metadata_field (TrackerDBInterface *iface,
Added: branches/libtracker-data/src/libtracker-data/tracker-data-schema.c
==============================================================================
--- (empty file)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-schema.c Thu Nov 6 10:34:16 2008
@@ -0,0 +1,279 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ * Copyright (C) 2007, Jason Kivlighn (jkivlighn gmail com)
+ * Copyright (C) 2007, Creative Commons (http://creativecommons.org)
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <fcntl.h>
+
+#include <libtracker-common/tracker-file-utils.h>
+#include <libtracker-common/tracker-nfs-lock.h>
+#include <libtracker-common/tracker-parser.h>
+#include <libtracker-common/tracker-type-utils.h>
+#include <libtracker-common/tracker-utils.h>
+
+#include <libtracker-db/tracker-db-index.h>
+#include <libtracker-db/tracker-db-interface-sqlite.h>
+#include <libtracker-db/tracker-db-index-manager.h>
+#include <libtracker-db/tracker-db-manager.h>
+
+#include "tracker-data-manager.h"
+#include "tracker-data-schema.h"
+
+GArray *
+tracker_db_create_array_of_services (const gchar *service,
+ gboolean basic_services)
+{
+ GArray *array;
+
+ if (service) {
+ array = tracker_ontology_get_subcategory_ids (service);
+ } else if (basic_services) {
+ array = tracker_ontology_get_subcategory_ids ("Files");
+ } else {
+ array = tracker_ontology_get_subcategory_ids ("*");
+ }
+
+ return array;
+}
+
+gchar *
+tracker_db_get_field_name (const gchar *service,
+ const gchar *meta_name)
+{
+ gint key_field;
+
+ /* Replace with tracker_ontology_get_field_name_by_service_name */
+ key_field = tracker_ontology_service_get_key_metadata (service, meta_name);
+
+ if (key_field > 0) {
+ return g_strdup_printf ("KeyMetadata%d", key_field);
+ }
+
+ if (strcasecmp (meta_name, "File:Path") == 0) return g_strdup ("Path");
+ if (strcasecmp (meta_name, "File:Name") == 0) return g_strdup ("Name");
+ if (strcasecmp (meta_name, "File:Mime") == 0) return g_strdup ("Mime");
+ if (strcasecmp (meta_name, "File:Size") == 0) return g_strdup ("Size");
+ if (strcasecmp (meta_name, "File:Rank") == 0) return g_strdup ("Rank");
+ if (strcasecmp (meta_name, "File:Modified") == 0) return g_strdup ("IndexTime");
+
+ return NULL;
+}
+
+gchar *
+tracker_db_metadata_get_field_related_names (TrackerDBInterface *iface,
+ const gchar *name)
+{
+ TrackerDBResultSet *result_set;
+
+ g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+
+ result_set = tracker_data_manager_exec_proc (iface,
+ "GetMetadataAliasesForName",
+ name,
+ name,
+ NULL);
+
+ if (result_set) {
+ GString *s = NULL;
+ gboolean valid = TRUE;
+ gint id;
+
+ while (valid) {
+ tracker_db_result_set_get (result_set, 1, &id, -1);
+
+ if (s) {
+ g_string_append_printf (s, ", %d", id);
+ } else {
+ s = g_string_new ("");
+ g_string_append_printf (s, "%d", id);
+ }
+
+ valid = tracker_db_result_set_iter_next (result_set);
+ }
+
+ g_object_unref (result_set);
+
+ return g_string_free (s, FALSE);
+ }
+
+ return NULL;
+}
+
+TrackerDBResultSet *
+tracker_db_xesam_get_metadata_names (TrackerDBInterface *iface,
+ const gchar *name)
+{
+ TrackerDBResultSet *result_set;
+
+ g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+
+ result_set = tracker_data_manager_exec_proc (iface,
+ "GetXesamMetaDataLookups",
+ name,
+ NULL);
+
+ return result_set;
+}
+
+TrackerDBResultSet *
+tracker_db_xesam_get_all_text_metadata_names (TrackerDBInterface *iface)
+{
+ TrackerDBResultSet *result_set;
+
+ g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
+
+ result_set = tracker_data_manager_exec_proc (iface,
+ "GetXesamMetaDataTextLookups",
+ NULL);
+
+ return result_set;
+}
+
+TrackerDBResultSet *
+tracker_db_xesam_get_service_names (TrackerDBInterface *iface,
+ const gchar *name)
+{
+ TrackerDBResultSet *result_set;
+
+ g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+
+ result_set = tracker_data_manager_exec_proc (iface,
+ "GetXesamServiceLookups",
+ name,
+ NULL);
+
+ return result_set;
+}
+
+const gchar *
+tracker_db_metadata_get_field_table (TrackerFieldType type)
+{
+ switch (type) {
+ case TRACKER_FIELD_TYPE_INDEX:
+ case TRACKER_FIELD_TYPE_STRING:
+ case TRACKER_FIELD_TYPE_DOUBLE:
+ return "ServiceMetaData";
+
+ case TRACKER_FIELD_TYPE_INTEGER:
+ case TRACKER_FIELD_TYPE_DATE:
+ return "ServiceNumericMetaData";
+
+ case TRACKER_FIELD_TYPE_BLOB:
+ return "ServiceBlobMetaData";
+
+ case TRACKER_FIELD_TYPE_KEYWORD:
+ return "ServiceKeywordMetaData";
+
+ default:
+ break;
+ }
+
+ return NULL;
+}
+
+TrackerFieldData *
+tracker_db_get_metadata_field (TrackerDBInterface *iface,
+ const gchar *service,
+ const gchar *field_name,
+ gint field_count,
+ gboolean is_select,
+ gboolean is_condition)
+{
+ TrackerFieldData *field_data = NULL;
+ TrackerField *def;
+
+ g_return_val_if_fail (TRACKER_IS_DB_INTERFACE (iface), NULL);
+ g_return_val_if_fail (service != NULL, NULL);
+ g_return_val_if_fail (field_name != NULL, NULL);
+
+ def = tracker_ontology_get_field_by_name (field_name);
+
+ if (def) {
+ gchar *alias;
+ const gchar *table_name;
+ gchar *this_field_name;
+ gchar *where_field;
+
+ field_data = g_object_new (TRACKER_TYPE_FIELD_DATA,
+ "is-select", is_select,
+ "is-condition", is_condition,
+ "field-name", field_name,
+ NULL);
+
+ alias = g_strdup_printf ("M%d", field_count);
+ table_name = tracker_db_metadata_get_field_table (tracker_field_get_data_type (def));
+
+ g_debug ("Field_name: %s :table_name is: %s for data_type: %i",
+ field_name,
+ table_name,
+ tracker_field_get_data_type(def));
+
+ tracker_field_data_set_alias (field_data, alias);
+ tracker_field_data_set_table_name (field_data, table_name);
+ tracker_field_data_set_id_field (field_data, tracker_field_get_id (def));
+ tracker_field_data_set_data_type (field_data, tracker_field_get_data_type (def));
+ tracker_field_data_set_multiple_values (field_data, tracker_field_get_multiple_values (def));
+
+ this_field_name = tracker_db_get_field_name (service, field_name);
+
+ if (this_field_name) {
+ gchar *str;
+
+ str = g_strdup_printf (" S.%s ", this_field_name);
+ tracker_field_data_set_select_field (field_data, str);
+ tracker_field_data_set_needs_join (field_data, FALSE);
+ g_free (str);
+ g_free (this_field_name);
+ } else {
+ gchar *str;
+ gchar *display_field;
+
+ display_field = tracker_ontology_field_get_display_name (def);
+ str = g_strdup_printf ("M%d.%s", field_count, display_field);
+ tracker_field_data_set_select_field (field_data, str);
+ tracker_field_data_set_needs_join (field_data, TRUE);
+ g_free (str);
+ g_free (display_field);
+ }
+
+ if ((tracker_field_get_data_type (def) == TRACKER_FIELD_TYPE_DOUBLE) ||
+ (tracker_field_get_data_type (def) == TRACKER_FIELD_TYPE_INDEX) ||
+ (tracker_field_get_data_type (def) == TRACKER_FIELD_TYPE_STRING)) {
+ where_field = g_strdup_printf ("M%d.MetaDataDisplay", field_count);
+ } else {
+ where_field = g_strdup_printf ("M%d.MetaDataValue", field_count);
+ }
+
+ tracker_field_data_set_where_field (field_data, where_field);
+ g_free (where_field);
+ g_free (alias);
+ }
+
+ return field_data;
+}
+
Added: branches/libtracker-data/src/libtracker-data/tracker-data-schema.h
==============================================================================
--- (empty file)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-schema.h Thu Nov 6 10:34:16 2008
@@ -0,0 +1,67 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ * Copyright (C) 2007, Jason Kivlighn (jkivlighn gmail com)
+ * Copyright (C) 2007, Creative Commons (http://creativecommons.org)
+ * Copyright (C) 2008, Nokia
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TRACKER_DATA_SCHEMA_H__
+#define __TRACKER_DATA_SCHEMA_H__
+
+#include <glib.h>
+
+#include <libtracker-common/tracker-config.h>
+#include <libtracker-common/tracker-field.h>
+#include <libtracker-common/tracker-field-data.h>
+#include <libtracker-common/tracker-language.h>
+#include <libtracker-common/tracker-ontology.h>
+
+#include <libtracker-db/tracker-db-interface.h>
+#include <libtracker-db/tracker-db-file-info.h>
+#include <libtracker-db/tracker-db-index.h>
+
+G_BEGIN_DECLS
+
+GArray * tracker_db_create_array_of_services (const gchar *service,
+ gboolean basic_services);
+
+/* Metadata API */
+gchar * tracker_db_metadata_get_field_related_names (TrackerDBInterface *iface,
+ const gchar *name);
+const gchar * tracker_db_metadata_get_field_table (TrackerFieldType type);
+
+/* Miscellaneous API */
+gchar * tracker_db_get_field_name (const gchar *service,
+ const gchar *meta_name);
+TrackerFieldData * tracker_db_get_metadata_field (TrackerDBInterface *iface,
+ const gchar *service,
+ const gchar *field_name,
+ gint field_count,
+ gboolean is_select,
+ gboolean is_condition);
+
+/* XESAM API */
+TrackerDBResultSet *tracker_db_xesam_get_metadata_names (TrackerDBInterface *iface,
+ const char *name);
+TrackerDBResultSet *tracker_db_xesam_get_all_text_metadata_names (TrackerDBInterface *iface);
+TrackerDBResultSet *tracker_db_xesam_get_service_names (TrackerDBInterface *iface,
+ const char *name);
+G_END_DECLS
+
+#endif /* __TRACKER_DATA_SCHEMA_H__ */
Modified: branches/libtracker-data/src/libtracker-data/tracker-data-search.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-data-search.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-data-search.c Thu Nov 6 10:34:16 2008
@@ -34,6 +34,7 @@
#include <libtracker-db/tracker-db-manager.h>
#include "tracker-data-manager.h"
+#include "tracker-data-schema.h"
#include "tracker-data-search.h"
#include "tracker-query-tree.h"
Modified: branches/libtracker-data/src/libtracker-data/tracker-rdf-query.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-rdf-query.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-rdf-query.c Thu Nov 6 10:34:16 2008
@@ -25,8 +25,9 @@
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
-#include "tracker-rdf-query.h"
#include "tracker-data-manager.h"
+#include "tracker-data-schema.h"
+#include "tracker-rdf-query.h"
/* RDF Query Condition
* <rdfq:Condition>
Modified: branches/libtracker-data/src/libtracker-data/tracker-xesam-query.c
==============================================================================
--- branches/libtracker-data/src/libtracker-data/tracker-xesam-query.c (original)
+++ branches/libtracker-data/src/libtracker-data/tracker-xesam-query.c Thu Nov 6 10:34:16 2008
@@ -47,8 +47,9 @@
#include <libtracker-common/tracker-type-utils.h>
#include <libtracker-common/tracker-utils.h>
-#include "tracker-xesam-query.h"
#include "tracker-data-manager.h"
+#include "tracker-data-schema.h"
+#include "tracker-xesam-query.h"
/* XESAM Query Condition
* <query>
Modified: branches/libtracker-data/src/trackerd/tracker-keywords.c
==============================================================================
--- branches/libtracker-data/src/trackerd/tracker-keywords.c (original)
+++ branches/libtracker-data/src/trackerd/tracker-keywords.c Thu Nov 6 10:34:16 2008
@@ -31,6 +31,7 @@
#include <libtracker-data/tracker-data-manager.h>
#include <libtracker-data/tracker-data-query.h>
+#include <libtracker-data/tracker-data-schema.h>
#include <libtracker-data/tracker-data-search.h>
#include "tracker-dbus.h"
Modified: branches/libtracker-data/src/trackerd/tracker-search.c
==============================================================================
--- branches/libtracker-data/src/trackerd/tracker-search.c (original)
+++ branches/libtracker-data/src/trackerd/tracker-search.c Thu Nov 6 10:34:16 2008
@@ -37,6 +37,7 @@
#include <libtracker-data/tracker-data-manager.h>
#include <libtracker-data/tracker-data-query.h>
+#include <libtracker-data/tracker-data-schema.h>
#include <libtracker-data/tracker-data-search.h>
#include <libtracker-data/tracker-query-tree.h>
#include <libtracker-data/tracker-rdf-query.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]