Skip to content

Commit 458d066

Browse files
committed
added some notes; fixed a bug in versions mode that occured when opening a closed branch and loading the branch from the server... if there was a deleted node in that branch it would throw an exception because it would try to get the current version of the node to send back with the changes so the client could rewind from the current version. Now the server returns null for deleted nodes instead of failing with an exception, and the client knows that if it gets null that means the node has been deleted.
1 parent 516d517 commit 458d066

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

src/org/argmap/client/ArgMap.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import com.google.gwt.user.client.ui.TabLayoutPanel;
2222
import com.google.gwt.user.client.ui.Widget;
2323

24-
//TODO: opening any tree with links doesn't seem to work
2524
//TODO: test opening negated links in versions mode (probably won't work!!!)
2625
//TODO: fix versions mode formating
2726
//TODO: versioning root node with no modifications/adds throws exception because of empty change list

src/org/argmap/server/ArgMapServiceImpl.java

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -605,15 +605,14 @@ public Map<Long, NodeWithChanges> getPropsWithChanges(List<Long> propIDs) {
605605
Map<Long, NodeWithChanges> map = new HashMap<Long, NodeWithChanges>();
606606
for (Long propID : propIDs) {
607607
NodeWithChanges propWithChanges = new NodeWithChanges();
608-
// try {
609-
propWithChanges.node = ofy.get(Proposition.class, propID);
610-
// } catch (NotFoundException e) {
611-
// /*
612-
// * if the node doesn't currently exist because it has been
613-
// * deleted, just return null
614-
// */
615-
// propWithChanges.node = null;
616-
// }
608+
609+
/*
610+
* we find() instead of get() because the node in question might not
611+
* currently exist; it might have been deleted in which case
612+
* returning null should be fine
613+
*/
614+
propWithChanges.node = ofy.find(Proposition.class, propID);
615+
617616
propWithChanges.nodeChanges = getPropChanges(propID);
618617
map.put(propID, propWithChanges);
619618
}
@@ -625,15 +624,14 @@ public Map<Long, NodeWithChanges> getArgsWithChanges(List<Long> argIDs) {
625624
Map<Long, NodeWithChanges> map = new HashMap<Long, NodeWithChanges>();
626625
for (Long argID : argIDs) {
627626
NodeWithChanges argWithChanges = new NodeWithChanges();
628-
// try {
629-
argWithChanges.node = ofy.get(Argument.class, argID);
630-
// } catch (NotFoundException e) {
631-
// /*
632-
// * if the node doesn't currently exist because it has been
633-
// * deleted, just return null
634-
// */
635-
// argWithChanges.node = null;
636-
// }
627+
628+
/*
629+
* we find() instead of get() because the node in question might not
630+
* currently exist; it might have been deleted in which case
631+
* returning null should be fine
632+
*/
633+
argWithChanges.node = ofy.find(Argument.class, argID);
634+
637635
argWithChanges.nodeChanges = getArgChanges(argID,
638636
argWithChanges.unlinkedLinks);
639637
map.put(argID, argWithChanges);

war/WEB-INF/appengine-generated/datastore-indexes-auto.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<!-- Indices written at Wed, 15 Dec 2010 13:35:11 EST -->
1+
<!-- Indices written at Wed, 15 Dec 2010 17:39:37 EST -->
22

33
<datastore-indexes>
44

5-
<!-- Used 9 times in query history -->
5+
<!-- Used 11 times in query history -->
66
<datastore-index kind="Proposition" ancestor="false" source="auto">
77
<property name="root" direction="asc"/>
88
<property name="created" direction="desc"/>

0 commit comments

Comments
 (0)