Permalink
Browse files

Add Dashboard Views

  • Loading branch information...
1 parent bbc82d2 commit 2a61f0c3e90f5292141087406dc0c3cbb62b2b96 @pdpi pdpi committed Sep 25, 2012
View
@@ -6,5 +6,6 @@ bi-platform-v2-plugin/override.properties
bi-platform-v2-plugin/bin/
bi-platform-v2-plugin/dist/
bi-platform-v2-plugin/lib/
-
-/nbproject/private/
+bi-platform-v2-plugin/runtime-lib/
+solution/system/
+/nbproject/private/
@@ -38,7 +38,9 @@
<property name="js.module.script.namespace" value="cdf"/>
<property name="ivy.repository.publish" value="file:///Users/nbaker/.m2/repository"/>
-
+ <property name="runtimelib.dir"
+ value="${basedir}/runtime-lib"
+ description="Directory that hosts Jar files required to run project source. (IVY will populate this directory with required jars)" />
<!-- Import the common_build.xml file which contains all the default tasks -->
<import file="common_build.xml"/>
@@ -49,6 +51,17 @@
THE TASKS THAT NEED TO DIFFER FROM THE DEFAULT IMPLEMENTATION OF THE TASKS
FOUND IN common_build.xml.
-->
+ <path id="classpath">
+ <fileset dir="${devlib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ <fileset dir="runtime-lib">
+ <include name="**/*.jar" />
+ </fileset>
+ </path>
<target name="compile.compile" depends="init" description="Performs the actual javac compile">
<javac destdir="${classes.dir}"
@@ -86,7 +99,8 @@
<property name="plugin.local.install.solutions.dir" value="../solution" />
- <target name="dist" depends="clean-dist,resolve,jar,dist-plugin,dist-solution,dist-samples,subfloor-js.dist-js"/>
+ <!--<target name="dist" depends="clean-dist,resolve,jar,dist-plugin,dist-solution,dist-samples,subfloor-js.dist-js"/>-->
+ <target name="dist" depends="clean-dist,jar,dist-plugin,dist-solution,dist-samples,subfloor-js.dist-js"/>
<target name="dist-compile" depends="clean-dist,jar,dist-plugin"/>
<property name="plugin.artifact.id" value="${plugin.name}"/>
@@ -150,6 +164,9 @@
<fileset dir="${dist.dir}">
<include name="${ivy.artifact.id}-${project.revision}.jar" />
</fileset>
+ <fileset dir="${runtimelib.dir}">
+ <include name="*.jar" />
+ </fileset>
<fileset dir="${devlib.dir}">
<include name="*.jar" />
</fileset>
@@ -332,6 +349,15 @@ excludes="**/Thumbs.db"
-->
</target>
+ <target name="resolve"
+ depends="resolve-default, resolve-test, resolve-runtime, ivy.check-releasable"
+ description="Retrieves all the dependent libraries" />
+
+ <target name="resolve-runtime" depends="resolve-init">
+ <ivy:resolve file="${ivyfile}" conf="runtime" />
+ <ivy:retrieve conf="runtime" pattern="runtime-lib/[module]-[revision](-[classifier]).[ext]" />
+ </target>
+
<target name="minify-client">
<concat destfile="${CLIENT}/scripts.js">
<filelist dir='${CLIENT}' files='${scripts}'/>
@@ -271,9 +271,15 @@ if (typeof $.SetImpromptuDefaults == 'function')
});
var Dashboards = {
+ parameterModel: new Backbone.Model(),
TRAFFIC_RED: webAppPath + "/content/pentaho-cdf/resources/style/images/traffic_red.png",
TRAFFIC_YELLOW: webAppPath + "/content/pentaho-cdf/resources/style/images/traffic_yellow.png",
TRAFFIC_GREEN: webAppPath + "/content/pentaho-cdf/resources/style/images/traffic_green.png",
+ viewFlags: {
+ UNUSED: "unused",
+ UNBOUND: "unbound",
+ VIEW: "view"
+ },
/* globalContext determines if components and params are retrieved
* from the current window's object or from the Dashboards singleton
*/
@@ -752,6 +758,7 @@ Dashboards.setI18nSupport = function(lc, i18nRef) {
Dashboards.init = function(components){
this.loadStorage();
this.restoreBookmarkables();
+ this.restoreView();
if ($.isArray(components)) {
Dashboards.addComponents(components);
}
@@ -841,6 +848,7 @@ Dashboards.fireChange = function(parameter, value) {
Dashboards.createAndCleanErrorDiv();
Dashboards.setParameter(parameter, value);
+ Dashboards.parameterModel.change();
var toUpdate = [];
var workDone = false;
var silent = true;
@@ -872,6 +880,15 @@ Dashboards.fireChange = function(parameter, value) {
}, Dashboards.renderDelay);
};
+Dashboards.restoreView = function() {
+ var p, params;
+ if(!Dashboards.view) return;
+ params = Dashboards.view.params;
+ for(p in params) if (params.hasOwnProperty(p)) {
+ Dashboards.setParameter(p,params[p]);
+ }
+};
+
Dashboards.getHashValue = function(key) {
var hash = window.location.hash,
obj;
@@ -917,12 +934,13 @@ Dashboards.setBookmarkable = function(parameter, value) {
if(!this.bookmarkables) this.bookmarkables = {};
if (arguments.length === 1) value = true;
this.bookmarkables[parameter] = value;
-}
+};
Dashboards.isBookmarkable = function(parameter) {
if(!this.bookmarkables) {return false;}
return Boolean(this.bookmarkables[parameter]);
-}
+};
+
Dashboards.generateBookmarkState = function() {
@@ -1019,6 +1037,49 @@ Dashboards.restoreBookmarkables = function() {
}
}
+Dashboards.setParameterViewMode = function(parameter, value) {
+ if(!this.viewParameters) this.viewParameters = {};
+ if (arguments.length === 1) value = Dashboards.viewFlags.VIEW;
+ //if(!Dashboards.viewFlags.hasOwnProperty(value)) throw
+ this.viewParameters[parameter] = value;
+};
+
+Dashboards.isViewParameter = function(parameter) {
+ if(!this.viewParameters) {return false;}
+ return this.viewParameters[parameter];
+};
+
+/*
+ * List the values for all dashboard parameters flagged as being View parameters
+ */
+Dashboards.getViewParameters = function(){
+ if(!this.viewParameters) return {};
+ var params = this.viewParameters,
+ ret = {};
+ for(p in params) if (params.hasOwnProperty(p)) {
+ if (params[p] == Dashboards.viewFlags.VIEW|| params[p] == Dashboards.viewFlags.UNBOUND) {
+ ret[p] = Dashboards.getParameterValue(p);
+ }
+ return ret;
+ }
+};
+
+/*
+ * List all dashboard parameters flagged as being Unbound View parameters
+ */
+
+Dashboards.getUnboundParameters = function(){
+ if(!this.viewParameters) return {};
+ var params = this.viewParameters,
+ ret = []
+ for(p in params) if (params.hasOwnProperty(p)) {
+ if (params[p] == Dashboards.viewFlags.UNBOUND) {
+ ret.push(p);
+ }
+ return ret;
+ }
+};
+
Dashboards.getParameterValue = function (parameterName) {
if (Dashboards.globalContext) {
try{
@@ -1072,6 +1133,7 @@ Dashboards.setParameter = function(parameterName, parameterValue) {
Dashboards.parameters[parameterName] = parameterValue;
}
}
+ Dashboards.parameterModel.set(parameterName,parameterValue,{silent:true});
Dashboards.persistBookmarkables(parameterName);
};
@@ -1,45 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
-
- <info organisation="pentaho" module="pentaho-cdf" revision="${project.revision}" />
-
- <configurations>
- <conf name="default"/>
- <conf name="source"/>
- <conf name="zip"/>
- <conf name="test" visibility="private"/>
- <conf name="js"/>
- </configurations>
-
- <publications>
- <artifact name="pentaho-cdf" type="jar" conf="default"/>
- <artifact name="pentaho-cdf" m:classifier="sources" type="source" ext="jar" conf="source"/>
- <artifact name="pentaho-cdf" type="zip" conf="zip"/>
- <artifact name="pentaho-cdf" m:classifier="js" type="js" ext="zip" conf="js" />
- </publications>
-
- <dependencies defaultconf="default->default">
-
- <!-- third party dependencies -->
- <dependency org="commons-logging" name="commons-logging" rev="1.1" transitive="false"/>
- <dependency org="commons-io" name="commons-io" rev="1.3" transitive="false"/>
- <dependency org="dom4j" name="dom4j" rev="1.6.1" transitive="false"/>
- <dependency org="commons-lang" name="commons-lang" rev="2.2" />
- <dependency org="org.json" name="json" rev="${dependency.json.revision}" transitive="false"/>
- <dependency org="javax.servlet" name="servlet-api" rev="2.4" />
- <!-- pentaho dependencies -->
- <dependency org="pentaho-reporting-engine" name="pentaho-reporting-engine-classic-core-platform-plugin"
- rev="${dependency.pentaho-reporting-engine-classic-core-platform-plugin.revision}" changing="true">
- </dependency> <dependency org="pentaho" name="pentaho-bi-platform-api" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
- <dependency org="pentaho" name="pentaho-bi-platform-util" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
- <dependency org="pentaho" name="pentaho-bi-platform-engine-core" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
- <dependency org="pentaho" name="pentaho-bi-platform-engine-services" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
- <dependency org="pentaho" name="pentaho-bi-platform-repository" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
- <dependency org="pentaho" name="pentaho-bi-platform-plugin-services" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
- <dependency org="pentaho" name="pentaho-bi-platform-web" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
- <dependency org="pentaho" name="pentaho-bi-platform-web-servlet" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
- <dependency org="org.hibernate" name="hibernate" rev="3.2.6.ga">
- <!--
+<ivy-module xmlns:m="http://ant.apache.org/ivy/maven" version="2.0">
+ <info organisation="pentaho" module="pentaho-cdf" revision="${project.revision}"/>
+ <configurations>
+ <conf name="default"/>
+ <conf name="runtime"/>
+ <conf name="source"/>
+ <conf name="zip"/>
+ <conf name="test" visibility="private"/>
+ <conf name="js"/>
+ </configurations>
+ <publications>
+ <artifact name="pentaho-cdf" type="jar" conf="default"/>
+ <artifact name="pentaho-cdf" m:classifier="sources" type="source" ext="jar" conf="source"/>
+ <artifact name="pentaho-cdf" type="zip" conf="zip"/>
+ <artifact name="pentaho-cdf" m:classifier="js" type="js" ext="zip" conf="js"/>
+ </publications>
+ <dependencies defaultconf="default->default">
+ <!-- third party dependencies -->
+ <dependency org="commons-logging" name="commons-logging" rev="1.1" transitive="false"/>
+ <dependency org="commons-io" name="commons-io" rev="1.3" transitive="false"/>
+ <dependency org="dom4j" name="dom4j" rev="1.6.1" transitive="false"/>
+ <dependency org="commons-lang" name="commons-lang" rev="2.2"/>
+ <dependency org="org.json" name="json" rev="${dependency.json.revision}" transitive="false"/>
+ <dependency org="javax.servlet" name="servlet-api" rev="2.4"/>
+ <!-- pentaho dependencies -->
+ <dependency org="pentaho-reporting-engine" name="pentaho-reporting-engine-classic-core-platform-plugin" rev="${dependency.pentaho-reporting-engine-classic-core-platform-plugin.revision}" changing="true">
+ </dependency>
+ <dependency org="pentaho" name="pentaho-bi-platform-api" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
+ <dependency org="pentaho" name="pentaho-bi-platform-util" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
+ <dependency org="pentaho" name="pentaho-bi-platform-engine-core" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
+ <dependency org="pentaho" name="pentaho-bi-platform-engine-services" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
+ <dependency org="pentaho" name="pentaho-bi-platform-repository" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
+ <dependency org="pentaho" name="pentaho-bi-platform-plugin-services" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
+ <dependency org="pentaho" name="pentaho-bi-platform-web" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
+ <dependency org="pentaho" name="pentaho-bi-platform-web-servlet" rev="${dependency.bi-platform.revision}" transitive="false" changing="true"/>
+ <dependency org="org.hibernate" name="hibernate" rev="3.2.6.ga">
+ <!--
include these jars, needed for unit tests. child projects may choose
to exclude these, if deploying to an app server, etc.
@@ -48,11 +44,19 @@
<exclude org="asm" name="asm" />
<exclude org="asm" name="asm-attrs" />
-->
- <exclude org="commons-logging" name="commons-logging" />
- <exclude org="commons-collections"/>
- <exclude org="dom4j" name="dom4j" />
- </dependency>
+ <exclude org="commons-logging" name="commons-logging"/>
+ <exclude org="commons-collections"/>
+ <exclude org="dom4j" name="dom4j"/>
+ </dependency>
+ <dependency org="pentaho" name="cpf" rev="TRUNK-SNAPSHOT" transitive="false" changing="true" conf="runtime->default"/>
+
+ <!-- orient db (persistence) -->
+ <dependency org="com.orientechnologies" name="orient-commons" rev="${dependency.orientdb.revision}" transitive="false" conf="runtime,default->default"/>
+ <dependency org="com.orientechnologies" name="orientdb-core" rev="${dependency.orientdb.revision}" transitive="false" conf="runtime,default->default"/>
+ <dependency org="com.orientechnologies" name="orientdb-server" rev="${dependency.orientdb.revision}" transitive="false" conf="runtime,default->default" />
+ <dependency org="com.orientechnologies" name="orientdb-client" rev="${dependency.orientdb.revision}" transitive="false" conf="runtime,default->default" />
+ <dependency org="com.orientechnologies" name="orientdb-enterprise" rev="${dependency.orientdb.revision}" transitive="false" conf="runtime,default->default" />
+
- </dependencies>
-
+ </dependencies>
</ivy-module>
Oops, something went wrong.

0 comments on commit 2a61f0c

Please sign in to comment.