Beispiel #1
0
		private bool DoStartupProcessing ()
			{
			m_DataBase = new WCFStandardsNS.WCFStandards ();
			m_DataBase.DefaultConnectionStringName = Properties.Settings.Default.WebConnectionStringName;
			WMB.WPMediaApplicationState.Instance.Properties ["DataBase"] = m_DataBase;

			
			m_RootDirectory = Path.Combine(CommonDataBase.DataBase.GetLocalWPMediaRoot (),
				WMB.Basics.GetUserConfigurationSettingsValue ("RootDirectoryForStoredOldContent"));
			if (!Directory.Exists (m_RootDirectory))
				Directory.CreateDirectory (m_RootDirectory);
			String FullControlFileName = System.IO.Path.Combine (m_RootDirectory, ControlFileName);
			if (!File.Exists (FullControlFileName))
				{
				MessageBox.Show ("Der ControlFile \"" + FullControlFileName + "\" existiert nicht!!");
				return false;
				}
			StreamReader ControlFile = new StreamReader (FullControlFileName);
			m_UrlToCheckdataList = new List<UrlToCheckData> ();
			while (ControlFile.Peek () != 0)
				{
				String ControlLine = ControlFile.ReadLine ();
				if (String.IsNullOrEmpty (ControlLine))
					break;
				String [] Elements = ControlLine.Split (';');
				UrlToCheckData NewEntry = new UrlToCheckData (Elements);
				NewEntry.m_RootDirectory = m_RootDirectory;
				m_UrlToCheckdataList.Add (NewEntry);
				}
			return true;
			}
Beispiel #2
0
		public SelectKaufeBieteSucheFromAltErlaaNet (UrlToCheckData EntryToCheck, String Content)
			{
			m_EntryToCheck = EntryToCheck;
			m_Content = Content.Replace ("</A>", "</a>").Replace ("&nbsp;", "")
				.Replace ("<br>", "").Replace ("</br>", "");
			}
Beispiel #3
0
		private String DoProcessing (UrlToCheckData EntryToCheck, String NewContent)
			{
			if (EntryToCheck.m_LogicalName == "Process_KaufeBieteSuche1")
				{
				SelectKaufeBieteSucheFromAltErlaaNet KaufeBieteSuche
					= new SelectKaufeBieteSucheFromAltErlaaNet (EntryToCheck, NewContent);
				KaufeBieteSuche.m_DataBase = m_DataBase;
				KaufeBieteSuche.m_ITimingsInterface = m_ITimingsInterface;
				return KaufeBieteSuche.Run1 ();
				}
			if (EntryToCheck.m_LogicalName == "Process_KaufeBieteSuche2")
				{
				SelectKaufeBieteSucheFromAltErlaaNet KaufeBieteSuche
					= new SelectKaufeBieteSucheFromAltErlaaNet (EntryToCheck, NewContent);
				KaufeBieteSuche.m_DataBase = m_DataBase;
				KaufeBieteSuche.m_ITimingsInterface = m_ITimingsInterface;
				return KaufeBieteSuche.Run2 ();
				}
			return "";
			}
Beispiel #4
0
		private void ReportError (UrlToCheckData EntryToCheck)
			{
			String MessageText = String.Empty;
			String Betreff = String.Empty;
			if (EntryToCheck.m_ProcessingType == "Compare")
				{
				MessageText = "AlterInhalt Link = http://www.citynews.at/AenderungenInFremdseiten/"
									 + EntryToCheck.m_OldFileName +
									 "\r\nNeuerInhalt Link = http://www.citynews.at/AenderungenInFremdseiten/"
									 + EntryToCheck.m_NewFileName + "\r\nDabei wurden folgende Unterschiede festgestellt:\r\n"
									 + String.Join ("\r\n", EntryToCheck.m_DifferenceDescription.ToArray ());
				Betreff = EntryToCheck.m_LogicalName + " - Änderungen aus den definierten Internet Quellen";
				
				}
			else
				{
				if (EntryToCheck.m_LogicalName == "KaufeBieteSuche")
					{
					}

				}
			SendMessage (Betreff, MessageText);
			}
Beispiel #5
0
		private static void DoCompare (UrlToCheckData EntryToCheck, String NewContent)
			{
			if (!EntryToCheck.IfOldFileExists ())
				{
				EntryToCheck.WriteOld (NewContent);
				EntryToCheck.m_Changed = false;
				return;
				}
			EntryToCheck.WriteNew (NewContent);
			String OldContent = EntryToCheck.OldContent ();
			EntryToCheck.m_DifferenceDescription = SpecialStringCompare (NewContent, OldContent);
			if (EntryToCheck.m_DifferenceDescription.Count > 0)
				EntryToCheck.m_Changed = true;
			else
				EntryToCheck.m_Changed = false;
			}
Beispiel #6
0
		private void CheckData (UrlToCheckData EntryToCheck)
			{
			System.Net.WebClient WebData = new WebClient ();
			String NewContent = String.Empty;
			try
				{
				NewContent = WebData.DownloadString (EntryToCheck.m_InputUrl);
				}
			catch (Exception Excp)
				{
				WMB.Basics.ReportErrorToEventViewer ("WPMediaDataCompare::CheckData",
					"Es trat beim Laden der Daten für \"" + EntryToCheck.m_LogicalName + "\" von der Url \""
					+ EntryToCheck.m_InputUrl + "\" der folgende Fehler auf:\r\n"
					+ Excp.Message);
				SendMessage (EntryToCheck.m_LogicalName + " ****** fehler", "Es trat beim Laden der Daten für \""
					+ EntryToCheck.m_LogicalName + "\" von der Url \""
					+ EntryToCheck.m_InputUrl + "\" der folgende Fehler auf:\r\n"
					+ Excp.Message);
				EntryToCheck.m_CorrectLoaded = false;
				return;
				}
			EntryToCheck.m_CorrectLoaded = true;
			if (EntryToCheck.m_SignificantParts.Count > 0)
				NewContent = SelectSignificantParts (EntryToCheck.m_SignificantParts, NewContent);
			NewContent = System.Web.HttpUtility.HtmlDecode (NewContent);
			if (EntryToCheck.m_ProcessingType == "Compare")
				DoCompare (EntryToCheck, NewContent);
			else
				{
				DoProcessing (EntryToCheck, NewContent);
				}
			return;
			}