From: Vásáry Dániel Date: Thu, 2 Nov 2017 14:00:00 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=9660396eccb3e87db0fcb73a631112b3fd3be9f4;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30683 --- diff --git a/client/DxPlay/App.ico b/client/DxPlay/App.ico deleted file mode 100644 index 3a5525fd..00000000 Binary files a/client/DxPlay/App.ico and /dev/null differ diff --git a/client/DxPlay/DxPlay.csproj b/client/DxPlay/DxPlay.csproj index 9057acb4..107cb7ff 100644 --- a/client/DxPlay/DxPlay.csproj +++ b/client/DxPlay/DxPlay.csproj @@ -6,7 +6,7 @@ {0B44B3D7-52D7-4C0E-9B1C-F48CEEDA36FE} Debug AnyCPU - App.ico + maestro.ico DxPlay @@ -216,7 +216,6 @@ Component - Code @@ -227,6 +226,7 @@ PlayerForm.cs + PreserveNewest diff --git a/client/DxPlay/maestro.ico b/client/DxPlay/maestro.ico new file mode 100644 index 00000000..e81b6ff6 Binary files /dev/null and b/client/DxPlay/maestro.ico differ diff --git a/client/Maestro/Configuration/configuration-playout.json b/client/Maestro/Configuration/configuration-playout.json index abf37876..27f522f0 100644 --- a/client/Maestro/Configuration/configuration-playout.json +++ b/client/Maestro/Configuration/configuration-playout.json @@ -1,6 +1,6 @@ { "title": "Adáslebony", - "active": true, + "active": false, "startInTray": true, "enableCustomMetadataId": true, "player": { diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index abd8d0da..a956c42f 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -75,7 +75,7 @@ - Resources\mediacube_logo_small.ico + maestro.ico true @@ -293,9 +293,6 @@ PreserveNewest - - - @@ -326,8 +323,8 @@ - + diff --git a/client/Maestro/Program.cs b/client/Maestro/Program.cs index 158b8073..676ae4fa 100644 --- a/client/Maestro/Program.cs +++ b/client/Maestro/Program.cs @@ -82,15 +82,15 @@ namespace Maestro { private void CreateForms() { string[] files = Directory.GetFiles("./Configuration", "*.json"); if (files.Length == 0) { - MessageBox.Show("Hiányos konfiguráció!"); - Application.Exit(); + MessageBox.Show(new Form() { TopMost = true }, "Nincs aktív konfiguráció!"); + TerminateApplication(); } foreach (String file in files) { CreateForm(file); } if (forms.Count == 0) { MessageBox.Show(new Form() { TopMost = true }, "Nincs aktív konfiguráció!"); - //TerminateApplication(); + TerminateApplication(); } } diff --git a/client/Maestro/Resources/installforge-installer-project.ifp b/client/Maestro/Resources/installforge-installer-project.ifp index a64b33d3..ef230307 100644 Binary files a/client/Maestro/Resources/installforge-installer-project.ifp and b/client/Maestro/Resources/installforge-installer-project.ifp differ diff --git a/client/Maestro/maestro.ico b/client/Maestro/maestro.ico new file mode 100644 index 00000000..e81b6ff6 Binary files /dev/null and b/client/Maestro/maestro.ico differ diff --git a/client/PasswordEncrypter/PasswordEncrypter.csproj b/client/PasswordEncrypter/PasswordEncrypter.csproj index 7feb5536..bcbcbde6 100644 --- a/client/PasswordEncrypter/PasswordEncrypter.csproj +++ b/client/PasswordEncrypter/PasswordEncrypter.csproj @@ -55,6 +55,9 @@ MinimumRecommendedRules.ruleset true + + maestro.ico + @@ -74,5 +77,8 @@ + + + \ No newline at end of file diff --git a/client/PasswordEncrypter/maestro.ico b/client/PasswordEncrypter/maestro.ico new file mode 100644 index 00000000..e81b6ff6 Binary files /dev/null and b/client/PasswordEncrypter/maestro.ico differ diff --git a/server/-configuration/run-mediacube-server-bsh.launch b/server/-configuration/run-mediacube-server-bsh.launch index 84984baa..f957593d 100644 --- a/server/-configuration/run-mediacube-server-bsh.launch +++ b/server/-configuration/run-mediacube-server-bsh.launch @@ -19,7 +19,7 @@ - + diff --git a/server/-configuration/scheduledjobs.json b/server/-configuration/scheduledjobs.json index a872b482..58bc474b 100644 --- a/server/-configuration/scheduledjobs.json +++ b/server/-configuration/scheduledjobs.json @@ -64,7 +64,7 @@ ] }, { - "active": true, + "active": false, "name" : "OCTOPUS adatok szinkronizálása", "template": "sync-octopus.xml", "executeimmediate": true, diff --git a/server/user.jobengine.executors/jobtemplates/retrieve-material.xml b/server/user.jobengine.executors/jobtemplates/retrieve-material.xml index 6f381175..b36cf922 100644 --- a/server/user.jobengine.executors/jobtemplates/retrieve-material.xml +++ b/server/user.jobengine.executors/jobtemplates/retrieve-material.xml @@ -5,6 +5,7 @@ + @@ -19,6 +20,9 @@ + + + diff --git a/server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml b/server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml index 10f7884c..53807a42 100644 --- a/server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml +++ b/server/user.jobengine.executors/jobtemplates/retrieve-ondemand.xml @@ -2,10 +2,12 @@ - - + + + + @@ -16,7 +18,13 @@ - + + + + + + + @@ -42,6 +50,9 @@ + + + diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java index 7e494610..8071c713 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckMORPHEUSMissingMaterialsStep.java @@ -23,11 +23,12 @@ import user.jobengine.server.IJobRuntime; public class CheckMORPHEUSMissingMaterialsStep extends JobStep { private static final Logger logger = LogManager.getLogger(); - private static final String TARGET_NAME_PATTERN = "targetNamePattern"; + private static final String SUCCESSRECIPIENT = "successRecipient"; + private static final String TARGETNAMEPATTERN = "targetNamePattern"; private static final String MATERIAL_ID = "Material ID"; private static final String RETRIEVE_MATERIAL = "Adásanyag visszatöltés"; - private static final String TARGET_PATH = "targetPath"; - private static final String MEDIA_CUBE_MEDIA = "mediaCubeMedia"; + private static final String TARGETPATH = "targetPath"; + private static final String MEDIACUBEMEDIA = "mediaCubeMedia"; private static final String JOBTEMPLATE = "retrieve-material.xml"; private static final String CSV_EXT = ".csv"; private String targetPath; @@ -65,7 +66,8 @@ public class CheckMORPHEUSMissingMaterialsStep extends JobStep { return; } - jobEngine.submit(JOBTEMPLATE, RETRIEVE_MATERIAL, ListUtils.asMap(MEDIA_CUBE_MEDIA, medias.get(0), TARGET_PATH, targetPath, TARGET_NAME_PATTERN, "%s")); + jobEngine.submit(JOBTEMPLATE, RETRIEVE_MATERIAL, + ListUtils.asMap(MEDIACUBEMEDIA, medias.get(0), TARGETPATH, targetPath, TARGETNAMEPATTERN, "%s", SUCCESSRECIPIENT, null)); } private void processMissingMaterialCSV(Path csvFilePath) throws Exception { diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java index d4f096e6..39c1648f 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CheckTrafficMissingMaterialsStep.java @@ -26,6 +26,7 @@ public class CheckTRAFFICMissingMaterialsStep extends JobStep { private static final String SQLSERVER_JDBC_SQL_SERVER_DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver"; private static final String SQL = "{call dbo.clIFsp_EC_MAM(1001, 32, Null, Null, ?)}"; private static final String JOBTEMPLATE = "retrieve-material.xml"; + private static final String SUCCESSRECIPIENT = "successRecipient"; @StepEntry public Object[] execute(String dbUrl, String userName, String password, int lookupDays, String targetPath, IJobEngine jobEngine, IJobRuntime jobRuntime) @@ -82,7 +83,8 @@ public class CheckTRAFFICMissingMaterialsStep extends JobStep { } String title = "Traffic adásanyag visszatöltés: " + trafficId; - jobEngine.submit(JOBTEMPLATE, title, ListUtils.asMap(MEDIA_CUBE_MEDIA, medias.get(0), TARGET_PATH, targetPath, TARGET_NAME_PATTERN, "%s")); + jobEngine.submit(JOBTEMPLATE, title, + ListUtils.asMap(MEDIA_CUBE_MEDIA, medias.get(0), TARGET_PATH, targetPath, TARGET_NAME_PATTERN, "%s", SUCCESSRECIPIENT, null)); } } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/OutputPathAndNameSelectorStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/OutputPathAndNameSelectorStep.java index eab9db4d..e24df838 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/OutputPathAndNameSelectorStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/OutputPathAndNameSelectorStep.java @@ -1,34 +1,74 @@ package user.jobengine.server.steps; +import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import user.jobengine.db.Media; import user.jobengine.server.IJobEngine; import user.jobengine.server.IJobRuntime; -/** - * Elinditja minden mediara az archivalo folyamatot. - * - * @author robi - */ public class OutputPathAndNameSelectorStep extends JobStep { - private static final String ARCHIVE = "Archiválás"; - private static final String GLOBAL_SOURCE_PATH = "globalSourcePath"; + private enum MetadataType { + TRAFFIC, OCTOPUS, GENERIC + } + + private static final String TARGETNAMEPATTERN = "-ARCH-%s"; + private static final Logger logger = LogManager.getLogger(); - private static final String JOBTEMPLATE = "archive-material.xml"; - private static final String ARCHIVE_ITEM = "archiveItem"; + private static final String REGEXP_TRAFFIC = "^[MRP]{1}[0-9]{6}[A-Z]{1}$"; + private static final String REGEXP_OCTOPUSPLACEHOLDERID = "^[0-9]+_[0-9]+$"; + private static final String REGEXP_OCTOPUSPLACEHOLDERVERSIONEDID = "^[0-9]+_[0-9]+-[0-9]{3}$"; + + private void check(String trafficOutputPath, String octopusOutputPath, String genericOutputPath, String houseId) { + if (StringUtils.isBlank(trafficOutputPath)) { + logger.error(getMarker(), "A folyamat 'trafficOutputPath' bemeneti paramétere üres."); + throw new NullPointerException("System is not configured properly, 'trafficOutputPath' input parameter missing."); + } + if (StringUtils.isBlank(octopusOutputPath)) { + logger.error(getMarker(), "A folyamat 'octopusOutputPath' bemeneti paramétere üres."); + throw new NullPointerException("System is not configured properly, 'octopusOutputPath' input parameter missing."); + } + if (StringUtils.isBlank(genericOutputPath)) { + logger.error(getMarker(), "A folyamat 'genericOutputPath' bemeneti paramétere üres."); + throw new NullPointerException("System is not configured properly, 'genericOutputPath' input parameter missing."); + } + if (StringUtils.isBlank(houseId)) { + logger.error(getMarker(), "A folyamat 'houseId' bemeneti paramétere üres."); + throw new NullPointerException("System is not configured properly, 'houseId' input parameter missing."); + } + } @StepEntry - public Object[] execute(Media mediaCubeMedia, String houseId, IJobEngine jobEngine, IJobRuntime jobRuntime) { - String targetPath = ""; - String targetNamePattern = ""; + public Object[] execute(String trafficOutputPath, String octopusOutputPath, String genericOutputPath, String houseId, IJobEngine jobEngine, + IJobRuntime jobRuntime) { + check(trafficOutputPath, octopusOutputPath, genericOutputPath, houseId); - try { - } catch (Exception e) { - logger.catching(e); + String id = houseId.toUpperCase(); + MetadataType mdType = GuessMetadataType(id); + String targetPath = null; + switch (mdType) { + case GENERIC: + targetPath = genericOutputPath; + break; + case OCTOPUS: + targetPath = octopusOutputPath; + break; + case TRAFFIC: + targetPath = genericOutputPath; + break; } + String targetNamePattern = houseId + TARGETNAMEPATTERN; return new Object[] { targetPath, targetNamePattern }; } + private MetadataType GuessMetadataType(String id) { + if (id.matches(REGEXP_TRAFFIC)) + return MetadataType.TRAFFIC; + if (id.matches(REGEXP_OCTOPUSPLACEHOLDERID)) + return MetadataType.OCTOPUS; + if (id.matches(REGEXP_OCTOPUSPLACEHOLDERVERSIONEDID)) + return MetadataType.OCTOPUS; + return MetadataType.GENERIC; + } + } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java index 60774550..a82c3cd5 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TSMRestoreStep.java @@ -5,7 +5,9 @@ import java.util.List; import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.Marker; +import user.commons.MediaCubeMarker; import user.commons.RemoteFile; import user.commons.StoreUri; import user.commons.remotestore.IProgressEventListener; @@ -28,7 +30,8 @@ public class TSMRestoreStep extends JobStep { private String sourceFileName; @StepEntry - public Object[] execute(Media mediaCubeMedia, String targetPath, String targetNamePattern, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + public Object[] execute(Media mediaCubeMedia, String targetPath, String targetNamePattern, String successRecipient, IJobEngine jobEngine, + IJobRuntime jobRuntime) throws Exception { setAndCheck(mediaCubeMedia, targetPath, targetNamePattern, jobEngine); try { //TODO check file existance? @@ -52,17 +55,19 @@ public class TSMRestoreStep extends JobStep { logger.catching(e); throw e; } + + Marker marker = StringUtils.isBlank(successRecipient) ? getMarker() : new MediaCubeMarker(successRecipient); + logger.info(marker, ""); return null; } - private String getSourceFileName(Media mediaCubeMedia, Store targetStore) { + private String getSourceFileName(Media mediaCubeMedia, Store store) { List mediaFiles = mediaCubeMedia.getMediaFiles(); if (mediaFiles == null) return null; for (MediaFile mediaFile : mediaFiles) { - if (mediaFile.getStore().getId() == targetStore.getId()) { + if (mediaFile.getStore().getId() == store.getId()) return mediaFile.getRelativePath(); - } } return null; } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/UserNotificationStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/UserNotificationStep.java new file mode 100644 index 00000000..0886c95a --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/UserNotificationStep.java @@ -0,0 +1,19 @@ +package user.jobengine.server.steps; + +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.MediaCubeMarker; + +public class UserNotificationStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(String to, String notification) { + if (StringUtils.isNotBlank(to) && StringUtils.isNotBlank(notification)) + logger.info(new MediaCubeMarker(to), notification); + return null; + } + +} diff --git a/server/user.jobengine.osgi.server/pages/jobselector.zul b/server/user.jobengine.osgi.server/pages/jobselector.zul index f2202b80..9e794f6e 100644 --- a/server/user.jobengine.osgi.server/pages/jobselector.zul +++ b/server/user.jobengine.osgi.server/pages/jobselector.zul @@ -11,8 +11,8 @@ -     -       Â