summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlzhang2011-11-23 04:23:22 (EST)
committer mwu2011-11-23 04:23:22 (EST)
commitaedbbf6fb30076d788b43670bb70817c7c94dd79 (patch)
tree6b396d100ba4131ea1fc86c378ff769c8ee5a9c7
parent45c8c0aaa44f826e58bbe3ca1fe6afcc769b1ad0 (diff)
downloadorg.eclipse.birt-aedbbf6fb30076d788b43670bb70817c7c94dd79.zip
org.eclipse.birt-aedbbf6fb30076d788b43670bb70817c7c94dd79.tar.gz
org.eclipse.birt-aedbbf6fb30076d788b43670bb70817c7c94dd79.tar.bz2
Checkin: Support to show relative time period Time Function ToolTip
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateTest.java2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunctionTest.java2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunctionTest.java3
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingTest.java2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateTest.java2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunctionTest.java2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions1.txt2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions2.txt4
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions3.txt96
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions4.txt14
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions5.txt16
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions6.txt96
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions7.txt2
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions1.txt14
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions2.txt16
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions3.txt460
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt66
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt68
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions6.txt460
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions7.txt14
-rw-r--r--data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions8.txt2
-rw-r--r--data/org.eclipse.birt.data/plugin.xml8
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/IParallelPeriod.java10
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/IPeriodsFunction.java12
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/ITimeFunctionCreator.java10
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/ITimeFunctionCreatorFactory.java11
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/TimeFunctionCreatorEngine.java26
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/TimeMember.java (renamed from data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeMember.java)2
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java6
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java11
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/AbstractMDX.java2
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/IParallelPeriod.java8
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/IPeriodsFunction.java10
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java30
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java3
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java49
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionCreator.java24
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionCreatorFactory.java14
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionFactory.java4
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeMemberUtil.java1
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingFunction.java3
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateFunciton.java5
-rw-r--r--data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java55
-rw-r--r--data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java213
-rw-r--r--data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/Messages.properties11
-rw-r--r--data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/ResourceConstants.java11
-rw-r--r--data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java70
47 files changed, 1188 insertions, 764 deletions
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateTest.java b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateTest.java
index da58e79..c8b2a1f 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateTest.java
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateTest.java
@@ -5,7 +5,7 @@ import java.io.IOException;
import java.util.List;
import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.MonthToDateFunction;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeMember;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
import testutil.BaseTestCase;
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunctionTest.java b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunctionTest.java
index f9f69ea..ea92090 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunctionTest.java
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunctionTest.java
@@ -2,6 +2,8 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.io.IOException;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import junit.framework.TestCase;
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunctionTest.java b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunctionTest.java
index 4cfc07e..f80e5d4 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunctionTest.java
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunctionTest.java
@@ -3,9 +3,10 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.io.IOException;
import java.util.List;
-import junit.framework.TestCase;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
import testutil.BaseTestCase;
+
public class QuarterToDateFunctionTest extends BaseTestCase
{
protected void setUp( ) throws Exception
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingTest.java b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingTest.java
index 26fbf61..3258a7f 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingTest.java
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingTest.java
@@ -4,6 +4,8 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.io.IOException;
import java.util.List;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import testutil.BaseTestCase;
/**
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateTest.java b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateTest.java
index 015d529..cbe81b9 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateTest.java
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateTest.java
@@ -4,7 +4,7 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.io.IOException;
import java.util.List;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeMember;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.WeekToDateFunciton;
import testutil.BaseTestCase;
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunctionTest.java b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunctionTest.java
index 0ad4ab5..be8363c 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunctionTest.java
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunctionTest.java
@@ -4,6 +4,8 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.io.IOException;
import java.util.List;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import testutil.BaseTestCase;
public class YearToDateFunctionTest extends BaseTestCase
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions1.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions1.txt
index 8f94552..66d868d 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions1.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions1.txt
@@ -1,2 +1,2 @@
-2002 8
2002 7
+2002 8 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions2.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions2.txt
index 15107b3..7dfb605 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions2.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions2.txt
@@ -1,3 +1,3 @@
-2002 3 9
-2002 3 8
2002 3 7
+2002 3 8
+2002 3 9 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions3.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions3.txt
index 1693066..d24aad0 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions3.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions3.txt
@@ -1,49 +1,49 @@
-2002 3 8 18
-2002 3 8 17
-2002 3 8 16
-2002 3 8 15
-2002 3 8 14
-2002 3 8 13
-2002 3 8 12
-2002 3 8 11
-2002 3 8 10
-2002 3 8 9
-2002 3 8 8
-2002 3 8 7
-2002 3 8 6
-2002 3 8 5
-2002 3 8 4
-2002 3 8 3
-2002 3 8 2
-2002 3 8 1
-2002 3 7 31
-2002 3 7 30
-2002 3 7 29
-2002 3 7 28
-2002 3 7 27
-2002 3 7 26
-2002 3 7 25
-2002 3 7 24
-2002 3 7 23
-2002 3 7 22
-2002 3 7 21
-2002 3 7 20
-2002 3 7 19
-2002 3 7 18
-2002 3 7 17
-2002 3 7 16
-2002 3 7 15
-2002 3 7 14
-2002 3 7 13
-2002 3 7 12
-2002 3 7 11
-2002 3 7 10
-2002 3 7 9
-2002 3 7 8
-2002 3 7 7
-2002 3 7 6
-2002 3 7 5
-2002 3 7 4
-2002 3 7 3
-2002 3 7 2
2002 3 7 1
+2002 3 7 2
+2002 3 7 3
+2002 3 7 4
+2002 3 7 5
+2002 3 7 6
+2002 3 7 7
+2002 3 7 8
+2002 3 7 9
+2002 3 7 10
+2002 3 7 11
+2002 3 7 12
+2002 3 7 13
+2002 3 7 14
+2002 3 7 15
+2002 3 7 16
+2002 3 7 17
+2002 3 7 18
+2002 3 7 19
+2002 3 7 20
+2002 3 7 21
+2002 3 7 22
+2002 3 7 23
+2002 3 7 24
+2002 3 7 25
+2002 3 7 26
+2002 3 7 27
+2002 3 7 28
+2002 3 7 29
+2002 3 7 30
+2002 3 7 31
+2002 3 8 1
+2002 3 8 2
+2002 3 8 3
+2002 3 8 4
+2002 3 8 5
+2002 3 8 6
+2002 3 8 7
+2002 3 8 8
+2002 3 8 9
+2002 3 8 10
+2002 3 8 11
+2002 3 8 12
+2002 3 8 13
+2002 3 8 14
+2002 3 8 15
+2002 3 8 16
+2002 3 8 17
+2002 3 8 18 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions4.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions4.txt
index 24e99ec..97ebecb 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions4.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions4.txt
@@ -1,8 +1,8 @@
-2002 3 8 3
-2002 3 8 2
-2002 3 8 1
-2002 3 8 0
-2002 3 7 4
-2002 3 7 3
-2002 3 7 2
2002 3 7 1
+2002 3 7 2
+2002 3 7 3
+2002 3 7 4
+2002 3 8 0
+2002 3 8 1
+2002 3 8 2
+2002 3 8 3 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions5.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions5.txt
index 70f467b..13c803b 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions5.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions5.txt
@@ -1,13 +1,13 @@
-2002 3 8 3
-2002 3 8 2
-2002 3 8 1
-2002 3 8 0
-2002 3 7 4
-2002 3 7 3
-2002 3 7 2
2002 3 7 1
+2002 3 7 2
+2002 3 7 3
+2002 3 7 4
+2002 3 8 0
+2002 3 8 1
+2002 3 8 2
+2002 3 8 3
2002 3 8 4
2002 3 9 1
2002 3 9 2
2002 3 9 3
-2002 3 9 4
+2002 3 9 4 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions6.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions6.txt
index 5cb6985..b96c771 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions6.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions6.txt
@@ -1,52 +1,52 @@
-2002 3 8 18
-2002 3 8 17
-2002 3 8 16
-2002 3 8 15
-2002 3 8 14
-2002 3 8 13
-2002 3 8 12
-2002 3 8 11
-2002 3 8 10
-2002 3 8 9
-2002 3 8 8
-2002 3 8 7
-2002 3 8 6
-2002 3 8 5
-2002 3 8 4
-2002 3 8 3
-2002 3 8 2
-2002 3 8 1
-2002 3 7 31
-2002 3 7 30
-2002 3 7 29
-2002 3 7 28
-2002 3 7 27
-2002 3 7 26
-2002 3 7 25
-2002 3 7 24
-2002 3 7 23
-2002 3 7 22
-2002 3 7 21
-2002 3 7 20
-2002 3 7 19
-2002 3 7 18
-2002 3 7 17
-2002 3 7 16
-2002 3 7 15
-2002 3 7 14
-2002 3 7 13
-2002 3 7 12
-2002 3 7 11
-2002 3 7 10
-2002 3 7 9
-2002 3 7 8
-2002 3 7 7
-2002 3 7 6
-2002 3 7 5
-2002 3 7 4
-2002 3 7 3
-2002 3 7 2
2002 3 7 1
+2002 3 7 2
+2002 3 7 3
+2002 3 7 4
+2002 3 7 5
+2002 3 7 6
+2002 3 7 7
+2002 3 7 8
+2002 3 7 9
+2002 3 7 10
+2002 3 7 11
+2002 3 7 12
+2002 3 7 13
+2002 3 7 14
+2002 3 7 15
+2002 3 7 16
+2002 3 7 17
+2002 3 7 18
+2002 3 7 19
+2002 3 7 20
+2002 3 7 21
+2002 3 7 22
+2002 3 7 23
+2002 3 7 24
+2002 3 7 25
+2002 3 7 26
+2002 3 7 27
+2002 3 7 28
+2002 3 7 29
+2002 3 7 30
+2002 3 7 31
+2002 3 8 1
+2002 3 8 2
+2002 3 8 3
+2002 3 8 4
+2002 3 8 5
+2002 3 8 6
+2002 3 8 7
+2002 3 8 8
+2002 3 8 9
+2002 3 8 10
+2002 3 8 11
+2002 3 8 12
+2002 3 8 13
+2002 3 8 14
+2002 3 8 15
+2002 3 8 16
+2002 3 8 17
+2002 3 8 18
2002 3 8 19
2002 3 8 20
2002 3 8 21
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions7.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions7.txt
index 1cfaa55..921214b 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions7.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/QuarterToDateFunctionTest.testFunctions7.txt
@@ -1,3 +1,3 @@
-2002 8
2002 7
+2002 8
2002 9 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions1.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions1.txt
index 9b31cfc..13829c5 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions1.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions1.txt
@@ -1,8 +1,8 @@
-2002 8
-2002 7
-2002 6
-2002 5
-2002 4
-2002 3
-2002 2
2002 1
+2002 2
+2002 3
+2002 4
+2002 5
+2002 6
+2002 7
+2002 8 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions2.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions2.txt
index 3aeaa2a..e70fdb6 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions2.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions2.txt
@@ -1,9 +1,9 @@
-2002 3 9
-2002 3 8
-2002 3 7
-2002 2 6
-2002 2 5
-2002 2 4
-2002 1 3
-2002 1 2
2002 1 1
+2002 1 2
+2002 1 3
+2002 2 4
+2002 2 5
+2002 2 6
+2002 3 7
+2002 3 8
+2002 3 9
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions3.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions3.txt
index 1b7051f..b1c2755 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions3.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions3.txt
@@ -1,231 +1,231 @@
-2004 3 8 18
-2004 3 8 17
-2004 3 8 16
-2004 3 8 15
-2004 3 8 14
-2004 3 8 13
-2004 3 8 12
-2004 3 8 11
-2004 3 8 10
-2004 3 8 9
-2004 3 8 8
-2004 3 8 7
-2004 3 8 6
-2004 3 8 5
-2004 3 8 4
-2004 3 8 3
-2004 3 8 2
-2004 3 8 1
-2004 3 7 31
-2004 3 7 30
-2004 3 7 29
-2004 3 7 28
-2004 3 7 27
-2004 3 7 26
-2004 3 7 25
-2004 3 7 24
-2004 3 7 23
-2004 3 7 22
-2004 3 7 21
-2004 3 7 20
-2004 3 7 19
-2004 3 7 18
-2004 3 7 17
-2004 3 7 16
-2004 3 7 15
-2004 3 7 14
-2004 3 7 13
-2004 3 7 12
-2004 3 7 11
-2004 3 7 10
-2004 3 7 9
-2004 3 7 8
-2004 3 7 7
-2004 3 7 6
-2004 3 7 5
-2004 3 7 4
-2004 3 7 3
-2004 3 7 2
-2004 3 7 1
-2004 2 6 30
-2004 2 6 29
-2004 2 6 28
-2004 2 6 27
-2004 2 6 26
-2004 2 6 25
-2004 2 6 24
-2004 2 6 23
-2004 2 6 22
-2004 2 6 21
-2004 2 6 20
-2004 2 6 19
-2004 2 6 18
-2004 2 6 17
-2004 2 6 16
-2004 2 6 15
-2004 2 6 14
-2004 2 6 13
-2004 2 6 12
-2004 2 6 11
-2004 2 6 10
-2004 2 6 9
-2004 2 6 8
-2004 2 6 7
-2004 2 6 6
-2004 2 6 5
-2004 2 6 4
-2004 2 6 3
-2004 2 6 2
-2004 2 6 1
-2004 2 5 31
-2004 2 5 30
-2004 2 5 29
-2004 2 5 28
-2004 2 5 27
-2004 2 5 26
-2004 2 5 25
-2004 2 5 24
-2004 2 5 23
-2004 2 5 22
-2004 2 5 21
-2004 2 5 20
-2004 2 5 19
-2004 2 5 18
-2004 2 5 17
-2004 2 5 16
-2004 2 5 15
-2004 2 5 14
-2004 2 5 13
-2004 2 5 12
-2004 2 5 11
-2004 2 5 10
-2004 2 5 9
-2004 2 5 8
-2004 2 5 7
-2004 2 5 6
-2004 2 5 5
-2004 2 5 4
-2004 2 5 3
-2004 2 5 2
-2004 2 5 1
-2004 2 4 30
-2004 2 4 29
-2004 2 4 28
-2004 2 4 27
-2004 2 4 26
-2004 2 4 25
-2004 2 4 24
-2004 2 4 23
-2004 2 4 22
-2004 2 4 21
-2004 2 4 20
-2004 2 4 19
-2004 2 4 18
-2004 2 4 17
-2004 2 4 16
-2004 2 4 15
-2004 2 4 14
-2004 2 4 13
-2004 2 4 12
-2004 2 4 11
-2004 2 4 10
-2004 2 4 9
-2004 2 4 8
-2004 2 4 7
-2004 2 4 6
-2004 2 4 5
-2004 2 4 4
-2004 2 4 3
-2004 2 4 2
-2004 2 4 1
-2004 1 3 31
-2004 1 3 30
-2004 1 3 29
-2004 1 3 28
-2004 1 3 27
-2004 1 3 26
-2004 1 3 25
-2004 1 3 24
-2004 1 3 23
-2004 1 3 22
-2004 1 3 21
-2004 1 3 20
-2004 1 3 19
-2004 1 3 18
-2004 1 3 17
-2004 1 3 16
-2004 1 3 15
-2004 1 3 14
-2004 1 3 13
-2004 1 3 12
-2004 1 3 11
-2004 1 3 10
-2004 1 3 9
-2004 1 3 8
-2004 1 3 7
-2004 1 3 6
-2004 1 3 5
-2004 1 3 4
-2004 1 3 3
-2004 1 3 2
-2004 1 3 1
-2004 1 2 29
-2004 1 2 28
-2004 1 2 27
-2004 1 2 26
-2004 1 2 25
-2004 1 2 24
-2004 1 2 23
-2004 1 2 22
-2004 1 2 21
-2004 1 2 20
-2004 1 2 19
-2004 1 2 18
-2004 1 2 17
-2004 1 2 16
-2004 1 2 15
-2004 1 2 14
-2004 1 2 13
-2004 1 2 12
-2004 1 2 11
-2004 1 2 10
-2004 1 2 9
-2004 1 2 8
-2004 1 2 7
-2004 1 2 6
-2004 1 2 5
-2004 1 2 4
-2004 1 2 3
-2004 1 2 2
-2004 1 2 1
-2004 1 1 31
-2004 1 1 30
-2004 1 1 29
-2004 1 1 28
-2004 1 1 27
-2004 1 1 26
-2004 1 1 25
-2004 1 1 24
-2004 1 1 23
-2004 1 1 22
-2004 1 1 21
-2004 1 1 20
-2004 1 1 19
-2004 1 1 18
-2004 1 1 17
-2004 1 1 16
-2004 1 1 15
-2004 1 1 14
-2004 1 1 13
-2004 1 1 12
-2004 1 1 11
-2004 1 1 10
-2004 1 1 9
-2004 1 1 8
-2004 1 1 7
-2004 1 1 6
-2004 1 1 5
-2004 1 1 4
-2004 1 1 3
-2004 1 1 2
2004 1 1 1
+2004 1 1 2
+2004 1 1 3
+2004 1 1 4
+2004 1 1 5
+2004 1 1 6
+2004 1 1 7
+2004 1 1 8
+2004 1 1 9
+2004 1 1 10
+2004 1 1 11
+2004 1 1 12
+2004 1 1 13
+2004 1 1 14
+2004 1 1 15
+2004 1 1 16
+2004 1 1 17
+2004 1 1 18
+2004 1 1 19
+2004 1 1 20
+2004 1 1 21
+2004 1 1 22
+2004 1 1 23
+2004 1 1 24
+2004 1 1 25
+2004 1 1 26
+2004 1 1 27
+2004 1 1 28
+2004 1 1 29
+2004 1 1 30
+2004 1 1 31
+2004 1 2 1
+2004 1 2 2
+2004 1 2 3
+2004 1 2 4
+2004 1 2 5
+2004 1 2 6
+2004 1 2 7
+2004 1 2 8
+2004 1 2 9
+2004 1 2 10
+2004 1 2 11
+2004 1 2 12
+2004 1 2 13
+2004 1 2 14
+2004 1 2 15
+2004 1 2 16
+2004 1 2 17
+2004 1 2 18
+2004 1 2 19
+2004 1 2 20
+2004 1 2 21
+2004 1 2 22
+2004 1 2 23
+2004 1 2 24
+2004 1 2 25
+2004 1 2 26
+2004 1 2 27
+2004 1 2 28
+2004 1 2 29
+2004 1 3 1
+2004 1 3 2
+2004 1 3 3
+2004 1 3 4
+2004 1 3 5
+2004 1 3 6
+2004 1 3 7
+2004 1 3 8
+2004 1 3 9
+2004 1 3 10
+2004 1 3 11
+2004 1 3 12
+2004 1 3 13
+2004 1 3 14
+2004 1 3 15
+2004 1 3 16
+2004 1 3 17
+2004 1 3 18
+2004 1 3 19
+2004 1 3 20
+2004 1 3 21
+2004 1 3 22
+2004 1 3 23
+2004 1 3 24
+2004 1 3 25
+2004 1 3 26
+2004 1 3 27
+2004 1 3 28
+2004 1 3 29
+2004 1 3 30
+2004 1 3 31
+2004 2 4 1
+2004 2 4 2
+2004 2 4 3
+2004 2 4 4
+2004 2 4 5
+2004 2 4 6
+2004 2 4 7
+2004 2 4 8
+2004 2 4 9
+2004 2 4 10
+2004 2 4 11
+2004 2 4 12
+2004 2 4 13
+2004 2 4 14
+2004 2 4 15
+2004 2 4 16
+2004 2 4 17
+2004 2 4 18
+2004 2 4 19
+2004 2 4 20
+2004 2 4 21
+2004 2 4 22
+2004 2 4 23
+2004 2 4 24
+2004 2 4 25
+2004 2 4 26
+2004 2 4 27
+2004 2 4 28
+2004 2 4 29
+2004 2 4 30
+2004 2 5 1
+2004 2 5 2
+2004 2 5 3
+2004 2 5 4
+2004 2 5 5
+2004 2 5 6
+2004 2 5 7
+2004 2 5 8
+2004 2 5 9
+2004 2 5 10
+2004 2 5 11
+2004 2 5 12
+2004 2 5 13
+2004 2 5 14
+2004 2 5 15
+2004 2 5 16
+2004 2 5 17
+2004 2 5 18
+2004 2 5 19
+2004 2 5 20
+2004 2 5 21
+2004 2 5 22
+2004 2 5 23
+2004 2 5 24
+2004 2 5 25
+2004 2 5 26
+2004 2 5 27
+2004 2 5 28
+2004 2 5 29
+2004 2 5 30
+2004 2 5 31
+2004 2 6 1
+2004 2 6 2
+2004 2 6 3
+2004 2 6 4
+2004 2 6 5
+2004 2 6 6
+2004 2 6 7
+2004 2 6 8
+2004 2 6 9
+2004 2 6 10
+2004 2 6 11
+2004 2 6 12
+2004 2 6 13
+2004 2 6 14
+2004 2 6 15
+2004 2 6 16
+2004 2 6 17
+2004 2 6 18
+2004 2 6 19
+2004 2 6 20
+2004 2 6 21
+2004 2 6 22
+2004 2 6 23
+2004 2 6 24
+2004 2 6 25
+2004 2 6 26
+2004 2 6 27
+2004 2 6 28
+2004 2 6 29
+2004 2 6 30
+2004 3 7 1
+2004 3 7 2
+2004 3 7 3
+2004 3 7 4
+2004 3 7 5
+2004 3 7 6
+2004 3 7 7
+2004 3 7 8
+2004 3 7 9
+2004 3 7 10
+2004 3 7 11
+2004 3 7 12
+2004 3 7 13
+2004 3 7 14
+2004 3 7 15
+2004 3 7 16
+2004 3 7 17
+2004 3 7 18
+2004 3 7 19
+2004 3 7 20
+2004 3 7 21
+2004 3 7 22
+2004 3 7 23
+2004 3 7 24
+2004 3 7 25
+2004 3 7 26
+2004 3 7 27
+2004 3 7 28
+2004 3 7 29
+2004 3 7 30
+2004 3 7 31
+2004 3 8 1
+2004 3 8 2
+2004 3 8 3
+2004 3 8 4
+2004 3 8 5
+2004 3 8 6
+2004 3 8 7
+2004 3 8 8
+2004 3 8 9
+2004 3 8 10
+2004 3 8 11
+2004 3 8 12
+2004 3 8 13
+2004 3 8 14
+2004 3 8 15
+2004 3 8 16
+2004 3 8 17
+2004 3 8 18 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt
index ea40941..d28f82f 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions4.txt
@@ -1,34 +1,34 @@
-2004 3 8 4
-2004 3 8 3
-2004 3 8 2
-2004 3 8 1
-2004 3 7 4
-2004 3 7 3
-2004 3 7 2
-2004 3 7 1
-2004 2 6 5
-2004 2 6 4
-2004 2 6 3
-2004 2 6 2
-2004 2 5 5
-2004 2 5 4
-2004 2 5 3
-2004 2 5 2
-2004 2 5 1
-2004 2 4 4
-2004 2 4 3
-2004 2 4 2
-2004 2 4 1
-2004 1 3 5
-2004 1 3 4
-2004 1 3 3
-2004 1 3 2
-2004 1 2 5
-2004 1 2 4
-2004 1 2 3
-2004 1 2 2
-2004 1 2 1
-2004 1 1 4
-2004 1 1 3
-2004 1 1 2
2004 1 1 1
+2004 1 1 2
+2004 1 1 3
+2004 1 1 4
+2004 1 2 1
+2004 1 2 2
+2004 1 2 3
+2004 1 2 4
+2004 1 2 5
+2004 1 3 2
+2004 1 3 3
+2004 1 3 4
+2004 1 3 5
+2004 2 4 1
+2004 2 4 2
+2004 2 4 3
+2004 2 4 4
+2004 2 5 1
+2004 2 5 2
+2004 2 5 3
+2004 2 5 4
+2004 2 5 5
+2004 2 6 2
+2004 2 6 3
+2004 2 6 4
+2004 2 6 5
+2004 3 7 1
+2004 3 7 2
+2004 3 7 3
+2004 3 7 4
+2004 3 8 1
+2004 3 8 2
+2004 3 8 3
+2004 3 8 4
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt
index 8903b08..a234c13 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions5.txt
@@ -1,37 +1,37 @@
-2004 3 8 4
-2004 3 8 3
-2004 3 8 2
-2004 3 8 1
-2004 3 7 4
-2004 3 7 3
-2004 3 7 2
-2004 3 7 1
-2004 2 6 5
-2004 2 6 4
-2004 2 6 3
-2004 2 6 2
-2004 2 5 5
-2004 2 5 4
-2004 2 5 3
-2004 2 5 2
-2004 2 5 1
-2004 2 4 4
-2004 2 4 3
-2004 2 4 2
-2004 2 4 1
-2004 1 3 5
-2004 1 3 4
-2004 1 3 3
-2004 1 3 2
-2004 1 2 5
-2004 1 2 4
-2004 1 2 3
-2004 1 2 2
-2004 1 2 1
-2004 1 1 4
-2004 1 1 3
-2004 1 1 2
2004 1 1 1
+2004 1 1 2
+2004 1 1 3
+2004 1 1 4
+2004 1 2 1
+2004 1 2 2
+2004 1 2 3
+2004 1 2 4
+2004 1 2 5
+2004 1 3 2
+2004 1 3 3
+2004 1 3 4
+2004 1 3 5
+2004 2 4 1
+2004 2 4 2
+2004 2 4 3
+2004 2 4 4
+2004 2 5 1
+2004 2 5 2
+2004 2 5 3
+2004 2 5 4
+2004 2 5 5
+2004 2 6 2
+2004 2 6 3
+2004 2 6 4
+2004 2 6 5
+2004 3 7 1
+2004 3 7 2
+2004 3 7 3
+2004 3 7 4
+2004 3 8 1
+2004 3 8 2
+2004 3 8 3
+2004 3 8 4
2004 3 8 5
2004 3 9 2
2004 3 9 3
@@ -49,4 +49,4 @@
2004 4 12 2
2004 4 12 3
2004 4 12 4
-2004 4 12 5
+2004 4 12 5 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions6.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions6.txt
index 08cf102..f639db6 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions6.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions6.txt
@@ -1,234 +1,234 @@
-2004 3 8 18
-2004 3 8 17
-2004 3 8 16
-2004 3 8 15
-2004 3 8 14
-2004 3 8 13
-2004 3 8 12
-2004 3 8 11
-2004 3 8 10
-2004 3 8 9
-2004 3 8 8
-2004 3 8 7
-2004 3 8 6
-2004 3 8 5
-2004 3 8 4
-2004 3 8 3
-2004 3 8 2
-2004 3 8 1
-2004 3 7 31
-2004 3 7 30
-2004 3 7 29
-2004 3 7 28
-2004 3 7 27
-2004 3 7 26
-2004 3 7 25
-2004 3 7 24
-2004 3 7 23
-2004 3 7 22
-2004 3 7 21
-2004 3 7 20
-2004 3 7 19
-2004 3 7 18
-2004 3 7 17
-2004 3 7 16
-2004 3 7 15
-2004 3 7 14
-2004 3 7 13
-2004 3 7 12
-2004 3 7 11
-2004 3 7 10
-2004 3 7 9
-2004 3 7 8
-2004 3 7 7
-2004 3 7 6
-2004 3 7 5
-2004 3 7 4
-2004 3 7 3
-2004 3 7 2
-2004 3 7 1
-2004 2 6 30
-2004 2 6 29
-2004 2 6 28
-2004 2 6 27
-2004 2 6 26
-2004 2 6 25
-2004 2 6 24
-2004 2 6 23
-2004 2 6 22
-2004 2 6 21
-2004 2 6 20
-2004 2 6 19
-2004 2 6 18
-2004 2 6 17
-2004 2 6 16
-2004 2 6 15
-2004 2 6 14
-2004 2 6 13
-2004 2 6 12
-2004 2 6 11
-2004 2 6 10
-2004 2 6 9
-2004 2 6 8
-2004 2 6 7
-2004 2 6 6
-2004 2 6 5
-2004 2 6 4
-2004 2 6 3
-2004 2 6 2
-2004 2 6 1
-2004 2 5 31
-2004 2 5 30
-2004 2 5 29
-2004 2 5 28
-2004 2 5 27
-2004 2 5 26
-2004 2 5 25
-2004 2 5 24
-2004 2 5 23
-2004 2 5 22
-2004 2 5 21
-2004 2 5 20
-2004 2 5 19
-2004 2 5 18
-2004 2 5 17
-2004 2 5 16
-2004 2 5 15
-2004 2 5 14
-2004 2 5 13
-2004 2 5 12
-2004 2 5 11
-2004 2 5 10
-2004 2 5 9
-2004 2 5 8
-2004 2 5 7
-2004 2 5 6
-2004 2 5 5
-2004 2 5 4
-2004 2 5 3
-2004 2 5 2
-2004 2 5 1
-2004 2 4 30
-2004 2 4 29
-2004 2 4 28
-2004 2 4 27
-2004 2 4 26
-2004 2 4 25
-2004 2 4 24
-2004 2 4 23
-2004 2 4 22
-2004 2 4 21
-2004 2 4 20
-2004 2 4 19
-2004 2 4 18
-2004 2 4 17
-2004 2 4 16
-2004 2 4 15
-2004 2 4 14
-2004 2 4 13
-2004 2 4 12
-2004 2 4 11
-2004 2 4 10
-2004 2 4 9
-2004 2 4 8
-2004 2 4 7
-2004 2 4 6
-2004 2 4 5
-2004 2 4 4
-2004 2 4 3
-2004 2 4 2
-2004 2 4 1
-2004 1 3 31
-2004 1 3 30
-2004 1 3 29
-2004 1 3 28
-2004 1 3 27
-2004 1 3 26
-2004 1 3 25
-2004 1 3 24
-2004 1 3 23
-2004 1 3 22
-2004 1 3 21
-2004 1 3 20
-2004 1 3 19
-2004 1 3 18
-2004 1 3 17
-2004 1 3 16
-2004 1 3 15
-2004 1 3 14
-2004 1 3 13
-2004 1 3 12
-2004 1 3 11
-2004 1 3 10
-2004 1 3 9
-2004 1 3 8
-2004 1 3 7
-2004 1 3 6
-2004 1 3 5
-2004 1 3 4
-2004 1 3 3
-2004 1 3 2
-2004 1 3 1
-2004 1 2 29
-2004 1 2 28
-2004 1 2 27
-2004 1 2 26
-2004 1 2 25
-2004 1 2 24
-2004 1 2 23
-2004 1 2 22
-2004 1 2 21
-2004 1 2 20
-2004 1 2 19
-2004 1 2 18
-2004 1 2 17
-2004 1 2 16
-2004 1 2 15
-2004 1 2 14
-2004 1 2 13
-2004 1 2 12
-2004 1 2 11
-2004 1 2 10
-2004 1 2 9
-2004 1 2 8
-2004 1 2 7
-2004 1 2 6
-2004 1 2 5
-2004 1 2 4
-2004 1 2 3
-2004 1 2 2
-2004 1 2 1
-2004 1 1 31
-2004 1 1 30
-2004 1 1 29
-2004 1 1 28
-2004 1 1 27
-2004 1 1 26
-2004 1 1 25
-2004 1 1 24
-2004 1 1 23
-2004 1 1 22
-2004 1 1 21
-2004 1 1 20
-2004 1 1 19
-2004 1 1 18
-2004 1 1 17
-2004 1 1 16
-2004 1 1 15
-2004 1 1 14
-2004 1 1 13
-2004 1 1 12
-2004 1 1 11
-2004 1 1 10
-2004 1 1 9
-2004 1 1 8
-2004 1 1 7
-2004 1 1 6
-2004 1 1 5
-2004 1 1 4
-2004 1 1 3
-2004 1 1 2
2004 1 1 1
+2004 1 1 2
+2004 1 1 3
+2004 1 1 4
+2004 1 1 5
+2004 1 1 6
+2004 1 1 7
+2004 1 1 8
+2004 1 1 9
+2004 1 1 10
+2004 1 1 11
+2004 1 1 12
+2004 1 1 13
+2004 1 1 14
+2004 1 1 15
+2004 1 1 16
+2004 1 1 17
+2004 1 1 18
+2004 1 1 19
+2004 1 1 20
+2004 1 1 21
+2004 1 1 22
+2004 1 1 23
+2004 1 1 24
+2004 1 1 25
+2004 1 1 26
+2004 1 1 27
+2004 1 1 28
+2004 1 1 29
+2004 1 1 30
+2004 1 1 31
+2004 1 2 1
+2004 1 2 2
+2004 1 2 3
+2004 1 2 4
+2004 1 2 5
+2004 1 2 6
+2004 1 2 7
+2004 1 2 8
+2004 1 2 9
+2004 1 2 10
+2004 1 2 11
+2004 1 2 12
+2004 1 2 13
+2004 1 2 14
+2004 1 2 15
+2004 1 2 16
+2004 1 2 17
+2004 1 2 18
+2004 1 2 19
+2004 1 2 20
+2004 1 2 21
+2004 1 2 22
+2004 1 2 23
+2004 1 2 24
+2004 1 2 25
+2004 1 2 26
+2004 1 2 27
+2004 1 2 28
+2004 1 2 29
+2004 1 3 1
+2004 1 3 2
+2004 1 3 3
+2004 1 3 4
+2004 1 3 5
+2004 1 3 6
+2004 1 3 7
+2004 1 3 8
+2004 1 3 9
+2004 1 3 10
+2004 1 3 11
+2004 1 3 12
+2004 1 3 13
+2004 1 3 14
+2004 1 3 15
+2004 1 3 16
+2004 1 3 17
+2004 1 3 18
+2004 1 3 19
+2004 1 3 20
+2004 1 3 21
+2004 1 3 22
+2004 1 3 23
+2004 1 3 24
+2004 1 3 25
+2004 1 3 26
+2004 1 3 27
+2004 1 3 28
+2004 1 3 29
+2004 1 3 30
+2004 1 3 31
+2004 2 4 1
+2004 2 4 2
+2004 2 4 3
+2004 2 4 4
+2004 2 4 5
+2004 2 4 6
+2004 2 4 7
+2004 2 4 8
+2004 2 4 9
+2004 2 4 10
+2004 2 4 11
+2004 2 4 12
+2004 2 4 13
+2004 2 4 14
+2004 2 4 15
+2004 2 4 16
+2004 2 4 17
+2004 2 4 18
+2004 2 4 19
+2004 2 4 20
+2004 2 4 21
+2004 2 4 22
+2004 2 4 23
+2004 2 4 24
+2004 2 4 25
+2004 2 4 26
+2004 2 4 27
+2004 2 4 28
+2004 2 4 29
+2004 2 4 30
+2004 2 5 1
+2004 2 5 2
+2004 2 5 3
+2004 2 5 4
+2004 2 5 5
+2004 2 5 6
+2004 2 5 7
+2004 2 5 8
+2004 2 5 9
+2004 2 5 10
+2004 2 5 11
+2004 2 5 12
+2004 2 5 13
+2004 2 5 14
+2004 2 5 15
+2004 2 5 16
+2004 2 5 17
+2004 2 5 18
+2004 2 5 19
+2004 2 5 20
+2004 2 5 21
+2004 2 5 22
+2004 2 5 23
+2004 2 5 24
+2004 2 5 25
+2004 2 5 26
+2004 2 5 27
+2004 2 5 28
+2004 2 5 29
+2004 2 5 30
+2004 2 5 31
+2004 2 6 1
+2004 2 6 2
+2004 2 6 3
+2004 2 6 4
+2004 2 6 5
+2004 2 6 6
+2004 2 6 7
+2004 2 6 8
+2004 2 6 9
+2004 2 6 10
+2004 2 6 11
+2004 2 6 12
+2004 2 6 13
+2004 2 6 14
+2004 2 6 15
+2004 2 6 16
+2004 2 6 17
+2004 2 6 18
+2004 2 6 19
+2004 2 6 20
+2004 2 6 21
+2004 2 6 22
+2004 2 6 23
+2004 2 6 24
+2004 2 6 25
+2004 2 6 26
+2004 2 6 27
+2004 2 6 28
+2004 2 6 29
+2004 2 6 30
+2004 3 7 1
+2004 3 7 2
+2004 3 7 3
+2004 3 7 4
+2004 3 7 5
+2004 3 7 6
+2004 3 7 7
+2004 3 7 8
+2004 3 7 9
+2004 3 7 10
+2004 3 7 11
+2004 3 7 12
+2004 3 7 13
+2004 3 7 14
+2004 3 7 15
+2004 3 7 16
+2004 3 7 17
+2004 3 7 18
+2004 3 7 19
+2004 3 7 20
+2004 3 7 21
+2004 3 7 22
+2004 3 7 23
+2004 3 7 24
+2004 3 7 25
+2004 3 7 26
+2004 3 7 27
+2004 3 7 28
+2004 3 7 29
+2004 3 7 30
+2004 3 7 31
+2004 3 8 1
+2004 3 8 2
+2004 3 8 3
+2004 3 8 4
+2004 3 8 5
+2004 3 8 6
+2004 3 8 7
+2004 3 8 8
+2004 3 8 9
+2004 3 8 10
+2004 3 8 11
+2004 3 8 12
+2004 3 8 13
+2004 3 8 14
+2004 3 8 15
+2004 3 8 16
+2004 3 8 17
+2004 3 8 18
2004 3 8 19
2004 3 8 20
2004 3 8 21
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions7.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions7.txt
index ea2b4f2..3b83c06 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions7.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions7.txt
@@ -1,11 +1,11 @@
-2002 8
-2002 7
-2002 6
-2002 5
-2002 4
-2002 3
-2002 2
2002 1
+2002 2
+2002 3
+2002 4
+2002 5
+2002 6
+2002 7
+2002 8
2002 9
2002 10
2002 11
diff --git a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions8.txt b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions8.txt
index e5050b8..85b982b 100644
--- a/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions8.txt
+++ b/data/org.eclipse.birt.data.tests/test/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/golden/YearToDateFunctionTest.testFunctions8.txt
@@ -1,4 +1,4 @@
-2002 2
2002 1
+2002 2
2002 3
2002 4 \ No newline at end of file
diff --git a/data/org.eclipse.birt.data/plugin.xml b/data/org.eclipse.birt.data/plugin.xml
index 644a28d..89bc57e 100644
--- a/data/org.eclipse.birt.data/plugin.xml
+++ b/data/org.eclipse.birt.data/plugin.xml
@@ -9,5 +9,13 @@
point="org.eclipse.birt.core.FactoryService">
<factory class="org.eclipse.birt.data.engine.impl.DataEngineFactory"/>
</extension>
+
+ <extension
+ id="TimeFunctionCreatorFactory"
+ name="TimeFunctionCreatorFactory"
+ point="org.eclipse.birt.core.FactoryService">
+ <factory class="org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeFunctionCreatorFactory"/>
+ </extension>
+
</plugin>
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/IParallelPeriod.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/IParallelPeriod.java
new file mode 100644
index 0000000..7dc68ac
--- /dev/null
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/IParallelPeriod.java
@@ -0,0 +1,10 @@
+package org.eclipse.birt.data.engine.api.timefunction;
+
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
+
+public interface IParallelPeriod
+{
+ //return a members of the Time hierarchy
+ TimeMember getResult( TimeMember member );
+}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/IPeriodsFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/IPeriodsFunction.java
new file mode 100644
index 0000000..e45c2a4
--- /dev/null
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/IPeriodsFunction.java
@@ -0,0 +1,12 @@
+package org.eclipse.birt.data.engine.api.timefunction;
+
+import java.util.List;
+
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
+
+public interface IPeriodsFunction
+{
+ //return a set of members of the Time hierarchy
+ List<TimeMember> getResult( TimeMember member );
+}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/ITimeFunctionCreator.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/ITimeFunctionCreator.java
new file mode 100644
index 0000000..f1b944e
--- /dev/null
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/ITimeFunctionCreator.java
@@ -0,0 +1,10 @@
+package org.eclipse.birt.data.engine.api.timefunction;
+
+public interface ITimeFunctionCreator
+{
+ IPeriodsFunction createPeriodsToDateFunction( String levelType, boolean isCurrent );
+
+ IPeriodsFunction createTrailingFunction( String levelType, int Offset );
+
+ IParallelPeriod createParallelPeriodFunction( String levelType, int Offset );
+}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/ITimeFunctionCreatorFactory.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/ITimeFunctionCreatorFactory.java
new file mode 100644
index 0000000..0fb13d2
--- /dev/null
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/ITimeFunctionCreatorFactory.java
@@ -0,0 +1,11 @@
+package org.eclipse.birt.data.engine.api.timefunction;
+
+import org.eclipse.birt.core.exception.BirtException;
+
+
+public interface ITimeFunctionCreatorFactory
+{
+ public static final String EXTENSION_TIME_FUNCTION_CREATOR_FACTORY = "org.eclipse.birt.data.TimeFunctionCreatorFactory";
+
+ ITimeFunctionCreator createTimeFunctionCreator() throws BirtException;
+}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/TimeFunctionCreatorEngine.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/TimeFunctionCreatorEngine.java
new file mode 100644
index 0000000..f6e3edb
--- /dev/null
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/TimeFunctionCreatorEngine.java
@@ -0,0 +1,26 @@
+package org.eclipse.birt.data.engine.api.timefunction;
+
+import org.eclipse.birt.core.exception.BirtException;
+import org.eclipse.birt.core.framework.Platform;
+import org.eclipse.birt.data.engine.core.DataException;
+import org.eclipse.birt.data.engine.i18n.ResourceConstants;
+
+
+public class TimeFunctionCreatorEngine
+{
+
+ public static ITimeFunctionCreator newTimeFunctionCreator() throws BirtException
+ {
+ Platform.startup( null );
+
+ Object factory = Platform.createFactoryObject( ITimeFunctionCreatorFactory.EXTENSION_TIME_FUNCTION_CREATOR_FACTORY );
+ if ( factory instanceof ITimeFunctionCreatorFactory )
+ {
+ return ((ITimeFunctionCreatorFactory) factory).createTimeFunctionCreator( ) ;
+ }
+ else
+ {
+ throw new DataException( ResourceConstants.LOAD_FACTORY_ERROR );
+ }
+ }
+}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeMember.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/TimeMember.java
index 975bae4..ace401e 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeMember.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/api/timefunction/TimeMember.java
@@ -1,4 +1,4 @@
-package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
+package org.eclipse.birt.data.engine.api.timefunction;
public class TimeMember
{
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java
index 5b165ba..72b61a0 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/AggregationCalculator.java
@@ -21,8 +21,11 @@ import org.eclipse.birt.data.engine.aggregation.AggregationUtil;
import org.eclipse.birt.data.engine.api.aggregation.Accumulator;
import org.eclipse.birt.data.engine.api.aggregation.AggregationManager;
import org.eclipse.birt.data.engine.api.aggregation.IAggrFunction;
+import org.eclipse.birt.data.engine.api.timefunction.IParallelPeriod;
import org.eclipse.birt.data.engine.api.timefunction.ITimeFunction;
import org.eclipse.birt.data.engine.api.timefunction.TimePeriodType;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
import org.eclipse.birt.data.engine.core.DataException;
import org.eclipse.birt.data.engine.executor.cache.SizeOfUtil;
import org.eclipse.birt.data.engine.i18n.DataResourceHandle;
@@ -34,10 +37,7 @@ import org.eclipse.birt.data.engine.olap.data.api.cube.IDimension;
import org.eclipse.birt.data.engine.olap.data.impl.AggregationDefinition;
import org.eclipse.birt.data.engine.olap.data.impl.AggregationFunctionDefinition;
import org.eclipse.birt.data.engine.olap.data.impl.DimColumn;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.IParallelPeriod;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.IPeriodsFunction;
import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeFunctionFactory;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeMember;
import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeMemberUtil;
import org.eclipse.birt.data.engine.olap.data.impl.dimension.Member;
import org.eclipse.birt.data.engine.olap.data.util.BufferedStructureArray;
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
index c00e871..31592fe 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/TimeFunctionCalculator.java
@@ -14,6 +14,9 @@ import org.eclipse.birt.data.engine.api.aggregation.AggregationManager;
import org.eclipse.birt.data.engine.api.aggregation.IAggrFunction;
import org.eclipse.birt.data.engine.api.timefunction.ITimeFunction;
import org.eclipse.birt.data.engine.api.timefunction.TimePeriodType;
+import org.eclipse.birt.data.engine.api.timefunction.IParallelPeriod;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
import org.eclipse.birt.data.engine.core.DataException;
import org.eclipse.birt.data.engine.executor.cache.SizeOfUtil;
import org.eclipse.birt.data.engine.i18n.DataResourceHandle;
@@ -28,10 +31,7 @@ import org.eclipse.birt.data.engine.olap.data.api.cube.IDimension;
import org.eclipse.birt.data.engine.olap.data.impl.AggregationDefinition;
import org.eclipse.birt.data.engine.olap.data.impl.AggregationFunctionDefinition;
import org.eclipse.birt.data.engine.olap.data.impl.DimColumn;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.IParallelPeriod;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.IPeriodsFunction;
import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeFunctionFactory;
-import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeMember;
import org.eclipse.birt.data.engine.olap.data.impl.aggregation.function.TimeMemberUtil;
import org.eclipse.birt.data.engine.olap.data.impl.dimension.Member;
import org.eclipse.birt.data.engine.olap.data.util.BufferedStructureArray;
@@ -987,4 +987,9 @@ class PeriodsToDateWithParallel implements IPeriodsFunction
{
return periodsToDateFunc.getResult( parallelFunc.getResult( member ) );
}
+
+ public String getToolTip(TimeMember member)
+ {
+ return null;
+ }
} \ No newline at end of file
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/AbstractMDX.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/AbstractMDX.java
index b47acbe..3efb90e 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/AbstractMDX.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/AbstractMDX.java
@@ -1,6 +1,8 @@
package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import com.ibm.icu.util.Calendar;
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/IParallelPeriod.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/IParallelPeriod.java
deleted file mode 100644
index d8550f4..0000000
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/IParallelPeriod.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
-
-
-public interface IParallelPeriod
-{
- //return a members of the Time hierarchy
- TimeMember getResult( TimeMember member );
-}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/IPeriodsFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/IPeriodsFunction.java
deleted file mode 100644
index f42f8c7..0000000
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/IPeriodsFunction.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
-
-import java.util.List;
-
-
-public interface IPeriodsFunction
-{
- //return a set of members of the Time hierarchy
- List<TimeMember> getResult( TimeMember member );
-}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java
index ed8a057..1876eae 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/MonthToDateFunction.java
@@ -4,6 +4,9 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.GregorianCalendar;
@@ -34,13 +37,8 @@ public class MonthToDateFunction extends AbstractMDX
Calendar cal = new GregorianCalendar( TimeMemberUtil.getTimeZone( ),
TimeMemberUtil.getDefaultLocale( ) );
cal.clear( );
- cal.set(Calendar.DAY_OF_MONTH, 28);
+ cal.set( Calendar.DAY_OF_MONTH, 28 );
String baseType = translateToCal( cal, levelTypes, values );
- Calendar isCurrentCal = null;
- if ( isCurrent )
- {
- isCurrentCal = (Calendar) cal.clone( );
- }
int[] tmp;
if ( baseType.equals( MONTH ) )
{
@@ -62,14 +60,14 @@ public class MonthToDateFunction extends AbstractMDX
}
if( isCurrent )
{
- int currentMonth = isCurrentCal.get( Calendar.MONTH );
- isCurrentCal.add( Calendar.WEEK_OF_MONTH, 1 );
- while( currentMonth == isCurrentCal.get( Calendar.MONTH ))
+ int currentMonth = cal.get( Calendar.MONTH );
+ cal.add( Calendar.WEEK_OF_MONTH, 1 );
+ while( currentMonth == cal.get( Calendar.MONTH ))
{
- int[] newValues = getValueFromCal( isCurrentCal, levelTypes );
+ int[] newValues = getValueFromCal( cal, levelTypes );
TimeMember newMember = new TimeMember( newValues, levelTypes );
timeMembers.add( newMember );
- isCurrentCal.add( Calendar.WEEK_OF_MONTH, 1 );
+ cal.add( Calendar.WEEK_OF_MONTH, 1 );
}
}
}
@@ -85,14 +83,14 @@ public class MonthToDateFunction extends AbstractMDX
}
if( isCurrent )
{
- int currentMonth = isCurrentCal.get( Calendar.MONTH );
- isCurrentCal.add( Calendar.DAY_OF_MONTH, 1 );
- while( currentMonth == isCurrentCal.get( Calendar.MONTH ))
+ int currentMonth = cal.get( Calendar.MONTH );
+ cal.add( Calendar.DAY_OF_MONTH, 1 );
+ while( currentMonth == cal.get( Calendar.MONTH ))
{
- int[] newValues = getValueFromCal( isCurrentCal, levelTypes );
+ int[] newValues = getValueFromCal( cal, levelTypes );
TimeMember newMember = new TimeMember( newValues, levelTypes );
timeMembers.add( newMember );
- isCurrentCal.add( Calendar.DAY_OF_MONTH, 1 );
+ cal.add( Calendar.DAY_OF_MONTH, 1 );
}
}
}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java
index c561c1d..c0bb306 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/PreviousNPeriodsFunction.java
@@ -1,5 +1,8 @@
package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
+import org.eclipse.birt.data.engine.api.timefunction.IParallelPeriod;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.GregorianCalendar;
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java
index 95c248b..440ff1a 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/QuarterToDateFunction.java
@@ -3,6 +3,9 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.GregorianCalendar;
@@ -18,11 +21,6 @@ public class QuarterToDateFunction extends AbstractMDX implements IPeriodsFuncti
TimeMemberUtil.getDefaultLocale( ) );
cal.clear();
String calculateUnit = this.translateToCal( cal, levels, values ) ;
- Calendar isCurrentCal = null;
- if ( isCurrent )
- {
- isCurrentCal = (Calendar) cal.clone( );
- }
List<TimeMember> list = new ArrayList<TimeMember>( );
if ( calculateUnit.equals( QUARTER ) )
@@ -38,21 +36,22 @@ public class QuarterToDateFunction extends AbstractMDX implements IPeriodsFuncti
TimeMember newMember = null;
for ( int i = startMonth; i <= month; i++ )
{
- int[] newValues = getValueFromCal( cal, levels );
- newMember = new TimeMember( newValues, levels );
+ cal.set( Calendar.MONTH, i-1 );
+ int[] newValues = getValueFromCal( cal,levels);
+ newMember = new TimeMember(newValues,levels);
list.add( newMember );
- cal.add( Calendar.MONTH, -1 );
}
+
if( isCurrent )
{
- int currentQuarter = isCurrentCal.get( Calendar.MONTH ) / 3 + 1;
- isCurrentCal.add( Calendar.MONTH, 1 );
- while( currentQuarter == isCurrentCal.get( Calendar.MONTH ) / 3 + 1)
+ int currentQuarter = cal.get( Calendar.MONTH ) / 3 + 1;
+ cal.add( Calendar.MONTH, 1 );
+ while( currentQuarter == cal.get( Calendar.MONTH ) / 3 + 1)
{
- int[] newValues = getValueFromCal( isCurrentCal, levels );
+ int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- isCurrentCal.add( Calendar.MONTH, 1 );
+ cal.add( Calendar.MONTH, 1 );
}
}
}
@@ -69,21 +68,21 @@ public class QuarterToDateFunction extends AbstractMDX implements IPeriodsFuncti
TimeMember newMember = null;
for ( int i = starWeek; i <= weekOfYear; i++ )
{
+ cal.set (Calendar.WEEK_OF_YEAR,i);
int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- cal.add( Calendar.WEEK_OF_YEAR, -1 );
}
if( isCurrent )
{
- int currentQuarter = isCurrentCal.get( Calendar.MONTH ) / 3 + 1;
- isCurrentCal.add( Calendar.WEEK_OF_YEAR, 1 );
- while( currentQuarter == isCurrentCal.get( Calendar.MONTH ) / 3 + 1)
+ int currentQuarter = cal.get( Calendar.MONTH ) / 3 + 1;
+ cal.add( Calendar.WEEK_OF_YEAR, 1 );
+ while( currentQuarter == cal.get( Calendar.MONTH ) / 3 + 1)
{
- int[] newValues = getValueFromCal( isCurrentCal, levels );
+ int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- isCurrentCal.add( Calendar.WEEK_OF_YEAR, 1 );
+ cal.add( Calendar.WEEK_OF_YEAR, 1 );
}
}
}
@@ -99,21 +98,21 @@ public class QuarterToDateFunction extends AbstractMDX implements IPeriodsFuncti
TimeMember newMember = null;
for ( int i = startDay; i <= dayOfYear; i++ )
{
+ cal.set( Calendar.DAY_OF_YEAR, i );
int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- cal.add( Calendar.DAY_OF_YEAR, -1 );
}
if( isCurrent )
{
- int currentQuarter = isCurrentCal.get( Calendar.MONTH ) / 3 + 1;
- isCurrentCal.add( Calendar.DAY_OF_YEAR, 1 );
- while( currentQuarter == isCurrentCal.get( Calendar.MONTH ) / 3 + 1)
+ int currentQuarter = cal.get( Calendar.MONTH ) / 3 + 1;
+ cal.add( Calendar.DAY_OF_YEAR, 1 );
+ while( currentQuarter == cal.get( Calendar.MONTH ) / 3 + 1)
{
- int[] newValues = getValueFromCal( isCurrentCal, levels );
+ int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- isCurrentCal.add( Calendar.DAY_OF_YEAR, 1 );
+ cal.add( Calendar.DAY_OF_YEAR, 1 );
}
}
}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionCreator.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionCreator.java
new file mode 100644
index 0000000..eb62320
--- /dev/null
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionCreator.java
@@ -0,0 +1,24 @@
+package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
+
+import org.eclipse.birt.data.engine.api.timefunction.IParallelPeriod;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.ITimeFunctionCreator;
+
+
+public class TimeFunctionCreator implements ITimeFunctionCreator
+{
+ public IPeriodsFunction createPeriodsToDateFunction( String levelType, boolean isCurrent )
+ {
+ return TimeFunctionFactory.createPeriodsToDateFunction( levelType, isCurrent );
+ }
+
+ public IPeriodsFunction createTrailingFunction( String levelType, int Offset )
+ {
+ return TimeFunctionFactory.createTrailingFunction( levelType, Offset );
+ }
+
+ public IParallelPeriod createParallelPeriodFunction( String levelType, int Offset )
+ {
+ return TimeFunctionFactory.createParallelPeriodFunction( levelType, Offset );
+ }
+}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionCreatorFactory.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionCreatorFactory.java
new file mode 100644
index 0000000..ce29bbe
--- /dev/null
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionCreatorFactory.java
@@ -0,0 +1,14 @@
+package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
+
+import org.eclipse.birt.core.exception.BirtException;
+import org.eclipse.birt.data.engine.api.timefunction.ITimeFunctionCreator;
+import org.eclipse.birt.data.engine.api.timefunction.ITimeFunctionCreatorFactory;
+
+
+public class TimeFunctionCreatorFactory implements ITimeFunctionCreatorFactory
+{
+ public ITimeFunctionCreator createTimeFunctionCreator() throws BirtException
+ {
+ return new TimeFunctionCreator();
+ }
+}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionFactory.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionFactory.java
index 5284af8..429869b 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionFactory.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeFunctionFactory.java
@@ -13,6 +13,10 @@
*/
package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
+import org.eclipse.birt.data.engine.api.timefunction.IParallelPeriod;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
public class TimeFunctionFactory
{
public static IPeriodsFunction createPeriodsToDateFunction( String levelType, boolean isCurrent )
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeMemberUtil.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeMemberUtil.java
index fbbe319..e45c7b8 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeMemberUtil.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TimeMemberUtil.java
@@ -2,6 +2,7 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.util.Date;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
import org.eclipse.birt.data.engine.olap.data.api.ILevel;
import org.eclipse.birt.data.engine.olap.data.api.cube.IDimension;
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingFunction.java
index 117b702..06243f1 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/TrailingFunction.java
@@ -4,6 +4,9 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.GregorianCalendar;
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateFunciton.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateFunciton.java
index 2d7e32c..09ad744 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateFunciton.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/WeekToDateFunciton.java
@@ -4,6 +4,9 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.GregorianCalendar;
@@ -55,5 +58,5 @@ public class WeekToDateFunciton extends AbstractMDX implements IPeriodsFunction
return timeMembers;
}
-
+
}
diff --git a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java
index af97e00..6e1a558 100644
--- a/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java
+++ b/data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/olap/data/impl/aggregation/function/YearToDateFunction.java
@@ -3,6 +3,8 @@ package org.eclipse.birt.data.engine.olap.data.impl.aggregation.function;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.GregorianCalendar;
@@ -18,11 +20,6 @@ public class YearToDateFunction extends AbstractMDX implements IPeriodsFunction
TimeMemberUtil.getDefaultLocale( ) );
cal.clear( );
String calculateUnit = this.translateToCal( cal, levels, values ) ;
- Calendar isCurrentCal = null;
- if ( isCurrent )
- {
- isCurrentCal = (Calendar) cal.clone( );
- }
List<TimeMember> list = new ArrayList<TimeMember>( );
if ( calculateUnit.equals( YEAR ) )
@@ -36,21 +33,21 @@ public class YearToDateFunction extends AbstractMDX implements IPeriodsFunction
TimeMember newMember = null;
for ( int i = 1; i <= quarter; i++ )
{
+ cal.set( Calendar.MONTH, (i-1)*3 );
int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- cal.add( Calendar.MONTH, -3 );
}
if( isCurrent )
{
- int year = isCurrentCal.get( Calendar.YEAR );
- isCurrentCal.add( Calendar.MONTH, 3 );
- while( year == isCurrentCal.get( Calendar.YEAR ))
+ int year = cal.get( Calendar.YEAR );
+ cal.add( Calendar.MONTH, 3 );
+ while( year == cal.get( Calendar.YEAR ))
{
- int[] newValues = getValueFromCal( isCurrentCal, levels );
+ int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- isCurrentCal.add( Calendar.MONTH, 3 );
+ cal.add( Calendar.MONTH, 3 );
}
}
}
@@ -60,21 +57,21 @@ public class YearToDateFunction extends AbstractMDX implements IPeriodsFunction
TimeMember newMember = null;
for( int i=1; i<=month ; i++)
{
+ cal.set( Calendar.MONTH, i-1 );
int[] newValues = getValueFromCal( cal,levels);
newMember = new TimeMember(newValues,levels);
list.add( newMember );
- cal.add( Calendar.MONTH, -1 );
}
if( isCurrent )
{
- int year = isCurrentCal.get( Calendar.YEAR );
- isCurrentCal.add( Calendar.MONTH, 1 );
- while( year == isCurrentCal.get( Calendar.YEAR ))
+ int year = cal.get( Calendar.YEAR );
+ cal.add( Calendar.MONTH, 1 );
+ while( year == cal.get( Calendar.YEAR ))
{
- int[] newValues = getValueFromCal( isCurrentCal, levels );
+ int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- isCurrentCal.add( Calendar.MONTH, 1 );
+ cal.add( Calendar.MONTH, 1 );
}
}
}
@@ -84,21 +81,21 @@ public class YearToDateFunction extends AbstractMDX implements IPeriodsFunction
TimeMember newMember = null;
for ( int i = 1; i <= weekOfYear; i++ )
{
+ cal.set (Calendar.WEEK_OF_YEAR,i);
int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- cal.add( Calendar.WEEK_OF_YEAR, -1 );
}
if( isCurrent )
{
- int year = isCurrentCal.get( Calendar.YEAR );
- isCurrentCal.add( Calendar.WEEK_OF_YEAR, 1 );
- while( year == isCurrentCal.get( Calendar.YEAR ))
+ int year = cal.get( Calendar.YEAR );
+ cal.add( Calendar.WEEK_OF_YEAR, 1 );
+ while( year == cal.get( Calendar.YEAR ))
{
- int[] newValues = getValueFromCal( isCurrentCal, levels );
+ int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- isCurrentCal.add( Calendar.WEEK_OF_YEAR, 1 );
+ cal.add( Calendar.WEEK_OF_YEAR, 1 );
}
}
}
@@ -108,21 +105,21 @@ public class YearToDateFunction extends AbstractMDX implements IPeriodsFunction
TimeMember newMember = null;
for ( int i = 1; i <= dayOfYear; i++ )
{
+ cal.set( Calendar.DAY_OF_YEAR, i );
int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- cal.add( Calendar.DAY_OF_YEAR, -1 );
}
if( isCurrent )
{
- int year = isCurrentCal.get( Calendar.YEAR );
- isCurrentCal.add( Calendar.DAY_OF_YEAR, 1 );
- while( year == isCurrentCal.get( Calendar.YEAR ))
+ int year = cal.get( Calendar.YEAR );
+ cal.add( Calendar.DAY_OF_YEAR, 1 );
+ while( year == cal.get( Calendar.YEAR ))
{
- int[] newValues = getValueFromCal( isCurrentCal, levels );
+ int[] newValues = getValueFromCal( cal, levels );
newMember = new TimeMember( newValues, levels );
list.add( newMember );
- isCurrentCal.add( Calendar.DAY_OF_YEAR, 1 );
+ cal.add( Calendar.DAY_OF_YEAR, 1 );
}
}
}
diff --git a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
index 5e8811a..2d642f6 100644
--- a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
+++ b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/api/timeFunction/TimeFunctionManager.java
@@ -11,10 +11,23 @@
package org.eclipse.birt.report.data.adapter.api.timeFunction;
import java.util.ArrayList;
+import java.util.Date;
import java.util.Iterator;
import java.util.List;
+import org.eclipse.birt.core.exception.BirtException;
+import org.eclipse.birt.data.engine.api.IBinding;
+import org.eclipse.birt.data.engine.api.timefunction.IParallelPeriod;
+import org.eclipse.birt.data.engine.api.timefunction.IPeriodsFunction;
+import org.eclipse.birt.data.engine.api.timefunction.ITimePeriod;
+import org.eclipse.birt.data.engine.api.timefunction.TimeFunctionCreatorEngine;
+import org.eclipse.birt.data.engine.api.timefunction.TimeMember;
+import org.eclipse.birt.data.engine.api.timefunction.TimePeriodType;
import org.eclipse.birt.report.data.adapter.api.DataAdapterUtil;
+import org.eclipse.birt.report.data.adapter.api.DataRequestSession;
+import org.eclipse.birt.report.data.adapter.api.DataSessionContext;
+import org.eclipse.birt.report.data.adapter.i18n.Message;
+import org.eclipse.birt.report.data.adapter.i18n.ResourceConstants;
import org.eclipse.birt.report.model.api.CalculationArgumentHandle;
import org.eclipse.birt.report.model.api.ComputedColumnHandle;
import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
@@ -22,6 +35,7 @@ import org.eclipse.birt.report.model.api.olap.DimensionHandle;
import org.eclipse.birt.report.model.api.olap.TabularHierarchyHandle;
import org.eclipse.birt.report.model.api.olap.TabularLevelHandle;
+import com.ibm.icu.util.Calendar;
import com.ibm.icu.util.ULocale;
public class TimeFunctionManager
@@ -434,4 +448,203 @@ public class TimeFunctionManager
}
return new String[0];
}
+
+ private static int[] getValueFromCal( Calendar cal, String[] levelTypes )
+ {
+ int[] tmp = new int[levelTypes.length];
+
+ for ( int i = 0; i < levelTypes.length; i++ )
+ {
+ if ( levelTypes[i].equals( TimeMember.TIME_LEVEL_TYPE_YEAR ) )
+ {
+ tmp[i] = cal.get( Calendar.YEAR );
+ }
+
+ else if ( levelTypes[i].equals( TimeMember.TIME_LEVEL_TYPE_QUARTER ) )
+ {
+ tmp[i] = cal.get( Calendar.MONTH ) / 3 + 1;
+ }
+
+ else if ( levelTypes[i].equals( TimeMember.TIME_LEVEL_TYPE_MONTH ) )
+ {
+ tmp[i] = cal.get( Calendar.MONTH ) + 1;
+ }
+
+ else if ( levelTypes[i].equals( TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH ) )
+ {
+ tmp[i] = cal.get( Calendar.WEEK_OF_MONTH );
+ }
+
+ else if ( levelTypes[i].equals( TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR ) )
+ {
+ tmp[i] = cal.get( Calendar.WEEK_OF_YEAR );
+ }
+
+ else if ( levelTypes[i].equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK ) )
+ {
+ tmp[i] = cal.get( Calendar.DAY_OF_WEEK );
+ }
+
+ else if ( levelTypes[i].equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH ) )
+ {
+ tmp[i] = cal.get( Calendar.DAY_OF_MONTH );
+ }
+
+ else if ( levelTypes[i].equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR ) )
+ {
+ tmp[i] = cal.get( Calendar.DAY_OF_YEAR );
+ }
+ }
+
+ return tmp;
+ }
+
+ /**
+ * get the description for a specific time function
+ *
+ * @param dim
+ * @param timeLevelsInXtab
+ * @param column
+ * @return
+ * @throws BirtException
+ */
+ public static String getTooltipForTimeFunction( DimensionHandle dim,
+ ComputedColumnHandle column, ULocale locale ) throws BirtException
+ {
+ String desc = null;
+ DataRequestSession session = DataRequestSession.newSession( new DataSessionContext( DataSessionContext.MODE_DIRECT_PRESENTATION ) );
+ IBinding functionBinding = session.getModelAdaptor( ).adaptBinding( column );
+ ITimePeriod basePeriod = functionBinding.getTimeFunction( ).getBaseTimePeriod( );
+ ITimePeriod relativePeriod = functionBinding.getTimeFunction( ).getRelativeTimePeriod( );
+
+ Date date = functionBinding.getTimeFunction( ).getReferenceDate( ).getDate( );
+ Calendar cal = Calendar.getInstance( locale );
+ cal.setTime( date );
+ int levelCount = dim.getDefaultHierarchy( ).getLevelCount( );
+ int[] values = new int[levelCount];
+ String[] levelTypes = new String[levelCount];
+
+ for ( int i = 0; i < levelCount; i++ )
+ {
+ levelTypes[i] = dim.getDefaultHierarchy( )
+ .getLevel( i )
+ .getDateTimeLevelType( );
+ }
+ values = getValueFromCal( cal, levelTypes );
+ TimeMember member = new TimeMember( values, levelTypes );
+ IPeriodsFunction periodsFunction = null;
+ String toDatelevelType = null;
+ String paralevelType = null;
+
+ toDatelevelType = toLevelType( basePeriod.getType( ) );
+ boolean reverse = false;
+ if( basePeriod.countOfUnit() == 0 )
+ {
+ periodsFunction = TimeFunctionCreatorEngine.newTimeFunctionCreator( ).createPeriodsToDateFunction( toDatelevelType, basePeriod.isCurrent() );
+ }
+ else
+ {
+ periodsFunction = TimeFunctionCreatorEngine.newTimeFunctionCreator( ).createTrailingFunction(
+ toDatelevelType,basePeriod.countOfUnit() );
+ if ( basePeriod.countOfUnit( ) < 0 )
+ reverse = true;
+ }
+ List<TimeMember> list = null;
+ if ( relativePeriod != null )
+ {
+ paralevelType = toLevelType( relativePeriod.getType( ) );
+ IParallelPeriod parallelPeriod = TimeFunctionCreatorEngine.newTimeFunctionCreator( ).createParallelPeriodFunction( paralevelType,
+ relativePeriod.countOfUnit( ) );
+
+ list = periodsFunction.getResult( parallelPeriod.getResult( member ));
+ }
+ else
+ {
+ list = periodsFunction.getResult( member );
+ }
+ if ( reverse )
+ {
+ desc = constructTimeFunctionToolTip( list.get( list.size( ) - 1 ),
+ list.get( 0 ),
+ getCalculationType( column.getCalculationType( ), locale ).getDisplayName( ) );
+ }
+ else
+ {
+ desc = constructTimeFunctionToolTip( list.get( 0 ),
+ list.get( list.size( ) - 1 ),
+ getCalculationType( column.getCalculationType( ), locale ).getDisplayName( ) );
+ }
+
+
+ return desc;
+ }
+
+ private static String constructTimeFunctionToolTip( TimeMember from,
+ TimeMember to, String funcName )
+ {
+ StringBuffer result = new StringBuffer( "" );
+ result.append( funcName ).append( " ( " );
+ for ( int i = 0; i < from.getLevelType( ).length; i++ )
+ {
+ result.append( getLocalizedDisplayTimeUnitName( from.getLevelType( )[i] ) );
+ result.append( from.getMemberValue( )[i] ).append( " " );
+ }
+ result.append( Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_TO ) ).append( " " );
+
+ for ( int i = 0; i < to.getLevelType( ).length; i++ )
+ {
+ result.append( getLocalizedDisplayTimeUnitName( to.getLevelType( )[i] ) );
+ result.append( to.getMemberValue( )[i] ).append( " " );
+ }
+ result.append( " )" );
+ return result.toString( );
+ }
+
+ private static String getLocalizedDisplayTimeUnitName( String name )
+ {
+ if ( name.equals( TimeMember.TIME_LEVEL_TYPE_YEAR ) )
+ return Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_YEAR );
+ else if ( name.equals( TimeMember.TIME_LEVEL_TYPE_QUARTER ) )
+ return Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_QUARTER );
+ else if ( name.equals( TimeMember.TIME_LEVEL_TYPE_MONTH ) )
+ return Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_MONTH );
+ else if ( name.equals( TimeMember.TIME_LEVEL_TYPE_WEEK_OF_MONTH ) )
+ return Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_WEEKOFMONTH );
+ else if ( name.equals( TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR ) )
+ return Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_WEEKOFYEAR );
+ else if ( name.equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH ) )
+ return Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_DAYOFMONTH );
+ else if ( name.equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_WEEK ) )
+ return Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_DAYOFWEEK );
+ else if ( name.equals( TimeMember.TIME_LEVEL_TYPE_DAY_OF_YEAR ) )
+ return Message.getMessage( ResourceConstants.TIMEFUNCTION_TOOLTIP_DAYOFYEAR );
+
+ return "";
+ }
+
+
+ private static String toLevelType( TimePeriodType timePeriodType )
+ {
+ if( timePeriodType == TimePeriodType.YEAR )
+ {
+ return TimeMember.TIME_LEVEL_TYPE_YEAR;
+ }
+ else if( timePeriodType == TimePeriodType.QUARTER )
+ {
+ return TimeMember.TIME_LEVEL_TYPE_QUARTER;
+ }
+ else if( timePeriodType == TimePeriodType.MONTH )
+ {
+ return TimeMember.TIME_LEVEL_TYPE_MONTH;
+ }
+ else if( timePeriodType == TimePeriodType.WEEK )
+ {
+ return TimeMember.TIME_LEVEL_TYPE_WEEK_OF_YEAR;
+ }
+ else if( timePeriodType == TimePeriodType.DAY )
+ {
+ return TimeMember.TIME_LEVEL_TYPE_DAY_OF_MONTH;
+ }
+ return null;
+ }
}
diff --git a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/Messages.properties b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/Messages.properties
index 0db7e9e..3727b6d 100644
--- a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/Messages.properties
+++ b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/Messages.properties
@@ -102,4 +102,15 @@ timeFunction.PERIOD1.displayName = The first period
timeFunction.PERIOD2.displayName = The second period
timeFunction.N1.displayName = The first N
timeFunction.N2.displayName = The second N
+
+timeFunction.toolTip.to=To
+timeFunction.toolTip.year=Year:
+timeFunction.toolTip.quarter=Quarter:
+timeFunction.toolTip.month=Month:
+timeFunction.toolTip.dayOfMonth=Day Of Month:
+timeFunction.toolTip.dayOfWeek=Day Of Week:
+timeFunction.toolTip.weekOfYear=Week Of Year:
+timeFunction.toolTip.weekOfMonth=Week Of Month:
+timeFunction.toolTip.dayOfYear=Day Of Year:
+
\ No newline at end of file
diff --git a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/ResourceConstants.java b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/ResourceConstants.java
index 0b25320..33f0681 100644
--- a/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/ResourceConstants.java
+++ b/data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/i18n/ResourceConstants.java
@@ -105,4 +105,15 @@ public class ResourceConstants
public final static String TIMEFUNCITON_PERIOD2_DISPLAYNAME = "timeFunction.PERIOD2.displayName";
public final static String TIMEFUNCITON_N1_DISPLAYNAME = "timeFunction.N1.displayName";
public final static String TIMEFUNCITON_N2_DISPLAYNAME = "timeFunction.N2.displayName";
+
+ //toolTip
+ public final static String TIMEFUNCTION_TOOLTIP_TO = "timeFunction.toolTip.to";
+ public final static String TIMEFUNCTION_TOOLTIP_YEAR = "timeFunction.toolTip.year";
+ public final static String TIMEFUNCTION_TOOLTIP_QUARTER = "timeFunction.toolTip.quarter";
+ public final static String TIMEFUNCTION_TOOLTIP_MONTH = "timeFunction.toolTip.month";
+ public final static String TIMEFUNCTION_TOOLTIP_WEEKOFYEAR = "timeFunction.toolTip.weekOfYear";
+ public final static String TIMEFUNCTION_TOOLTIP_WEEKOFMONTH = "timeFunction.toolTip.weekOfMonth";
+ public final static String TIMEFUNCTION_TOOLTIP_DAYOFWEEK = "timeFunction.toolTip.dayOfWeek";
+ public final static String TIMEFUNCTION_TOOLTIP_DAYOFMONTH = "timeFunction.toolTip.dayOfMonth";
+ public final static String TIMEFUNCTION_TOOLTIP_DAYOFYEAR = "timeFunction.toolTip.dayOfYear";
}
diff --git a/data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java b/data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java
index 9a8cb31..4068c4f 100644
--- a/data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java
+++ b/data/org.eclipse.birt.report.data.adapter/test/org/eclipse/birt/report/data/adapter/internal/script/TimeFunctionManagerTest.java
@@ -35,6 +35,8 @@ import org.eclipse.birt.report.model.api.elements.structures.CalculationArgument
import org.eclipse.birt.report.model.api.elements.structures.ComputedColumn;
import org.eclipse.birt.report.model.api.olap.CubeHandle;
+import com.ibm.icu.util.ULocale;
+
public class TimeFunctionManagerTest extends TestCase
{
private CubeHandle cube1;//with year, quarter, month
@@ -331,4 +333,72 @@ public class TimeFunctionManagerTest extends TestCase
timeTypes = TimeFunctionManager.getTimeType( computedHandle );
assertTrue( timeTypes[0].equals( DesignChoiceConstants.DATE_TIME_LEVEL_TYPE_DAY_OF_YEAR ) );
}
+
+ public void testGettingToolTipForTimeFunction1() throws BirtException
+ {
+ cube1 = ModelUtil.prepareCube2( );
+
+ ComputedColumnHandle computedHandle = ModelUtil.createComputedColumnHandle( );
+ computedHandle.setAggregateFunction( "SUM" );
+ computedHandle.setCalculationType( IBuildInBaseTimeFunction.QUARTER_TO_DATE );
+ computedHandle.setReferenceDateType( DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE );
+ computedHandle.getReferenceDateValue( )
+ .setExpression( new Expression( "\"2003-08-17\"", null ) );
+ computedHandle.setProperty( ComputedColumn.TIME_DIMENSION_MEMBER,
+ "dimension[\"TimeDimension\"]" );
+ String desc = TimeFunctionManager.getTooltipForTimeFunction( cube1.getDimension( "TimeDimension" ), computedHandle, ULocale.getDefault( ) );
+ assertTrue(desc.equals( "Quarter to Date ( Year:2003 Quarter:3 Month:7 Day Of Year:182 To Year:2003 Quarter:3 Month:8 Day Of Year:229 )" ) );
+ }
+
+ public void testGettingToolTipForTimeFunction2() throws BirtException
+ {
+ cube1 = ModelUtil.prepareCube2( );
+
+ ComputedColumnHandle computedHandle = ModelUtil.createComputedColumnHandle( );
+ computedHandle.setAggregateFunction( "SUM" );
+ computedHandle.setCalculationType( IBuildInBaseTimeFunction.PREVIOUS_YEAR_TO_DATE );
+
+ computedHandle.setReferenceDateType( DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE );
+ computedHandle.getReferenceDateValue( )
+ .setExpression( new Expression( "\"2003-08-17\"", null ) );
+ computedHandle.setProperty( ComputedColumn.TIME_DIMENSION_MEMBER,
+ "dimension[\"TimeDimension\"]" );
+
+ String desc = TimeFunctionManager.getTooltipForTimeFunction( cube1.getDimension( "TimeDimension" ), computedHandle, ULocale.getDefault( ) );
+ assertTrue(desc.equals( "previous Year to Date ( Year:2002 Quarter:1 Month:1 Day Of Year:1 To Year:2002 Quarter:3 Month:8 Day Of Year:229 )" ) );
+ }
+
+ public void testGettingToolTipForTimeFunction3() throws BirtException
+ {
+ cube1 = ModelUtil.prepareCube2( );
+
+ ComputedColumnHandle computedHandle = ModelUtil.createComputedColumnHandle( );
+ computedHandle.setAggregateFunction( "SUM" );
+ computedHandle.setCalculationType( IBuildInBaseTimeFunction.TRAILING_12_MONTHS );
+
+ computedHandle.setReferenceDateType( DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE );
+ computedHandle.getReferenceDateValue( )
+ .setExpression( new Expression( "\"2003-08-17\"", null ) );
+ computedHandle.setProperty( ComputedColumn.TIME_DIMENSION_MEMBER,
+ "dimension[\"TimeDimension\"]" );
+
+ String desc = TimeFunctionManager.getTooltipForTimeFunction( cube1.getDimension( "TimeDimension" ), computedHandle, ULocale.getDefault( ) );
+ assertTrue(desc.equals( "Trailing 12 Months ( Year:2002 Quarter:3 Month:8 Day Of Year:230 To Year:2003 Quarter:3 Month:8 Day Of Year:229 )" ) );
+ }
+
+ public void testGettingToolTipForTimeFunction4() throws BirtException
+ {
+ cube1 = ModelUtil.prepareCube2( );
+
+ ComputedColumnHandle computedHandle = ModelUtil.createComputedColumnHandle( );
+ computedHandle.setAggregateFunction( "SUM" );
+ computedHandle.setCalculationType( IBuildInBaseTimeFunction.CURRENT_YEAR );
+ computedHandle.setReferenceDateType( DesignChoiceConstants.REFERENCE_DATE_TYPE_FIXED_DATE );
+ computedHandle.getReferenceDateValue( )
+ .setExpression( new Expression( "\"2003-08-17\"", null ) );
+ computedHandle.setProperty( ComputedColumn.TIME_DIMENSION_MEMBER,
+ "dimension[\"TimeDimension\"]" );
+ String desc = TimeFunctionManager.getTooltipForTimeFunction( cube1.getDimension( "TimeDimension" ), computedHandle, ULocale.getDefault( ) );
+ assertTrue(desc.equals( "Current Year ( Year:2003 Quarter:1 Month:1 Day Of Year:1 To Year:2003 Quarter:4 Month:12 Day Of Year:365 )" ) );
+ }
}