Skip to content
Browse files

Cleanup redundant flders

  • Loading branch information...
1 parent 100779a commit 3e0b2de2be50f00355714c9dfaa8460d3b242b56 @sonalgoyal committed
Showing with 12 additions and 26,141 deletions.
  1. +12 −1 NOTICE.txt
  2. +0 −116 README.txt
  3. BIN WebContent/Images/connection.jpg
  4. BIN WebContent/Images/crux_transparent.gif
  5. BIN WebContent/Images/dashboard.jpg
  6. BIN WebContent/Images/design_step1.jpg
  7. BIN WebContent/Images/design_step3.jpg
  8. BIN WebContent/Images/design_step4.jpg
  9. BIN WebContent/Images/design_step6.jpg
  10. BIN WebContent/Images/mapping_step1.jpg
  11. BIN WebContent/Images/mapping_step2.jpg
  12. BIN WebContent/Images/mapping_step3.jpg
  13. BIN WebContent/Images/mapping_step4.jpg
  14. BIN WebContent/Images/mapping_step5.jpg
  15. BIN WebContent/Images/report.jpg
  16. BIN WebContent/Images/viewReport.jpg
  17. +0 −3 WebContent/META-INF/MANIFEST.MF
  18. BIN WebContent/WEB-INF/lib/antlr-2.7.6.jar
  19. BIN WebContent/WEB-INF/lib/c3p0-0.9.1.jar
  20. BIN WebContent/WEB-INF/lib/commons-codec-1.4.jar
  21. BIN WebContent/WEB-INF/lib/commons-collections-3.1.jar
  22. BIN WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar
  23. BIN WebContent/WEB-INF/lib/commons-httpclient-3.1.jar
  24. BIN WebContent/WEB-INF/lib/commons-lang-2.5.jar
  25. BIN WebContent/WEB-INF/lib/commons-logging-1.1.1.jar
  26. BIN WebContent/WEB-INF/lib/commons-pool-1.5.6.jar
  27. BIN WebContent/WEB-INF/lib/dom4j-1.6.1.jar
  28. BIN WebContent/WEB-INF/lib/ehcache-core-1.6.2.jar
  29. BIN WebContent/WEB-INF/lib/ejb3-persistence.jar
  30. BIN WebContent/WEB-INF/lib/freemarker-2.3.13.jar
  31. BIN WebContent/WEB-INF/lib/hadoop-core-0.20-append-r1056497.jar
  32. BIN WebContent/WEB-INF/lib/hbase-0.90.3.jar
  33. BIN WebContent/WEB-INF/lib/hibernate-annotations.jar
  34. BIN WebContent/WEB-INF/lib/hibernate-commons-annotations.jar
  35. BIN WebContent/WEB-INF/lib/hibernate-validator.jar
  36. BIN WebContent/WEB-INF/lib/hibernate3.jar
  37. BIN WebContent/WEB-INF/lib/javassist-3.9.0.GA.jar
  38. BIN WebContent/WEB-INF/lib/jta-1.1.jar
  39. BIN WebContent/WEB-INF/lib/log4j-1.2.16.jar
  40. BIN WebContent/WEB-INF/lib/mysql-connector-java-5.0.7.jar
  41. BIN WebContent/WEB-INF/lib/ognl-2.6.11.jar
  42. BIN WebContent/WEB-INF/lib/protobuf-java-2.3.0.jar
  43. BIN WebContent/WEB-INF/lib/servlet-api-2.5-6.1.14.jar
  44. BIN WebContent/WEB-INF/lib/slf4j-api-1.5.8.jar
  45. BIN WebContent/WEB-INF/lib/slf4j-log4j12-1.5.8.jar
  46. BIN WebContent/WEB-INF/lib/struts2-core-2.1.6.jar
  47. BIN WebContent/WEB-INF/lib/struts2-fullhibernatecore-plugin-1.4-GA.jar
  48. BIN WebContent/WEB-INF/lib/struts2-json-plugin-2.2.3.jar
  49. BIN WebContent/WEB-INF/lib/xwork-2.1.2.jar
  50. BIN WebContent/WEB-INF/lib/zookeeper-3.3.2.jar
  51. +0 −21 WebContent/WEB-INF/web.xml
  52. +0 −451 WebContent/connection.jsp
  53. +0 −117 WebContent/css/dojo.css
  54. +0 −292 WebContent/dashBoard.jsp
  55. +0 −1,217 WebContent/design.jsp
  56. +0 −22 WebContent/footer.jsp
  57. +0 −45 WebContent/header.jsp
  58. +0 −19 WebContent/help/connectionHelp.html
  59. +0 −20 WebContent/help/dashboardHelp.html
  60. +0 −52 WebContent/help/designHelp.html
  61. +0 −49 WebContent/help/mappingHelp.html
  62. +0 −20 WebContent/help/reportHelp.html
  63. +0 −21 WebContent/help/viewReportHelp.html
  64. +0 −23 WebContent/index.jsp
  65. +0 −2 WebContent/js/d3/.gitignore
  66. 0 WebContent/js/d3/.gitmodules
  67. +0 −26 WebContent/js/d3/LICENSE
  68. +0 −247 WebContent/js/d3/Makefile
  69. +0 −51 WebContent/js/d3/README.md
  70. +0 −984 WebContent/js/d3/d3.chart.js
  71. +0 −1 WebContent/js/d3/d3.chart.min.js
  72. +0 −92 WebContent/js/d3/d3.csv.js
  73. +0 −1 WebContent/js/d3/d3.csv.min.js
  74. +0 −692 WebContent/js/d3/d3.geo.js
  75. +0 −1 WebContent/js/d3/d3.geo.min.js
  76. +0 −825 WebContent/js/d3/d3.geom.js
  77. +0 −1 WebContent/js/d3/d3.geom.min.js
  78. +0 −4,013 WebContent/js/d3/d3.js
  79. +0 −1,865 WebContent/js/d3/d3.layout.js
  80. +0 −1 WebContent/js/d3/d3.layout.min.js
  81. +0 −2 WebContent/js/d3/d3.min.js
  82. +0 −663 WebContent/js/d3/d3.time.js
  83. +0 −1 WebContent/js/d3/d3.time.min.js
  84. +0 −168 WebContent/js/d3/examples/albers/albers.html
  85. +0 −48 WebContent/js/d3/examples/area/area-radial.html
  86. +0 −113 WebContent/js/d3/examples/area/area.html
  87. +0 −50 WebContent/js/d3/examples/axis/axis-alternating.html
  88. +0 −68 WebContent/js/d3/examples/axis/axis-ggplot2.html
  89. +0 −117 WebContent/js/d3/examples/axis/axis-multiples.html
  90. +0 −63 WebContent/js/d3/examples/axis/axis-orientations.html
  91. +0 −153 WebContent/js/d3/examples/axis/axis-transition.html
  92. +0 −21 WebContent/js/d3/examples/azimuthal/azimuthal.css
  93. +0 −84 WebContent/js/d3/examples/azimuthal/azimuthal.html
  94. +0 −27 WebContent/js/d3/examples/azimuthal/azimuthal.js
  95. +0 −93 WebContent/js/d3/examples/bar/bar.html
  96. +0 −4 WebContent/js/d3/examples/box/box.css
  97. +0 −19 WebContent/js/d3/examples/box/box.html
  98. +0 −68 WebContent/js/d3/examples/box/box.js
  99. +0 −8 WebContent/js/d3/examples/bubble/bubble.css
  100. +0 −14 WebContent/js/d3/examples/bubble/bubble.html
  101. +0 −46 WebContent/js/d3/examples/bubble/bubble.js
  102. +0 −10 WebContent/js/d3/examples/bullet/bullet.css
  103. +0 −18 WebContent/js/d3/examples/bullet/bullet.html
  104. +0 −53 WebContent/js/d3/examples/bullet/bullet.js
  105. +0 −7 WebContent/js/d3/examples/bullet/bullets.json
  106. +0 −9 WebContent/js/d3/examples/bundle/bundle-radial.css
  107. +0 −15 WebContent/js/d3/examples/bundle/bundle-radial.html
  108. +0 −50 WebContent/js/d3/examples/bundle/bundle-radial.js
  109. +0 −14 WebContent/js/d3/examples/bundle/bundle-treemap.css
  110. +0 −16 WebContent/js/d3/examples/bundle/bundle-treemap.html
  111. +0 −53 WebContent/js/d3/examples/bundle/bundle-treemap.js
  112. +0 −49 WebContent/js/d3/examples/bundle/packages.js
  113. +0 −35 WebContent/js/d3/examples/button.css
  114. +0 −16 WebContent/js/d3/examples/calendar/calendar.css
  115. +0 −50 WebContent/js/d3/examples/calendar/calendar.js
  116. +0 −5,233 WebContent/js/d3/examples/calendar/dji.csv
  117. +0 −16 WebContent/js/d3/examples/calendar/dji.html
  118. +0 −61 WebContent/js/d3/examples/calendar/dji.js
  119. +0 −5,231 WebContent/js/d3/examples/calendar/vix.csv
  120. +0 −16 WebContent/js/d3/examples/calendar/vix.html
  121. +0 −60 WebContent/js/d3/examples/calendar/vix.js
  122. +0 −20 WebContent/js/d3/examples/cartogram/cartogram.css
  123. +0 −15 WebContent/js/d3/examples/cartogram/cartogram.html
  124. +0 −51 WebContent/js/d3/examples/cartogram/cartogram.js
  125. +0 −9 WebContent/js/d3/examples/cartogram/demers.css
  126. +0 −16 WebContent/js/d3/examples/cartogram/demers.html
  127. +0 −79 WebContent/js/d3/examples/cartogram/demers.js
  128. +0 −9 WebContent/js/d3/examples/cartogram/dorling.css
  129. +0 −16 WebContent/js/d3/examples/cartogram/dorling.html
  130. +0 −80 WebContent/js/d3/examples/cartogram/dorling.js
  131. +0 −109 WebContent/js/d3/examples/chord/chord-flare.html
  132. +0 −9 WebContent/js/d3/examples/chord/chord.css
  133. +0 −14 WebContent/js/d3/examples/chord/chord.html
  134. +0 −98 WebContent/js/d3/examples/chord/chord.js
  135. +0 −51 WebContent/js/d3/examples/choropleth/choropleth-area.html
  136. +0 −46 WebContent/js/d3/examples/choropleth/choropleth-bounds.html
  137. +0 −16 WebContent/js/d3/examples/choropleth/choropleth.css
  138. +0 −15 WebContent/js/d3/examples/choropleth/choropleth.html
  139. +0 −38 WebContent/js/d3/examples/choropleth/choropleth.js
  140. +0 −1 WebContent/js/d3/examples/choropleth/unemployment.json
  141. +0 −23 WebContent/js/d3/examples/clock/clock.css
  142. +0 −17 WebContent/js/d3/examples/clock/clock.html
  143. +0 −87 WebContent/js/d3/examples/clock/clock.js
  144. +0 −14 WebContent/js/d3/examples/cluster/cluster-radial.html
  145. +0 −39 WebContent/js/d3/examples/cluster/cluster-radial.js
  146. +0 −15 WebContent/js/d3/examples/cluster/cluster.css
  147. +0 −14 WebContent/js/d3/examples/cluster/cluster.html
  148. +0 −39 WebContent/js/d3/examples/cluster/cluster.js
  149. +0 −108 WebContent/js/d3/examples/contour/contour.html
  150. +0 −109 WebContent/js/d3/examples/crimea/crimea-stacked-area.html
  151. +0 −98 WebContent/js/d3/examples/crimea/crimea-stacked-bar.html
  152. +0 −24 WebContent/js/d3/examples/crimea/crimea.csv
  153. +0 −5 WebContent/js/d3/examples/data/README
  154. +0 −8 WebContent/js/d3/examples/data/faithful.json
  155. +0 −222 WebContent/js/d3/examples/data/flare-imports.json
  156. +0 −380 WebContent/js/d3/examples/data/flare.json
  157. +0 −101 WebContent/js/d3/examples/data/morley.csv
  158. +0 −2 WebContent/js/d3/examples/data/sample.csv
  159. +0 −5 WebContent/js/d3/examples/data/sample.html
  160. +0 −1 WebContent/js/d3/examples/data/sample.json
  161. +0 −1 WebContent/js/d3/examples/data/sample.txt
  162. +0 −4 WebContent/js/d3/examples/data/sample.xml
