// public int RunningIndex { get; set; } public MMUnitPresentationDataEntry(Information infoParent, ProcessConnector connector) { InfoParent = infoParent; Connector = connector; MMUnitToPresent = InfoParent.DataContext.MultiMedia.MMUnits.FindOrLoad(Connector.TableId); }
public static bool DeleteConnectedStandbildEntryViaStandBildManagement(ProcessConnector Connector) { Guid? DeletedRedaktionenId = null; String ReturnMessage = IOldToNewInterfaceInstance.DeleteStandBildEntry(Connector.InformationenId, Connector.InformationenAddOnId, Connector.Id, Connector.Redaktion, out DeletedRedaktionenId); Connector.TableId = Guid.Empty; Connector.InformationAddOn.FreiText = Connector.FreiText; return true; }
public static String CreateStandbildEntryViaStandBildManagement(ProcessConnector Connector) { if ((Connector.TableId != null) && (Connector.TableId != Guid.Empty)) return $"Es existiert schon ein aktiver {Connector.Redaktion} Eintrag"; Guid? CreatedRedaktionenId = null; String ReturnMessage = IOldToNewInterfaceInstance.CreateStandBildEntry(Connector.InformationenId, Connector.InformationenAddOnId, Connector.Id, Connector.Redaktion, out CreatedRedaktionenId); if ((String.IsNullOrEmpty(ReturnMessage)) && (CreatedRedaktionenId != null)) { Connector.TableId = CreatedRedaktionenId; Connector.InformationAddOn.FreiText = Connector.FreiText; } return ReturnMessage; }
public List<String> Get_MaterialElemente(ProcessConnector connector) { List<String> PictureElementeForThisInformation = new List<String>(); foreach (InformationAddOn infoAddOn in InformationenAddOnsOrdered) { if (infoAddOn.IsChaptered) { bool IsToProcess = false; foreach (ChapterBase usedChapter in connector.UsedChapters) { if (usedChapter.InformationenAddOnLinkedWithThisChapter.Contains(infoAddOn)) { IsToProcess = true; break; } } if (IsToProcess == false) continue; } if (infoAddOn.Tabelle == "Materialien") { Material material = infoAddOn.Get_ConnectedMaterial; String MaterialLink = material?.MaterialLink; if (!String.IsNullOrEmpty(MaterialLink)) PictureElementeForThisInformation.Add(MaterialLink.Trim()); } if (!String.IsNullOrEmpty(infoAddOn.TechnicalAddOn)) { String[] SingleTechnicalAddOn = infoAddOn.TechnicalAddOn.Split(';'); foreach (String SingleTechnicalAddOnEntry in SingleTechnicalAddOn) PictureElementeForThisInformation.Add(SingleTechnicalAddOnEntry.Trim()); } } return PictureElementeForThisInformation; }
// each Mapping is processed over all Data for one Information (= all InformationenAddOn) private void ProcessThisMapping(InformationAddOn InfoAddOn, DataRow NewRow, ProcessConnector ProcessConnectorToProcess, StandBildMapping Mapping, String PageIDToUse) { String InputString = GetInputString (InfoAddOn, Mapping); String TargetItemName = Mapping.TargetItem.Replace("?1", PageIDToUse); if (String.IsNullOrEmpty(TargetItemName)) return; if (TargetItemName == "*") return; if (!NewRow.Table.Columns.Contains(TargetItemName)) throw new Exception("Das TargetItem \"" + TargetItemName + "\" fehlt"); if (NewRow.Table.Columns[TargetItemName] == null) return; int MaxTargetLength = Convert.ToInt32(Mapping.MaxTargetLength); String AddContentAllowed = Mapping.AddContentAllowed; MoveToOrAdd (NewRow, TargetItemName, InputString, Mapping); }
private void ProcessAllMappingsForTypAndRedaktion (Typ activeTyp, DataRow newRow, ProcessConnector processConnectorToProcess, ChapterBase dynamicPageToCreateForThisRun, String pageIDToUse) { ObservableCollection<StandBildMapping> MappingsForThisTyp = null; if (processConnectorToProcess.Redaktion == "StandBild") MappingsForThisTyp = activeTyp.AvailableStandBildMappingsForStandBild; else if (processConnectorToProcess.Redaktion == "Banner") MappingsForThisTyp = activeTyp.AvailableStandBildMappingsForBanner; else MappingsForThisTyp = activeTyp.AvailableStandBildMappingsForAll; foreach (StandBildMapping Mapping in MappingsForThisTyp) { foreach (InformationAddOn InfoAddOn in InformationToProcess.InformationenAddOns) { if (Mapping.SourceDataDependencyId != InfoAddOn.DataDependencyId) continue; Profile.ActiveDataDependency = Profile.SetActiveDataDependencyViaId ((Guid)InfoAddOn.DataDependencyId); if ((Profile.ActiveDataDependency.DataElementeTemplate.UseMultiple == "Yes") && (pageIDToUse != "1")) continue; ProcessThisMapping(InfoAddOn, newRow, processConnectorToProcess, Mapping, pageIDToUse); #if DEBUG DoMappingTrace("After Standard Mapping", newRow, Mapping); #endif } if (dynamicPageToCreateForThisRun != null) foreach (InformationAddOn InfoAddOn in dynamicPageToCreateForThisRun.InformationenAddOnLinkedWithThisChapter) { if (Mapping.SourceDataDependencyId != InfoAddOn.DataDependencyId) continue; Profile.ActiveDataDependency = Profile.SetActiveDataDependencyViaId((Guid)InfoAddOn.DataDependencyId); if (Profile.ActiveDataDependency.DataElementeTemplate.UseMultiple != "Yes") throw new Exception("Profile.ActiveFullDataDependency.UseMultiple != \"Yes\""); ProcessThisMapping(InfoAddOn, newRow, processConnectorToProcess, Mapping, pageIDToUse); #if DEBUG DoMappingTrace("After Chapter Mapping", newRow, Mapping); #endif } } }
private void ProcessThisMappingGroup(Guid activeTypId, DataRow newRow, ProcessConnector processConnectorToProcess) { Typ activeTyp = processConnectorToProcess.Information.Typ; int pageIndex = 0; if (processConnectorToProcess.UsedChapters.Count > 0) { while (pageIndex < processConnectorToProcess.UsedChapters.Count) { ProcessAllMappingsForTypAndRedaktion (activeTyp, newRow, processConnectorToProcess, processConnectorToProcess.UsedChapters[pageIndex], Convert.ToString(pageIndex + 1)); pageIndex++; } } else { ProcessAllMappingsForTypAndRedaktion (activeTyp, newRow, processConnectorToProcess, (ChapterBase) null, Convert.ToString(pageIndex + 1)); } CheckAndCorrectEmptyPages(newRow); }
public bool DoStandBildProgrammActivities (ProcessConnector Connector) { if (!(bool) StandBildProcessorStarted) { MessageBox.Show ("Der Processor für \"" + "StandBild" + "\" Verarbeitung ist nicht installiert"); return false; } if ((Connector.TableId == null) || ((System.Guid) Connector.TableId == Guid.Empty)) { MessageBox.Show ("Das verzweigen zur StandBild/Banner Wartung\r\ngeht nur dann, wenn auch ein\r\n" + "Element angelegt ist"); return false; } ExternalControlClient.PostToHandlerViaTableName (Connector.TableName, (System.Guid) Connector.TableId, "Modify"); return true; }
private bool CreateStandBildTableEntry (InformationAddOn infoAddOn, ProcessConnector connector, ExternalControlClient StartUpParameter, Timing actuallTerminEntry, int DaysBackForAnzeigeTiming) { if ((connector.TableId != null) && (connector.TableId != System.Guid.Empty)) { MessageBox.Show ("der gewählte Eintrag ist technisch nicht in Ordnung\r\n" + "\"Connector.TableID != null\r\n" + "Bitte löschen Sie diesen Eintrag, oder treten Sie diesbezüglich\r\n" + "mit WPMedia in Kontakt"); return false; } if (connector.InformationenId != InformationToProcess.Id) { MessageBox.Show("Ein Schwerer Fehler ist aufgetreten\r\n" + "connector.InformationenID != DataModell.ActiveInformationen.ID\r\n" + "Abbruch!!"); throw new Exception("connector.InformationenID != DataModell.ActiveInformationen.ID"); } ProcessConnectorToWorkWith = connector; CsDbTableBase DynamicTargetTable = Data.DbServer3.WPMediaAddOnData.GetTableByName(connector.TableName); List<DataRow> RowsToDelete = new List<DataRow>(); foreach (DataRow dataRow in DynamicTargetTable.Rows) { RowsToDelete.Add(dataRow); } foreach (DataRow dataRow in RowsToDelete) { dataRow.Delete(); } DynamicTargetTable.AcceptChanges(); DynamicTargetTable.HasBeenLoaded = true; DynamicTargetTable.Generic_DownloadRows ($"Select * from {connector.TableName} where NameID = '{connector.NameId.Replace("'", "''")}'"); DynamicTargetTable.HasBeenLoaded = true; foreach (DataRow dataRow in DynamicTargetTable.Rows) { if (dataRow["NameID"].ToString() == connector.NameId) { MessageBox.Show($"Der Eintrag\r\n\"{connector.NameId}\"\r\nist schon vorhanden, " + $"diesen Namen bitte ändern"); return false; } } connector.TableId = System.Guid.NewGuid (); DataRow NewRow = DynamicTargetTable.NewRow (); NewRow ["ID"] = connector.TableId; NewRow ["NameID"] = connector.NameId; Profile.ActiveTyp = InformationToProcess.Typ; if (Profile.ActiveRedaktion != connector.Redaktion) throw new Exception ("Profile.ActiveRedaktion != Connector.Redaktion"); try { ProcessThisMappingGroup(Profile.ActiveTyp.Id, NewRow, connector); } catch (Exception Excp) { throw new Exception("ProcessThisMappingGroup (Version 2.0) brachte Fehler:\r\n" + Excp.ToString()); } if (NewRow.Table.Columns.Contains("TemplateName")) { if (!String.IsNullOrEmpty(connector.TemplateNameDecorated)) NewRow["TemplateName"] = connector.TemplateNameDecorated; } if (NewRow.Table.Columns.Contains("LastUpdateToken")) NewRow ["LastUpdateToken"] = Basics.GetNextLastUpdateTokenHelper (); NewRow ["ModifyTimeStamp"] = DateTime.Now; NewRow ["ProcessingStatus"] = "InternetPublishingPending;TVPublishingPending"; NewRow.Table.Rows.Add (NewRow); CreateAndLocallyImportStandBildTimingsEntry (Data.DbServer3.WPMediaAddOnData.Timings, NewRow, actuallTerminEntry, DaysBackForAnzeigeTiming); DynamicTargetTable.DataSet.SaveAnabolic(new Object()); DynamicTargetTable.DataSet.AcceptChanges(); CreatedStandBildGuid = connector.TableId = (Guid) NewRow ["ID"]; CommonSearchClass HandledEntry = null; infoAddOn.FreiText = connector.FreiText; if ((connector.InformationenId != InformationToProcess.Id) || (connector.InformationenAddOnId != infoAddOn.Id)) throw new Exception("((connector.InformationenId != InformationToProcess.Id)\r\n" + "|| (connector.InformationenAddOnId = infoAddOn.Id))"); Data.DbServer3.AltErlaaInfo.SaveUnspecific(new Object()); Data.DbServer3.AltErlaaInfo.AcceptChanges(); //if (!RunningAsOldToNew) // DataModell.UpdateWorkDataSet (RequiredUpdateFunction.Modify, ref HandledEntry); //else // DataModell.WorkDataSet.AcceptChanges(); String WPMediaPackageRoot = System.IO.Path.Combine (Basics.GetLocalWPMediaRoot (), Basics.XML_AUTO_CONTENT_SOURCE); String LocalPackageFileName = System.IO.Path.Combine (WPMediaPackageRoot, System.IO.Path.Combine (WPMediaPackageRoot, Path.Combine (connector.TableName, NewRow ["ID"].ToString () + ".pkg"))); int NumberOfPlayablePages; if (String.Compare (LocalPackageFileName, CreateLocalPackage (connector.TableName, ((System.Guid) connector.TableId).ToString (), out NumberOfPlayablePages), StringComparison.InvariantCultureIgnoreCase) != 0) throw new Exception ("StandBildCreation - LocalPackageFileName != CreatedName"); SetNumberOfPages (connector.TableName, ((System.Guid) connector.TableId).ToString (), NewRow, NumberOfPlayablePages); if ((NewRow.Table.Columns ["TemplateName"] != null) && (!String.IsNullOrEmpty (NewRow ["TemplateName"].ToString ()))) CreatePackageCheckAndDoTemplatingIfRequired (LocalPackageFileName, NewRow); List<String> PictureElementeForThisInformationID = InformationToProcess.Get_MaterialElemente(connector); CheckAndDoPictureImportIfRequired (NewRow, PictureElementeForThisInformationID); WMB.DataWrapper.Instance.DoCentralFileUpdate (LocalPackageFileName); DoStandBildProgrammActivities (connector); return true; }
public ProcessConnectorModell(ProcessConnector processConnector) { ProcessConnectorToProcess = processConnector; InformationAddOnToProcess = processConnector.InformationAddOn; }