コード例 #1
0
ファイル: Nntp.cs プロジェクト: ArsenShnurkov/beagle-1
		// FIXME: This need some more info
		private Indexable NntpMessageToIndexable (TB.NntpMessage message)
		{
			Indexable indexable;
			
			indexable = new Indexable (message.Uri);
			indexable.HitType = "MailMessage";
			indexable.MimeType = "message/rfc822";
			indexable.Timestamp = DateTime.Parse (message.GetString ("date")).ToUniversalTime ();
			
			indexable.AddProperty (Property.NewKeyword ("fixme:client", "thunderbird"));
			indexable.AddProperty (Property.NewUnsearched ("fixme:fullyIndexed", message.GetBool ("FullIndex")));
			indexable.AddProperty (Property.NewDate ("fixme:indexDateTime", DateTime.UtcNow));
			
			string subject = GMime.Utils.HeaderDecodePhrase (message.GetString ("subject"));
			indexable.AddProperty (Property.New ("dc:title", subject));
			
			return indexable;
		}
コード例 #2
0
ファイル: Rss.cs プロジェクト: ArsenShnurkov/beagle-1
		private Indexable RssFeedToIndexable (TB.RssFeed feed)
		{
			Indexable indexable;
			StringReader content = feed.Content;
			
			indexable = NewIndexable (feed.Uri, DateTime.Parse (feed.GetString ("date")).ToUniversalTime (), "FeedItem");
			indexable.MimeType = "text/html";
			
			indexable.AddProperty (Property.NewKeyword ("dc:identifier", feed.GetString ("message-id")));
			indexable.AddProperty (Property.NewKeyword ("dc:source", feed_url));
			indexable.AddProperty (Property.New ("dc:publisher", feed.GetString ("sender")));
			if (content == null)
				indexable.AddProperty (Property.New ("dc:title", feed.GetString ("subject")));
			
			indexable.SetTextReader (content);
			
			return indexable;
		}
コード例 #3
0
ファイル: MoveMail.cs プロジェクト: ArsenShnurkov/beagle-1
		// FIXME: This need some more info
		private Indexable MoveMailToIndexable (TB.MoveMail mail)
		{
			Indexable indexable;

			indexable = NewIndexable (mail.Uri, DateTime.UtcNow, "MailMessage");
			indexable.MimeType = "message/rfc822";
			
			string subject = GMime.Utils.HeaderDecodePhrase (mail.GetString ("subject"));
			indexable.AddProperty (Property.New ("dc:title", subject));
			
			return indexable;
		}
