From b261c99ac4b1dc1df93a52357830fb7cbb3df286 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Wed, 4 Jul 2018 13:13:17 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31146 --- server/-configuration/scheduledjobs.json | 2 +- .../src/user/commons/nosql/NoSQLUtils.java | 22 +++- .../src/user/commons/octopus/IOctopusAPI.java | 2 + .../src/user/commons/octopus/OctopusAPI.java | 2 - .../img/ic_delete_forever_black_18dp.png | Bin 0 -> 174 bytes .../pages/index.zul | 2 +- .../pages/missingmaterials.zul | 20 +++- .../user/jobengine/zk/model/IndexModel.java | 2 +- .../zk/model/MissingMaterialsModel.java | 30 +++-- .../user/jobengine/server/IT/Support.java | 110 ++++++++++++------ .../osgi/ws/nexio/NexioWSServlet.java | 9 +- 11 files changed, 138 insertions(+), 63 deletions(-) create mode 100644 server/user.jobengine.osgi.server/img/ic_delete_forever_black_18dp.png diff --git a/server/-configuration/scheduledjobs.json b/server/-configuration/scheduledjobs.json index 60a7180f..de2427f5 100644 --- a/server/-configuration/scheduledjobs.json +++ b/server/-configuration/scheduledjobs.json @@ -68,7 +68,7 @@ "template": "sys-import-morpheus-missing-materials.xml", "cronexpression": "0 0 0/1 1/1 * ? *", "parameters": [ - {"name": "csvFilePath", "value": "/mnt/MORPHEUS", "type": "java.lang.String"}, + {"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"} ] diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java b/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java index fad74d42..ac57183a 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nosql/NoSQLUtils.java @@ -10,6 +10,7 @@ import org.apache.logging.log4j.Logger; import com.ibm.nosql.json.api.BasicDBList; import com.ibm.nosql.json.api.BasicDBObject; import com.ibm.nosql.json.api.DB; +import com.ibm.nosql.json.api.DBCollection; import com.ibm.nosql.json.api.DBCursor; import com.ibm.nosql.json.api.DBObject; import com.ibm.nosql.json.api.NoSQLClient; @@ -91,11 +92,17 @@ public class NoSQLUtils { public static List asList(DBCursor cursor) { List result = null; - if (cursor.hasNext()) - result = cursor.toArray(); - cursor.close(); - if (result == null) - result = new ArrayList<>(); + try { + cursor.lazyFetch(); + while (cursor.hasNext()) { + DBObject obj = cursor.next(); + if (result == null) + result = new ArrayList<>(); + result.add(obj); + } + } finally { + cursor.close(); + } return result; } @@ -113,6 +120,10 @@ public class NoSQLUtils { return result; } + public static DBCollection collection(String name) { + return getNoSQLDB().getCollection(name); + } + public static DB getNoSQLDB() { try { // if (noSQLClient == null) @@ -122,5 +133,4 @@ public class NoSQLUtils { } return noSQLClient; } - } diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java index 5013aa97..86360d46 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java @@ -48,6 +48,8 @@ public interface IOctopusAPI { static final String STORYID = "storyId"; static final String FORMAT = "format"; static final String REPORTERS = "reporters"; + static final String $DATE = "$date"; + static final String $ELEMMATCH = "$elemMatch"; DBObject getRundown(Date scheduledDate); diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java index df2e0300..4244dd5d 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java @@ -20,8 +20,6 @@ import user.commons.nosql.NoSQLUtils; public class OctopusAPI implements IOctopusAPI { //private static final Logger logger = LogManager.getLogger(); - private static final String $DATE = "$date"; - private static final String $ELEMMATCH = "$elemMatch"; private DB db; public OctopusAPI() throws SQLException { diff --git a/server/user.jobengine.osgi.server/img/ic_delete_forever_black_18dp.png b/server/user.jobengine.osgi.server/img/ic_delete_forever_black_18dp.png new file mode 100644 index 0000000000000000000000000000000000000000..3a251b69c051b28fd96a3bca8552552011df6f4a GIT binary patch literal 174 zcmV;f08#&mP)l7N~%3RszETG?;*CVFQL`4Y(Bjf{^$W?P5@3 zxB-Mp40~}ay3Qa0hLQ|7@maS4%-)F4x*Nopw3k5{C=GTK1-?td2&W`WMO+NsDB;}= c6rnl*07$!FWNEa#DF6Tf07*qoM6N<$g82nHbpQYW literal 0 HcmV?d00001 diff --git a/server/user.jobengine.osgi.server/pages/index.zul b/server/user.jobengine.osgi.server/pages/index.zul index 697ac54c..fa02bd7a 100644 --- a/server/user.jobengine.osgi.server/pages/index.zul +++ b/server/user.jobengine.osgi.server/pages/index.zul @@ -69,7 +69,7 @@
-