<commit_before><STYLE type="text/css">
	.contents, .shadow {
		position: relative;
		bottom: 4px;
		right: 4px;
		min-width:700px
	}
	.shadow { background-color: #ccc; }
	.contents {
		background-color: #fff;
		color: #000;
		border: 1px solid #000;
		padding: 0.5em;
		min-width:700px
	}

	#testTable {
		width: 500px
		background-color: #0ff;
		border: 1px solid;
	}

	#testTable tr td:nth-child(1) {
		font-family: monospace;
	}

	#testTable td.testPending{
		font-style: italic;
		color: blue
	}

	#testTable td.testPassed {
		font-style: italic;
		color: green
	}

	#testTable td.testFailed {
		font-style: italic;
		color: red
	}


</style>
<div class="shadow">
	<div class="contents">
		<h2>Community Data Access</h2>


		<p>

		CDA is a new Data Access project for Pentaho project. Aims to solve the
		problem of data extraction. The details are described <a
			href="http://tinyurl.com/ydfzw4u">in this blog post</a>.

		</p>

		<p>

		This page lists not only the available datasources but serves as test
		page and reference to the way they work.

		</p>

		<h3>Datasource test</h3>

		<table id="testTable" cellpadding="0" cellspacing="0">

			<tr>
				<th>Access method</th>
				<th>Description</th>
				<th>Sample</th>
				<th>Result</th>
			</tr>
		</table>


	</div>
</div>
<script language="javascript" type="text/javascript">

	var components = [];

	</script>

	<script language="javascript" type="text/javascript">

		function load(){
			Dashboards.init(components);
		}


load();


// To add test cases, just edit this array

var testCases = [
{
	type: "sql.jdbc",
	desc: "Sql query over a jdbc datasource",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/sql-jdbc.cda",
	expectedCols: 4,
	expectedRows: 3
},
{
	type: "sql.jndi",
	desc: "Sql query over a jndi datasource",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/sql-jndi.cda",
	expectedCols: 4,
	expectedRows: 2
},
{
	type: "mondrian.jdbc",
	desc: "Mdx query over a jdbc mondrian connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/mondrian-jdbc.cda",
	expectedCols: 4,
	expectedRows: 1
},
{
	type: "mondrian.jndi",
	desc: "Mdx query over a jndi mondrian connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/mondrian-jndi.cda",
	expectedCols: 4,
	expectedRows: 3
}/*,
{
	url: "../cda/doQuery?path=/bi-developers/cda/cdafiles/sample.cda&dataAccessId=5",
	expectedCols: 3,
	expectedRows: 4
},
{
	url: "../cda/doQuery?path=/bi-developers/cda/cdafiles/sample.cda&dataAccessId=6",
	expectedCols: 3,
	expectedRows: 4
}*/
];


// Init table


// Build code to execute