Sorry, we could not display the entire diff because too many files (5,929) changed.
View
13 NOTICE.txt
@@ -1,2 +1,13 @@
This product includes software developed by Nube Technologies LLP.
-(http://www.nubetech.co/).
+(http://www.nubetech.co/).
+This Project directly depends on following projects:
+HBase
+Hadoop
+Commons-Pool
+Hibernate
+Struts
+Junits
+Mockito
+MySql
+C3p0
+ehcache
View
116 README.txt
@@ -1,116 +0,0 @@
-Crux is a reporting application for HBase. Crux has been tested against
-
-1. Apache HBase 0.90.3 on Apache Hadoop 0.20.2 with Hadoop append.
-2. Cloudera's distribution. CDH3 - Hadoop 0.20.2-CDH3u1
-
-
-Crux license
-------------
-Crux license is Apache License v2
-
-
-Why HBase?
-----------
-HBase provides a low latency columnar storage for big data. HBase fits perfectly with the Hadoop stack, using HDFS for storage and
-providing out of the box support for Map Reduce. Data can be ingested into HBase from a traditional Map Reduce application,
-Pig or Hive, Cascading, Flume, Scribe, Hiho or Sqoop. Data can also be imported using HBase bulk loader.
-
-
-Why Crux?
----------
-Once you have collected your data in HBase, there is a need to expose it to business and technical users of your organization.
-The size of the data as well as the unstructured format makes it difficult to use a traditional
-reporting application with it. Crux uses native HBase integration to help you query your data. Crux has a web based report designer and viewer,
-making report creation and sharing easier. Crux comes with built in comparators for long, short, int, double, float, string and boolean datatypes
-and can create tables, graphs, scatter plots and other visuals for your data.
-Simple as well as composite rowkeys are supported via mapping Row Key Aliases.
-One can define filters on the row keys and perform get operations and range scans.
-Crux works with your schema and your data, there is no predefined schema for you to fit your data in.
-
-
-Crux Design
------------
-Crux uses the HBase Java client API, which is a fully featured way to access HBase.
-There are other clients available for HBase, for example Rest, Thrift and Avro. At the time of writing Crux, these clients
-do not expose the complete conditional querying capability needed by Crux.
-Then there are batch clients like Map Reduce, Hive handler, Pig and Cascading.
-These are great for performing batch analysis using HBase data.
-However, a reporting application needs faster response time than the batch nature of these.
-Crux thus uses the HBase Java Client API.
-
-Crux also uses mySQL to store the mapping of HBase schemas, connections and reports.
-The front end is built using Ajax, Dojo, Struts, with Hibernate. Crux uses open source software and comes with Apache License.
-
-
-Crux Mailing List, Issue Reporting and Support
-----------------------------------------------
-Join http://groups.google.com/group/cruxUsers to discuss crux features, issues and to seek help.
-You can also report bugs and request features at https://github.com/sonalgoyal/crux/issues.
-Crux has built in help pages in the web interface. More info can also be found at http://www.nubetech.co/weblog
-
-Crux Documentation and user guide
----------------------------------
-Crux features, guides and news is available at http://nubetech.co/category/crux-2.
-Besides this, Crux has an extensive inbuilt guide per page to help you create your reports effortlessly.
-The mailing list is also a good source of information about Crux.
-
-Using Crux
-----------
-Using Crux, one can query HBase tables and create reports to analyze results.
-To do this, there are a few simple steps.
-
-Prerequisies:
-- A running HBase
-- A running MySQL instance
-- A servlet container like Tomcat.
-- Java installed. We used JDK 1.6
-- Ant
-
-Once you have the prerequisites
-
-a. Build crux(See instructions to build crux with ant).
-The zip file has the crux war, schema and crux.jar.
-b. Run the schema file in MySQL. On mysql prompt, source <path to file>/schema.sql
-This creates the schema required for saving the report definitions.
-c. Copy crux.jar to HBase Home/lib or edit HBase home/conf/hbase-env.sh and add the jars location to the file.
-For example,
-
-# Extra Java CLASSPATH elements. Optional.
-# export HBASE_CLASSPATH=
-export HBASE_CLASSPATH="/home/nube/crux.jar"
-
-Restart hbase.
-This is needed as Crux has built in filters which work on the server side to select the data you choose.
-
-d. Drop the war in tomcat/webapps and start tomcat.
-e. Go to http://machine:8080/crux and define your connection, mapping and report.
-
-Instructions to build crux with ANT
------------------------------------
-A. Update hibernate.cfg.xml with your MySQL connection.url, connection.username and connection.password.
-B. Build and create zip:
- ant deploy
- (crux-version.zip is created in crux/deploy/)
-
-
-Instructions to run test cases of crux with ANT
------------------------------------------------
-ant test
-
-
-Instructions to set up the dev environment in Eclipse
--------------------------------------------------
-After copying crux in your eclipse project, please add all jars from crux/lib_test/ and
-crux/lib_test/run_time/ to your eclipse java build path libraries.
-
-
-Crux Limitations
-----------------
-Crux is an HBase application, so the schema and the querying has to be designed accordingly.
-As far as possible, try to create row filters with equals/greater than equals/less than
-so as to leverage HBase's Get and Range Scan operations.
-
-Sample data
------------
-Crux comes with sample data - you can refer to testData/BseStock/README.txt for downloading BSE stock data for given list of scrips
-and populating hbase with it.
View
BIN WebContent/Images/connection.jpg
Deleted file not rendered
View
BIN WebContent/Images/crux_transparent.gif
Deleted file not rendered
View
BIN WebContent/Images/dashboard.jpg
Deleted file not rendered
View
BIN WebContent/Images/design_step1.jpg
Deleted file not rendered
View
BIN WebContent/Images/design_step3.jpg
Deleted file not rendered
View
BIN WebContent/Images/design_step4.jpg
Deleted file not rendered
View
BIN WebContent/Images/design_step6.jpg
Deleted file not rendered
View
BIN WebContent/Images/mapping_step1.jpg
Deleted file not rendered
View
BIN WebContent/Images/mapping_step2.jpg
Deleted file not rendered
View
BIN WebContent/Images/mapping_step3.jpg
Deleted file not rendered
View
BIN WebContent/Images/mapping_step4.jpg
Deleted file not rendered
View
BIN WebContent/Images/mapping_step5.jpg
Deleted file not rendered
View
BIN WebContent/Images/report.jpg
Deleted file not rendered
View
BIN WebContent/Images/viewReport.jpg
Deleted file not rendered
View
3 WebContent/META-INF/MANIFEST.MF
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-Class-Path:
-
View
BIN WebContent/WEB-INF/lib/antlr-2.7.6.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/c3p0-0.9.1.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/commons-codec-1.4.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/commons-collections-3.1.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/commons-fileupload-1.2.1.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/commons-httpclient-3.1.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/commons-lang-2.5.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/commons-logging-1.1.1.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/commons-pool-1.5.6.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/dom4j-1.6.1.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/ehcache-core-1.6.2.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/ejb3-persistence.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/freemarker-2.3.13.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/hadoop-core-0.20-append-r1056497.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/hbase-0.90.3.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/hibernate-annotations.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/hibernate-commons-annotations.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/hibernate-validator.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/hibernate3.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/javassist-3.9.0.GA.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/jta-1.1.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/log4j-1.2.16.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/mysql-connector-java-5.0.7.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/ognl-2.6.11.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/protobuf-java-2.3.0.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/servlet-api-2.5-6.1.14.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/slf4j-api-1.5.8.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/slf4j-log4j12-1.5.8.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/struts2-core-2.1.6.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/struts2-fullhibernatecore-plugin-1.4-GA.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/struts2-json-plugin-2.2.3.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/xwork-2.1.2.jar
Binary file not shown.
View
BIN WebContent/WEB-INF/lib/zookeeper-3.3.2.jar
Binary file not shown.
View
21 WebContent/WEB-INF/web.xml
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app id="crux" version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <display-name>Crux</display-name>
- <welcome-file-list>
- <welcome-file>welcome.action</welcome-file>
- </welcome-file-list>
-
-
- <filter>
- <filter-name>struts2</filter-name>
- <filter-class>co.nubetech.crux.servlet.filter.CruxFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>struts2</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
-</web-app>
View
451 WebContent/connection.jsp
@@ -1,451 +0,0 @@
-<!--
- * Copyright 2011 Nube Technologies
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed
- * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations under the License.
--->
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
-<%@ taglib prefix="s" uri="/struts-tags"%>
-<%@ page import="org.apache.struts2.json.JSONUtil"%>
-<jsp:include page="header.jsp" />
-<jsp:include page="topNavigation.jsp" />
-<jsp:include page="progress.jsp" />
-<jsp:include page="tableInclude.jsp" />
-<h1 style="position: absolute; top: 10px; left: 48%;">Connection</h1>
-<br>
-A connection defines the location of your HBase server. Please define the server and port. Please give a unique name to the connection so that you can use it throughout.
-<br>
-<br>
-<script>
-dojo.require("dijit.form.Form");
-dojo.require("dijit.form.Button");
-dojo.require("dijit.form.ValidationTextBox");
-dojo.require("dijit.form.Select");
-dojo.require("dojox.grid.DataGrid");
-dojo.require("dojo.data.ItemFileWriteStore");
-dojo.require("dijit.Dialog");
-
-function showHelp(){
- window.open ('help/connectionHelp.html', '', 'width=600,scrollbars=1');
-}
-
-var storeData = {
- identifier: 'id',
- label: 'name',
- items: <%out.println(JSONUtil.serialize(request.getAttribute("connectionViewList")));%>
- };
-var jsonStore = new dojo.data.ItemFileWriteStore({ data: storeData });
-var grid = null;
-
-function updateConnectionViewList(data){
- jsonStore.fetch({
- query: { id: '*' },
- onComplete: function(items, result){
- dojo.forEach(items, function(item){
- jsonStore.deleteItem(item);
- });
- }
- });
- jsonStore.save();
-
- if(data.connectionViewList.length==0){
- responseMessage("No connection defined. Please click Add to create a new connection.");
- document.getElementById("gridNode").style.visibility = "hidden";
- document.getElementById("linksForConnection").style.visibility = "hidden";
- showConnectionForm();
- } else{
- document.getElementById("gridNode").style.visibility = "visible";
- document.getElementById("linksForConnection").style.visibility = "visible";
- dijit.byId("gridNode").selection.clear();
- }
- //alert("deleted");
- for(var i=0;i<data.connectionViewList.length;i++){
- jsonStore.newItem(data.connectionViewList[i]);
- }
-}
-
-dojo.addOnLoad(function(e) {
- var layoutConnections = [[{
- field: "index",
- name: "Serial No.",
- width: "5"
- },
- {
- field: "id",
- name: "Id",
- width: "auto"
- },
- {
- field: "name",
- name: "Name",
- width: "auto"
- },
- {
- field: "datastoreName",
- name: "Datastore Name",
- width: "auto"
- },
- {
- field: "hbaseRestServerPropertyValue",
- name: "HBase Rest Server",
- width: "auto"
- }]];
-
- grid = new dojox.grid.DataGrid({
- query: { id: '*' },
- store: jsonStore,
- structure: layoutConnections,
- selectionMode: 'single',
- autoHeight:5
- }, 'gridNode');
- grid.layout.setColumnVisibility(1,false);
- grid.startup();
-
- if(grid.getItem(0)==null){
- responseMessage("No connection defined. Please click Add to create a new connection.");
- document.getElementById("gridNode").style.visibility = "hidden";
- document.getElementById("linksForConnection").style.visibility = "hidden";
- showConnectionForm();
- }
-});
-
-dojo.addOnLoad(function(e){
- dojo.connect(grid, "onRowClick", function(e) {
- var isAddValue = document.getElementById("isAdd").getAttribute("value");
- var isEditValue = document.getElementById("isEdit").getAttribute("value");
- clearResponse();
- if(isEditValue == "true" && isAddValue == "false"){
- var items = grid.selection.getSelected();
- if(items.length==1){
- dojo.forEach(items, function(selectedItem) {
- var idValue = grid.store.getValues(selectedItem, 'id');
- document.getElementById("connectionId").value = idValue;
-
- var ConnectionNameValue = grid.store.getValues(selectedItem, 'name');
- //document.getElementById('connectionName').value = ConnectionNameValue;
- dijit.byId('connectionName').set('value',ConnectionNameValue);
-
- /*var hostPropertyValue = grid.store.getValues(selectedItem, 'hostPropertyValue');
- //document.getElementById('hostPropertyValue').value = hostPropertyValue;
- dijit.byId('hostPropertyValue').set('value',hostPropertyValue);*/
-
- var portPropertyValue = grid.store.getValues(selectedItem, 'hbaseRestServerPropertyValue');
- //document.getElementById('portPropertyValue').value = portPropertyValue;
- dijit.byId('hbaseRestServerPropertyValue').set('value',portPropertyValue);
- }); // end forEach
- }
- }
- });
-});
-
-
-dojo.addOnLoad(function(e){
- var editConnectionLink = dijit.byId("editConnection");
-
- dojo.connect(editConnectionLink, "onClick", function(e) {
- clearResponse();
- clearValues();
- document.getElementById("updateConnectionForm").style.visibility = "hidden";
- dijit.byId("updateConnectionForm").reset();
- var items = grid.selection.getSelected();
- if(items.length==1){
- dojo.forEach(items, function(selectedItem) {
- var idValue = grid.store.getValues(selectedItem, 'id');
- document.getElementById("connectionId").value = idValue;
-
- var ConnectionNameValue = grid.store.getValues(selectedItem, 'name');
- //document.getElementById('connectionName').value = ConnectionNameValue;
- dijit.byId('connectionName').set('value',ConnectionNameValue);
-
- /*var hostPropertyValue = grid.store.getValues(selectedItem, 'hostPropertyValue');
- //document.getElementById('hostPropertyValue').value = hostPropertyValue;
- dijit.byId('hostPropertyValue').set('value',hostPropertyValue);*/
-
- var portPropertyValue = grid.store.getValues(selectedItem, 'hbaseRestServerPropertyValue');
- //document.getElementById('portPropertyValue').value = portPropertyValue;
- dijit.byId('hbaseRestServerPropertyValue').set('value',portPropertyValue);
- }); // end forEach
-
- document.getElementById("updateConnectionForm").style.visibility = "visible";
- document.getElementById("isAdd").value = "false";
- document.getElementById("isEdit").value = "true";
- } else{
- responseMessage("Please select a connection.");
- }
- });
-});
-
-
-function showConnectionForm(){
- clearResponse();
- clearValues();
- dijit.byId("updateConnectionForm").reset();
- document.getElementById("updateConnectionForm").style.visibility = "visible";
- document.getElementById("isAdd").value = "true";
- document.getElementById("isEdit"). value = "false";
-}
-
-function clearValues(){
- document.getElementById('connectionId').value = 0;
- document.getElementById('isAdd').value = '';
- document.getElementById('isEdit').value = '';
- document.getElementById('connectionName').value = '';
- //document.getElementById('hostPropertyValue').value = '';
- document.getElementById('hbaseRestServerPropertyValue').value = '';
-}
-
-dojo.addOnLoad(function(e) {
- var updateConnectionForm = dijit.byId("updateConnectionForm");
- dojo.connect(updateConnectionForm, "onSubmit", function(e) {
-
- clearResponse();
- e.preventDefault();
-
- var isAddValue = document.getElementById("isAdd").getAttribute("value");
- //alert("isAddValue: " + isAddValue);
- var isEditValue = document.getElementById("isEdit").getAttribute("value");
- //alert("isEditValue: " + isEditValue);
-
- //alert(updateConnectionForm.isValid());
- if (updateConnectionForm.validate() && isEditValue == "true" && isAddValue == "false") {
- showProgressIndicator();
- var xhrArgs = {
- form: dojo.byId("updateConnectionForm"),
- url: "<s:url action='updateConnection'/>",
- handleAs: "json",
- load: function(data) {
- hideProgressIndicator();
- console.log("Data is " + data);
- //alert(data.error);
- if(data.error.error){
- responseMessage("Error: "+data.error.message);
- }else{
- //alert ("Returned successfully");
- updateConnectionViewList(data);
- clearValues();
- updateConnectionForm.reset();
- document.getElementById("updateConnectionForm").style.visibility = "hidden";
- }
- },
- error: function(error) {
- hideProgressIndicator();
- //We'll 404 in the demo, but that's okay. We don't have a 'postIt' service on the
- //docs server.
- console.log("Error " + error);
- }
- };
- //Call the asynchronous xhrPost
- var deferred = dojo.xhrPost(xhrArgs);
- } else if (updateConnectionForm.validate() && isEditValue == "false" && isAddValue == "true") {
- showProgressIndicator();
- var xhrArgs = {
- form: dojo.byId("updateConnectionForm"),
- url: "<s:url action='saveConnection'/>",
- handleAs: "json",
- load: function(data) {
- hideProgressIndicator();
- console.log("Data is " + data);
- if(data.error.error){
- responseMessage("Error: "+data.error.message);
- }else{
- //alert ("Returned successfully");
- updateConnectionViewList(data);
- clearValues();
- updateConnectionForm.reset();
- document.getElementById("updateConnectionForm").style.visibility = "hidden";
- }
- },
- error: function(error) {
- hideProgressIndicator();
- //We'll 404 in the demo, but that's okay. We don't have a 'postIt' service on the
- //docs server.
- console.log("Error " + error);
- }
- };
- //Call the asynchronous xhrPost
- var deferred = dojo.xhrPost(xhrArgs);
- } else {
- responseMessage("Please fill up the form with required and correct values.");
- }
-
- });
-});
-
-
-dojo.addOnLoad(function(e){
- var deleteConnectionLink = dijit.byId("deleteConnection");
- dojo.connect(deleteConnectionLink, "onClick", function(e) {
- clearResponse();
- var items = grid.selection.getSelected();
- if(items.length==1){
- document.getElementById("updateConnectionForm").style.visibility = "hidden";
- dijit.byId("updateConnectionForm").reset();
- dijit.byId("deleteConnectionDialog").show();
- }else{
- responseMessage("Please select a connection.");
- }
- });
-});
-
-
-function deleteTrue() {
- var deleteConnectionLink = dijit.byId("deleteConnection");
- var items = grid.selection.getSelected();
- if(items.length==1){
- dojo.forEach(items, function(selectedItem) {
- var value = grid.store.getValues(selectedItem, 'id');
- var id = document.getElementById("connectionIdToDelete").value = value;
- }); // end forEach
-
- if (deleteConnectionLink.validate()) {
- showProgressIndicator();
- var xhrArgs = {
- form: dojo.byId("deleteConnection"),
- url: "<s:url action='deleteConnection'/>",
- handleAs: "json",
- load: function(data) {
- hideProgressIndicator();
- console.log("Data is " + data);
- if(data.error.error){
- responseMessage("Error: "+data.error.message);
- //dijit.byId("deleteErrorDialog").show();
- }else{
- //alert ("Returned successfully");
- updateConnectionViewList(data);
- //document.getElementById("updateConnectionForm").style.visibility = "hidden";
- }
- },
- error: function(error) {
- hideProgressIndicator();
- //alert("error:"+error);
- }
- };
- var deferred = dojo.xhrPost(xhrArgs);
-
- }
- }else{
- responseMessage("Please select a connection.");
- }
- dijit.byId("deleteConnectionDialog").hide();
-}
-
-function deleteFalse(){
- dijit.byId("deleteConnectionDialog").hide();
-}
-
-dojo.addOnLoad(function(e) {
- dijit.byId("hbaseRestServerPropertyValue").validator = function (value, constraints) {
- return testPattern(value, constraints);
- }
-});
-
-
-function testPattern(value, constraints) {
- var returnValue = true;
- var hbaseRestServerPropertyValue = value.split(",");
- var length = hbaseRestServerPropertyValue.length;
-
- var regExp = new RegExp("[a-zA-Z0-9.-]+:[0-9]");
-
- for(i=0;i<length;i++){
- //hbaseRestServerPropertyValue[i].match(regExp)
- if(regExp.test(hbaseRestServerPropertyValue[i])){
- var integerValue = hbaseRestServerPropertyValue[i].split(":")[1];
- if (integerValue == parseInt(integerValue) && integerValue.length < 5) {}
- else{
- returnValue = false;
- }
- }else{
- returnValue = false;
- }
- }
- return returnValue;
-}
-
-
-
-
-</script>
-
-<div id="deleteConnectionDialog" dojoType="dijit.Dialog" title="Confirm Deletion">
- Are you sure you want to delete? Deletion can not be undone.
- <br /><br />
- <button id="deleteTrue" dojoType="dijit.form.Button" onClick="deleteTrue()">Yes</button>
- <button id="deleteFalse" dojoType="dijit.form.Button" onClick="deleteFalse()">No</button>
-</div>
-
-<div style="width: 60%; float: center;">
- <div id="gridNode" style="width: 200px; float: center;"></div>
-</div>
-
-<br />
-
-<table id="linksForConnection">
-<tr>
-<td align="center" width="50px">
-<div dojoType="dijit.form.Form" id="addNewConnection">
- <a href="#" onClick="showConnectionForm()">Add</a>
-</div>
-</td>
-<td align="center" width="50px">
-<div dojoType="dijit.form.Form" id="editConnection" name="editConnection" style="float:center;">
- <a href="#">Edit</a>
-</div>
-</td>
-<td align="center" width="50px">
-<div dojoType="dijit.form.Form" id="deleteConnection" name="deleteConnection" style="float:center;">
- <input type="hidden" id="connectionIdToDelete" name="connection.id" dojoType="dijit.form.TextBox" />
- <a href="#">Delete</a>
-</div>
-</td>
-</tr>
-</table>
-
-<br />
-
-<div dojoType="dijit.form.Form" id="updateConnectionForm" name="updateConnectionForm" style="visibility:hidden">
- <input type="hidden" id="isAdd" name="isAdd" />
- <input type="hidden" id="isEdit" name="isEdit" />
- <input type="hidden" id="connectionId" name="connection.id"/>
- <table>
- <tr><td align="right">
- Connection Name:&nbsp;
- </td><td align="left">
- <input type="text" id="connectionName" name="connection.name"
- dojoType="dijit.form.ValidationTextBox" maxlength=100 required="true" trim="true" missingMessage="Required."/>
- </td></tr>
-
- <!--
- <tr><td align="right">
- HBase Rest Server Host:&nbsp;
- </td><td align="left">
- <input type="text" id="hostPropertyValue" name="hostProperty.value"
- dojoType="dijit.form.ValidationTextBox" maxlength=100 required="true" trim="true" missingdMessage="Required."/>
- </td></tr>
- -->
-
- <tr><td align="right">
- HBase Zookeeper Location:&nbsp;
- </td><td align="left">
- <input type="text" id="hbaseRestServerPropertyValue" name="hbaseRestServerProperty.value"
- dojoType="dijit.form.ValidationTextBox" maxlength=100 required="true" trim="true"
- missingMessage="host:port e.g. hbseZookeeperQuorum:hbaseZookeeperPropertyClientPort"
- invalidMessage="This value is not valid. Expected: host:port e.g. hbseZookeeperQuorum:hbaseZookeeperPropertyClientPort"/>
- </td></tr>
- <tr><td></td>
- <td align="center">
- <button type="submit" dojoType="dijit.form.Button">Save</button>
- </td></tr>
- </table>
-</div>
-<br />
-<jsp:include page="footer.jsp" />
View
117 WebContent/css/dojo.css
@@ -1,117 +0,0 @@
-body,div,dl,dt,dd,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td
- {
- margin: 0;
- padding: 0;
-}
-
-fieldset,img {
- border: 0 none;
-}
-
-address,caption,cite,code,dfn,th,var {
- font-style: normal;
- font-weight: normal;
-}
-
-caption,th {
- text-align: left;
-}
-
-q:before,q:after {
- content: "";
-}
-
-abbr,acronym {
- border: 0;
-}
-
-body {
- font: 12px Myriad, Helvetica, Tahoma, Arial, clean, sans-serif;
- *font-size: 75%;
-}
-
-h1 {
- font-size: 1.5em;
- font-weight: normal;
- line-height: 1em;
- margin-top: 1em;
- margin-bottom: 0;
-}
-
-h2 {
- font-size: 1.1667em;
- font-weight: bold;
- line-height: 1.286em;
- margin-top: 1.929em;
- margin-bottom: 0.643em;
-}
-
-h3,h4,h5,h6 {
- font-size: 1em;
- font-weight: bold;
- line-height: 1.5em;
- margin-top: 1.5em;
- margin-bottom: 0;
-}
-
-p {
- font-size: 1em;
- margin-top: 1.5em;
- margin-bottom: 1.5em;
- line-height: 1.5em;
-}
-
-blockquote {
- font-size: 0.916em;
- margin-top: 3.272em;
- margin-bottom: 3.272em;
- line-height: 1.636em;
- padding: 1.636em;
- border-top: 1px solid #ccc;
- border-bottom: 1px solid #ccc;
-}
-
-ol li,ul li {
- font-size: 1em;
- line-height: 1.5em;
- margin: 0;
-}
-
-pre,code {
- font-size: 115%;
- *font-size: 100%;
- font-family: Courier, "Courier New";
- background-color: #efefef;
- border: 1px solid #ccc;
-}
-
-pre {
- border-width: 1px 0;
- padding: 1.5em;
-}
-
-table {
- font-size: 100%;
-}
-
-.dojoTabular {
- border-collapse: collapse;
- border-spacing: 0;
- border: 1px solid #ccc;
- margin: 0 1.5em;
-}
-
-.dojoTabular th {
- text-align: center;
- font-weight: bold;
-}
-
-.dojoTabular thead,.dojoTabular tfoot {
- background-color: #efefef;
- border: 1px solid #ccc;
- border-width: 1px 0;
-}
-
-.dojoTabular th,.dojoTabular td {
- padding: 0.25em 0.5em;
-}
View
292 WebContent/dashBoard.jsp
@@ -1,292 +0,0 @@
-<!--
- * Copyright 2011 Nube Technologies
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed
- * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations under the License.
--->
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
-<%@ taglib prefix="s" uri="/struts-tags"%>
-<jsp:include page="header.jsp" />
-<jsp:include page="topNavigation.jsp" />
-<jsp:include page="tableInclude.jsp" />
-<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">
- 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');
- }
-
- var gridContainer;
- dojo.addOnLoad(function(){
- gridContainer = new dojox.layout.GridContainerLite({
- nbZones: 2,
- opacity: .5,
- hasResizableColumns: true,
- allowAutoScroll: true,
- withHandles: true,
- dragHandleClass: 'dijitTitlePaneTitle',
- style: {
- width: '100%'
- },
- acceptTypes: ['Portlet'],
- isOffset: true,
- isAutoOrganized:true
- },
- 'gridContainer');
-
- var reportList = <%out.println(JSONUtil.serialize(request.getAttribute("reportListForDashBoard")));%> ;
- for(var i=0;i<reportList.length;i++){
- var emptyFilter = false;
- var formDiv = dojo.create("form", {
- id: "form"+i,
- name: "getData"+i
- });
- var portletContent = [
- formDiv,
- dojo.create('div', {
- id: 'div'+i,
- height:'400px',
- width:'700px'
- }),
- dojo.create('div', {
- id: 'legend'+i
- })
- ];
-
- var portlet = new dojox.widget.Portlet({
- id: 'dash_'+reportList[i].dashboard.id,
- closable: false,
- dndType: 'Portlet',
- title: reportList[i].name,
- content: portletContent
- });
- var mapId ;
- if( reportList[i].designs[0].rowAlias != null){
- mapId = reportList[i].designs[0].rowAlias.mapping.id;
- } else {
- mapId = reportList[i].designs[0].columnAlias.mapping.id;
- }
- var form= new dijit.form.Form({
- method: "POST",
- name: "form"+i,
- action: ""
- }, formDiv );
-
-
- var hiddenField1 = new dijit.form.TextBox({
- id: 'report'+i,
- name: "report.id",
- value: reportList[i].id,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(hiddenField1.domNode);
-
- var hiddenField2 = new dijit.form.TextBox({
- id: 'mapId'+i,
- name: "mappingId",
- value:mapId,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(hiddenField2.domNode);
-
-
- var hiddenField3 = new dijit.form.TextBox({
- id: 'chartType'+i,
- name: "chartType",
- value: reportList[i].reportType.type,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(hiddenField3.domNode);
-
- var rowFilter = reportList[i].rowAliasFilters;
- var columnFilter = reportList[i].columnFilters;
-
- for(var j=0;j<rowFilter.length;j++){
- var hiddenField4 = new dijit.form.TextBox({
- id: "filterList["+j+"].alias"+i,
- name: "filterList["+j+"].alias",
- value: rowFilter[j].rowAlias.alias,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(hiddenField4.domNode);
- form.containerNode.appendChild(dojo.create("label", { innerHTML: rowFilter[j].rowAlias.alias+'&nbsp;&nbsp;'}));
- var hiddenField5 = new dijit.form.TextBox({
- id: "filterList["+j+"].filterType"+i,
- name: "filterList["+j+"].filterType",
- value: rowFilter[j].filterType.type,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(hiddenField5.domNode);
- form.containerNode.appendChild(dojo.create("label", { innerHTML: rowFilter[j].filterType.type+'&nbsp;&nbsp;'}));
-
- if(rowFilter[j].value==null || rowFilter[j].value ==""){
-
- emptyFilter = true;
- var hiddenField6 = new dijit.form.TextBox({
- id: "filterList["+j+"].value"+i,
- name: "filterList["+j+"].value",
- value: rowFilter[j].value,
- type: 'text'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(dojo.create("label", {'for': "filterList["+j+"].value"+i, innerHTML: "value:&nbsp;"}));
- form.containerNode.appendChild(hiddenField6.domNode);
-
- } else {
- var hiddenField6 = new dijit.form.TextBox({
- id: "filterList["+j+"].value"+i,
- name: "filterList["+j+"].value",
- value: rowFilter[j].value,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(dojo.create("label", { innerHTML: rowFilter[j].value}));
- form.containerNode.appendChild(hiddenField6.domNode);
-
- }
- form.containerNode.appendChild(dojo.create("br"));
-
- }
-
- for(var j=rowFilter.length;j<columnFilter.length+rowFilter.length;j++){
- var hiddenField4 = new dijit.form.TextBox({
- id: "filterList["+j+"].alias"+i,
- name: "filterList["+j+"].alias",
- value: columnFilter[j-rowFilter.length].columnAlias.alias,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(hiddenField4.domNode);
- form.containerNode.appendChild(dojo.create("label", {innerHTML: columnFilter[j-rowFilter.length].columnAlias.alias+'&nbsp;&nbsp;'}));
-
- var hiddenField5 = new dijit.form.TextBox({
- id: "filterList["+j+"].filterType"+i,
- name: "filterList["+j+"].filterType",
- value: columnFilter[j-rowFilter.length].filterType.type,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(hiddenField5.domNode);
- form.containerNode.appendChild(dojo.create("label", {innerHTML: columnFilter[j-rowFilter.length].filterType.type+'&nbsp;&nbsp;'}));
-
-
- if(columnFilter[j].value==null || columnFilter[j].value ==""){
- emptyFilter = true;
- var hiddenField6 = new dijit.form.TextBox({
- id: "filterList["+j+"].value"+i,
- name: "filterList["+j+"].value",
- value: columnFilter[j-rowFilter.length].value,
- type: 'text'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(dojo.create("label", {'for': "filterList["+j+"].value"+i, innerHTML: "value:&nbsp;"}));
- form.containerNode.appendChild(hiddenField6.domNode);
-
- } else {
- var hiddenField6 = new dijit.form.TextBox({
- id: "filterList["+j+"].value"+i,
- name: "filterList["+j+"].value",
- value: columnFilter[j-rowFilter.length].value,
- type: 'hidden'
- },
- document.createElement("input")
- );
- form.containerNode.appendChild(hiddenField6.domNode);
- form.containerNode.appendChild(dojo.create("label", { innerHTML: columnFilter[j-rowFilter.length].value}));
-
- }
- 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(false,'form'+x,'chartType'+x,'div'+x,'legend'+x);
- }
- },
- document.createElement("button"));
- form.containerNode.appendChild(button.domNode);
- }
- form.startup();
- // alert(reportList[i].dashboard.column+","+reportList[i].dashboard.index);
- gridContainer.addChild(portlet,reportList[i].dashboard.column);
- if (!emptyFilter){
- populateData(false,'form'+i,'chartType'+i,'div'+i,'legend'+i);
- }
- }
- gridContainer.startup();
- dojo.subscribe("/dojox/mdnd/drop", null,saveAttributes);
- });
-
- function saveAttributes(){
- var children = gridContainer.getChildren();
- var json = '{'+'"dashboardInfo":["'+children[0].id.substring(5)+':'+gridContainer.getIndexOfChild(children[0])+':'+children[0].column+'"';
- for(var i=1;i<children.length;i++){
- json+=',"'+children[i].id.substring(5)+':'+gridContainer.getIndexOfChild(children[i])+':'+children[i].column+'"';
- }
- json+=']}';
- showProgressIndicator();
- var xhrArgs = {
- url: "<s:url action='saveDashBoard'/>",
- handleAs: "json",
- content: dojo.fromJson(json),
- load: function(data) {
- hideProgressIndicator();
- if(data.error.error){
- responseMessage("Error: "+data.error.message);
- }
- } ,
- error: function(error) {
- hideProgressIndicator();
- responseMessage("Error " + error);
- }
- };
- var deferred = dojo.xhrPost(xhrArgs);
- }
-
- </script>
- <style type="text/css">
- @import "js/dojo/dojox/widget/Portlet/Portlet.css";
- @import "js/dojo/dojox/layout/resources/GridContainer.css";
- </style>
-
-<div id="gridContainer"></div>
-
-
-
-
View
1,217 WebContent/design.jsp
@@ -1,1217 +0,0 @@
-<!--
- * Copyright 2011 Nube Technologies
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed
- * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
- * CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and limitations under the License.
--->
-<%@ taglib prefix="s" uri="/struts-tags"%>
-<jsp:include page="header.jsp" />
-<jsp:include page="topNavigation.jsp" />
-<jsp:include page="progress.jsp" />
-<jsp:include page="tableInclude.jsp" />
-<h1 style="position: absolute; top: 10px; left: 45%;">Report Design</h1>
-<br>
-<br>
-<script type="text/javascript" src="js/viewReport.js"></script>
-<script type="text/javascript" src="js/d3/d3.js"></script>
-<script type="text/javascript" src="js/polymaps/polymaps.js"></script>
-<%@ page import="org.apache.struts2.json.JSONUtil"%>
-<s:set name="isEdit" value="%{edit}" />
-<style type="text/css">
-@import "js/dojo/dojo/resources/dnd.css";
-
-@import "js/polymaps/polyStyle.css";
-
-.dojoDndItem {
- padding: 3px;
-}
-
-.dojoDndItemOver {
- background-color: #D9E8F9;;
- cursor: pointer;
-}
-
-.claro .dijitArrowButtonInner {
- background-position: -54px 40%;
- background-repeat: no-repeat;
- height: 6px;
- margin: 0 auto;
- width: 9px;
-}
-
-svg {
- display: block;
-}
-
-circle {
- stroke: black;
- fill: brown;
- fill-opacity: .5;
-}
-
-#mapNode {
- width: 960px;
- height: 500px;
-}
-
-</style>
-<div style="color: #FF0000">
- <s:property value='%{error.message}' />
-</div>
-
-<script type="text/javascript">
- dojo.require("dijit.form.Form");
- dojo.require("dijit.form.Button");
- dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dijit.form.CheckBox");
- dojo.require("dojo.dnd.Source");
- dojo.require("dijit.TitlePane");
- dojo.require("dijit.form.Select");
- dojo.require("dijit.layout.TabContainer");
- dojo.require("dijit.layout.ContentPane");
- 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;
- function showHelp(){
- window.open ('help/designHelp.html', '', 'width=600,scrollbars=1');
- }
-
- function changed(value){
- document.getElementById("simplechart").style.visibility = "hidden";
- document.getElementById("legend").style.visibility = "hidden";
- if(value=="Table"){
- dojo.style("yAxis","visibility","hidden");
- dojo.style("zAxis","visibility","hidden");
- dijit.byId("xAxis").set("title","Columns");
- clearNodes(yAxis,true);
- 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();
- }
-
- function preview(){
- 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.charting.widget.SelectableLegend");
- clearResponse();
- getDataFromHBase();
- }
-
- dojo.addOnLoad(function(e) {
- document.getElementById("xbutton").style.visibility = "hidden";
- document.getElementById("ybutton").style.visibility = "hidden";
- document.getElementById("zbutton").style.visibility = "hidden";
- dojo.style("zAxis","visibility","hidden");
- document.getElementById("pane").style.visibility = "hidden";
- document.getElementById("pageDiv").style.visibility = "visible";
- var mappingName = dijit.byId("mappingName");
- var initReportForm = dijit.byId("populateDimensionAndMeasureList");
- dojo.style("dimensionList","visibility","hidden");
- dojo.style("measuresList","visibility","hidden");
- dimensionList = new dojo.dnd.Source("dimensionList");
- measuresList = new dojo.dnd.Source("measuresList");
- 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("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];
- dojo.connect(xAxisPane,"onMouseOut",highlightSelected);
- dojo.connect(yAxisPane,"onMouseOut",highlightSelected);
- dojo.connect(zAxisPane,"onMouseOut",highlightSelected);
- var aliasSelect = dijit.byId("alias");
- dojo.connect(aliasSelect, "onChange", populateFilterType);
- });
-
- function populateFilterType(){
- clearResponse();
- var json = '{'+'"aliasName":"'+dijit.byId('alias').get('value')+'","mappingId":"'+dijit.byId('mappingName').get('value')+'"}';
- var aliasName = dojo.fromJson(json);
- showProgressIndicator();
- var xhrArgs = {
- url: "<s:url action='populateFilterType'/>",
- handleAs: "json",
- content: aliasName,
- load: function(data) {
- hideProgressIndicator();
- if(data.error.error){
- responseMessage("Error: "+data.error.message);
- }else{
- var filter_box = dijit.byId('filterType');
- filter_box.options.length = 0;
- 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) {
- hideProgressIndicator();
- responseMessage("Error " + error);
- }
- };
- var deferred = dojo.xhrPost(xhrArgs);
- }
-
- function highlightSelected(){
- var xNodes = xAxis.getAllNodes();
- var yNodes = yAxis.getAllNodes();
- var zNodes = zAxis.getAllNodes();
- var selectedXNodes = xAxis.getSelectedNodes();
- var selectedYNodes = yAxis.getSelectedNodes();
- var selectedZNodes = zAxis.getSelectedNodes();
- dojo.forEach(xNodes, function(node) {
- dojo.style(node, "color", "#000000");
- });
- dojo.forEach(yNodes, function(node) {
- dojo.style(node, "color", "#000000");
- });
- dojo.forEach(zNodes, function(node) {
- dojo.style(node, "color", "#000000");
- });
- dojo.forEach(selectedXNodes, function(node) {
- dojo.style(node, "color", "#01aa00");
- });
- dojo.forEach(selectedYNodes, function(node) {
- dojo.style(node, "color", "#01aa00");
- });
- dojo.forEach(selectedZNodes, function(node) {
- dojo.style(node, "color", "#01aa00");
- });
- }
- function clearNodes(srcId,all){
- if(all){
- srcId.selectAll();
- }
- srcId.deleteSelectedNodes();
- srcId.selectNone();
- }
- function checkGridItems(grid,i){
- if(grid.getItem(i)!=null){
- deleteGridItem(grid,i);
- }
- }
- function deleteGridItem(grid,i){
- jsonStore.deleteItem(grid.getItem(i));
- checkGridItems(grid,0);
- }
- var aliasValueType = [];
- var functionView = [];
-
- function populateList(callEdit){
- clearResponse();
- document.getElementById("simplechart").style.visibility = "hidden";
- document.getElementById("legend").style.visibility = "hidden";
- var grid = dijit.byId('gridNode');
- if(grid.getItem(0)!=null){
- checkGridItems(grid,0);
- jsonStore.save();
- document.getElementById("addFilter").style.visibility = "visible";
- document.getElementById("links").style.visibility = "hidden";
- document.getElementById("gridNode").style.visibility = "hidden";
- }
- var val = dijit.byId('mappingName').get('value');
- dijit.byId('mappingId').set('value',val);
- dijit.byId('mapping_Id').set('value',val);
- var initReportForm = dijit.byId("populateDimensionAndMeasureList");
- var clearXAxisButton = dijit.byId("clearXAxisNode");
- var clearYAxisButton = dijit.byId("clearYAxisNode");
- var clearZAxisButton = dijit.byId("clearZAxisNode");
- dojo.connect(clearXAxisButton, "onClick", function(e){
- clearNodes(xAxis,false);
- if(xAxis.getAllNodes().length==0){
- document.getElementById("xbutton").style.visibility = "hidden";
- }else if(xAxis.getAllNodes().length==1) {
- xAxis.selectAll();
- highlightSelected();
- }
- });
- dojo.connect(clearYAxisButton, "onClick", function(e){
- clearNodes(yAxis,false);
- if(yAxis.getAllNodes().length==0){
- document.getElementById("ybutton").style.visibility = "hidden";
- } else if(yAxis.getAllNodes().length==1) {
- yAxis.selectAll();
- highlightSelected();
- }
- });
- dojo.connect(clearZAxisButton, "onClick", function(e){
- clearNodes(zAxis,false);
- if(zAxis.getAllNodes().length==0){
- document.getElementById("zbutton").style.visibility = "hidden";
- } else if(zAxis.getAllNodes().length==1) {
- zAxis.selectAll();
- highlightSelected();
- }
- });
- clearNodes(dimensionList,true);
- clearNodes(measuresList,true);
- clearNodes(xAxis,true);
- clearNodes(yAxis,true);
- if(val!=null && val!="" ){
- if (initReportForm.validate()) {
- showProgressIndicator();
- var xhrArgs = {
- form: dojo.byId("populateDimensionAndMeasureList"),
- url: "<s:url action='populateDimensionAndMeasureList'/>",
- handleAs: "json",
- load: function(data) {
-
- if(data.error.error){
- responseMessage("Error: "+data.error.message);
- }else{
- dojo.style("dimensionList","visibility","visible");
- dojo.style("measuresList","visibility","visible");
- document.getElementById("pane").style.visibility = "visible";
- document.getElementById("reportTypeTable").style.visibility = "visible";
- dimensionList.copyOnly=true;
- measuresList.copyOnly=true;
- var dimensionArray = [];
- var measureArray = [];
- aliasValueType = data.dimensionAndMeasureViewList;
- functionView = data.functionViewList;
- for (var i=0;i<data.dimensionAndMeasureViewList.length;i++){
- if (data.dimensionAndMeasureViewList[i].isDimension=="true"){
- dimensionArray.push(data.dimensionAndMeasureViewList[i].alias);
- } else {
- measureArray.push(data.dimensionAndMeasureViewList[i].alias);
- }
- }
- dimensionList.insertNodes(false, dimensionArray);
- measuresList.insertNodes(false, measureArray);
- //xAxis.checkAcceptance = customCheckAcceptance;
- //yAxis.checkAcceptance = customCheckAcceptance;
- dimensionList.checkAcceptance = NoneCheckAcceptance;
- measuresList.checkAcceptance = NoneCheckAcceptance;
- dojo.subscribe("/dnd/start", null, highlightTargets);
- dojo.subscribe("/dnd/cancel", null, unhighlightTargets);
- /*dojo.subscribe("/dnd/drop", function(){
- unhighlightTargets(dojo.dnd.manager().target);
- });*/
- dojo.subscribe("/dnd/drop", function(source, nodes, copy, target){
- unhighlightTargets(dojo.dnd.manager().target);
- target.forInSelectedItems(function(item, id){
- //alert("Children length: " + dojo.byId(id).childNodes.length);
- if(dojo.byId(id).childNodes.length == 1){
- displayFunctionMenu(id);
- }
- });
- if(zAxis.getAllNodes().length==0){
- document.getElementById("zbutton").style.visibility = "hidden";
- } else if(zAxis.getAllNodes().length==1) {
- zAxis.selectAll();
- highlightSelected();
- }
- if(yAxis.getAllNodes().length==0){
- document.getElementById("ybutton").style.visibility = "hidden";
- } else if(yAxis.getAllNodes().length==1) {
- yAxis.selectAll();
- highlightSelected();
- }
- if(xAxis.getAllNodes().length==0){
- document.getElementById("xbutton").style.visibility = "hidden";
- }else if(xAxis.getAllNodes().length==1) {
- xAxis.selectAll();
- highlightSelected();
- }
- });
- var select_box = dijit.byId('reportType');
- select_box.options.length = 0;
- for(var i=0; i < data.reportTypeList.length; ++i){
- var key = data.reportTypeList[i].type;
- select_box.addOption({value: key, label: key});
- };
- var alias_box = dijit.byId('alias');
- alias_box.options.length = 0;
- for(var i=0; i < data.dimensionAndMeasureViewList.length; ++i){
- alias_box.addOption({value: data.dimensionAndMeasureViewList[i].alias, label: data.dimensionAndMeasureViewList[i].alias});
- };
- if(callEdit){
- populateEditData();
- }
- }
- hideProgressIndicator();
- } ,
- error: function(error) {
- hideProgressIndicator();
- responseMessage("Error: "+error);
- }
- };
- var deferred = dojo.xhrPost(xhrArgs);
- }
- } else {
- responseMessage("No mapping defined. Please define mapping on mapping page");
- document.getElementById("reportTypeTable").style.visibility = "hidden";
- document.getElementById("addFilter").style.visibility = "hidden";
- }
- }
- function displayFunctionMenu(id){
- if(dojo.byId(id).childNodes.length == 2){
- dojo.destroy(dojo.byId(id).childNodes[1]);
- }
- var menu = new dijit.Menu({
- style: "display: none;"
- });
- //alert("Creating sub-menu for functions");
- var subMenu = new dijit.Menu();
- subMenu.addChild(new dijit.MenuItem({
- label: "None",
- onClick: function() {
- removeFunctionIfExists(id);
- }
- }));
- var valueTypeFunc = "";
- var table = document.getElementById(id);
- var tableCells = table.getElementsByTagName("td");
- var alias = "";
- if(tableCells.length!=0){
- alias = tableCells[0].innerHTML;
- } else {
- alias = table.innerHTML;
- }
- var length = alias.split("(").length;
- var lastFunc = "";
- if(length > 1){
- lastFunc = trim(alias.split("(")[0]);
- for(var i=0;i<functionView.length;i++){
- if(functionView[i].functionName==lastFunc){
- valueTypeFunc=functionView[i].returnType;
- }
- }
- } else {
- for(var k=0;k<aliasValueType.length;k++){
- if(alias==aliasValueType[k].alias){
- valueTypeFunc = aliasValueType[k].valueType;
- }
- }
- }
- for(var i=0;i<functionView.length;i++){
- if(valueTypeFunc == functionView[i].valueType){
- var name = functionView[i].functionName;
- var menuItem = new dijit.MenuItem({
- label: name,
- onClick: function(e) {
- //removeFunctionIfExists(id);
- //alert(e.target.innerHTML);
- assignFunctionToAlias(id, e.target.innerHTML);
- displayFunctionMenu(id);
- }
- });
- subMenu.addChild(menuItem);
- }
- }
- menu.addChild(new dijit.PopupMenuItem({
- label: "Functions",
- popup: subMenu
- }));
- //alert("Creating drop-down button");
- var button = new dijit.form.DropDownButton({
- name: "function",
- dropDown: menu,
- showLabel: false
- });
- //alert("itemName is: " + item.name);
- //alert("id is: " + id);
- dojo.byId(id).appendChild(button.domNode);
- }
-
- function NoneCheckAcceptance(source, nodes) {
- return false;
- }
- function clearInnerHTML(text){
- var array = text.split(">");
- if(array.length>1){
- return array[1].split("<")[0];
- } else {
- return array[0];
- }
- }
- function trim(s){
- var l=0; var r=s.length -1;
- while(l < s.length && s[l] == ' '){
- l++;
- }
- while(r > l && s[r] == ' '){
- r-=1;
- }
- return s.substring(l, r+1);
- }
-
- function assignFunctionToAlias(id, functionName){
- var table = document.getElementById(id);
- var tableCells = table.getElementsByTagName("td");
- var alias = tableCells[0].innerHTML;
- tableCells[0].innerHTML = functionName + "(" + alias + ")";
- }
-
- function removeFunctionIfExists(id){
- var table = document.getElementById(id);
- var tableCells = table.getElementsByTagName("td");
- var alias = tableCells[0].innerHTML;
- var length = alias.split("(").length;
- if(length > 1){
- tableCells[0].innerHTML = trim(alias.split("(")[length - 1].split(")")[0]);
- }
- }
-
- function customCheckAcceptance(source, nodes) {
- var xNodes=xAxis.getAllNodes();
- var yNodes=yAxis.getAllNodes();
- var allow=true;
- for(var i=0;i<xNodes.length;i++) {
- if(clearInnerHTML(xNodes[i].innerHTML)==clearInnerHTML(nodes[0].innerHTML)) {
- allow = false;
- }
- }
- for(var i=0;i<yNodes.length;i++) {
- if(clearInnerHTML(yNodes[i].innerHTML)==clearInnerHTML(nodes[0].innerHTML)) {
- allow = false;
- }
- }
- if(source==xAxis || source==yAxis){
- allow=true;
- }
- return allow;
- }
-
- function getValuesFromPane(paneId){
- 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='findPreviewReportData'/>",
- handleAs: "json",
- load: function(data) {
- if(data.error.error){
- responseMessage("Error: "+data.error.message);
- }else{
- if(chartType=="Table"){
- dijit.byId("tableDialog").show();
- document.getElementById("preTableName").innerHTML=dijit.byId("reportName").get("value");
- doPlotTable(getValuesFromPane("xAxisNode"),data.dataList,'tableNode');
- }else if(chartType=="Choropleth"){
- dijit.byId("mapDialog").show();
- document.getElementById("preMapName").innerHTML=dijit.byId("reportName").get("value");
- doPlotMap(data.dataList);
- } else {
- dijit.byId("chartDialog").show();
- document.getElementById("preReportName").innerHTML=dijit.byId("reportName").get("value");
- doPlot(getValuesFromPane("xAxisNode"),getValuesFromPane("yAxisNode"),data.dataList,chartType,'simplechart','legend');
- }
- }
- hideProgressIndicator();
- },
- error: function(error) {
- responseMessage("Error: "+error);
- hideProgressIndicator();
- }
- };
- var deferred = dojo.xhrPost(xhrArgs);
- removeAppendedChild();
- }
- }
- function removeAppendedChild(){
- var count = 0;
- var saveForm = document.getElementById("saveReportForm");
- jsonStore.fetch({
- query: { alias: '*' },
- onItem: function(item) {
- saveForm.removeChild(document.getElementById("filterList["+count+"].alias"));
- saveForm.removeChild(document.getElementById("filterList["+count+"].filterType"));
- saveForm.removeChild(document.getElementById("filterList["+count+"].value"));
- count++;
- }
- });
- }
- function highlightTargets(){
- var props = {
- margin: { start: '0', end: '-5', unit: 'px' },
- borderWidth: { start: '0', end: '5', unit: 'px' }
- };
- dojo.style("xAxis", "color", "#01aa00");
- dojo.style("yAxis", "color", "#01aa00");
- clearResponse();
- document.getElementById("simplechart").style.visibility = "hidden";
- document.getElementById("legend").style.visibility = "hidden";
- }
- function unhighlightTargets(dropTarget){
- var props = {
- margin: { start: '-5', end: '0', unit: 'px' },
- borderWidth: { start: '5', end: '0', unit: 'px' }
- };
- dojo.style("xAxis", "color", "#000000");
- dojo.style("yAxis", "color", "#000000");
- dojo.query('.dojoDndAvatar').forEach(function(node, index, arr){
- dojo.style(node, "visibility","hidden");
- });
- if(dropTarget==xAxis){
- document.getElementById("xbutton").style.visibility = "visible";
- } else if(dropTarget==yAxis){