Uncommented check for cacheFile older than 24h see Ticket #4194
authorAlexander Oppermann <a.oppermann@bgbm.org>
Tue, 22 Apr 2014 08:26:54 +0000 (08:26 +0000)
committerAlexander Oppermann <a.oppermann@bgbm.org>
Tue, 22 Apr 2014 08:26:54 +0000 (08:26 +0000)
cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/controller/checklist/ChecklistDemoController.java

index 627715861fdc793726e2e4cb286864b6f277cb24..af3de504a17da31eda42d3fdd1d0a32cc9b788ff 100644 (file)
@@ -162,8 +162,6 @@ public class ChecklistDemoController extends AbstractController implements Resou
             HttpServletRequest request) throws IOException {\r
 \r
         try{\r
             HttpServletRequest request) throws IOException {\r
 \r
         try{\r
-            //TODO: Fix bug with pageNumber and pageSize\r
-            //FIXME:Pagination won't work as expected...as soon as pageNumber is greater than 9, then the page won't pull new entries...\r
             if(pageSize == null) {\r
                 pageSize = 20;\r
             }\r
             if(pageSize == null) {\r
                 pageSize = 20;\r
             }\r
@@ -235,23 +233,19 @@ public class ChecklistDemoController extends AbstractController implements Resou
             long result = System.currentTimeMillis() - cacheFile.lastModified();\r
             final long day = 86400000;\r
             logger.info("result of calculation: " + result);\r
             long result = System.currentTimeMillis() - cacheFile.lastModified();\r
             final long day = 86400000;\r
             logger.info("result of calculation: " + result);\r
-            if(result < day){\r
+            //FIXME: if file older than one day won't trigger new export automatically\r
+//            if(result < day){\r
                 Map<String, File> modelMap = new HashMap<String, File>();\r
                 modelMap.put("file", cacheFile);\r
                 mv.addAllObjects(modelMap);\r
                 FileDownloadView fdv = new FileDownloadView("text/csv", fileName, "txt", "UTF-8");\r
                 mv.setView(fdv);\r
                 return mv;\r
                 Map<String, File> modelMap = new HashMap<String, File>();\r
                 modelMap.put("file", cacheFile);\r
                 mv.addAllObjects(modelMap);\r
                 FileDownloadView fdv = new FileDownloadView("text/csv", fileName, "txt", "UTF-8");\r
                 mv.setView(fdv);\r
                 return mv;\r
-            }\r
+//            }\r
         }else{//trigger progress monitor and performExport()\r
             String processLabel = "Exporting...";\r
             final String frontbaseUrl = null;\r
             ProgressMonitorUtil progressUtil = new ProgressMonitorUtil(progressMonitorController);\r
         }else{//trigger progress monitor and performExport()\r
             String processLabel = "Exporting...";\r
             final String frontbaseUrl = null;\r
             ProgressMonitorUtil progressUtil = new ProgressMonitorUtil(progressMonitorController);\r
-\r
-//            if(clearCache == true){\r
-//                IRestServiceProgressMonitor monitor = progressMonitorController.getMonitor(indexMonitorUuid);\r
-//                monitor.setCanceled(true);\r
-//            }\r
             if (!progressMonitorController.isMonitorRunning(indexMonitorUuid)) {\r
                 indexMonitorUuid = progressUtil.registerNewMonitor();\r
                 Thread subThread = new Thread() {\r
             if (!progressMonitorController.isMonitorRunning(indexMonitorUuid)) {\r
                 indexMonitorUuid = progressUtil.registerNewMonitor();\r
                 Thread subThread = new Thread() {\r