#286
authorvasary.daniel <TFS\vasary.daniel>
Fri, 29 Apr 2022 08:56:02 +0000 (08:56 +0000)
committervasary.daniel <TFS\vasary.daniel>
Fri, 29 Apr 2022 08:56:02 +0000 (08:56 +0000)
git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C33233

server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SmallTests.java
server/user.jobengine.executors/src/user/jobengine/server/steps/OutputPathAndNameSelectorStep.java
server/user.jobengine.osgi.commons/src/user/commons/configuration/SystemConfiguration.java
server/user.mediacube.gui/pages/jobs.zul

index af7269157810d32ca0ddac71078bd36404182201..f50a10e3a0b70a16e7560b387918cc02a0aba2bb 100644 (file)
@@ -1576,4 +1576,12 @@ public class SmallTests {
                Map<String, Integer> collected = sut.entrySet().stream().collect(collector);\r
 \r
        }\r
+\r
+       @Test\r
+       public void test9999992() throws Exception {\r
+               IConfiguration configuration = SystemConfiguration.getInstance();\r
+               String octopusAddress = configuration.value("services.octopus.api.address", null);\r
+               System.out.println(octopusAddress);\r
+       }\r
+\r
 }\r
index f0203ca5f5c925b14f7f187810f0bce5b315d5a4..3aa7016e0299388d69aa27c22243a0f268a44adb 100644 (file)
@@ -14,6 +14,7 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;\r
 import org.apache.logging.log4j.Marker;\r
 \r
+import user.commons.configuration.SystemConfiguration;\r
 import user.jobengine.db.ArchivedMedia;\r
 import user.jobengine.server.IJobEngine;\r
 import user.jobengine.server.IJobRuntime;\r
