r7162 - in dumbhippo/trunk/server: src/com/dumbhippo/dm/fetch tests tests/com/dumbhippo/dm
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7162 - in dumbhippo/trunk/server: src/com/dumbhippo/dm/fetch tests tests/com/dumbhippo/dm
- Date: Wed, 9 Jan 2008 13:54:40 -0600 (CST)
Author: otaylor
Date: 2008-01-09 13:54:39 -0600 (Wed, 09 Jan 2008)
New Revision: 7162
Modified:
dumbhippo/trunk/server/src/com/dumbhippo/dm/fetch/BoundFetch.java
dumbhippo/trunk/server/tests/com/dumbhippo/dm/FetchTests.java
dumbhippo/trunk/server/tests/fetch-tests.xml
Log:
Include "+" in the fetch string we send to the client with each resource
if we are doing a default fetch. This is needed for notifications, where
the client won't know otherwise that properties that we are sending include
all the defaults.
Modified: dumbhippo/trunk/server/src/com/dumbhippo/dm/fetch/BoundFetch.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/dm/fetch/BoundFetch.java 2008-01-09 19:43:38 UTC (rev 7161)
+++ dumbhippo/trunk/server/src/com/dumbhippo/dm/fetch/BoundFetch.java 2008-01-09 19:54:39 UTC (rev 7162)
@@ -186,6 +186,9 @@
else {
StringBuilder sb = new StringBuilder();
+ if ((oldFetch != null && oldFetch.getIncludeDefault()) || getIncludeDefault())
+ sb.append("+");
+
newIndex = 0; oldIndex = 0;
newOrdering = propertyOrdering(0);
oldOrdering = oldFetch != null ? oldFetch.propertyOrdering(0) : Long.MAX_VALUE;
Modified: dumbhippo/trunk/server/tests/com/dumbhippo/dm/FetchTests.java
===================================================================
--- dumbhippo/trunk/server/tests/com/dumbhippo/dm/FetchTests.java 2008-01-09 19:43:38 UTC (rev 7161)
+++ dumbhippo/trunk/server/tests/com/dumbhippo/dm/FetchTests.java 2008-01-09 19:54:39 UTC (rev 7162)
@@ -97,7 +97,7 @@
em = support.beginSessionRO(viewpoint);
TestGroupDMO groupDMO = support.currentSessionRO().find(TestGroupDMO.class, groupId);
- doFetchTest(Guid.class, TestGroupDMO.class, groupDMO, "+;members +", "bobAndJane",
+ doFetchTest(Guid.class, TestGroupDMO.class, groupDMO, "+;members +", "bobAndJaneDefault",
"group", groupId.toString(),
"bob", bobId.toString(),
"jane", janeId.toString());
Modified: dumbhippo/trunk/server/tests/fetch-tests.xml
===================================================================
--- dumbhippo/trunk/server/tests/fetch-tests.xml 2008-01-09 19:43:38 UTC (rev 7161)
+++ dumbhippo/trunk/server/tests/fetch-tests.xml 2008-01-09 19:54:39 UTC (rev 7162)
@@ -26,6 +26,26 @@
</g:resource>
</fetchResult>
+ <fetchResult id="bobAndJaneDefault">
+ <u:resource m:resourceId="user/$(bob)" m:indirect="true" m:fetch="+;name">
+ <u:name>Bob</u:name>
+ </u:resource>
+ <gm:resource m:resourceId="groupMember/$(group).$(bob)" m:indirect="true" m:fetch="+;member">
+ <gm:member m:resourceId="user/$(bob)"/>
+ </gm:resource>
+ <u:resource m:resourceId="user/$(jane)" m:indirect="true" m:fetch="+;name">
+ <u:name>Jane</u:name>
+ </u:resource>
+ <gm:resource m:resourceId="groupMember/$(group).$(jane)" m:indirect="true" m:fetch="+;member">
+ <gm:member m:resourceId="user/$(jane)"/>
+ </gm:resource>
+ <g:resource m:resourceId="group/$(group)" m:fetch="+;name;members">
+ <g:name>BobAndJane</g:name>
+ <g:members m:resourceId="groupMember/$(group).$(bob)"/>
+ <g:members m:resourceId="groupMember/$(group).$(jane)"/>
+ </g:resource>
+ </fetchResult>
+
<fetchResult id="bobAndJaneSmall">
<g:resource m:resourceId="group/$(group)" m:fetch="name">
<g:name>BobAndJane</g:name>
@@ -33,32 +53,32 @@
</fetchResult>
<fetchResult id="bobAndJaneRemaining">
- <u:resource m:resourceId="user/$(bob)" m:indirect="true" m:fetch="name">
+ <u:resource m:resourceId="user/$(bob)" m:indirect="true" m:fetch="+;name">
<u:name>Bob</u:name>
</u:resource>
- <gm:resource m:resourceId="groupMember/$(group).$(bob)" m:indirect="true" m:fetch="member">
+ <gm:resource m:resourceId="groupMember/$(group).$(bob)" m:indirect="true" m:fetch="+;member">
<gm:member m:resourceId="user/$(bob)"/>
</gm:resource>
- <u:resource m:resourceId="user/$(jane)" m:indirect="true" m:fetch="name">
+ <u:resource m:resourceId="user/$(jane)" m:indirect="true" m:fetch="+;name">
<u:name>Jane</u:name>
</u:resource>
- <gm:resource m:resourceId="groupMember/$(group).$(jane)" m:indirect="true" m:fetch="member">
+ <gm:resource m:resourceId="groupMember/$(group).$(jane)" m:indirect="true" m:fetch="+;member">
<gm:member m:resourceId="user/$(jane)"/>
</gm:resource>
- <g:resource m:resourceId="group/$(group)" m:fetch="name;members">
+ <g:resource m:resourceId="group/$(group)" m:fetch="+;name;members">
<g:members m:resourceId="groupMember/$(group).$(bob)"/>
<g:members m:resourceId="groupMember/$(group).$(jane)"/>
</g:resource>
</fetchResult>
<fetchResult id="bobAndJaneAddOn">
- <gm:resource m:resourceId="groupMember/$(group).$(bob)" m:indirect="true" m:fetch="group;member">
+ <gm:resource m:resourceId="groupMember/$(group).$(bob)" m:indirect="true" m:fetch="+;group;member">
<gm:group m:resourceId="group/$(group)"/>
</gm:resource>
- <gm:resource m:resourceId="groupMember/$(group).$(jane)" m:indirect="true" m:fetch="group;member">
+ <gm:resource m:resourceId="groupMember/$(group).$(jane)" m:indirect="true" m:fetch="+;group;member">
<gm:group m:resourceId="group/$(group)"/>
</gm:resource>
- <g:resource m:resourceId="group/$(group)" m:fetch="name;members">
+ <g:resource m:resourceId="group/$(group)" m:fetch="+;name;members">
</g:resource>
</fetchResult>
@@ -69,7 +89,7 @@
<gm:resource m:resourceId="groupMember/$(group).$(jane)" m:indirect="true" m:fetch="group">
<gm:group m:resourceId="group/$(group)"/>
</gm:resource>
- <g:resource m:resourceId="group/$(group)" m:fetch="name;members">
+ <g:resource m:resourceId="group/$(group)" m:fetch="+;name;members">
<g:name>BobAndJane</g:name>
<g:members m:resourceId="groupMember/$(group).$(bob)"/>
<g:members m:resourceId="groupMember/$(group).$(jane)"/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]