Exemplo n.º 1
0
		void m_CreationThread_DoWork (object sender, DoWorkEventArgs e)
			{
			WMB.DataWrapper.Instance.SetSecurity("", null);

			WPMediaCentralService.WPMediaCentralServices ProcessingUnit = new WPMediaCentralServices ();
			ProcessingUnit.MyRunningThread = e.Argument as BackgroundWorker;
			String ComputerName = WMB.Basics.GetComputerName ().ToUpper ();
//TODO			String LocalWPMediaRoot = CommonDataBase.DataBase.GetLocalWPMediaRoot();
			String LocalWPMediaRoot = WMB.Basics.WPMediaServerRootDirectory;
			ProcessingUnit.LocalWPMediaRoot = LocalWPMediaRoot;
			String WPMediaConnectionStringName = WMB.Basics.GetUserConfigurationSettingsValue("WPMediaConnectionStringName");
			String WPMediaAddOnConnectionStringName = WMB.Basics.GetUserConfigurationSettingsValue("WPMediaAddOnConnectionStringName");

			// by sac - I think, this procedure is not required any more
#if DEBUG
			//ProcessingUnit.StartFullProcedure(WPMediaConnectionStringName, WPMediaAddOnConnectionStringName, DateTime.Now.AddDays(-30), null, null);
#endif	
			}
Exemplo n.º 2
0
		public void DoInternetPictureCreation ()
			{
			WPMediaCentralServices InternetPictureService = new WPMediaCentralServices ();
			InternetPictureService.m_DataBase = m_DataBase;
			InternetPictureService.GetFinalPicturesCall += GetFinalPicturesCall;
			InternetPictureService.FreeDisposeableElementsCall += FreeDisposeableElementsCall;
			InternetPictureService.GetNumberOfFinalPagesCall += GetNumberOfFinalPagesCall;
			InternetPictureService.DoInternetPictureCreation ();


			}
Exemplo n.º 3
0
		public int CreateAllRequiredCentralComponents ()
			{
// by sac xxx

			if (CVM.CommonValues.IsTestRun)
				WMB.Basics.ReportInformationToEventViewer ("WPMediaCreateStandBildTVUnits.Create",
							 "DoTableImport - started");
			try
				{
				if (String.Compare (WMB.Basics.GetComputerName (), "Heinz64", true) != 0)
					DoTableImport ();
				}
			catch (Exception Excp)
				{
				WMB.Basics.ReportErrorToEventViewer ("CreateStandbildTVUnits.Create",
					"Bei Aufruf von \"DoTableImport\" trat folgender Fehler auf:\r\n"
					+ Excp.Message);
				}
			if (CVM.CommonValues.IsTestRun)
				WMB.Basics.ReportInformationToEventViewer ("WPMediaCreateStandBildTVUnits.Create",
							 "CreateGallerieEntriesFromPictureFiles - started");
//			CreateGallerieEntriesFromPictureFiles ();

			DataSet AvailableTablesDataSet = m_DataBase.GetCommonDataSet ("Select * from TableDefinitions order by TableName");
			List<String> AvailableTables = new List<string> ();
			WPMediaCentralService.WPMediaCentralServices Services = new WPMediaCentralServices ();
			int ModifiedEntries = 0;
			foreach (DataRow tableDefinitionRow in AvailableTablesDataSet.Tables [0].Rows)
				{
				String AvailableTableName = tableDefinitionRow ["TableName"].ToString ();
				if (AvailableTableName == "AlleTables")
					continue;
				String TableType = tableDefinitionRow ["Type"].ToString ();
				String ProcessingVersion = tableDefinitionRow ["ProcessingVersion"].ToString ();
				ControlFileExtension = "*.Pkg";
				Services.ControlFileExtension = ControlFileExtension;
				// TODO
				if (String.Compare(WMB.Basics.GetComputerName(), "Heinz64", true) == 0)
					{
					RootDirectoryForEntryGeneration = "\\\\WebServer2\\WPMediaSender\\Source";
					if (AvailableTableName != TABLE_NAME_FOR_TEST_PURPOSES)
						continue;
					}

				DirectoryInfo directoryInfo = new DirectoryInfo
					(Path.Combine(RootDirectoryForEntryGeneration, AvailableTableName));
				if (!directoryInfo.Exists)
					{
					WMB.Basics.ReportInformationToEventViewer("WPMediaCreateStandBildTVUnits.Create",
								$"{AvailableTableName}, {ProcessingVersion}\r\n" +
								$"Creation Loop kann nicht starten, weil Directory nicht vorhanden");
					continue;
					}
				if (CVM.CommonValues.IsTestRun)
					{
					int NumberOfFiles = WMB.Basics.GetFilesFromDirectory
						(Path.Combine(RootDirectoryForEntryGeneration, AvailableTableName), new string[ ] {"*.pkg"}, 1).Count; 
					WMB.Basics.ReportInformationToEventViewer("WPMediaCreateStandBildTVUnits.Create",
								 AvailableTableName + ", " + ProcessingVersion + " Creation Loop - started"
								 + "\r\nNumberOfFiles = " + Convert.ToString(NumberOfFiles));
					}
				String DefinitionNameToCreate = tableDefinitionRow ["DefinitionNameToCreate"].ToString ();
				if (String.IsNullOrEmpty (DefinitionNameToCreate))
					{
					try
						{
						ModifiedEntries += CreateModifiedEntries(RootDirectoryForEntryGeneration, 
									DefinitionNameToCreate, AvailableTableName, TableType);
						}
					catch (Exception Excp)
						{
						WMB.Basics.ReportErrorToEventViewer ("CreateStandbildTVUnits.Create",
							"Bei Aufruf von \"CreateModifiedEntries\" für die Tabelle  \"" + AvailableTableName
								+ "\" trat folgender Fehler auf:\r\n" + Excp.Message);
						}
					}
				try
					{
					Services.CreateStandbildPlayingData(WMB.Basics.WPMediaServerRootDirectory,
						RootDirectoryForEntryGeneration, AvailableTableName, tableDefinitionRow);
					}
				catch (Exception Excp)
					{
					WMB.Basics.ReportErrorToEventViewer("CreateStandbildTVUnits.Create",
						"Bei Aufruf von \"Services.CreateStandbildPlayingData\" für die Tabelle  \"" + AvailableTableName
							+ "\" trat folgender Fehler auf:\r\n" + Excp.Message);
					}

				if (CVM.CommonValues.IsTestRun)
					{
					int NumberOfFiles = WMB.Basics.GetFilesFromDirectory
						(Path.Combine(RootDirectoryForEntryGeneration, AvailableTableName), new string[] { "*.pkg" }, 1).Count;
					WMB.Basics.ReportInformationToEventViewer("WPMediaCreateStandBildTVUnits.Create",
								 AvailableTableName + ", " + ProcessingVersion + " Creation Loop - ended"
								 + "\r\nNumberOfFiles = " + Convert.ToString(NumberOfFiles));
					}
				}
			String WPMediaConnectionStringName = WMB.Basics.GetUserConfigurationSettingsValue ("WPMediaConnectionStringName");
			String WPMediaAddOnDataConnectionStringName = WMB.Basics.GetUserConfigurationSettingsValue("WebConnectionStringName");
			Services.HandleTheDescriptionFileDataBaseInformations(WPMediaConnectionStringName, WPMediaAddOnDataConnectionStringName);
			return ModifiedEntries;
			}