使用 Rally SDK 2 的功能证卡打印机

Feature Card Printer using Rally SDK 2

全部 我正在为 Rally 开发功能打印应用程序,以便我们可以为我们的模拟投资组合看板生成卡片。我想使用 2.0 SDK 构建这台打印机。我使用 original Card print 代码作为起点。我的 Java 脚本生锈了,我可以帮助我们克服这个障碍。

应用程序的目标。

我正在使用商店从 Rally 中提取数据。这按预期工作。 我在将存储结果传递到数组以创建 HTML 卡片时遇到问题。数据正在进入 _displayFeatureCard: 函数。我可以在控制台打印出来看到它。

这是我目前所拥有的。

Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function () {
    console.log("App Launched")   

//App调用组合特征数据存储 this._getfeaturedatastore();

},

//Get the portfolio feature data from Rally 
_getfeaturedatastore: function(){   
   var getfeaturedata = Ext.create('Rally.data.wsapi.Store', {
model: 'PortfolioItem/Feature',
autoLoad: true,

//为商店创建过滤器 过滤器:[ { 属性: 'State.Name',

        value: 'Story Definition',
    }

],

listeners: {
    load: function(getfeaturedatastore, getfeaturedatadata, success) {
    console.log("Got Feature Data Woot",getfeaturedatastore, getfeaturedatadata, success)    
    this._displayFeatureCard(getfeaturedata);
    },

     scope: this
},
fetch: ['State', 'Name', 'Description', 'Owner', 'Parent','PlannedStartDate','FormattedID','Tags']

}); },

_displayFeatureCard: function(getfeaturedata){
    var MAX_NAME_LEN = 115;
    var name,i,theMarkup,data, description, owner, parent, plannedstartdate, formattedid, data;

 data = getfeaturedata;

  console.log("Woot made it to the Card", data)

  for (i = 0; i < data; i++) {

        name = data[i].Name;

        owner = data[i].Owner;

        parent = data[i].Parent;

        description = data[i].Description;

        plannedstartdate=data[i].PlannedStartDate;

        formattedid=data[i].FormattedID;

        theMarkup = this.createMarkup(i, data, name, description, owner, parent, plannedstartdate, formattedid);

        dojo.byId("cards").innerHTML += theMarkup;

  }

},

检查您的代码,您的应用构造函数正在使用 Rally 的 AppSDK 2.0(基于 ExtJS),而您的 _displayFeatureCard 方法正在引用 dojo,它是遗留的 AppSDK1,不建议在 AppSDK 2.0 中使用。

有一个用于打印功能卡的 RallyCommunity 应用程序(PrintStoryCards 的略微修改版本)。可在此处获得:

https://github.com/RallyCommunity/feature-print-cards

它也是基于旧版和已弃用的 AppSDK1。但是它仍然有效,您可能会发现它符合您的要求。