Ejemplo n.º 1
0
        public bool ProcessRedirect(Uri redirectedUri)
        {
            MetadataParsedURL originalMetadataPURL = originalDocument.Location;
            ParsedUri         originalPURL         = originalMetadataPURL == null ? null : originalMetadataPURL.Value;
            ParsedUri         redirectedPURL       = new ParsedUri(redirectedUri.AbsoluteUri);

            Debug.WriteLine("try redirecting: " + originalPURL + " > " + redirectedPURL);

            /*Document redirectedDocument = semanticsSessionScope.GetOrConstructDocument(redirectedPURL);
             * // note FIXME currently, GetOrConstructDocument does not return null!
             * if (redirectedDocument != null)
             * {
             *  // existing document: the redirected url has been visited already.
             *
             *  if (originalPURL != redirectedPURL)
             *      redirectedDocument.AddAdditionalLocation(originalMetadataPURL);
             *
             *  // TODO -- copy metadata from originalDocument?!!
             *
             *  documentClosure.ChangeDocument(redirectedDocument);
             *
             *  // TODO -- reconnect
             *
             *  return true;
             * }
             * else
             * {
             *  // TODO -- redirect to a new location.
             * }*/

            // TODO -- what if redirectedDocument is already in the queue or being downloaded?

            return(false);
        }
Ejemplo n.º 2
0
 public void AddAdditionalLocation(MetadataParsedURL additionalLocation)
 {
     if (AdditionalLocations == null)
     {
         AdditionalLocations = new List <MetadataParsedURL>();
     }
     AdditionalLocations.Add(additionalLocation);
 }
Ejemplo n.º 3
0
 ///<summary>
 /// Get the old location from this.
 /// Set the location of this to the newLocation.
 /// Add a mapping in the GlobalCollection from newLocation to this.
 /// Add the old location for this as an additionalLocation for this.
 ///</summary>
 public void ChangeLocation(ParsedUri newLocation)
 {
     if (newLocation != null)
     {
         MetadataParsedURL origLocation = Location;
         if (!origLocation.Value.Equals(newLocation))
         {
             Location = new MetadataParsedURL(newLocation);
             if (SemanticsSessionScope != null)
             {
                 SemanticsSessionScope.GlobalDocumentCollection.AddDocument(this, newLocation);
             }
             AddAdditionalLocation(origLocation);
         }
     }
 }
Ejemplo n.º 4
0
 ///<summary>
 /// Get the old location from this.
 /// Set the location of this to the newLocation.
 /// Add a mapping in the GlobalCollection from newLocation to this.
 /// Add the old location for this as an additionalLocation for this.
 ///</summary>
 public void ChangeLocation(ParsedUri newLocation)
 {
     if (newLocation != null)
     {
         MetadataParsedURL origLocation = Location;
         if (!origLocation.Value.Equals(newLocation))
         {
             Location = new MetadataParsedURL(newLocation);
             if (SemanticsSessionScope != null)
                 SemanticsSessionScope.GlobalDocumentCollection.AddDocument(this, newLocation);
             AddAdditionalLocation(origLocation);
         }
     }
 }
Ejemplo n.º 5
0
 public void AddAdditionalLocation(MetadataParsedURL additionalLocation)
 {
     if (AdditionalLocations == null)
         AdditionalLocations = new List<MetadataParsedURL>();
     AdditionalLocations.Add(additionalLocation);
 }