From 83b8855818afe2ce338f4610a6bef6ab461c77fc Mon Sep 17 00:00:00 2001 From: AndreBott Date: Fri, 20 Feb 2015 17:18:39 +0100 Subject: [PATCH] Update FirstValuesProcessor.java enabling the FirstValuesProcessor to retrieve values which are up to 100 years in the future. (e.g. for predicted timeseries) --- webapp/app/controllers/modules2/FirstValuesProcessor.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/webapp/app/controllers/modules2/FirstValuesProcessor.java b/webapp/app/controllers/modules2/FirstValuesProcessor.java index 9235eec0..d8e49a04 100644 --- a/webapp/app/controllers/modules2/FirstValuesProcessor.java +++ b/webapp/app/controllers/modules2/FirstValuesProcessor.java @@ -33,8 +33,10 @@ public String init(String pathStr, ProcessorSetup nextInChain, VisitorInfo visit super.init(pathStr, nextInChain, visitor, options); //params = parsePath(pathStr, visitor); //first values may have no start and end times here + long oneHundredYearsInMillis = 3153600000000L; + long customEnd = System.currentTimeMillis() + oneHundredYearsInMillis; if(params.getOriginalStart() == null && params.getOriginalEnd() == null) { - long end= System.currentTimeMillis(); + long end= customEnd; Long start = null; String previousPath = params.getPreviousPath()+"/"+start+"/"+end; String leftOver = params.getLeftOverPath()+"/"+start+"/"+end; @@ -48,7 +50,7 @@ public String init(String pathStr, ProcessorSetup nextInChain, VisitorInfo visit //in this case, there is only one time in the url which was put at the end parameter :( which is confusing //and to add to the confusion if reverse=true, end actually means end but reverse=false end means start instead if(!visitor.isReversed()) { - long end = System.currentTimeMillis(); + long end = customEnd; previousPath = previousPath+"/"+params.getOriginalEnd()+"/"+end; leftOver = leftOver+"/"+params.getOriginalEnd()+"/"+end; params = new Path(params.getParams(), previousPath, leftOver, params.getOriginalEnd(), end, visitor.isReversed());