コード例 #4
0
ファイル: Contact.cs プロジェクト: ArsenShnurkov/beagle-1
		private Indexable ContactToIndexable (TB.Contact contact)
		{
			Indexable indexable = NewIndexable (contact.Uri, DateTime.Now.ToUniversalTime (), "Contact");
			
			indexable.AddProperty (Property.New ("fixme:FirstName", contact.GetString ("FirstName")));
			indexable.AddProperty (Property.New ("fixme:LastName", contact.GetString ("LastName")));
			indexable.AddProperty (Property.New ("fixme:DisplayName", contact.GetString ("LastName")));
			indexable.AddProperty (Property.New ("fixme:NickName", contact.GetString ("NickName")));
			indexable.AddProperty (Property.NewKeyword ("fixme:PrimaryEmail", contact.GetString ("PrimaryEmail")));
			indexable.AddProperty (Property.NewKeyword ("fixme:SecondEmail", contact.GetString ("SecondEmail")));
			indexable.AddProperty (Property.New ("fixme:WorkPhone", contact.GetString ("WorkPhone")));
			indexable.AddProperty (Property.New ("fixme:FaxNumber", contact.GetString ("FaxNumber")));
			indexable.AddProperty (Property.New ("fixme:HomePhone", contact.GetString ("HomePhone")));
			indexable.AddProperty (Property.New ("fixme:PagerNumber", contact.GetString ("PagerNumber")));
			indexable.AddProperty (Property.New ("fixme:CellularNumber", contact.GetString ("CellularNumber")));
			indexable.AddProperty (Property.New ("fixme:HomeAddress", contact.GetString ("HomeAddress")));
			indexable.AddProperty (Property.New ("fixme:HomeAddress2", contact.GetString ("HomeAddress2")));
			indexable.AddProperty (Property.New ("fixme:HomeCity", contact.GetString ("HomeCity")));
			indexable.AddProperty (Property.New ("fixme:HomeState", contact.GetString ("HomeState")));
			indexable.AddProperty (Property.New ("fixme:HomeZipCode", contact.GetString("HomeZipCode")));
			indexable.AddProperty (Property.New ("fixme:HomeCountry", contact.GetString ("HomeCountry")));
			indexable.AddProperty (Property.New ("fixme:WorkAddress", contact.GetString ("WorkAddress")));
			indexable.AddProperty (Property.New ("fixme:WorkAddress2", contact.GetString ("WorkAddress2")));
			indexable.AddProperty (Property.New ("fixme:WorkCity", contact.GetString ("WorkCity")));
			indexable.AddProperty (Property.New ("fixme:WorkState", contact.GetString ("WorkState")));
			indexable.AddProperty (Property.New ("fixme:WorkZipCode", contact.GetString ("WorkZipCode")));
			indexable.AddProperty (Property.New ("fixme:WorkCountry", contact.GetString ("WorkCountry")));
			indexable.AddProperty (Property.New ("fixme:JobTitle", contact.GetString ("JobTitle")));
			indexable.AddProperty (Property.New ("fixme:Department", contact.GetString ("Department")));
			indexable.AddProperty (Property.New ("fixme:Company", contact.GetString ("Company")));
			indexable.AddProperty (Property.New ("fixme:_AimScreenName", contact.GetString ("_AimScreenName")));
			indexable.AddProperty (Property.New ("fixme:FamilyName", contact.GetString ("FamilyName")));
			indexable.AddProperty (Property.NewKeyword ("fixme:WebPage1", contact.GetString ("WebPage1")));
			indexable.AddProperty (Property.NewKeyword ("fixme:WebPage2", contact.GetString ("WebPage2")));
			indexable.AddProperty (Property.New ("fixme:BirthYear", contact.GetString ("BirthYear")));
			indexable.AddProperty (Property.New ("fixme:BirthMonth", contact.GetString ("BirthMonth")));
			indexable.AddProperty (Property.New ("fixme:BirthDay", contact.GetString ("BirthDay")));
			indexable.AddProperty (Property.New ("fixme:Custom1", contact.GetString ("Custom1")));
			indexable.AddProperty (Property.New ("fixme:Custom2", contact.GetString ("Custom2")));
			indexable.AddProperty (Property.New ("fixme:Custom3", contact.GetString ("Custom3")));
			indexable.AddProperty (Property.New ("fixme:Custom4", contact.GetString ("Custom4")));
			indexable.AddProperty (Property.New ("fixme:Notes", contact.GetString ("Notes")));
			indexable.AddProperty (Property.New ("fixme:PreferMailFormat", contact.GetString ("PreferMailFormat")));
			
			indexable.AddProperty (Property.NewKeyword ("fixme:Email", contact.GetString ("PrimaryEmail")));
			indexable.AddProperty (Property.New ("fixme:Name", contact.GetString ("DisplayName")));
			
			return indexable;
		}
コード例 #5
0
ファイル: Mail.cs プロジェクト: ArsenShnurkov/beagle-1
		private Indexable MailToIndexable (TB.Mail mail)
		{
			Indexable indexable;
			GMime.Message message = mail.Message;
			FullIndex = mail.GetBool ("FullIndex"); // Make sure this is up to date
			string mailbox = (MailboxName != null ? MailboxName : (string) mail.GetString ("mailbox"));
			
			indexable = NewIndexable (mail.Uri, message.Date.ToUniversalTime (), "MailMessage");
			indexable.MimeType = "message/rfc822";
			indexable.CacheContent = true;
			indexable.AddProperty (Property.NewKeyword ("fixme:folder", mailbox));
			indexable.SetBinaryStream (message.Stream);
			
			if (mail.GetBool ("FullIndex"))
				indexable.ContentUri = UriFu.PathToFileUri (Thunderbird.GetFullyIndexableFile (DbFile));
			
			message.Dispose ();			

			return indexable;
		}