"cronexpression": "0 0 0/1 1/1 * ? *",\r
"parameters": [ \r
{"name": "sourcePath", "value": "/mnt/ISILON/ARCHIVE", "type": "java.lang.String"},\r
- {"name": "globalSourcePath", "value": "\\\\10.10.1.100\\BRAAVOS\\ARCHIVE", "type": "java.lang.String"}\r
+ {"name": "globalSourcePath", "value": "\\\\10.10.1.100\\BRAAVOS\\ARCHIVE", "type": "java.lang.String"},\r
+ {"name": "transcoderTargetPath", "value": "/mnt/SELENIO", "type": "java.lang.String"},\r
+ {"name": "webPath", "value": "/mediacube/data/lowres/www/video", "type": "java.lang.String"},\r
+ {"name": "killDateDays", "value": 1, "type": "java.lang.Integer"}\r
]\r
},\r
{\r
Windows mapping\r
net use i: \\10.10.1.100\braavos /user:mediacube Broadca5T /persistent:no\r
net use r: \\10.10.1.100\braavos /user:readonly readonly /persistent:no\r
-
\ No newline at end of file
+ \r
+ \r
+Selenio\r
+-------\r
+ mount -t cifs -o username=root,password=Broadca5T //10.10.1.71/Data/Output/MP4_H264_AAC
\ No newline at end of file
<launcherArgs>\r
<programArgs>-consoleLog -console 5555\r
</programArgs>\r
- <vmArgs>-Dfile.encoding=UTF-8\r
--agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888\r
--Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory\r
-\r
-#System\r
--Dorg.eclipse.equinox.http.jetty.http.port=80\r
--Dorg.eclipse.epp.logging.aeri.skipReports=true \r
--Declipse.ignoreApp=true \r
--Dosgi.noShutdown=true\r
--Djetty.home=./configuration/jetty\r
--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\r
--Dlog4j.configurationFile=./configuration/log4j2.xml\r
--Djobengine.loglevel=INFO\r
--Djobengine.jobsteps.root=./configuration/executors\r
--Djobengine.jobtemplates.root=./configuration/jobtemplates\r
+ <vmArgs>-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
+-Dorg.eclipse.equinox.http.jetty.http.port=80
+-Dorg.eclipse.epp.logging.aeri.skipReports=true
+-Declipse.ignoreApp=true
+-Dosgi.noShutdown=true
+-Djetty.home=./configuration/jetty
+-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
+-Dlog4j.configurationFile=./configuration/log4j2.xml
+-Djobengine.loglevel=INFO
+-Djobengine.jobsteps.root=./configuration/executors
+-Djobengine.jobtemplates.root=./configuration/jobtemplates
-Djobengine.jobscheduling.config=./configuration/scheduledjobs.json\r
</vmArgs>\r
- <vmArgsLin>#Database
--Djobengine.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true;
--Djobengine.db.user=db2admin
--Djobengine.db.password=password
--Djobengine.nosql.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true;
--Djobengine.nosql.db.user=db2admin
--Djobengine.nosql.db.password=password
--Djobengine.nosql.db.schema=test
-
-#Octopus
--Djobengine.octopus.api.address=http://10.10.1.11/api/v1
--Djobengine.octopus.api.user=mam
--Djobengine.octopus.api.password=napocska
-
-#Selenio
--Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl
--Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium
-
-#Nexio
--Dnexio.host=10.10.1.55\r
+ <vmArgsLin>#Database\r
+-Djobengine.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true;\r
+-Djobengine.db.user=db2admin\r
+-Djobengine.db.password=password\r
+-Djobengine.nosql.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true;\r
+-Djobengine.nosql.db.user=db2admin\r
+-Djobengine.nosql.db.password=password\r
+-Djobengine.nosql.db.schema=test\r
+\r
+#Octopus\r
+-Djobengine.octopus.api.address=http://10.10.1.11/api/v1\r
+-Djobengine.octopus.api.user=mam\r
+-Djobengine.octopus.api.password=napocska\r
+\r
+#Selenio\r
+-Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl\r
+-Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium\r
+\r
+#Nexio\r
+-Dnexio.host=10.10.1.56\r
</vmArgsLin>\r
<vmArgsMac>-XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts\r
</vmArgsMac>\r
<parameters>\r
<parameter name="archiveItem" type="user.jobengine.server.steps.ArchiveItem" />\r
<parameter name="globalSourcePath" type="java.lang.String"/>\r
+ <parameter name="transcoderTargetPath" type="java.lang.String"/>\r
+ <parameter name="webPath" type="java.lang.String"/>\r
+ <parameter name="killDateDays" type="java.lang.Integer"/>\r
</parameters>\r
<variables>\r
<variable name="mediaCubeMedia" type="user.jobengine.db.Media" />\r
<input>\r
<variable name="mediaCubeMedia" />\r
</input>\r
+ <input>\r
+ <parameter name="killDateDays" />\r
+ </input>\r
</inputs>\r
<commands>\r
<calljobstep id="id3" type="user.jobengine.server.steps.TranscodeSELENIOStep" weight="1">\r
<input>\r
<variable name="mediaCubeMedia" />\r
</input>\r
+ <input>\r
+ <parameter name="transcoderTargetPath" />\r
+ </input>\r
+ <input>\r
+ <parameter name="webPath" />\r
+ </input>\r
</inputs>\r
- <outputs>\r
- </outputs>\r
</calljobstep>\r
</commands>\r
</calljobstep>\r
<?xml version="1.0" encoding="UTF-8"?>\r
<jobtemplate name="Felhasználói archiválás">\r
-<declarations>\r
- <parameters>\r
- <parameter name="sourcePath" type="java.lang.String"/>\r
- <parameter name="globalSourcePath" type="java.lang.String"/>\r
- </parameters>\r
- <variables>\r
- <variable name="archiveList" type="java.util.ArrayList"/>\r
- </variables>\r
-</declarations>\r
-<commands>\r
- <calljobstep id="step1" type="user.jobengine.server.steps.ArchiveListBuilderStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="sourcePath" />\r
- </input>\r
- </inputs>\r
- <outputs>\r
- <output>\r
- <variable name="archiveList" />\r
- </output>\r
- </outputs>\r
- </calljobstep>\r
- \r
- <calljobstep id="step2" type="user.jobengine.server.steps.ArchiveMaterialSubmitStep" weight="1">\r
- <inputs>\r
- <input>\r
- <parameter name="globalSourcePath" />\r
- </input>\r
- <input>\r
- <variable name="archiveList" />\r
- </input>\r
- </inputs>\r
- </calljobstep>\r
-</commands>\r
+ <declarations>\r
+ <parameters>\r
+ <parameter name="sourcePath" type="java.lang.String" />\r
+ <parameter name="globalSourcePath" type="java.lang.String" />\r
+ <parameter name="transcoderTargetPath" type="java.lang.String" />\r
+ <parameter name="webPath" type="java.lang.String" />\r
+ <parameter name="killDateDays" type="java.lang.Integer" />\r
+ </parameters>\r
+ <variables>\r
+ <variable name="archiveList" type="java.util.ArrayList" />\r
+ </variables>\r
+ </declarations>\r
+ <commands>\r
+ <calljobstep id="step1" type="user.jobengine.server.steps.ArchiveListBuilderStep" weight="1">\r
+ <inputs>\r
+ <input>\r
+ <parameter name="sourcePath" />\r
+ </input>\r
+ </inputs>\r
+ <outputs>\r
+ <output>\r
+ <variable name="archiveList" />\r
+ </output>\r
+ </outputs>\r
+ </calljobstep>\r
+\r
+ <calljobstep id="step2" type="user.jobengine.server.steps.ArchiveMaterialSubmitStep" weight="1">\r
+ <inputs>\r
+ <input>\r
+ <parameter name="globalSourcePath" />\r
+ </input>\r
+ <input>\r
+ <variable name="archiveList" />\r
+ </input>\r
+ <input>\r
+ <parameter name="transcoderTargetPath" />\r
+ </input>\r
+ <input>\r
+ <parameter name="webPath" />\r
+ </input>\r
+ <input>\r
+ <parameter name="killDateDays" />\r
+ </input>\r
+ </inputs>\r
+ </calljobstep>\r
+ </commands>\r
</jobtemplate>
\ No newline at end of file
* @author robi\r
*/\r
public class ArchiveMaterialSubmitStep extends JobStep {\r
- private static final String ARCHIVE = "Archiválás";\r
- private static final String GLOBAL_SOURCE_PATH = "globalSourcePath";\r
private static final Logger logger = LogManager.getLogger();\r
private static final String JOBTEMPLATE = "archive-material.xml";\r
+ private static final String KILL_DATE_DAYS = "killDateDays";\r
+ private static final String WEB_PATH = "webPath";\r
+ private static final String TRANSCODER_TARGET_PATH = "transcoderTargetPath";\r
+ private static final String ARCHIVE = "Archiválás";\r
+ private static final String GLOBAL_SOURCE_PATH = "globalSourcePath";\r
private static final String ARCHIVE_ITEM = "archiveItem";\r
\r
@StepEntry\r
- public Object[] execute(String globalSourcePath, ArrayList<ArchiveItem> archiveList, IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
+ public Object[] execute(String globalSourcePath, ArrayList<ArchiveItem> archiveList, String transcoderTargetPath, String webPath, int killDateDays,\r
+ IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
try {\r
for (ArchiveItem archiveItem : archiveList) {\r
try {\r
- IJobRuntime submit = jobEngine.submit(JOBTEMPLATE, ARCHIVE,\r
- ListUtils.asMap(ARCHIVE_ITEM, archiveItem, GLOBAL_SOURCE_PATH, globalSourcePath));\r
+ IJobRuntime submit = jobEngine.submit(JOBTEMPLATE, ARCHIVE, ListUtils.asMap(ARCHIVE_ITEM, archiveItem, GLOBAL_SOURCE_PATH, globalSourcePath,\r
+ TRANSCODER_TARGET_PATH, transcoderTargetPath, WEB_PATH, webPath, KILL_DATE_DAYS, killDateDays));\r
} catch (Exception e) {\r
if (archiveItem != null)\r
archiveItem.removeCatchedFile();\r
private FileType fileType;\r
\r
@StepEntry\r
- public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, int killDateDays, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
try {\r
setAndCheck(archiveItem, mediaCubeMedia, jobEngine);\r
\r
saveMetadata(mediaCubeMedia, sourceFileName, name);\r
logger.info(getMarker(), "A {} állomány archiválása sikeres.", archiveItem.getMediaFile().toFile().getName());\r
\r
+ KillDateFile killDateFile = new KillDateFile(sourceMediaFile.getParent().toString(), sourceMediaFile.getFileName().toString());\r
+ killDateFile.create(killDateDays);\r
} catch (Exception e) {\r
logger.catching(e);\r
logger.error(getMarker(), "A {} állomány archiválása sikertelen. A rendszer hibaüzenete: {}", archiveItem.getMediaFile().toFile().getName(),\r
package user.jobengine.server.steps;\r
\r
-import java.io.File;\r
+import java.io.IOException;\r
import java.net.URL;\r
+import java.nio.file.Files;\r
import java.nio.file.Path;\r
import java.nio.file.Paths;\r
+import java.nio.file.StandardCopyOption;\r
import java.util.Arrays;\r
import java.util.List;\r
\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
-import user.commons.StoreUri;\r
-import user.commons.remotestore.RemoteStoreProtocol;\r
import user.commons.selenio.wsclient.AudioSource;\r
import user.commons.selenio.wsclient.Clip;\r
import user.commons.selenio.wsclient.ClipList;\r
import user.commons.selenio.wsclient.FileSnapshot;\r
import user.commons.selenio.wsclient.MediaFile;\r
import user.commons.selenio.wsclient.State;\r
-import user.commons.selenio.wsclient.TranscodeDestination;\r
import user.commons.selenio.wsclient.TranscodeMgrWS;\r
import user.commons.selenio.wsclient.TranscodeMgrWSService;\r
import user.commons.selenio.wsclient.TranscodeRequest;\r
private IItemManager manager;\r
private Store store;\r
private FileType fileType;\r
+ private String transcoderTargetPath;\r
+ private String webPath;\r
\r
public TranscodeSELENIOStep() throws Exception {\r
try {\r
}\r
}\r
\r
- private TranscodeRequest buildTranscodeRequest(String projectFilePath, String sourceFilePath, String targetPath) throws java.lang.Exception {\r
+ private TranscodeRequest buildTranscodeRequest(String projectFilePath, String sourceFilePath) throws java.lang.Exception {\r
Clip clip = new Clip();\r
MediaFile mediaFile = new MediaFile();\r
mediaFile.setFile(sourceFilePath);\r
transcodeRequest.setProject(project);\r
transcodeRequest.setTranscodeSource(transcodeSource);\r
\r
- TranscodeDestination transcodeDestination = new TranscodeDestination();\r
+ // TranscodeDestination transcodeDestination = new TranscodeDestination();\r
\r
//transcodeDestination.setOutputWriteDirectory(outputPath);\r
- transcodeDestination.setOutputPostMoveDirectory(targetPath);\r
- transcodeRequest.setTranscodeDestination(transcodeDestination);\r
+ // transcodeDestination.setOutputPostMoveDirectory(targetPath);\r
+ // transcodeRequest.setTranscodeDestination(transcodeDestination);\r
return transcodeRequest;\r
}\r
\r
@StepEntry\r
- public Object[] execute(String globalInputFolder, ArchiveItem archiveItem, Media mediaCubeMedia, IJobEngine jobEngine, IJobRuntime jobRuntime)\r
- throws Exception {\r
- if (StringUtils.isBlank(globalInputFolder))\r
+ public Object[] execute(String globalSourcePath, ArchiveItem archiveItem, Media mediaCubeMedia, String transcoderTargetPath, String webPath,\r
+ IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+\r
+ if (StringUtils.isBlank(globalSourcePath))\r
throw new NullPointerException("System is not configured properly, 'globalInputFolder' parameter missing.");\r
manager = jobEngine.getItemManager();\r
\r
if (fileType == null)\r
throw new NullPointerException("System is not configured properly, low-res file type definition missing.");\r
\r
- StoreUri sourceStoreUri = store.getSourceStoreUri(RemoteStoreProtocol.SMB);\r
- if (sourceStoreUri == null)\r
- throw new NullPointerException("System is not configured properly, low-res system store SMB store URI definition missing.");\r
+ if (StringUtils.isBlank(transcoderTargetPath))\r
+ throw new NullPointerException("System is not configured properly, 'transcoderTargetPath' parameter missing.");\r
+ this.transcoderTargetPath = transcoderTargetPath;\r
+\r
+ if (StringUtils.isBlank(webPath))\r
+ throw new NullPointerException("System is not configured properly, 'webPath' parameter missing.");\r
+ this.webPath = webPath;\r
+\r
+ // StoreUri sourceStoreUri = store.getSourceStoreUri(RemoteStoreProtocol.SMB);\r
+ // if (sourceStoreUri == null)\r
+ // throw new NullPointerException("System is not configured properly, low-res system store SMB store URI definition missing.");\r
\r
- Path inputPath = Paths.get(globalInputFolder, archiveItem.getMediaFile().toFile().getName());\r
+ Path inputPath = Paths.get(globalSourcePath, archiveItem.getMediaFile().toFile().getName());\r
String sourceFilePath = inputPath.toString();\r
- String outputPath = sourceStoreUri.getRootPath();\r
- TranscodeRequest transcodeRequest = buildTranscodeRequest(projectFilePath, sourceFilePath, outputPath);\r
+ // String outputPath = sourceStoreUri.getRootPath();\r
+ TranscodeRequest transcodeRequest = buildTranscodeRequest(projectFilePath, sourceFilePath);\r
TranscodeTask transcodeTask = transcoder.submitTranscodeTask(transcodeRequest);\r
\r
if (transcodeTask == null)\r
throw new IndexOutOfBoundsException("There are more than 1 file in the response: " + transcodeTask.getId());\r
\r
user.commons.selenio.wsclient.MediaFile selenioMediaFile = outputs.get(0);\r
- File outFile = new File(selenioMediaFile.getFile());\r
- user.jobengine.db.MediaFile mediaFile = manager.createMediaFile(outFile.getName(), fileType, store, mediaCubeMedia);\r
+ String outFile = selenioMediaFile.getFile();\r
+ outFile = outFile.substring(outFile.lastIndexOf("\\") + 1);\r
+ user.jobengine.db.MediaFile mediaFile = manager.createMediaFile(outFile, fileType, store, mediaCubeMedia);\r
mediaFile.add();\r
+ try {\r
+ Files.move(Paths.get(transcoderTargetPath, outFile), Paths.get(webPath, outFile), StandardCopyOption.REPLACE_EXISTING);\r
+ } catch (IOException e) {\r
+ logger.catching(e);\r
+ logger.error(getMarker(), "A {} állomány mozgatása a {} mappába nem sikerült.", outFile, webPath);\r
+ }\r
}\r
\r
@SuppressWarnings("incomplete-switch")\r
<!-- media player -->\r
<center border="none">\r
\r
- <borderlayout height="100%" width="100%" visible="@load(svm.hasLowresMediaFile)">\r
+ <borderlayout height="100%" width="100%">\r
\r
- <north border="none" size="60%" splittable="true" minsize="250" collapsible="true">\r
+ <north border="none" size="60%" splittable="true" minsize="250" collapsible="true" visible="@load(svm.hasLowresMediaFile)">\r
<div align="center" height="100%" width="100%">\r
<iframe id="mediaPlayer" height="100%" width="100%" autohide="false" src="@load(svm.lowresMediaFilePath)"></iframe>\r
</div>\r
</north>\r
<center border="none">\r
\r
- <groupbox closable="false" mold="3d" width="100%" height="100%">\r
+ <groupbox closable="false" mold="3d" width="100%" height="100%" visible="@load(svm.selectedMedia ne null)">\r
<caption>\r
<button label="Visszatöltés" onClick="@command('downloadMedia')" autodisable="self" disabled="@load(not svm.hasTSMMediaFile)"\r
sclass="buttonboldfont" />\r
<div>\r
<label style="font-size:8pt; color: gray" value="Média leírása" />\r
<div style="margin: 4px">\r
- <label value="@load(svm.selectedMedia.title)" />\r
+ <label value="@load(svm.selectedMedia.description)" />\r
</div>\r
</div>\r
</div>\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.File;\r
+import java.io.IOException;\r
+import java.nio.file.Files;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+import java.nio.file.attribute.FileAttribute;\r
+import java.nio.file.attribute.PosixFilePermission;\r
+import java.nio.file.attribute.PosixFilePermissions;\r
+import java.text.SimpleDateFormat;\r
+import java.util.Calendar;\r
+import java.util.Set;\r
+\r
+public class KillDateFile {\r
+ private static final String KILLDATE_NAME = "%s.%s.killdate";\r
+ private static final String YYYY_M_MDD = "yyyyMMdd";\r
+ private static final String STATUSFOLDER = ".STATUS";\r
+ private String filePath;\r
+ private String fileName;\r
+\r
+ public KillDateFile(String filePath, String fileName) {\r
+ this.filePath = filePath;\r
+ this.fileName = fileName;\r
+ }\r
+\r
+ public void create(int days) throws IOException {\r
+ Path statusPath = Paths.get(filePath, STATUSFOLDER);\r
+ File statusFolder = statusPath.toFile();\r
+ if (!statusFolder.exists() || !statusFolder.isDirectory()) {\r
+ Set<PosixFilePermission> perms = PosixFilePermissions.fromString("rwxrwxrwx");\r
+ FileAttribute<Set<PosixFilePermission>> attr = PosixFilePermissions.asFileAttribute(perms);\r
+ Files.createDirectory(statusPath, attr);\r
+ }\r
+ Calendar killDate = Calendar.getInstance();\r
+ killDate.add(Calendar.DAY_OF_YEAR, days);\r
+ SimpleDateFormat dateFormat = new SimpleDateFormat(YYYY_M_MDD);\r
+ String killDateFileName = String.format(KILLDATE_NAME, fileName, dateFormat.format(killDate.getTime()));\r
+ Path killDatePath = Paths.get(filePath, STATUSFOLDER, killDateFileName);\r
+ Files.createFile(killDatePath);\r
+ }\r
+}\r
public void doSearch() {\r
try {\r
//do search ++++++++\r
- if(searchValue != null){\r
- if(searchValue.length() >= 3){\r
+ this.selectedItem = null;\r
+ this.selectedMedia = null;\r
+ if (searchValue != null) {\r
+ if (searchValue.length() >= 3) {\r
searchResult = new CachedListModel(searchValue);\r
- if(searchResult.getSize() <= 0){\r
- this.selectedItem = null;\r
- this.selectedMedia = null;\r
- }\r
}\r
}\r
} catch (Exception exc) {\r
}\r
return ret;\r
}\r
-\r
+ \r
public boolean getHasSelectedMediaFile(){\r
String mediaFilePath =getMediaFilePath();\r
return (mediaFilePath != null && !"".equals(mediaFilePath));\r