Rally Cardboard for Stories by Project - rally

Im trying to create a Cardboard in Rally to show Stories assigned to specific project (within a given release).
We use the project field to identify which of our three scrum team are working a specific story. I would like a board style display to allow me to move stories from team to team quickly, and to show a list of whats on each teams plate for a given release.
I came up with the following custom HTML App:
function cardboardOnLoad(cardboard, args) {
var items = args.items;
var itemsByType = cardboard.getItems(null, "Defect");
var itemsByState = cardboard.getItems("Accepted");
var itemsByTypeAndState = cardboard.getItems("Backlog", "Defect");
}
function onLoad() {
var rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
'__PROJECT_OID__', '__PROJECT_SCOPING_DOWN__');
var cardboardConfig = {
types : ["Defect", "HierarchicalRequirement"],
attribute: "Project",
fetch : "Name,FormattedID,Owner,ObjectID",
query : 'Release.Name = "RI 3.1.0"',
order : 'Rank'
};
var cardboard = new rally.sdk.ui.CardBoard(cardboardConfig, rallyDataSource);
cardboard.addEventListener(cardboard.getValidEvents().onLoad, cardboardOnLoad);
cardboard.display("cardboard");
}
rally.addOnLoad(onLoad);
Only Problems is that it doesn't actually show my stories... just the project column names...
It stories are shown if I change the attribute value to "ScheduleState", but not for "Project", and im not sure why...
Any help would be appreciated.
Thanks.

This requires a slightly advanced usage of the cardboard where the columns are queried for manually. The comments above are correct in that you can run into some strange project scoping behavior otherwise.
The following app will build a board for all direct child projects of the currently scoped project.
Assuming you have a project hierarchy like so:
Project 1
+--Project 2
+--Project 3
+--Project 4
The board will contain columns Project 2, Project 3 and Project 4 when scoped to Project 1.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Release Project Board</title>
<meta name="Name" content="Release Project Board" />
<script type="text/javascript" src="/apps/1.32/sdk.js"></script>
<script type="text/javascript">
var rallyDataSource;
var cardBoard;
var releaseDropdown;
function onLoad() {
rallyDataSource = new rally.sdk.data.RallyDataSource('__WORKSPACE_OID__',
'__PROJECT_OID__',
'__PROJECT_SCOPING_UP__',
'__PROJECT_SCOPING_DOWN__');
releaseDropdown = new rally.sdk.ui.ReleaseDropdown({}, rallyDataSource);
releaseDropdown.addEventListener("onLoad", findProjects);
releaseDropdown.addEventListener("onChange", onReleaseChanged);
releaseDropdown.display("release");
}
function onReleaseChanged(rd, args) {
var config = cardboard.getConfiguration();
config.query = releaseDropdown.getQueryFromSelected();
cardboard.refresh(config);
}
function findProjects() {
rallyDataSource.find({
key: "projects",
type: "project",
query: new rally.sdk.util.Query('Parent = /project/__PROJECT_OID__'),
fetch: true
}, onProjectsRetrieved);
}
function onProjectsRetrieved(results) {
var columns = {};
rally.forEach(results.projects, function(project) {
columns[rally.sdk.util.Ref.getRelativeRef(project)] = {
displayValue: project.Name
};
});
var cardboardConfig = {
types : ["Defect", "HierarchicalRequirement"],
attribute: "Project",
fetch : "Name,FormattedID,Owner,ObjectID,Project",
query: releaseDropdown.getQueryFromSelected(),
columns: columns
};
cardboard = new rally.sdk.ui.CardBoard(cardboardConfig, rallyDataSource);
cardboard.display("cardboard");
}
rally.addOnLoad(onLoad);
</script>
</head>
<body>
<div id="release"></div>
<div id="cardboard"></div>
</body>
</html>

Related

How to Add Js Script Ads in Angular 2

