From aef3acdc5e66559b2f6434397b74cbf09f3d5c30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Tue, 13 Feb 2018 22:01:40 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30900 --- .../Configuration/configuration-grafika1.json | 80 ------------- client/Maestro/Maestro.csproj | 3 - client/Maestro/MaestroForm.Target.cs | 1 + client/Maestro/Properties/AssemblyInfo.cs | 4 +- server/-product/mediacube.product | 39 +++---- server/-product/pom.xml | 7 +- .../jobtemplates/import-statistics.xml | 7 ++ .../src/obsolate/TranscodeStep.java | 15 ++- .../CopyForArchiveNEXIORecordingsStep.java | 28 ++++- .../server/steps/FakeNoParamsStep.java | 14 ++- .../server/steps/ImportStatisticsStep.java | 18 +++ .../server/steps/OctopusDataMiner.java | 2 +- .../pages/joblist.zul | 108 ++++++++++-------- .../pages/jobselector.zul | 63 +++++++--- .../pages/missingmaterials.zul | 2 +- .../src/user/jobengine/server/IJobEngine.java | 3 +- .../src/user/jobengine/server/JobEngine.java | 23 ++-- .../jobengine/server/JobStepExecutor.java | 3 +- .../user/jobengine/zk/model/JobElement.java | 28 ----- .../user/jobengine/zk/model/JobListModel.java | 60 ++++++---- .../jobengine/zk/model/JobSelectorModel.java | 44 ++++--- .../zk/model/MissingMaterialsModel.java | 14 --- .../zk/util/DesktopCleanupListener.java | 2 +- 23 files changed, 285 insertions(+), 283 deletions(-) delete mode 100644 client/Maestro/Configuration/configuration-grafika1.json create mode 100644 server/user.jobengine.executors/jobtemplates/import-statistics.xml create mode 100644 server/user.jobengine.executors/src/user/jobengine/server/steps/ImportStatisticsStep.java delete mode 100644 server/user.jobengine.osgi.server/src/user/jobengine/zk/model/JobElement.java diff --git a/client/Maestro/Configuration/configuration-grafika1.json b/client/Maestro/Configuration/configuration-grafika1.json deleted file mode 100644 index 3e23f552..00000000 --- a/client/Maestro/Configuration/configuration-grafika1.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "title": "Grafikai feltöltő", - "active": true, - "startInTray": false, - "enableCustomMetadataId": true, - "player": { - "enabled": true, - "autoStart": false, - "segmentEditor": false - }, - "source": { - "$type": "UNCSource", - "filter": "png,tga,mov,mxf", - "local": { - "address": "file://C:/x/", - "userName": "mediacube", - "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", - "timeout": 1000 - } - }, - "metadatas": [ - { - "$type": "OctopusMetadata", - "server": { - "address": "http://10.10.1.27/services/rest/octopus/", - "timeout": 1000 - } - }, - { - "$type": "TrafficMetadata", - "server": { - "address": "Data Source=10.10.1.45\\sql16;Initial Catalog=PA_Echo;Persist Security Info=True;", - "userName": "MAM", - "password": "7RKZYBzumKjL40SJwuwiFCvX57xuCN8zay6OttUm2wbrgImyYZBHyZTUUYrXX31Ge2Uwew07HYsqh2uzdJeDBDwcVntxaHg3nIpv9Dyq/odVoiC4tUF/K+lgvKWANcrZ", - "timeout": 1000 - } - }, - { - "$type": "MediaCubeMetadata", - "metadataTitleFormat": "%SOURCENAME%", - "metadataIDFormat": "%SOURCESTARTID%", - "server": { - "address": "http://10.10.1.27/services/rest/jobengine/", - "timeout": 1000 - } - } - ], - "targets": [ - { - "label": "Octopus mappába küldés", - "processor": "FTPTargetProcessor", - "outputFormat": "%SOURCENAME%", - "tag": "Betöltés", - "subFolderFormat": "%IDROOT%-%TEXT%/GRAFIKA-%TIMESTAMP%", - "killDateDays": 15, - "saveArchiveMetadata": false, - "remote": { - "address": "ftp://10.10.1.100/OCTOPUS", - "userName": "mediacube", - "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", - "timeout": 1000 - } - }, - { - "label": "Traffic mappába küldés", - "processor": "FTPTargetProcessor", - "outputFormat": "%SOURCENAME%", - "tag": "Betöltés", - "subFolderFormat": "%IDROOT%-%TEXT%/GRAFIKA-%TIMESTAMP%", - "killDateDays": 30, - "saveArchiveMetadata": false, - "remote": { - "address": "ftp://10.10.1.100/PLAYOUT_NLE", - "userName": "mediacube", - "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", - "timeout": 1000 - } - } - ] -} diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index ad7b5124..76ed944f 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -273,9 +273,6 @@ Always - - Always - Always diff --git a/client/Maestro/MaestroForm.Target.cs b/client/Maestro/MaestroForm.Target.cs index 1174a290..39a40434 100644 --- a/client/Maestro/MaestroForm.Target.cs +++ b/client/Maestro/MaestroForm.Target.cs @@ -149,6 +149,7 @@ namespace Maestro { force |= target.SaveArchiveMetadata || target.SaveMorpheusMetadata || target.NexioServer; if (force && (ArchiveMetadata == null || !ArchiveMetadata.IsFilled)) { ArchiveMetadata = GetArchiveMetadata(); + SelectedMetadata.MetadataText = ArchiveMetadata.itemTitle; UpdateEditArchiveMetadataStatus(); if (ArchiveMetadata == null) { MessageBox.Show(String.Format("A {0} folyamat nem futtatható kísérő adatok nélkül.", target.Label)); diff --git a/client/Maestro/Properties/AssemblyInfo.cs b/client/Maestro/Properties/AssemblyInfo.cs index 8180e131..73085c6a 100644 --- a/client/Maestro/Properties/AssemblyInfo.cs +++ b/client/Maestro/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.7.4")] -[assembly: AssemblyFileVersion("2.0.7.4")] +[assembly: AssemblyVersion("2.0.7.5")] +[assembly: AssemblyFileVersion("2.0.7.5")] diff --git a/server/-product/mediacube.product b/server/-product/mediacube.product index 74e9543b..a039e209 100644 --- a/server/-product/mediacube.product +++ b/server/-product/mediacube.product @@ -9,25 +9,25 @@ -consoleLog -console 5555 - -Xms512m --Xmx1024m --Dfile.encoding=UTF-8 --agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888 --Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory - -#System --Djetty.home=/opt/mediacube/configuration/jetty --Dlog4j.configurationFile=/opt/mediacube/configuration/log4j2.xml --Djobengine.jobsteps.root=/opt/mediacube/configuration/executors --Djobengine.jobtemplates.root=/opt/mediacube/configuration/jobtemplates --Djobengine.jobscheduling.config=/opt/mediacube/configuration/scheduledjobs.json --Dmediacube.auth.location=/opt/mediacube/configuration/mediacube-auth.properties - --Dorg.eclipse.epp.logging.aeri.skipReports=true --Declipse.ignoreApp=true --Dosgi.noShutdown=true --Djobengine.loglevel=INFO --Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml + -Xms512m +-Xmx1024m +-Dfile.encoding=UTF-8 +-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888 +-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory + +#System +-Djetty.home=/opt/mediacube/configuration/jetty +-Dlog4j.configurationFile=/opt/mediacube/configuration/log4j2.xml +-Djobengine.jobsteps.root=/opt/mediacube/configuration/executors +-Djobengine.jobtemplates.root=/opt/mediacube/configuration/jobtemplates +-Djobengine.jobscheduling.config=/opt/mediacube/configuration/scheduledjobs.json +-Dmediacube.auth.location=/opt/mediacube/configuration/mediacube-auth.properties + +-Dorg.eclipse.epp.logging.aeri.skipReports=true +-Declipse.ignoreApp=true +-Dosgi.noShutdown=true +-Djobengine.loglevel=INFO +-Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml -Djava.io.tmpdir=/opt/mediacube/tmp #Database @@ -176,7 +176,6 @@ - diff --git a/server/-product/pom.xml b/server/-product/pom.xml index 66a07dde..35d23307 100644 --- a/server/-product/pom.xml +++ b/server/-product/pom.xml @@ -73,6 +73,12 @@ log4j2.xml + + ${basedir}/../-configuration + + mediacube-auth.properties + + @@ -153,7 +159,6 @@ start-mediacube.sh stop-mediacube.sh - mediacube-auth.properties diff --git a/server/user.jobengine.executors/jobtemplates/import-statistics.xml b/server/user.jobengine.executors/jobtemplates/import-statistics.xml new file mode 100644 index 00000000..f195723d --- /dev/null +++ b/server/user.jobengine.executors/jobtemplates/import-statistics.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/server/user.jobengine.executors/src/obsolate/TranscodeStep.java b/server/user.jobengine.executors/src/obsolate/TranscodeStep.java index 059d6d44..7dc01602 100644 --- a/server/user.jobengine.executors/src/obsolate/TranscodeStep.java +++ b/server/user.jobengine.executors/src/obsolate/TranscodeStep.java @@ -29,24 +29,24 @@ import user.jobengine.server.steps.StepEntry; public class TranscodeStep extends JobStep { private static final Logger logger = LogManager.getLogger(); + private static final String RCC_HOST = "jobengine.rcc.host"; + private static final String RCC_LOWRES_PROFILE = "jobengine.rcc.defaultlowresprofile"; @StepEntry - public Object[] execute(RemoteFile file, String transcoderProfile, IJobEngine jobEngine, IJobRuntime jobRuntime) - throws Exception { + public Object[] execute(RemoteFile file, String transcoderProfile, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { if (file == null) throw new JobEngineException("RemoteFile is null"); - String transcoderHost = System.getProperty(IJobEngine.RCC_HOST); + String transcoderHost = System.getProperty(RCC_HOST); RCCClient client = new RCCClient(transcoderHost); String guid = client.getProfileId(transcoderProfile); if (guid == null) { logger.info("Transcoder profile not exists: " + transcoderProfile + ", using default"); - String profile = System.getProperty(IJobEngine.RCC_LOWRES_PROFILE); + String profile = System.getProperty(RCC_LOWRES_PROFILE); logger.info("Profile : " + profile); profile = StringUtils.strip(profile, "\""); if (profile == null) - throw new JobEngineException( - "System default lowres profile is not configured (missing argument jobengine.rcc.defaultlowresprofile)"); + throw new JobEngineException("System default lowres profile is not configured (missing argument jobengine.rcc.defaultlowresprofile)"); guid = client.getProfileId(profile); if (guid == null) throw new JobEngineException("Default profile not exists on remote host: " + "\"" + profile + "\""); @@ -111,8 +111,7 @@ public class TranscodeStep extends JobStep { lores.setRelativePath(name); mediaFiles.add(lores); } else { - String message = String.format("Job status is %s. Error details: %s", job.getStatus(), - job.getErrorMessage()); + String message = String.format("Job status is %s. Error details: %s", job.getStatus(), job.getErrorMessage()); throw new JobEngineException(message); } break; diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java index 1e58316f..d9220945 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java @@ -5,6 +5,7 @@ import java.net.InetAddress; import java.net.URI; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; @@ -98,9 +99,7 @@ public class CopyForArchiveNEXIORecordingsStep extends JobStep { private void copyFile(FileArchive fileArchive, RundownArchive rundownArchive, StoryArchive storyArchive) throws Exception { String origFileName = fileArchive.getFileName(); - String videoFileName = origFileName + MXFEXT; - - transferFile(videoFileName, videoFileName); + String videoFileName = transferFile(origFileName); BasicDBObject metadata = createMetadata(rundownArchive, storyArchive, fileArchive); transferMetadata(videoFileName, metadata); createSourceKillDateFile(rundownArchive, origFileName); @@ -179,6 +178,20 @@ public class CopyForArchiveNEXIORecordingsStep extends JobStep { return CalendarUtils.createCalendar(CalendarUtils.createCalendar(recordDate), timePart).getTime(); } + private String getTargetFileName(String sourceFileName, String[] names) { + List remoteNames = new ArrayList<>(); + for (String name : names) { + if (name != null) + remoteNames.add(name.toLowerCase()); + } + String result = sourceFileName + MXFEXT; + int version = 1; + while (remoteNames.contains(result.toLowerCase())) { + result = String.format("%s-%d%s", sourceFileName, version, MXFEXT); + } + return result; + } + private RundownArchive processClip(BasicDBObject clip) { RundownArchive result = null; String clipName = NoSQLUtils.asString(clip, LONGNAMEID); @@ -333,15 +346,19 @@ public class CopyForArchiveNEXIORecordingsStep extends JobStep { } - private void transferFile(String sourceFileName, String targetFileName) throws Exception { + private String transferFile(String sourceFileName) throws Exception { + String result = null; int reply = 0; logger.info("Transfer clip {}", sourceFileName); try { sourceFtp = ((FtpDirectoryLister) sourceUri.getLister()).connect(); targetFtp = ((FtpDirectoryLister) targetUri.getLister()).connect(); + if (!targetFtp.enterRemotePassiveMode()) throw new Exception("!PASV"); + result = getTargetFileName(sourceFileName, targetFtp.listNames()); + reply = sourceFtp.port(InetAddress.getByName(targetFtp.getPassiveHost()), targetFtp.getPassivePort()); if (!FTPReply.isPositiveCompletion(reply)) throw new Exception("PORT parancs válasza: " + sourceFtp.getReplyString()); @@ -356,7 +373,7 @@ public class CopyForArchiveNEXIORecordingsStep extends JobStep { if (!targetFtp.setFileType(FTP.BINARY_FILE_TYPE)) throw new Exception("!TARGET TYPE"); - reply = targetFtp.stor(targetFileName); + reply = targetFtp.stor(result); if (!FTPReply.isPositivePreliminary(reply)) throw new Exception("STOR parancs válasza: " + sourceFtp.getReplyString()); @@ -379,6 +396,7 @@ public class CopyForArchiveNEXIORecordingsStep extends JobStep { targetUri.cleanUp(); } + return result; } private void transferMetadata(String fileName, BasicDBObject metadata) throws Exception { diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeNoParamsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeNoParamsStep.java index 20f6f980..61bb5b5b 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeNoParamsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeNoParamsStep.java @@ -5,7 +5,6 @@ import java.util.concurrent.CountDownLatch; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import user.commons.JobStatus; import user.commons.ListUtils; import user.jobengine.server.IJobEngine; import user.jobengine.server.IJobRuntime; @@ -19,8 +18,17 @@ public class FakeNoParamsStep extends JobStep { CountDownLatch latch = new CountDownLatch(count); private void childStatusChanged(JobStatusChangedEvent event) { - if (JobStatus.SUSPENDED.equals(event.getStatus()) || JobStatus.FINISHED.equals(event.getStatus())) + switch (event.getStatus()) { + case CANCELED: + case FINISHED: + case RUNABLE: + case SUSPENDED: latch.countDown(); + break; + default: + break; + } + // if (JobStatus.SUSPENDED.equals(event.getStatus()) || JobStatus.FINISHED.equals(event.getStatus())) } @StepEntry @@ -38,6 +46,8 @@ public class FakeNoParamsStep extends JobStep { // if (i == 8) // throw new Exception("stop"); // } + + //Thread.sleep(100000); for (int i = 0; i < count; i++) { jobEngine.submit(jobRuntime, e -> childStatusChanged(e), CHILD_TEMPLATE, CHILD_TITLE, ListUtils.asMap("itemID", i)); } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/ImportStatisticsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/ImportStatisticsStep.java new file mode 100644 index 00000000..c4f01eb2 --- /dev/null +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/ImportStatisticsStep.java @@ -0,0 +1,18 @@ +package user.jobengine.server.steps; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import user.jobengine.server.IJobEngine; +import user.jobengine.server.IJobRuntime; + +public class ImportStatisticsStep extends JobStep { + private static final Logger logger = LogManager.getLogger(); + + @StepEntry + public Object[] execute(IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + + return null; + } + +} diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/OctopusDataMiner.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/OctopusDataMiner.java index cf3acd5d..9490aa7c 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/OctopusDataMiner.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/OctopusDataMiner.java @@ -45,7 +45,7 @@ public class OctopusDataMiner { private static final String LINEFEED = "\r\n"; private static final String SIMPLE_LINEFEED = "\n"; private static final String SAVING_STORY_ID = "Saving story {}"; - private static final String FIELDS_STORIES = "id,name,modified,type,format,mosObjects,script,customColumns,CustomColumn.label,CustomColumn.value,reporters,User.longName,User.userName"; + private static final String FIELDS_STORIES = "id,name,modified,type,format,mosObjects,script,scheduleFrom,scheduleTo,customColumns,CustomColumn.label,CustomColumn.value,reporters,User.longName,User.userName"; private static final String FIELDS_RUNDOWN = "id,name,modified,scheduledStart,channel,Channel.name,rundownType,RundownType.name"; private static final String FIELDS_RUNDOWN_STORYIDS = "id,slugs,Slug.storyId,Slug.position"; private static final String FIELDS_STORYFOLDER = "id,name,modified"; diff --git a/server/user.jobengine.osgi.server/pages/joblist.zul b/server/user.jobengine.osgi.server/pages/joblist.zul index 6786db73..e507b0a9 100644 --- a/server/user.jobengine.osgi.server/pages/joblist.zul +++ b/server/user.jobengine.osgi.server/pages/joblist.zul @@ -2,26 +2,20 @@ - + - -
- + +
+ - +
@@ -35,38 +29,62 @@
- - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- +
- + \ No newline at end of file diff --git a/server/user.jobengine.osgi.server/pages/jobselector.zul b/server/user.jobengine.osgi.server/pages/jobselector.zul index 07687e2d..65874ab3 100644 --- a/server/user.jobengine.osgi.server/pages/jobselector.zul +++ b/server/user.jobengine.osgi.server/pages/jobselector.zul @@ -1,18 +1,49 @@ - - - - - - - - -     -       Â