desktop-data-model r7244 - trunk/engine-dbus



Author: otaylor
Date: Tue Jan 29 18:35:00 2008
New Revision: 7244
URL: http://svn.gnome.org/viewvc/desktop-data-model?rev=7244&view=rev

Log:
- Add a rule property UserDMO.contact to aid in people-merging
- Change user.aimBuddy/xmppBuddy/localBuddy to Buddies to match
  the contact properties.


Modified:
   trunk/engine-dbus/hippo-im.c

Modified: trunk/engine-dbus/hippo-im.c
==============================================================================
--- trunk/engine-dbus/hippo-im.c	(original)
+++ trunk/engine-dbus/hippo-im.c	Tue Jan 29 18:35:00 2008
@@ -70,14 +70,30 @@
     HippoDataCache *cache = hippo_engine_app_get_data_cache(hippo_get_engine_app());
     DDMDataModel *model = hippo_data_cache_get_model(cache);
 
+    /* Adding this rule here is a bit of a cheat, since it is between two server-side
+     * properties and has nothing to do with IM or buddies, but having it here makes it
+     * easier to merge everything together and create a global view of "a person".
+     * The reason for doing it client-side rather than server side is that it is a
+     * viewer-dependent property, and thus expensive and awkward to do on the
+     * server side.
+     */
+    ddm_data_model_add_rule(model,
+                            "http://mugshot.org/p/o/user";,
+                            "online-desktop:/p/o/user#contact",
+                            "http://online.gnome.org/p/o/contact";,
+                            DDM_DATA_CARDINALITY_01, FALSE, NULL,
+                            "source.user = target");
+
+    /* Now we link our buddy resources into User/Contact resources with more rules */
+    
     /* Add user property to buddies */
     ddm_data_model_add_rule(model,
                             "online-desktop:/p/o/buddy",
                             "online-desktop:/p/o/buddy#user",
                             "http://mugshot.org/p/o/user";,
                             DDM_DATA_CARDINALITY_01, FALSE, NULL,
-                            "(source.aim = target.name and target.protocol = 'aim') or "
-                            "(source.xmpp = target.name and target.protocol = 'xmpp') or "
+                            "(source.aims = target.name and target.protocol = 'aim') or "
+                            "(source.xmpps = target.name and target.protocol = 'xmpp') or "
                             "(source = target.name and target.protocol = 'mugshot-local')");
 
     /* Add contact property to buddies */
@@ -93,25 +109,25 @@
     /* Add aimBuddy property to users */
     ddm_data_model_add_rule(model,
                             "http://mugshot.org/p/o/user";,
-                            "online-desktop:/p/o/buddy/reverse#aimBuddy",
+                            "online-desktop:/p/o/buddy/reverse#aimBuddies",
                             "online-desktop:/p/o/buddy",
-                            DDM_DATA_CARDINALITY_01, FALSE, NULL,
-                            "target.aim = source.name and source.protocol = 'aim' and not source.deleted");
+                            DDM_DATA_CARDINALITY_N, FALSE, NULL,
+                            "target.aims = source.name and source.protocol = 'aim' and not source.deleted");
 
     /* Add xmppBuddy property to users */
     ddm_data_model_add_rule(model,
                             "http://mugshot.org/p/o/user";,
-                            "online-desktop:/p/o/buddy/reverse#xmppBuddy",
+                            "online-desktop:/p/o/buddy/reverse#xmppBuddies",
                             "online-desktop:/p/o/buddy",
-                            DDM_DATA_CARDINALITY_01, FALSE, NULL,
-                            "target.xmpp = source.name and source.protocol = 'xmpp' and not source.deleted");
+                            DDM_DATA_CARDINALITY_N, FALSE, NULL,
+                            "target.xmpps = source.name and source.protocol = 'xmpp' and not source.deleted");
 
     /* Add mugshotLocalBuddy property to users */
     ddm_data_model_add_rule(model,
                             "http://mugshot.org/p/o/user";,
-                            "online-desktop:/p/o/buddy/reverse#mugshotLocalBuddy",
+                            "online-desktop:/p/o/buddy/reverse#mugshotLocalBuddies",
                             "online-desktop:/p/o/buddy",
-                            DDM_DATA_CARDINALITY_01, FALSE, NULL,
+                            DDM_DATA_CARDINALITY_N, FALSE, NULL,
                             "target = source.name and source.protocol = 'mugshot-local' and not source.deleted");
 
     /* Add aimBuddies property to contacts */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]