I am new to Angular 2 , I had developed a Web-site now I want to add ads but unfortunately ads are in Js formate they are working if i add in index.html page but i want to modulate their location and type in differnt pages can any one help me with it, here is a basic format of Ads script that I am using
<script type="text/javascript">
( function() {
if (window.CHITIKA === undefined) { window.CHITIKA = { 'units' : [] }; };
var unit = {"calltype":"async[2]","publisher":"Sunny6142","width":550,"height":250,"sid":"Chitika Default"};
var placement_id = window.CHITIKA.units.length;
window.CHITIKA.units.push(unit);
document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>');
}());
</script>

JQGrid Showing empty while processing more than 3200 records with MVC 4

JQGrid is working fine for records up to 3000 and so with loadone:true , while it comes to more than 3200 it is showing empty grid. I would like to take up with server side paging and loadonce:false. is there any better way to load the data loadonce:true and show some huge amount of data like 20k records? if we are going to use server side paging, we should fetch only specific amount of records from database ? please find my code below and point me if any issues.
Model:
public class GOALogging
{
public int SERV_TRANS_ID { get; set; }
public string ACT_YEAR { get; set; }
public string SEAS { get; set; }
public string RESPONSE_DT { get; set; }
}
Controller
public ActionResult Index()
{
return View();
}
public JsonResult getRecords()
{
List<GOALogging> items = new List<GOALogging>();
items = GetLoggingDetails();
var a = Json(items, JsonRequestBehavior.AllowGet);
return a;
}
public List<GOALogging> GetLoggingDetails()
{
string connString = ConfigurationManager.ConnectionStrings["ACTOLConnection"].ConnectionString;
SqlConnection conn = new SqlConnection(connString);
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandTimeout = 6000;
cmd.CommandText = "GET_SAMPLEDETAILS";
cmd.Connection = conn;
conn.Open();
DataTable dataTable = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dataTable);
conn.Close();
da.Dispose();
List<GOALogging> items = new List<GOALogging>();
foreach (DataRow row in dataTable.Rows)
{
items.Add(new GOALogging
{
SERV_TRANS_ID = Convert.ToInt32(row["SERV_TRANS_ID"]),
ACT_YEAR = row["ACT_YEAR"].ToString(),
SEAS = row["SEAS"].ToString(),
RESPONSE_DT = row["RESPONSE_DT"].ToString()
});
}
return items;
}
View
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="~/Scripts/grid.locale-en.js"></script>
<script src="~/Scripts/jquery-1.11.0.min.js"></script>
<link href="~/Scripts/lib-UI-jquery-css-custom-theme-jquery-ui-1.9.2.custom.css" rel="stylesheet" />
<script src="~/Scripts/jquery.jqGrid.js"></script>
<script src="~/Scripts/grid.locale-en.js"></script>
<link href="~/Scripts/ui.jqgrid.css" rel="stylesheet" />
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css" rel="stylesheet" />
</head>
<body>
<script type="text/javascript">
$(function () {
$("#myGrid").jqGrid({
url: '/GOA/getRecords',
datatype: 'json',
myType: 'GET',
colNames: ['ID',
'YEAR', 'SEASON', 'RESPONSE_DT'],
colModel: [
{ name: 'SERV_TRANS_ID' },
{ name: 'ACT_YEAR' },
{ name: 'SEAS' },
{ name: 'RESPONSE_DT' }
],
pager: $('#myPager'),
jsonReader: { cell: ""},
rowNum: 10,
sortname: 'SERV_TRANS_ID',
sortorder: 'desc',
gridview: true,
loadonce: true,
rowList: [10, 20, 50, 100],
width:1120,
height:280,
viewrecords: true,
caption: 'Past 24 hours ACTService Processing Status'
});
});
</script>
<div >
<table id="myGrid" ></table>
<div id="myPager"></div>
</div>
</body>
</html>
This is because of Maximum length restriction in .Net, you can use below formated code in your controller to go ahead of issue.
List<MEmployee> items = new List<MEmployee>();
items = getData();
var a = Json(items, JsonRequestBehavior.AllowGet);
a.MaxJsonLength = int.MaxValue;
return a;
Reference link
I suspect that you have some problem with the size of serialized data. I mean that you have pure ASP.NET MVC problem. Old version of ASP.NET MVC uses very old JavaScriptSerializer for serialization which have the restriction described here and here.
I would recommend you to use Newtonsoft.Json instead of JavaScriptSerializer. If you would migrate to MVC5 then it will be automatically. Newtonsoft.Json works much more quickly as JavaScriptSerializer and have no such restrictions.
Here you can download the demo project which used simple ASP.NET MVC for editing the data. It uses Newtonsoft.Json of cause.
It's recommended additionally to use compression of returned JSON data. Look at here for example.