var Caller = Base.extend({
		idx: -1,
		testInfo: {},

		constructor: function(idx){
			this.idx = idx;
			this.testInfo = testCases[idx];

			this.init();
		},

		init: function(){
			// Add this line to the table
			var sampleFile = this.testInfo.url.match(/cdafiles\/(.*)/)[0];
			$("#testTable").append("<tr><td>" + this.testInfo.type + "</td><td>"+this.testInfo.desc+"</td><td>"+ sampleFile+"</td><td class='testPending'>testing...</td></tr>");
		},

		makeCall:  function(){
			var myself = this;
			$.getJSON(this.testInfo.url,function(data){<commit_msg>- template.html file has stubs to make metadata and scripting tests<commit_after><STYLE type="text/css">
	.contents, .shadow {
		position: relative;
		bottom: 4px;
		right: 4px;
		min-width:700px
	}
	.shadow { background-color: #ccc; }
	.contents {
		background-color: #fff;
		color: #000;
		border: 1px solid #000;
		padding: 0.5em;
		min-width:700px
	}

	#testTable {
		width: 500px
		background-color: #0ff;
		border: 1px solid;
	}

	#testTable tr td:nth-child(1) {
		font-family: monospace;
	}

	#testTable td.testPending{
		font-style: italic;
		color: blue
	}

	#testTable td.testPassed {
		font-style: italic;
		color: green
	}

	#testTable td.testFailed {
		font-style: italic;
		color: red
	}


</style>
<div class="shadow">
	<div class="contents">
		<h2>Community Data Access</h2>


		<p>

		CDA is a new Data Access project for Pentaho project. Aims to solve the
		problem of data extraction. The details are described <a
			href="http://tinyurl.com/ydfzw4u">in this blog post</a>.

		</p>

		<p>

		This page lists not only the available datasources but serves as test
		page and reference to the way they work.

		</p>

		<h3>Datasource test</h3>

		<table id="testTable" cellpadding="0" cellspacing="0">

			<tr>
				<th>Access method</th>
				<th>Description</th>
				<th>Sample</th>
				<th>Result</th>
			</tr>
		</table>


	</div>
</div>
<script language="javascript" type="text/javascript">

	var components = [];

	</script>

	<script language="javascript" type="text/javascript">

		function load(){
			Dashboards.init(components);
		}


load();


// To add test cases, just edit this array

var testCases = [
{
	type: "sql.jdbc",
	desc: "Sql query over a jdbc datasource",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/sql-jdbc.cda",
	expectedCols: 4,
	expectedRows: 3
},
{
	type: "sql.jndi",
	desc: "Sql query over a jndi datasource",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/sql-jndi.cda",
	expectedCols: 4,
	expectedRows: 2
},
{
	type: "mondrian.jdbc",
	desc: "Mdx query over a jdbc mondrian connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/mondrian-jdbc.cda",
	expectedCols: 4,
	expectedRows: 1
},
{
	type: "mondrian.jndi",
	desc: "Mdx query over a jndi mondrian connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/mondrian-jndi.cda",
	expectedCols: 4,
	expectedRows: 3
},
{
	type: "mondrian.jdbc (denormalized)",
	desc: "Denormalized Mdx query over a jdbc mondrian connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/denormalized-mondrian-jndi.cda",
	expectedCols: 5,
	expectedRows: 6
},
{
	type: "mondrian.jndi (denormalized)",
	desc: "Denormalized Mdx query over a jndi mondrian connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/denormalized-mondrian-jndi.cda",
	expectedCols: 5,
	expectedRows: 6
}/*,
{
	type: "olap4j.jdbc",
	desc: "Mdx query over a olap4j jdbc connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/olap4j-jdbc.cda",
	expectedCols: 5,
	expectedRows: 6
},
{
	type: "olap4j.jndi",
	desc: "Mdx query over a olap4j jndi connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/olap4j-jndi.cda",
	expectedCols: 5,
	expectedRows: 6
}
{
	type: "scripting",
	desc: "Scripting data access",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/scripting.cda",
	expectedCols: 5,
	expectedRows: 6
}
{
	type: "metadata",
	desc: "Mql query over a metadata connection",
	url: "../cda/doQuery?dataAccessId=1&path=/bi-developers/cda/cdafiles/metadata.cda",
	expectedCols: 5,
	expectedRows: 6
}
*/
];


// Init table


// Build code to execute

var Caller = Base.extend({
		idx: -1,
		testInfo: {},

		constructor: function(idx){
			this.idx = idx;
			this.testInfo = testCases[idx];

			this.init();
		},

		init: function(){
			// Add this line to the table
			var sampleFile = this.testInfo.url.match(/cdafiles\/(.*)/)[0];
			$("#testTable").append("<tr><td>" + this.testInfo.type + "</td><td>"+this.testInfo.desc+"</td><td>"+ sampleFile+"</td><td class='testPending'>testing...</td></tr>");
		},

		makeCall:  function(){
			var myself = this;
			$.getJSON(this.testInfo.url,function(data){
{'fraction_non_alphanumeric': 0.16751269035532995, 'fraction_numerical': 0.01576275714667379, 'mean_word_length': 3.8396897220426633, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3734911', 'n_tokens_mistral': 3208, 'n_tokens_neox': 2895, 'n_words': 632}