From: Vásáry Dániel Date: Wed, 24 Jun 2020 12:56: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=2ef4e51b9aae7a5dc301d40adcf70d3544b5fc78;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31864 --- diff --git a/server/-configuration/AMC/scheduledjobs.json b/server/-configuration/AMC/scheduledjobs.json new file mode 100644 index 00000000..35fa1db5 --- /dev/null +++ b/server/-configuration/AMC/scheduledjobs.json @@ -0,0 +1,315 @@ +{"joblist":[ + { + "active": false, + "executeimmediate": false, + "cronexpression": "0/10 * * * * ? *", + "template": "worker-keepalive.xml", + "parameters": [ + {"name": "masterAddress", "value": "localhost", "type": "java.lang.String"} + ] + }, + { + "template": "cancelable.xml" + }, + { + "template": "submit-child.xml" + }, + { + "name" : "Proxy pótlása", + "template": "create-lowres-ondemand.xml", + "parameters": [ + {"name": "globalRetrievePath", "value": "file://isilon.intra.echotv.hu", "type": "java.lang.String"}, + {"name": "localRetrievePath", "value": "/mnt/ISILON", "type": "java.lang.String"}, + {"name": "localHiresPath", "value": "/mediacube/data/lowres/", "type": "java.lang.String" }, + {"name": "globalHiresPath", "value": "L:\\", "type": "java.lang.String" }, + {"name": "localLowresPath", "value": "/mnt/FIXTRANSCODER/OUTPUT", "type": "java.lang.String" }, + {"name": "transcoderAddress", "value": "http://10.10.1.74:65445/api/json/v1/", "type": "java.lang.String"}, + {"name": "transcoderTemplateName", "value": "MAM_proxy", "type": "java.lang.String"}, + {"name": "webPath", "value": "/mediacube/data/lowres/www/video/", "type": "java.lang.String" } + ] + }, + { + "name" : "sys: Migrate HSM", + "template": "migrate-hsm.xml", + "parameters": [ + {"name": "sourceLocation", "value": "//10.11.1.89", "type": "java.lang.String"}, + {"name": "targetLocation", "value": "c:/_video", "type": "java.lang.String"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "SYS: recreate-lowres", + "template": "sys-recreate-lowres.xml", + "parameters": [ + {"name": "localHiresPath", "value": "", "type": "java.lang.String" }, + {"name": "globalRetrievePath", "value": "", "type": "java.lang.String" } + ] + }, + { + "name" : "SYS: batch-retrieve-ondemand", + "template": "batch-retrieve-ondemand.xml" + }, + { + "name" : "SYS: retrieve-ondemand", + "template": "retrieve-ondemand.xml", + "parameters": [ + {"name": "globalRetrievePath", "value": "c:\\temp", "type": "java.lang.String"}, + {"name": "localRetrievePath", "value": "c:\\temp", "type": "java.lang.String"}, + {"name": "materialOutputFolder", "value": "PLAYOUT_NLE", "type": "java.lang.String"}, + {"name": "promoOutputFolder", "value": "PROMO_NLE", "type": "java.lang.String"}, + {"name": "advertisementOutputFolder", "value": "REKLAM_NLE", "type": "java.lang.String"}, + {"name": "octopusOutputFolder", "value": "OCTOPUS", "type": "java.lang.String"}, + {"name": "genericOutputFolder", "value": "ARCHIVE_RESTORE", "type": "java.lang.String"}, + {"name": "onlineOutputFolder", "value": "ONLINE", "type": "java.lang.String"}, + {"name": "killDateDays", "value": 7, "type": "java.lang.Integer"}, + {"name": "nexioAgency", "value": "ARCHIVE_RESTORE", "type": "java.lang.String"}, + {"name": "nexioPort", "value": 2098, "type": "java.lang.Integer"}, + {"name": "nexioUserName", "value": "administrator", "type": "java.lang.String"}, + {"name": "nexioPassword", "value": "system", "type": "java.lang.String"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Multiparam", + "template": "test-multiparam.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "p1", "value": 1, "type": "java.lang.Long"}, + {"name": "p2", "value": "x", "type": "java.lang.String"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Visszarögzített anyagok utólagos archiválása", + "template": "archive-recording.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "sourcePath", "value": "\\\\10.10.254.74\\temp_isilon\\NEXIO", "type": "java.lang.String"}, + {"name": "targetPath", "value": "\\\\10.10.1.74\\MAM-Proxy_input", "type": "java.lang.String"}, + {"name": "nexioPort", "value": 2098, "type": "java.lang.Integer"}, + {"name": "nexioUserName", "value": "administrator", "type": "java.lang.String"}, + {"name": "nexioPassword", "value": "system", "type": "java.lang.String"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Híranyag statisztika importálása", + "template": "import-statistics.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "daysBeforeNow", "value": 7, "type": "java.lang.Integer"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "MORPHEUS 'missing materials' importálása", + "template": "sys-import-morpheus-missing-materials.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "csvFilePath", "value": "c:\\temp\\__", "type": "java.lang.String"}, + {"name": "processedFolder", "value": "DONE", "type": "java.lang.String"}, + {"name": "targetPath", "value": "/mnt/ISILON/ARCHIVE_RESTORE", "type": "java.lang.String"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Archiválás az ISILON/ARCHIVE mappából", + "template": "archive-ondemand.xml", + "cronexpression": "0 0 23 * * ?", + "parameters": [ + {"name": "sourcePath", "value": "/mnt/ISILON/ARCHIVE", "type": "java.lang.String"}, + {"name": "globalSourcePath", "value": "\\\\10.10.1.100\\BRAAVOS\\ARCHIVE", "type": "java.lang.String"}, + {"name": "transcoderTargetPath", "value": "/mnt/SELENIO", "type": "java.lang.String"}, + {"name": "webPath", "value": "/mediacube/data/lowres/www/video", "type": "java.lang.String"}, + {"name": "killDateDays", "value": 1, "type": "java.lang.Integer"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Egy archiválás", + "template": "archive-ondemand.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "sourcePath", "value": "/mnt/ISILON/ARCHIVE/ONE", "type": "java.lang.String"}, + {"name": "globalSourcePath", "value": "\\\\10.10.1.100\\BRAAVOS\\ARCHIVE\\ONE", "type": "java.lang.String"}, + {"name": "transcoderTargetPath", "value": "/mnt/SELENIO", "type": "java.lang.String"}, + {"name": "webPath", "value": "/mediacube/data/lowres/www/video", "type": "java.lang.String"}, + {"name": "killDateDays", "value": 1, "type": "java.lang.Integer"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "NEXIO bejátszók másolása az ISILON/ARCHIVE mappába", + "template": "copyforarchive-nexio-materials.xml", + "cronexpression": "0 0 10 * * ?", + "parameters": [ + {"name": "nexioPort", "value": 2098, "type": "java.lang.Integer"}, + {"name": "nexioUserName", "value": "administrator", "type": "java.lang.String"}, + {"name": "nexioPassword", "value": "system", "type": "java.lang.String"}, + {"name": "archiveFtp", "value": "ftp://10.10.1.100/ARCHIVE", "type": "java.lang.String"}, + {"name": "archiveUserName", "value": "mediacube", "type": "java.lang.String"}, + {"name": "archivePassword", "value": "Broadca5T", "type": "java.lang.String"}, + {"name": "daysBeforeNow", "value": 1, "type": "java.lang.Integer"}, + {"name": "nexioKillDateDays", "value": 7, "type": "java.lang.Integer"}, + {"name": "nexioAgency", "value": "ARCHIVED", "type": "java.lang.String"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "NEXIO visszarögzített anyagok másolása az ISILON/ARCHIVE mappába", + "template": "copyforarchive-nexio-recordings.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "nexioPort", "value": 2098, "type": "java.lang.Integer"}, + {"name": "nexioUserName", "value": "administrator", "type": "java.lang.String"}, + {"name": "nexioPassword", "value": "system", "type": "java.lang.String"}, + {"name": "archiveFtp", "value": "ftp://10.10.1.100/ARCHIVE", "type": "java.lang.String"}, + {"name": "archiveUserName", "value": "mediacube", "type": "java.lang.String"}, + {"name": "archivePassword", "value": "Broadca5T", "type": "java.lang.String"}, + {"name": "filterAgencies", "value": "schedule-rec", "type": "java.lang.String"}, + {"name": "limit", "value": 10, "type": "java.lang.Integer"}, + {"name": "nexioKillDateDays", "value": 7, "type": "java.lang.Integer"}, + {"name": "nexioAgency", "value": "ARCHIVED", "type": "java.lang.String"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Lejárt NEXIO anyagok törlése", + "template": "delete-nexio-materials.xml", + "cronexpression": "0 0 10 * * ?", + "parameters": [ + {"name": "port", "value": 2098, "type": "java.lang.Integer"}, + {"name": "userName", "value": "administrator", "type": "java.lang.String"}, + {"name": "password", "value": "system", "type": "java.lang.String"}, + {"name": "filterAgencies", "value": "ARCHIVED", "type": "java.lang.String"}, + {"name": "gracePeriodDays", "value": 1, "type": "java.lang.Integer"}, + {"name": "notificationOnly", "value": true, "type": "java.lang.Boolean"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "TRAFFIC anyagok visszatöltése", + "template": "retrieve-traffic-missing-materials.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "dbUrl", "value": "jdbc:sqlserver://10.10.1.45\\sql16;databaseName=PA_Echo;", "type": "java.lang.String"}, + {"name": "userName", "value": "MAM", "type": "java.lang.String"}, + {"name": "password", "value": "Echotv.hu", "type": "java.lang.String"}, + {"name": "lookupDays", "value": 7, "type": "java.lang.Integer"}, + {"name": "targetPath", "value": "/mnt/ISILON/PLAYOUT/IceGateway/Input", "type": "java.lang.String"}, + {"name": "killDateDays", "value": 10, "type": "java.lang.Integer"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "MORPHEUS anyagok visszatöltése", + "template": "retrieve-morpheus-missing-materials.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "sourcePath", "value": "/mnt/MORPHEUS", "type": "java.lang.String"}, + {"name": "targetPath", "value": "/mnt/ISILON/PLAYOUT/IceGateway/Input", "type": "java.lang.String"}, + {"name": "killDateDays", "value": 10, "type": "java.lang.Integer"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Lejárt ISISLON/ARCHIVE anyagok törlése", + "template": "delete-materials.xml", + "cronexpression": "0 0 5 * * ?", + "parameters": [ + {"name": "sourcePath", "value": "/mnt/ISILON/ARCHIVE", "type": "java.lang.String"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "OCTOPUS adatok szinkronizálása", + "template": "sync-octopus.xml", + "cronexpression": "0/20 * * * * ?", + "parameters": [ + {"name": "includeArchived", "value": false, "type": "java.lang.Boolean"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "OCTOPUS adatok szinkronizálása archivált tükrökkel együtt", + "template": "sync-octopus.xml", + "cronexpression": "0/30 * * * * ?", + "parameters": [ + {"name": "includeArchived", "value": true, "type": "java.lang.Boolean"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Párhuzamosított teszt folyamat", + "template": "fake-concurrent.xml", + "cronexpression": "0/10 * * ? * *", + "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Teszt folyamat (nincs paraméter)", + "template": "fake-noparams.xml", + "cronexpression": "0 40 22 * * ?", + "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Teszt folyamat", + "template": "fake.xml", + "cronexpression": "0/20 * * * * ?", + "parameters": [ + {"name": "itemID", "value": 1, "type": "java.lang.Long"}, + {"name": "iter", "value": ["a", "b", "c"], "type": "java.lang.Iterable"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "", + "cronexpression": "", + "template": "retrieve-ondemand.xml", + "parameters": [ + {"name": "trafficOutputPath", "value": "/mnt/ISILON/PLAYOUT_NLE", "type": "java.lang.String"}, + {"name": "octopusOutputPath", "value": "/mnt/ISILON/OCTOPUS", "type": "java.lang.String"}, + {"name": "genericOutputPath", "value": "/mnt/ISILON/ARCHIVE_RESTORE", "type": "java.lang.String"}, + {"name": "basket", "type": "java.lang.ArrayList"}, + {"name": "houseId", "type": "java.lang.String"}, + {"name": "successRecipient", "type": "java.lang.String"}, + {"name": "killDateDays", "type": "java.lang.Integer"} + ] + }, + { + "active": false, + "executeimmediate": false, + "name" : "Common file copy", + "template": "common-copy.xml", + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "sourcePath", "value": "10.10.1.100/ARCHIVE", "type": "java.lang.String"}, + {"name": "targetPath", "value": "10.10.1.100/TEMP", "type": "java.lang.String"}, + {"name": "sourceFileName", "value": "akarmi.mp4", "type": "java.lang.String"}, + {"name": "targetFileName", "value": "barmi.mp4", "type": "java.lang.String"}, + {"name": "sourceProtocol", "value": "http://", "type": "java.lang.String"}, + {"name": "targetProtocol", "value": "http://", "type": "java.lang.String"}, + ] + } +]} + diff --git a/server/-configuration/log4j2-test.xml b/server/-configuration/log4j2-test.xml index dd800b0a..a076d04d 100644 --- a/server/-configuration/log4j2-test.xml +++ b/server/-configuration/log4j2-test.xml @@ -7,10 +7,25 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/-configuration/run-mediacube-server-hirtv.launch b/server/-configuration/run-mediacube-server-hirtv.launch index 7cf76446..835b327e 100644 --- a/server/-configuration/run-mediacube-server-hirtv.launch +++ b/server/-configuration/run-mediacube-server-hirtv.launch @@ -22,7 +22,7 @@ - + diff --git a/server/-configuration/run-mediacube-server-mv.launch b/server/-configuration/run-mediacube-server-mv.launch index 4b613aea..f7f6d9f0 100644 --- a/server/-configuration/run-mediacube-server-mv.launch +++ b/server/-configuration/run-mediacube-server-mv.launch @@ -19,10 +19,10 @@ - + - + diff --git a/server/-configuration/run-mediacube-server-user.launch b/server/-configuration/run-mediacube-server-user.launch index 6168aa19..2d084b11 100644 --- a/server/-configuration/run-mediacube-server-user.launch +++ b/server/-configuration/run-mediacube-server-user.launch @@ -22,7 +22,7 @@ - + diff --git a/server/-configuration/scheduledjobs.json b/server/-configuration/scheduledjobs.json index 35fa1db5..948c8778 100644 --- a/server/-configuration/scheduledjobs.json +++ b/server/-configuration/scheduledjobs.json @@ -1,5 +1,18 @@ {"joblist":[ { + "template": "harris-missingmaterial-checker.xml", + "parameters": [ + {"name": "vicFiles", "value": ["/opt/PASA-DB/VIC/EDIT 10.VIC"], "type": "java.lang.Iterable"}, + {"name": "escortStoreName", "value": "LOCAL", "type": "java.lang.String"}, + {"name": "targetStoreName", "value": "LOCAL", "type": "java.lang.String"}, + {"name": "targetProtocol", "value": "FTP", "type": "java.lang.String"} + ] + }, + { + "template": "test-fork-cancelable.xml", + "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] + }, + { "active": false, "executeimmediate": false, "cronexpression": "0/10 * * * * ? *", diff --git a/server/-dependencies/jobengine.target b/server/-dependencies/jobengine.target index a8e09167..78bd1266 100644 --- a/server/-dependencies/jobengine.target +++ b/server/-dependencies/jobengine.target @@ -1,5 +1,5 @@ - + @@ -13,7 +13,7 @@ - + diff --git a/server/-dependencies/libs/db2jcc4.jar b/server/-dependencies/libs/db2jcc4.jar index ab7516fa..2bffab14 100644 Binary files a/server/-dependencies/libs/db2jcc4.jar and b/server/-dependencies/libs/db2jcc4.jar differ diff --git a/server/-dependencies/libs/db2jcc4.jar.old b/server/-dependencies/libs/db2jcc4.jar.old new file mode 100644 index 00000000..ab7516fa Binary files /dev/null and b/server/-dependencies/libs/db2jcc4.jar.old differ diff --git a/server/-dependencies/libs/db2jcc_license_cu.jar b/server/-dependencies/libs/db2jcc_license_cu.jar index aae778fc..3156fa04 100644 Binary files a/server/-dependencies/libs/db2jcc_license_cu.jar and b/server/-dependencies/libs/db2jcc_license_cu.jar differ diff --git a/server/-dependencies/libs/db2jcc_license_cu.jar.old b/server/-dependencies/libs/db2jcc_license_cu.jar.old new file mode 100644 index 00000000..aae778fc Binary files /dev/null and b/server/-dependencies/libs/db2jcc_license_cu.jar.old differ diff --git a/server/-dependencies/pom.xml b/server/-dependencies/pom.xml index 0cc4847f..971c11c9 100644 --- a/server/-dependencies/pom.xml +++ b/server/-dependencies/pom.xml @@ -36,7 +36,7 @@ libs/db2jcc4.jar com.ibm db2jcc4 - 4.19.26 + 4.26.14 jar @@ -218,7 +218,7 @@ com.ibm:nosql:4.19.26 - com.ibm:db2jcc4:4.19.26 + com.ibm:db2jcc4:4.26.14 org.slf4j:slf4j-simple:1.6.3 diff --git a/server/-product/mediacube.product b/server/-product/mediacube.product index c6a83a88..6abffb7b 100644 --- a/server/-product/mediacube.product +++ b/server/-product/mediacube.product @@ -104,7 +104,7 @@ - + diff --git a/server/hu.user.mediacube.executors.tests/tsmapi-1.1.dll b/server/hu.user.mediacube.executors.tests/tsmapi-1.1.dll new file mode 100644 index 00000000..b92868b4 Binary files /dev/null and b/server/hu.user.mediacube.executors.tests/tsmapi-1.1.dll differ diff --git a/server/user.jobengine.executors/config/config-worker.xml b/server/user.jobengine.executors/config/config-worker.xml index 8dcc0d3a..97f24d87 100644 --- a/server/user.jobengine.executors/config/config-worker.xml +++ b/server/user.jobengine.executors/config/config-worker.xml @@ -3,12 +3,14 @@ - + + + - + \ No newline at end of file diff --git a/server/user.jobengine.executors/config/config.xml b/server/user.jobengine.executors/config/config.xml index e0183cde..6f70a96d 100644 --- a/server/user.jobengine.executors/config/config.xml +++ b/server/user.jobengine.executors/config/config.xml @@ -1,8 +1,11 @@ + + + @@ -20,7 +23,6 @@ - diff --git a/server/user.jobengine.executors/config/scheduledjobs.json b/server/user.jobengine.executors/config/scheduledjobs.json index 41282496..040a1579 100644 --- a/server/user.jobengine.executors/config/scheduledjobs.json +++ b/server/user.jobengine.executors/config/scheduledjobs.json @@ -1,4 +1,8 @@ {"joblist":[ + { + "template": "test-fork-cancelable.xml", + "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] + }, { "name" : "Proxy pótlása", "template": "create-lowres-ondemand.xml", @@ -204,14 +208,6 @@ "name" : "Teszt folyamat", "template": "fake.xml", "cronexpression": "0/10 * * ? * *", - "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] - }, - { - "active": false, - "executeimmediate": false, - "name" : "Teszt fork-párhuzamosított folyamat", - "template": "fake-noparams.xml", - "cronexpression": "0 40 22 * * ?", "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] }, { diff --git a/server/user.jobengine.executors/jobtemplates/create-lowres-ondemand.xml b/server/user.jobengine.executors/jobtemplates/create-lowres-ondemand.xml index c00193cc..5dbdeb86 100644 --- a/server/user.jobengine.executors/jobtemplates/create-lowres-ondemand.xml +++ b/server/user.jobengine.executors/jobtemplates/create-lowres-ondemand.xml @@ -1,5 +1,5 @@ - + diff --git a/server/user.jobengine.executors/jobtemplates/fork-validate-and-archive.xml b/server/user.jobengine.executors/jobtemplates/fork-validate-and-archive.xml index a612bf78..d4461a87 100644 --- a/server/user.jobengine.executors/jobtemplates/fork-validate-and-archive.xml +++ b/server/user.jobengine.executors/jobtemplates/fork-validate-and-archive.xml @@ -2,20 +2,32 @@ - + + + + - + - + + + + + + + + + + diff --git a/server/user.jobengine.executors/jobtemplates/fork-validate-and-restore.xml b/server/user.jobengine.executors/jobtemplates/fork-validate-and-restore.xml new file mode 100644 index 00000000..63d2cb22 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/fork-validate-and-restore.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/generic-archive-checker.xml b/server/user.jobengine.executors/jobtemplates/generic-archive-checker.xml index 1252a67b..c321bee5 100644 --- a/server/user.jobengine.executors/jobtemplates/generic-archive-checker.xml +++ b/server/user.jobengine.executors/jobtemplates/generic-archive-checker.xml @@ -3,10 +3,10 @@ - + - + @@ -14,7 +14,7 @@ - + @@ -23,7 +23,7 @@ - + diff --git a/server/user.jobengine.executors/jobtemplates/nexio-missingmaterial-checker.xml b/server/user.jobengine.executors/jobtemplates/harris-missingmaterial-checker.xml similarity index 81% rename from server/user.jobengine.executors/jobtemplates/nexio-missingmaterial-checker.xml rename to server/user.jobengine.executors/jobtemplates/harris-missingmaterial-checker.xml index 19cddfec..060ecc31 100644 --- a/server/user.jobengine.executors/jobtemplates/nexio-missingmaterial-checker.xml +++ b/server/user.jobengine.executors/jobtemplates/harris-missingmaterial-checker.xml @@ -3,14 +3,14 @@ - + - + diff --git a/server/user.jobengine.executors/jobtemplates/nexio-archive-checker.xml b/server/user.jobengine.executors/jobtemplates/nexio-archive-checker.xml index 6d9240b2..063c4be1 100644 --- a/server/user.jobengine.executors/jobtemplates/nexio-archive-checker.xml +++ b/server/user.jobengine.executors/jobtemplates/nexio-archive-checker.xml @@ -1,10 +1,11 @@ - + - - + + + @@ -12,10 +13,13 @@ - + - + + + + diff --git a/server/user.jobengine.executors/jobtemplates/peablebeach-missingmaterial-checker.xml b/server/user.jobengine.executors/jobtemplates/peablebeach-missingmaterial-checker.xml new file mode 100644 index 00000000..f1fae0b8 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/peablebeach-missingmaterial-checker.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/fake-noparams.xml b/server/user.jobengine.executors/jobtemplates/test-fork-cancelable.xml similarity index 56% rename from server/user.jobengine.executors/jobtemplates/fake-noparams.xml rename to server/user.jobengine.executors/jobtemplates/test-fork-cancelable.xml index aaab8a3c..f3d21d6e 100644 --- a/server/user.jobengine.executors/jobtemplates/fake-noparams.xml +++ b/server/user.jobengine.executors/jobtemplates/test-fork-cancelable.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/server/user.jobengine.executors/jobtemplates/validate-and-archive.xml b/server/user.jobengine.executors/jobtemplates/validate-and-archive.xml index 099aeb1a..9882f40e 100644 --- a/server/user.jobengine.executors/jobtemplates/validate-and-archive.xml +++ b/server/user.jobengine.executors/jobtemplates/validate-and-archive.xml @@ -3,11 +3,12 @@ - + - - + + + @@ -18,13 +19,13 @@ - + - + @@ -34,34 +35,43 @@ - + + + + + + + - + - + - + - + + + + @@ -73,7 +83,7 @@ - + diff --git a/server/user.jobengine.executors/jobtemplates/validate-and-restore.xml b/server/user.jobengine.executors/jobtemplates/validate-and-restore.xml new file mode 100644 index 00000000..99e6e049 --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/validate-and-restore.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java index 67abe142..10c9ddd9 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CancelableStep.java @@ -29,11 +29,14 @@ public class CancelableStep extends JobStep { for (int i = 0; i < count; i++) { if (getJobRuntime().isWaitingCancel()) break; - Thread.sleep(100); + Thread.sleep(1000); setProgress((i + 1) * count); + // if (i == 5) + // throw new Exception("Test"); } } catch (Exception e) { e.printStackTrace(); + throw e; } // Path filePath = Paths.get("/mnt/ISILON/ARCHIVE_RESTORE/XXX/xxx-ARCH-209740793_2-207990326.MXF"); diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/EscortFiles.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/EscortFiles.java index 6cb3dfb3..5c7a0251 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/EscortFiles.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/EscortFiles.java @@ -39,7 +39,7 @@ import user.commons.StoreUri; import user.commons.remotestore.FtpDirectoryLister; public class EscortFiles { - private static final String DOT_JSON = ".json"; + public static final String DOT_JSON = ".json"; private static final Logger logger = LogManager.getLogger(); private static final String EXTENDEDAGENCY = "ExtendedAgency"; private static final String EXTENDEDDESCRIPTION = "ExtendedDescription"; @@ -207,4 +207,8 @@ public class EscortFiles { targetUri.cleanUp(); } } + + public static void createFellow(String escortFile, String extension) throws IOException { + Files.copy(Paths.get(escortFile), Paths.get(escortFile + "." + extension)); + } } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/FileValidatorStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/FileValidatorStep.java index b5cbd158..fc17afb5 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/FileValidatorStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/FileValidatorStep.java @@ -4,6 +4,7 @@ import java.io.FileNotFoundException; import java.nio.file.Path; import java.nio.file.Paths; +import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -12,6 +13,7 @@ import user.commons.mediatool.MediaInfo; import user.commons.remotestore.RemoteStoreProtocol; public class FileValidatorStep extends JobStep { + private static final String COLORSPACE = "COLORSPACE"; private static final Logger logger = LogManager.getLogger(); private void deleteSilently(Path file) { @@ -23,37 +25,57 @@ public class FileValidatorStep extends JobStep { } @StepEntry - public Object[] execute(StoreUri sourceStoreUri, String fileName, long expectedFrameNumber, long expectedSize, String escortFile) throws Exception { + public Object[] execute(StoreUri sourceStoreUri, String fileName, long expectedFrameNumber, long expectedSize, String exceptedColorSpace, String escortFile) + throws Exception { if (!RemoteStoreProtocol.LOCAL.equals(sourceStoreUri.getProtocol())) throw new Exception("Store URI protocol must be local."); Path filePath = Paths.get(sourceStoreUri.toString(true), fileName); if (!filePath.toFile().exists()) throw new FileNotFoundException("File not exists: " + filePath.toString()); - if (expectedFrameNumber > 0) - validateFrameNumber(filePath, expectedFrameNumber, escortFile); + if (expectedFrameNumber > 0 || StringUtils.isNotBlank(exceptedColorSpace)) + validateMedia(filePath, expectedFrameNumber, exceptedColorSpace, escortFile); + if (expectedSize > 0) validateSize(filePath, expectedSize, escortFile); + + logger.info(getMarker(), "{} passed validation", fileName); return null; } - private void validateFrameNumber(Path filePath, long expectedFrameNumber, String escortFile) throws Exception { + private void validateMedia(Path filePath, long expectedFrameNumber, String exceptedColorSpace, String escortFile) throws Exception { MediaInfo mi = null; try { mi = new MediaInfo(filePath); mi.process(); - long frames = mi.getFrames(); - if (frames != expectedFrameNumber) { - deleteSilently(filePath); - if (escortFile != null) { - Path escortFilePath = Paths.get(escortFile); - deleteSilently(escortFilePath); + + if (expectedFrameNumber > 0) { + long frames = mi.getFrames(); + if (frames != expectedFrameNumber) { + deleteSilently(filePath); + if (escortFile != null) { + Path escortFilePath = Paths.get(escortFile); + deleteSilently(escortFilePath); + } + throw new Exception("Length mismatch in " + filePath + ". Expected: " + expectedFrameNumber + ", found: " + frames); + } + } + + if (StringUtils.isNotBlank(exceptedColorSpace)) { + String colorSpace = mi.getColorSpace(); + if (colorSpace == null) { + EscortFiles.createFellow(escortFile, COLORSPACE); + throw new Exception("Can not determine color space in " + filePath); + } + + if (!colorSpace.equals(exceptedColorSpace)) { + EscortFiles.createFellow(escortFile, COLORSPACE); + throw new Exception("Expected color space is " + exceptedColorSpace + ", but found " + colorSpace); } - throw new Exception("Length mismatch. Expected: " + expectedFrameNumber + ", found: " + frames); } } catch (Exception e) { - logger.error(e.getMessage()); + logger.error(getSessionMarker(), e.getMessage()); throw e; } } @@ -65,7 +87,7 @@ public class FileValidatorStep extends JobStep { throw new Exception("Size mismatch. Expected: " + expectedSize + ", found: " + length); } catch (Exception e) { - logger.error(e.getMessage()); + logger.error(getSessionMarker(), e.getMessage()); throw e; } } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/ForkValidateAndArchiveStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/ForkByStatusFileStep.java similarity index 57% rename from server/user.jobengine.executors/src/user/jobengine/server/steps/ForkValidateAndArchiveStep.java rename to server/user.jobengine.executors/src/user/jobengine/server/steps/ForkByStatusFileStep.java index 2ac8fc82..c9858b96 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/ForkValidateAndArchiveStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/ForkByStatusFileStep.java @@ -10,33 +10,28 @@ import java.util.Map; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.message.Message; +import org.apache.logging.log4j.message.ParameterizedMessage; import user.commons.DownloadableMedia; import user.commons.StoreUri; import user.commons.remotestore.RemoteStoreProtocol; -import user.jobengine.db.Store; import user.jobengine.server.IJobRuntime; -public class ForkValidateAndArchiveStep extends JobStep { +public class ForkByStatusFileStep extends JobStep { private static final Logger logger = LogManager.getLogger(); @StepEntry - public Object[] execute(String storeName, String template, int limit) { + public Object[] execute(String tempStoreName, String targetStoreName, String targetProtocol, String template, String expectedColorSpace, int limit) + throws Exception { DirectoryStream directoryStream = null; int count = limit; try { - Store store = getManager().getStore(storeName); - if (store == null) - throw new NullPointerException("Store not exists: " + storeName); - StoreUri sourceStoreUri = store.getTargetStoreUri(RemoteStoreProtocol.LOCAL); - if (sourceStoreUri == null) - throw new NullPointerException("LOCAL store URI not available on: " + storeName); - - Store systemStore = getManager().getSystemStore(false); - StoreUri tsmStoreUri = systemStore.getTargetStoreUri(RemoteStoreProtocol.TSM); + StoreUri tempStoreUri = getManager().getStoreUri(tempStoreName, RemoteStoreProtocol.LOCAL); + StoreUri targetStoreUri = getManager().getStoreUri(targetStoreName, Enum.valueOf(RemoteStoreProtocol.class, targetProtocol)); if (getJobRuntime().forkPrepare()) { - Path path = Paths.get(sourceStoreUri.toString(true), ".STATUS"); + Path path = Paths.get(tempStoreUri.toString(true), ".STATUS"); directoryStream = Files.newDirectoryStream(path); if (directoryStream != null) { for (Path escortFile : directoryStream) { @@ -46,14 +41,13 @@ public class ForkValidateAndArchiveStep extends JobStep { break; } - if (processPathItem(sourceStoreUri, tsmStoreUri, template, escortFile)) + if (processPathItem(tempStoreUri, targetStoreUri, template, escortFile)) count--; if (count == 0) break; } } - if (count == limit) getJobRuntime().cancelForkPrepare(); else @@ -63,6 +57,7 @@ public class ForkValidateAndArchiveStep extends JobStep { setProgress(100); } catch (Exception e) { logger.error(getSessionMarker(), e.getMessage()); + throw e; } finally { if (directoryStream != null) { try { @@ -75,10 +70,19 @@ public class ForkValidateAndArchiveStep extends JobStep { return null; } - private boolean processPathItem(StoreUri tempStoreUri, StoreUri tsmStoreUri, String template, Path escortFile) throws IOException { + private boolean processPathItem(StoreUri tempStoreUri, StoreUri targetStoreUri, String template, Path escortFile) throws IOException { if (escortFile.toFile().isDirectory()) return false; + //ami nem JSON azt nem kezeljuk + if (!escortFile.getFileName().toString().toLowerCase().endsWith(EscortFiles.DOT_JSON)) + return false; + + //aminek van COLORSPACE kiterjesztésű + Path colorspaceFile = Paths.get(escortFile.toString() + ".colorspace"); + if (colorspaceFile.toFile().exists()) + return false; + String fileName = escortFile.getFileName().toString(); //minimum 3 karakter: STORENAME.FILENAME.MXF.JSON long dotCount = fileName.chars().filter(ch -> ch == '.').count(); @@ -93,19 +97,22 @@ public class ForkValidateAndArchiveStep extends JobStep { Map parameters = new HashMap<>(); parameters.put("sourceStoreUri", sourceStoreUri); + parameters.put("fileName", downloadable.getString("fileName")); parameters.put("tempStoreUri", tempStoreUri); - parameters.put("tsmStoreUri", tsmStoreUri); - parameters.put("sourceFileName", downloadable.getString("fileName")); - parameters.put("tsmFileName", downloadable.getString("fileName")); + parameters.put("targetStoreUri", targetStoreUri); parameters.put("expectedFrameNumber", downloadable.getLong("frames")); + parameters.put("expectedSize", downloadable.getLong("size")); + parameters.put("expectedColorSpace", downloadable.getString("colorSpace")); parameters.put("escortFile", escortFile.toAbsolutePath().toString()); - IJobRuntime child = getEngine().submit(template, "Archiválás", parameters); + IJobRuntime child = getEngine().submit(getJobRuntime(), null, template, "Archiválás", parameters); if (child == null) throw new Exception("Submit error."); } catch (Exception e) { - logger.error(e.getMessage()); + Message m = new ParameterizedMessage(e.getMessage()); + logger.error(getMarker(), m, e); + logger.error(getSessionMarker(), m); return false; } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/GenericArchiveCheckerStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/GenericArchiveCheckerStep.java index 8fd14dc8..10f5a76e 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/GenericArchiveCheckerStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/GenericArchiveCheckerStep.java @@ -1,6 +1,7 @@ package user.jobengine.server.steps; import java.io.IOException; +import java.nio.file.Paths; import java.sql.Timestamp; import java.util.List; @@ -12,7 +13,6 @@ import user.commons.RemoteFile; import user.commons.StoreUri; import user.commons.remotestore.RemoteStoreProtocol; import user.jobengine.db.Media; -import user.jobengine.db.Store; public class GenericArchiveCheckerStep extends JobStep { private static final String DOT_MXF = ".MXF"; @@ -26,22 +26,19 @@ public class GenericArchiveCheckerStep extends JobStep { } @StepEntry - public Object[] execute(String storeName, String protocol, String wildCard, String outputPath, int limit) throws Exception { - Store store = getManager().getStore(storeName); - if (store == null) - throw new NullPointerException("Store not available: " + storeName); - - StoreUri storeUri = store.getSourceStoreUri(Enum.valueOf(RemoteStoreProtocol.class, protocol)); - if (storeUri == null) - throw new NullPointerException("StoreUri not available on " + storeName + " for protocol " + protocol); - + public Object[] execute(String sourceStoreName, String protocol, String wildCard, String escortStoreName, int limit) throws Exception { + StoreUri storeUri = null; int count = limit; try { + storeUri = getManager().getStoreUri(sourceStoreName, Enum.valueOf(RemoteStoreProtocol.class, protocol)); + StoreUri escortSoreUri = getManager().getStoreUri(escortStoreName, RemoteStoreProtocol.LOCAL); + String outputPath = Paths.get(escortSoreUri.toString(true)).toString(); + //az FTP store nem tamogatja az asszinkron listazast List remoteFiles = storeUri.getRemoteFiles(wildCard); for (RemoteFile remoteFile : remoteFiles) { - if (processClip(storeName, remoteFile, storeUri.getId(), outputPath)) + if (processClip(sourceStoreName, remoteFile, storeUri.getId(), outputPath)) count--; if (count == 0) { @@ -53,6 +50,8 @@ public class GenericArchiveCheckerStep extends JobStep { } catch (Exception e) { throw e; } finally { + if (storeUri != null) + storeUri.cleanUp(); } return null; diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOMissingMaterialCheckerStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/HarrisMissingMaterialCheckerStep.java similarity index 64% rename from server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOMissingMaterialCheckerStep.java rename to server/user.jobengine.executors/src/user/jobengine/server/steps/HarrisMissingMaterialCheckerStep.java index ff4d2a07..1acca884 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOMissingMaterialCheckerStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/HarrisMissingMaterialCheckerStep.java @@ -8,29 +8,32 @@ import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import com.ibm.nosql.json.api.BasicDBList; + +import user.commons.DownloadableMedia; import user.commons.StoreUri; -import user.commons.UploadableMedia; import user.commons.harris.HarrisRecord; import user.commons.harris.VICFileParser; import user.commons.remotestore.RemoteStoreProtocol; import user.jobengine.db.Media; -public class NEXIOMissingMaterialCheckerStep extends JobStep { +public class HarrisMissingMaterialCheckerStep extends JobStep { private static final Logger logger = LogManager.getLogger(); private static final String lineFormat = System.getProperty("harris.vic.lineformat", "A TTTTTTTT LLLLLLLLLLL MMMMMMMMMMMMMMMMMMMMMMM X DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"); private static final String validTypeCodes = System.getProperty("harris.vic.validtypecodes", "SPACE,E"); - private static final String appendExtension = System.getProperty("harris.vic.appendextension", ".mxf"); + private static final String appendExtension = System.getProperty("missingmaterial.appendextension", ".mxf"); @StepEntry - public Object[] execute(String[] vicFiles, String escortStoreName, String targetStoreName, String targetProtocol) throws Exception { + public Object[] execute(BasicDBList vicFiles, String escortStoreName, String targetStoreName, String targetProtocol) throws Exception { StoreUri escortStoreUri = null; try { escortStoreUri = getManager().getStoreUri(escortStoreName, RemoteStoreProtocol.LOCAL); StoreUri targetStoreUri = getManager().getStoreUri(targetStoreName, Enum.valueOf(RemoteStoreProtocol.class, targetProtocol)); List records = null; - for (String vicFile : vicFiles) { - Path vicFilePath = Paths.get(vicFile); + for (Object vicFile : vicFiles) { + Path vicFilePath = Paths.get(String.valueOf(vicFile)); + logger.info("Processing {} (exists: {})", vicFilePath, vicFilePath.toFile().exists()); VICFileParser parser = new VICFileParser(vicFilePath, lineFormat, validTypeCodes); if (records == null) records = parser.getRecords(); @@ -48,6 +51,7 @@ public class NEXIOMissingMaterialCheckerStep extends JobStep { } catch (Exception e) { logger.error(getSessionMarker(), e.getMessage()); + logger.error(e.getMessage()); throw e; } finally { if (escortStoreUri != null) @@ -65,16 +69,20 @@ public class NEXIOMissingMaterialCheckerStep extends JobStep { fileName += appendExtension; if (media == null) { - logger.error(getSessionMarker(), "File {} not archived yet", fileName); + logger.warn(getSessionMarker(), "File is not available in archive {}", fileName); return; } - UploadableMedia uploadable = UploadableMedia.create(record.getFileName(), fileName, targetStoreUri.getId(), media.getId()); - String escortFileName = targetStoreName + "." + uploadable.getString("fileName"); + DownloadableMedia downloadable = DownloadableMedia.create(media.getTitle(), fileName, media.getModified(), media.getCreated(), media.getLength(), 0L, + targetStoreUri.getId(), media.getId()); + String escortFileName = targetStoreName + "." + downloadable.getString("fileName"); String outputPath = null; try { outputPath = Paths.get(escortStoreUri.toString(true)).toString(); - EscortFiles.createMetadataIfNotExists(outputPath, escortFileName, uploadable.toPrettyString("")); + if (EscortFiles.createMetadataIfNotExists(outputPath, escortFileName, downloadable.toPrettyString(""))) + logger.info(getSessionMarker(), "Status file created {}", escortFileName); + else + logger.info(getSessionMarker(), "Status file already exists {}", escortFileName); } catch (Exception e) { logger.error("Can't create escort file {}", Paths.get(outputPath.toString(), escortFileName)); } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/MetadataPersisterStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/MetadataPersisterStep.java index 769c5df6..66813d00 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/MetadataPersisterStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/MetadataPersisterStep.java @@ -2,11 +2,14 @@ package user.jobengine.server.steps; import java.nio.file.Path; import java.nio.file.Paths; +import java.sql.Timestamp; +import java.time.Instant; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import user.commons.DownloadableMedia; +import user.commons.StoreUri; import user.jobengine.db.IItemManager; import user.jobengine.db.Item; import user.jobengine.db.Media; @@ -17,14 +20,14 @@ public class MetadataPersisterStep extends JobStep { private static final Logger logger = LogManager.getLogger(); @StepEntry - public Object[] execute(String escortFile) throws Exception { + public Object[] execute(StoreUri targetStoreUri, String escortFile) throws Exception { try { Path escortFilePath = Paths.get(escortFile); //ha nem ment at a letoltott file az ellenorzesen, akkor már torolve lett if (escortFilePath.toFile().exists()) { String escortFileName = escortFilePath.getFileName().toString(); - String storeName = escortFileName.substring(0, escortFileName.indexOf(".")); + String sourceStoreName = escortFileName.substring(0, escortFileName.indexOf(".")); DownloadableMedia downloadable = EscortFiles.decode(escortFilePath); String title = downloadable.getString("title"); String fileName = downloadable.getString("fileName"); @@ -32,20 +35,22 @@ public class MetadataPersisterStep extends JobStep { IItemManager manager = getManager(); + String targetStoreName = getManager().getStore(targetStoreUri.getStoreId()).getName(); //ez elszallhat, mert nincs filetype vagy store - MediaFile mediaFile = manager.createMediaFile(fileName, fileTypeName, storeName); + MediaFile mediaFile = manager.createMediaFile(fileName, fileTypeName, targetStoreName); //ez elszallhat, mert nincs itemtype - Item item = manager.createItem(GENERIC, title, storeName, null); + Item item = manager.createItem(GENERIC, title, sourceStoreName, null); //ez elszallhat, mert nincs itemtype - Media media = manager.createMedia(GENERIC, title, storeName, null); + Media media = manager.createMedia(GENERIC, title, sourceStoreName, null); //TODO megoldani egy tranzakcioban item.add(); media.setItemId(item.getId()); + media.setLength(downloadable.getLong("frames")); + media.setArchived(Timestamp.from(Instant.now())); media.add(); mediaFile.setMediaId(media.getId()); mediaFile.add(); - } } catch (Exception e) { logger.error(e.getMessage()); diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOArchiveCheckerStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOArchiveCheckerStep.java index f6b6a5ae..5d34da69 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOArchiveCheckerStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/NEXIOArchiveCheckerStep.java @@ -1,7 +1,10 @@ package user.jobengine.server.steps; import java.io.IOException; +import java.nio.file.Paths; import java.sql.Timestamp; +import java.time.Duration; +import java.time.Instant; import java.util.Iterator; import org.apache.logging.log4j.LogManager; @@ -18,7 +21,7 @@ import user.commons.remotestore.RemoteStoreProtocol; import user.jobengine.db.Media; public class NEXIOArchiveCheckerStep extends JobStep { - private static final String DOT_MXF = ".MXF"; + private static final String DOT_MXF = ".mxf"; private static final Logger logger = LogManager.getLogger(); private boolean check(Timestamp modified, Timestamp created, int duration, Media media) { @@ -31,19 +34,24 @@ public class NEXIOArchiveCheckerStep extends JobStep { } @StepEntry - public Object[] execute(String storeName, String outputPath, int limit) throws Exception { - StoreUri storeUri = getManager().getStoreUri(storeName, RemoteStoreProtocol.NEXIO); + public Object[] execute(String sourceStoreName, String escortStoreName, int lastModifiedHours, int limit) throws Exception { Controller controller = null; try { - if (storeUri.getPortNumber() == 0) - controller = new Controller(storeUri.getUri(), storeUri.getPortNumber()); + StoreUri nexioStoreUri = getManager().getStoreUri(sourceStoreName, RemoteStoreProtocol.NEXIO); + StoreUri downloadStoreUri = getManager().getStoreUri(sourceStoreName, RemoteStoreProtocol.FTP); + StoreUri escortStoreUri = getManager().getStoreUri(escortStoreName, RemoteStoreProtocol.LOCAL); + String outputPath = Paths.get(escortStoreUri.toString(true)).toString(); + + if (nexioStoreUri.getPortNumber() == 0) + controller = new Controller(nexioStoreUri.getUri(), nexioStoreUri.getPortNumber()); else - controller = new Controller(storeUri.getUri()); + controller = new Controller(nexioStoreUri.getUri()); controller.connect(); Mediabase mediabase = controller.getMediabase(); + Iterator clips = mediabase.getClips(); - processClips(storeName, storeUri.getId(), outputPath, limit, clips); + processClips(sourceStoreName, downloadStoreUri.getId(), outputPath, limit, clips, lastModifiedHours); } catch (Exception e) { logger.error(getSessionMarker(), e.getMessage()); throw e; @@ -55,7 +63,7 @@ public class NEXIOArchiveCheckerStep extends JobStep { return null; } - private void processClips(String storeName, long storeUriId, String outputPath, int limit, Iterator clips) + private void processClips(String storeName, long storeUriId, String outputPath, int limit, Iterator clips, int lastModifiedHours) throws ClipNotFoundException, IOException, ProtocolException { int count = limit; while (clips.hasNext()) { @@ -67,28 +75,39 @@ public class NEXIOArchiveCheckerStep extends JobStep { Clip clip = clips.next(); String title = clip.getXid().get(); - Timestamp modified = Timestamp.from(clip.getModifiedTimestamp().toInstant()); + Instant clipModified = clip.getModifiedTimestamp().toInstant(); + Timestamp modified = Timestamp.from(clipModified); Timestamp created = Timestamp.from(clip.getRecordDateTimestamp().toInstant()); int frames = clip.getDuration(); - //TODO a rogzites alatt allo klippeket kiszurni - Media media = getManager().getMedia(title); boolean createEscort = check(modified, created, frames, media); if (createEscort) { - long mediaId = media == null ? 0 : media.getId(); + long mediaId = 0; + + //lastModifiedHours oran belul modositott anyagokat beken hagyjuk + if (media != null) { + //negativ ha a masodik az elso elott van + long modifiedHours = Duration.between(clipModified, Instant.now()).toHours(); + if (modifiedHours > lastModifiedHours) { + logger.info(getSessionMarker(), "Modification time is too cloose for {}"); + continue; + } + mediaId = media.getId(); + } + String fileName = title + DOT_MXF; DownloadableMedia downloadable = DownloadableMedia.create(title, fileName, modified, created, frames, 0, storeUriId, mediaId); - //letezik : mar hozzadva - String escortFileName = storeName + "." + downloadable.getString("fileName"); - if (EscortFiles.createMetadataIfNotExists(outputPath, escortFileName, downloadable.toPrettyString(""))) + if (EscortFiles.createMetadataIfNotExists(outputPath, escortFileName, downloadable.toPrettyString(""))) { + logger.info(getSessionMarker(), "Archive status file created for {}", fileName); count--; + } } - //vegtelen : limit=-1 + //vegtelen : limit<=0 if (count == 0) { logger.info("Limit reached: {}", limit); break; diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/PBMissingMaterialCheckerStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/PBMissingMaterialCheckerStep.java deleted file mode 100644 index b5249063..00000000 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/PBMissingMaterialCheckerStep.java +++ /dev/null @@ -1,74 +0,0 @@ -package user.jobengine.server.steps; - -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.List; - -import org.apache.commons.lang.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -import user.commons.StoreUri; -import user.commons.UploadableMedia; -import user.commons.harris.HarrisRecord; -import user.commons.harris.VICFileParser; -import user.commons.remotestore.RemoteStoreProtocol; -import user.jobengine.db.Media; - -public class PBMissingMaterialCheckerStep extends JobStep { - private static final Logger logger = LogManager.getLogger(); - private static final String lineFormat = System.getProperty("harris.vic.lineformat", - "A TTTTTTTT LLLLLLLLLLL MMMMMMMMMMMMMMMMMMMMMMM X DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"); - private static final String validTypeCodes = System.getProperty("harris.vic.validtypecodes", "SPACE,E"); - private static final String appendExtension = System.getProperty("harris.vic.appendextension", ".mxf"); - - @StepEntry - public Object[] execute(String[] vicFiles, String escortStoreName, String targetStoreName, String targetProtocol) throws Exception { - StoreUri escortStoreUri = null; - try { - escortStoreUri = getManager().getStoreUri(escortStoreName, RemoteStoreProtocol.LOCAL); - StoreUri targetStoreUri = getManager().getStoreUri(targetStoreName, Enum.valueOf(RemoteStoreProtocol.class, targetProtocol)); - for (String vicFile : vicFiles) { - Path vicFilePath = Paths.get(vicFile); - VICFileParser parser = new VICFileParser(vicFilePath, lineFormat, validTypeCodes); - List records = parser.getRecords(); - for (HarrisRecord record : records) - processRecord(record, targetStoreName, targetStoreUri, escortStoreUri); - - } - } catch (Exception e) { - logger.error(getSessionMarker(), e.getMessage()); - throw e; - } finally { - if (escortStoreUri != null) - escortStoreUri.cleanUp(); - } - - return null; - } - - private void processRecord(HarrisRecord record, String targetStoreName, StoreUri targetStoreUri, StoreUri escortStoreUri) { - Media media = getManager().getMedia(record.getFileName()); - - String fileName = record.getFileName(); - if (StringUtils.isNotBlank(appendExtension)) - fileName += appendExtension; - - if (media == null) { - logger.error(getSessionMarker(), "File {} not archived yet", fileName); - return; - } - - UploadableMedia uploadable = UploadableMedia.create(record.getFileName(), fileName, targetStoreUri.getId(), media.getId()); - String escortFileName = targetStoreName + "." + uploadable.getString("fileName"); - String outputPath = null; - try { - outputPath = Paths.get(escortStoreUri.toString(true)).toString(); - EscortFiles.createMetadataIfNotExists(outputPath, escortFileName, uploadable.toPrettyString("")); - } catch (Exception e) { - logger.error("Can't create escort file {}", Paths.get(outputPath.toString(), escortFileName)); - } - - } - -} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/PeableBeachMissingMaterialCheckerStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/PeableBeachMissingMaterialCheckerStep.java new file mode 100644 index 00000000..3c53af0f --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/PeableBeachMissingMaterialCheckerStep.java @@ -0,0 +1,86 @@ +package user.jobengine.server.steps; + +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.commons.DownloadableMedia; +import user.commons.RemoteFile; +import user.commons.StoreUri; +import user.commons.peablebeach.PBMissingMaterialSrc; +import user.commons.remotestore.RemoteStoreProtocol; +import user.jobengine.db.Media; + +public class PeableBeachMissingMaterialCheckerStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + private static final String appendExtension = System.getProperty("missingmaterial.appendextension", ".mxf"); + + @StepEntry + public Object[] execute(String escortStoreName, String targetStoreName, String targetProtocol, String primaryEndPoint, String primaryUserName, + String primaryPassword, String secondaryEndPoint, String secondaryUserName, String secondaryPassword, int rangeForwardHours) throws Exception { + StoreUri escortStoreUri = null; + try { + escortStoreUri = getManager().getStoreUri(escortStoreName, RemoteStoreProtocol.LOCAL); + StoreUri targetStoreUri = getManager().getStoreUri(targetStoreName, Enum.valueOf(RemoteStoreProtocol.class, targetProtocol)); + + PBMissingMaterialSrc source = new PBMissingMaterialSrc(); + source.init(primaryEndPoint, primaryUserName, primaryPassword, secondaryEndPoint, secondaryUserName, secondaryPassword, rangeForwardHours); + + List remoteFiles = targetStoreUri.getRemoteFiles(); + + List poolContent = new ArrayList<>(); + remoteFiles.forEach(i -> { + String fileName = i.getName(); + String title = fileName.substring(0, fileName.lastIndexOf(".")); + poolContent.add(title); + }); + logger.info("Pool contains {} items", poolContent.size()); + LinkedHashSet fileNames = source.getPossibelMissingMaterialNames(poolContent); + logger.info("API returns {} items", fileNames.size()); + + for (String fileName : fileNames) { + processRecord(fileName, targetStoreName, targetStoreUri, escortStoreUri); + } + } catch (Exception e) { + logger.error(getSessionMarker(), e.getMessage()); + throw e; + } finally { + if (escortStoreUri != null) + escortStoreUri.cleanUp(); + } + + return null; + } + + private void processRecord(String fileName, String targetStoreName, StoreUri targetStoreUri, StoreUri escortStoreUri) { + String title = fileName.substring(0, fileName.lastIndexOf(".")); + + Media media = getManager().getMedia(title); + + if (StringUtils.isNotBlank(appendExtension)) + fileName += appendExtension; + + if (media == null) { + logger.error(getSessionMarker(), "File {} not archived yet", fileName); + return; + } + + DownloadableMedia downloadable = DownloadableMedia.create(title, fileName, media.getModified(), media.getCreated(), media.getLength(), 0L, + targetStoreUri.getId(), media.getId()); + String escortFileName = targetStoreName + "." + downloadable.getString("fileName"); + String outputPath = null; + try { + outputPath = Paths.get(escortStoreUri.toString(true)).toString(); + EscortFiles.createMetadataIfNotExists(outputPath, escortFileName, downloadable.toPrettyString("")); + } catch (Exception e) { + logger.error("Can't create escort file {}", Paths.get(outputPath.toString(), escortFileName)); + } + + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeNoParamsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java similarity index 91% rename from server/user.jobengine.executors/src/user/jobengine/server/steps/FakeNoParamsStep.java rename to server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java index 1c17c973..6d0e2057 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeNoParamsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TestForkCancelableStep.java @@ -6,7 +6,7 @@ import org.apache.logging.log4j.Logger; import user.jobengine.server.IJobEngine; import user.jobengine.server.IJobRuntime; -public class FakeNoParamsStep extends JobStep { +public class TestForkCancelableStep extends JobStep { private static final String CHILD_TITLE = "Párhuzamosított alfolyamat"; // private static final String CHILD_TEMPLATE = "fake-concurrent.xml"; private static final String CHILD_TEMPLATE = "cancelable.xml"; diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferFromTSMStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferFromTSMStep.java new file mode 100644 index 00000000..a74c02b4 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferFromTSMStep.java @@ -0,0 +1,11 @@ +package user.jobengine.server.steps; + +import user.commons.StoreUri; + +public class TransferFromTSMStep extends TransferStep { + @Override + @StepEntry + public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception { + return super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName); + } +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferStep.java index eb7ce500..ac382368 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferStep.java @@ -1,5 +1,7 @@ package user.jobengine.server.steps; +import java.nio.file.Paths; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -13,14 +15,17 @@ public class TransferStep extends JobStep { @StepEntry public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception { try { - logger.info("Transfering {} from {} to {}", sourceFileName, sourceStoreUri, targetStoreUri); - if (!(symulateTransferToTSM && RemoteStoreProtocol.TSM.equals(targetStoreUri.getProtocol()))) { + String description = Paths.get(sourceStoreUri.toString(true), sourceFileName).toString(); + getJobRuntime().setDescription(description); + if (isSimulateTSMWrite(sourceStoreUri, targetStoreUri)) { + logger.info(getSessionMarker(), "Skipping real TSM write of {} from {} to {}", sourceFileName, sourceStoreUri, targetStoreUri); + } else { sourceStoreUri.addProgressListener(e -> setProgress(e.getProgress())); sourceStoreUri.transferFrom(targetStoreUri, sourceFileName, targetFileName); + logger.info(getSessionMarker(), "Transfer of {} completed from {} to {}", sourceFileName, sourceStoreUri, targetStoreUri); } - logger.info("Transfer completed"); } catch (Exception e) { - logger.catching(e); + logger.error(getSessionMarker(), "Error in transfer of {} when copying from {} to {}", sourceFileName, sourceStoreUri, targetStoreUri); throw e; } finally { if (sourceStoreUri != null) @@ -30,4 +35,8 @@ public class TransferStep extends JobStep { } return null; } + + private boolean isSimulateTSMWrite(StoreUri sourceStoreUri, StoreUri targetStoreUri) { + return symulateTransferToTSM && (RemoteStoreProtocol.TSM.equals(targetStoreUri.getProtocol())); + } } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferToTSMStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferToTSMStep.java new file mode 100644 index 00000000..64a6e531 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/TransferToTSMStep.java @@ -0,0 +1,11 @@ +package user.jobengine.server.steps; + +import user.commons.StoreUri; + +public class TransferToTSMStep extends TransferStep { + @Override + @StepEntry + public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception { + return super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName); + } +} diff --git a/server/user.jobengine.osgi.commons/.classpath b/server/user.jobengine.osgi.commons/.classpath index 5774abd3..32848218 100644 --- a/server/user.jobengine.osgi.commons/.classpath +++ b/server/user.jobengine.osgi.commons/.classpath @@ -4,5 +4,11 @@ + + + + + + diff --git a/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF b/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF index 8237d82e..b147adf7 100644 --- a/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF +++ b/server/user.jobengine.osgi.commons/META-INF/MANIFEST.MF @@ -33,6 +33,7 @@ Export-Package: user.commons, user.commons.nexio.server.protocol, user.commons.nosql, user.commons.octopus, + user.commons.peablebeach, user.commons.rcc, user.commons.remotestore, user.commons.rest, @@ -54,10 +55,10 @@ Require-Bundle: org.apache.commons.lang;bundle-version="2.4.0", com.ibm.nosql;bundle-version="4.19.26", joda-time;bundle-version="2.2.0", javax.ws.rs-api;bundle-version="2.0.1", - com.ibm.db2jcc4;bundle-version="4.19.26", com.microsoft.sqlserver.sqljdbc;bundle-version="6.0.8112", javax.annotation-api;bundle-version="1.2.0", org.apache.httpcomponents.httpclient;bundle-version="4.2.6", org.apache.httpcomponents.httpcore;bundle-version="4.2.5", org.apache.commons.logging;bundle-version="1.1.1", - org.apache.commons.io;bundle-version="2.2.0" + org.apache.commons.io;bundle-version="2.2.0", + com.ibm.db2.jcc;bundle-version="1.4.0" diff --git a/server/user.jobengine.osgi.commons/src/user/commons/DownloadableMedia.java b/server/user.jobengine.osgi.commons/src/user/commons/DownloadableMedia.java index 1b67f59f..9304a403 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/DownloadableMedia.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/DownloadableMedia.java @@ -6,7 +6,7 @@ import com.ibm.nosql.json.api.BasicDBObject; public class DownloadableMedia extends BasicDBObject { - public static DownloadableMedia create(String title, String fileName, Timestamp modified, Timestamp created, int frames, long size, long storeUriId, + public static DownloadableMedia create(String title, String fileName, Timestamp modified, Timestamp created, long frames, long size, long storeUriId, long mediaId) { DownloadableMedia archive = new DownloadableMedia(); archive.put("title", title); diff --git a/server/user.jobengine.osgi.commons/src/user/commons/UploadableMedia.java b/server/user.jobengine.osgi.commons/src/user/commons/UploadableMedia.java deleted file mode 100644 index 80c05db1..00000000 --- a/server/user.jobengine.osgi.commons/src/user/commons/UploadableMedia.java +++ /dev/null @@ -1,16 +0,0 @@ -package user.commons; - -import com.ibm.nosql.json.api.BasicDBObject; - -public class UploadableMedia extends BasicDBObject { - - public static UploadableMedia create(String title, String fileName, long storeUriId, long mediaId) { - UploadableMedia archive = new UploadableMedia(); - archive.put("title", title); - archive.put("fileName", fileName); - archive.put("storeUriId", storeUriId); - archive.put("mediaId", mediaId); - return archive; - } - -} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java b/server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java index 7a46ad5c..4ccac3f3 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/mediatool/MediaInfo.java @@ -16,6 +16,9 @@ public class MediaInfo { private long frames; private Path filePath; private int bitRate; + private String colorSpace; + private int audioStreams; + private int videoStreams; public MediaInfo(Path filePath) { this.filePath = filePath; @@ -42,18 +45,23 @@ public class MediaInfo { final DemuxerStream stream = demuxer.getStream(i); final Decoder decoder = stream.getDecoder(); - if (decoder != null && decoder.getCodecType() == MediaDescriptor.Type.MEDIA_VIDEO) { - videoStreamId = i; - frames = stream.getNumFrames(); + if (decoder != null) { + if (decoder.getCodecType() == MediaDescriptor.Type.MEDIA_VIDEO) { + videoStreams++; + videoStreamId = i; + frames = stream.getNumFrames(); - if (frames == 0) - frames = stream.getDuration(); - - break; + if (frames == 0) + frames = stream.getDuration(); + colorSpace = decoder.getPixelFormat().toString(); + } + if (decoder.getCodecType() == MediaDescriptor.Type.MEDIA_AUDIO) { + audioStreams++; + } } } if (videoStreamId == -1) - throw new RuntimeException("could not find video stream in container: " + filePath); + throw new RuntimeException("Could not find video stream in " + filePath); } catch (Exception e) { logger.catching(e); @@ -68,4 +76,16 @@ public class MediaInfo { } } + public String getColorSpace() { + return colorSpace; + } + + public int getAudioStreams() { + return audioStreams; + } + + public int getVideoStreams() { + return videoStreams; + } + } diff --git a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MarinaAPI.wsdl b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MarinaAPI.wsdl new file mode 100644 index 00000000..d35ffb38 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MarinaAPI.wsdl @@ -0,0 +1,1402 @@ + + + + + + + + + + Conforms to type 'lastModifiedDateTimeRange'. + + + + + + + + + + The event id type can only be one of the valid listed types used in retrieval of events. + + + + + + + + + + + Valid position enums that can be used in an event id for event retrieval. + + + + + + + + + + The event id value can either be a specific UID or position enum. + + + + + + One or more of the configurable fields can be set.and are used to retrieve extra config information + + + + + + + + + + Specifies the component to retrieve the extra config from + + + + + + + + + + + + Container that encapsulates the request to "get config" message to send to API + + + + + + + + + + + + + + + + Container encapsulating the request to set config and response to the "getConfig" + + + + + + + + + + + + + + + + + + + + + + Conforms to type 'media'. + + + + + + + + + + Conforms to type 'config'. + + + + + + + + + + Conforms to type 'mediaUsageList' + + + + + + + + + + Conforms to type 'deleteMedia' + + + + + + + + + + Conforms to type 'media'. + + + + + + + + + + Conforms to type 'media'. + + + + + + + + + + Conforms to type 'media'. + + + + + + + + + + Conforms to type 'dateTimecodeRange'. + + + + + + + + + + Conforms to type 'dateTimecodeRange'. + + + + + + + + + + Conforms to type 'dateTimecodeRange'. + + + + + + + + + + Conforms to type 'mediaUsage'. + + + + + + + + + + Conforms to type 'MediaInstance'. + + + + + + + + + + + + + + + + + + Used to return information on available media. + + + + + Used to return information on unavailable media. + + + + + Heartbeat id used to track heartbeat responses. + + + + + String used to hold list name for list query commands. Can also be a channel name from which the active list will be used. + + + + + Event count of queried lists or number of events to return. + + + + + Event count of queried lists or number of events to return. + + + + + Event count of queried lists or number of events to return. + + + + + Event count of queried events with no aux xml to return. + + + + + Conforms to type 'playlistPrimaryEvent'. + + + + + + + + + + Position of the event to query. + + + + + Key of the event to query. + + + + + Container for an event list. + + + + + + + + + + Conforms to type 'job'. + + + + + + + + + + Conforms to type 'scheduled job'. + + + + + + + + + + Id of an automation job. + + + + + Id of a scheduled automation job. + + + + + Flag used to indicate there are more events after the last event in an event list returned by a call that returns multiple events. + + + + + Event id used to retrieve events. + + + + + Next event id returned by command. + + + + + A list of event ids. + + + + + + + + + + Container element for an event id list. + + + + + + + + + + Container for an event id list for events that have been deleted. + + + + + + + + + + Container for an event id list for events that have not been queried. + + + + + + + + + + For events that return event XML set this flag to true for child events to be returned. + + + + + Conforms to type 'componentTag'. + + + + + + + + + + For events that return component information set this flag to true to include active objects that aren't hosted. + + + + + Conforms to complex type 'componentList'. + + + + + + + + + + An enumeration of different update types performed on an event. + + + + + + + + + + + + + + Object containing all parameters returned by the getContiguousListEvents method. + + + + + + The number of events contained in the event list container. + + + + + A list of events returned using the passed in query parameters. + + + + + A flag to indicate whether there are more events available after the last event returned in the event list container. + + + + + The event id key for the next event in the list after the last event contained in the event list container. + + + + + + + + Object containing all parameters returned by the getNonContiguousListEvents method. + + + + + + A list of events returned using the passed in query parameters. + + + + + The number of events contained in the event list container. + + + + + A list of event id's for events that have been deleted from the list of events to query. + + + + + The number of events contained in the deleted events event id list container. + + + + + A list of event id's for events that were not queried this will always be a subset of the list of event id's passed in to query. + + + + + The number of events contained in the non-queried events event id list container. + + + + + + + + Object containing all parameters returned by the getListEventChanges method. + + + + + + A list of event id's for events that have changed and meet the filters provided. + + + + + The number of events contained in the returned event id list container. + + + + + + + + Object containing all parameters returned by the getListEventChangesAuxXML method. + + + + + + + + + + + + + When set to true we return back to the caller a list of all events that contained no aux xml. + + + + + Container element for a list of media items. + + + + + + + + + + + Container element for a list of jobs. + + + + + + + + + + + Container element for a list of scheduled jobs. + + + + + + + + + + + Container element for a media item relating to jobs. + + + + + + + + + + Container element for a media item relating to scheduled jobs. + + + + + + + + + + Container element for the get job request. + + + + + + + + + + Container element for the get scheduled job request. + + + + + + + + + + Container element for the get Custom View request. + + + + + + + + + + + + + + Contains a list of media from the get Custom View request. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Inserts or updates media and/or media instance metadata in the marina database. + + + + + Returns metadata for the specified media/media instances. See definition of pbs:media. +The media key must be specified and optionally media instance keys (mediaSets). +If no media instances are requested, metadata for all instances are returned. + + + + + Returns playout usage of the specified media. +The media key must be specified and optionally media instance keys (media sets). +If no instances are specified the usage of all instances of that media are returned. + + + + + Returns the playout usage for all media within a specified timecode range. + + + + + The heartbeat ID is client generated and is echoed back to the caller by the PBS API. + + + + + + + + + Returns the 'event' event with the queried event id and list. + + + + + Returns the 'playlistPrimaryEvent' event with an event id of 'eventKey' including the +next 'nEventCount' events in an 'eventList'. + + + + + Returns a list of events specified in 'eventIdList'. +Deleted/missing events are returned in the 'deletedEvents' eventIdList. +If more events are queried than the maximum configured amount then non-queried +events are returned in the 'nonQueriedEvents' eventIdList getNonContiguousListEvents +can then be called again passing in the list. When this list is empty all events were +queried. + + + + + Returns a list of event ids for all events that have changed in the specified list +between the specified dates/times filtered by an event type. +Note: It is possible this method will return more events than is supported by +getNonContiguousListEvents. + + + + + Returns a list of components that meet the filter requirements. + + + + + Returns the job id of the created/updated job on success. +Note: You must send the job uid on an update. + + + + + + Returns the job id of the created/updated scheduled job on success. + Note: You must send the job uid on an update. + + + + + + Delete a job using the id returned by 'insertUpdateJob'. + + + + + Delete a job using the id returned by 'insertUpdateJob'. + + + + + Delete a media instance (or multiple media instances). +The media key must be specified and optionally media instance keys (media sets). +If no instances are specified, all instances of that media will be deleted from all the media sets. + + + + + Return the updated jobs database auxillary XML. At the moment this is just used for +returning reconcile keys for a given list of deleted event UIDs. Events with no aux +xml stored for them can be returned by setting the include empty aux xml events flag +and will be returned in an event id list. + + + + + + + + + + + + + + + + + Returns a job list of all jobs whose state has changed between the dates/times. + + + + + Returns a job list of all scheduled jobs whose state has changed between the dates/times. + + + + + Returns a list of all the automation jobs and their current state relating to the media. + + + + + Returns a list of all the scheduled jobs and their current state relating to the media. + + + + + Returns the job with the queried job id and type. + + + + + Returns the scheduled job with the queried job id and type. + + + + + Returns metadata for the specified media instance. See definition of pbs:mediaInstance. +The media key must be specified and optionally media instance keys (mediaSets). +If no media instances are requested, metadata for all instances are returned. + + + + + Returns a medialist of rows returned by the specified custom view + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MediaUsageComparator.java b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MediaUsageComparator.java new file mode 100644 index 00000000..56451493 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/MediaUsageComparator.java @@ -0,0 +1,42 @@ +package user.commons.peablebeach; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import pb.wsclient.MediaInstanceUsage; +import pb.wsclient.MediaUsage; +import pb.wsclient.MediaUsage.MediaInstancesUsage; + +class MediaUsageComparator implements Comparator { + + //Compares its two arguments for order. + @Override + public int compare(MediaUsage mu1, MediaUsage mu2) { + String mu1FirstTime = getEarliestUsageTime(mu1); + String mu2FirstTime = getEarliestUsageTime(mu2); + return mu1FirstTime.compareTo(mu2FirstTime); + } + + //Indicates whether some other object is "equal to" this comparator. + @Override + public boolean equals(Object obj) { + return false; + } + + private String getEarliestUsageTime(MediaUsage mu) { + MediaInstancesUsage muUsage = mu.getMediaInstancesUsage(); + List muUsageList = muUsage.getMediaInstanceUsage(); + List sortedEarliest = new ArrayList(); + for (MediaInstanceUsage usage : muUsageList) { + sortedEarliest.add(usage.getEarliestUsageTime()); + } + Collections.sort(sortedEarliest); + if (sortedEarliest.size() > 0) { + return sortedEarliest.get(0); + } else { + return null; + } + } +} \ No newline at end of file diff --git a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/PBMissingMaterialSrc.java b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/PBMissingMaterialSrc.java new file mode 100644 index 00000000..860d13a5 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/PBMissingMaterialSrc.java @@ -0,0 +1,202 @@ +package user.commons.peablebeach; + +//import pb.wsclient; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collections; +import java.util.Date; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; + +import javax.xml.ws.BindingProvider; + +import org.apache.commons.lang.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import pb.wsclient.DateTimecodeRange; +import pb.wsclient.DateTimecodeRangeContainer; +import pb.wsclient.GetCustomViewRequestContainer; +import pb.wsclient.GetCustomViewResponseContainer; +import pb.wsclient.Media; +import pb.wsclient.MediaList; +import pb.wsclient.MediaType; +import pb.wsclient.MediaUsage; +import pb.wsclient.MediaUsageList; +import pb.wsclient.MediaUsageListContainer; +import pb.wsclient.PBClientTest; +import pb.wsclient.PBSMarinaAPI; +import pb.wsclient.PBSMarinaAPIService; + +/** + * PebbleBeach missing material source. Soap ws hivasokkal kerdezi le a hianyzo allomanyokat. + */ +public class PBMissingMaterialSrc { + private static final Logger logger = LogManager.getLogger(); + private SimpleDateFormat sdf_range = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss:'00'"); + private URL wsdlURL = null; + private PBSMarinaAPI primaryMarinaAPI = null; + private PBSMarinaAPI secondaryMarinaAPI = null; + private int rangeForwardHours = 24; + + private PBSMarinaAPI createPBMarinaAPI(String endPointUrl, URL wsdlURL, String soapUserId, String soapUserPassword) throws Exception { + PBSMarinaAPIService api = new PBSMarinaAPIService(wsdlURL); + PBSMarinaAPI bpsPort = api.getPBSMarinaAPISOAPPort(); + BindingProvider bindingProvider = (BindingProvider) bpsPort; + + Map context = bindingProvider.getRequestContext(); + context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endPointUrl); + + if (StringUtils.isNotBlank(soapUserId) && StringUtils.isNotBlank(soapUserPassword)) { + context.put(BindingProvider.USERNAME_PROPERTY, soapUserId); //pbs + context.put(BindingProvider.PASSWORD_PROPERTY, soapUserPassword); //pbs + } + return bpsPort; + } + + /*** + * A PeableBeach altal lehetseges missing material statuszu mediak nevei, amik nincsenek a BeachPool-ban + * + * @param poolContent + * Egyszintu BeachPool lista + * @throws Exception + */ + public LinkedHashSet getPossibelMissingMaterialNames(List poolContent) throws Exception { + //get sortable + List sortedMediaUsages = querySortableMedias(); + //sort by earliestusagetime + Collections.sort(sortedMediaUsages, new MediaUsageComparator()); + //normalize + LinkedHashSet result = normalizeName(sortedMediaUsages); + //collect more + LinkedHashSet otherMedias = queryOtherMedias(result); + result.addAll(otherMedias); + //get only realy missing + if (poolContent != null) + result.removeAll(poolContent); + return result; + + } + + public void init(String primaryEndPoint, String primaryUserName, String primaryPassword, String secondaryEndPoint, String secondaryUserName, + String secondaryPassword, int rangeForwardHours) throws Exception { + this.wsdlURL = PBClientTest.class.getClassLoader().getResource("MarinaAPI.wsdl"); + this.primaryMarinaAPI = createPBMarinaAPI(primaryEndPoint, this.wsdlURL, primaryUserName, primaryPassword); + if (StringUtils.isNotBlank(secondaryEndPoint)) + this.secondaryMarinaAPI = createPBMarinaAPI(secondaryEndPoint, this.wsdlURL, secondaryUserName, secondaryPassword); + + this.rangeForwardHours = rangeForwardHours; + } + + /*** + * A nem ures media neveket kisbetusse konvertalja + * + * @param mediaUsages + * @return + */ + private LinkedHashSet normalizeName(List mediaUsages) { + LinkedHashSet result = new LinkedHashSet(); + for (MediaUsage mediaUsage : mediaUsages) { + String name = normalizeName(mediaUsage.getMediaName()); + if (StringUtils.isNotBlank(name)) + result.add(name); + } + return result; + } + + private String normalizeName(String mediaName) { + String result = null; + if (StringUtils.isNotBlank(mediaName)) { + result = mediaName.trim().toLowerCase(); + } + return result; + } + + private LinkedHashSet queryOtherMedias(LinkedHashSet missingMediaFileNames) throws Exception { + + LinkedHashSet ret = new LinkedHashSet(); + + //SOAP Request + GetCustomViewRequestContainer cvReqContainer = new GetCustomViewRequestContainer(); + GetCustomViewRequestContainer.MarinaCustomAPI customApi = new GetCustomViewRequestContainer.MarinaCustomAPI(); + cvReqContainer.setMarinaCustomAPI(customApi); + customApi.setView("cxvMissingMediaPlaylistCache"); //config +++++ + + GetCustomViewResponseContainer cvContainer = null; + try { + //call ws + cvContainer = primaryMarinaAPI.getCustomView(cvReqContainer); + } catch (Exception e) { + logger.error("", e); + if (secondaryMarinaAPI != null) { + cvContainer = secondaryMarinaAPI.getCustomView(cvReqContainer); + } + } + + //remove existing media files from list + if (cvContainer != null) { + MediaList mediaList = cvContainer.getMediaList(); + if (mediaList != null) { + for (Media media : mediaList.getMedia()) { + //CI12345 -> ci12345.mxf + String mediaName = media.getMediaName(); + + if (StringUtils.isNotBlank(mediaName)) { + mediaName = normalizeName(mediaName); + if (!missingMediaFileNames.contains(mediaName)) { + ret.add(mediaName); + } + } else { + logger.error("PBMissingMaterialSrc.getCustomViewMediaList empty filename: " + media.getMediaName()); + } + + } + } + } + return ret; + } + + private List querySortableMedias() throws Exception { + List result = new ArrayList(); + + DateTimecodeRangeContainer rangec = new DateTimecodeRangeContainer(); + DateTimecodeRange range = new DateTimecodeRange(); + + long now = System.currentTimeMillis(); + Calendar cal = Calendar.getInstance(); + cal.setTimeInMillis(now); + cal.add(Calendar.HOUR_OF_DAY, this.rangeForwardHours); //24 + + String fromDateStr = sdf_range.format(new Date(now)); + String toDateStr = sdf_range.format(cal.getTime()); + + //1. SOAP query missing media list + + range.setStart(fromDateStr); //now "2019-03-26T10:00:00:00" + range.setEnd(toDateStr); //now + x hours "2019-03-29T10:00:00:00" + rangec.setDateTimecodeRange(range); + + MediaUsageListContainer mulc = null; + try { + mulc = primaryMarinaAPI.getMediaUsageByUTRange(rangec, false, true); + } catch (Exception e) { + logger.error("", e); + if (secondaryMarinaAPI != null) { + mulc = secondaryMarinaAPI.getMediaUsageByUTRange(rangec, false, true); + } + } + + MediaUsageList mul = mulc.getMediaUsageList(); + + List mediaList = mul.getMediaUsage(); + for (MediaUsage mu : mediaList) { + if (MediaType.VIDEO.equals(mu.getMediaType())) + result.add(mu); + } + return result; + } + +} diff --git a/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/include/MarinaTypes.xsd b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/include/MarinaTypes.xsd new file mode 100644 index 00000000..3861a9d0 --- /dev/null +++ b/server/user.jobengine.osgi.commons/src/user/commons/peablebeach/include/MarinaTypes.xsd @@ -0,0 +1,4510 @@ + + + + + + Scheduling properties for an action. + + + + Enumerated Start Type. + + + + + For Fixed starts this is a date time for Parent Start and End this is a timecode span offset. + + + + + + Aspect Ratio + + + + + + + + + + + + + + + + + + Properties for Aspect Ratio + + + + + + AsRun Action Event + + + + + + + + + + + + + AsRun related values + + + + + List of errors + + + + + + + + The name of the error. + + + + + + + + + + + + + + + + + + + + + + + + + + + The time the state changed. + + + + + The state off the error (On or Off) + + + + + + + + + + + Optional message providing more information. + + + + + + + + + + + The time the event or job started, if it ran. + + + + + The time the event or job ended, if it ran. + + + + + The time the event or duration ran for. + + + + + The final result of the event or job. Either "Completed" or another descriptive string to describe what the result was. + + + + + + + + + + + + + + + + + Either "done" or "disabled". For most events the state will always be "done". For events disabled in the UI they will always have a state of "done". + + + + + + + + + + + The redundancy role used for the OnAir job. e.g. Main. + + + + + The device which was used by this event or job to fulfill it's function (e.g. video stream). + + + + + The source device which was used by this event or job to fulfill it's function (e.g. router). + + + + + The source port which was used by this event or job to fulfill it's function (e.g. router port). + + + + + The destination device which was used by this event or job to fulfill it's function (e.g. router). + + + + + The destination port which was used by this event or job to fulfill it's function (e.g. router port). + + + + + The name of the TxList that this event was played out on. + + + + + + + + + + + The ID of the list that this event was played out on. + + + + + The name of the channel this event was played out on, if redundancy is being used this will be the reudnant list object name. + + + + + The ID of the channel this event was played out on, if redundancy is being used this will be the reudnant list ID. + + + + + + Template for an asrun event. + + + + + The asRunData for this event. i.e. What really happened + + + + + + + + + + + + + + + + + Information about a job that was created to service a list event. + + + + + + + + + + + + The properties used by the embedded job. These may be a subset of the event's properties, or they may have been calculated by the implementation of the job. + + + + + + The type of this job, e.g. Media, Effect, etc + + + + + + + + + + + The role of this job in a redundant pair. + + + + + XPath for the feature properties element for which this job was created. The XPath is relative from the root 'event' element. This attribute may be missing if the job was not created to fulfill a feature. + + + + + + A list of all the jobs created to service a list event. + + + + + + + + Properties of an asrun job. + + + + + + + + + + + + + + + + + + + + + + + AsRun Primary Event + + + + + + + + + + + + + AsRun Event List - contains multiple asRunEvents + + + + + + + + + + + AsRun Secondary Event + + + + + + + + + + + + + AsRun Secondary Event List + + + + + + + + + + + Observations by operators or users. + + + + + The comment typed in by the user. + + + + + + The time the observation was made. + + + + + The name of the user that made the observation. + + + + + + + + + + + The name of the client pc that the observation was made from. e.g. MCRClient1 + + + + + + + + + + + + Supersedes audioTracks, represents both groups and tracks. + + + + + + + + + + + Configuration parameters for encoding. This is free form for now but will be formalised later. + + + + + + + + Any number of free form tags. + + + + + + + + + + + The encoding format used for this track. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 based track index, + + + + + + + + + + + + + + + + + Uniique name for this group. + + + + + + + + + + + + Representation of an audio track + + + + 0 based audio track number + + + + + Number of channels of audio within this track + + + + + Sample rate of audio encoding in kHz + + + + + Encoding format of the audio track (see enum) + + + + + + + + + + + + + Encoding resolution + + + + + Language of audio track + + + + + + + + + + + + Collection of audio tracks + + + + + + + + Enumeration of automation job states. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Properties used by CG media devices + + + + + Template fields go here if required. + + + + + + + + + + + + Required when the type is PassThrough. For some devices this can be used to specify a command to pass directly to the device. + + + + + + + + Required when the type is Transition. For example, can be used to fade up/down a logo. + + + + + + + + + + + + + + + + + Optional properties for dolphin devices. + + + + + + + + + + + + + + + + + Optional Layer + + + + + Option to load at start time instead of loading at cue time and fading up at start time. + + + + + + Three Part Animation stop type enum + + + + + + + + + + + + + + + + + + + + + + + + + Properties for a transmission channel. + + + + Optional name of the channel this list should be played on. + + + + + + + + + + + An optional comment describing what this list is intended for or what it contains. + + + + + Optional date/time that the list should be aired. + + + + + Optional time offset name this list was saved in + + + + + Optional time offset value this list was saved in. This is a timecode span. + + + + + + Representation of a classification of an "object" (e.g. media, mediaInstance, mediaSet) + + + + If true, all the media in the DB and all the one you will create will be given the default category as value. If false, they won't have any category assigned. + + + + + The name of the classification e.g. "Program Type" or "Rating" + + + + + + + + + + + The name of the category within this classification e.g. "Trailer", "Advertisement" or "18+" + + + + + + + + + + + + Collection of classifications + + + + + + + + A representation of a component. + + + + + + + + + + + + Required attributes for a component. + + + + + + + + + + + + + + + + + + + + + + + + + A list of components. + + + + + + + + + + + + + + + + + + + + + PBS date time that excludes timezone. + + + + + + + + + + + + + + + + Can either be a dateTimecode or a Timecode + + + + + + + + + + + + Representation of a timecode range (start -> end) + + + + + + + Representation of a delete media request + + + + + Collection of deleted media instances + + + + + + Delete information for a media instance + + + + + + + + + + + Representation of a delete media instance request + + + + Name of server or tape on which this instance is located + + + + + Indicates whether the media instance was successfully deleted or not + + + + + + + + + + + + Properties for Dolphin CG jobs. + + + + Media name of CG event to display. + + + + + + + + + + + X Position in percent (60.7pc) or pixels (100pi) + + + + + + + + + + Y Position in percent (60.7pc) or pixels (100pi) + + + + + + + + + + X dimension scale. For example 1.0 is image size, 2.0 twice size, 0.5 half size. + + + + + Y dimension scale. For example 1.0 is image size, 2.0 twice size, 0.5 half size. + + + + + Maximum opacity level when on 0.0 less than nOpacity less than or equal to 1.0 + + + + + Graphic layer priority. Default is 1. Higher priority graphic elements will be displayed over the top of lower ones. + + + + + Enumerated value includes values such as Cut, Cut Fade, Mix, Wipe, U-Fade etc. + + + + + Transition time in frames from opacity 0 (off) to n (on) + + + + + + + + + + As per onTransitionType enum but for the off transition. + + + + + Transition time in frames from opacity n (on) to 0 (off). + + + + + + Dolphin graphic properties + + + + + + + + + + + the defered start time + + + + + latency between list and dolphin device + + + + + name of dolphin CG + + + + + on or off + + + + + + + + + + + + Properties for effects + + + + + The device port the effect will occur on + + + + + + + + the type of transition required (cut, mix etc) + + + + + how fast should the transition be? + + + + + + + + + the type of transition required (cut, mix etc) + + + + + how fast should the transition be? + + + + + 0% is off, 100% is fully on. + + + + + + + + + + + optional. Can be used alongside other rules to adjust the PGM volume when adding an audio over. + + + + + + + + + + + + + + + the type of transition required (cut, mix etc) + + + + + how fast should the transition be? + + + + + this can be a specific logo name or logo number as used in the physical device. + + + + + + + + + + + + + M2100 specific effect + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + digital video effects properties + + + + + the dve sequence name, number or id to be used. + + + + + option to override the dve's configured duration if supported by the device. + + + + + + + + + + + + + + + + + + + + + + + + based on type selected the appropriate child element should be completed + + + + + + + + + + + Option to override the defualt list validation of these properties. Off turns off all validation. Warn sets warnings when errors are found. Update will update the properties with the correct data if it's wrong. + + + + + + + M2100 specific effect + + + + + the type of transition required (cut, mix etc) + + + + + how fast should the transition be? + + + + + 0% is off, 100% is fully on. + + + + + + + + + + + audio clip file to load as understood by the M2100 + + + + + + + + + the type of effect that is required. The matchin child element then also needs to be completed. + + + + + + + + + + + + + + + the name of the effect that is to be triggered. For example "AudioOver1, AudioOver2, DVE". These names are sourced from the third party device itself and are not configurable. + + + + + + + + + + + + Classification used in a list event where 'AutoAssociate' doesn't make sense. + + + + + + + + Collection of event classifications + + + + + + + + + + + + Properties for automation list events. + + + + + + + + + + + + + + + + + + + + + + + + the houseID is a media level piece of data. However in many cases the PBS database may not be populated with this houseID information. This attribute allows the houseId to be displayed in the playlist UI. Note that it does NOT get updated into the database; or used in any way. It is for visual purposes only. + + + + + Option to override the defualt list validation of these properties. Off turns off all validation. Warn sets warnings when errors are found. Update will update the properties with the correct data if it's wrong. + + + + + + + + + + + + + + + Properties allowed for an event feature. + + + + + You can have any number of additional features but only one of each type. + + + + + + + + + + + + + + + + + + + custom field name + + + + + value associated with the custom field name + + + + + + + + + + + + + + + The type of this feature. The properties valid for a feature depend on its type. + + + + + + + + + A instance of a health flag applicable to a component. + + + + + + A list of all health flags applicable to a component + + + + + + + + A representation of a connection heartbeat + + + + + Concession for custom metadata + + + + + + + + + + + + Properties for keeping track of object history. + + + + + + + Name of the user that created this object. + + + + + + + + + + Date and Time of creation. + + + + + Optional comment by author. + + + + + + + + + Name of the user that modified this object. + + + + + + + + + + Date and Time of modification. + + + + + Optional comment by author. + + + + + + + + Optional source identifier. This could be the original filename for example. + + + + + + Properties used by ingest jobs + + + + + + + + + A single job + + + + + + + + The type of this job. + + + + + + + + + + + + + + This is the internal id for the event which is useful for debugging. It is ignored when loading the list. + + + + + + A List of jobs. + + + + + + + + Properties of a job list. + + + + + + + + + Properties of a job. + + + + + + For jobs that operate on media. + +You must at least specify the MediaName and Media type, however you can specify much more information if required. + +For example +1.) if you want to delete all instances of a piece of media the just specify the MediaName and MediaType, then set "global" to true on the delete element. +2.) if you want to delete specific instances of a piece of media then specify which ones using the mediaInstances element. + +When ingesting material the meta data specified here is used to update the media database. + + + + + Can be specified for transfer jobs. + +If the transfer is an ingest job this gives a hint as to the final destination of the media but can be overridden by the operators. + +For all other types of transfer this MUST be specified. + + + + + Must be specified for delete jobs. + +At present there are no individual delete properties but an empty element must exist. + + + + + States whether the job is confirmed for deletion. + + + + + States whether the job will delete all media instances across the system. + + + + + States whether the job will delete the media record. + + + + + Informs whether the delete job is a cross domain one. + + + + + + + You can use this to specify the priority of the job, + +It's not used for all type of job and is assumed to be low priority if it's omitted. + + + + + For ingest transfer jobs you can specify the som, duration and video properties where the jobType will always be record. + + + + + + + + State of a job. + + + + The job's current state. + + + + + A hint describing the job's state. + + + + + DateTime the job's state was last modified by the system. + + + + + + A single item to keep + + + + + + + This is the internal id for the keep item which is useful for debugging. It is ignored when loading the list. + + + + + + Properties of a keepItem + + + + + The media name/type of the item that needs to be kept + + + + + + + + + + + + + + + + + + + + + + + + For how long must the item(s) be kept? this expiry time denotes when the item no longer needs to be forcibly kept above other rules in the system. + + + + + + + + + + + A List of items to keep + + + + + + + + Properties of a keep list. + + + + + + + + A representation of a group of languages. + + + + + + + + Representation of a last update time timecode range (start -> end) + + + + + + + Collection of layers + + + + + + + + + + + + + + + Date for list stream allocation + + + + + + + + + + + + + + + + + + + + Properties used by automation lists for allocation + + + + + if type = listStream then this must be completed + + + + + + + + + + + + + + Properties for a macro event. + + + + The value of the macro. e.g. If the event type is Logo this may be LogoOn or LogoOff. + + + + + + A named collection of markup items + + + + + Representation of a segment or keyframe + + + + + + The name of the markup to which the markupItems belong. + + + + + + + + + + + Indicates whether the markup item data represents the complete markup, or only an incremental update. + + + + + + Representation of a segment or keyframe. Presence of a valid duration indicates a segment, otherwise interpreted as a keyframe. + + + + The type of the markup item. If "Template" the item represents an item in a predefined template. If "Dynamic" the item is not part of a template. It is possible to mix dynamic and template items in a single markup. + + + + + + + + + + + The 1 based position of the item within the markup. + + + + + + + + + + The name of the item (e.g. "Part1", "Break") + + + + + + + + + + + The timecode of the start of a segment or the position of a keyframe. + + + + + The duration of a segment. This attribute should be absent when specifying a keyframe. + + + + + A user defined comment that may be displayed in certain user interfaces. + + + + + + + + + + + For non-thumbnail types this value stores the offset from the SOM for the thumbnail. + + + + + + Collection of markup elements + + + + + A named collection of markupItems + + + + + + + Representation of a piece of media with associated metadata. Make sure the creationTime is in the format 2017-03-23T14:11:00 [YYYY-MM-DD]T[HH:MM:SS] otherwise XML validation will fail. + + + + + Concession for custom metadata + + + + + + + + + + + + + + + + + + + + + + + + + Optional title for media + + + + + + + + + + + Original SOM where media was located on tape (only used if media is scheduled by OrigSOM) + + + + + DateTime this media was first seen by the system + + + + + DateTime this media was last modified by the system + + + + + Internal Marina media UID + + + + + Optional house Id for media + + + + + + + + + + + Optional alternate Id for media + + + + + + + + + + + Date and time media becomes valid + + + + + Date and time media becomes invalid + + + + + The number of times this media has been played to air. + + + + + The date and time that this media was first played to air. + + + + + The date and time of the last time this media was played to air. + + + + + Free text field for any media notes + + + + + + + + + + + + Representation of the metadata for an instance of a piece of media. This type is intended to be embedded inside an element with a specified mediaKey + + + + + Concession for custom metadata + + + + + + + + + + + + + + + + Textual hint for this version + + + + + + + + + + + Duration of this instance + + + + + Time at which this instance started creation + + + + + Time at which this instance ended creation + + + + + Textual hint set during the creation process + + + + + + + + + + + + Internal Marina media instance UID + + + + + Size of the media in bytes + + + + + Source url of the media instance + + + + + Destination URL of the media instance + + + + + When deleting media, set this to true to delete all instances in the specified mediaSet. For example, on a device supporting subdirectories, delete from all subdirectories. + + + + + + Composite Key for MediaInstance + + + + Name of server or tape on which this instance is located + + + + + + + + + + + Version number of media instance + + + + + Position of this instance on a data tape, OR the instanceSOM for a tape/server instance + + + + + Directory in which this instance is located (only used for raw file systems e.g. NAS, FTP). If not specified defaults to the root of the device. + + + + + + + + + + + Filename of this instance on the file system (only used for raw file systems e.g. NAS, FTP) + + + + + + + + + + + The internal Id of the directory containing the media instance. + + + + + + Composite Key for MediaInstance but where all attributes are optional + + + + Name of server or tape on which this instance is located + + + + + + + + + + + Version number of media instance + + + + + Position of this instance on a data tape, OR the instanceSOM for a tape/server instance + + + + + Directory in which this instance is located (only used for raw file systems e.g. NAS, FTP) + + + + + + + + + + + Filename of this instance on the file system (only used for raw file systems e.g. NAS, FTP) + + + + + + + + + + + + Collection of media instances + + + + + + + + Properties of a media instance + + + + + This is depreciated use the audio tag instead. + + + + + Audio and Audio Group metadata. + + + + + Collection of classifications + + + + + + + Representation of the usage of a media instance + + + + Name of server or tape on which this instance is located + + + + + Flag to indicate that the media instance exists on the specified media set + + + + + The latest time at which this media instance is required for playout. + + + + + The media instance last usage tx list name. + + + + + + + + + + + The last usage event UID assigned by the list. + + + + + The earliest time at which this media instance is required for playout. + + + + + The media instance earliest usage tx list name. + + + + + + + + + + + The earliest usage event UID assigned by the list. + + + + + The unique instance id for this usage instance. + + + + + + Composite key for media + + + + Textual identifier for a piece of media (e.g. server id) + + + + + Type of media (see enum) + + + + + + Representation of a collection of media. 0 or more instances may also be specified + + + + + + + + + + + + + + Properties of a piece of media. Does not include properties of instances of that media + + + + + Collection of classifications + + + + + Collection of markups + + + + + + + Properties for segmenting media. + + + + + + + The name of the item (e.g. "Part1", "Break") + + + + + + + + + + + The 1 based position of the item within the markup. + + + + + + + + + + + + + + + + + + + + + + Option to override the defualt list validation of these properties. Off turns off all validation. Warn sets warnings when errors are found. Update will update the properties with the correct data if it's wrong. + + + + + + Representation of a piece of media with associated metadata. Make sure the creationTime is in the format 2017-03-23T14:11:00 [YYYY-MM-DD]T[HH:MM:SS] otherwise XML validation will fail. + + + + + Concession for custom metadata + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Composite key for media set + + + + Textual identifier for a media set (e.g. server name) + + + + + Type of media set (see enum) + + + + + + + + + + + + + + + + + + + + + + + + A simple representation of a piece of media, used in the list and other places where only the key is required. + + + + The unique name for the media, also know as MediaId. + + + + + The type of the media, e.g. Video or Subtitle. + + + + + + A simple representation of a piece of media, but where all attributes are optional. Used in the keep list + + + + The unique name for the media, also know as MediaId. + + + + + The type of the media, e.g. Video or Subtitle. + + + + + + + + + + + + + Media Stream Job Properties + + + + + + + + + + Allocation is not used in all lists. + + + + + + + + + + + + + + + + + + + Representation of a piece of media's usage and availability in the system + + + + + Collection of media instance usage records. This is only returned if the media is actually being used in a playlist. + + + + + + Usage information for a media instance + + + + + + + + + + + Representation of a collection of media usage elements + + + + + + + + Used in media and job lists to show if there are more results than could be returned + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An action is a single shot event that performs one task only. It has no duration and no monitoring. + + + + + The properties required for an event depend on its type. See the playlist documentation for more details. + + + + + The are the events secondaries. Marina supports a maximum of three levels from the root (primary) event so you can have two levels of secondary events. + + + + + optional state node + + + + + + + + Properties for effects in the context of a playlistActionEvent + + + + + + The status of the effect, i.e. On or Off + + + + + + + + Properties allowed for an action event. + + + + + + + + + + + + + + + Attributes for a playlist event. + + + + The type of this event, this could be one of the default enumerations or a custom type for a specific customer or site. + + + + + A disabled event is ignored by the list. If omitted this value is assumed to be true. + + + + + If true the event can be used as a maker for list timers. If omitted it is assumed to be false. + + + + + The internal Id of the event. Useful for debugging and is ignored on list load. + + + + + Manual Secondary event tag. Useful for catching such jobs. If omitted it is assumed to be false + + + + + + A single playlist event. + + + + + Optional state node + + + + + The properties required for an event depend on it's type. See the playlist documentation for more details. + + + + + The child events are this event's secondaries. Marina supports a maximum of three levels from the root event. + + + + + + + + A List of primary events. + + + + + + + + Properties of a playlist event + + + + + + + + + + + + + + + + + + + + + Properties of a playlist + + + + + + + + + + + + A secondary event, can have a start, end or start and end. This allows starting an event (logo on) with one secondary and stopping it (logo off) with another secondary. + + + + + Optional state node + + + + + The properties required for an event depend on its type. See the playlist documentation for more details. + + + + + The are the events secondaries. Marina supports a maximum of three levels from the root (primary) event so you can have two levels of secondary events. + + + + + + + + A List of secondary events and actions. + + + + + + + + + + + Properties of a secondary event. + + + + + + + + + + + + + + + Scheduling properties for a primary event + + + + + + Enumerated End Type + + + + + Offset or Duration + + + + + + + + Internal properties for a priority. + + + + + + + The time for which the request is required by. + + + + + + + + + The priority level (Low, Medium or High). + + + + + + + + + + + + + + + The type of the priority (RequiredTime or Relative). + + + + + + + + + + + + + + + + + + Properties used by automation lists for record sources + + + + + + + Specifies a type of automatic record, e.g. PrimaryVideo + + + + + + + + + + + If "Auto" is selected the auto child element should be completed, otherwise an explicit source can be defined in the switch properties of the event. + + + + + + + + + + + + Redundancy Role + + + + + + + + + Resource request parameters + + + + + Information about who is making the request. Most of the attributes are for the UI renderers. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Used for RML requests, controlled by parent's type attribute. + + + + + + The name of the requested resource. Media set name in case of tape, Media Set Location Address Id in case of bin and device name in case of RML device. + + + + + + + + For requests of type 'Media' the media properties must also be filled in. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Properties of restricting xml loading. + + + + The name of the channel the list has been created for. + + + + + + + + + + + End Type for a scheduled event. + + + + + + + + + + + + + A single scheduled job + + + + + + + + The type of this job. + + + + + + + + + + This is the internal id for the event which is useful for debugging. It is ignored when loading the list. + + + + + + A List of scheduled jobs. + + + + + + + + Properties of a scheduled job. + + + + + Contains data which is used to control the scheduling of this job. + + + + + For jobs that operate on media. +When ingesting material the meta data specified here is used to update the media database. + + + + + Typically this would be an input on a router, but could also be a media stream. + + + + + + Here you can specify the source to be switched to the destination media streams. + + + + + If the source is video. Here you can specify the som, duration and video properties for the source media. The jobType should always be Play. + + + + + + + + + + + + + + + + + + + Here you can specify the som, duration and video properties for each destination stream. The jobType should always be Record. + + + + + + Control default overwrite behaviour. + + + + + Only valid when jobType="record". If omitted explicit is assumed. Explicit uses the SOM set in the mediaStreamElement. TimeOfDay uses the house timecode of when the recording started. + + + + + + + + + + + + + + + + + + + + + + + Here you can specify the som, duration and video properties for each review stream. The jobType should always be Play. + + + + + + + + + + + + + + + Scheduling properties for a scheduled job + + + + Enumerated Start Type. + + + + + For Fixed starts this is a date time for Parent Start and End this is a timecode span offset. + + + + + Enumerated End Type + + + + + Offset or Duration + + + + + + Start Type for a scheduled event. + + + + + + + + + + + + + + A List of secondary jobs. + + + + + + + + Scheduling properties for a secondary event + + + + Start type is optional and is used to turn an event on. Specify only the end type to turn an event off. + + + + + For Fixed starts this is a date time for Parent Start and End this is a timecode span offset. + + + + + Set this if you want to turn off a secondary event. If you specify both a startType and an endType you can turn an event on/off in a single event. It is not valid to have an end type of Duration if you have not specified a startType. + + + + + Offset or Duration + + + + + + The slot name can be one of the default enumerations or customers can have site specific slot names for GPI card slots. + + + + + + + + + + + + + Enumeration of the default slot types. + + + + + + + + + + + + + + + Enumeration of time status of an event + + + + + + + + + + + + + + + + Enumeration of status types. + + + + + + + + + Properties for the status of the playlist when the mpl was created. + + + + + + + + Size of the active region. + + + + + Number of events in the playlist. + + + + + Prefered redundancy role for media. + + + + + Prefered redundancy role for live. + + + + + Focus index. + + + + + State of the TxList, as flags separated by an OR operator |. E.g. listState="Primary Prepared|Primary Running|Primary OnAir". + + + + + + Subtitle Captioning Mode. + + + + + + + + + + + + + Properties used for subtitle parameters. + + + + + + + + + + + + + + Set's the subtitle source such as File or Live. If omitted File will be assumed. + + + + + + + + + + + Sets the subtilers captioning mode. + + + + + Profile number sent to Subtitle device under the guise of setting. This recalls profiles on the device to apply to the subtitle output i.e. HD/SD, font, colour, etc. + + + + + + Allocation properties for a switch + + + + + + + + The type of auto allocation. i.e. "MediaStream". + + + + + + + + + + + + + + + + + + A name of a preconfigured allocation. + + + + + + + + + + + + + + + The name of the device to switch. + + + + + + + + + + + Port on the device to switch. This can either be the port name or number. + + + + + + + + + + + + + + + Indicates the appropriate child element should be created. + + + + + + + + + + + + + + + Properties for jobs that contain switches + + + + + + Source is mandatory however this can be specified using default properties in Marina and is therefore optional for a playlist. + + + + + Destination is mandatory however this can be specified using default properties in Marina and is therefore optional for a playlist. + + + + + + + + The transition type. Usually only master control switchers support transitions, if you set a transition that is not supported or you don't set a transition a Cut will be used. + + + + + The rate of the transition. Usually only master control switchers support transitions, if you set a rate that is not supported or you don't set a rate Fast will be used. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A representation of a system object + + + + + + + + + + + + + + + Offset for the Local Time. + + + + + House Time. + + + + + + Internal properties for a transfer. + + + + + The transfer's destination. + + + + + + The type of the transfer (Copy or Move). + + + + + + + + + + + + Internal properties for a transfer destination. + + + + The mediaSet for the destination. + + + + + The mediaName as created on the destination. + + + + + Whether or not an existing destination instance should be overwritten. + + + + + + Properties for trigger jobs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The usage type can be one of the default enumerations or customers can have site specific usage types. + + + + + + + + + + + + + Enumeration of the default usage types. + + + + + + + + + + + + + + + + + + + + A representation of a user object. + + + + + Concession for custom metadata + + + + + + + + + + + + + + + + + + + A representation of a user group object. + + + + + Concession for custom metadata + + + + + + + + + + + + + Properties Validation Mode + + + + + + + + + + + + + + + Properties used by video media devices + + + + Used for ingest and tape playout in the playlist. + + + + + Play or Record + + + + + + + + + + + Only valid when jobType="record" + + + + + Only valid when jobType="record". If omitted explicit is assumed. Explicit uses the SOM set in the mediaStreamElement. TimeOfDay uses the house timecode of when the recording started. + + + + + + + + + + + Controls how the SOM is written to the media during a record. + + + + + + + + + + + + When set to true auto routing will be disabled and any explicit routing in the switchProperties xml will be ignored. + + + + + + Properties for a VPS event + + + + Aspect ratio of video. + + + + + 4 characters max with optional padded whitespace. + + + + + + + + + + + + Suitable for children true/false. + + + + + The type of time to send. If set to 'time' you must sepcify the dateTime attribute. + + + + + + + + + + + + + Date and time in the format 'dd-mmThh:mm' + + + + + + + + + + Type of audio. + + + + + + + + + + + diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java index 82eecdf7..a7ffedd5 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java @@ -17,8 +17,8 @@ import user.tsm.client.TSMBufferedClient; public class TSMLister implements IDirectoryLister { - private static final String FSNAME = File.separator + "JOBENGINE"; - private static final String HLNAME = File.separator + "JOBENGINE"; + private static final String FSNAME = File.separator + System.getProperty("tsm.fsname", "JOBENGINE"); + private static final String HLNAME = File.separator + System.getProperty("tsm.hlname", "JOBENGINE"); private static final Logger logger = LogManager.getLogger(); private TSMBufferedClient client; diff --git a/server/user.jobengine.osgi.db/META-INF/MANIFEST.MF b/server/user.jobengine.osgi.db/META-INF/MANIFEST.MF index dae95dba..03d3ebc7 100644 --- a/server/user.jobengine.osgi.db/META-INF/MANIFEST.MF +++ b/server/user.jobengine.osgi.db/META-INF/MANIFEST.MF @@ -6,18 +6,20 @@ Bundle-Version: 1.0.0 DynamicImport-Package: * Bundle-ClassPath: . Require-Bundle: user.jobengine.osgi.commons;bundle-version="1.0.0", - com.ibm.db2jcc4;bundle-version="4.19.26", com.ibm.nosql;bundle-version="4.19.26";visibility:=reexport, org.jmock.junit4;bundle-version="2.6.0", org.junit;bundle-version="4.12.0", - org.jmock;bundle-version="2.6.0" + org.jmock;bundle-version="2.6.0", + com.ibm.db2.jcc;bundle-version="1.4.0" Service-Component: OSGI-INF/component.xml Bundle-ActivationPolicy: lazy Import-Package: com.fasterxml.jackson.annotation;version="2.4.5", + com.ibm.db2.jcc, javax.ws.rs.client, javax.ws.rs.core, org.apache.commons.io;version="2.2.0", - org.apache.logging.log4j;version="2.8.2" + org.apache.logging.log4j;version="2.8.2", + sqlj.runtime.ref Export-Package: user.jobengine.db, user.jobengine.search diff --git a/server/user.jobengine.osgi.db/deploy.launch b/server/user.jobengine.osgi.db/build-db-module.launch similarity index 100% rename from server/user.jobengine.osgi.db/deploy.launch rename to server/user.jobengine.osgi.db/build-db-module.launch diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java index 9f80794c..ec8c788e 100644 --- a/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java @@ -102,6 +102,8 @@ public interface IItemManager extends IEntityPersister { void disconnect(); + StoreUri ensureUri(String storeName, String uri, boolean isSystem, boolean isLowres, RemoteStoreProtocol protocol); + void executeQuery(Connection connection, String query, IResultSetConsumer consumer, IStatementDecorator decorator); void executeQuery(String query, IResultSetConsumer consumer, IStatementDecorator decorator); @@ -127,6 +129,8 @@ public interface IItemManager extends IEntityPersister { */ List getAll(Class type, long id); + // long getExistingRundownMedia(String houseid); + /** * Visszaadja egy átmeneti tárolóban tárolt entitás listáját. * @@ -135,8 +139,6 @@ public interface IItemManager extends IEntityPersister { */ List getAllCached(Class baseClass); - // long getExistingRundownMedia(String houseid); - /** * Visszaadja az entitásnak megfelelő DAO objektumot. * diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java index a7038b68..52c4849f 100644 --- a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java @@ -452,6 +452,27 @@ public class ItemManager extends MemoryCache implements IItemManager { traceOut(); } + @Override + public StoreUri ensureUri(String storeName, String uri, boolean isSystem, boolean isLowres, RemoteStoreProtocol protocol) { + Store store = getStore(storeName); + StoreUri result = null; + if (store == null) { + store = createStore(storeName, isSystem, isLowres); + store.add(); + } else + result = store.getStoreUri(protocol); + + if (result == null) { + result = createStoreUri(protocol, uri); + result.setSource(true); + result.setTarget(true); + result.setStoreId(store.getId()); + result.add(); + } + result.setPersister(this); + return result; + } + @Override public void executeQuery(Connection connection, String query, IResultSetConsumer consumer, IStatementDecorator decorator) { ResultSet rs = null; @@ -1210,8 +1231,8 @@ public class ItemManager extends MemoryCache implements IItemManager { message = e.getClass().getName(); StackTraceElement element = Thread.currentThread().getStackTrace()[2]; message += String.format(", source: %1$s.%2$s", element.getClassName(), element.getMethodName()); - if (logger != null) - logger.error(message, e); + // if (logger != null) + // logger.error(message, e); throw new ItemManagerException(message); } } diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/Store.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/Store.java index 167eb6d3..ee580d3e 100644 --- a/server/user.jobengine.osgi.db/src/user/jobengine/db/Store.java +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/Store.java @@ -29,9 +29,25 @@ public class Store extends EntityBase implements Serializable { public StoreUri getSourceStoreUri(RemoteStoreProtocol protocol) { StoreUri result = null; List uris = getStoreUris(); - for (StoreUri uri : uris) { - if (uri.getProtocol().equals(protocol)) { - if (uri.isSource()) { + if (uris != null) { + for (StoreUri uri : uris) { + if (uri.getProtocol().equals(protocol)) { + if (uri.isSource()) { + result = uri; + break; + } + } + } + } + return result; + } + + public StoreUri getStoreUri(RemoteStoreProtocol protocol) { + StoreUri result = null; + List uris = getStoreUris(); + if (uris != null) { + for (StoreUri uri : uris) { + if (uri.getProtocol().equals(protocol)) { result = uri; break; } diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/search/MediaFinder.java b/server/user.jobengine.osgi.db/src/user/jobengine/search/MediaFinder.java index 61909434..3152ba10 100644 --- a/server/user.jobengine.osgi.db/src/user/jobengine/search/MediaFinder.java +++ b/server/user.jobengine.osgi.db/src/user/jobengine/search/MediaFinder.java @@ -3,7 +3,6 @@ package user.jobengine.search; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; -import java.sql.SQLException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; @@ -28,9 +27,8 @@ public class MediaFinder implements IMediaFinder { this.manager = manager; } - private PreparedStatement createStatement(Connection connection, String criteria, List typeIDs, SearchOptions options) throws SQLException { + private PreparedStatement createStatement(Connection connection, String criteria, List typeIDs, SearchOptions options) throws Exception { StringBuilder typeCriteria = getTypeCriterias(typeIDs); - String criteriasPattern = getCriteriasRegexPattern(criteria); StringBuilder sql = new StringBuilder(); @@ -56,7 +54,7 @@ public class MediaFinder implements IMediaFinder { } if (criteria != null && criteria.trim().length() > 0) - sql.append(" AND CONTAINS(md.description, ?) >= 1"); + sql.append(" AND CONTAINS(md.description, '" + criteria + "') >= 1"); if (options.getSearchFrom() != null) { sql.append(String.format(" AND m.archived > '%s'", df.format(options.getSearchFrom()))); @@ -80,8 +78,11 @@ public class MediaFinder implements IMediaFinder { logger.info(query); PreparedStatement st = connection.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); - if (criteria != null && criteria.trim().length() > 0) - st.setString(1, criteria); + // Ettol elszall a 11.5-on a kereses + // if (criteria != null && criteria.trim().length() > 0) { + // st.setString(1, criteria); + // logger.info("Parameter is {}", criteria); + // } return st; } diff --git a/server/user.jobengine.osgi.server/WEB-INF/web.xml b/server/user.jobengine.osgi.server/WEB-INF/web.xml index 6caf8c81..38cff511 100644 --- a/server/user.jobengine.osgi.server/WEB-INF/web.xml +++ b/server/user.jobengine.osgi.server/WEB-INF/web.xml @@ -1,9 +1,14 @@ - - + + + + Media Archivum - zkLoader ZK loader for ZUML pages @@ -29,31 +34,26 @@ - - zkLoader - *.zul - + + + + - - zkLoader - *.zhtml - + + + + - - auEngine - /zkau/* - + + + + action-route /actions/* - - - - - 60 @@ -69,6 +69,8 @@ default.jsp index.zhtml + + diff --git a/server/user.mediacube.metadata/META-INF/MANIFEST.MF b/server/user.mediacube.metadata/META-INF/MANIFEST.MF index ce18ea2c..9e6b6ca5 100644 --- a/server/user.mediacube.metadata/META-INF/MANIFEST.MF +++ b/server/user.mediacube.metadata/META-INF/MANIFEST.MF @@ -11,7 +11,7 @@ DynamicImport-Package: * Require-Bundle: org.mybatis.mybatis;bundle-version="3.5.2", org.junit;bundle-version="4.12.0", com.microsoft.sqlserver.sqljdbc, - com.ibm.db2jcc4;bundle-version="4.19.26" + com.ibm.db2.jcc;bundle-version="1.4.0" Bundle-ActivationPolicy: lazy Import-Package: com.ibm.nosql.bson, com.ibm.nosql.json.api,