JS Bigquery example working in chrome/firefox but not in IE?

The below example which is given in Google Developers, is working in Chrome/Firfox with out having any issues but not in IE and I am using IE Version#11 (Latest) in windows 8.1.
The chart is not displaying in IE and it a java script error i am getting.![enter image description here][1]
Note:
1. Similar error i am getting when i use Google Developers-JSON example also...to fetch the records from Bigquery and showing in a table...like executing in chrome/firefox but not in IE???
2. If possible Can you please provide and ASP.NET web application example, to connect google BigQuery and showing the Data in GRIDView with C#.NET (NOT WITH ASP.NET MVC)
<html>
<head>
<script src="https://apis.google.com/js/client.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', { packages: ['geochart'] });
</script>
<script>
// UPDATE TO USE YOUR PROJECT ID AND CLIENT ID
var project_id = 'XXXXXXXXX';
var client_id = 'XXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com';
var config = {
'client_id': client_id,
//'P12_KEY': 'Keys/ab2c867e84d6d629f0a80595ae14fdbe44492de8 - privatekey.P12',
//'SERVICE_ACCOUNT' : '87853623787-7lsfbcuu9p3gr9o76opp5fkrvhdf0itk#developer.gserviceaccount.com',
'scope': 'https://www.googleapis.com/auth/bigquery'
};
function runQuery() {
var request = gapi.client.bigquery.jobs.query({
'projectId': project_id,
'timeoutMs': '30000',
'query': 'SELECT state, AVG(mother_age) AS theav FROM [publicdata:samples.natality] WHERE year=2000 AND ever_born=1 GROUP BY state ORDER BY theav DESC;'
});
request.execute(function (response) {
console.log(response);
var stateValues = [["State", "Age"]];
$.each(response.result.rows, function (i, item) {
var state = item.f[0].v;
var age = parseFloat(item.f[1].v);
var stateValue = [state, age];
stateValues.push(stateValue);
});
var data = google.visualization.arrayToDataTable(stateValues);
var geochart = new google.visualization.GeoChart(
document.getElementById('map'));
geochart.draw(data, { width: 556, height: 347, resolution: "provinces", region: "US" });
});
}
function auth() {
gapi.auth.authorize(config, function () {
gapi.client.load('bigquery', 'v2', runQuery);
$('#client_initiated').html('BigQuery client initiated');
});
$('#auth_button').hide();
}
</script>
</head>
<body>
<h2>Average Mother Age at First Birth in 2000</h2>
<button id="auth_button" onclick="auth();">Authorize</button>
<button id="query_button" style="display:none;" onclick="runQuery();">Run Query</button>
<div id="map"></div>
</body>
</html>
Perhaps because you have console.log() statement and IE doesn't like that.

MVC 4 theme switching with Ajax.ActionLinks

