git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Fri, 13 Oct 2017 15:07:45 +0000 (15:07 +0000)
committerVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Fri, 13 Oct 2017 15:07:45 +0000 (15:07 +0000)
server/-configuration/scheduledjobs.json
server/-product/DEPLOY-README.txt
server/-product/mediacube.product
server/user.jobengine.executors/jobtemplates/archive-material.xml
server/user.jobengine.executors/jobtemplates/archive-ondemand.xml
server/user.jobengine.executors/src/user/jobengine/server/steps/ArchiveMaterialSubmitStep.java
server/user.jobengine.executors/src/user/jobengine/server/steps/TSMBackupStep.java
server/user.jobengine.executors/src/user/jobengine/server/steps/TranscodeSELENIOStep.java
server/user.jobengine.osgi.server/pages/search_items.zul
server/user.jobengine.osgi.server/src/user/jobengine/server/steps/KillDateFile.java [new file with mode: 0644]
server/user.jobengine.osgi.server/src/user/jobengine/zk/model/SearchModel.java

index 9347880f8a43dd6db82d67c3a0e7a2eab31d445d..8a436610b1c6a55e42400d8004215c135e2655fb 100644 (file)
@@ -7,7 +7,10 @@
       "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
index 2d12684e9d1be112360b05022454301c69f7c349..508dba7f990b30e7e50545f6d4b54c21941648bb 100644 (file)
@@ -68,4 +68,8 @@ ISILON
 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
index 6c6422cfeb65d9b12493957ec7af128f8ef7e355..29ee557b1270768468cde723a17a860df3b0075a 100644 (file)
@@ -9,43 +9,43 @@
    <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
index bb9fd2bfb07dce523c313652f9c3c23ea405960b..d8ec58f4758691442b50323ff46f855c003ff033 100644 (file)
@@ -4,6 +4,9 @@
                <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
@@ -30,6 +33,9 @@
                                <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
index 9f38a3bb2f41dd2f2cb132dbb643e6ad4f90ec94..fe104fc4f4d4b3802342341210a391af8f241a21 100644 (file)
@@ -1,37 +1,49 @@
 <?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
index 234332c93723e0f0a9cccdd0527c18b0cd6e6105..7f9cb2c464d7f7664667adb7eed0b79ecb5475f0 100644 (file)
@@ -15,19 +15,23 @@ import user.jobengine.server.IJobRuntime;
  * @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
index b3fb5dbd702165c2d585b03d60bab454f81bf2cd..9f77a2fa96b986575518a67790161e42c46e9a62 100644 (file)
@@ -33,7 +33,7 @@ public class TSMBackupStep extends JobStep {
        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
@@ -59,6 +59,8 @@ public class TSMBackupStep extends JobStep {
                        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
index 67461133a7de06cc0e2a88c78c6147225f80f3a3..c3f65319a765621f2d9b1bd9d8b6057ba84773be 100644 (file)
@@ -1,9 +1,11 @@
 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
@@ -13,8 +15,6 @@ import org.apache.commons.lang.StringUtils;
 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
@@ -22,7 +22,6 @@ import user.commons.selenio.wsclient.Exception_Exception;
 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
@@ -48,6 +47,8 @@ public class TranscodeSELENIOStep extends JobStep {
        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
@@ -67,7 +68,7 @@ public class TranscodeSELENIOStep extends JobStep {
                }\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
@@ -91,18 +92,19 @@ public class TranscodeSELENIOStep extends JobStep {
                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
@@ -114,14 +116,22 @@ public class TranscodeSELENIOStep extends JobStep {
                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
@@ -161,9 +171,16 @@ public class TranscodeSELENIOStep extends JobStep {
                        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
index 63dd7158aa28c24f37cedf70938e83ee518d6a62..31db0bb3ccfd3dc329044a92cebeaf8eccfb9e9b 100644 (file)
                        <!-- 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
diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/KillDateFile.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/KillDateFile.java
new file mode 100644 (file)
index 0000000..ae95f19
--- /dev/null
@@ -0,0 +1,42 @@
+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
index 0f6f745b294de8342901a8e0128d5379a70a612b..96383ab17d79b400493f68699015503faf449aa5 100644 (file)
@@ -47,13 +47,11 @@ public class SearchModel extends BaseModel {
        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
@@ -155,7 +153,7 @@ public class SearchModel extends BaseModel {
                        }\r
                        return ret;\r
                }\r
-\r
+       \r
                public boolean getHasSelectedMediaFile(){\r
                        String mediaFilePath =getMediaFilePath();\r
                        return (mediaFilePath != null && !"".equals(mediaFilePath));\r