public DocumentClosure ConstructClosure(MetadataServicesClient client, SemanticsGlobalCollection <Document> downloadedDocumentCollection)
 {
     return(new DocumentClosure(SemanticsSessionScope, this)
     {
         MetadataServicesClient = client,
         GlobalDocumentCollection = downloadedDocumentCollection
     });
 }
        public async void TestMetadataServicesClient()
        {
            Console.WriteLine("Initializing client");
            MetadataServicesClient mmdclient = new MetadataServicesClient(RepositoryMetadataTranslationScope.Get(), null);

            mmdclient.RequestMetadata(new ParsedUri("http://dl.acm.org/citation.cfm?id=1871437.1871580"));
            //Console.WriteLine("Got second metadata object: {0}", d );


            mmdclient.RequestMetadata(new ParsedUri("http://www.amazon.com/gp/product/B0050SYS5A/"));
            //Console.WriteLine("Got second metadata object: {0}", d2);

            Console.WriteLine("Terminating test cases");
        }
Example #3
0
        public async void TestMetadataServicesClient()
        {
            Console.WriteLine("Initializing client");
            MetadataServicesClient mmdclient = new MetadataServicesClient(RepositoryMetadataTranslationScope.Get(), null);

            mmdclient.RequestMetadata(new ParsedUri("http://dl.acm.org/citation.cfm?id=1871437.1871580"));
            //Console.WriteLine("Got second metadata object: {0}", d );


            mmdclient.RequestMetadata(new ParsedUri("http://www.amazon.com/gp/product/B0050SYS5A/"));
            //Console.WriteLine("Got second metadata object: {0}", d2);

            Console.WriteLine("Terminating test cases");
        }
//        public ParsedUri DownloadLocation
//        {
//            get
//            {
//                ParsedUri result	    = Location.Value;
//		        ParsedUri localLocation	= LocalLocation.Value;
//		        if (localLocation != null)
//		        {
//			        FileInfo localFile	= localLocation.File;
//			        if (localFile.Exists)
//				        result	= localLocation;
//		        }
//		        return result;
//            }
//        }

        ///<summary>
        /// @return A closure for this, or null, if this is not fit to be parsed.
        ///</summary>
        public DocumentClosure GetOrConstructClosure(MetadataServicesClient client, SemanticsGlobalCollection <Document> downloadedDocumentCollection)
        {
            DocumentClosure result = this.documentClosure;

            if (result == null)
            {
                result = this.documentClosure;
                if (result == null)
                {
                    result = ConstructClosure(client, downloadedDocumentCollection);
                    this.documentClosure = result;
                }
            }
            return(result);
        }