@@ -28,32 +29,40 @@ public class OutputPathAndNameSelectorStep extends JobStep {
        private static final Logger logger = LogManager.getLogger();\r
 \r
        private Marker marker;\r
+       private String octopusAddress = SystemConfiguration.getInstance().value("services.octopus.api.address", null);\r
 \r
-       private void check(String localRetrievePath, String materialOutputFolder, String promoOutputFolder, String advertisementOutputFolder,\r
-                       String octopusOutputFolder, String genericOutputFolder, String houseId, String targetPathType) {\r
+       private void check(String localRetrievePath, String materialOutputFolder, String promoOutputFolder,\r
+                       String advertisementOutputFolder, String octopusOutputFolder, String genericOutputFolder, String houseId,\r
+                       String targetPathType) {\r
                if (StringUtils.isBlank(localRetrievePath)) {\r
                        logger.error(marker, "A folyamat 'localRetrievePath' bemeneti paramétere üres.");\r
-                       throw new NullPointerException("System is not configured properly, 'localRetrievePath' input parameter missing.");\r
+                       throw new NullPointerException(\r
+                                       "System is not configured properly, 'localRetrievePath' input parameter missing.");\r
                }\r
                if (StringUtils.isBlank(materialOutputFolder)) {\r
                        logger.error(marker, "A folyamat 'materialOutputFolder' bemeneti paramétere üres.");\r
-                       throw new NullPointerException("System is not configured properly, 'materialOutputFolder' input parameter missing.");\r
+                       throw new NullPointerException(\r
+                                       "System is not configured properly, 'materialOutputFolder' input parameter missing.");\r
                }\r
                if (StringUtils.isBlank(promoOutputFolder)) {\r
                        logger.error(marker, "A folyamat 'promoOutputFolder' bemeneti paramétere üres.");\r
-                       throw new NullPointerException("System is not configured properly, 'promoOutputFolder' input parameter missing.");\r
+                       throw new NullPointerException(\r
+                                       "System is not configured properly, 'promoOutputFolder' input parameter missing.");\r
                }\r
                if (StringUtils.isBlank(advertisementOutputFolder)) {\r
                        logger.error(marker, "A folyamat 'advertisementOutputFolder' bemeneti paramétere üres.");\r
-                       throw new NullPointerException("System is not configured properly, 'advertisementOutputFolder' input parameter missing.");\r
+                       throw new NullPointerException(\r
+                                       "System is not configured properly, 'advertisementOutputFolder' input parameter missing.");\r
                }\r
                if (StringUtils.isBlank(octopusOutputFolder)) {\r
                        logger.error(marker, "A folyamat 'octopusOutputFolder' bemeneti paramétere üres.");\r
-                       throw new NullPointerException("System is not configured properly, 'octopusOutputFolder' input parameter missing.");\r
+                       throw new NullPointerException(\r
+                                       "System is not configured properly, 'octopusOutputFolder' input parameter missing.");\r
                }\r
                if (StringUtils.isBlank(genericOutputFolder)) {\r
                        logger.error(marker, "A folyamat 'genericOutputFolder' bemeneti paramétere üres.");\r
-                       throw new NullPointerException("System is not configured properly, 'genericOutputFolder' input parameter missing.");\r
+                       throw new NullPointerException(\r
+                                       "System is not configured properly, 'genericOutputFolder' input parameter missing.");\r
                }\r
                if (StringUtils.isBlank(houseId)) {\r
                        logger.error(marker, "A folyamat 'houseId' bemeneti paramétere üres.");\r
@@ -61,22 +70,24 @@ public class OutputPathAndNameSelectorStep extends JobStep {
                }\r
                if (StringUtils.isBlank(targetPathType)) {\r
                        logger.error(marker, "A folyamat 'targetPathType' bemeneti paramétere üres.");\r
-                       throw new NullPointerException("System is not configured properly, 'targetPathType' input parameter missing.");\r
+                       throw new NullPointerException(\r
+                                       "System is not configured properly, 'targetPathType' input parameter missing.");\r
                }\r
        }\r
 \r
        @StepEntry\r
-       public Object[] execute(String localRetrievePath, String materialOutputFolder, String promoOutputFolder, String advertisementOutputFolder,\r
-                       String octopusOutputFolder, String genericOutputFolder, String onlineOutputFolder, String houseId, String targetPathType,\r
-                       ArchivedMedia archivedMedia, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+       public Object[] execute(String localRetrievePath, String materialOutputFolder, String promoOutputFolder,\r
+                       String advertisementOutputFolder, String octopusOutputFolder, String genericOutputFolder,\r
+                       String onlineOutputFolder, String houseId, String targetPathType, ArchivedMedia archivedMedia,\r
+                       IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
                marker = jobRuntime.getSessionMarker();\r
-               check(localRetrievePath, materialOutputFolder, promoOutputFolder, advertisementOutputFolder, octopusOutputFolder, genericOutputFolder, houseId,\r
-                               targetPathType);\r
+               check(localRetrievePath, materialOutputFolder, promoOutputFolder, advertisementOutputFolder,\r
+                               octopusOutputFolder, genericOutputFolder, houseId, targetPathType);\r
                Object[] result = null;\r
                switch (Integer.parseInt(targetPathType)) {\r
                case 0:\r
-                       String outputFolder = getFolderById(materialOutputFolder, promoOutputFolder, advertisementOutputFolder, octopusOutputFolder, genericOutputFolder,\r
-                                       houseId, archivedMedia);\r
+                       String outputFolder = getFolderById(materialOutputFolder, promoOutputFolder, advertisementOutputFolder,\r
+                                       octopusOutputFolder, genericOutputFolder, houseId, archivedMedia);\r
                        result = localTargetInit(localRetrievePath, outputFolder, houseId, jobRuntime);\r
                        break;\r
                case 1:\r
@@ -93,17 +104,22 @@ public class OutputPathAndNameSelectorStep extends JobStep {
                return result;\r
        }\r
 \r
-       private String getFolderById(String materialOutputFolder, String promoOutputFolder, String advertisementOutputFolder, String octopusOutputFolder,\r
-                       String genericOutputFolder, String houseId, ArchivedMedia archivedMedia) throws Exception {\r
+       private String getFolderById(String materialOutputFolder, String promoOutputFolder,\r
+                       String advertisementOutputFolder, String octopusOutputFolder, String genericOutputFolder, String houseId,\r
+                       ArchivedMedia archivedMedia) throws Exception {\r
                String id = houseId.toUpperCase();\r
                MetadataType mdType = MetadataTypeDetector.GuessMetadataType(id);\r
                String result = null;\r
 \r
-               //a groovy nem latja enumnak, hanem az objektum tulajdonsaganak\r
+               // a groovy nem latja enumnak, hanem az objektum tulajdonsaganak\r
                switch (mdType.toString()) {\r
                case "OctopusPlaceholder":\r
                case "OctopusStory":\r
-                       result = octopusOutputFolder;\r
+                       // 220429 MV-ben nincs Octopus\r
+                       if (octopusAddress == null)\r
+                               result = genericOutputFolder;\r
+                       else\r
+                               result = octopusOutputFolder;\r
                        break;\r
                case "TrafficMaterial":\r
                        result = materialOutputFolder;\r
@@ -138,14 +154,16 @@ public class OutputPathAndNameSelectorStep extends JobStep {
                return result[0];\r
        }\r
 \r
-       private Object[] localTargetInit(String localRetrievePath, String outputFolder, String houseId, IJobRuntime jobRuntime) throws IOException {\r
+       private Object[] localTargetInit(String localRetrievePath, String outputFolder, String houseId,\r
+                       IJobRuntime jobRuntime) throws IOException {\r
                String id = houseId.toUpperCase();\r
                String targetPath = getPossiblePath(id, Paths.get(localRetrievePath, outputFolder, id)).toString();\r
                String targetNamePattern = houseId + TARGETNAMEPATTERN;\r
                try {\r
                        EscortFiles.ensureUNCFolder(Paths.get(targetPath));\r
                } catch (Exception e) {\r
-                       logger.error(jobRuntime.getSessionMarker(), "A cél mappa '{}' nem létezik és nem hozható létre. A rendszer hibaüzenete: {}", targetPath,\r
+                       logger.error(jobRuntime.getSessionMarker(),\r
+                                       "A cél mappa '{}' nem létezik és nem hozható létre. A rendszer hibaüzenete: {}", targetPath,\r
                                        e.getMessage());\r
                        throw e;\r
                }\r
index e750cb764f054f9dec034f209c55c706534d2efd..10111159031c785519e9ab36ba8abe726af4e22a 100644 (file)
@@ -88,7 +88,7 @@ public class SystemConfiguration implements IConfiguration {
                try {\r
 \r
                        result = value(fqn);\r
-                       if (!result.getClass().isAssignableFrom(defValue.getClass()))\r
+                       if (defValue != null && !result.getClass().isAssignableFrom(defValue.getClass()))\r
                                throw new ClassCastException(result.getClass() + " ? " + defValue.getClass());\r
                } catch (Exception e) {\r
                        if (e instanceof NullPointerException)\r
index c651300abf1e439aa28e610c32ff9f4b8055a802..f4cee7ce31008efc7fe7afdb29c302452733ebc9 100644 (file)
@@ -8,7 +8,7 @@
                <tabs visible="true">\r
                        <tab id="tab0" label="Futó folyamatok" selected="true" />\r
                        <tab id="tab1" label="Folyamat szerkesztő" />\r
-<!--                   <tab id="tab2" label="Folyamat szerkesztő2" /> -->\r
+                       <tab id="tab2" label="Folyamat szerkesztő2" />\r
                </tabs>\r
                <tabpanels>\r
                        <tabpanel>\r