Permalink
Browse files

Fixing Dashboard issue, restructure tests, extra js

  • Loading branch information...
1 parent beb3caf commit a97264cf798e59d829f9e568b544bc4898ac4d3a @sonalgoyal committed Oct 20, 2011
Showing 755 changed files with 97,524 additions and 394 deletions.
@@ -0,0 +1,6 @@
+build
+clean
+compile_src
+compile_test
+deploy
+jar
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
@@ -21,14 +21,14 @@
<jsp:include page="progress.jsp" />
<%@ page import="org.apache.struts2.json.JSONUtil"%>
<div align="center" style="color:#FF0000"><s:property value='%{error.message}'/></div>
-<script type="text/javascript" src="js/viewReport.js"></script>
<script type="text/javascript">
dojo.require("dojox.widget.Portlet");
dojo.require("dojox.layout.GridContainerLite");
dojo.require("dijit.form.Form");
dojo.require("dijit.form.TextBox");
dojo.require("dijit.form.Button");
+ <%@ include file="js/viewReport.js" %>
function showHelp(){
window.open ('help/dashboardHelp.html', '', 'width=600,scrollbars=1');
}
@@ -229,13 +229,14 @@
}
form.containerNode.appendChild(dojo.create("br"));
}
+ form.containerNode.appendChild(dojo.create("br"));
if(emptyFilter){
var button = new dijit.form.Button({
id: 'button_'+i,
label: "View Report",
onClick: function() {
var x = this.id.substring(7, this.id.length);
- populateData('form'+x,'chartType'+x,'div'+x,'legend'+x);
+ populateData(false,'form'+x,'chartType'+x,'div'+x,'legend'+x);
}
},
document.createElement("button"));
@@ -245,7 +246,7 @@
// alert(reportList[i].dashboard.column+","+reportList[i].dashboard.index);
gridContainer.addChild(portlet,reportList[i].dashboard.column);
if (!emptyFilter){
- populateData('form'+i,'chartType'+i,'div'+i,'legend'+i);
+ populateData(false,'form'+i,'chartType'+i,'div'+i,'legend'+i);
}
}
gridContainer.startup();
@@ -277,68 +278,7 @@
};
var deferred = dojo.xhrPost(xhrArgs);
}
-
- function populateData(formId,chartTypeId,divId,legendId) {
- dojo.require('dojox.charting.widget.Chart2D');
- dojo.require('dojox.charting.widget.Legend');
- dojo.require('dojox.charting.DataSeries');
- dojo.require('dojox.charting.plot2d.Markers');
- dojo.require('dojox.charting.themes.ThreeD');
- dojo.require("dojox.json.query");
- dojo.require("dojox.charting.themes.Claro");
- dojo.require("dojox.grid.DataGrid");
- dojo.require("dojo.data.ItemFileWriteStore");
- dojo.require("dojox.charting.widget.SelectableLegend");
-
- clearResponse();
- var getDataForm = dijit.byId(formId);
- var xList = [];
- var yList = [];
- var zList = [];
- var chartType = document.getElementById(chartTypeId).value;
-
- if (getDataForm.validate()) {
- showProgressIndicator();
- var xhrArgs = {
- form: dojo.byId(formId),
- url: "<s:url action='getDataAction'/>",
- handleAs: "json",
- load: function(data) {
- if(data.error.error){
- responseMessage("Error: "+data.error.message);
- }else{
- var values = data.axisValues;
- var axisValue = values.split(":");
- for(var i=0;i<axisValue.length;i++){
- var val = axisValue[i].split(",");
- if(val[0]=="x"){
- xList.push(val[1]);
- } else if(val[0]=="y"){
- yList.push(val[1]);
- } else if(val[0]=="z"){
- zList.push(val[1]);
- }
- }
- if(chartType=="Table"){
- doPlotTable(xList,data.dataList,divId);
- }else {
- doPlot(xList,yList,data.dataList,chartType,divId,legendId);
- }
- }
- hideProgressIndicator();
- },
- error: function(error) {
- hideProgressIndicator();
- responseMessage("error:"+error);
- }
- };
- var deferred = dojo.xhrPost(xhrArgs);
-
- } else {
- responseMessage("Please define filter value");
- }
-}
-
+
</script>
<style type="text/css">
@import "js/dojo/dojox/widget/Portlet/Portlet.css";
View
@@ -80,12 +80,12 @@ circle {
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileWriteStore");
dojo.require("dijit.Dialog");
+ dojo.require("dijit.form.NumberTextBox");
var dimensionList;
var measuresList ;
var xAxis;
var yAxis;
var zAxis;
- var chartType;
function showHelp(){
window.open ('help/designHelp.html', '', 'width=600,scrollbars=1');
}
@@ -101,20 +101,24 @@ circle {
clearNodes(zAxis,true);
document.getElementById("ybutton").style.visibility = "hidden";
document.getElementById("zbutton").style.visibility = "hidden";
+ document.getElementById("recordsPerPage").style.visibility = "visible";
+
} else if(value=="Choropleth"){
dojo.style("zAxis","visibility","visible");
dojo.style("yAxis","visibility","visible");
dijit.byId("xAxis").set("title","Latitude");
dijit.byId("yAxis").set("title","Longitude");
+ document.getElementById("recordsPerPage").style.visibility = "hidden";
+
} else {
document.getElementById("zbutton").style.visibility = "hidden";
dojo.style("zAxis","visibility","hidden");
dojo.style("yAxis","visibility","visible");
dijit.byId("xAxis").set("title","X-Axis");
dijit.byId("yAxis").set("title","Y-Axis");
+ document.getElementById("recordsPerPage").style.visibility = "hidden";
}
clearResponse();
- chartType=value;
}
function preview(){
@@ -146,9 +150,9 @@ circle {
var xAxisPane = new dijit.TitlePane({title: "X-Axis", open: true}, "xAxis");
var yAxisPane = new dijit.TitlePane({title: "Y-Axis", open: true}, "yAxis");
var zAxisPane = new dijit.TitlePane({title: "Data", open: true}, "zAxis");
- xAxis = new dojo.dnd.Source("xAxisNode");
- yAxis = new dojo.dnd.Source("yAxisNode");
- zAxis = new dojo.dnd.Source("zAxisNode");
+ xAxis = new dojo.dnd.Source("xAxis");
+ yAxis = new dojo.dnd.Source("yAxis");
+ zAxis = new dojo.dnd.Source("zAxis");
xAxis.parent = dojo.query("#xAxisNode tbody")[0];
yAxis.parent = dojo.query("#yAxisNode tbody")[0];
zAxis.parent = dojo.query("#zAxisNode tbody")[0];
@@ -178,6 +182,7 @@ circle {
for(var i=0; i < data.filterTypeList.length; ++i){
filter_box.addOption({value: data.filterTypeList[i].type, label: data.filterTypeList[i].type});
}
+ dojo.publish("filterPopulated");
}
} ,
error: function(error) {
@@ -510,21 +515,23 @@ circle {
}
function getValuesFromPane(paneId){
- var array=[];
- var table = document.getElementById(paneId);
- var tableCells = table.getElementsByTagName("td");
- for(var i=0;i<tableCells.length;i++){
- array.push(tableCells[i].innerHTML);
- }
- return array;
+ var array=[];
+ var table = document.getElementById(paneId);
+ var tableCells = table.getElementsByTagName("div");
+ for(var i=0;i<tableCells.length;i++){
+ array.push(tableCells[i].childNodes[0].nodeValue);
+ }
+
+ return array;
}
function getDataFromHBase() {
var getDataForm = dijit.byId("saveReportForm");
+ var chartType = dijit.byId("reportType").get("value");
if (getDataForm.validate()) {
showProgressIndicator();
var xhrArgs = {
form: dojo.byId("saveReportForm"),
- url: "<s:url action='getPreviewDataAction'/>",
+ url: "<s:url action='findPreviewReportData'/>",
handleAs: "json",
load: function(data) {
if(data.error.error){
@@ -740,10 +747,11 @@ circle {
dojo.forEach(items, function(selectedItem) {
dijit.byId('alias').set('value',grid.store.getValues(selectedItem, 'alias'));
dijit.byId('value').set('value',grid.store.getValues(selectedItem, 'value'));
- var typeFilter = grid.store.getValues(selectedItem,'filterType');
- setTimeout(function (typeFilter) {
- dijit.byId('filterType').set('value',typeFilter);
- },500,typeFilter);
+ this.typeFilter = grid.store.getValues(selectedItem,'filterType');
+ this.handle=dojo.subscribe("filterPopulated",this,function(){
+ dijit.byId('filterType').set('value',typeFilter);
+ dojo.unsubscribe(this.handle);
+ });
});
dijit.byId('isEdit').set('value',"true");
document.getElementById("addFilter").style.visibility = "visible";
@@ -825,13 +833,14 @@ circle {
}
function isValidSaveForm(xArray,yArray){
+ var chartType = dijit.byId("reportType").get("value");
var isValid = true;
if(chartType=="Table"){
if(xArray.length==0) {
responseMessage("Please drag and drop appropriate alias to define Columns for your report");
isValid=false;
}
- } else if(value=="Choropleth"){
+ } else if(chartType=="Choropleth"){
if(xArray.length>1 || yArray.length>1 || zArray.length>1){
responseMessage("Invalid data for Latitude or Longitude or Data. Please add only one Alias to these Panes");
isValid=false;
@@ -921,21 +930,15 @@ circle {
<td align="left" rowspan="2">
<table frame="border">
<tr> <td width="150px" align="center">
- <table id="dimensionList" class="container">
- <tbody align="center">
- <tr>
- <td width="150px"><b>Dimensions</b></td>
- </tr>
- </tbody>
- </table>
+ <div id="dimensionList" class="container" style="float:center;" align="center">
+ <b>Dimensions</b>
+ </div>
+
+
<br />
- <table id="measuresList" class="container">
- <tbody align="center">
- <tr>
- <td width="150px"><b>Measures</b><td>
- </tr>
- </tbody>
- </table>
+ <div id="measuresList" class="container" style="float:center;" align="center">
+ <b>Measures</b>
+ </div>
</table></td>
<td align="center">
<table id="reportTypeTable" style="visibility: hidden;">
@@ -945,7 +948,15 @@ circle {
dojoType="dijit.form.Select" onchange='changed(this.value)'>
</select> <br />
</td>
- </tr>
+
+ <td>
+ <div id="recordsPerPage">
+ &nbsp; Records per Page: &nbsp;
+ <input id="numRecordsPerPage" name="report.numRecordsPerPage" dojoType="dijit.form.NumberTextBox" style="width:52px" />
+ </div>
+ </td>
+
+ </tr>
</table></td>
</tr>
<tr>
@@ -957,19 +968,13 @@ circle {
<div id="xAxis" style="width: 100%">
<table id="xAxisNode" width=100% height=100%>
<tbody align="center">
- <tr height=100%>
- <th width=100%></th>
- </tr>
</tbody>
</table>
</div></td>
<td width="200px">
<div id="yAxis" style="width: 100%">
<table id="yAxisNode" width=100% height=100%>
<tbody align="center">
- <tr height=100%>
- <th width=100%></th>
- </tr>
</tbody>
</table>
</div>
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Dashboard-Help</title>
+<link rel="stylesheet" type="text/css" href="../js/dojo/dijit/themes/claro/claro.css"/>
+<link rel="stylesheet" type="text/css" href="../js/dojo/dojo/resources/dojo.css"/>
+</head>
+<body>
+<h1 align="center">Dashboard</h1>
+<br>
+The page displays the list of reports which have been added to dashboard each report in separate portlet. We can
+drag and drop these portlets and arrange in any sequence on the page.
+<br>
+<div align="center">
+<img align="middle" src="../Images/dashboard.jpg" />
+</div>
+<br>
+</body>
+</html>
@@ -0,0 +1,2 @@
+_site
+node_modules
No changes.
@@ -0,0 +1,26 @@
+Copyright (c) 2010, Michael Bostock
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* The name Michael Bostock may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Oops, something went wrong.

0 comments on commit a97264c

Please sign in to comment.