Index: DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js
===================================================================
--- DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js	(revision 5266)
+++ DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js	(revision 5274)
@@ -163,6 +163,7 @@
                     // Database insert request is true if successful
                     // Firebug.Console.log(rtn);
+                    annotationProxy.log('called cache stuff');
                     callback.call(undefined, aid);  
-                    annotationProxy.log('called cache stuff');
+                    
                 }
             });
@@ -227,5 +228,6 @@
             var xhr = new XMLHttpRequest();
             xhr.onload = function() {
-                annotationProxy.log("Cache POST status: "+xhr.status);
+                annotationProxy.log("Cache POST status for "+targetURL+": "+xhr.status);
+                annotationProxy.log(xhr.statusText);
             };
             xhr.open("POST", targetURL, true);
@@ -242,4 +244,5 @@
                            cache+'\n\n' +
                            '--'+boundary+'--';
+            annotationProxy.log(postBody);       
             xhr.send(postBody);
         },
@@ -264,4 +267,21 @@
             });         
         },
+        getCacheURL: function (targetURL, callback){
+            $.ajax({
+                type: "GET",
+                url: targetURL,
+                dataType: "xml",
+                success: function(xml, textStatus, jqXHR) {
+                    $xml = $.parseXML(jqXHR.responseText);
+                    
+                    jQuery($xml).find('cached').each(function() {
+                        var cacheURL = this.getAttribute('ref');
+                        callback.call(undefined, cacheURL);
+                    });
+                    
+                                 
+                }
+            });               
+        },
         setBackend: function(url) {
             this.backend = url;
Index: DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js
===================================================================
--- DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js	(revision 5266)
+++ DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js	(revision 5274)
@@ -118,5 +118,25 @@
             });
         },
-        getCacheURL: function(om_object){
+        openRemoteCache: function(event){
+            this.log(event);
+            var oid = bitsAutocacheService.bitsItemView.object.oid;
+            var cacheUrl = this.getCacheURL(oid);
+            
+            
+        },
+        getCacheURL: function(oid, tabbed){
+            var aid = this.getAidFromOid(oid);
+            annotationFramework.getTargets(aid, function(targets){
+                var targetURL = targets[0];
+                annotationProxy.log('targets');
+                annotationProxy.log(targets[0]);
+                annotationFramework.getCacheURL(targetURL, function(cacheURL){
+                    cacheURL += '/stream';
+                    annotationProxy.log('cacheURL');
+                    annotationProxy.log(cacheURL);
+                    
+                    bitsAutocacheService.Common.loadURL(cacheURL,tabbed);
+                });
+            });
             
         },
Index: DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/autocacheSidebarOverlay.xul
===================================================================
--- DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/autocacheSidebarOverlay.xul	(revision 5266)
+++ DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/autocacheSidebarOverlay.xul	(revision 5274)
@@ -122,9 +122,9 @@
                         id="bitsItemTreePopupCacheOpenRemote"
                         label="&markingcollection.autocache.open.remote;"
-                        oncommand="alert('TODO remote cache')"/>
+                        oncommand="window.top.annotationProxy.openRemoteCache(event, false);"/>
                     <menuitem
                         id="bitsItemTreePopupCacheOpenRemoteNewTab"
                         label="&markingcollection.autocache.open.remotenewtab;"
-                        oncommand="alert('TODO remote cache in new tab')"/>
+                        oncommand="window.top.annotationProxy.openRemoteCache(event, true);"/>
                     <menuitem
                         id="bitsItemTreePopupCacheOpen"