The full text of this question is available with a screenshot here
Thanks for any help - original post follows:
So I downloaded the MvcMusicStore and fired up the completed project. I read all the articles talking about extending the view engine and using jquery plugins but I wanted to believe it could be simpler than that to just change the CSS file path when a link gets clicked. Mainly because I didn't want to copy code verbatim that I didn't fully understand. I'm very new to MVC.
So this is what I did:
To HomeController.cs I added:
public ActionResult Theme(string themeName)
{
ViewBag.Theme = ThemeModel.GetSetThemeCookie(themeName);
return View();
}
to Models I added this class:
public class ThemeModel
{
public static string GetSetThemeCookie(string theme)
{
HttpCookie cookie = HttpContext.Current.Request.Cookies.Get("userTheme");
string rv = "Blue";
if (theme != null)
rv = theme;
else
{
if (cookie != null)
rv = cookie["themeName"];
else
rv = "Blue";
}
cookie = new HttpCookie("userTheme");
HttpContext.Current.Response.Cookies.Remove("userTheme");
cookie.Expires = DateTime.Now.AddYears(100);
cookie["themeName"] = rv;
HttpContext.Current.Response.SetCookie(cookie);
return rv;
}
}
I then created 2 copies of Site.css, changing only the background color and font-family and a view to generate my link tag.
<link href="#Url.Content(string.Format("~/Content/{0}.css", ViewBag.Theme))" rel="stylesheet" type="text/css" />
Finally, I made these changes to my _Layout.cshtml.
<!DOCTYPE html>
<html>
<head>
<title>#ViewBag.Title</title>
#if (ViewBag.Theme == null) {Html.RenderAction("Theme", "Home");}
<script src="#Url.Content("~/Scripts/jquery-1.4.4.min.js")"
type="text/javascript"></script>
</head>
<body>
<div id="header">
<h1>ASP.NET MVC MUSIC STORE</h1>
<ul id="navlist">
<li class="first">Home</li>
<li>Store</li>
<li>#{Html.RenderAction("CartSummary", "ShoppingCart");}</li>
<li>Admin</li>
</ul>
</div>
#{Html.RenderAction("GenreMenu", "Store");}
<div id="main">
#RenderBody()
</div>
<div id="footer">
Themes: #Ajax.ActionLink("Coral", "Theme", "Home", new { themeName = "Coral" }, null, new { #style = "color : coral"} )
#Ajax.ActionLink("Blue", "Theme", "Home", new { themeName = "Blue" }, null, new { #style = "color : blue;"})
</div>
</body>
</html>
When I run the app I get the general layout rendered twice. Once with only the genre menu rendered on the left and nothing in the body. And then again with the top 5 albums. I can't post the image as I don't have enough rep.
When I click my Coral and Blue links, my theme changes and I get just the one set without the top 5 albums.
So after some more reading on here I tried this:
_Layout.cshtml:
#{Html.RenderAction("Theme", "Home");}
HomeController.cs
public ActionResult Theme(string themeName)
{
ViewBag.Theme = ThemeModel.GetSetThemeCookie(themeName);
return PartialView();
}
But even though this stops the duplicate rendering, when I click the theme link, the colour changes but I get absolutely nothing else on the page.
Well and truly flummoxed now and could really use some help.
Cheers,
.pd.
Okay - here's how I did it in the end.
Create a javascript file. Mine's called master.js:
function ajaxSuccSetTheme(theme) {
$('#linkTheme').attr('href', '/Content/' + theme + '.css');
}
Modify the _Layout.cshtml:
#{
if (ViewBag.Theme == null) {
ViewBag.Theme = MvcMusicStore.Models.ThemeModel.GetSetThemeCookie();
}
}
<link id="linkTheme" href="#Url.Content(string.Format("~/Content/{0}.css", ViewBag.Theme))" rel="stylesheet" type="text/css" />
<script src="#Url.Content("~/Scripts/jquery-2.0.3.min.js")" type="text/javascript"></script>
<script src="#Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="#Url.Content("~/Scripts/master.js")" type="text/javascript"></script>
Notes on this:
The first time the page loads Theme will not have been written to the ViewBag
Give the <link> tag the same ID as the jQuery selector in your js file above
Update unobtrusive ajax jQuery file to the same version as your jQuery lib. Your Ajax.ActionLink won't work without it.
Then my theme switching links in _Layout.cshtml look like this:
<div id="footer">
Themes :
#Ajax.ActionLink("Coral", "Theme", "Home", new { themeName = "Coral" },
new AjaxOptions { HttpMethod = "POST", OnSuccess = string.Format("ajaxSuccSetTheme('{0}');", "Coral")},
new { #style = "color : coral;" }) |
#Ajax.ActionLink("Blue", "Theme", "Home", new { themeName = "Blue" },
new AjaxOptions { HttpMethod = "POST", OnSuccess = string.Format("ajaxSuccSetTheme('{0}');", "Blue")},
new { #style = "color : blue;" })
</div>
Notes on that:
themeName = "whatever" is the argument to your Theme Controller method. this gets passed to the cookie method in the ThemeModel
method = POST so IE doesn't cache it and I've read a couple other questions that got solved by not doing a GET
you have to kludge your own args to the OnSuccess js callback
Next the HomeController.cs change:
public ActionResult Theme(string themeName)
{
ViewBag.Theme = ThemeModel.GetSetThemeCookie(themeName);
if (Request.IsAjaxRequest())
{
return PartialView();
}
else
{
return null;
}
}
Honestly, it doesn't matter if you just return null without checking for IsAjaxRequest() cuz all we need from this is to set the cookie so it remembers when you next login.
Which just leaves the cookie setting method in the ThemeModel:
public class ThemeModel
{
public static string GetSetThemeCookie(string theme = null)
{
HttpCookie cookie = HttpContext.Current.Request.Cookies.Get("userTheme");
string rv = "Blue";
if (theme != null)
rv = theme;
else
{
if (cookie != null)
rv = cookie["themeName"];
else
{
cookie = new HttpCookie("userTheme");
rv = "Blue";
}
}
cookie.Expires = DateTime.Now.AddYears(100);
cookie["themeName"] = rv;
HttpContext.Current.Response.SetCookie(cookie);
return rv;
}
}
Hope I helped somebody. If you'd rather do it all in jQuery here's Tim Vanfosson's Theme Manager jQuery Plugin
Cheers,
.pd.

Unable to print output to the console in dojo

I'm a beginner in dojo, and I'm trying to print the output to console using dojo code. But I don't what's the problem in the following code, and how can I print the output to the console?
<html>
<head>
<script type = "text/javascript" src = "dojo/dojo.js" data-dojo-config = "async: true, isDebug : true" >
</script>
</head>
<body>
<h1 id = "greeting">Hello</h1>
<script>
define(["dojo/dom"],function(dom) {
var Twitter = declare(null, {username:"defaultusername",
say :function(msg)
{
console.log("Hello "+msg);
}
});
var myInstance = new Twitter();
myInstance.say("Dojo");
});
</script>
</body>
</html>
Use require instead of define:
<script>
require(["dojo/dom", "dojo/_base/declare"], function(dom, declare) {
var Twitter = declare(null, {
username: "defaultusername",
say :function(msg) {
console.log("Hello "+msg);
}
});
var myInstance = new Twitter();
myInstance.say("Dojo");
});
</script>
Console works, but your code inside callback function in declare is not being executed until you require it.
You cannot define in inline script code, that is meant to be a class define, put in the topmost line of a class-file, meaning define maps the filename to the returned value of its function.
This means, if you have
dojo_toolkit /
dojo/
dijit/
dojox/
libs/
myWidgets/
foo.js
And foo.js reads
define(["dijit._Widget"], function(adijit) {
return declare("libs.myWidgets.foo", [adijit], function() {
say: function(msg) { console.log(msg); }
});
});
Then a new module is registered, called libs / myWidgets / foo. You should make sure that the returned declare's declaredClass inside each define matches the file hierachy.
That being said, reason why define does not work for you is the explaination above. It is inline and has no src to guess the declaredClass name from. Rewrite your code to define("aTwitterLogger", [":
define("aTwitterLogger", ["dojo/_base/declare", "dojo/dom"],function(declare, dom) {
var Twitter = declare(null, {
username:"defaultusername",
say :function(msg)
{
console.log("Hello "+msg);
}
});
var myInstance = new Twitter();
myInstance.say("Dojo");
});