galaxy-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 15302 discussions
commit/galaxy-central: guerler: Charts: Heatmap add color schemes
by commits-noreply@bitbucket.org 15 Jun '14
by commits-noreply@bitbucket.org 15 Jun '14
15 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/56a24bfc4d15/
Changeset: 56a24bfc4d15
User: guerler
Date: 2014-06-15 02:20:31
Summary: Charts: Heatmap add color schemes
Affected #: 3 files
diff -r 972549a5f857b22ae7acd130b915523647b05422 -r 56a24bfc4d155bb0df1875a6225cf1e71b8947b3 config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
@@ -30,6 +30,74 @@
use_panels : {
init : 'false',
hide : true
+ },
+ color_set : {
+ title : 'Color scheme',
+ info : 'Select a color scheme for your heatmap',
+ type : 'select',
+ init : 'jet',
+ data : [
+ {
+ label : 'Cold-to-Hot',
+ value : 'hot'
+ },
+ {
+ label : 'Cool',
+ value : 'cool'
+ },
+ {
+ label : 'Copper',
+ value : 'copper'
+ },
+ {
+ label : 'Gray scale',
+ value : 'gray'
+ },
+ {
+ label : 'Jet',
+ value : 'jet'
+ },
+ {
+ label : 'No-Green',
+ value : 'no_green'
+ },
+ {
+ label : 'Ocean',
+ value : 'ocean'
+ },
+ {
+ label : 'Polar',
+ value : 'polar'
+ },
+ {
+ label : 'Red-to-Green',
+ value : 'redgreen'
+ },
+ {
+ label : 'Red-to-green (saturated)',
+ value : 'red2green'
+ },
+ {
+ label : 'Relief',
+ value : 'relief'
+ },
+ {
+ label : 'Seismograph',
+ value : 'seis'
+ },
+ {
+ label : 'Sealand',
+ value : 'sealand'
+ },
+ {
+ label : 'Split',
+ value : 'split'
+ },
+ {
+ label : 'Wysiwyg',
+ value : 'wysiwyg'
+ }
+ ]
}
}
});
diff -r 972549a5f857b22ae7acd130b915523647b05422 -r 56a24bfc4d155bb0df1875a6225cf1e71b8947b3 config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-parameters.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-parameters.js
@@ -0,0 +1,42 @@
+// dependencies
+define([], function() {
+
+// color palettes
+var colorSets = {
+ seis: ['#AA0000', '#D00000', '#F70000', '#FF1D00', '#FF4400', '#FF6A00', '#FF9000', '#FFB700', '#FFDD00', '#FFFF00', '#FFFF00', '#FFFF00', '#BDFF0C', '#73FF1A', '#3FFA36', '#16F45A', '#00D08B', '#0087CD', '#0048FA', '#0024E3'].reverse(),
+
+ sealand: ['#8C66FF', '#6A66FF', '#6684FF', '#66A7FF', '#66CAFF', '#66ECFF', '#66FFF0', '#66FFCE', '#66FFAB', '#66FF88', '#66FF66', '#88FF66', '#ABFF66', '#CEFF66', '#FFEEA6', '#FFD3A6', '#FFB8A6', '#FFAAB0', '#FFB5CB', '#FFC0E1'].reverse(),
+
+ redgreen: ['#005824', '#1A693B', '#347B53', '#4F8D6B', '#699F83', '#83B09B', '#9EC2B3', '#B8D4CB', '#D2E6E3', '#EDF8FB', '#FFFFFF', '#F1EEF6', '#E6D3E1','#DBB9CD', '#D19EB9', '#C684A4', '#BB6990', '#B14F7C', '#A63467', '#9B1A53', '#91003F'],
+
+ ocean: ['#000000', '#000209', '#000413', '#00061E', '#000728', '#000932', '#002650', '#00426E', '#005E8C', '#007AAA', '#0096C8', '#22A9C2', '#45BCBB', '#67CFB5', '#8AE2AE', '#ACF6A8', '#BCF8B9', '#CBF9CA', '#DBFBDC', '#EBFDED'].reverse(),
+
+ cool: ['#00FFFF', '#0DF2FF', '#19E6FF', '#26D9FF', '#33CCFF', '#3FBFFF', '#4CB3FF', '#59A6FF', '#6699FF', '#738CFF', '#7F7FFF', '#8C73FF', '#9966FF', '#A659FF', '#B24DFF', '#BF3FFF', '#CC33FF', '#D926FF', '#E619FF', '#F20DFF'],
+
+ copper: ['#000000', '#100906', '#1F130D', '#301E13', '#40281A', '#50321F', '#603C26', '#70462D', '#805033', '#905A3A', '#A06440', '#B06E46', '#C0784D', '#D08253', '#E08C5A', '#F09660', '#FFA066', '#FFAA6D', '#FFB473', '#FFBE7A'].reverse(),
+
+ gray: ['#000000', '#0D0D0D', '#191919', '#262626', '#333333', '#3F3F3F', '#4C4C4C', '#595959', '#666666', '#737373', '#7F7F7F', '#8C8C8C', '#999999', '#A6A6A6', '#B2B2B2', '#BFBFBF', '#CCCCCC', '#D9D9D9', '#E6E6E6', '#F2F2F2'].reverse(),
+
+ hot: ['#000000', '#220000', '#440000', '#660000', '#880000', '#AA0000', '#CC0000', '#EE0000', '#FF1100', '#FF3300', '#FF5500', '#FF7700', '#FF9900', '#FFBB00', '#FFDD00', '#FFFF00', '#FFFF33', '#FFFF66', '#FFFF99', '#FFFFCC'].reverse(),
+
+ jet: ['#00007F', '#0000B2', '#0000E5', '#0019FF', '#004DFF', '#007FFF', '#00B2FF', '#00E5FF', '#FFFFF2', '#FFFFD9', '#FFFFBF', '#FFFFA5', '#FFFF8C', '#FFE500', '#FFB300', '#FF7F00', '#FF4C00', '#FF1900', '#E50000', '#B20000'],
+
+ no_green: ['#1F60FF', '#1F60FF', '#1F9FFF', '#1FBFFF', '#00CFFF', '#2AFFFF', '#2AFFFF', '#55FFFF', '#7FFFFF', '#AAFFFF', '#FFFF54', '#FFFF54', '#FFF000', '#FFBF00', '#FFA800', '#FF8A00', '#FF8A00', '#FF7000', '#FF4D00', '#FF0000'],
+
+ polar: ['#0000FF', '#1919FF', '#3333FF', '#4C4CFF', '#6666FF', '#7F7FFF', '#9999FF', '#B2B2FF', '#CCCCFF', '#E6E6FF', '#FFFFFF', '#FFE5E5', '#FFCCCC', '#FFB2B2', '#FF9999', '#FF7F7F', '#FF6666', '#FF4C4C', '#FF3333', '#FF1A1A'],
+
+ red2green: ['#FF0000', '#FF1919', '#FF3333', '#FF4C4C', '#FF6666', '#FF7F7F', '#FF9999', '#FFB2B2', '#FFCCCC', '#FFE6E6', '#FFFFFF', '#E5FFE5', '#CCFFCC', '#B2FFB2', '#99FF99', '#7FFF7F', '#66FF66', '#4CFF4C', '#33FF33', '#1AFF1A'].reverse(),
+
+ relief: ['#000000', '#000413', '#000728', '#002650', '#005E8C', '#0096C8', '#45BCBB', '#8AE2AE', '#BCF8B9', '#DBFBDC', '#467832', '#887438', '#B19D48', '#DBC758', '#FAE769', '#FAEB7E', '#FCED93', '#FCF1A7', '#FCF6C1', '#FDFAE0'].reverse(),
+
+ split: ['#7F7FFF', '#6666E6', '#4D4DCC', '#3333B3', '#1A1A99', '#00007F', '#000066', '#00004D', '#000033', '#00001A', '#000000', '#1A0000', '#330000', '#4D0000', '#660000', '#7F0000', '#991A1A', '#B33333', '#CC4D4D', '#E66666'],
+
+ wysiwyg: ['#3F003F', '#3F003F', '#3F00BF', '#003FFF', '#00A0FF', '#3FBFFF', '#3FBFFF', '#40E0FF', '#3FFFBF', '#3FFF3F', '#7FFF3F', '#BFFF3F', '#BFFF3F', '#FFE040', '#FFE040', '#FF6040', '#FF1F40', '#FF60C0', '#FFA0FF', '#FFA0FF'].reverse()
+}
+
+// return
+return {
+ colorSets: colorSets
+}
+
+});
\ No newline at end of file
diff -r 972549a5f857b22ae7acd130b915523647b05422 -r 56a24bfc4d155bb0df1875a6225cf1e71b8947b3 config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
@@ -1,5 +1,5 @@
// dependencies
-define(['plugin/charts/tools', 'utils/utils'], function(Tools, Utils) {
+define(['plugin/charts/tools', 'utils/utils', 'plugin/charts/others/heatmap/heatmap-parameters'], function(Tools, Utils, HeatmapParameters) {
// widget
return Backbone.View.extend({
@@ -15,7 +15,7 @@
style: {
'font-weight' : 'normal',
'font-family' : 'Verdana',
- 'font-size' : '12'
+ 'font-size' : 12
},
legend: {
width : 15,
@@ -23,13 +23,12 @@
style : {
'font-weight' : 'normal',
'font-family' : 'Verdana',
- 'font-size' : '11'
+ 'font-size' : 11
},
limit : 7
},
background_color : '#FFFFF8',
- debug_color : '#FFFFFF',
- color_set : ['#ffffd9','#edf8b1','#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58','#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58']
+ debug_color : '#FFFFFF'
},
// initialize
@@ -41,6 +40,9 @@
// render
render : function(canvas_id, groups) {
+ // get color set
+ this.color_set = HeatmapParameters.colorSets[this.chart.settings.get('color_set')];
+
// categories
this.categories = Tools.makeUniqueCategories(groups);
@@ -57,7 +59,7 @@
// color scale
this.zMin = d3.min(this.data, function(d) { return d.z; });
this.zMax = d3.max(this.data, function(d) { return d.z; });
- this.zScale = d3.scale.quantize().domain([this.zMin, this.zMax]).range(this.options.color_set);
+ this.zScale = d3.scale.quantize().domain([this.zMin, this.zMax]).range(this.color_set);
// create axis
this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
@@ -285,7 +287,6 @@
.style('stroke-width', 1)
.call(this.yAxis);
-
// fix text
var yFontSize = Math.min(boxHeight, font_size);
this.gyAxis.selectAll('text')
@@ -329,11 +330,11 @@
var legendWidth = this.options.legend.width;
var legendElements = this.zScale.range().length;
var legendElementHeight = legendSize * height / legendElements;
- var legendHeight = legendElements * legendElementHeight;
+ var legendHeight = legendElements * legendElementHeight / 2;
// create legend elements
var legend = this.svg.selectAll('.legend')
- .data(d3.range(this.zMin, this.zMax, (this.zMax-this.zMin) / legendElements).reverse())
+ .data(d3.range(this.zMin, this.zMax, 2 * (this.zMax-this.zMin) / legendElements).reverse())
.enter().append('g')
.attr('class', 'legend')
.attr('transform', function(d, i) {
@@ -363,6 +364,16 @@
return str;
}
});
+
+ this.svg.append('text')
+ .style(this.options.legend.style)
+ .style({'font-size' : 9, 'font-weight': 'bold'})
+ .text('Legend')
+ .attr('transform', function(d, i) {
+ var x = width + (margin.right - this.getBBox().width) / 2;
+ var y = ((height - legendHeight) / 2) - 10;
+ return 'translate(' + x + ',' + y + ')';
+ });
},
// create axes formatting
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Add heatmap legend
by commits-noreply@bitbucket.org 15 Jun '14
by commits-noreply@bitbucket.org 15 Jun '14
15 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/972549a5f857/
Changeset: 972549a5f857
User: guerler
Date: 2014-06-15 00:43:52
Summary: Charts: Add heatmap legend
Affected #: 3 files
diff -r 37f1d93ae873cc65f2c9b731e16609f3c9bc3a99 -r 972549a5f857b22ae7acd130b915523647b05422 config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
@@ -5,7 +5,7 @@
category : 'Others',
query_limit : 2000,
library : 'Custom',
- tag : 'div',
+ tag : 'svg',
keywords : 'small',
zoomable : true,
columns : {
@@ -25,6 +25,12 @@
title : 'Observation',
is_numeric : true
}
+ },
+ settings : {
+ use_panels : {
+ init : 'false',
+ hide : true
+ }
}
});
diff -r 37f1d93ae873cc65f2c9b731e16609f3c9bc3a99 -r 972549a5f857b22ae7acd130b915523647b05422 config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
@@ -6,15 +6,30 @@
// options
optionsDefault: {
- font_size : 12,
- font_family : 'Verdana',
- font_style : {
- 'font-weight' : 'normal',
- 'font-family' : 'Verdana'
+ margin: {
+ top : 40,
+ right : 70,
+ bottom : 70,
+ left : 70
},
- background_color : '#FFFFF8',
- debug_color : '#FFFFFF',
- color_set : ['#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58']
+ style: {
+ 'font-weight' : 'normal',
+ 'font-family' : 'Verdana',
+ 'font-size' : '12'
+ },
+ legend: {
+ width : 15,
+ size : 0.9,
+ style : {
+ 'font-weight' : 'normal',
+ 'font-family' : 'Verdana',
+ 'font-size' : '11'
+ },
+ limit : 7
+ },
+ background_color : '#FFFFF8',
+ debug_color : '#FFFFFF',
+ color_set : ['#ffffd9','#edf8b1','#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58','#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58']
},
// initialize
@@ -40,9 +55,9 @@
this.yScale = d3.scale.linear().domain([0, this.categories.array.y.length]);
// color scale
+ this.zMin = d3.min(this.data, function(d) { return d.z; });
this.zMax = d3.max(this.data, function(d) { return d.z; });
- this.zScale = d3.scale.quantize().domain([0, this.zMax]);
- this.zScale.range(this.options.color_set);
+ this.zScale = d3.scale.quantize().domain([this.zMin, this.zMax]).range(this.options.color_set);
// create axis
this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
@@ -79,6 +94,7 @@
var chart = this.chart;
var data = this.data;
var self = this;
+ this.data = data;
// get/reset container
var container = $('#' + this.canvas_id);
@@ -96,28 +112,48 @@
this.xAxis.tickValues(d3.range(xTickStart, xTickEnd, 1));
this.yAxis.tickValues(d3.range(yTickStart, yTickEnd, 1));
- // set margin and heights
- var margin = {top: 40, right: 20, bottom: 70, left: 70},
- width = parseInt(container.width()) - margin.left - margin.right,
- height = parseInt(container.height()) - margin.top - margin.bottom;
+ // get margins
+ var margin = this.options.margin;
- // default font size
- var font_size = this.options.font_size;
+ // configure dimensions
+ this.height = parseInt(container.height()) - margin.top - margin.bottom;
+ this.width = parseInt(container.width()) - margin.left - margin.right;
- //
// set range
- //
- this.xScale.range([0, width]);
- this.yScale.range([height, 0]);
+ this.xScale.range([0, this.width]);
+ this.yScale.range([this.height, 0]);
- //
- // draw boxes
- //
// get box properties
- var rowCount = yDomain[1] - yDomain[0],
- colCount = xDomain[1] - xDomain[0],
- boxWidth = Math.max(1, Math.floor(width / colCount)),
- boxHeight = Math.max(1, Math.floor(height / rowCount));
+ this.rowCount = yDomain[1] - yDomain[0];
+ this.colCount = xDomain[1] - xDomain[0];
+ this.boxWidth = Math.max(1, Math.floor(this.width / this.colCount));
+ this.boxHeight = Math.max(1, Math.floor(this.height / this.rowCount));
+
+ // create group
+ var svg = this.svg = d3.select('#' + this.canvas_id)
+ .append('g')
+ .attr('class', 'heatmap')
+ .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
+
+ // build elements
+ this._buildBoxes();
+ this._buildX();
+ this._buildY();
+ this._buildLegend();
+ },
+
+ // y axis
+ _buildBoxes: function() {
+ // link this
+ var self = this;
+
+ // collect parameters
+ var height = this.height;
+ var width = this.width;
+ var margin = this.options.margin;
+ var svg = this.svg;
+ var boxWidth = this.boxWidth;
+ var boxHeight = this.boxHeight;
// box location
function _locator(d) {
@@ -129,17 +165,6 @@
return self.zScale(d.z);
};
- //
- // create svg
- //
- var svg = d3.select('#' + this.canvas_id)
- .append('svg')
- .attr('width', width + margin.left + margin.right)
- .attr('height', height + margin.top + margin.bottom)
- .append('g')
- .attr('class', 'heatmap')
- .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
-
// set background color
var gBackground = svg.append('rect')
.attr('width', width)
@@ -160,100 +185,183 @@
.attr('clip-path', 'url(#clip)');
// add boxes to chart area
- var boxes = chartBody.selectAll('g.box-group').data(data, function(d, i) {
+ var boxes = chartBody.selectAll('g.box-group').data(this.data, function(d, i) {
return d.x + '\0' + d.y;
});
var gEnter = boxes.enter().append('g')
.attr('class', 'box-group');
gEnter.append('rect')
- .attr('class','heat-box')
- .attr('fill', 'red');
+ .attr('class','heat-box');
boxes.selectAll('rect')
.attr('rx', 1)
.attr('ry', 1)
.attr('fill', _color)
.attr('width', boxWidth)
.attr('height', boxHeight)
- .attr('transform', _locator);
+ .attr('transform', _locator)
+ .append('svg:title')
+ .text(function(d) { return d.x; });
boxes.exit().remove();
-
+ },
+
+ // x axis
+ _buildX : function() {
+ // link this
+ var self = this;
+
+ // collect parameters
+ var height = this.height;
+ var width = this.width;
+ var margin = this.options.margin;
+ var svg = this.svg;
+ var font_size = this.options.style['font-size'];
+ var boxWidth = this.boxWidth;
+
// draw x axis
this.gxAxis = svg.append('g')
.attr('class', 'x axis')
.style('stroke-width', 1)
.attr('transform', 'translate(0,' + height + ')')
.call(this.xAxis);
+
+ // fix text
+ var xFontSize = Math.min(boxWidth, font_size);
+ this.gxAxis.selectAll('text')
+ .style(this.options.style)
+ .style({'font-size': xFontSize + 'px'})
+ .attr('transform', function(d) {
+ var y = -this.getBBox().height - 10;
+ var x = -xFontSize + boxWidth/2;
+ return 'rotate(-90)translate(' + y + ',' + x + ')';
+ });
+
+ // set background color
+ var gxAxisLabelBackground = svg.append('rect')
+ .attr('width', width)
+ .attr('height', font_size + 3)
+ .attr('y', height + margin.bottom - font_size - 3)
+ .attr('fill', this.options.debug_color);
+
+ // axis label
+ this.gxAxisLabel = svg.append('text')
+ .attr('class', 'x label')
+ .style(this.options.style)
+ .text(this.chart.settings.get('x_axis_label'))
+ .attr('transform', function(d) {
+ var y = height + margin.bottom - font_size/3;
+ var x = (width - this.getBBox().width)/2;
+ return 'translate(' + x + ',' + y + ')';
+ });
+
+ // chart title
+ this.gxTickLabel = svg.append('text')
+ .attr('class', 'title')
+ .style(this.options.style)
+ .style({'font-size' : 1.5*font_size})
+ .text(this.chart.get('title'))
+ .attr('transform', function(d) {
+ var y = -margin.top/2;
+ var x = (width - this.getBBox().width)/2;
+ return 'translate(' + x + ',' + y + ')';
+ });
+ },
+
+ // y axis
+ _buildY : function() {
+ // link this
+ var self = this;
+
+ // collect parameters
+ var height = this.height;
+ var width = this.width;
+ var margin = this.options.margin;
+ var svg = this.svg;
+ var font_size = this.options.style['font-size'];
+ var boxHeight = this.boxHeight;
// draw y axis
this.gyAxis = svg.append('g')
.attr('class', 'y axis')
.style('stroke-width', 1)
.call(this.yAxis);
-
- // fix text
- var xFontSize = Math.min(boxWidth, font_size);
- this.gxAxis.selectAll('text')
- .style(this.options.font_style)
- .style({'font-size': xFontSize + 'px'})
- .attr('transform', function(d) {
- var y = -this.getBBox().height - 10;
- var x = -xFontSize + boxWidth/2;
- return 'rotate(-90)translate(' + y + ',' + x + ')';
- });
+
// fix text
var yFontSize = Math.min(boxHeight, font_size);
this.gyAxis.selectAll('text')
- .style(this.options.font_style)
+ .style(this.options.style)
.style({'font-size': yFontSize + 'px'})
.attr('y', -boxHeight/2);
// set background color
- var gBackgroundBottom = svg.append('rect')
- .attr('width', width)
- .attr('height', font_size + 3)
- .attr('y', height + margin.bottom - font_size - 3)
- .attr('fill', this.options.debug_color);
-
- // axis label
- this.gxLabel = svg.append('text')
- .attr('class', 'x label')
- .style(this.options.font_style)
- .text(this.chart.settings.get('x_axis_label'))
- .attr('transform', function(d) {
- var y = height + margin.bottom - font_size/3;
- var x = (width - this.getBBox().width)/2;
- return 'translate(' + x + ',' + y + ')';
- });
-
- // set background color
- var gBackgroundLeft = svg.append('rect')
+ var gyAxisLabelBackground = svg.append('rect')
.attr('width', font_size)
.attr('height', height)
.attr('x', -margin.left)
.attr('fill', this.options.debug_color);
-
+
// axis label
- this.gyLabel = svg.append('text')
+ this.gyAxisLabel = svg.append('text')
.attr('class', 'y label')
- .style(this.options.font_style)
+ .style(this.options.style)
.text(this.chart.settings.get('y_axis_label'))
.attr('transform', function(d) {
var x = -margin.left + font_size-2;
var y = -(height + this.getBBox().width)/2;
return 'rotate(-90)translate(' + y + ',' + x + ')';
});
-
- // chart title
- this.gxLabel = svg.append('text')
- .attr('class', 'title')
- .style(this.options.font_style)
- .style({'font-size' : 1.5*font_size})
- .text(this.chart.get('title'))
- .attr('transform', function(d) {
- var y = -margin.top/2;
- var x = (width - this.getBBox().width)/2;
- return 'translate(' + x + ',' + y + ')';
+ },
+
+ // legend
+ _buildLegend : function() {
+ // link this
+ var self = this;
+
+ // collect parameters
+ var height = this.height;
+ var width = this.width;
+ var margin = this.options.margin;
+ var font_size = this.options.legend.style['font-size'];
+ var limit = this.options.legend.limit;
+
+ // identify legend dimensions
+ var legendSize = this.options.legend.size;
+ var legendWidth = this.options.legend.width;
+ var legendElements = this.zScale.range().length;
+ var legendElementHeight = legendSize * height / legendElements;
+ var legendHeight = legendElements * legendElementHeight;
+
+ // create legend elements
+ var legend = this.svg.selectAll('.legend')
+ .data(d3.range(this.zMin, this.zMax, (this.zMax-this.zMin) / legendElements).reverse())
+ .enter().append('g')
+ .attr('class', 'legend')
+ .attr('transform', function(d, i) {
+ var x = width + 10;
+ var y = ((height - legendHeight) / 2) + (i * legendElementHeight);
+ return 'translate(' + x + ',' + y + ')';
+ });
+
+ legend.append('rect')
+ .attr('width', legendWidth)
+ .attr('height', legendElementHeight)
+ .style('fill', function(z) {
+ return self.zScale(z);
+ });
+
+ legend.append('text')
+ .attr('x', legendWidth + 4)
+ .attr('y', function() {
+ return (legendElementHeight+this.getBBox().height)/2;
+ })
+ .style(this.options.legend.style)
+ .text(function(d) {
+ var str = String(d);
+ if (str.length > limit) {
+ return str.substr(0, limit-2) + '..';
+ } else {
+ return str;
+ }
});
},
diff -r 37f1d93ae873cc65f2c9b731e16609f3c9bc3a99 -r 972549a5f857b22ae7acd130b915523647b05422 config/plugins/visualizations/charts/static/library/screenshot.js
--- a/config/plugins/visualizations/charts/static/library/screenshot.js
+++ b/config/plugins/visualizations/charts/static/library/screenshot.js
@@ -68,7 +68,7 @@
// show input fields
$svg.find('.highcharts-button').show();
});
-
+
// do the post
_post($el, screenshot_url, {
filename : name || 'chart',
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: nsoranzo: Add job_metrics_conf.xml to .hgignore
by commits-noreply@bitbucket.org 14 Jun '14
by commits-noreply@bitbucket.org 14 Jun '14
14 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/37f1d93ae873/
Changeset: 37f1d93ae873
User: nsoranzo
Date: 2014-06-14 17:44:07
Summary: Add job_metrics_conf.xml to .hgignore
Affected #: 1 file
diff -r 5b5eee5079a557b332527f6e9beda02c29dd2ecd -r 37f1d93ae873cc65f2c9b731e16609f3c9bc3a99 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -62,6 +62,7 @@
data_manager_conf.xml
shed_data_manager_conf.xml
object_store_conf.xml
+job_metrics_conf.xml
config/*
static/welcome.html.*
static/welcome.html
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Heatmaps add title and axis labels
by commits-noreply@bitbucket.org 14 Jun '14
by commits-noreply@bitbucket.org 14 Jun '14
14 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5b5eee5079a5/
Changeset: 5b5eee5079a5
User: guerler
Date: 2014-06-14 12:51:59
Summary: Charts: Heatmaps add title and axis labels
Affected #: 2 files
diff -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 -r 5b5eee5079a557b332527f6e9beda02c29dd2ecd config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
@@ -3,7 +3,7 @@
return $.extend(true, {}, config_default, {
title : 'Heatmap',
category : 'Others',
- query_limit : 1000,
+ query_limit : 2000,
library : 'Custom',
tag : 'div',
keywords : 'small',
diff -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 -r 5b5eee5079a557b332527f6e9beda02c29dd2ecd config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
@@ -1,12 +1,27 @@
// dependencies
-define(['plugin/charts/tools'], function(Tools) {
+define(['plugin/charts/tools', 'utils/utils'], function(Tools, Utils) {
// widget
return Backbone.View.extend({
+
+ // options
+ optionsDefault: {
+ font_size : 12,
+ font_family : 'Verdana',
+ font_style : {
+ 'font-weight' : 'normal',
+ 'font-family' : 'Verdana'
+ },
+ background_color : '#FFFFF8',
+ debug_color : '#FFFFFF',
+ color_set : ['#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58']
+ },
+
// initialize
initialize: function(app, options) {
this.app = app;
this.chart = options.chart;
+ this.options = Utils.merge (this.optionsDefault, options);
},
// render
@@ -17,26 +32,22 @@
// collect parameters
this.canvas_id = canvas_id;
this.data = groups[0].values;
- this.color_set = ['#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58'];
-
- // get limits
- this.zMax = d3.max(this.data, function(d) { return d.z; });
//
// domains/scales
//
this.xScale = d3.scale.linear().domain([0, this.categories.array.x.length]);
this.yScale = d3.scale.linear().domain([0, this.categories.array.y.length]);
- this.zScale = d3.scale.ordinal().domain([0, this.zMax]);
+
+ // color scale
+ this.zMax = d3.max(this.data, function(d) { return d.z; });
+ this.zScale = d3.scale.quantize().domain([0, this.zMax]);
+ this.zScale.range(this.options.color_set);
// create axis
this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
this.yAxis = d3.svg.axis().scale(this.yScale).orient('left');
- // set ticks
- this.xAxis.tickValues(d3.range(this.xScale.domain()[0], this.xScale.domain()[1], 1));
- this.yAxis.tickValues(d3.range(this.yScale.domain()[0], this.yScale.domain()[1], 1));
-
// make categories
this._makeTickFormat('x');
this._makeTickFormat('y');
@@ -67,31 +78,44 @@
// get parameters
var chart = this.chart;
var data = this.data;
- var color_set = this.color_set;
var self = this;
// get/reset container
var container = $('#' + this.canvas_id);
container.empty();
+ // get domain
+ var xDomain = this.xScale.domain();
+ var yDomain = this.yScale.domain();
+
+ // set ticks
+ var xTickStart = Math.ceil(xDomain[0]);
+ var xTickEnd = Math.floor(xDomain[1]);
+ var yTickStart = Math.ceil(yDomain[0]);
+ var yTickEnd = Math.floor(yDomain[1]);
+ this.xAxis.tickValues(d3.range(xTickStart, xTickEnd, 1));
+ this.yAxis.tickValues(d3.range(yTickStart, yTickEnd, 1));
+
// set margin and heights
- var margin = {top: 20, right: 90, bottom: 90, left: 100},
+ var margin = {top: 40, right: 20, bottom: 70, left: 70},
width = parseInt(container.width()) - margin.left - margin.right,
height = parseInt(container.height()) - margin.top - margin.bottom;
+ // default font size
+ var font_size = this.options.font_size;
+
//
// set range
//
this.xScale.range([0, width]);
this.yScale.range([height, 0]);
- this.zScale.range(color_set);
//
// draw boxes
//
// get box properties
- var rowCount = this.yScale.domain()[1] - this.yScale.domain()[0],
- colCount = this.xScale.domain()[1] - this.xScale.domain()[0],
+ var rowCount = yDomain[1] - yDomain[0],
+ colCount = xDomain[1] - xDomain[0],
boxWidth = Math.max(1, Math.floor(width / colCount)),
boxHeight = Math.max(1, Math.floor(height / rowCount));
@@ -117,10 +141,10 @@
.attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
// set background color
- var background = svg.append('rect')
+ var gBackground = svg.append('rect')
.attr('width', width)
.attr('height', height)
- .attr('fill', '#FFFFF8');
+ .attr('fill', this.options.background_color);
// clip path
var clip = svg.append('clipPath')
@@ -159,7 +183,7 @@
.style('stroke-width', 1)
.attr('transform', 'translate(0,' + height + ')')
.call(this.xAxis);
-
+
// draw y axis
this.gyAxis = svg.append('g')
.attr('class', 'y axis')
@@ -167,8 +191,9 @@
.call(this.yAxis);
// fix text
- var xFontSize = Math.min(boxWidth, 12);
+ var xFontSize = Math.min(boxWidth, font_size);
this.gxAxis.selectAll('text')
+ .style(this.options.font_style)
.style({'font-size': xFontSize + 'px'})
.attr('transform', function(d) {
var y = -this.getBBox().height - 10;
@@ -177,10 +202,59 @@
});
// fix text
- var yFontSize = Math.min(boxHeight, 12);
+ var yFontSize = Math.min(boxHeight, font_size);
this.gyAxis.selectAll('text')
+ .style(this.options.font_style)
.style({'font-size': yFontSize + 'px'})
.attr('y', -boxHeight/2);
+
+ // set background color
+ var gBackgroundBottom = svg.append('rect')
+ .attr('width', width)
+ .attr('height', font_size + 3)
+ .attr('y', height + margin.bottom - font_size - 3)
+ .attr('fill', this.options.debug_color);
+
+ // axis label
+ this.gxLabel = svg.append('text')
+ .attr('class', 'x label')
+ .style(this.options.font_style)
+ .text(this.chart.settings.get('x_axis_label'))
+ .attr('transform', function(d) {
+ var y = height + margin.bottom - font_size/3;
+ var x = (width - this.getBBox().width)/2;
+ return 'translate(' + x + ',' + y + ')';
+ });
+
+ // set background color
+ var gBackgroundLeft = svg.append('rect')
+ .attr('width', font_size)
+ .attr('height', height)
+ .attr('x', -margin.left)
+ .attr('fill', this.options.debug_color);
+
+ // axis label
+ this.gyLabel = svg.append('text')
+ .attr('class', 'y label')
+ .style(this.options.font_style)
+ .text(this.chart.settings.get('y_axis_label'))
+ .attr('transform', function(d) {
+ var x = -margin.left + font_size-2;
+ var y = -(height + this.getBBox().width)/2;
+ return 'rotate(-90)translate(' + y + ',' + x + ')';
+ });
+
+ // chart title
+ this.gxLabel = svg.append('text')
+ .attr('class', 'title')
+ .style(this.options.font_style)
+ .style({'font-size' : 1.5*font_size})
+ .text(this.chart.get('title'))
+ .attr('transform', function(d) {
+ var y = -margin.top/2;
+ var x = (width - this.getBBox().width)/2;
+ return 'translate(' + x + ',' + y + ')';
+ });
},
// create axes formatting
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Add clustered heatmap
by commits-noreply@bitbucket.org 14 Jun '14
by commits-noreply@bitbucket.org 14 Jun '14
14 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4efe7fa1e748/
Changeset: 4efe7fa1e748
User: guerler
Date: 2014-06-14 10:15:45
Summary: Charts: Add clustered heatmap
Affected #: 8 files
diff -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
@@ -1,12 +1,13 @@
define(['plugin/charts/forms/default'], function(config_default) {
return $.extend(true, {}, config_default, {
- title : 'Heat map',
+ title : 'Heatmap',
category : 'Others',
- query_limit : 1,
+ query_limit : 1000,
library : 'Custom',
tag : 'div',
keywords : 'small',
+ zoomable : true,
columns : {
x : {
title : 'Column labels',
diff -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/heatmap-plugin.js
@@ -0,0 +1,210 @@
+// dependencies
+define(['plugin/charts/tools'], function(Tools) {
+
+// widget
+return Backbone.View.extend({
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.chart = options.chart;
+ },
+
+ // render
+ render : function(canvas_id, groups) {
+ // categories
+ this.categories = Tools.makeUniqueCategories(groups);
+
+ // collect parameters
+ this.canvas_id = canvas_id;
+ this.data = groups[0].values;
+ this.color_set = ['#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58'];
+
+ // get limits
+ this.zMax = d3.max(this.data, function(d) { return d.z; });
+
+ //
+ // domains/scales
+ //
+ this.xScale = d3.scale.linear().domain([0, this.categories.array.x.length]);
+ this.yScale = d3.scale.linear().domain([0, this.categories.array.y.length]);
+ this.zScale = d3.scale.ordinal().domain([0, this.zMax]);
+
+ // create axis
+ this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
+ this.yAxis = d3.svg.axis().scale(this.yScale).orient('left');
+
+ // set ticks
+ this.xAxis.tickValues(d3.range(this.xScale.domain()[0], this.xScale.domain()[1], 1));
+ this.yAxis.tickValues(d3.range(this.yScale.domain()[0], this.yScale.domain()[1], 1));
+
+ // make categories
+ this._makeTickFormat('x');
+ this._makeTickFormat('y');
+
+ // refresh on window resize
+ var self = this;
+ $(window).on('resize', function () {
+ self.redraw();
+ });
+
+ // draw
+ this.redraw();
+
+ // add zoom
+ Tools.addZoom({
+ xAxis : this.xAxis,
+ yAxis : this.yAxis,
+ redraw : function() { self.redraw() },
+ svg : d3.select('#' + this.canvas_id)
+ });
+
+ // return
+ return true;
+ },
+
+ // redraw
+ redraw: function() {
+ // get parameters
+ var chart = this.chart;
+ var data = this.data;
+ var color_set = this.color_set;
+ var self = this;
+
+ // get/reset container
+ var container = $('#' + this.canvas_id);
+ container.empty();
+
+ // set margin and heights
+ var margin = {top: 20, right: 90, bottom: 90, left: 100},
+ width = parseInt(container.width()) - margin.left - margin.right,
+ height = parseInt(container.height()) - margin.top - margin.bottom;
+
+ //
+ // set range
+ //
+ this.xScale.range([0, width]);
+ this.yScale.range([height, 0]);
+ this.zScale.range(color_set);
+
+ //
+ // draw boxes
+ //
+ // get box properties
+ var rowCount = this.yScale.domain()[1] - this.yScale.domain()[0],
+ colCount = this.xScale.domain()[1] - this.xScale.domain()[0],
+ boxWidth = Math.max(1, Math.floor(width / colCount)),
+ boxHeight = Math.max(1, Math.floor(height / rowCount));
+
+ // box location
+ function _locator(d) {
+ return 'translate(' + self.xScale(d.x) + ',' + self.yScale(d.y+1) + ')';
+ };
+
+ // box color
+ function _color (d) {
+ return self.zScale(d.z);
+ };
+
+ //
+ // create svg
+ //
+ var svg = d3.select('#' + this.canvas_id)
+ .append('svg')
+ .attr('width', width + margin.left + margin.right)
+ .attr('height', height + margin.top + margin.bottom)
+ .append('g')
+ .attr('class', 'heatmap')
+ .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
+
+ // set background color
+ var background = svg.append('rect')
+ .attr('width', width)
+ .attr('height', height)
+ .attr('fill', '#FFFFF8');
+
+ // clip path
+ var clip = svg.append('clipPath')
+ .attr('id', 'clip')
+ .append('rect')
+ .attr('x', 0)
+ .attr('y', 0)
+ .attr('width', width)
+ .attr('height', height);
+
+ // create chart area
+ var chartBody = svg.append('g')
+ .attr('clip-path', 'url(#clip)');
+
+ // add boxes to chart area
+ var boxes = chartBody.selectAll('g.box-group').data(data, function(d, i) {
+ return d.x + '\0' + d.y;
+ });
+ var gEnter = boxes.enter().append('g')
+ .attr('class', 'box-group');
+ gEnter.append('rect')
+ .attr('class','heat-box')
+ .attr('fill', 'red');
+ boxes.selectAll('rect')
+ .attr('rx', 1)
+ .attr('ry', 1)
+ .attr('fill', _color)
+ .attr('width', boxWidth)
+ .attr('height', boxHeight)
+ .attr('transform', _locator);
+ boxes.exit().remove();
+
+ // draw x axis
+ this.gxAxis = svg.append('g')
+ .attr('class', 'x axis')
+ .style('stroke-width', 1)
+ .attr('transform', 'translate(0,' + height + ')')
+ .call(this.xAxis);
+
+ // draw y axis
+ this.gyAxis = svg.append('g')
+ .attr('class', 'y axis')
+ .style('stroke-width', 1)
+ .call(this.yAxis);
+
+ // fix text
+ var xFontSize = Math.min(boxWidth, 12);
+ this.gxAxis.selectAll('text')
+ .style({'font-size': xFontSize + 'px'})
+ .attr('transform', function(d) {
+ var y = -this.getBBox().height - 10;
+ var x = -xFontSize + boxWidth/2;
+ return 'rotate(-90)translate(' + y + ',' + x + ')';
+ });
+
+ // fix text
+ var yFontSize = Math.min(boxHeight, 12);
+ this.gyAxis.selectAll('text')
+ .style({'font-size': yFontSize + 'px'})
+ .attr('y', -boxHeight/2);
+ },
+
+ // create axes formatting
+ _makeTickFormat: function(id) {
+ var settings = this.chart.settings;
+ var self = this;
+ Tools.makeTickFormat({
+ categories : self.categories.array[id],
+ type : settings.get(id + '_axis_type'),
+ precision : settings.get(id + '_axis_precision'),
+ formatter : function(formatter) {
+ if (formatter) {
+ self[id + 'Axis'].tickFormat(function(value) {
+ return formatter(value);
+ });
+ }
+ }
+ });
+ },
+
+ // handle error
+ _handleError: function(err) {
+ this.chart.state('failed', err);
+ }
+});
+
+});
\ No newline at end of file
diff -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
@@ -1,5 +1,5 @@
// dependencies
-define(['plugin/charts/tools'], function(Tools) {
+define(['plugin/charts/tools', 'plugin/charts/others/heatmap/heatmap-plugin'], function(Tools, HeatMap) {
// widget
return Backbone.View.extend({
@@ -14,6 +14,9 @@
// backup chart
this.chart = chart;
+ // create heatmap
+ this.heatmap = new HeatMap(app, { chart : chart });
+
// distribute data groups on svgs and handle process
var self = this;
var plot = Tools.panelHelper({
@@ -23,201 +26,9 @@
chart : chart,
request_dictionary : request_dictionary,
render : function(canvas_id, groups) {
- return self.render(canvas_id, groups)
+ return self.heatmap.render(canvas_id, groups)
}
});
- },
-
- // render
- render : function(canvas_id, groups) {
- // categories
- this.categories = Tools.makeUniqueCategories(groups);
-
- // collect parameters
- this.canvas_id = canvas_id;
- this.data = groups[0].values;
- this.color_set = ['#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58'];
-
- // get limits
- this.xMax = d3.max(this.data, function(d) { return d.x; });
- this.yMax = d3.max(this.data, function(d) { return d.y; });
- this.zMax = d3.max(this.data, function(d) { return d.z; });
-
- //
- // domains/scales
- //
- this.xScale = d3.scale.linear().domain([0, this.xMax]);
- this.yScale = d3.scale.linear().domain([0, this.yMax]);
- this.zScale = d3.scale.ordinal().domain([0, this.zMax]);
-
- // create axis
- this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
- this.yAxis = d3.svg.axis().scale(this.yScale).orient('left');
-
- // set ticks
- this.xAxis.tickValues(d3.range(this.xScale.domain()[0], this.xScale.domain()[1], 1));
- this.yAxis.tickValues(d3.range(this.yScale.domain()[0], this.yScale.domain()[1], 1));
-
- // make categories
- this._makeTickFormat('x');
- this._makeTickFormat('y');
-
- // refresh on window resize
- var self = this;
- $(window).on('resize', function () {
- self.redraw();
- });
-
- // draw
- this.redraw();
-
- // add zoom
- Tools.addZoom({
- xAxis : this.xAxis,
- yAxis : this.yAxis,
- redraw : function() { self.redraw() },
- svg : d3.select('#' + this.canvas_id),
- discrete : true
- });
-
- // return
- return true;
- },
-
- // redraw
- redraw: function() {
- // get parameters
- var chart = this.options.chart;
- var type = this.options.type;
- var data = this.data;
- var color_set = this.color_set;
- var self = this;
-
- // get/reset container
- var container = $('#' + this.canvas_id);
- container.empty();
-
- // set margin and heights
- var margin = {top: 20, right: 90, bottom: 90, left: 100},
- width = parseInt(container.width()) - margin.left - margin.right,
- height = parseInt(container.height()) - margin.top - margin.bottom;
-
- //
- // set range
- //
- this.xScale.range([0, width]);
- this.yScale.range([height, 0]);
- this.zScale.range(color_set);
-
- //
- // draw boxes
- //
- // get box properties
- var rowCount = this.yScale.domain()[1] - this.yScale.domain()[0],
- colCount = this.xScale.domain()[1] - this.xScale.domain()[0],
- boxWidth = Math.max(1, Math.floor(width / colCount)),
- boxHeight = Math.max(1, Math.floor(height / rowCount));
-
- // box location
- function _locator(d) {
- return 'translate(' + self.xScale(d.x) + ',' + self.yScale(d.y) + ')';
- };
-
- // box color
- function _color (d) {
- return self.zScale(d.z);
- };
-
- //
- // create svg
- //
- var svg = d3.select('#' + this.canvas_id)
- .append('svg')
- .attr('width', width + margin.left + margin.right)
- .attr('height', height + margin.top + margin.bottom)
- .append('g')
- .attr('class', 'heatmap')
- .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
-
- // clip path
- var clip = svg.append('clipPath')
- .attr('id', 'clip')
- .append('rect')
- .attr('x', 0)
- .attr('y', boxHeight)
- .attr('width', width)
- .attr('height', height);
-
- // create chart area
- var chartBody = svg.append('g')
- .attr('clip-path', 'url(#clip)');
-
- // add boxes to chart area
- var boxes = chartBody.selectAll('g.box-group').data(data, function(d, i) {
- return d.x + '\0' + d.y;
- });
- var gEnter = boxes.enter().append('g')
- .attr('class', 'box-group');
- gEnter.append('rect')
- .attr('class','heat-box')
- .attr('fill', 'red');
- boxes.selectAll('rect')
- .attr('rx', 2)
- .attr('ry', 2)
- .attr('fill', _color)
- .attr('width', boxWidth)
- .attr('height', boxHeight)
- .attr('transform', _locator);
- boxes.exit().remove();
-
- // draw x axis
- this.gxAxis = svg.append('g')
- .attr('class', 'x axis')
- .style('stroke-width', 0)
- .attr('transform', 'translate(0,' + (height + margin.top + boxHeight) + ')')
- .call(this.xAxis);
-
- // draw y axis
- this.gyAxis = svg.append('g')
- .attr('class', 'y axis')
- .style('stroke-width', 0)
- .call(this.yAxis);
-
- // fix text
- var xFontSize = Math.min(boxWidth, 12);
- this.gxAxis.selectAll('text')
- .style({'font-family': 'Courier New', 'font-size': xFontSize + 'px'})
- .attr('transform', 'rotate(-90)')
- .attr('y', (boxWidth-xFontSize)/2);
-
- // fix text
- var yFontSize = Math.min(boxHeight, 12);
- this.gyAxis.selectAll('text')
- .style({'font-family': 'Courier New', 'font-size': yFontSize + 'px'})
- .attr('y', -boxHeight/2 + boxHeight);
- },
-
- // create axes formatting
- _makeTickFormat: function(id) {
- var settings = this.chart.settings;
- var self = this;
- Tools.makeTickFormat({
- categories : self.categories.array[id],
- type : settings.get(id + '_axis_type'),
- precision : settings.get(id + '_axis_precision'),
- formatter : function(formatter) {
- if (formatter) {
- self[id + 'Axis'].tickFormat(function(value) {
- return formatter(value);
- });
- }
- }
- });
- },
-
- // handle error
- _handleError: function(chart, err) {
- chart.state('failed', err);
}
});
diff -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/config.js
@@ -0,0 +1,9 @@
+define(['plugin/charts/others/heatmap/config'], function(config_default) {
+
+return $.extend(true, {}, config_default, {
+ title : 'Clustered Heatmap',
+ category : 'Data processing (requires \'charts\' tool from Toolshed)',
+ execute : 'heatmap'
+});
+
+});
\ No newline at end of file
diff -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/logo.png
Binary file config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/logo.png has changed
diff -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap_cluster/wrapper.js
@@ -0,0 +1,37 @@
+// dependencies
+define(['plugin/charts/tools', 'plugin/charts/others/heatmap/heatmap-plugin'], function(Tools, HeatMap) {
+
+// widget
+return Backbone.View.extend({
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary) {
+ // backup chart
+ this.chart = chart;
+
+ // create heatmap
+ this.heatmap = new HeatMap(app, {
+ chart : chart
+ });
+
+ // distribute data groups on svgs and handle process
+ var self = this;
+ var plot = Tools.panelHelper({
+ app : this.app,
+ canvas_list : this.options.canvas_list,
+ process_id : process_id,
+ chart : chart,
+ request_dictionary : request_dictionary,
+ render : function(canvas_id, groups) {
+ return self.heatmap.render(canvas_id, groups)
+ }
+ });
+ }
+});
+
+});
\ No newline at end of file
diff -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 config/plugins/visualizations/charts/static/charts/tools.js
--- a/config/plugins/visualizations/charts/static/charts/tools.js
+++ b/config/plugins/visualizations/charts/static/charts/tools.js
@@ -297,7 +297,7 @@
// add zoom handler
function addZoom(options) {
// scaleExtent
- var scaleExtent = 10;
+ var scaleExtent = 100;
// parameters
var yAxis = options.yAxis;
@@ -306,7 +306,6 @@
var yDomain = options.yDomain || yAxis.scale().domain;
var redraw = options.redraw;
var svg = options.svg;
- var discrete = options.discrete;
// scales
var xScale = xAxis.scale();
@@ -325,10 +324,6 @@
// fix domain
function fixDomain(domain, boundary) {
- if (discrete) {
- domain[0] = Math.floor(domain[0]);
- domain[1] = Math.ceil(domain[1]);
- }
domain[0] = Math.min(Math.max(domain[0], boundary[0]), boundary[1] - boundary[1]/scaleExtent);
domain[1] = Math.max(boundary[0] + boundary[1]/scaleExtent, Math.min(domain[1], boundary[1]));
return domain;
diff -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 -r 4efe7fa1e748801a2a7fd86faf100e4070f29388 config/plugins/visualizations/charts/static/charts/types.js
--- a/config/plugins/visualizations/charts/static/charts/types.js
+++ b/config/plugins/visualizations/charts/static/charts/types.js
@@ -16,7 +16,8 @@
'plugin/charts/jqplot/line/config',
'plugin/charts/jqplot/scatter/config',
'plugin/charts/jqplot/boxplot/config',
- 'plugin/charts/others/heatmap/config'
+ 'plugin/charts/others/heatmap/config',
+ 'plugin/charts/others/heatmap_cluster/config'
], function(nvd3_bar,
nvd3_bar_stacked,
nvd3_bar_horizontal,
@@ -34,7 +35,8 @@
jqplot_line,
jqplot_scatter,
jqplot_boxplot,
- others_heatmap
+ others_heatmap,
+ others_heatmap_cluster
) {
// widget
@@ -59,7 +61,8 @@
'jqplot_line' : jqplot_line,
'jqplot_scatter' : jqplot_scatter,
'jqplot_boxplot' : jqplot_boxplot,
- 'others_heatmap' : others_heatmap
+ 'others_heatmap' : others_heatmap,
+ 'others_heatmap_cluster' : others_heatmap_cluster
}
});
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Add tick formatting
by commits-noreply@bitbucket.org 14 Jun '14
by commits-noreply@bitbucket.org 14 Jun '14
14 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d408a47ca329/
Changeset: d408a47ca329
User: guerler
Date: 2014-06-14 07:42:52
Summary: Charts: Add tick formatting
Affected #: 4 files
diff -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
@@ -113,8 +113,8 @@
var categories = Tools.makeCategories(groups);
// make axes
- function makeAxis (id) {
- Tools.makeAxis({
+ function makeTickFormat (id) {
+ Tools.makeTickFormat({
categories : categories.array[id],
type : settings.get(id + '_axis_type'),
precision : settings.get(id + '_axis_precision'),
@@ -127,8 +127,8 @@
}
});
};
- makeAxis('x');
- makeAxis('y');
+ makeTickFormat('x');
+ makeTickFormat('y');
},
// handle error
diff -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
@@ -11,6 +11,10 @@
// render
draw : function(process_id, chart, request_dictionary) {
+ // backup chart
+ this.chart = chart;
+
+ // distribute data groups on svgs and handle process
var self = this;
var plot = Tools.panelHelper({
app : this.app,
@@ -26,14 +30,14 @@
// render
render : function(canvas_id, groups) {
+ // categories
+ this.categories = Tools.makeUniqueCategories(groups);
+
// collect parameters
this.canvas_id = canvas_id;
this.data = groups[0].values;
this.color_set = ['#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58'];
- // result
- var categories = Tools.makeUniqueCategories(groups);
-
// get limits
this.xMax = d3.max(this.data, function(d) { return d.x; });
this.yMax = d3.max(this.data, function(d) { return d.y; });
@@ -45,7 +49,19 @@
this.xScale = d3.scale.linear().domain([0, this.xMax]);
this.yScale = d3.scale.linear().domain([0, this.yMax]);
this.zScale = d3.scale.ordinal().domain([0, this.zMax]);
-
+
+ // create axis
+ this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
+ this.yAxis = d3.svg.axis().scale(this.yScale).orient('left');
+
+ // set ticks
+ this.xAxis.tickValues(d3.range(this.xScale.domain()[0], this.xScale.domain()[1], 1));
+ this.yAxis.tickValues(d3.range(this.yScale.domain()[0], this.yScale.domain()[1], 1));
+
+ // make categories
+ this._makeTickFormat('x');
+ this._makeTickFormat('y');
+
// refresh on window resize
var self = this;
$(window).on('resize', function () {
@@ -87,35 +103,20 @@
height = parseInt(container.height()) - margin.top - margin.bottom;
//
- // create svg
- //
- var svg = d3.select('#' + this.canvas_id)
- .append('svg')
- .attr('width', width + margin.left + margin.right)
- .attr('height', height + margin.top + margin.bottom)
- .append('g')
- .attr('class', 'heatmap')
- .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
-
- //
// set range
//
this.xScale.range([0, width]);
this.yScale.range([height, 0]);
this.zScale.range(color_set);
- // get domain
- var xDomain = this.xScale.domain();
- var yDomain = this.yScale.domain();
-
//
// draw boxes
//
// get box properties
var rowCount = this.yScale.domain()[1] - this.yScale.domain()[0],
colCount = this.xScale.domain()[1] - this.xScale.domain()[0],
- boxWidth = Math.max(1, Math.min(Math.floor(width / colCount), 20)),
- boxHeight = Math.max(1, Math.min(Math.floor(height / rowCount), 20));
+ boxWidth = Math.max(1, Math.floor(width / colCount)),
+ boxHeight = Math.max(1, Math.floor(height / rowCount));
// box location
function _locator(d) {
@@ -127,6 +128,17 @@
return self.zScale(d.z);
};
+ //
+ // create svg
+ //
+ var svg = d3.select('#' + this.canvas_id)
+ .append('svg')
+ .attr('width', width + margin.left + margin.right)
+ .attr('height', height + margin.top + margin.bottom)
+ .append('g')
+ .attr('class', 'heatmap')
+ .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
+
// clip path
var clip = svg.append('clipPath')
.attr('id', 'clip')
@@ -159,8 +171,6 @@
boxes.exit().remove();
// draw x axis
- this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
- this.xAxis.tickValues(d3.range(xDomain[0], xDomain[1], 1));
this.gxAxis = svg.append('g')
.attr('class', 'x axis')
.style('stroke-width', 0)
@@ -168,8 +178,6 @@
.call(this.xAxis);
// draw y axis
- this.yAxis = d3.svg.axis().scale(this.yScale).orient('left');
- this.yAxis.tickValues(d3.range(yDomain[0], yDomain[1], 1));
this.gyAxis = svg.append('g')
.attr('class', 'y axis')
.style('stroke-width', 0)
@@ -190,24 +198,21 @@
},
// create axes formatting
- _makeAxes: function(d3chart, settings) {
- // make axes
- function makeAxis (id) {
- Tools.makeAxis({
- categories : categories.array[id],
- type : settings.get(id + '_axis_type'),
- precision : settings.get(id + '_axis_precision'),
- formatter : function(formatter) {
- if (formatter) {
- d3chart[id + 'Axis']().tickFormat(function(value) {
- return formatter(value);
- });
- }
+ _makeTickFormat: function(id) {
+ var settings = this.chart.settings;
+ var self = this;
+ Tools.makeTickFormat({
+ categories : self.categories.array[id],
+ type : settings.get(id + '_axis_type'),
+ precision : settings.get(id + '_axis_precision'),
+ formatter : function(formatter) {
+ if (formatter) {
+ self[id + 'Axis'].tickFormat(function(value) {
+ return formatter(value);
+ });
}
- });
- };
- makeAxis('x');
- makeAxis('y');
+ }
+ });
},
// handle error
diff -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 config/plugins/visualizations/charts/static/charts/tools.js
--- a/config/plugins/visualizations/charts/static/charts/tools.js
+++ b/config/plugins/visualizations/charts/static/charts/tools.js
@@ -248,7 +248,7 @@
};
// make axis
-function makeAxis (options) {
+function makeTickFormat (options) {
var type = options.type;
var precision = options.precision;
var categories = options.categories;
@@ -296,6 +296,9 @@
// add zoom handler
function addZoom(options) {
+ // scaleExtent
+ var scaleExtent = 10;
+
// parameters
var yAxis = options.yAxis;
var xAxis = options.xAxis;
@@ -323,11 +326,11 @@
// fix domain
function fixDomain(domain, boundary) {
if (discrete) {
- domain[0] = parseInt(domain[0]);
- domain[1] = parseInt(domain[1]);
+ domain[0] = Math.floor(domain[0]);
+ domain[1] = Math.ceil(domain[1]);
}
- domain[0] = Math.max(domain[0], boundary[0]);
- domain[1] = Math.max(0, Math.min(domain[1], boundary[1]));
+ domain[0] = Math.min(Math.max(domain[0], boundary[0]), boundary[1] - boundary[1]/scaleExtent);
+ domain[1] = Math.max(boundary[0] + boundary[1]/scaleExtent, Math.min(domain[1], boundary[1]));
return domain;
};
@@ -350,7 +353,7 @@
// initialize wrapper
d3zoom.x(xScale)
.y(yScale)
- .scaleExtent([1, 10])
+ .scaleExtent([1, scaleExtent])
.on('zoom', zoomed);
// add handler
@@ -365,7 +368,7 @@
makeSeries : makeSeries,
getDomains : getDomains,
mapCategories : mapCategories,
- makeAxis : makeAxis,
+ makeTickFormat : makeTickFormat,
addZoom : addZoom
}
diff -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 -r d408a47ca3292a13ef58e435ee06e81ac04a04a5 config/plugins/visualizations/charts/static/views/group.js
--- a/config/plugins/visualizations/charts/static/views/group.js
+++ b/config/plugins/visualizations/charts/static/views/group.js
@@ -193,7 +193,7 @@
}
// set initial value
- if (is_unique) {
+ if (is_unique && this.chart.groups.first()) {
select.value(this.chart.groups.first().get(id));
} else {
select.value(this.group.get(id));
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Unify d3 zoom handler
by commits-noreply@bitbucket.org 14 Jun '14
by commits-noreply@bitbucket.org 14 Jun '14
14 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/287abf1a8263/
Changeset: 287abf1a8263
User: guerler
Date: 2014-06-14 06:25:38
Summary: Charts: Unify d3 zoom handler
Affected #: 7 files
diff -r 79ddd419dd50430978b753f4f0abf2564e02047a -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 config/plugins/visualizations/charts/static/charts/jqplot/common/plot-config.js
--- a/config/plugins/visualizations/charts/static/charts/jqplot/common/plot-config.js
+++ b/config/plugins/visualizations/charts/static/charts/jqplot/common/plot-config.js
@@ -8,18 +8,10 @@
var settings = chart.settings;
var plot_config = {
enablePlugins: true,
- seriesColors: function() {
- var colors = [];
- var colorScale = d3.scale.category20();
- for (var i = 0; i < chart.groups.length; i++) {
- colors.push(colorScale(i));
- }
- return colors;
- }(),
-
+ seriesColors: d3.scale.category20().range(),
seriesDefaults: {
renderer : $.jqplot.LineRenderer,
- //lineWidth : 1, // Width of the line in pixels.
+ //lineWidth : 1, // Width of the line in pixels.
shadow : false, // show shadow or not.
showLine : true, // whether to render the line segments or not.
diff -r 79ddd419dd50430978b753f4f0abf2564e02047a -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
@@ -80,9 +80,21 @@
.call(d3chart);
// add zoom/pan handler
- var zoom_mode = chart.definition.zoomable;
- if (zoom_mode == 'axis' || zoom_mode == 'svg') {
- self._addZoom(d3chart, canvas, zoom_mode);
+ if (chart.definition.zoomable) {
+ // clip edges
+ if (d3chart.clipEdge) {
+ d3chart.clipEdge(true);
+ }
+
+ // add zoom
+ Tools.addZoom({
+ xAxis : d3chart.xAxis,
+ yAxis : d3chart.yAxis,
+ yDomain: d3chart.yDomain,
+ xDomain: d3chart.xDomain,
+ redraw : function() { d3chart.update() },
+ svg : canvas
+ });
}
// refresh on window resize
@@ -95,84 +107,11 @@
return true;
},
- // add zoom handler
- _addZoom: function(nvd3_model, svg, zoom_mode) {
- // clip edges
- if (nvd3_model.clipEdge) {
- nvd3_model.clipEdge(true);
- }
-
- // get canvas dimensions
- var width = parseInt(svg.style('width'));
- var height = parseInt(svg.style('height'));
-
- // create x scales
- var x_domain = nvd3_model.xAxis.scale().domain();
- var x = d3.scale.linear()
- .domain(x_domain)
- .range([0, width]);
-
- // create y scale
- var y_domain = nvd3_model.yAxis.scale().domain();
- var y = d3.scale.linear()
- .domain(y_domain)
- .range([height, 0]);
-
- // min/max boundaries
- var x_boundary = nvd3_model.xScale().domain().slice();
- var y_boundary = nvd3_model.yScale().domain().slice();
-
- // create d3 zoom handler
- var d3zoom = d3.behavior.zoom();
-
- // fix domain
- function fixDomain(domain, boundary) {
- domain[0] = Math.max(domain[0], boundary[0]);
- domain[1] = Math.min(domain[1], boundary[1]);
- return domain;
- };
-
- // zoom event handler
- function zoomed() {
- if (zoom_mode == 'axis') {
- nvd3_model.xDomain(fixDomain(x.domain(), x_boundary));
- nvd3_model.yDomain(fixDomain(y.domain(), y_boundary));
- nvd3_model.update();
- } else {
- var translate = d3.event.translate;
- svg.select('.nvd3').attr("transform", "translate(" + translate + ") scale(" + d3.event.scale + ")");
- }
- };
-
- // zoom event handler
- function unzoomed() {
- if (zoom_mode == 'axis') {
- nvd3_model.xDomain(x_boundary);
- nvd3_model.yDomain(y_boundary);
- nvd3_model.update();
- d3zoom.scale(1);
- d3zoom.translate([0,0]);
- } else {
- var translate = d3.event.translate;
- svg.select('.nvd3').attr("transform", "translate([0,0]) scale(1)");
- }
- };
-
- // initialize wrapper
- d3zoom.x(x)
- .y(y)
- .scaleExtent([1, 10])
- .on("zoom", zoomed);
-
- // add handler
- svg.call(d3zoom).on("dblclick.zoom", unzoomed);
- },
-
// create axes formatting
_makeAxes: function(d3chart, groups, settings) {
// result
var categories = Tools.makeCategories(groups);
-
+
// make axes
function makeAxis (id) {
Tools.makeAxis({
diff -r 79ddd419dd50430978b753f4f0abf2564e02047a -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
@@ -2,9 +2,8 @@
return $.extend(true, {}, config_default, {
title : 'Heat map',
- //execute : 'heatmap',
category : 'Others',
- query_limit : 5,
+ query_limit : 1,
library : 'Custom',
tag : 'div',
keywords : 'small',
diff -r 79ddd419dd50430978b753f4f0abf2564e02047a -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
@@ -56,7 +56,13 @@
this.redraw();
// add zoom
- this._addZoom();
+ Tools.addZoom({
+ xAxis : this.xAxis,
+ yAxis : this.yAxis,
+ redraw : function() { self.redraw() },
+ svg : d3.select('#' + this.canvas_id),
+ discrete : true
+ });
// return
return true;
@@ -183,65 +189,6 @@
.attr('y', -boxHeight/2 + boxHeight);
},
- // add zoom handler
- _addZoom: function() {
- // link this
- var self = this;
-
- // min/max boundaries
- var x_boundary = this.xScale.domain().slice();
- var y_boundary = this.yScale.domain().slice();
-
- // create d3 zoom handler
- var d3zoom = d3.behavior.zoom();
-
- // fix domain
- function fixDomain(domain, boundary) {
- domain[0] = parseInt(domain[0]);
- domain[1] = parseInt(domain[1]);
- domain[0] = Math.max(domain[0], boundary[0]);
- domain[1] = Math.max(0, Math.min(domain[1], boundary[1]));
- return domain;
- };
-
- // zoom event handler
- function zoomed() {
- var yDomain = fixDomain(self.yScale.domain(), y_boundary);
- if (Math.abs(yDomain[1]-yDomain[0]) > 30) {
- self.yScale.domain(yDomain);
- self.gyAxis.call(self.yAxis);
- }
- var xDomain = fixDomain(self.xScale.domain(), x_boundary);
- if (Math.abs(xDomain[1]-xDomain[0]) > 30) {
- self.xScale.domain(xDomain);
- self.gxAxis.call(self.xAxis);
- }
- self.redraw();
- };
-
- // zoom event handler
- function unzoomed() {
- self.xScale.domain(x_boundary);
- self.yScale.domain(y_boundary);
- self.redraw();
- d3zoom.scale(1);
- d3zoom.translate([0,0]);
- };
-
- // initialize wrapper
- d3zoom.x(this.xScale)
- .y(this.yScale)
- .scaleExtent([1, 10])
- .on('zoom', zoomed);
-
- // clip edges
- //svg.clipEdge(true);
-
- // add handler
- var svg = d3.select('#' + this.canvas_id);
- svg.call(d3zoom).on('dblclick.zoom', unzoomed);
- },
-
// create axes formatting
_makeAxes: function(d3chart, settings) {
// make axes
@@ -259,8 +206,8 @@
}
});
};
- //makeAxis('x');
- //makeAxis('y');
+ makeAxis('x');
+ makeAxis('y');
},
// handle error
diff -r 79ddd419dd50430978b753f4f0abf2564e02047a -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 config/plugins/visualizations/charts/static/charts/tools.js
--- a/config/plugins/visualizations/charts/static/charts/tools.js
+++ b/config/plugins/visualizations/charts/static/charts/tools.js
@@ -293,7 +293,70 @@
}
}
};
+
+// add zoom handler
+function addZoom(options) {
+ // parameters
+ var yAxis = options.yAxis;
+ var xAxis = options.xAxis;
+ var xDomain = options.xDomain || xAxis.scale().domain;
+ var yDomain = options.yDomain || yAxis.scale().domain;
+ var redraw = options.redraw;
+ var svg = options.svg;
+ var discrete = options.discrete;
+
+ // scales
+ var xScale = xAxis.scale();
+ var yScale = yAxis.scale();
+
+ // min/max boundaries
+ var x_boundary = xScale.domain().slice();
+ var y_boundary = yScale.domain().slice();
+
+ // create d3 zoom handler
+ var d3zoom = d3.behavior.zoom();
+
+ // ensure nice axis
+ xScale.nice();
+ yScale.nice();
+ // fix domain
+ function fixDomain(domain, boundary) {
+ if (discrete) {
+ domain[0] = parseInt(domain[0]);
+ domain[1] = parseInt(domain[1]);
+ }
+ domain[0] = Math.max(domain[0], boundary[0]);
+ domain[1] = Math.max(0, Math.min(domain[1], boundary[1]));
+ return domain;
+ };
+
+ // zoom event handler
+ function zoomed() {
+ yDomain(fixDomain(yScale.domain(), y_boundary));
+ xDomain(fixDomain(xScale.domain(), x_boundary));
+ redraw();
+ };
+
+ // zoom event handler
+ function unzoomed() {
+ xDomain(x_boundary);
+ yDomain(y_boundary);
+ redraw();
+ d3zoom.scale(1);
+ d3zoom.translate([0,0]);
+ };
+
+ // initialize wrapper
+ d3zoom.x(xScale)
+ .y(yScale)
+ .scaleExtent([1, 10])
+ .on('zoom', zoomed);
+
+ // add handler
+ svg.call(d3zoom).on('dblclick.zoom', unzoomed);
+};
+
// return
return {
panelHelper : panelHelper,
@@ -302,7 +365,8 @@
makeSeries : makeSeries,
getDomains : getDomains,
mapCategories : mapCategories,
- makeAxis : makeAxis
+ makeAxis : makeAxis,
+ addZoom : addZoom
}
});
\ No newline at end of file
diff -r 79ddd419dd50430978b753f4f0abf2564e02047a -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 config/plugins/visualizations/charts/static/plugins/nvd3/nv.d3.js
--- a/config/plugins/visualizations/charts/static/plugins/nvd3/nv.d3.js
+++ b/config/plugins/visualizations/charts/static/plugins/nvd3/nv.d3.js
@@ -11174,8 +11174,8 @@
pointPaths.exit().remove();
pointPaths
.attr('d', function(d) {
- if (d.data.length === 0)
- return 'M 0 0'
+ if (!d || !d.data || d.data.length === 0)
+ return 'M 0 0';
else
return 'M' + d.data.join('L') + 'Z';
});
diff -r 79ddd419dd50430978b753f4f0abf2564e02047a -r 287abf1a826352fdbe1bd0702ad55c1bdaa93094 config/plugins/visualizations/charts/templates/charts.mako
--- a/config/plugins/visualizations/charts/templates/charts.mako
+++ b/config/plugins/visualizations/charts/templates/charts.mako
@@ -29,9 +29,6 @@
${h.javascript_link( app_root + "plugins/jqplot/jquery.jqplot.js" )}
${h.javascript_link( app_root + "plugins/jqplot/jquery.jqplot.plugins.js" )}
- ## dc
- ${h.javascript_link( app_root + "plugins/dc/crossfilter.js" )}
-
## load merged/minified code
${h.javascript_link( app_root + "build-app.js" )}
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Charts: Add custom heatmap, unify chart configuration
by commits-noreply@bitbucket.org 14 Jun '14
by commits-noreply@bitbucket.org 14 Jun '14
14 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/79ddd419dd50/
Changeset: 79ddd419dd50
User: guerler
Date: 2014-06-14 01:04:41
Summary: Charts: Add custom heatmap, unify chart configuration
Affected #: 29 files
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/app.css
--- a/config/plugins/visualizations/charts/static/app.css
+++ b/config/plugins/visualizations/charts/static/app.css
@@ -48,7 +48,7 @@
margin-left: 5px;
top: -1px;
font-size: 1.0em;
- display: inline-block;
+ display: inline;
}
.charts-viewport .icon {
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/forms/default.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/forms/default.js
@@ -0,0 +1,266 @@
+define([], function() {
+
+return {
+ title : '',
+ category : '',
+ library : '',
+ tag : '',
+ keywords : '',
+ query_limit : 0,
+ settings : {
+ separator_x : {
+ title : 'X axis',
+ type : 'separator'
+ },
+ x_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'X-axis',
+ placeholder : 'Axis label'
+ },
+ x_axis_type : {
+ title : 'Axis value type',
+ info : 'Select the value type of the axis.',
+ type : 'select',
+ init : 'auto',
+ data : [
+ {
+ label : '-- Do not show values --',
+ value : 'hide',
+ operations : {
+ hide : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Auto',
+ value : 'auto',
+ operations : {
+ hide : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Float',
+ value : 'f',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Exponent',
+ value : 'e',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Integer',
+ value : 'd',
+ operations : {
+ hide : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Percentage',
+ value : 'p',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'Rounded',
+ value : 'r',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ },
+ {
+ label : 'SI-prefix',
+ value : 's',
+ operations : {
+ show : ['x_axis_precision']
+ }
+ }
+ ]
+ },
+ x_axis_precision : {
+ title : 'Axis tick format',
+ info : 'Select the tick format for the axis.',
+ type : 'select',
+ init : '.1',
+ data : [
+ {
+ label : '0.00001',
+ value : '.5'
+ },
+ {
+ label : '0.0001',
+ value : '.4'
+ },
+ {
+ label : '0.001',
+ value : '.3'
+ },
+ {
+ label : '0.01',
+ value : '.2'
+ },
+ {
+ label : '0.1',
+ value : '.1'
+ },
+ {
+ label : '1',
+ value : '1'
+ }
+ ]
+
+ },
+ separator_y : {
+ title : 'Y axis',
+ type : 'separator'
+ },
+ y_axis_label : {
+ title : 'Axis label',
+ info : 'Provide a label for the axis.',
+ type : 'text',
+ init : 'Y-axis',
+ placeholder : 'Axis label'
+ },
+ y_axis_type : {
+ title : 'Axis value type',
+ info : 'Select the value type of the axis.',
+ type : 'select',
+ init : 'auto',
+ data : [
+ {
+ label : '-- Do not show values --',
+ value : 'hide',
+ operations : {
+ hide : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Auto',
+ value : 'auto',
+ operations : {
+ hide : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Float',
+ value : 'f',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Exponent',
+ value : 'e',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Integer',
+ value : 'd',
+ operations : {
+ hide : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Percentage',
+ value : 'p',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'Rounded',
+ value : 'r',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ },
+ {
+ label : 'SI-prefix',
+ value : 's',
+ operations : {
+ show : ['y_axis_precision']
+ }
+ }
+ ]
+ },
+ y_axis_precision : {
+ title : 'Axis tick format',
+ info : 'Select the tick format for the axis.',
+ type : 'select',
+ init : '.1',
+ data : [
+ {
+ label : '0.00001',
+ value : '.5'
+ },
+ {
+ label : '0.0001',
+ value : '.4'
+ },
+ {
+ label : '0.001',
+ value : '.3'
+ },
+ {
+ label : '0.01',
+ value : '.2'
+ },
+ {
+ label : '0.1',
+ value : '.1'
+ },
+ {
+ label : '1',
+ value : '1'
+ }
+ ]
+
+ },
+ separator_legend : {
+ title : 'Others',
+ type : 'separator'
+ },
+ show_legend : {
+ title : 'Show legend',
+ info : 'Would you like to add a legend?',
+ type : 'radiobutton',
+ init : 'true',
+ data : [
+ {
+ label : 'Yes',
+ value : 'true'
+ },
+ {
+ label : 'No',
+ value : 'false'
+ }
+ ]
+ },
+ use_panels : {
+ title : 'Use multi-panels',
+ info : 'Would you like to separate your data into individual panels?',
+ type : 'radiobutton',
+ init : 'false',
+ data : [
+ {
+ label : 'Yes',
+ value : 'true'
+ },
+ {
+ label : 'No',
+ value : 'false'
+ }
+ ]
+ }
+ }
+};
+
+});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/jqplot/common/config.js
--- a/config/plugins/visualizations/charts/static/charts/jqplot/common/config.js
+++ b/config/plugins/visualizations/charts/static/charts/jqplot/common/config.js
@@ -1,108 +1,21 @@
-define([], function() {
+define(['plugin/charts/forms/default'], function(config_default) {
-return {
+return $.extend(true, {}, config_default, {
title : '',
category : '',
- library : 'JqPlot',
+ library : 'jqPlot',
tag : 'div',
- keywords : 'default medium',
+ zoomable : true,
+ keywords : 'medium',
query_limit : 10000,
settings : {
- separator_label : {
- title : 'X axis',
+ separator_grid : {
+ title : 'Grids',
type : 'separator'
},
- x_axis_label : {
- title : 'Axis label',
- info : 'Provide a label for the axis.',
- type : 'text',
- init : 'X-axis',
- placeholder : 'Axis label'
- },
- x_axis_type : {
- title : 'Axis value type',
- info : 'Select the value type of the axis.',
- type : 'select',
- init : 'auto',
- data : [
- {
- label : '-- Do not show values --',
- value : 'hide',
- hide : ['x_axis_tick']
- },
- {
- label : 'Auto',
- value : 'auto',
- hide : ['x_axis_tick']
- },
- {
- label : 'Float',
- value : 'f',
- show : ['x_axis_tick']
- },
- {
- label : 'Exponent',
- value : 'e',
- show : ['x_axis_tick']
- },
- {
- label : 'Integer',
- value : 'd',
- hide : ['x_axis_tick']
- },
- {
- label : 'Percentage',
- value : 'p',
- show : ['x_axis_tick']
- },
- {
- label : 'Rounded',
- value : 'r',
- show : ['x_axis_tick']
- },
- {
- label : 'SI-prefix',
- value : 's',
- show : ['x_axis_tick']
- }
- ]
- },
- x_axis_tick : {
- title : 'Axis tick format',
- info : 'Select the tick format for the axis.',
- type : 'select',
- init : '.1',
- data : [
- {
- label : '0.00001',
- value : '.5'
- },
- {
- label : '0.0001',
- value : '.4'
- },
- {
- label : '0.001',
- value : '.3'
- },
- {
- label : '0.01',
- value : '.2'
- },
- {
- label : '0.1',
- value : '.1'
- },
- {
- label : '1',
- value : '1'
- }
- ]
-
- },
x_axis_grid : {
title : 'Axis grid',
- info : 'Would you like to show grid lines for this axis?',
+ info : 'Would you like to show grid lines for the X axis?',
type : 'radiobutton',
init : 'false',
data : [
@@ -116,101 +29,9 @@
}
]
},
- separator_tick : {
- title : 'Y axis',
- type : 'separator'
- },
- y_axis_label : {
- title : 'Axis label',
- info : 'Provide a label for the axis.',
- type : 'text',
- init : 'Y-axis',
- placeholder : 'Axis label'
- },
- y_axis_type : {
- title : 'Axis value type',
- info : 'Select the value type of the axis.',
- type : 'select',
- init : 'auto',
- data : [
- {
- label : '-- Do not show values --',
- value : 'hide',
- hide : ['y_axis_tick']
- },
- {
- label : 'Auto',
- value : 'auto',
- hide : ['y_axis_tick']
- },
- {
- label : 'Float',
- value : 'f',
- show : ['y_axis_tick']
- },
- {
- label : 'Exponent',
- value : 'e',
- show : ['y_axis_tick']
- },
- {
- label : 'Integer',
- value : 'd',
- hide : ['y_axis_tick']
- },
- {
- label : 'Percentage',
- value : 'p',
- show : ['y_axis_tick']
- },
- {
- label : 'Rounded',
- value : 'r',
- show : ['y_axis_tick']
- },
- {
- label : 'SI-prefix',
- value : 's',
- show : ['y_axis_tick']
- }
- ]
- },
- y_axis_tick : {
- title : 'Axis tick format',
- info : 'Select the tick format for the axis.',
- type : 'select',
- init : '.1',
- data : [
- {
- label : '0.00001',
- value : '.5'
- },
- {
- label : '0.0001',
- value : '.4'
- },
- {
- label : '0.001',
- value : '.3'
- },
- {
- label : '0.01',
- value : '.2'
- },
- {
- label : '0.1',
- value : '.1'
- },
- {
- label : '1',
- value : '1'
- }
- ]
-
- },
y_axis_grid : {
title : 'Axis grid',
- info : 'Would you like to show grid lines for this axis?',
+ info : 'Would you like to show grid lines for the Y axis?',
type : 'radiobutton',
init : 'true',
data : [
@@ -223,44 +44,8 @@
value : 'false'
}
]
- },
- separator_legend : {
- title : 'Others',
- type : 'separator'
- },
- show_legend : {
- title : 'Show legend',
- info : 'Would you like to add a legend?',
- type : 'radiobutton',
- init : 'true',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
- },
- use_panels : {
- title : 'Use multi-panels',
- info : 'Would you like to separate your data into individual panels?',
- type : 'radiobutton',
- init : 'false',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
}
}
-};
+});
});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js
@@ -54,7 +54,7 @@
this._makeAxes(groups, plot_config, chart.settings);
// make custom series call
- if (makeSeries) {
+ if (makeSeriesLabels) {
plot_config.series = makeSeriesLabels(groups, plot_config);
} else {
plot_config.series = this._makeSeriesLabels(groups);
@@ -92,7 +92,6 @@
var plot = drawGraph();
// catch window resize event
- var self = this;
$(window).on('resize', function () {
drawGraph();
});
@@ -126,41 +125,21 @@
categories = Tools.makeCategories(groups);
}
- // make axis
+ // make axes
function makeAxis (id) {
- var axis = plot_config.axes[id + 'axis'].tickOptions;
- var type = settings.get(id + '_axis_type');
- var tick = settings.get(id + '_axis_tick');
- var is_category = categories.array[id];
-
- // hide axis
- if (type == 'hide') {
- axis.formatter = function(format, value) { return '' };
- return;
- }
-
- // format values/labels
- if (type == 'auto') {
- if (is_category) {
- axis.formatter = function(format, value) {
- return categories.array[id][value] || '';
- };
- }
- } else {
- var formatter = d3.format(tick + type);
- if (is_category) {
- axis.formatter = function(format, value) {
- return formatter(categories.array[id][value]);
- };
- } else {
- axis.formatter = function(format, value) {
- return formatter(value);
+ Tools.makeAxis({
+ categories : categories.array[id],
+ type : settings.get(id + '_axis_type'),
+ precision : settings.get(id + '_axis_precision'),
+ formatter : function(formatter) {
+ if (formatter) {
+ plot_config.axes[id + 'axis'].tickOptions.formatter = function(format, value) {
+ return formatter(value);
+ };
}
}
- }
+ });
};
-
- // make axes
makeAxis('x');
makeAxis('y');
},
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal/config.js
@@ -3,7 +3,6 @@
return $.extend(true, {}, nvd3_config, {
title : 'Horizontal',
category : 'Bar diagrams',
- keywords : 'default small',
settings : {
x_axis_type : {
init : 'hide'
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_horizontal_stacked/config.js
@@ -3,7 +3,6 @@
return $.extend(true, {}, nvd3_config, {
title : 'Stacked horizontal',
category : 'Bar diagrams',
- keywords : 'default small',
settings : {
x_axis_type : {
init : 'hide'
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/bar_stacked/config.js
@@ -3,7 +3,6 @@
return $.extend(true, {}, nvd3_config, {
title : 'Stacked',
category : 'Bar diagrams',
- keywords : 'default small',
columns : {
x : {
title : 'Values for x-axis',
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/common/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/common/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/common/config.js
@@ -1,234 +1,11 @@
-define(['plugin/plugins/nvd3/nv.d3'], function() {
-
-return {
+define(['plugin/charts/forms/default', 'plugin/plugins/nvd3/nv.d3'], function(config_default) {
+return $.extend(true, {}, config_default, {
title : '',
category : '',
library : 'NVD3',
tag : 'svg',
keywords : 'small',
- query_limit : 500,
- settings : {
- separator_label : {
- title : 'X axis',
- type : 'separator'
- },
- x_axis_label : {
- title : 'Axis label',
- info : 'Provide a label for the axis.',
- type : 'text',
- init : 'X-axis',
- placeholder : 'Axis label'
- },
- x_axis_type : {
- title : 'Axis value type',
- info : 'Select the value type of the axis.',
- type : 'select',
- init : 'auto',
- data : [
- {
- label : '-- Do not show values --',
- value : 'hide',
- hide : ['x_axis_tick']
- },
- {
- label : 'Auto',
- value : 'auto',
- hide : ['x_axis_tick']
- },
- {
- label : 'Float',
- value : 'f',
- show : ['x_axis_tick']
- },
- {
- label : 'Exponent',
- value : 'e',
- show : ['x_axis_tick']
- },
- {
- label : 'Integer',
- value : 'd',
- hide : ['x_axis_tick']
- },
- {
- label : 'Percentage',
- value : 'p',
- show : ['x_axis_tick']
- },
- {
- label : 'Rounded',
- value : 'r',
- show : ['x_axis_tick']
- },
- {
- label : 'SI-prefix',
- value : 's',
- show : ['x_axis_tick']
- }
- ]
- },
- x_axis_tick : {
- title : 'Axis tick format',
- info : 'Select the tick format for the axis.',
- type : 'select',
- init : '.1',
- data : [
- {
- label : '0.00001',
- value : '.5'
- },
- {
- label : '0.0001',
- value : '.4'
- },
- {
- label : '0.001',
- value : '.3'
- },
- {
- label : '0.01',
- value : '.2'
- },
- {
- label : '0.1',
- value : '.1'
- },
- {
- label : '1',
- value : '1'
- }
- ]
-
- },
- separator_tick : {
- title : 'Y axis',
- type : 'separator'
- },
- y_axis_label : {
- title : 'Axis label',
- info : 'Provide a label for the axis.',
- type : 'text',
- init : 'Y-axis',
- placeholder : 'Axis label'
- },
- y_axis_type : {
- title : 'Axis value type',
- info : 'Select the value type of the axis.',
- type : 'select',
- init : 'auto',
- data : [
- {
- label : '-- Do not show values --',
- value : 'hide',
- hide : ['y_axis_tick']
- },
- {
- label : 'Auto',
- value : 'auto',
- hide : ['y_axis_tick']
- },
- {
- label : 'Float',
- value : 'f',
- show : ['y_axis_tick']
- },
- {
- label : 'Exponent',
- value : 'e',
- show : ['y_axis_tick']
- },
- {
- label : 'Integer',
- value : 'd',
- hide : ['y_axis_tick']
- },
- {
- label : 'Percentage',
- value : 'p',
- show : ['y_axis_tick']
- },
- {
- label : 'Rounded',
- value : 'r',
- show : ['y_axis_tick']
- },
- {
- label : 'SI-prefix',
- value : 's',
- show : ['y_axis_tick']
- }
- ]
- },
- y_axis_tick : {
- title : 'Axis tick format',
- info : 'Select the tick format for the axis.',
- type : 'select',
- init : '.1',
- data : [
- {
- label : '0.00001',
- value : '.5'
- },
- {
- label : '0.0001',
- value : '.4'
- },
- {
- label : '0.001',
- value : '.3'
- },
- {
- label : '0.01',
- value : '.2'
- },
- {
- label : '0.1',
- value : '.1'
- },
- {
- label : '1',
- value : '1'
- }
- ]
-
- },
- separator_legend : {
- title : 'Others',
- type : 'separator'
- },
- show_legend : {
- title : 'Show legend',
- info : 'Would you like to add a legend?',
- type : 'radiobutton',
- init : 'true',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
- },
- use_panels : {
- title : 'Use multi-panels',
- info : 'Would you like to separate your data into individual panels?',
- type : 'radiobutton',
- init : 'false',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
- }
- }
-};
+ query_limit : 500
+});
});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/common/wrapper.js
@@ -173,39 +173,21 @@
// result
var categories = Tools.makeCategories(groups);
- // make axis
+ // make axes
function makeAxis (id) {
- var axis = d3chart[id + 'Axis'];
- var type = settings.get(id + '_axis_type');
- var tick = settings.get(id + '_axis_tick');
- var is_category = categories.array[id];
-
- // hide axis
- if (type == 'hide') {
- axis.tickFormat(function() { return '' });
- return;
- }
-
- // format values/labels
- if (type == 'auto') {
- if (is_category) {
- axis.tickFormat(function(value) {
- return categories.array[id][value]
- });
+ Tools.makeAxis({
+ categories : categories.array[id],
+ type : settings.get(id + '_axis_type'),
+ precision : settings.get(id + '_axis_precision'),
+ formatter : function(formatter) {
+ if (formatter) {
+ d3chart[id + 'Axis'].tickFormat(function(value) {
+ return formatter(value);
+ });
+ }
}
- } else {
- var formatter = d3.format(tick + type);
- if (is_category) {
- axis.tickFormat(function(value) {
- return formatter(categories.array[id][value]);
- });
- } else {
- axis.tickFormat(formatter);
- }
- }
+ });
};
-
- // make axes
makeAxis('x');
makeAxis('y');
},
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/histogram/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/histogram/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/histogram/config.js
@@ -21,7 +21,7 @@
y_axis_type : {
init : 'f'
},
- y_axis_tick : {
+ y_axis_precision : {
init : '.2'
}
}
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/histogram_discrete/config.js
@@ -21,7 +21,7 @@
y_axis_type : {
init : 'f'
},
- y_axis_tick : {
+ y_axis_precision : {
init : '.2'
}
}
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/line_focus/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/line_focus/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/line_focus/config.js
@@ -3,7 +3,7 @@
return $.extend(true, {}, nvd3_config, {
title : 'Line with focus',
category : 'Others',
- keywords : 'default small',
+ zoomable : true,
columns : {
x : {
title : 'Values for x-axis',
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/nvd3/pie/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/pie/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/pie/config.js
@@ -5,8 +5,7 @@
category : 'Area charts',
library : 'NVD3',
tag : 'svg',
- keywords : 'default small',
- use_panels : true,
+ keywords : 'small',
columns : {
label : {
title : 'Labels',
@@ -20,21 +19,9 @@
},
settings : {
- show_legend : {
- title : 'Show legend',
- info : 'Would you like to add a legend?',
- type : 'select',
- init : 'false',
- data : [
- {
- label : 'Yes',
- value : 'true'
- },
- {
- label : 'No',
- value : 'false'
- }
- ]
+ main_separator : {
+ type : 'separator',
+ title : 'Pie chart settings'
},
donut_ratio : {
@@ -61,6 +48,23 @@
}
]
},
+
+ show_legend : {
+ title : 'Show legend',
+ info : 'Would you like to add a legend?',
+ type : 'radiobutton',
+ init : 'false',
+ data : [
+ {
+ label : 'Yes',
+ value : 'true'
+ },
+ {
+ label : 'No',
+ value : 'false'
+ }
+ ]
+ },
label_separator : {
type : 'separator',
@@ -99,7 +103,7 @@
label_outside : {
title : 'Show outside',
info : 'Would you like to show labels outside the donut?',
- type : 'select',
+ type : 'radiobutton',
init : 'false',
data : [
{
@@ -111,6 +115,11 @@
value : 'false'
}
]
+ },
+
+ use_panels : {
+ init : 'true',
+ hide : true
}
}
});
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/config.js
@@ -0,0 +1,31 @@
+define(['plugin/charts/forms/default'], function(config_default) {
+
+return $.extend(true, {}, config_default, {
+ title : 'Heat map',
+ //execute : 'heatmap',
+ category : 'Others',
+ query_limit : 5,
+ library : 'Custom',
+ tag : 'div',
+ keywords : 'small',
+ columns : {
+ x : {
+ title : 'Column labels',
+ is_label : true,
+ is_numeric : true,
+ is_unique : true
+ },
+ y : {
+ title : 'Row labels',
+ is_label : true,
+ is_numeric : true,
+ is_unique : true
+ },
+ z : {
+ title : 'Observation',
+ is_numeric : true
+ }
+ }
+});
+
+});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/others/heatmap/logo.png
Binary file config/plugins/visualizations/charts/static/charts/others/heatmap/logo.png has changed
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
--- /dev/null
+++ b/config/plugins/visualizations/charts/static/charts/others/heatmap/wrapper.js
@@ -0,0 +1,272 @@
+// dependencies
+define(['plugin/charts/tools'], function(Tools) {
+
+// widget
+return Backbone.View.extend({
+ // initialize
+ initialize: function(app, options) {
+ this.app = app;
+ this.options = options;
+ },
+
+ // render
+ draw : function(process_id, chart, request_dictionary) {
+ var self = this;
+ var plot = Tools.panelHelper({
+ app : this.app,
+ canvas_list : this.options.canvas_list,
+ process_id : process_id,
+ chart : chart,
+ request_dictionary : request_dictionary,
+ render : function(canvas_id, groups) {
+ return self.render(canvas_id, groups)
+ }
+ });
+ },
+
+ // render
+ render : function(canvas_id, groups) {
+ // collect parameters
+ this.canvas_id = canvas_id;
+ this.data = groups[0].values;
+ this.color_set = ['#ffffd9','#edf8b1','#c7e9b4','#7fcdbb','#41b6c4','#1d91c0','#225ea8','#253494','#081d58'];
+
+ // result
+ var categories = Tools.makeUniqueCategories(groups);
+
+ // get limits
+ this.xMax = d3.max(this.data, function(d) { return d.x; });
+ this.yMax = d3.max(this.data, function(d) { return d.y; });
+ this.zMax = d3.max(this.data, function(d) { return d.z; });
+
+ //
+ // domains/scales
+ //
+ this.xScale = d3.scale.linear().domain([0, this.xMax]);
+ this.yScale = d3.scale.linear().domain([0, this.yMax]);
+ this.zScale = d3.scale.ordinal().domain([0, this.zMax]);
+
+ // refresh on window resize
+ var self = this;
+ $(window).on('resize', function () {
+ self.redraw();
+ });
+
+ // draw
+ this.redraw();
+
+ // add zoom
+ this._addZoom();
+
+ // return
+ return true;
+ },
+
+ // redraw
+ redraw: function() {
+ // get parameters
+ var chart = this.options.chart;
+ var type = this.options.type;
+ var data = this.data;
+ var color_set = this.color_set;
+ var self = this;
+
+ // get/reset container
+ var container = $('#' + this.canvas_id);
+ container.empty();
+
+ // set margin and heights
+ var margin = {top: 20, right: 90, bottom: 90, left: 100},
+ width = parseInt(container.width()) - margin.left - margin.right,
+ height = parseInt(container.height()) - margin.top - margin.bottom;
+
+ //
+ // create svg
+ //
+ var svg = d3.select('#' + this.canvas_id)
+ .append('svg')
+ .attr('width', width + margin.left + margin.right)
+ .attr('height', height + margin.top + margin.bottom)
+ .append('g')
+ .attr('class', 'heatmap')
+ .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');
+
+ //
+ // set range
+ //
+ this.xScale.range([0, width]);
+ this.yScale.range([height, 0]);
+ this.zScale.range(color_set);
+
+ // get domain
+ var xDomain = this.xScale.domain();
+ var yDomain = this.yScale.domain();
+
+ //
+ // draw boxes
+ //
+ // get box properties
+ var rowCount = this.yScale.domain()[1] - this.yScale.domain()[0],
+ colCount = this.xScale.domain()[1] - this.xScale.domain()[0],
+ boxWidth = Math.max(1, Math.min(Math.floor(width / colCount), 20)),
+ boxHeight = Math.max(1, Math.min(Math.floor(height / rowCount), 20));
+
+ // box location
+ function _locator(d) {
+ return 'translate(' + self.xScale(d.x) + ',' + self.yScale(d.y) + ')';
+ };
+
+ // box color
+ function _color (d) {
+ return self.zScale(d.z);
+ };
+
+ // clip path
+ var clip = svg.append('clipPath')
+ .attr('id', 'clip')
+ .append('rect')
+ .attr('x', 0)
+ .attr('y', boxHeight)
+ .attr('width', width)
+ .attr('height', height);
+
+ // create chart area
+ var chartBody = svg.append('g')
+ .attr('clip-path', 'url(#clip)');
+
+ // add boxes to chart area
+ var boxes = chartBody.selectAll('g.box-group').data(data, function(d, i) {
+ return d.x + '\0' + d.y;
+ });
+ var gEnter = boxes.enter().append('g')
+ .attr('class', 'box-group');
+ gEnter.append('rect')
+ .attr('class','heat-box')
+ .attr('fill', 'red');
+ boxes.selectAll('rect')
+ .attr('rx', 2)
+ .attr('ry', 2)
+ .attr('fill', _color)
+ .attr('width', boxWidth)
+ .attr('height', boxHeight)
+ .attr('transform', _locator);
+ boxes.exit().remove();
+
+ // draw x axis
+ this.xAxis = d3.svg.axis().scale(this.xScale).orient('bottom');
+ this.xAxis.tickValues(d3.range(xDomain[0], xDomain[1], 1));
+ this.gxAxis = svg.append('g')
+ .attr('class', 'x axis')
+ .style('stroke-width', 0)
+ .attr('transform', 'translate(0,' + (height + margin.top + boxHeight) + ')')
+ .call(this.xAxis);
+
+ // draw y axis
+ this.yAxis = d3.svg.axis().scale(this.yScale).orient('left');
+ this.yAxis.tickValues(d3.range(yDomain[0], yDomain[1], 1));
+ this.gyAxis = svg.append('g')
+ .attr('class', 'y axis')
+ .style('stroke-width', 0)
+ .call(this.yAxis);
+
+ // fix text
+ var xFontSize = Math.min(boxWidth, 12);
+ this.gxAxis.selectAll('text')
+ .style({'font-family': 'Courier New', 'font-size': xFontSize + 'px'})
+ .attr('transform', 'rotate(-90)')
+ .attr('y', (boxWidth-xFontSize)/2);
+
+ // fix text
+ var yFontSize = Math.min(boxHeight, 12);
+ this.gyAxis.selectAll('text')
+ .style({'font-family': 'Courier New', 'font-size': yFontSize + 'px'})
+ .attr('y', -boxHeight/2 + boxHeight);
+ },
+
+ // add zoom handler
+ _addZoom: function() {
+ // link this
+ var self = this;
+
+ // min/max boundaries
+ var x_boundary = this.xScale.domain().slice();
+ var y_boundary = this.yScale.domain().slice();
+
+ // create d3 zoom handler
+ var d3zoom = d3.behavior.zoom();
+
+ // fix domain
+ function fixDomain(domain, boundary) {
+ domain[0] = parseInt(domain[0]);
+ domain[1] = parseInt(domain[1]);
+ domain[0] = Math.max(domain[0], boundary[0]);
+ domain[1] = Math.max(0, Math.min(domain[1], boundary[1]));
+ return domain;
+ };
+
+ // zoom event handler
+ function zoomed() {
+ var yDomain = fixDomain(self.yScale.domain(), y_boundary);
+ if (Math.abs(yDomain[1]-yDomain[0]) > 30) {
+ self.yScale.domain(yDomain);
+ self.gyAxis.call(self.yAxis);
+ }
+ var xDomain = fixDomain(self.xScale.domain(), x_boundary);
+ if (Math.abs(xDomain[1]-xDomain[0]) > 30) {
+ self.xScale.domain(xDomain);
+ self.gxAxis.call(self.xAxis);
+ }
+ self.redraw();
+ };
+
+ // zoom event handler
+ function unzoomed() {
+ self.xScale.domain(x_boundary);
+ self.yScale.domain(y_boundary);
+ self.redraw();
+ d3zoom.scale(1);
+ d3zoom.translate([0,0]);
+ };
+
+ // initialize wrapper
+ d3zoom.x(this.xScale)
+ .y(this.yScale)
+ .scaleExtent([1, 10])
+ .on('zoom', zoomed);
+
+ // clip edges
+ //svg.clipEdge(true);
+
+ // add handler
+ var svg = d3.select('#' + this.canvas_id);
+ svg.call(d3zoom).on('dblclick.zoom', unzoomed);
+ },
+
+ // create axes formatting
+ _makeAxes: function(d3chart, settings) {
+ // make axes
+ function makeAxis (id) {
+ Tools.makeAxis({
+ categories : categories.array[id],
+ type : settings.get(id + '_axis_type'),
+ precision : settings.get(id + '_axis_precision'),
+ formatter : function(formatter) {
+ if (formatter) {
+ d3chart[id + 'Axis']().tickFormat(function(value) {
+ return formatter(value);
+ });
+ }
+ }
+ });
+ };
+ //makeAxis('x');
+ //makeAxis('y');
+ },
+
+ // handle error
+ _handleError: function(chart, err) {
+ chart.state('failed', err);
+ }
+});
+
+});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/tools.js
--- a/config/plugins/visualizations/charts/static/charts/tools.js
+++ b/config/plugins/visualizations/charts/static/charts/tools.js
@@ -246,14 +246,63 @@
counter : counter
}
};
+
+// make axis
+function makeAxis (options) {
+ var type = options.type;
+ var precision = options.precision;
+ var categories = options.categories;
+ var formatter = options.formatter;
+ // hide axis
+ if (type == 'hide') {
+ formatter(function() { return '' });
+ return;
+ }
+
+ // format values/labels
+ if (type == 'auto') {
+ if (categories) {
+ formatter(function(value) {
+ return categories[value] || '';
+ });
+ }
+ } else {
+ var d3format = d3.format(precision + type);
+ if (categories) {
+ formatter(function(value) {
+ var label = categories[value];
+ if (label) {
+ if (isNaN(label)) {
+ return label;
+ } else {
+ try {
+ return d3format(label);
+ } catch (err) {
+ return label;
+ }
+ }
+ } else {
+ return '';
+ }
+ });
+ } else {
+ formatter(function(value) {
+ return d3format(value);
+ });
+ }
+ }
+};
+
// return
return {
- panelHelper : panelHelper,
- makeCategories : makeCategories,
- makeSeries : makeSeries,
- getDomains : getDomains,
- mapCategories : mapCategories
+ panelHelper : panelHelper,
+ makeCategories : makeCategories,
+ makeUniqueCategories : makeUniqueCategories,
+ makeSeries : makeSeries,
+ getDomains : getDomains,
+ mapCategories : mapCategories,
+ makeAxis : makeAxis
}
});
\ No newline at end of file
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/charts/types.js
--- a/config/plugins/visualizations/charts/static/charts/types.js
+++ b/config/plugins/visualizations/charts/static/charts/types.js
@@ -15,7 +15,8 @@
'plugin/charts/jqplot/bar/config',
'plugin/charts/jqplot/line/config',
'plugin/charts/jqplot/scatter/config',
- 'plugin/charts/jqplot/boxplot/config'
+ 'plugin/charts/jqplot/boxplot/config',
+ 'plugin/charts/others/heatmap/config'
], function(nvd3_bar,
nvd3_bar_stacked,
nvd3_bar_horizontal,
@@ -32,7 +33,8 @@
jqplot_bar,
jqplot_line,
jqplot_scatter,
- jqplot_boxplot
+ jqplot_boxplot,
+ others_heatmap
) {
// widget
@@ -56,7 +58,8 @@
'nvd3_histogram_discrete' : nvd3_histogram_discrete,
'jqplot_line' : jqplot_line,
'jqplot_scatter' : jqplot_scatter,
- 'jqplot_boxplot' : jqplot_boxplot
+ 'jqplot_boxplot' : jqplot_boxplot,
+ 'others_heatmap' : others_heatmap
}
});
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/library/ui-table-form.js
--- a/config/plugins/visualizations/charts/static/library/ui-table-form.js
+++ b/config/plugins/visualizations/charts/static/library/ui-table-form.js
@@ -97,13 +97,14 @@
// find selected dictionary
var dict = _.findWhere(settings_def.data, {value: value});
- if (dict) {
- for (var i in dict.show) {
- var target = dict.show[i];
+ if (dict && dict.operations) {
+ var operations = dict.operations;
+ for (var i in operations.show) {
+ var target = operations.show[i];
self.table.get(target).show();
}
- for (var i in dict.hide) {
- var target = dict.hide[i];
+ for (var i in operations.hide) {
+ var target = operations.hide[i];
self.table.get(target).hide();
}
}
@@ -122,13 +123,14 @@
// find selected dictionary
var dict = _.findWhere(settings_def.data, {value: value});
- if (dict) {
- for (var i in dict.show) {
- var target = dict.show[i];
+ if (dict && dict.operations) {
+ var operations = dict.operations;
+ for (var i in operations.show) {
+ var target = operations.show[i];
self.table.get(target).show();
}
- for (var i in dict.hide) {
- var target = dict.hide[i];
+ for (var i in operations.hide) {
+ var target = operations.hide[i];
self.table.get(target).hide();
}
}
@@ -226,6 +228,11 @@
// add to table
this.table.append(id);
+
+ // show/hide
+ if (settings_def.hide) {
+ this.table.get(id).hide();
+ }
}
});
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/views/editor.js
--- a/config/plugins/visualizations/charts/static/views/editor.js
+++ b/config/plugins/visualizations/charts/static/views/editor.js
@@ -207,7 +207,7 @@
this.chart.groups.each(function(group) {
var title = group.get('key', '');
if (title == '') {
- title = 'Chart data';
+ title = 'Data label';
}
self.tabs.title(group.id, ++counter + ': ' + title);
});
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/static/views/types.js
--- a/config/plugins/visualizations/charts/static/views/types.js
+++ b/config/plugins/visualizations/charts/static/views/types.js
@@ -138,10 +138,19 @@
// add chart types
for (var id in this.categories[category]) {
+ // get type
var type = this.categories[category][id];
+
+ // make title
+ var title = type.title + ' (' + type.library + ')';
+ if (type.zoomable) {
+ title = '<span class="fa fa-search-plus"/>' + title;
+ }
+
+ // append type to screen
$el.append(Utils.wrap(this._template_item({
id : id,
- title : type.title + ' (' + type.library + ')',
+ title : title,
url : config.app_root + 'charts/' + this.app.chartPath(id) + '/logo.png'
})));
}
diff -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 -r 79ddd419dd50430978b753f4f0abf2564e02047a config/plugins/visualizations/charts/templates/charts.mako
--- a/config/plugins/visualizations/charts/templates/charts.mako
+++ b/config/plugins/visualizations/charts/templates/charts.mako
@@ -29,6 +29,9 @@
${h.javascript_link( app_root + "plugins/jqplot/jquery.jqplot.js" )}
${h.javascript_link( app_root + "plugins/jqplot/jquery.jqplot.plugins.js" )}
+ ## dc
+ ${h.javascript_link( app_root + "plugins/dc/crossfilter.js" )}
+
## load merged/minified code
${h.javascript_link( app_root + "build-app.js" )}
@@ -61,12 +64,13 @@
require.config({
baseUrl: config.root + "static/scripts/",
paths: {
- "plugin" : "${app_root}"
+ "plugin" : "${app_root}",
+ "d3" : "libs/d3"
},
shim: {
"libs/underscore": { exports: "_" },
"libs/backbone/backbone": { exports: "Backbone" },
- "d3": { exports: "d3"},
+ "d3": { exports: "d3"}
}
});
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: davebgx: Fetch eggs after initializing sample files, per John Chilton's comment.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4bcc1949021b/
Changeset: 4bcc1949021b
User: davebgx
Date: 2014-06-13 23:32:51
Summary: Fetch eggs after initializing sample files, per John Chilton's comment.
Affected #: 1 file
diff -r fb4ac45f7827a92fa637899fb5da43a350bc857b -r 4bcc1949021ba358ea3e1dbf624d0014e8fab525 scripts/common_startup.sh
--- a/scripts/common_startup.sh
+++ b/scripts/common_startup.sh
@@ -8,19 +8,6 @@
[ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0
[ "$arg" = "--skip-samples" ] && COPY_SAMPLE_FILES=0
done
-if [ $FETCH_EGGS -eq 1 ]; then
- python ./scripts/check_eggs.py -q
- if [ $? -ne 0 ]; then
- echo "Some eggs are out of date, attempting to fetch..."
- python ./scripts/fetch_eggs.py
- if [ $? -eq 0 ]; then
- echo "Fetch successful."
- else
- echo "Fetch failed."
- exit 1
- fi
- fi
-fi
SAMPLES="
tool_shed_wsgi.ini.sample
@@ -60,4 +47,17 @@
fi
done
fi
-
+
+if [ $FETCH_EGGS -eq 1 ]; then
+ python ./scripts/check_eggs.py -q
+ if [ $? -ne 0 ]; then
+ echo "Some eggs are out of date, attempting to fetch..."
+ python ./scripts/fetch_eggs.py
+ if [ $? -eq 0 ]; then
+ echo "Fetch successful."
+ else
+ echo "Fetch failed."
+ exit 1
+ fi
+ fi
+fi
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c74d749979cd/
Changeset: c74d749979cd
User: jmchilton
Date: 2014-06-13 22:45:41
Summary: Rollback UI commit - not quite ready after more testing.
Affected #: 6 files
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/collection/dataset-collection-base.js
--- a/static/scripts/mvc/collection/dataset-collection-base.js
+++ b/static/scripts/mvc/collection/dataset-collection-base.js
@@ -144,7 +144,7 @@
contentView.$el.children( '.dataset-body' ).replaceWith( contentView._render_body() );
contentView.$el.children( '.dataset-body' ).slideDown( contentView.fxSpeed, function(){
contentView.expanded = true;
- contentView.trigger( 'body-expanded', contentView.model );
+ contentView.trigger( 'body-expanded', contentView.model.get( 'id' ) );
});
}
// TODO: Fetch more details like HDA view...
@@ -158,7 +158,7 @@
var hdaView = this;
this.$el.children( '.dataset-body' ).slideUp( hdaView.fxSpeed, function(){
hdaView.expanded = false;
- hdaView.trigger( 'body-collapsed', hdaView.model.id );
+ hdaView.trigger( 'body-collapsed', hdaView.model.get( 'id' ) );
});
},
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -319,7 +319,7 @@
title : "Data Viewer: " + self.model.get('name'),
type : "other",
content : function(parent_elt) {
- var new_dataset = new dataset.TabularDataset({id: self.model.get('id')});
+ var new_dataset = new dataset.TabularDataset({id: self.model.id});
$.when(new_dataset.fetch()).then(function() {
dataset.createTabularDatasetChunkedView({
model: new_dataset,
@@ -568,7 +568,7 @@
hdaView.$el.children( '.dataset-body' ).replaceWith( hdaView._render_body() );
hdaView.$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
hdaView.expanded = true;
- hdaView.trigger( 'body-expanded', hdaView.model );
+ hdaView.trigger( 'body-expanded', hdaView.model.get( 'id' ) );
});
//hdaView.render( false ).$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
@@ -595,7 +595,7 @@
var hdaView = this;
this.$el.children( '.dataset-body' ).slideUp( hdaView.fxSpeed, function(){
hdaView.expanded = false;
- hdaView.trigger( 'body-collapsed', hdaView.model.id );
+ hdaView.trigger( 'body-collapsed', hdaView.model.get( 'id' ) );
});
},
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -12,22 +12,9 @@
* @constructs
*/
var HistoryContent = Backbone.Model.extend( baseMVC.LoggableMixin ).extend( {
- idAttribute : 'type_id',
/** fetch location of this HDA's history in the api */
urlRoot: galaxy_config.root + 'api/histories/',
-
- constructor : function( attrs, options ){
- attrs.type_id = HistoryContent.typeIdStr( attrs.type, attrs.id );
- Backbone.Model.apply( this, arguments );
- },
-
- initialize : function( attrs, options ){
- // assumes type won't change
- this.on( 'change:id', this._createTypeId );
- //TODO: not sure this covers all the bases...
- },
-
/** full url spec. for this HDA */
url : function(){
return this.urlRoot + this.get( 'history_id' ) + '/contents/' + this.get('history_content_type') + 's/' + this.get( 'id' );
@@ -151,19 +138,10 @@
term = term.replace( /"/g, '' );
return model.matches( term );
});
- },
-
- _createTypeId : function(){
- return ( this.attributes.type_id = [ this.attributes.type, this.attributes.id ].join( '-' ) );
- },
+ }
} );
-/** create a type + id string for use in mixed collections */
-HistoryContent.typeIdStr = function _typeId( type, id ){
- return [ type, id ].join( '-' );
-};
-
//==============================================================================
/** @class (HDA) model for a Galaxy dataset
* related to a history.
@@ -250,10 +228,6 @@
initialize : function( data ){
this.log( this + '.initialize', this.attributes );
this.log( '\tparent history_id: ' + this.get( 'history_id' ) );
-
- this._createTypeId();
- // assumes type won't change
- this.on( 'change:id', this._createTypeId );
//!! this state is not in trans.app.model.Dataset.states - set it here -
if( !this.get( 'accessible' ) ){
@@ -508,7 +482,7 @@
* @returns array of encoded ids
*/
ids : function(){
- return this.map( function( hda ){ return hda.get('id'); });
+ return this.map( function( hda ){ return hda.id; });
},
/** Get hdas that are not ready
@@ -669,7 +643,7 @@
this.chain().each( function( hda ) {
// TODO: Handle duplicate names.
var name = hda.attributes.name;
- var id = hda.get('id');
+ var id = hda.id;
var content_type = hda.attributes.history_content_type;
if( content_type == "dataset" ) {
if( full_collection_type != "list" ) {
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -236,7 +236,7 @@
// for symmetry, not actually used by backend of consumed
// by frontend.
data[ "dataset_collection_details" ] = hdcaDetailIds.join( ',' );
- }
+ }
return jQuery.ajax( galaxy_config.root + 'api/histories/' + historyData.id + '/contents', { data: data });
}
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -273,7 +273,7 @@
* @param {HistoryDatasetAssociation} hda
*/
_createContentView : function( hda ){
- var hdaId = hda.id,
+ var hdaId = hda.get( 'id' ),
historyContentType = hda.get( 'history_content_type' ),
hdaView = null;
@@ -328,7 +328,7 @@
// only
} else {
- var id = hdaView.model.id;
+ var id = hdaView.model.get( 'id' );
historyView.lastSelectedViewId = id;
//console.debug( 'lastSelectedViewId:', historyView.lastSelectedViewId );
selectedIds = [ id ];
@@ -340,7 +340,7 @@
});
hdaView.on( 'de-selected', function( hdaView, event ){
//console.debug( 'de-selected', event );
- var id = hdaView.model.id;
+ var id = hdaView.model.get( 'id' );
historyView.selectedHdaIds = _.without( historyView.selectedHdaIds, id );
//console.debug( 'de-selected', historyView.selectedHdaIds );
});
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r c74d749979cd894d4e69f82967d69938f90e4a27 static/scripts/mvc/history/readonly-history-panel.js
--- a/static/scripts/mvc/history/readonly-history-panel.js
+++ b/static/scripts/mvc/history/readonly-history-panel.js
@@ -18,9 +18,9 @@
//TODO: add scroll position?
},
/** add an hda id to the hash of expanded hdas */
- addExpandedHda : function( model ){
+ addExpandedHda : function( id ){
var key = 'expandedHdas';
- this.save( key, _.extend( this.get( key ), _.object([ model.id ], [ model.get( 'id' ) ]) ) );
+ this.save( key, _.extend( this.get( key ), _.object([ id ], [ true ]) ) );
},
/** remove an hda id from the hash of expanded hdas */
removeExpandedHda : function( id ){
@@ -264,7 +264,7 @@
var hdaDetailIds = function( historyData ){
// will be called to get hda ids that need details from the api
//TODO: non-visible HDAs are getting details loaded... either stop loading them at all or filter ids thru isVisible
- return _.values( HistoryPrefs.get( historyData.id ).get( 'expandedHdas' ) );
+ return _.keys( HistoryPrefs.get( historyData.id ).get( 'expandedHdas' ) );
};
return this.loadHistory( historyId, attributes, historyFn, hdaFn, hdaDetailIds );
},
@@ -591,7 +591,7 @@
if( visibleHdas.length ){
visibleHdas.each( function( hda ){
// render it (NOTE: reverse order, newest on top (prepend))
- var hdaId = hda.id,
+ var hdaId = hda.get( 'id' ),
hdaView = panel._createContentView( hda );
newHdaViews[ hdaId ] = hdaView;
// persist selection
@@ -610,7 +610,7 @@
* @param {HistoryDatasetAssociation} hda
*/
_createContentView : function( hda ){
- var hdaId = hda.id,
+ var hdaId = hda.get( 'id' ),
historyContentType = hda.get( "history_content_type" ),
hdaView = null;
if( historyContentType === "dataset" ){
@@ -646,8 +646,8 @@
panel.errorHandler( model, xhr, options, msg );
});
// maintain a list of hdas whose bodies are expanded
- hdaView.on( 'body-expanded', function( model ){
- panel.storage.addExpandedHda( model );
+ hdaView.on( 'body-expanded', function( id ){
+ panel.storage.addExpandedHda( id );
});
hdaView.on( 'body-collapsed', function( id ){
panel.storage.removeExpandedHda( id );
https://bitbucket.org/galaxy/galaxy-central/commits/fb4ac45f7827/
Changeset: fb4ac45f7827
User: jmchilton
Date: 2014-06-13 22:50:38
Summary: Merge.
Affected #: 6 files
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -34,6 +34,9 @@
def __getitem__( self, key ):
return self.data_tables.__getitem__( key )
+ def __setitem__( self, key, value ):
+ return self.data_tables.__setitem__( key, value )
+
def __contains__( self, key ):
return self.data_tables.__contains__( key )
@@ -43,6 +46,9 @@
except KeyError:
return default
+ def set( self, name, value ):
+ self[ name ] = value
+
def get_tables( self ):
return self.data_tables
@@ -335,7 +341,7 @@
return rval
def get_version_fields( self ):
- return ( self._loaded_content_version, self.data )
+ return ( self._loaded_content_version, self.get_fields() )
def parse_column_spec( self, config_element ):
"""
@@ -422,7 +428,7 @@
return default
rval = default
# Look for table entry.
- for fields in self.data:
+ for fields in self.get_fields():
if fields[ query_col ] == query_val:
rval = fields[ return_col ]
break
@@ -444,7 +450,7 @@
is_error = False
if self.largest_index < len( fields ):
fields = self._replace_field_separators( fields )
- if fields not in self.data or allow_duplicates:
+ if fields not in self.get_fields() or allow_duplicates:
self.data.append( fields )
else:
log.debug( "Attempted to add fields (%s) to data table '%s', but this entry already exists and allow_duplicates is False.", fields, self.name )
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b run.sh
--- a/run.sh
+++ b/run.sh
@@ -5,31 +5,12 @@
python ./scripts/check_python.py
[ $? -ne 0 ] && exit 1
-./scripts/copy_sample_files.sh
+./scripts/common_startup.sh
if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then
python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR"
fi
-# explicitly attempt to fetch eggs before running
-FETCH_EGGS=1
-for arg in "$@"; do
- [ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0; break
-done
-if [ $FETCH_EGGS -eq 1 ]; then
- python ./scripts/check_eggs.py -q
- if [ $? -ne 0 ]; then
- echo "Some eggs are out of date, attempting to fetch..."
- python ./scripts/fetch_eggs.py
- if [ $? -eq 0 ]; then
- echo "Fetch successful."
- else
- echo "Fetch failed."
- exit 1
- fi
- fi
-fi
-
if [ -n "$GALAXY_RUN_ALL" ]; then
servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' universe_wsgi.ini | xargs echo`
daemon=`echo "$@" | grep -q daemon`
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b run_reports.sh
--- a/run_reports.sh
+++ b/run_reports.sh
@@ -11,6 +11,8 @@
cd `dirname $0`
+./scripts/common_startup.sh --skip-samples
+
GALAXY_REPORTS_CONFIG=${GALAXY_REPORTS_CONFIG:-reports_wsgi.ini}
GALAXY_REPORTS_PID=${GALAXY_REPORTS_PID:-reports_webapp.pid}
GALAXY_REPORTS_LOG=${GALAXY_REPORTS_LOG:-reports_webapp.log}
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b run_tool_shed.sh
--- a/run_tool_shed.sh
+++ b/run_tool_shed.sh
@@ -2,7 +2,7 @@
cd `dirname $0`
-./scripts/copy_sample_files.sh
+./scripts/common_startup.sh
tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@`
args=$@
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b scripts/common_startup.sh
--- /dev/null
+++ b/scripts/common_startup.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# explicitly attempt to fetch eggs before running
+FETCH_EGGS=1
+COPY_SAMPLE_FILES=1
+for arg in "$@"; do
+ [ "$arg" = "--skip-eggs" ] && FETCH_EGGS=0
+ [ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0
+ [ "$arg" = "--skip-samples" ] && COPY_SAMPLE_FILES=0
+done
+if [ $FETCH_EGGS -eq 1 ]; then
+ python ./scripts/check_eggs.py -q
+ if [ $? -ne 0 ]; then
+ echo "Some eggs are out of date, attempting to fetch..."
+ python ./scripts/fetch_eggs.py
+ if [ $? -eq 0 ]; then
+ echo "Fetch successful."
+ else
+ echo "Fetch failed."
+ exit 1
+ fi
+ fi
+fi
+
+SAMPLES="
+ tool_shed_wsgi.ini.sample
+ datatypes_conf.xml.sample
+ external_service_types_conf.xml.sample
+ migrated_tools_conf.xml.sample
+ reports_wsgi.ini.sample
+ shed_tool_conf.xml.sample
+ tool_conf.xml.sample
+ shed_tool_data_table_conf.xml.sample
+ tool_data_table_conf.xml.sample
+ tool_sheds_conf.xml.sample
+ data_manager_conf.xml.sample
+ shed_data_manager_conf.xml.sample
+ openid_conf.xml.sample
+ job_metrics_conf.xml.sample
+ universe_wsgi.ini.sample
+ lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
+ tool-data/shared/ncbi/builds.txt.sample
+ tool-data/shared/ensembl/builds.txt.sample
+ tool-data/shared/ucsc/builds.txt.sample
+ tool-data/shared/ucsc/publicbuilds.txt.sample
+ tool-data/shared/ucsc/ucsc_build_sites.txt.sample
+ tool-data/shared/igv/igv_build_sites.txt.sample
+ tool-data/shared/rviewer/rviewer_build_sites.txt.sample
+ tool-data/*.sample
+ static/welcome.html.sample
+"
+
+if [ $COPY_SAMPLE_FILES -eq 1 ]; then
+ # Create any missing config/location files
+ for sample in $SAMPLES; do
+ file=${sample%.sample}
+ if [ ! -f "$file" -a -f "$sample" ]; then
+ echo "Initializing $file from `basename $sample`"
+ cp $sample $file
+ fi
+ done
+fi
+
diff -r c74d749979cd894d4e69f82967d69938f90e4a27 -r fb4ac45f7827a92fa637899fb5da43a350bc857b scripts/copy_sample_files.sh
--- a/scripts/copy_sample_files.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-SAMPLES="
- tool_shed_wsgi.ini.sample
- datatypes_conf.xml.sample
- external_service_types_conf.xml.sample
- migrated_tools_conf.xml.sample
- reports_wsgi.ini.sample
- shed_tool_conf.xml.sample
- tool_conf.xml.sample
- shed_tool_data_table_conf.xml.sample
- tool_data_table_conf.xml.sample
- tool_sheds_conf.xml.sample
- data_manager_conf.xml.sample
- shed_data_manager_conf.xml.sample
- openid_conf.xml.sample
- job_metrics_conf.xml.sample
- universe_wsgi.ini.sample
- lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
- tool-data/shared/ncbi/builds.txt.sample
- tool-data/shared/ensembl/builds.txt.sample
- tool-data/shared/ucsc/builds.txt.sample
- tool-data/shared/ucsc/publicbuilds.txt.sample
- tool-data/shared/ucsc/ucsc_build_sites.txt.sample
- tool-data/shared/igv/igv_build_sites.txt.sample
- tool-data/shared/rviewer/rviewer_build_sites.txt.sample
- tool-data/*.sample
- static/welcome.html.sample
-"
-
-# Create any missing config/location files
-for sample in $SAMPLES; do
- file=${sample%.sample}
- if [ ! -f "$file" -a -f "$sample" ]; then
- echo "Initializing $file from `basename $sample`"
- cp $sample $file
- fi
-done
-
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5dd5952050c8/
Changeset: 5dd5952050c8
User: davebgx
Date: 2014-06-13 22:39:59
Summary: Abstract common startup tasks into scripts/common_startup.sh, which used to be copy_sample_files.sh.
Affected #: 5 files
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 run.sh
--- a/run.sh
+++ b/run.sh
@@ -5,31 +5,12 @@
python ./scripts/check_python.py
[ $? -ne 0 ] && exit 1
-./scripts/copy_sample_files.sh
+./scripts/common_startup.sh
if [ -n "$GALAXY_UNIVERSE_CONFIG_DIR" ]; then
python ./scripts/build_universe_config.py "$GALAXY_UNIVERSE_CONFIG_DIR"
fi
-# explicitly attempt to fetch eggs before running
-FETCH_EGGS=1
-for arg in "$@"; do
- [ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0; break
-done
-if [ $FETCH_EGGS -eq 1 ]; then
- python ./scripts/check_eggs.py -q
- if [ $? -ne 0 ]; then
- echo "Some eggs are out of date, attempting to fetch..."
- python ./scripts/fetch_eggs.py
- if [ $? -eq 0 ]; then
- echo "Fetch successful."
- else
- echo "Fetch failed."
- exit 1
- fi
- fi
-fi
-
if [ -n "$GALAXY_RUN_ALL" ]; then
servers=`sed -n 's/^\[server:\(.*\)\]/\1/ p' universe_wsgi.ini | xargs echo`
daemon=`echo "$@" | grep -q daemon`
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 run_reports.sh
--- a/run_reports.sh
+++ b/run_reports.sh
@@ -11,6 +11,8 @@
cd `dirname $0`
+./scripts/common_startup.sh --skip-samples
+
GALAXY_REPORTS_CONFIG=${GALAXY_REPORTS_CONFIG:-reports_wsgi.ini}
GALAXY_REPORTS_PID=${GALAXY_REPORTS_PID:-reports_webapp.pid}
GALAXY_REPORTS_LOG=${GALAXY_REPORTS_LOG:-reports_webapp.log}
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 run_tool_shed.sh
--- a/run_tool_shed.sh
+++ b/run_tool_shed.sh
@@ -2,7 +2,7 @@
cd `dirname $0`
-./scripts/copy_sample_files.sh
+./scripts/common_startup.sh
tool_shed=`./lib/tool_shed/scripts/bootstrap_tool_shed/parse_run_sh_args.sh $@`
args=$@
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 scripts/common_startup.sh
--- /dev/null
+++ b/scripts/common_startup.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+# explicitly attempt to fetch eggs before running
+FETCH_EGGS=1
+COPY_SAMPLE_FILES=1
+for arg in "$@"; do
+ [ "$arg" = "--skip-eggs" ] && FETCH_EGGS=0
+ [ "$arg" = "--stop-daemon" ] && FETCH_EGGS=0
+ [ "$arg" = "--skip-samples" ] && COPY_SAMPLE_FILES=0
+done
+if [ $FETCH_EGGS -eq 1 ]; then
+ python ./scripts/check_eggs.py -q
+ if [ $? -ne 0 ]; then
+ echo "Some eggs are out of date, attempting to fetch..."
+ python ./scripts/fetch_eggs.py
+ if [ $? -eq 0 ]; then
+ echo "Fetch successful."
+ else
+ echo "Fetch failed."
+ exit 1
+ fi
+ fi
+fi
+
+SAMPLES="
+ tool_shed_wsgi.ini.sample
+ datatypes_conf.xml.sample
+ external_service_types_conf.xml.sample
+ migrated_tools_conf.xml.sample
+ reports_wsgi.ini.sample
+ shed_tool_conf.xml.sample
+ tool_conf.xml.sample
+ shed_tool_data_table_conf.xml.sample
+ tool_data_table_conf.xml.sample
+ tool_sheds_conf.xml.sample
+ data_manager_conf.xml.sample
+ shed_data_manager_conf.xml.sample
+ openid_conf.xml.sample
+ job_metrics_conf.xml.sample
+ universe_wsgi.ini.sample
+ lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
+ tool-data/shared/ncbi/builds.txt.sample
+ tool-data/shared/ensembl/builds.txt.sample
+ tool-data/shared/ucsc/builds.txt.sample
+ tool-data/shared/ucsc/publicbuilds.txt.sample
+ tool-data/shared/ucsc/ucsc_build_sites.txt.sample
+ tool-data/shared/igv/igv_build_sites.txt.sample
+ tool-data/shared/rviewer/rviewer_build_sites.txt.sample
+ tool-data/*.sample
+ static/welcome.html.sample
+"
+
+if [ $COPY_SAMPLE_FILES -eq 1 ]; then
+ # Create any missing config/location files
+ for sample in $SAMPLES; do
+ file=${sample%.sample}
+ if [ ! -f "$file" -a -f "$sample" ]; then
+ echo "Initializing $file from `basename $sample`"
+ cp $sample $file
+ fi
+ done
+fi
+
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 scripts/copy_sample_files.sh
--- a/scripts/copy_sample_files.sh
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-SAMPLES="
- tool_shed_wsgi.ini.sample
- datatypes_conf.xml.sample
- external_service_types_conf.xml.sample
- migrated_tools_conf.xml.sample
- reports_wsgi.ini.sample
- shed_tool_conf.xml.sample
- tool_conf.xml.sample
- shed_tool_data_table_conf.xml.sample
- tool_data_table_conf.xml.sample
- tool_sheds_conf.xml.sample
- data_manager_conf.xml.sample
- shed_data_manager_conf.xml.sample
- openid_conf.xml.sample
- job_metrics_conf.xml.sample
- universe_wsgi.ini.sample
- lib/tool_shed/scripts/bootstrap_tool_shed/user_info.xml.sample
- tool-data/shared/ncbi/builds.txt.sample
- tool-data/shared/ensembl/builds.txt.sample
- tool-data/shared/ucsc/builds.txt.sample
- tool-data/shared/ucsc/publicbuilds.txt.sample
- tool-data/shared/ucsc/ucsc_build_sites.txt.sample
- tool-data/shared/igv/igv_build_sites.txt.sample
- tool-data/shared/rviewer/rviewer_build_sites.txt.sample
- tool-data/*.sample
- static/welcome.html.sample
-"
-
-# Create any missing config/location files
-for sample in $SAMPLES; do
- file=${sample%.sample}
- if [ ! -f "$file" -a -f "$sample" ]; then
- echo "Initializing $file from `basename $sample`"
- cp $sample $file
- fi
-done
-
https://bitbucket.org/galaxy/galaxy-central/commits/867208553d9d/
Changeset: 867208553d9d
User: davebgx
Date: 2014-06-13 22:41:00
Summary: Merge with incoming.
Affected #: 1 file
diff -r 5dd5952050c822282ecb12ed3a5fc2f262a8f921 -r 867208553d9dba216acd6669543714e3aa1ebed2 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -34,6 +34,9 @@
def __getitem__( self, key ):
return self.data_tables.__getitem__( key )
+ def __setitem__( self, key, value ):
+ return self.data_tables.__setitem__( key, value )
+
def __contains__( self, key ):
return self.data_tables.__contains__( key )
@@ -43,6 +46,9 @@
except KeyError:
return default
+ def set( self, name, value ):
+ self[ name ] = value
+
def get_tables( self ):
return self.data_tables
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: Add set methods to ToolDataTableManager.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c8e9e10e1a5a/
Changeset: c8e9e10e1a5a
User: dan
Date: 2014-06-13 22:31:25
Summary: Add set methods to ToolDataTableManager.
Affected #: 1 file
diff -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 -r c8e9e10e1a5a2c69e94224629e8b086112e15bff lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -34,6 +34,9 @@
def __getitem__( self, key ):
return self.data_tables.__getitem__( key )
+ def __setitem__( self, key, value ):
+ return self.data_tables.__setitem__( key, value )
+
def __contains__( self, key ):
return self.data_tables.__contains__( key )
@@ -43,6 +46,9 @@
except KeyError:
return default
+ def set( self, name, value ):
+ self[ name ] = value
+
def get_tables( self ):
return self.data_tables
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: In TabularToolDataTable use .get_fields() instead of .data directly.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6e39473e4c51/
Changeset: 6e39473e4c51
User: dan
Date: 2014-06-13 22:09:53
Summary: In TabularToolDataTable use .get_fields() instead of .data directly.
Affected #: 1 file
diff -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 -r 6e39473e4c51151ef71ef0f5a5e05134e5d5aaa4 lib/galaxy/tools/data/__init__.py
--- a/lib/galaxy/tools/data/__init__.py
+++ b/lib/galaxy/tools/data/__init__.py
@@ -335,7 +335,7 @@
return rval
def get_version_fields( self ):
- return ( self._loaded_content_version, self.data )
+ return ( self._loaded_content_version, self.get_fields() )
def parse_column_spec( self, config_element ):
"""
@@ -422,7 +422,7 @@
return default
rval = default
# Look for table entry.
- for fields in self.data:
+ for fields in self.get_fields():
if fields[ query_col ] == query_val:
rval = fields[ return_col ]
break
@@ -444,7 +444,7 @@
is_error = False
if self.largest_index < len( fields ):
fields = self._replace_field_separators( fields )
- if fields not in self.data or allow_duplicates:
+ if fields not in self.get_fields() or allow_duplicates:
self.data.append( fields )
else:
log.debug( "Attempted to add fields (%s) to data table '%s', but this entry already exists and allow_duplicates is False.", fields, self.name )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/73b0cb2e6795/
Changeset: 73b0cb2e6795
User: jmchilton
Date: 2014-06-13 21:25:36
Summary: Modifications to history_contents API and client consumption...
... to reflect the fact that history can now contain two kinds of objects with potentially overlapping ids.
Affected #: 2 files
diff -r ea6698177726a9e94931dcd818db52f5c0e2aec3 -r 73b0cb2e679542f197eb12715e05a770c5501e0d lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -102,8 +102,10 @@
contents_kwds[ 'deleted' ] = kwd.get( 'deleted', None )
contents_kwds[ 'visible' ] = kwd.get( 'visible', None )
# details param allows a mixed set of summary and detailed hdas
- #TODO: this is getting convoluted due to backwards compat
- details = kwd.get( 'details', None ) or []
+ # Ever more convoluted due to backwards compat..., details
+ # should be considered deprecated in favor of more specific
+ # dataset_details (and to be implemented dataset_collection_details).
+ details = kwd.get( 'details', None ) or kwd.get( 'dataset_details', None ) or []
if details and details != 'all':
details = util.listify( details )
diff -r ea6698177726a9e94931dcd818db52f5c0e2aec3 -r 73b0cb2e679542f197eb12715e05a770c5501e0d static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -200,6 +200,7 @@
History.getHistoryData = function getHistoryData( historyId, options ){
options = options || {};
var hdaDetailIds = options.hdaDetailIds || [];
+ var hdcaDetailIds = options.hdcaDetailIds || [];
//console.debug( 'getHistoryData:', historyId, options );
var df = jQuery.Deferred(),
@@ -224,7 +225,18 @@
if( _.isFunction( hdaDetailIds ) ){
hdaDetailIds = hdaDetailIds( historyData );
}
- var data = ( hdaDetailIds.length )?( { details : hdaDetailIds.join( ',' ) } ):( {} );
+ if( _.isFunction( hdcaDetailIds ) ){
+ hdcaDetailIds = hdcaDetailIds( historyData );
+ }
+ var data = {};
+ if( hdaDetailIds.length ) {
+ data[ "dataset_details" ] = hdaDetailIds.join( ',' );
+ }
+ if( hdcaDetailIds.length ) {
+ // for symmetry, not actually used by backend of consumed
+ // by frontend.
+ data[ "dataset_collection_details" ] = hdcaDetailIds.join( ',' );
+ }
return jQuery.ajax( galaxy_config.root + 'api/histories/' + historyData.id + '/contents', { data: data });
}
https://bitbucket.org/galaxy/galaxy-central/commits/74826a57c456/
Changeset: 74826a57c456
User: jmchilton
Date: 2014-06-13 21:25:36
Summary: Progress on UI problems when collections and datasets in same history have same id.
Approach outlined by Carl, introduces separation between Backbone model id and underlying Galaxy id. Backbone id now includes type in the id. Lots of switching around which id is used where - probably introduces some bugs if I failed to update which id is to be used or switched to wrong one.
Affected #: 6 files
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/collection/dataset-collection-base.js
--- a/static/scripts/mvc/collection/dataset-collection-base.js
+++ b/static/scripts/mvc/collection/dataset-collection-base.js
@@ -144,7 +144,7 @@
contentView.$el.children( '.dataset-body' ).replaceWith( contentView._render_body() );
contentView.$el.children( '.dataset-body' ).slideDown( contentView.fxSpeed, function(){
contentView.expanded = true;
- contentView.trigger( 'body-expanded', contentView.model.get( 'id' ) );
+ contentView.trigger( 'body-expanded', contentView.model );
});
}
// TODO: Fetch more details like HDA view...
@@ -158,7 +158,7 @@
var hdaView = this;
this.$el.children( '.dataset-body' ).slideUp( hdaView.fxSpeed, function(){
hdaView.expanded = false;
- hdaView.trigger( 'body-collapsed', hdaView.model.get( 'id' ) );
+ hdaView.trigger( 'body-collapsed', hdaView.model.id );
});
},
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -319,7 +319,7 @@
title : "Data Viewer: " + self.model.get('name'),
type : "other",
content : function(parent_elt) {
- var new_dataset = new dataset.TabularDataset({id: self.model.id});
+ var new_dataset = new dataset.TabularDataset({id: self.model.get('id')});
$.when(new_dataset.fetch()).then(function() {
dataset.createTabularDatasetChunkedView({
model: new_dataset,
@@ -568,7 +568,7 @@
hdaView.$el.children( '.dataset-body' ).replaceWith( hdaView._render_body() );
hdaView.$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
hdaView.expanded = true;
- hdaView.trigger( 'body-expanded', hdaView.model.get( 'id' ) );
+ hdaView.trigger( 'body-expanded', hdaView.model );
});
//hdaView.render( false ).$el.children( '.dataset-body' ).slideDown( hdaView.fxSpeed, function(){
@@ -595,7 +595,7 @@
var hdaView = this;
this.$el.children( '.dataset-body' ).slideUp( hdaView.fxSpeed, function(){
hdaView.expanded = false;
- hdaView.trigger( 'body-collapsed', hdaView.model.get( 'id' ) );
+ hdaView.trigger( 'body-collapsed', hdaView.model.id );
});
},
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -12,9 +12,22 @@
* @constructs
*/
var HistoryContent = Backbone.Model.extend( baseMVC.LoggableMixin ).extend( {
+ idAttribute : 'type_id',
/** fetch location of this HDA's history in the api */
urlRoot: galaxy_config.root + 'api/histories/',
+
+ constructor : function( attrs, options ){
+ attrs.type_id = HistoryContent.typeIdStr( attrs.type, attrs.id );
+ Backbone.Model.apply( this, arguments );
+ },
+
+ initialize : function( attrs, options ){
+ // assumes type won't change
+ this.on( 'change:id', this._createTypeId );
+ //TODO: not sure this covers all the bases...
+ },
+
/** full url spec. for this HDA */
url : function(){
return this.urlRoot + this.get( 'history_id' ) + '/contents/' + this.get('history_content_type') + 's/' + this.get( 'id' );
@@ -138,10 +151,19 @@
term = term.replace( /"/g, '' );
return model.matches( term );
});
- }
+ },
+
+ _createTypeId : function(){
+ return ( this.attributes.type_id = [ this.attributes.type, this.attributes.id ].join( '-' ) );
+ },
} );
+/** create a type + id string for use in mixed collections */
+HistoryContent.typeIdStr = function _typeId( type, id ){
+ return [ type, id ].join( '-' );
+};
+
//==============================================================================
/** @class (HDA) model for a Galaxy dataset
* related to a history.
@@ -228,6 +250,10 @@
initialize : function( data ){
this.log( this + '.initialize', this.attributes );
this.log( '\tparent history_id: ' + this.get( 'history_id' ) );
+
+ this._createTypeId();
+ // assumes type won't change
+ this.on( 'change:id', this._createTypeId );
//!! this state is not in trans.app.model.Dataset.states - set it here -
if( !this.get( 'accessible' ) ){
@@ -482,7 +508,7 @@
* @returns array of encoded ids
*/
ids : function(){
- return this.map( function( hda ){ return hda.id; });
+ return this.map( function( hda ){ return hda.get('id'); });
},
/** Get hdas that are not ready
@@ -643,7 +669,7 @@
this.chain().each( function( hda ) {
// TODO: Handle duplicate names.
var name = hda.attributes.name;
- var id = hda.id;
+ var id = hda.get('id');
var content_type = hda.attributes.history_content_type;
if( content_type == "dataset" ) {
if( full_collection_type != "list" ) {
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -236,7 +236,7 @@
// for symmetry, not actually used by backend of consumed
// by frontend.
data[ "dataset_collection_details" ] = hdcaDetailIds.join( ',' );
- }
+ }
return jQuery.ajax( galaxy_config.root + 'api/histories/' + historyData.id + '/contents', { data: data });
}
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -273,7 +273,7 @@
* @param {HistoryDatasetAssociation} hda
*/
_createContentView : function( hda ){
- var hdaId = hda.get( 'id' ),
+ var hdaId = hda.id,
historyContentType = hda.get( 'history_content_type' ),
hdaView = null;
@@ -328,7 +328,7 @@
// only
} else {
- var id = hdaView.model.get( 'id' );
+ var id = hdaView.model.id;
historyView.lastSelectedViewId = id;
//console.debug( 'lastSelectedViewId:', historyView.lastSelectedViewId );
selectedIds = [ id ];
@@ -340,7 +340,7 @@
});
hdaView.on( 'de-selected', function( hdaView, event ){
//console.debug( 'de-selected', event );
- var id = hdaView.model.get( 'id' );
+ var id = hdaView.model.id;
historyView.selectedHdaIds = _.without( historyView.selectedHdaIds, id );
//console.debug( 'de-selected', historyView.selectedHdaIds );
});
diff -r 73b0cb2e679542f197eb12715e05a770c5501e0d -r 74826a57c456f0953482baab07a9b8bd26ab91c4 static/scripts/mvc/history/readonly-history-panel.js
--- a/static/scripts/mvc/history/readonly-history-panel.js
+++ b/static/scripts/mvc/history/readonly-history-panel.js
@@ -18,9 +18,9 @@
//TODO: add scroll position?
},
/** add an hda id to the hash of expanded hdas */
- addExpandedHda : function( id ){
+ addExpandedHda : function( model ){
var key = 'expandedHdas';
- this.save( key, _.extend( this.get( key ), _.object([ id ], [ true ]) ) );
+ this.save( key, _.extend( this.get( key ), _.object([ model.id ], [ model.get( 'id' ) ]) ) );
},
/** remove an hda id from the hash of expanded hdas */
removeExpandedHda : function( id ){
@@ -264,7 +264,7 @@
var hdaDetailIds = function( historyData ){
// will be called to get hda ids that need details from the api
//TODO: non-visible HDAs are getting details loaded... either stop loading them at all or filter ids thru isVisible
- return _.keys( HistoryPrefs.get( historyData.id ).get( 'expandedHdas' ) );
+ return _.values( HistoryPrefs.get( historyData.id ).get( 'expandedHdas' ) );
};
return this.loadHistory( historyId, attributes, historyFn, hdaFn, hdaDetailIds );
},
@@ -591,7 +591,7 @@
if( visibleHdas.length ){
visibleHdas.each( function( hda ){
// render it (NOTE: reverse order, newest on top (prepend))
- var hdaId = hda.get( 'id' ),
+ var hdaId = hda.id,
hdaView = panel._createContentView( hda );
newHdaViews[ hdaId ] = hdaView;
// persist selection
@@ -610,7 +610,7 @@
* @param {HistoryDatasetAssociation} hda
*/
_createContentView : function( hda ){
- var hdaId = hda.get( 'id' ),
+ var hdaId = hda.id,
historyContentType = hda.get( "history_content_type" ),
hdaView = null;
if( historyContentType === "dataset" ){
@@ -646,8 +646,8 @@
panel.errorHandler( model, xhr, options, msg );
});
// maintain a list of hdas whose bodies are expanded
- hdaView.on( 'body-expanded', function( id ){
- panel.storage.addExpandedHda( id );
+ hdaView.on( 'body-expanded', function( model ){
+ panel.storage.addExpandedHda( model );
});
hdaView.on( 'body-collapsed', function( id ){
panel.storage.removeExpandedHda( id );
https://bitbucket.org/galaxy/galaxy-central/commits/e5eae98697a2/
Changeset: e5eae98697a2
User: jmchilton
Date: 2014-06-13 21:41:51
Summary: Pack scripts.
Affected #: 6 files
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/collection/dataset-collection-base.js
--- a/static/scripts/packed/mvc/collection/dataset-collection-base.js
+++ b/static/scripts/packed/mvc/collection/dataset-collection-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(b,a){var c=a.HistoryContentBaseView.extend({className:"dataset hda history-panel-hda",id:function(){return"hdca-"+this.model.get("id")},initialize:function(d){if(d.logger){this.logger=this.model.logger=d.logger}this.log(this+".initialize:",d);this.selectable=d.selectable||false;this.selected=d.selected||false;this.expanded=d.expanded||false},render:function(e){var d=this._buildNewRender();this._queueNewRender(d,e);return this},templateSkeleton:function(){return['<div class="dataset hda">','<div class="dataset-warnings">',"<% if ( deleted ) { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</div>","<% } %>","<% if ( ! visible ) { %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%= hid %></span> ','<span class="dataset-name"><%= name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("")},templateBody:function(){return['<div class="dataset-body">','<div class="dataset-summary">',"A dataset collection.","</div>"].join("")},_buildNewRender:function(){var d=$(_.template(this.templateSkeleton(),this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);return d},_render_titleButtons:function(){return[]},_render_body:function(){var e=$('<div>Error: unknown state "'+this.model.get("state")+'".</div>'),d=this["_render_body_"+this.model.get("state")];if(_.isFunction(d)){e=d.call(this)}this._setUpBehaviors(e);if(this.expanded){e.show()}return e},_setUpBehaviors:function(d){d=d||this.$el;make_popup_menus(d);d.find("[title]").tooltip({placement:"bottom"})},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},expandBody:function(){var d=this;function e(){d.$el.children(".dataset-body").replaceWith(d._render_body());d.$el.children(".dataset-body").slideDown(d.fxSpeed,function(){d.expanded=true;d.trigger("body-expanded",d.model.get("id"))})}e()},collapseBody:function(){var d=this;this.$el.children(".dataset-body").slideUp(d.fxSpeed,function(){d.expanded=false;d.trigger("body-collapsed",d.model.get("id"))})},_render_body_ok:function(){var d=$(_.template(this.templateBody(),this.model.toJSON()));if(this.model.get("deleted")){return d}return d}});return{DatasetCollectionBaseView:c}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(b,a){var c=a.HistoryContentBaseView.extend({className:"dataset hda history-panel-hda",id:function(){return"hdca-"+this.model.get("id")},initialize:function(d){if(d.logger){this.logger=this.model.logger=d.logger}this.log(this+".initialize:",d);this.selectable=d.selectable||false;this.selected=d.selected||false;this.expanded=d.expanded||false},render:function(e){var d=this._buildNewRender();this._queueNewRender(d,e);return this},templateSkeleton:function(){return['<div class="dataset hda">','<div class="dataset-warnings">',"<% if ( deleted ) { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</div>","<% } %>","<% if ( ! visible ) { %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%= hid %></span> ','<span class="dataset-name"><%= name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("")},templateBody:function(){return['<div class="dataset-body">','<div class="dataset-summary">',"A dataset collection.","</div>"].join("")},_buildNewRender:function(){var d=$(_.template(this.templateSkeleton(),this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);return d},_render_titleButtons:function(){return[]},_render_body:function(){var e=$('<div>Error: unknown state "'+this.model.get("state")+'".</div>'),d=this["_render_body_"+this.model.get("state")];if(_.isFunction(d)){e=d.call(this)}this._setUpBehaviors(e);if(this.expanded){e.show()}return e},_setUpBehaviors:function(d){d=d||this.$el;make_popup_menus(d);d.find("[title]").tooltip({placement:"bottom"})},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},expandBody:function(){var d=this;function e(){d.$el.children(".dataset-body").replaceWith(d._render_body());d.$el.children(".dataset-body").slideDown(d.fxSpeed,function(){d.expanded=true;d.trigger("body-expanded",d.model)})}e()},collapseBody:function(){var d=this;this.$el.children(".dataset-body").slideUp(d.fxSpeed,function(){d.expanded=false;d.trigger("body-collapsed",d.model.id)})},_render_body_ok:function(){var d=$(_.template(this.templateBody(),this.model.toJSON()));if(this.model.get("deleted")){return d}return d}});return{DatasetCollectionBaseView:c}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/base-mvc","mvc/data","utils/localization"],function(e,b,g,d){var h=Backbone.View.extend(b.LoggableMixin).extend({tagName:"div",fxSpeed:"fast",_queueNewRender:function(j,k){k=(k===undefined)?(true):(k);var i=this;if(k){$(i).queue(function(l){this.$el.fadeOut(i.fxSpeed,l)})}$(i).queue(function(l){this.$el.empty().attr("class",i.className).addClass("state-"+i.model.get("state")).append(j.children());if(this.selectable){this.showSelector(0)}l()});if(k){$(i).queue(function(l){this.$el.fadeIn(i.fxSpeed,l)})}$(i).queue(function(l){this.trigger("rendered",i);if(this.model.inReadyState()){this.trigger("rendered:ready",i)}if(this.draggable){this.draggableOn()}l()})},toggleBodyVisibility:function(l,j){var i=32,k=13;if(l&&(l.type==="keydown")&&!(l.keyCode===i||l.keyCode===k)){return true}var m=this.$el.find(".dataset-body");j=(j===undefined)?(!m.is(":visible")):(j);if(j){this.expandBody()}else{this.collapseBody()}return false},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(i){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this,i);this.selected=true}return false},deselect:function(i){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this,i);this.selected=false}return false},toggleSelect:function(i){if(this.selected){this.deselect(i)}else{this.select(i)}}});var c=h.extend({className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log(this+".initialize:",i);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=i.linkTarget||"_blank";this.selectable=i.selectable||false;this.selected=i.selected||false;this.expanded=i.expanded||false;this.draggable=i.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(j,i){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(j){this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var i=this._buildNewRender();this._queueNewRender(i,j);return this},_buildNewRender:function(){var i=$(c.templates.skeleton(this.model.toJSON()));i.find(".dataset-primary-actions").append(this._render_titleButtons());i.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(i);return i},_setUpBehaviors:function(i){i=i||this.$el;make_popup_menus(i);i.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===e.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===e.HistoryDatasetAssociation.STATES.DISCARDED)||(!this.model.get("accessible"))){return null}var j={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){j.disabled=true;j.title=d("Cannot display datasets removed from disk")}else{if(this.model.get("state")===e.HistoryDatasetAssociation.STATES.UPLOAD){j.disabled=true;j.title=d("This dataset must finish uploading before it can be viewed")}else{if(this.model.get("state")===e.HistoryDatasetAssociation.STATES.NEW){j.disabled=true;j.title=d("This dataset is not yet viewable")}else{j.title=d("View data");j.href=this.urls.display;var i=this;j.onclick=function(k){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+i.model.get("name"),type:"other",content:function(l){var m=new g.TabularDataset({id:i.model.id});$.when(m.fetch()).then(function(){g.createTabularDatasetChunkedView({model:m,parent_elt:l,embedded:true,height:"100%"})})}});k.preventDefault()}}}}}j.faIcon="fa-eye";return faIconButton(j)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var j=this.urls,k=this.model.get("meta_files");if(_.isEmpty(k)){return $(['<a href="'+j.download+'" title="'+d("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var l="dataset-"+this.model.get("id")+"-popup",i=['<div popupmenu="'+l+'">','<a href="'+j.download+'">',d("Download dataset"),"</a>","<a>"+d("Additional files")+"</a>",_.map(k,function(m){return['<a class="action-button" href="',j.meta_download+m.file_type,'">',d("Download")," ",m.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+j.download+'" title="'+d("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+l+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(i)},_render_showParamsButton:function(){return faIconButton({title:d("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var j=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),i=this["_render_body_"+this.model.get("state")];if(_.isFunction(i)){j=i.call(this)}this._setUpBehaviors(j);if(this.expanded){j.show()}return j},_render_stateBodyHelper:function(i,l){l=l||[];var j=this,k=$(c.templates.body(_.extend(this.model.toJSON(),{body:i})));k.find(".dataset-actions .left").append(_.map(l,function(m){return m.call(j)}));return k},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+d("This is a new dataset and not all of its data are available yet")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+d("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+d("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+d("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+d("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+d("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+d("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+d('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var i=['<span class="help-text">',d("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){i="<div>"+this.model.get("misc_blurb")+"</div>"+i}return this._render_stateBodyHelper(i,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+d("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var i=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(d("An error occurred setting the metadata for this dataset"))),j=this._render_body_ok();j.prepend(i);return j},_render_body_ok:function(){var i=this,k=$(c.templates.body(this.model.toJSON())),j=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);k.find(".dataset-actions .left").append(_.map(j,function(l){return l.call(i)}));if(this.model.isDeletedOrPurged()){return k}return k},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},expandBody:function(){var i=this;function j(){i.$el.children(".dataset-body").replaceWith(i._render_body());i.$el.children(".dataset-body").slideDown(i.fxSpeed,function(){i.expanded=true;i.trigger("body-expanded",i.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(k){i.urls=i.model.urls();j()})}else{j()}},collapseBody:function(){var i=this;this.$el.children(".dataset-body").slideUp(i.fxSpeed,function(){i.expanded=false;i.trigger("body-collapsed",i.model.get("id"))})},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var i=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);i.addEventListener("dragstart",this.dragStartHandler,false);i.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var i=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);i.removeEventListener("dragstart",this.dragStartHandler,false);i.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(i){this.trigger("dragstart",this);i.dataTransfer.effectAllowed="move";i.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(i){this.trigger("dragend",this);return false},remove:function(j){var i=this;this.$el.fadeOut(i.fxSpeed,function(){i.$el.remove();i.off();if(j){j()}})},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+i+")"}});var a=_.template(['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',d("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',d("This dataset has been deleted and removed from disk")+".","</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',d("This dataset has been deleted")+".","</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',d("This dataset has been hidden")+".","</strong></div>","<% } %>","</div>",'<div class="dataset-selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join(""));var f=_.template(['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',d("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',d("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join(""));c.templates={skeleton:function(i){return a({_l:d,hda:i})},body:function(i){return f({_l:d,hda:i})}};return{HistoryContentBaseView:h,HDABaseView:c}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/base-mvc","mvc/data","utils/localization"],function(e,b,g,d){var h=Backbone.View.extend(b.LoggableMixin).extend({tagName:"div",fxSpeed:"fast",_queueNewRender:function(j,k){k=(k===undefined)?(true):(k);var i=this;if(k){$(i).queue(function(l){this.$el.fadeOut(i.fxSpeed,l)})}$(i).queue(function(l){this.$el.empty().attr("class",i.className).addClass("state-"+i.model.get("state")).append(j.children());if(this.selectable){this.showSelector(0)}l()});if(k){$(i).queue(function(l){this.$el.fadeIn(i.fxSpeed,l)})}$(i).queue(function(l){this.trigger("rendered",i);if(this.model.inReadyState()){this.trigger("rendered:ready",i)}if(this.draggable){this.draggableOn()}l()})},toggleBodyVisibility:function(l,j){var i=32,k=13;if(l&&(l.type==="keydown")&&!(l.keyCode===i||l.keyCode===k)){return true}var m=this.$el.find(".dataset-body");j=(j===undefined)?(!m.is(":visible")):(j);if(j){this.expandBody()}else{this.collapseBody()}return false},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(i){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this,i);this.selected=true}return false},deselect:function(i){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this,i);this.selected=false}return false},toggleSelect:function(i){if(this.selected){this.deselect(i)}else{this.select(i)}}});var c=h.extend({className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},initialize:function(i){if(i.logger){this.logger=this.model.logger=i.logger}this.log(this+".initialize:",i);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=i.linkTarget||"_blank";this.selectable=i.selectable||false;this.selected=i.selected||false;this.expanded=i.expanded||false;this.draggable=i.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(j,i){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(j){this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var i=this._buildNewRender();this._queueNewRender(i,j);return this},_buildNewRender:function(){var i=$(c.templates.skeleton(this.model.toJSON()));i.find(".dataset-primary-actions").append(this._render_titleButtons());i.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(i);return i},_setUpBehaviors:function(i){i=i||this.$el;make_popup_menus(i);i.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===e.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===e.HistoryDatasetAssociation.STATES.DISCARDED)||(!this.model.get("accessible"))){return null}var j={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){j.disabled=true;j.title=d("Cannot display datasets removed from disk")}else{if(this.model.get("state")===e.HistoryDatasetAssociation.STATES.UPLOAD){j.disabled=true;j.title=d("This dataset must finish uploading before it can be viewed")}else{if(this.model.get("state")===e.HistoryDatasetAssociation.STATES.NEW){j.disabled=true;j.title=d("This dataset is not yet viewable")}else{j.title=d("View data");j.href=this.urls.display;var i=this;j.onclick=function(k){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+i.model.get("name"),type:"other",content:function(l){var m=new g.TabularDataset({id:i.model.get("id")});$.when(m.fetch()).then(function(){g.createTabularDatasetChunkedView({model:m,parent_elt:l,embedded:true,height:"100%"})})}});k.preventDefault()}}}}}j.faIcon="fa-eye";return faIconButton(j)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var j=this.urls,k=this.model.get("meta_files");if(_.isEmpty(k)){return $(['<a href="'+j.download+'" title="'+d("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var l="dataset-"+this.model.get("id")+"-popup",i=['<div popupmenu="'+l+'">','<a href="'+j.download+'">',d("Download dataset"),"</a>","<a>"+d("Additional files")+"</a>",_.map(k,function(m){return['<a class="action-button" href="',j.meta_download+m.file_type,'">',d("Download")," ",m.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+j.download+'" title="'+d("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+l+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(i)},_render_showParamsButton:function(){return faIconButton({title:d("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var j=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),i=this["_render_body_"+this.model.get("state")];if(_.isFunction(i)){j=i.call(this)}this._setUpBehaviors(j);if(this.expanded){j.show()}return j},_render_stateBodyHelper:function(i,l){l=l||[];var j=this,k=$(c.templates.body(_.extend(this.model.toJSON(),{body:i})));k.find(".dataset-actions .left").append(_.map(l,function(m){return m.call(j)}));return k},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+d("This is a new dataset and not all of its data are available yet")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+d("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+d("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+d("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+d("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+d("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+d("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+d('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var i=['<span class="help-text">',d("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){i="<div>"+this.model.get("misc_blurb")+"</div>"+i}return this._render_stateBodyHelper(i,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+d("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var i=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(d("An error occurred setting the metadata for this dataset"))),j=this._render_body_ok();j.prepend(i);return j},_render_body_ok:function(){var i=this,k=$(c.templates.body(this.model.toJSON())),j=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);k.find(".dataset-actions .left").append(_.map(j,function(l){return l.call(i)}));if(this.model.isDeletedOrPurged()){return k}return k},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},expandBody:function(){var i=this;function j(){i.$el.children(".dataset-body").replaceWith(i._render_body());i.$el.children(".dataset-body").slideDown(i.fxSpeed,function(){i.expanded=true;i.trigger("body-expanded",i.model)})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(k){i.urls=i.model.urls();j()})}else{j()}},collapseBody:function(){var i=this;this.$el.children(".dataset-body").slideUp(i.fxSpeed,function(){i.expanded=false;i.trigger("body-collapsed",i.model.id)})},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var i=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);i.addEventListener("dragstart",this.dragStartHandler,false);i.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var i=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);i.removeEventListener("dragstart",this.dragStartHandler,false);i.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(i){this.trigger("dragstart",this);i.dataTransfer.effectAllowed="move";i.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(i){this.trigger("dragend",this);return false},remove:function(j){var i=this;this.$el.fadeOut(i.fxSpeed,function(){i.$el.remove();i.off();if(j){j()}})},toString:function(){var i=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+i+")"}});var a=_.template(['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',d("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',d("This dataset has been deleted and removed from disk")+".","</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',d("This dataset has been deleted")+".","</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',d("This dataset has been hidden")+".","</strong></div>","<% } %>","</div>",'<div class="dataset-selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join(""));var f=_.template(['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',d("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',d("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join(""));c.templates={skeleton:function(i){return a({_l:d,hda:i})},body:function(i){return f({_l:d,hda:i})}};return{HistoryContentBaseView:h,HDABaseView:c}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/dataset/hda-model.js
--- a/static/scripts/packed/mvc/dataset/hda-model.js
+++ b/static/scripts/packed/mvc/dataset/hda-model.js
@@ -1,1 +1,1 @@
-define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},isVisible:function(n,o){var m=true;if((!n)&&(this.get("deleted")||this.get("purged"))){m=false}if((!o)&&(!this.get("visible"))){m=false}return m},searchAttribute:function(o,m){var n=this.get(o);if(!m||(n===undefined||n===null)){return false}if(_.isArray(n)){return this._searchArrayAttribute(n,m)}return(n.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)},_searchArrayAttribute:function(n,m){m=m.toLowerCase();return _.any(n,function(o){return(o.toString().toLowerCase().indexOf(m.toLowerCase())!==-1)})},search:function(m){var n=this;return _.filter(this.searchAttributes,function(o){return n.searchAttribute(o,m)})},matches:function(n){var p="=",m=n.split(p);if(m.length>=2){var o=m[0];o=this.searchAliases[o]||o;return this.searchAttribute(o,m[1])}return !!this.search(n).length},matchesAll:function(n){var m=this;n=n.match(/(".*"|\w*=".*"|\S*)/g).filter(function(o){return !!o});return _.all(n,function(o){o=o.replace(/"/g,"");return m.matches(o)})}});var l=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var n=this.get("id");if(!n){return{}}var m={purge:galaxy_config.root+"datasets/"+n+"/purge_async",display:galaxy_config.root+"datasets/"+n+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+n+"/edit",download:galaxy_config.root+"datasets/"+n+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+n,rerun:galaxy_config.root+"tool_runner/rerun?id="+n,show_params:galaxy_config.root+"datasets/"+n+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+n,set:galaxy_config.root+"dataset/annotate_async?id="+n},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+n+"&metadata_name="};return m},initialize:function(m){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",l.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(n,m){this.log(this+" has changed state:",n,m);if(this.inReadyState()){this.trigger("state:ready",n,m,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var m=_.contains(l.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||m)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(m){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},m)},undelete:function i(m){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},m)},hide:function d(m){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},m)},unhide:function h(m){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},m)},purge:function g(m){if(this.get("purged")){return jQuery.when()}m=m||{};m.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var n=this,o=jQuery.ajax(m);o.done(function(r,p,q){n.set({deleted:true,purged:true})});o.fail(function(t,p,s){var q=c("Unable to purge dataset");var r=("Removal of datasets by users is not allowed in this Galaxy instance");if(t.responseJSON&&t.responseJSON.error){q=t.responseJSON.error}else{if(t.responseText.indexOf(r)!==-1){q=r}}t.responseText=q;n.trigger("error",n,t,m,c(q),{error:q})});return o},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var m=this.get("id")||"";if(this.get("name")){m=this.get("hid")+' :"'+this.get("name")+'",'+m}return"HDA("+m+")"}});l.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};l.READY_STATES=[l.STATES.OK,l.STATES.EMPTY,l.STATES.PAUSED,l.STATES.FAILED_METADATA,l.STATES.NOT_VIEWABLE,l.STATES.DISCARDED,l.STATES.ERROR];l.NOT_READY_STATES=[l.STATES.UPLOAD,l.STATES.QUEUED,l.STATES.RUNNING,l.STATES.SETTING_METADATA,l.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(n,m){if(n.history_content_type=="dataset"){return new l(n,m)}else{if(n.history_content_type=="dataset_collection"){return new j(n,m)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(n,m){m=m||{};this.historyId=m.historyId},ids:function(){return this.map(function(m){return m.id})},notReady:function(){return this.filter(function(m){return !m.inReadyState()})},running:function(){var m=[];this.each(function(n){if(!n.inReadyState()){m.push(n.get("id"))}});return m},getByHid:function(m){return _.first(this.filter(function(n){return n.get("hid")===m}))},getVisible:function(m,p,o){o=o||[];var n=new b(this.filter(function(q){return q.isVisible(m,p)}));_.each(o,function(q){if(!_.isFunction(q)){return}n=new b(n.filter(q))});return n},haveDetails:function(){return this.all(function(m){return m.hasDetails()})},fetchAllDetails:function(n){n=n||{};var m={details:"all"};n.data=(n.data)?(_.extend(n.data,m)):(m);return this.fetch(n)},ajaxQueue:function(p,o){var n=jQuery.Deferred(),m=this.length,r=[];if(!m){n.resolve([]);return n}var q=this.chain().reverse().map(function(t,s){return function(){var u=p.call(t,o);u.done(function(v){n.notify({curr:s,total:m,response:v,model:t})});u.always(function(v){r.push(v);if(q.length){q.shift()()}else{n.resolve(r)}})}}).value();q.shift()();return n},matches:function(m){return this.filter(function(n){return n.matches(m)})},set:function(o,m){var n=this;o=_.map(o,function(q){var r=n.get(q.id);if(!r){return q}var p=r.toJSON();_.extend(p,q);return p});Backbone.Collection.prototype.set.call(this,o,m)},promoteToHistoryDatasetCollection:function k(r,p,n){n=n||{};n.url=this.url();n.type="POST";var t=p;var q=[],m=null;if(p=="list"){this.chain().each(function(w){var u=w.attributes.name;var x=w.id;var v=w.attributes.history_content_type;if(v=="dataset"){if(t!="list"){console.log("Invalid collection type")}q.push({name:u,src:"hda",id:x})}else{if(t=="list"){t="list:"+w.attributes.collection_type}else{if(t!="list:"+w.attributes.collection_type){console.log("Invalid collection type")}}q.push({name:u,src:"hdca",id:x})}});m="New Dataset List"}else{if(p=="paired"){var o=this.ids();if(o.length!=2){}q.push({name:"forward",src:"hda",id:o[0]});q.push({name:"reverse",src:"hda",id:o[1]});m="New Dataset Pair"}}n.data={type:"dataset_collection",name:m,collection_type:t,element_identifiers:JSON.stringify(q),};var s=jQuery.ajax(n);s.done(function(w,u,v){r.refresh()});s.fail(function(w,u,v){if(w.responseJSON&&w.responseJSON.error){error=w.responseJSON.error}else{error=w.responseJSON}w.responseText=error});return s},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var j=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:l,HDACollection:b}});
\ No newline at end of file
+define(["mvc/base-mvc","utils/localization"],function(e,c){var a=Backbone.Model.extend(e.LoggableMixin).extend({idAttribute:"type_id",urlRoot:galaxy_config.root+"api/histories/",constructor:function(o,n){o.type_id=a.typeIdStr(o.type,o.id);Backbone.Model.apply(this,arguments)},initialize:function(o,n){this.on("change:id",this._createTypeId)},url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("history_content_type")+"s/"+this.get("id")},hidden:function(){return !this.get("visible")},"delete":function f(n){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},n)},undelete:function j(n){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},n)},hide:function d(n){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},n)},unhide:function i(n){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},n)},isVisible:function(o,p){var n=true;if((!o)&&(this.get("deleted")||this.get("purged"))){n=false}if((!p)&&(!this.get("visible"))){n=false}return n},searchAttribute:function(p,n){var o=this.get(p);if(!n||(o===undefined||o===null)){return false}if(_.isArray(o)){return this._searchArrayAttribute(o,n)}return(o.toString().toLowerCase().indexOf(n.toLowerCase())!==-1)},_searchArrayAttribute:function(o,n){n=n.toLowerCase();return _.any(o,function(p){return(p.toString().toLowerCase().indexOf(n.toLowerCase())!==-1)})},search:function(n){var o=this;return _.filter(this.searchAttributes,function(p){return o.searchAttribute(p,n)})},matches:function(o){var q="=",n=o.split(q);if(n.length>=2){var p=n[0];p=this.searchAliases[p]||p;return this.searchAttribute(p,n[1])}return !!this.search(o).length},matchesAll:function(o){var n=this;o=o.match(/(".*"|\w*=".*"|\S*)/g).filter(function(p){return !!p});return _.all(o,function(p){p=p.replace(/"/g,"");return n.matches(p)})},_createTypeId:function(){return(this.attributes.type_id=[this.attributes.type,this.attributes.id].join("-"))},});a.typeIdStr=function h(n,o){return[n,o].join("-")};var m=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",history_content_type:"dataset",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urls:function(){var o=this.get("id");if(!o){return{}}var n={purge:galaxy_config.root+"datasets/"+o+"/purge_async",display:galaxy_config.root+"datasets/"+o+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+o+"/edit",download:galaxy_config.root+"datasets/"+o+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+o,rerun:galaxy_config.root+"tool_runner/rerun?id="+o,show_params:galaxy_config.root+"datasets/"+o+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+o,set:galaxy_config.root+"dataset/annotate_async?id="+o},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+o+"&metadata_name="};return n},initialize:function(n){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));this._createTypeId();this.on("change:id",this._createTypeId);if(!this.get("accessible")){this.set("state",m.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(o,n){this.log(this+" has changed state:",o,n);if(this.inReadyState()){this.trigger("state:ready",o,n,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},inReadyState:function(){var n=_.contains(m.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||n)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function f(n){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},n)},undelete:function j(n){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},n)},hide:function d(n){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},n)},unhide:function i(n){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},n)},purge:function g(n){if(this.get("purged")){return jQuery.when()}n=n||{};n.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var o=this,p=jQuery.ajax(n);p.done(function(s,q,r){o.set({deleted:true,purged:true})});p.fail(function(u,q,t){var r=c("Unable to purge dataset");var s=("Removal of datasets by users is not allowed in this Galaxy instance");if(u.responseJSON&&u.responseJSON.error){r=u.responseJSON.error}else{if(u.responseText.indexOf(s)!==-1){r=s}}u.responseText=r;o.trigger("error",o,u,n,c(r),{error:r})});return p},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},toString:function(){var n=this.get("id")||"";if(this.get("name")){n=this.get("hid")+' :"'+this.get("name")+'",'+n}return"HDA("+n+")"}});m.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};m.READY_STATES=[m.STATES.OK,m.STATES.EMPTY,m.STATES.PAUSED,m.STATES.FAILED_METADATA,m.STATES.NOT_VIEWABLE,m.STATES.DISCARDED,m.STATES.ERROR];m.NOT_READY_STATES=[m.STATES.UPLOAD,m.STATES.QUEUED,m.STATES.RUNNING,m.STATES.SETTING_METADATA,m.STATES.NEW];var b=Backbone.Collection.extend(e.LoggableMixin).extend({model:function(o,n){if(o.history_content_type=="dataset"){return new m(o,n)}else{if(o.history_content_type=="dataset_collection"){return new k(o,n)}else{}}},urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(o,n){n=n||{};this.historyId=n.historyId},ids:function(){return this.map(function(n){return n.get("id")})},notReady:function(){return this.filter(function(n){return !n.inReadyState()})},running:function(){var n=[];this.each(function(o){if(!o.inReadyState()){n.push(o.get("id"))}});return n},getByHid:function(n){return _.first(this.filter(function(o){return o.get("hid")===n}))},getVisible:function(n,q,p){p=p||[];var o=new b(this.filter(function(r){return r.isVisible(n,q)}));_.each(p,function(r){if(!_.isFunction(r)){return}o=new b(o.filter(r))});return o},haveDetails:function(){return this.all(function(n){return n.hasDetails()})},fetchAllDetails:function(o){o=o||{};var n={details:"all"};o.data=(o.data)?(_.extend(o.data,n)):(n);return this.fetch(o)},ajaxQueue:function(q,p){var o=jQuery.Deferred(),n=this.length,s=[];if(!n){o.resolve([]);return o}var r=this.chain().reverse().map(function(u,t){return function(){var v=q.call(u,p);v.done(function(w){o.notify({curr:t,total:n,response:w,model:u})});v.always(function(w){s.push(w);if(r.length){r.shift()()}else{o.resolve(s)}})}}).value();r.shift()();return o},matches:function(n){return this.filter(function(o){return o.matches(n)})},set:function(p,n){var o=this;p=_.map(p,function(r){var s=o.get(r.id);if(!s){return r}var q=s.toJSON();_.extend(q,r);return q});Backbone.Collection.prototype.set.call(this,p,n)},promoteToHistoryDatasetCollection:function l(s,q,o){o=o||{};o.url=this.url();o.type="POST";var u=q;var r=[],n=null;if(q=="list"){this.chain().each(function(x){var v=x.attributes.name;var y=x.get("id");var w=x.attributes.history_content_type;if(w=="dataset"){if(u!="list"){console.log("Invalid collection type")}r.push({name:v,src:"hda",id:y})}else{if(u=="list"){u="list:"+x.attributes.collection_type}else{if(u!="list:"+x.attributes.collection_type){console.log("Invalid collection type")}}r.push({name:v,src:"hdca",id:y})}});n="New Dataset List"}else{if(q=="paired"){var p=this.ids();if(p.length!=2){}r.push({name:"forward",src:"hda",id:p[0]});r.push({name:"reverse",src:"hda",id:p[1]});n="New Dataset Pair"}}o.data={type:"dataset_collection",name:n,collection_type:u,element_identifiers:JSON.stringify(r),};var t=jQuery.ajax(o);t.done(function(x,v,w){s.refresh()});t.fail(function(x,v,w){if(x.responseJSON&&x.responseJSON.error){error=x.responseJSON.error}else{error=x.responseJSON}x.responseText=error});return t},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});var k=a.extend({defaults:{history_id:null,model_class:"HistoryDatasetCollectionAssociation",history_content_type:"dataset_collection",hid:0,id:null,name:"(unnamed dataset collection)",state:"ok",accessible:true,deleted:false,visible:true,purged:false,tags:[],annotation:""},urls:function(){},inReadyState:function(){return true},searchAttributes:["name"],searchAliases:{title:"name"},});return{HistoryDatasetAssociation:m,HDACollection:b}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/history/history-model.js
--- a/static/scripts/packed/mvc/history/history-model.js
+++ b/static/scripts/packed/mvc/history/history-model.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/base-mvc","utils/localization"],function(c,a,b){var e=Backbone.Model.extend(a.LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",initialize:function(h,i,g){g=g||{};this.logger=g.logger||null;this.log(this+".initialize:",h,i,g);this.hdas=new c.HDACollection(i||[],{historyId:this.get("id")});if(i&&_.isArray(i)){this.hdas.reset(i)}this._setUpListeners();this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(h,k,g,j,i){this.errorHandler(h,k,g,j,i)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(h,g){if(this.hdas){this.hdas.historyId=g}},this)},errorHandler:function(h,k,g,j,i){this.clearUpdateTimeout()},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(g,h){return g+h},0)},checkForUpdates:function(g){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(g)){g.call(this)}}return this},setUpdateTimeout:function(g){g=g||e.UPDATE_DELAY;var h=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){h.refresh()},g);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(h,g){h=h||[];g=g||{};var i=this;g.data=g.data||{};if(h.length){g.data.details=h.join(",")}var j=this.hdas.fetch(g);j.done(function(k){i.checkForUpdates(function(){this.fetch()})});return j},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});e.UPDATE_DELAY=4000;e.getHistoryData=function f(h,r){r=r||{};var l=r.hdaDetailIds||[];var n=jQuery.Deferred(),m=null;function i(s){return jQuery.ajax(galaxy_config.root+"api/histories/"+h)}function g(s){if(!s||!s.state_ids){return 0}return _.reduce(s.state_ids,function(t,v,u){return t+v.length},0)}function q(t){if(!g(t)){return[]}if(_.isFunction(l)){l=l(t)}var s=(l.length)?({details:l.join(",")}):({});return jQuery.ajax(galaxy_config.root+"api/histories/"+t.id+"/contents",{data:s})}var p=r.historyFn||i,o=r.hdaFn||q;var k=p(h);k.done(function(s){m=s;n.notify({status:"history data retrieved",historyJSON:m})});k.fail(function(u,s,t){n.reject(u,"loading the history")});var j=k.then(o);j.then(function(s){n.notify({status:"dataset data retrieved",historyJSON:m,hdaJSON:s});n.resolve(m,s)});j.fail(function(u,s,t){n.reject(u,"loading the datasets",{history:m})});return n};var d=Backbone.Collection.extend(a.LoggableMixin).extend({model:e,urlRoot:galaxy_config.root+"api/histories"});return{History:e,HistoryCollection:d}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/base-mvc","utils/localization"],function(c,a,b){var e=Backbone.Model.extend(a.LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",initialize:function(h,i,g){g=g||{};this.logger=g.logger||null;this.log(this+".initialize:",h,i,g);this.hdas=new c.HDACollection(i||[],{historyId:this.get("id")});if(i&&_.isArray(i)){this.hdas.reset(i)}this._setUpListeners();this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(h,k,g,j,i){this.errorHandler(h,k,g,j,i)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(h,g){if(this.hdas){this.hdas.historyId=g}},this)},errorHandler:function(h,k,g,j,i){this.clearUpdateTimeout()},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(g,h){return g+h},0)},checkForUpdates:function(g){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(g)){g.call(this)}}return this},setUpdateTimeout:function(g){g=g||e.UPDATE_DELAY;var h=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){h.refresh()},g);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(h,g){h=h||[];g=g||{};var i=this;g.data=g.data||{};if(h.length){g.data.details=h.join(",")}var j=this.hdas.fetch(g);j.done(function(k){i.checkForUpdates(function(){this.fetch()})});return j},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});e.UPDATE_DELAY=4000;e.getHistoryData=function f(h,s){s=s||{};var m=s.hdaDetailIds||[];var j=s.hdcaDetailIds||[];var o=jQuery.Deferred(),n=null;function i(t){return jQuery.ajax(galaxy_config.root+"api/histories/"+h)}function g(t){if(!t||!t.state_ids){return 0}return _.reduce(t.state_ids,function(u,w,v){return u+w.length},0)}function r(u){if(!g(u)){return[]}if(_.isFunction(m)){m=m(u)}if(_.isFunction(j)){j=j(u)}var t={};if(m.length){t.dataset_details=m.join(",")}if(j.length){t.dataset_collection_details=j.join(",")}return jQuery.ajax(galaxy_config.root+"api/histories/"+u.id+"/contents",{data:t})}var q=s.historyFn||i,p=s.hdaFn||r;var l=q(h);l.done(function(t){n=t;o.notify({status:"history data retrieved",historyJSON:n})});l.fail(function(v,t,u){o.reject(v,"loading the history")});var k=l.then(p);k.then(function(t){o.notify({status:"dataset data retrieved",historyJSON:n,hdaJSON:t});o.resolve(n,t)});k.fail(function(v,t,u){o.reject(v,"loading the datasets",{history:n})});return o};var d=Backbone.Collection.extend(a.LoggableMixin).extend({model:e,urlRoot:galaxy_config.root+"api/histories"});return{History:e,HistoryCollection:d}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/collection/dataset-collection-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations","utils/localization"],function(f,b,h,d,a,c,e){var g=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(i){i=i||{};this.selectedHdaIds=[];this.lastSelectedViewId=null;this.tagsEditor=null;this.annotationEditor=null;this.purgeAllowed=i.purgeAllowed||false;this.selecting=i.selecting||false;this.annotationEditorShown=i.annotationEditorShown||false;this.tagsEditorShown=i.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,i)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(i){this.model.fetch()},this)},renderModel:function(){var i=$("<div/>");i.append(g.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(i).text(this.emptyMsg);if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(i);this._renderAnnotation(i)}i.find(".history-secondary-actions").prepend(this._renderSelectButton());i.find(".history-dataset-actions").toggle(this.selecting);i.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(i);this.renderHdas(i);return i},_renderTags:function(i){var j=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:i.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){j.toggleHDATagEditors(true,j.fxSpeed)},onhide:function(){j.toggleHDATagEditors(false,j.fxSpeed)},$activator:faIconButton({title:e("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(i.find(".history-secondary-actions"))})},_renderAnnotation:function(i){var j=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:i.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){j.toggleHDAAnnotationEditors(true,j.fxSpeed)},onhide:function(){j.toggleHDAAnnotationEditors(false,j.fxSpeed)},$activator:faIconButton({title:e("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(i.find(".history-secondary-actions"))})},_renderSelectButton:function(i){return faIconButton({title:e("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(i){i=i||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,i);if(!this.model){return}this._setUpDatasetActionsPopup(i);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var j=this;i.find(".history-name").attr("title",e("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(k){var l=j.model.get("name");if(k&&k!==l){j.$el.find(".history-name").text(k);j.model.save({name:k}).fail(function(){j.$el.find(".history-name").text(j.model.previous("name"))})}else{j.$el.find(".history-name").text(l)}}})},_setUpDatasetActionsPopup:function(i){var j=this,k=[{html:e("Hide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.hide;j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Unhide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.unhide;j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Delete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype["delete"];j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Undelete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.undelete;j.getSelectedHdaCollection().ajaxQueue(l)}}];if(j.purgeAllowed){k.push({html:e("Permanently delete datasets"),func:function(){if(confirm(e("This will permanently remove the data in your datasets. Are you sure?"))){var l=f.HistoryDatasetAssociation.prototype.purge;j.getSelectedHdaCollection().ajaxQueue(l)}}})}k.push({html:e("Build Dataset List (Experimental)"),func:function(){j.getSelectedHdaCollection().promoteToHistoryDatasetCollection(j.model,"list")}});k.push({html:e("Build Dataset Pair (Experimental)"),func:function(){j.getSelectedHdaCollection().promoteToHistoryDatasetCollection(j.model,"paired")}});return new PopupMenu(i.find(".history-dataset-action-popup-btn"),k)},_handleHdaDeletionChange:function(i){if(i.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[i.id])}},_handleHdaVisibleChange:function(i){if(i.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[i.id])}},_createContentView:function(j){var i=j.get("id"),l=j.get("history_content_type"),k=null;if(l==="dataset"){k=new this.HDAViewClass({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],selectable:this.selecting,purgeAllowed:this.purgeAllowed,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)})}else{if(l==="dataset_collection"){k=new h.DatasetCollectionEditView({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}}this._setUpHdaListeners(k);return k},_setUpHdaListeners:function(j){var i=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,j);j.on("selected",function(m,l){if(!l){return}var k=[];if((l.shiftKey)&&(i.lastSelectedViewId&&_.has(i.hdaViews,i.lastSelectedViewId))){var o=i.hdaViews[i.lastSelectedViewId];k=i.selectDatasetRange(m,o).map(function(p){return p.model.id})}else{var n=m.model.get("id");i.lastSelectedViewId=n;k=[n]}i.selectedHdaIds=_.union(i.selectedHdaIds,k)});j.on("de-selected",function(l,k){var m=l.model.get("id");i.selectedHdaIds=_.without(i.selectedHdaIds,m)})},toggleHDATagEditors:function(i){var j=arguments;_.each(this.hdaViews,function(k){if(k.tagsEditor){k.tagsEditor.toggle.apply(k.tagsEditor,j)}})},toggleHDAAnnotationEditors:function(i){var j=arguments;_.each(this.hdaViews,function(k){if(k.annotationEditor){k.annotationEditor.toggle.apply(k.annotationEditor,j)}})},removeHdaView:function(j){if(!j){return}var i=this;j.$el.fadeOut(i.fxSpeed,function(){j.off();j.remove();delete i.hdaViews[j.model.id];if(_.isEmpty(i.hdaViews)){i.trigger("empty-history",i);i._renderEmptyMsg()}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":"toggleSelectors","click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(i){i=(i!==undefined)?(i):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(i);_.each(this.hdaViews,function(j){j.showSelector()});this.selectedHdaIds=[];this.lastSelectedViewId=null},hideSelectors:function(i){i=(i!==undefined)?(i):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(i);_.each(this.hdaViews,function(j){j.hideSelector()});this.selectedHdaIds=[];this.lastSelectedViewId=null},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(i){_.each(this.hdaViews,function(j){j.select(i)})},deselectAllDatasets:function(i){this.lastSelectedViewId=null;_.each(this.hdaViews,function(j){j.deselect(i)})},selectDatasetRange:function(k,j){var i=this.hdaViewRange(k,j);_.each(i,function(l){l.select()});return i},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(i){return i.selected})},getSelectedHdaCollection:function(){return new f.HDACollection(_.map(this.getSelectedHdaViews(),function(i){return i.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:g}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/collection/dataset-collection-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations","utils/localization"],function(f,b,h,d,a,c,e){var g=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(i){i=i||{};this.selectedHdaIds=[];this.lastSelectedViewId=null;this.tagsEditor=null;this.annotationEditor=null;this.purgeAllowed=i.purgeAllowed||false;this.selecting=i.selecting||false;this.annotationEditorShown=i.annotationEditorShown||false;this.tagsEditorShown=i.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,i)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(i){this.model.fetch()},this)},renderModel:function(){var i=$("<div/>");i.append(g.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(i).text(this.emptyMsg);if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(i);this._renderAnnotation(i)}i.find(".history-secondary-actions").prepend(this._renderSelectButton());i.find(".history-dataset-actions").toggle(this.selecting);i.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(i);this.renderHdas(i);return i},_renderTags:function(i){var j=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:i.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){j.toggleHDATagEditors(true,j.fxSpeed)},onhide:function(){j.toggleHDATagEditors(false,j.fxSpeed)},$activator:faIconButton({title:e("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(i.find(".history-secondary-actions"))})},_renderAnnotation:function(i){var j=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:i.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){j.toggleHDAAnnotationEditors(true,j.fxSpeed)},onhide:function(){j.toggleHDAAnnotationEditors(false,j.fxSpeed)},$activator:faIconButton({title:e("Edit history annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(i.find(".history-secondary-actions"))})},_renderSelectButton:function(i){return faIconButton({title:e("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(i){i=i||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,i);if(!this.model){return}this._setUpDatasetActionsPopup(i);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var j=this;i.find(".history-name").attr("title",e("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(k){var l=j.model.get("name");if(k&&k!==l){j.$el.find(".history-name").text(k);j.model.save({name:k}).fail(function(){j.$el.find(".history-name").text(j.model.previous("name"))})}else{j.$el.find(".history-name").text(l)}}})},_setUpDatasetActionsPopup:function(i){var j=this,k=[{html:e("Hide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.hide;j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Unhide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.unhide;j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Delete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype["delete"];j.getSelectedHdaCollection().ajaxQueue(l)}},{html:e("Undelete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.undelete;j.getSelectedHdaCollection().ajaxQueue(l)}}];if(j.purgeAllowed){k.push({html:e("Permanently delete datasets"),func:function(){if(confirm(e("This will permanently remove the data in your datasets. Are you sure?"))){var l=f.HistoryDatasetAssociation.prototype.purge;j.getSelectedHdaCollection().ajaxQueue(l)}}})}k.push({html:e("Build Dataset List (Experimental)"),func:function(){j.getSelectedHdaCollection().promoteToHistoryDatasetCollection(j.model,"list")}});k.push({html:e("Build Dataset Pair (Experimental)"),func:function(){j.getSelectedHdaCollection().promoteToHistoryDatasetCollection(j.model,"paired")}});return new PopupMenu(i.find(".history-dataset-action-popup-btn"),k)},_handleHdaDeletionChange:function(i){if(i.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[i.id])}},_handleHdaVisibleChange:function(i){if(i.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[i.id])}},_createContentView:function(j){var i=j.id,l=j.get("history_content_type"),k=null;if(l==="dataset"){k=new this.HDAViewClass({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],selectable:this.selecting,purgeAllowed:this.purgeAllowed,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)})}else{if(l==="dataset_collection"){k=new h.DatasetCollectionEditView({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}}this._setUpHdaListeners(k);return k},_setUpHdaListeners:function(j){var i=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,j);j.on("selected",function(m,l){if(!l){return}var k=[];if((l.shiftKey)&&(i.lastSelectedViewId&&_.has(i.hdaViews,i.lastSelectedViewId))){var o=i.hdaViews[i.lastSelectedViewId];k=i.selectDatasetRange(m,o).map(function(p){return p.model.id})}else{var n=m.model.id;i.lastSelectedViewId=n;k=[n]}i.selectedHdaIds=_.union(i.selectedHdaIds,k)});j.on("de-selected",function(l,k){var m=l.model.id;i.selectedHdaIds=_.without(i.selectedHdaIds,m)})},toggleHDATagEditors:function(i){var j=arguments;_.each(this.hdaViews,function(k){if(k.tagsEditor){k.tagsEditor.toggle.apply(k.tagsEditor,j)}})},toggleHDAAnnotationEditors:function(i){var j=arguments;_.each(this.hdaViews,function(k){if(k.annotationEditor){k.annotationEditor.toggle.apply(k.annotationEditor,j)}})},removeHdaView:function(j){if(!j){return}var i=this;j.$el.fadeOut(i.fxSpeed,function(){j.off();j.remove();delete i.hdaViews[j.model.id];if(_.isEmpty(i.hdaViews)){i.trigger("empty-history",i);i._renderEmptyMsg()}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":"toggleSelectors","click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(i){i=(i!==undefined)?(i):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(i);_.each(this.hdaViews,function(j){j.showSelector()});this.selectedHdaIds=[];this.lastSelectedViewId=null},hideSelectors:function(i){i=(i!==undefined)?(i):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(i);_.each(this.hdaViews,function(j){j.hideSelector()});this.selectedHdaIds=[];this.lastSelectedViewId=null},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(i){_.each(this.hdaViews,function(j){j.select(i)})},deselectAllDatasets:function(i){this.lastSelectedViewId=null;_.each(this.hdaViews,function(j){j.deselect(i)})},selectDatasetRange:function(k,j){var i=this.hdaViewRange(k,j);_.each(i,function(l){l.select()});return i},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(i){return i.selected})},getSelectedHdaCollection:function(){return new f.HDACollection(_.map(this.getSelectedHdaViews(),function(i){return i.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:g}});
\ No newline at end of file
diff -r 74826a57c456f0953482baab07a9b8bd26ab91c4 -r e5eae98697a2f5bc4fdab711ebc1ae8d48ccde20 static/scripts/packed/mvc/history/readonly-history-panel.js
--- a/static/scripts/packed/mvc/history/readonly-history-panel.js
+++ b/static/scripts/packed/mvc/history/readonly-history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/collection/dataset-collection-base","mvc/dataset/hda-base","mvc/user/user-model","mvc/base-mvc","utils/localization"],function(g,k,b,a,f,d){var i=f.SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(n){var m="expandedHdas";this.save(m,_.extend(this.get(m),_.object([n],[true])))},removeExpandedHda:function(n){var m="expandedHdas";this.save(m,_.omit(this.get(m),n))},toString:function(){return"HistoryPrefs("+this.id+")"}});i.storageKeyPrefix="history:";i.historyStorageKey=function e(m){if(!m){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+m)}return(i.storageKeyPrefix+m)};i.get=function c(m){return new i({id:i.historyStorageKey(m)})};i.clearAll=function h(n){for(var m in sessionStorage){if(m.indexOf(i.storageKeyPrefix)===0){sessionStorage.removeItem(m)}}};var j=Backbone.View.extend(f.LoggableMixin).extend({HDAViewClass:b.HDABaseView,tagName:"div",className:"history-panel",fxSpeed:"fast",emptyMsg:d("This history is empty"),noneFoundMsg:d("No matching datasets found"),initialize:function(m){m=m||{};if(m.logger){this.logger=m.logger}this.log(this+".initialize:",m);this.linkTarget=m.linkTarget||"_blank";this.fxSpeed=_.has(m,"fxSpeed")?(m.fxSpeed):(this.fxSpeed);this.filters=[];this.searchFor="";this.findContainerFn=m.findContainerFn;this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this._setUpListeners();var n=_.pick(m,"initiallyExpanded","show_deleted","show_hidden");this.setModel(this.model,n,false);if(m.onready){m.onready.call(this)}},_setUpListeners:function(){this.on("error",function(n,q,m,p,o){this.errorHandler(n,q,m,p,o)});this.on("loading-history",function(){this._showLoadingIndicator("loading history...",40)});this.on("loading-done",function(){this._hideLoadingIndicator(40);if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});if(this.logger){this.on("all",function(m){this.log(this+"",arguments)},this)}return this},errorHandler:function(o,r,n,q,p){console.error(o,r,n,q,p);if(r&&r.status===0&&r.readyState===0){}else{if(r&&r.status===502){}else{var m=this._parseErrorMessage(o,r,n,q,p);if(!this.$messages().is(":visible")){this.once("rendered",function(){this.displayMessage("error",m.message,m.details)})}else{this.displayMessage("error",m.message,m.details)}}}},_parseErrorMessage:function(p,t,o,s,r){var n=Galaxy.currUser,m={message:this._bePolite(s),details:{user:(n instanceof a.User)?(n.toJSON()):(n+""),source:(p instanceof Backbone.Model)?(p.toJSON()):(p+""),xhr:t,options:(t)?(_.omit(o,"xhr")):(o)}};_.extend(m.details,r||{});if(t&&_.isFunction(t.getAllResponseHeaders)){var q=t.getAllResponseHeaders();q=_.compact(q.split("\n"));q=_.map(q,function(u){return u.split(": ")});m.details.xhr.responseHeaders=_.object(q)}return m},_bePolite:function(m){m=m||d("An error occurred while getting updates from the server");return m+". "+d("Please contact a Galaxy administrator if the problem persists")+"."},loadHistoryWithHDADetails:function(o,n,m,q){var p=function(r){return _.keys(i.get(r.id).get("expandedHdas"))};return this.loadHistory(o,n,m,q,p)},loadHistory:function(p,o,n,s,q){var m=this;o=o||{};m.trigger("loading-history",m);var r=g.History.getHistoryData(p,{historyFn:n,hdaFn:s,hdaDetailIds:o.initiallyExpanded||q});return m._loadHistoryFromXHR(r,o).fail(function(v,t,u){m.trigger("error",m,v,o,d("An error was encountered while "+t),{historyId:p,history:u||{}})}).always(function(){m.trigger("loading-done",m)})},_loadHistoryFromXHR:function(o,n){var m=this;o.then(function(p,q){m.JSONToModel(p,q,n)});o.fail(function(q,p){m.render()});return o},JSONToModel:function(p,m,n){this.log("JSONToModel:",p,m,n);n=n||{};var o=new g.History(p,m,n);this.setModel(o);return this},setModel:function(n,m,o){m=m||{};o=(o!==undefined)?(o):(true);this.log("setModel:",n,m,o);this.freeModel();this.selectedHdaIds=[];if(n){this.model=n;if(this.logger){this.model.logger=this.logger}this._setUpWebStorage(m.initiallyExpanded,m.show_deleted,m.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this)}if(o){this.render()}return this},freeModel:function(){if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.freeHdaViews();return this},freeHdaViews:function(){this.hdaViews={};return this},_setUpWebStorage:function(n,m,o){this.storage=new i({id:i.historyStorageKey(this.model.get("id"))});if(_.isObject(n)){this.storage.set("exandedHdas",n)}if(_.isBoolean(m)){this.storage.set("show_deleted",m)}if(_.isBoolean(o)){this.storage.set("show_hidden",o)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get());return this},_setUpModelEventHandlers:function(){this.model.hdas.on("add",this.addContentView,this);this.model.on("error error:hdas",function(n,p,m,o){this.errorHandler(n,p,m,o)},this);return this},render:function(o,p){this.log("render:",o,p);o=(o===undefined)?(this.fxSpeed):(o);var m=this,n;if(this.model){n=this.renderModel()}else{n=this.renderWithoutModel()}$(m).queue("fx",[function(q){if(o&&m.$el.is(":visible")){m.$el.fadeOut(o,q)}else{q()}},function(q){m.$el.empty();if(n){m.$el.append(n.children())}q()},function(q){if(o&&!m.$el.is(":visible")){m.$el.fadeIn(o,q)}else{q()}},function(q){if(p){p.call(this)}m.trigger("rendered",this);q()}]);return this},renderWithoutModel:function(){var m=$("<div/>"),n=$("<div/>").addClass("message-container").css({margin:"4px"});return m.append(n)},renderModel:function(){var m=$("<div/>");m.append(j.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(m).text(this.emptyMsg);m.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(m);this.renderHdas(m);return m},_renderEmptyMsg:function(o){var n=this,m=n.$emptyMessage(o);if(!_.isEmpty(n.hdaViews)){m.hide()}else{if(n.searchFor){m.text(n.noneFoundMsg).show()}else{m.text(n.emptyMsg).show()}}return this},_renderSearchButton:function(m){return faIconButton({title:d("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_setUpBehaviours:function(m){m=m||this.$el;m.find("[title]").tooltip({placement:"bottom"});this._setUpSearchInput(m.find(".history-search-controls .history-search-input"));return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(m){return(m||this.$el).find(".datasets-list")},$messages:function(m){return(m||this.$el).find(".message-container")},$emptyMessage:function(m){return(m||this.$el).find(".empty-history-message")},renderHdas:function(n){n=n||this.$el;var m=this,p={},o=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);this.$datasetsList(n).empty();if(o.length){o.each(function(r){var q=r.get("id"),s=m._createContentView(r);p[q]=s;if(_.contains(m.selectedHdaIds,q)){s.selected=true}m.attachContentView(s.render(),n)})}this.hdaViews=p;this._renderEmptyMsg(n);return this.hdaViews},_createContentView:function(n){var m=n.get("id"),p=n.get("history_content_type"),o=null;if(p==="dataset"){o=new this.HDAViewClass({model:n,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[m],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}else{o=new k.DatasetCollectionBaseView({model:n,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[m],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}this._setUpHdaListeners(o);return o},_setUpHdaListeners:function(n){var m=this;n.on("error",function(p,r,o,q){m.errorHandler(p,r,o,q)});n.on("body-expanded",function(o){m.storage.addExpandedHda(o)});n.on("body-collapsed",function(o){m.storage.removeExpandedHda(o)});return this},attachContentView:function(o,n){n=n||this.$el;var m=this.$datasetsList(n);m.prepend(o.$el);return this},addContentView:function(p){this.log("add."+this,p);var n=this;if(!p.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return n}$({}).queue([function o(r){var q=n.$emptyMessage();if(q.is(":visible")){q.fadeOut(n.fxSpeed,r)}else{r()}},function m(q){var r=n._createContentView(p);n.hdaViews[p.id]=r;r.render().$el.hide();n.scrollToTop();n.attachContentView(r);r.$el.slideDown(n.fxSpeed)}]);return n},refreshContents:function(n,m){if(this.model){return this.model.refresh(n,m)}return $.when()},hdaViewRange:function(p,o){if(p===o){return[p]}var m=this,n=false,q=[];this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters).each(function(r){if(n){q.push(m.hdaViews[r.id]);if(r===p.model||r===o.model){n=false}}else{if(r===p.model||r===o.model){n=true;q.push(m.hdaViews[r.id])}}});return q},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(m){m.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{});return this},toggleShowDeleted:function(m){m=(m!==undefined)?(m):(!this.storage.get("show_deleted"));this.storage.set("show_deleted",m);this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(m){m=(m!==undefined)?(m):(!this.storage.get("show_hidden"));this.storage.set("show_hidden",m);this.renderHdas();return this.storage.get("show_hidden")},_setUpSearchInput:function(n){var o=this,p=".history-search-input";function m(q){if(o.model.hdas.haveDetails()){o.searchHdas(q);return}o.$el.find(p).searchInput("toggle-loading");o.model.hdas.fetchAllDetails({silent:true}).always(function(){o.$el.find(p).searchInput("toggle-loading")}).done(function(){o.searchHdas(q)})}n.searchInput({initialVal:o.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:m,onsearch:_.bind(this.searchHdas,this),onclear:_.bind(this.clearHdaSearch,this)});return n},toggleSearchControls:function(o,m){var n=this.$el.find(".history-search-controls"),p=(jQuery.type(o)==="number")?(o):(this.fxSpeed);m=(m!==undefined)?(m):(!n.is(":visible"));if(m){n.slideDown(p,function(){$(this).find("input").focus()})}else{n.slideUp(p)}return m},searchHdas:function(m){var n=this;this.searchFor=m;this.filters=[function(o){return o.matchesAll(n.searchFor)}];this.trigger("search:searching",m,this);this.renderHdas();return this},clearHdaSearch:function(m){this.searchFor="";this.filters=[];this.trigger("search:clear",this);this.renderHdas();return this},_showLoadingIndicator:function(n,m,o){m=(m!==undefined)?(m):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,o)}else{this.$el.fadeOut(m);this.indicator.show(n,m,o)}},_hideLoadingIndicator:function(m,n){m=(m!==undefined)?(m):(this.fxSpeed);if(this.indicator){this.indicator.hide(m,n)}},displayMessage:function(r,s,q){var o=this;this.scrollToTop();var p=this.$messages(),m=$("<div/>").addClass(r+"message").html(s);if(!_.isEmpty(q)){var n=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(o._messageToModalOptions(r,s,q));return false});m.append(" ",n)}return p.html(m)},_messageToModalOptions:function(q,s,p){var m=this,r=$("<div/>"),o={title:"Details"};function n(t){t=_.omit(t,_.functions(t));return["<table>",_.map(t,function(v,u){v=(_.isObject(v))?(n(v)):(v);return'<tr><td style="vertical-align: top; color: grey">'+u+'</td><td style="padding-left: 8px">'+v+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(p)){o.body=r.append(n(p))}else{o.body=r.html(p)}o.buttons={Ok:function(){Galaxy.modal.hide();m.clearMessages()}};return o},clearMessages:function(){this.$messages().empty();return this},scrollPosition:function(){return this.$container().scrollTop()},scrollTo:function(m){this.$container().scrollTop(m);return this},scrollToTop:function(){this.$container().scrollTop(0);return this},scrollToId:function(n){if((!n)||(!this.hdaViews[n])){return this}var m=this.hdaViews[n];this.scrollTo(m.el.offsetTop);return this},scrollToHid:function(m){var n=this.model.hdas.getByHid(m);if(!n){return this}return this.scrollToId(n.id)},toString:function(){return"ReadOnlyHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var l=['<div class="history-controls">','<div class="history-search-controls">','<div class="history-search-input"></div>',"</div>",'<div class="history-title">',"<% if( history.name ){ %>",'<div class="history-name"><%= history.name %></div>',"<% } %>","</div>",'<div class="history-subtitle clear">',"<% if( history.nice_size ){ %>",'<div class="history-size"><%= history.nice_size %></div>',"<% } %>",'<div class="history-secondary-actions"></div>',"</div>","<% if( history.deleted ){ %>",'<div class="warningmessagesmall"><strong>',d("You are currently viewing a deleted history!"),"</strong></div>","<% } %>",'<div class="message-container">',"<% if( history.message ){ %>",'<div class="<%= history.status %>message"><%= history.message %></div>',"<% } %>","</div>",'<div class="quota-message errormessage">',d("You are over your disk quota"),". ",d("Tool execution is on hold until your disk usage drops below your allocated quota"),".","</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="history-dataset-actions">','<div class="btn-group">','<button class="history-select-all-datasets-btn btn btn-default"','data-mode="select">',d("All"),"</button>",'<button class="history-deselect-all-datasets-btn btn btn-default"','data-mode="select">',d("None"),"</button>","</div>",'<button class="history-dataset-action-popup-btn btn btn-default">',d("For all selected"),"...</button>","</div>","</div>",'<div class="datasets-list"></div>','<div class="empty-history-message infomessagesmall">',d("This history is empty"),"</div>"].join("");j.templates={historyPanel:function(m){return _.template(l,m,{variable:"history"})}};return{ReadOnlyHistoryPanel:j}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/collection/dataset-collection-base","mvc/dataset/hda-base","mvc/user/user-model","mvc/base-mvc","utils/localization"],function(g,k,b,a,f,d){var i=f.SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(m){var n="expandedHdas";this.save(n,_.extend(this.get(n),_.object([m.id],[m.get("id")])))},removeExpandedHda:function(n){var m="expandedHdas";this.save(m,_.omit(this.get(m),n))},toString:function(){return"HistoryPrefs("+this.id+")"}});i.storageKeyPrefix="history:";i.historyStorageKey=function e(m){if(!m){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+m)}return(i.storageKeyPrefix+m)};i.get=function c(m){return new i({id:i.historyStorageKey(m)})};i.clearAll=function h(n){for(var m in sessionStorage){if(m.indexOf(i.storageKeyPrefix)===0){sessionStorage.removeItem(m)}}};var j=Backbone.View.extend(f.LoggableMixin).extend({HDAViewClass:b.HDABaseView,tagName:"div",className:"history-panel",fxSpeed:"fast",emptyMsg:d("This history is empty"),noneFoundMsg:d("No matching datasets found"),initialize:function(m){m=m||{};if(m.logger){this.logger=m.logger}this.log(this+".initialize:",m);this.linkTarget=m.linkTarget||"_blank";this.fxSpeed=_.has(m,"fxSpeed")?(m.fxSpeed):(this.fxSpeed);this.filters=[];this.searchFor="";this.findContainerFn=m.findContainerFn;this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this._setUpListeners();var n=_.pick(m,"initiallyExpanded","show_deleted","show_hidden");this.setModel(this.model,n,false);if(m.onready){m.onready.call(this)}},_setUpListeners:function(){this.on("error",function(n,q,m,p,o){this.errorHandler(n,q,m,p,o)});this.on("loading-history",function(){this._showLoadingIndicator("loading history...",40)});this.on("loading-done",function(){this._hideLoadingIndicator(40);if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});if(this.logger){this.on("all",function(m){this.log(this+"",arguments)},this)}return this},errorHandler:function(o,r,n,q,p){console.error(o,r,n,q,p);if(r&&r.status===0&&r.readyState===0){}else{if(r&&r.status===502){}else{var m=this._parseErrorMessage(o,r,n,q,p);if(!this.$messages().is(":visible")){this.once("rendered",function(){this.displayMessage("error",m.message,m.details)})}else{this.displayMessage("error",m.message,m.details)}}}},_parseErrorMessage:function(p,t,o,s,r){var n=Galaxy.currUser,m={message:this._bePolite(s),details:{user:(n instanceof a.User)?(n.toJSON()):(n+""),source:(p instanceof Backbone.Model)?(p.toJSON()):(p+""),xhr:t,options:(t)?(_.omit(o,"xhr")):(o)}};_.extend(m.details,r||{});if(t&&_.isFunction(t.getAllResponseHeaders)){var q=t.getAllResponseHeaders();q=_.compact(q.split("\n"));q=_.map(q,function(u){return u.split(": ")});m.details.xhr.responseHeaders=_.object(q)}return m},_bePolite:function(m){m=m||d("An error occurred while getting updates from the server");return m+". "+d("Please contact a Galaxy administrator if the problem persists")+"."},loadHistoryWithHDADetails:function(o,n,m,q){var p=function(r){return _.values(i.get(r.id).get("expandedHdas"))};return this.loadHistory(o,n,m,q,p)},loadHistory:function(p,o,n,s,q){var m=this;o=o||{};m.trigger("loading-history",m);var r=g.History.getHistoryData(p,{historyFn:n,hdaFn:s,hdaDetailIds:o.initiallyExpanded||q});return m._loadHistoryFromXHR(r,o).fail(function(v,t,u){m.trigger("error",m,v,o,d("An error was encountered while "+t),{historyId:p,history:u||{}})}).always(function(){m.trigger("loading-done",m)})},_loadHistoryFromXHR:function(o,n){var m=this;o.then(function(p,q){m.JSONToModel(p,q,n)});o.fail(function(q,p){m.render()});return o},JSONToModel:function(p,m,n){this.log("JSONToModel:",p,m,n);n=n||{};var o=new g.History(p,m,n);this.setModel(o);return this},setModel:function(n,m,o){m=m||{};o=(o!==undefined)?(o):(true);this.log("setModel:",n,m,o);this.freeModel();this.selectedHdaIds=[];if(n){this.model=n;if(this.logger){this.model.logger=this.logger}this._setUpWebStorage(m.initiallyExpanded,m.show_deleted,m.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this)}if(o){this.render()}return this},freeModel:function(){if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.freeHdaViews();return this},freeHdaViews:function(){this.hdaViews={};return this},_setUpWebStorage:function(n,m,o){this.storage=new i({id:i.historyStorageKey(this.model.get("id"))});if(_.isObject(n)){this.storage.set("exandedHdas",n)}if(_.isBoolean(m)){this.storage.set("show_deleted",m)}if(_.isBoolean(o)){this.storage.set("show_hidden",o)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get());return this},_setUpModelEventHandlers:function(){this.model.hdas.on("add",this.addContentView,this);this.model.on("error error:hdas",function(n,p,m,o){this.errorHandler(n,p,m,o)},this);return this},render:function(o,p){this.log("render:",o,p);o=(o===undefined)?(this.fxSpeed):(o);var m=this,n;if(this.model){n=this.renderModel()}else{n=this.renderWithoutModel()}$(m).queue("fx",[function(q){if(o&&m.$el.is(":visible")){m.$el.fadeOut(o,q)}else{q()}},function(q){m.$el.empty();if(n){m.$el.append(n.children())}q()},function(q){if(o&&!m.$el.is(":visible")){m.$el.fadeIn(o,q)}else{q()}},function(q){if(p){p.call(this)}m.trigger("rendered",this);q()}]);return this},renderWithoutModel:function(){var m=$("<div/>"),n=$("<div/>").addClass("message-container").css({margin:"4px"});return m.append(n)},renderModel:function(){var m=$("<div/>");m.append(j.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(m).text(this.emptyMsg);m.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(m);this.renderHdas(m);return m},_renderEmptyMsg:function(o){var n=this,m=n.$emptyMessage(o);if(!_.isEmpty(n.hdaViews)){m.hide()}else{if(n.searchFor){m.text(n.noneFoundMsg).show()}else{m.text(n.emptyMsg).show()}}return this},_renderSearchButton:function(m){return faIconButton({title:d("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_setUpBehaviours:function(m){m=m||this.$el;m.find("[title]").tooltip({placement:"bottom"});this._setUpSearchInput(m.find(".history-search-controls .history-search-input"));return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(m){return(m||this.$el).find(".datasets-list")},$messages:function(m){return(m||this.$el).find(".message-container")},$emptyMessage:function(m){return(m||this.$el).find(".empty-history-message")},renderHdas:function(n){n=n||this.$el;var m=this,p={},o=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);this.$datasetsList(n).empty();if(o.length){o.each(function(r){var q=r.id,s=m._createContentView(r);p[q]=s;if(_.contains(m.selectedHdaIds,q)){s.selected=true}m.attachContentView(s.render(),n)})}this.hdaViews=p;this._renderEmptyMsg(n);return this.hdaViews},_createContentView:function(n){var m=n.id,p=n.get("history_content_type"),o=null;if(p==="dataset"){o=new this.HDAViewClass({model:n,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[m],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}else{o=new k.DatasetCollectionBaseView({model:n,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[m],hasUser:this.model.ownedByCurrUser(),logger:this.logger})}this._setUpHdaListeners(o);return o},_setUpHdaListeners:function(n){var m=this;n.on("error",function(p,r,o,q){m.errorHandler(p,r,o,q)});n.on("body-expanded",function(o){m.storage.addExpandedHda(o)});n.on("body-collapsed",function(o){m.storage.removeExpandedHda(o)});return this},attachContentView:function(o,n){n=n||this.$el;var m=this.$datasetsList(n);m.prepend(o.$el);return this},addContentView:function(p){this.log("add."+this,p);var n=this;if(!p.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return n}$({}).queue([function o(r){var q=n.$emptyMessage();if(q.is(":visible")){q.fadeOut(n.fxSpeed,r)}else{r()}},function m(q){var r=n._createContentView(p);n.hdaViews[p.id]=r;r.render().$el.hide();n.scrollToTop();n.attachContentView(r);r.$el.slideDown(n.fxSpeed)}]);return n},refreshContents:function(n,m){if(this.model){return this.model.refresh(n,m)}return $.when()},hdaViewRange:function(p,o){if(p===o){return[p]}var m=this,n=false,q=[];this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters).each(function(r){if(n){q.push(m.hdaViews[r.id]);if(r===p.model||r===o.model){n=false}}else{if(r===p.model||r===o.model){n=true;q.push(m.hdaViews[r.id])}}});return q},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(m){m.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{});return this},toggleShowDeleted:function(m){m=(m!==undefined)?(m):(!this.storage.get("show_deleted"));this.storage.set("show_deleted",m);this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(m){m=(m!==undefined)?(m):(!this.storage.get("show_hidden"));this.storage.set("show_hidden",m);this.renderHdas();return this.storage.get("show_hidden")},_setUpSearchInput:function(n){var o=this,p=".history-search-input";function m(q){if(o.model.hdas.haveDetails()){o.searchHdas(q);return}o.$el.find(p).searchInput("toggle-loading");o.model.hdas.fetchAllDetails({silent:true}).always(function(){o.$el.find(p).searchInput("toggle-loading")}).done(function(){o.searchHdas(q)})}n.searchInput({initialVal:o.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:m,onsearch:_.bind(this.searchHdas,this),onclear:_.bind(this.clearHdaSearch,this)});return n},toggleSearchControls:function(o,m){var n=this.$el.find(".history-search-controls"),p=(jQuery.type(o)==="number")?(o):(this.fxSpeed);m=(m!==undefined)?(m):(!n.is(":visible"));if(m){n.slideDown(p,function(){$(this).find("input").focus()})}else{n.slideUp(p)}return m},searchHdas:function(m){var n=this;this.searchFor=m;this.filters=[function(o){return o.matchesAll(n.searchFor)}];this.trigger("search:searching",m,this);this.renderHdas();return this},clearHdaSearch:function(m){this.searchFor="";this.filters=[];this.trigger("search:clear",this);this.renderHdas();return this},_showLoadingIndicator:function(n,m,o){m=(m!==undefined)?(m):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,o)}else{this.$el.fadeOut(m);this.indicator.show(n,m,o)}},_hideLoadingIndicator:function(m,n){m=(m!==undefined)?(m):(this.fxSpeed);if(this.indicator){this.indicator.hide(m,n)}},displayMessage:function(r,s,q){var o=this;this.scrollToTop();var p=this.$messages(),m=$("<div/>").addClass(r+"message").html(s);if(!_.isEmpty(q)){var n=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(o._messageToModalOptions(r,s,q));return false});m.append(" ",n)}return p.html(m)},_messageToModalOptions:function(q,s,p){var m=this,r=$("<div/>"),o={title:"Details"};function n(t){t=_.omit(t,_.functions(t));return["<table>",_.map(t,function(v,u){v=(_.isObject(v))?(n(v)):(v);return'<tr><td style="vertical-align: top; color: grey">'+u+'</td><td style="padding-left: 8px">'+v+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(p)){o.body=r.append(n(p))}else{o.body=r.html(p)}o.buttons={Ok:function(){Galaxy.modal.hide();m.clearMessages()}};return o},clearMessages:function(){this.$messages().empty();return this},scrollPosition:function(){return this.$container().scrollTop()},scrollTo:function(m){this.$container().scrollTop(m);return this},scrollToTop:function(){this.$container().scrollTop(0);return this},scrollToId:function(n){if((!n)||(!this.hdaViews[n])){return this}var m=this.hdaViews[n];this.scrollTo(m.el.offsetTop);return this},scrollToHid:function(m){var n=this.model.hdas.getByHid(m);if(!n){return this}return this.scrollToId(n.id)},toString:function(){return"ReadOnlyHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var l=['<div class="history-controls">','<div class="history-search-controls">','<div class="history-search-input"></div>',"</div>",'<div class="history-title">',"<% if( history.name ){ %>",'<div class="history-name"><%= history.name %></div>',"<% } %>","</div>",'<div class="history-subtitle clear">',"<% if( history.nice_size ){ %>",'<div class="history-size"><%= history.nice_size %></div>',"<% } %>",'<div class="history-secondary-actions"></div>',"</div>","<% if( history.deleted ){ %>",'<div class="warningmessagesmall"><strong>',d("You are currently viewing a deleted history!"),"</strong></div>","<% } %>",'<div class="message-container">',"<% if( history.message ){ %>",'<div class="<%= history.status %>message"><%= history.message %></div>',"<% } %>","</div>",'<div class="quota-message errormessage">',d("You are over your disk quota"),". ",d("Tool execution is on hold until your disk usage drops below your allocated quota"),".","</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="history-dataset-actions">','<div class="btn-group">','<button class="history-select-all-datasets-btn btn btn-default"','data-mode="select">',d("All"),"</button>",'<button class="history-deselect-all-datasets-btn btn btn-default"','data-mode="select">',d("None"),"</button>","</div>",'<button class="history-dataset-action-popup-btn btn btn-default">',d("For all selected"),"...</button>","</div>","</div>",'<div class="datasets-list"></div>','<div class="empty-history-message infomessagesmall">',d("This history is empty"),"</div>"].join("");j.templates={historyPanel:function(m){return _.template(l,m,{variable:"history"})}};return{ReadOnlyHistoryPanel:j}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: Handle update_state for Conditional tool parameters when a currently valid current_case value has not been provided.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ea6698177726/
Changeset: ea6698177726
User: dan
Date: 2014-06-13 19:30:23
Summary: Handle update_state for Conditional tool parameters when a currently valid current_case value has not been provided.
Affected #: 2 files
diff -r 8a608db6cf83b653a433f43b501f4047f63d248b -r ea6698177726a9e94931dcd818db52f5c0e2aec3 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2392,7 +2392,18 @@
# Get value of test param and determine current case
value, test_param_error = \
check_param( trans, input.test_param, test_incoming, context, source=source )
- current_case = input.get_current_case( value, trans )
+ try:
+ current_case = input.get_current_case( value, trans )
+ except ValueError, e:
+ #load default initial value
+ if not test_param_error:
+ test_param_error = str( e )
+ if trans is not None:
+ history = trans.get_history()
+ else:
+ history = None
+ value = input.test_param.get_initial_value( trans, context, history=history )
+ current_case = input.get_current_case( value, trans )
if current_case != old_current_case:
# Current case has changed, throw away old state
group_state = state[input.name] = {}
diff -r 8a608db6cf83b653a433f43b501f4047f63d248b -r ea6698177726a9e94931dcd818db52f5c0e2aec3 lib/galaxy/tools/parameters/grouping.py
--- a/lib/galaxy/tools/parameters/grouping.py
+++ b/lib/galaxy/tools/parameters/grouping.py
@@ -472,7 +472,7 @@
for index, case in enumerate( self.cases ):
if str_value == case.value:
return index
- raise Exception( "No case matched value:", self.name, str_value )
+ raise ValueError( "No case matched value:", self.name, str_value )
def value_to_basic( self, value, app ):
rval = dict()
current_case = rval['__current_case__'] = value['__current_case__']
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Small clarification in previous doc addition.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8a608db6cf83/
Changeset: 8a608db6cf83
User: jmchilton
Date: 2014-06-13 16:14:38
Summary: Small clarification in previous doc addition.
Affected #: 1 file
diff -r c9c07643e04ece14e27c07c4aa73b3578202c47b -r 8a608db6cf83b653a433f43b501f4047f63d248b lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -240,7 +240,8 @@
'content' = [the encoded id from the HDCA]
create new history dataset collection (for type 'dataset_collection')
- 'source' = 'new_collection'
+ 'source' = 'new_collection' (default 'source' if type is
+ 'dataset_collection' - no need to specify this)
'collection_type' = For example, "list", "paired", "list:paired".
'name' = Name of new dataset collection.
'element_identifiers' = Recursive list structure defining collection.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Add some quick docs for creating dataset collections through API.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c9c07643e04e/
Changeset: c9c07643e04e
User: jmchilton
Date: 2014-06-13 16:08:56
Summary: Add some quick docs for creating dataset collections through API.
For full worked examples see bioblend and API tests.
Affected #: 1 file
diff -r 05500f5c6710816865536335a42eb9e00caf6f03 -r c9c07643e04ece14e27c07c4aa73b3578202c47b lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -217,27 +217,54 @@
def create( self, trans, history_id, payload, **kwd ):
"""
create( self, trans, history_id, payload, **kwd )
- * POST /api/histories/{history_id}/contents
+ * POST /api/histories/{history_id}/contents/{type}
create a new HDA by copying an accessible LibraryDataset
:type history_id: str
:param history_id: encoded id string of the new HDA's History
+ :type type: str
+ :param type: Type of history content - 'dataset' (default) or
+ 'dataset_collection'.
:type payload: dict
:param payload: dictionary structure containing::
- copy from library:
+ copy from library (for type 'dataset'):
'source' = 'library'
'content' = [the encoded id from the library dataset]
- copy from HDA:
+ copy from history dataset (for type 'dataset'):
'source' = 'hda'
'content' = [the encoded id from the HDA]
+ copy from history dataset collection (for type 'dataset_collection')
+ 'source' = 'hdca'
+ 'content' = [the encoded id from the HDCA]
+
+ create new history dataset collection (for type 'dataset_collection')
+ 'source' = 'new_collection'
+ 'collection_type' = For example, "list", "paired", "list:paired".
+ 'name' = Name of new dataset collection.
+ 'element_identifiers' = Recursive list structure defining collection.
+ Each element must have 'src' which can be
+ 'hda', 'ldda', 'hdca', or 'new_collection',
+ as well as a 'name' which is the name of
+ element (e.g. "forward" or "reverse" for
+ paired datasets, or arbitrary sample names
+ for instance for lists). For all src's except
+ 'new_collection' - a encoded 'id' attribute
+ must be included wiht element as well.
+ 'new_collection' sources must defined a
+ 'collection_type' and their own list of
+ (potentially) nested 'element_identifiers'.
+
..note:
Currently, a user can only copy an HDA from a history that the user owns.
:rtype: dict
:returns: dictionary containing detailed information for the new HDA
"""
+ # TODO: Flush out create new collection documentation above, need some
+ # examples. See also bioblend and API tests for specific examples.
+
# get the history, if anon user and requesting current history - allow it
if( ( trans.user == None )
and ( history_id == trans.security.encode_id( trans.history.id ) ) ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Fix spelling error in API test.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/05500f5c6710/
Changeset: 05500f5c6710
User: jmchilton
Date: 2014-06-13 15:46:01
Summary: Fix spelling error in API test.
Affected #: 1 file
diff -r 588559638acc7ed88542f8e77987698f2fa0b2fb -r 05500f5c6710816865536335a42eb9e00caf6f03 test/api/test_dataset_collections.py
--- a/test/api/test_dataset_collections.py
+++ b/test/api/test_dataset_collections.py
@@ -73,12 +73,13 @@
collection_type="list:paired",
instance_type="history",
history_id=self.history_id,
- name="nested_collecion",
+ name="a nested collection",
element_identifiers=json.dumps( element_identifiers ),
)
create_response = self._post( "dataset_collections", payload )
dataset_collection = self._check_create_response( create_response )
assert dataset_collection[ "collection_type" ] == "list:paired"
+ assert dataset_collection[ "name" ] == "a nested collection"
returned_collections = dataset_collection[ "elements" ]
assert len( returned_collections ) == 1, dataset_collection
pair_1_element = returned_collections[ 0 ]
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Fixup XML formatting in job_conf.xml.sample_advanced.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/588559638acc/
Changeset: 588559638acc
User: jmchilton
Date: 2014-06-13 08:02:13
Summary: Fixup XML formatting in job_conf.xml.sample_advanced.
Should fix the remaining failing unit tests.
Affected #: 1 file
diff -r 365e1cef25a5ef79ed64934e0b1c483ae73a7445 -r 588559638acc7ed88542f8e77987698f2fa0b2fb job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -162,7 +162,7 @@
<!-- Following command can be used to tweak docker command. --><!-- <param id="docker_cmd">/usr/local/custom_docker/docker</param> --><!-- Following can be used to connect to docke server in different
- ways (translated as -H argument to docker client).
+ ways (translated as -H argument to docker client). --><!-- <param id="docker_host">unix:///var/run/docker.sock</param> --><!-- <param id="docker_host">:5555</param> --><!-- <param id="docker_host">:5555</param> -->
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Fix failing unit tests for 60d8de4.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/365e1cef25a5/
Changeset: 365e1cef25a5
User: jmchilton
Date: 2014-06-13 07:58:23
Summary: Fix failing unit tests for 60d8de4.
Affected #: 4 files
diff -r 972bd6fbd63f372cc80096e0c099c5e17d33dfe7 -r 365e1cef25a5ef79ed64934e0b1c483ae73a7445 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -153,7 +153,7 @@
<!-- <param id="docker_sudo">false</param> --><!-- Following option can be used to tweak sudo command used by
default. -->
- <!-- <param id="docker_sudo_cmd">/usr/bin/sudo --extra_param</param> -->
+ <!-- <param id="docker_sudo_cmd">/usr/bin/sudo -extra_param</param> --><!-- By default, docker container will not have any networking
enabled. host networking can be bridged by uncommenting next option
http://docs.docker.io/reference/run/#network-settings
diff -r 972bd6fbd63f372cc80096e0c099c5e17d33dfe7 -r 365e1cef25a5ef79ed64934e0b1c483ae73a7445 lib/galaxy/tools/deps/containers.py
--- a/lib/galaxy/tools/deps/containers.py
+++ b/lib/galaxy/tools/deps/containers.py
@@ -99,6 +99,12 @@
return asbool(destination_info.get("%s_enabled" % container_type, False))
+class NullContainerFinder(object):
+
+ def find_container(self, tool_info, destination_info, job_info):
+ return []
+
+
class ContainerRegistry():
def __init__(self):
diff -r 972bd6fbd63f372cc80096e0c099c5e17d33dfe7 -r 365e1cef25a5ef79ed64934e0b1c483ae73a7445 lib/galaxy/tools/deps/requirements.py
--- a/lib/galaxy/tools/deps/requirements.py
+++ b/lib/galaxy/tools/deps/requirements.py
@@ -53,14 +53,14 @@
... contents_document = '''<tool><requirements>%s</requirements></tool>'''
... root = ElementTree.fromstring( contents_document % contents )
... return parse_requirements_from_xml( root )
- >>> reqs = load_requirements('''<requirement>bwa</requirement>''')
+ >>> reqs, containers = load_requirements('''<requirement>bwa</requirement>''')
>>> reqs[0].name
'bwa'
>>> reqs[0].version is None
True
>>> reqs[0].type
'package'
- >>> reqs = load_requirements('''<requirement type="binary" version="1.3.3">cufflinks</requirement>''')
+ >>> reqs, containers = load_requirements('''<requirement type="binary" version="1.3.3">cufflinks</requirement>''')
>>> reqs[0].name
'cufflinks'
>>> reqs[0].version
diff -r 972bd6fbd63f372cc80096e0c099c5e17d33dfe7 -r 365e1cef25a5ef79ed64934e0b1c483ae73a7445 test/unit/tools_support.py
--- a/test/unit/tools_support.py
+++ b/test/unit/tools_support.py
@@ -16,6 +16,7 @@
from galaxy.util import parse_xml
from galaxy.util.dbkeys import GenomeBuilds
from galaxy.jobs import NoopQueue
+from galaxy.tools.deps.containers import NullContainerFinder
class UsesApp( object ):
@@ -126,6 +127,7 @@
self.security_agent = GalaxyRBACAgent( self.model )
self.tool_data_tables = {}
self.dataset_collections_service = None
+ self.container_finder = NullContainerFinder()
class MockContext(object):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dannon: Re-enable flexible default_bucket for cloudlaunch.
by commits-noreply@bitbucket.org 13 Jun '14
by commits-noreply@bitbucket.org 13 Jun '14
13 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/972bd6fbd63f/
Changeset: 972bd6fbd63f
User: dannon
Date: 2014-06-13 00:26:24
Summary: Re-enable flexible default_bucket for cloudlaunch.
Affected #: 1 file
diff -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c -r 972bd6fbd63f372cc80096e0c099c5e17d33dfe7 lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
--- a/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
+++ b/lib/galaxy/webapps/galaxy/controllers/cloudlaunch.py
@@ -72,7 +72,8 @@
cml = cloudman.launch.CloudManLauncher(key_id, secret)
result = cml.launch(cluster_name, ami, instance_type, password,
cfg.kernel_id, cfg.ramdisk_id, cfg.key_name,
- cfg.security_groups, cfg.placement)
+ cfg.security_groups, cfg.placement,
+ bucket_default=bucket_default)
# result is a dict with sg_names, kp_name, kp_material, rs, and instance_id
if not result['rs']:
trans.response.status = 400
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Eliminate the use of trans in most functions in the Tool Shed's shed_util_common utility module.
by commits-noreply@bitbucket.org 12 Jun '14
by commits-noreply@bitbucket.org 12 Jun '14
12 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9a69f032d6d9/
Changeset: 9a69f032d6d9
User: greg
Date: 2014-06-12 21:43:38
Summary: Eliminate the use of trans in most functions in the Tool Shed's shed_util_common utility module.
Affected #: 24 files
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/web/base/controllers/admin.py
--- a/lib/galaxy/web/base/controllers/admin.py
+++ b/lib/galaxy/web/base/controllers/admin.py
@@ -7,6 +7,8 @@
from string import punctuation as PUNCTUATION
import galaxy.queue_worker
+from tool_shed.util import shed_util_common as suc
+
log = logging.getLogger( __name__ )
@@ -29,7 +31,7 @@
status = kwd.get( 'status', 'done' )
if trans.webapp.name == 'galaxy':
installed_repositories = trans.install_model.context.query( trans.install_model.ToolShedRepository ).first()
- installing_repository_ids = get_ids_of_tool_shed_repositories_being_installed( trans, as_string=True )
+ installing_repository_ids = suc.get_ids_of_tool_shed_repositories_being_installed( trans.app, as_string=True )
return trans.fill_template( '/webapps/galaxy/admin/index.mako',
installed_repositories=installed_repositories,
installing_repository_ids=installing_repository_ids,
@@ -1091,24 +1093,6 @@
## ---- Utility methods -------------------------------------------------------
-def get_ids_of_tool_shed_repositories_being_installed( trans, as_string=False ):
- installing_repository_ids = []
- new_status = trans.install_model.ToolShedRepository.installation_status.NEW
- cloning_status = trans.install_model.ToolShedRepository.installation_status.CLONING
- setting_tool_versions_status = trans.install_model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS
- installing_dependencies_status = trans.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES
- loading_datatypes_status = trans.install_model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES
- for tool_shed_repository in trans.install_model.context.query( trans.install_model.ToolShedRepository ) \
- .filter( or_( trans.install_model.ToolShedRepository.status == new_status,
- trans.install_model.ToolShedRepository.status == cloning_status,
- trans.install_model.ToolShedRepository.status == setting_tool_versions_status,
- trans.install_model.ToolShedRepository.status == installing_dependencies_status,
- trans.install_model.ToolShedRepository.status == loading_datatypes_status ) ):
- installing_repository_ids.append( trans.security.encode_id( tool_shed_repository.id ) )
- if as_string:
- return ','.join( installing_repository_ids )
- return installing_repository_ids
-
def get_user( trans, user_id ):
"""Get a User from the database by id."""
user = trans.sa_session.query( trans.model.User ).get( trans.security.decode_id( user_id ) )
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
--- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
+++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
@@ -59,7 +59,7 @@
# Since exported workflows are dictionaries with very few attributes that differentiate them from each
# other, we'll build the list based on the following dictionary of those few attributes.
exported_workflows = []
- repository = suc.get_tool_shed_repository_by_id( trans, id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, id )
metadata = repository.metadata
if metadata:
exported_workflow_tups = metadata.get( 'workflows', [] )
@@ -142,7 +142,7 @@
index = payload.get( 'index', None )
if index is None:
raise HTTPBadRequest( detail="Missing required parameter 'index'." )
- repository = suc.get_tool_shed_repository_by_id( trans, tool_shed_repository_id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, tool_shed_repository_id )
exported_workflows = json.from_json_string( self.exported_workflows( trans, tool_shed_repository_id ) )
# Since we don't have an in-memory object with an id, we'll identify the exported workflow via its location (i.e., index) in the list.
exported_workflow = exported_workflows[ int( index ) ]
@@ -169,7 +169,7 @@
tool_shed_repository_id = kwd.get( 'id', '' )
if not tool_shed_repository_id:
raise HTTPBadRequest( detail="Missing required parameter 'id'." )
- repository = suc.get_tool_shed_repository_by_id( trans, tool_shed_repository_id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, tool_shed_repository_id )
exported_workflows = json.from_json_string( self.exported_workflows( trans, tool_shed_repository_id ) )
imported_workflow_dicts = []
for exported_workflow_dict in exported_workflows:
@@ -406,7 +406,7 @@
for repository in query:
repository_id = trans.security.encode_id( repository.id )
try:
- invalid_file_tups, metadata_dict = metadata_util.reset_all_metadata_on_installed_repository( trans, repository_id )
+ invalid_file_tups, metadata_dict = metadata_util.reset_all_metadata_on_installed_repository( trans.app, repository_id )
if invalid_file_tups:
message = tool_util.generate_message_for_invalid_tools( trans,
invalid_file_tups,
@@ -436,7 +436,7 @@
:param id: the encoded id of the ToolShedRepository object
"""
# Example URL: http://localhost:8763/api/tool_shed_repositories/df7a1f0c02a5b08e
- tool_shed_repository = suc.get_tool_shed_repository_by_id( trans, id )
+ tool_shed_repository = suc.get_tool_shed_repository_by_id( trans.app, id )
if tool_shed_repository is None:
log.debug( "Unable to locate tool_shed_repository record for id %s." % ( str( id ) ) )
return {}
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -326,7 +326,7 @@
repository_id = kwd.get( 'repository_id', None )
relative_path_to_image_file = kwd.get( 'image_file', None )
if repository_id and relative_path_to_image_file:
- repository = suc.get_tool_shed_repository_by_id( trans, repository_id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, repository_id )
if repository:
repo_files_dir = repository.repo_files_directory( trans.app )
path_to_file = suc.get_absolute_path_to_file_in_repository( repo_files_dir, relative_path_to_image_file )
@@ -433,7 +433,7 @@
status = kwd.get( 'status', 'done' )
if workflow_name:
workflow_name = encoding_util.tool_shed_decode( workflow_name )
- repository = suc.get_tool_shed_repository_by_id( trans, repository_id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, repository_id )
if repository:
workflow, status, message = workflow_util.import_workflow( trans, repository, workflow_name )
if workflow:
@@ -808,7 +808,7 @@
# The user must be on the manage_repository_tool_dependencies page and clicked the button to either install or uninstall a
# tool dependency, but they didn't check any of the available tool dependencies on which to perform the action.
repository_id = kwd.get( 'repository_id', None )
- tool_shed_repository = suc.get_tool_shed_repository_by_id( trans, repository_id )
+ tool_shed_repository = suc.get_tool_shed_repository_by_id( trans.app, repository_id )
if 'operation' in kwd:
operation = kwd[ 'operation' ].lower()
if not tool_dependency_ids:
@@ -858,12 +858,12 @@
message += ' and restart your Galaxy server to install tool dependencies.'
status = 'error'
installed_tool_dependencies_select_field = \
- suc.build_tool_dependencies_select_field( trans,
+ suc.build_tool_dependencies_select_field( trans.app,
tool_shed_repository=tool_shed_repository,
name='inst_td_ids',
uninstalled_only=False )
uninstalled_tool_dependencies_select_field = \
- suc.build_tool_dependencies_select_field( trans,
+ suc.build_tool_dependencies_select_field( trans.app,
tool_shed_repository=tool_shed_repository,
name='uninstalled_tool_dependency_ids',
uninstalled_only=True )
@@ -890,7 +890,7 @@
else:
# The user must be on the manage_repository_tool_dependencies page and clicked the button to either install or uninstall a
# tool dependency, but they didn't check any of the available tool dependencies on which to perform the action.
- tool_shed_repository = suc.get_tool_shed_repository_by_id( trans, repository_id )
+ tool_shed_repository = suc.get_tool_shed_repository_by_id( trans.app, repository_id )
self.tool_dependency_grid.title = "Tool shed repository '%s' tool dependencies" % tool_shed_repository.name
if 'operation' in kwd:
operation = kwd[ 'operation' ].lower()
@@ -942,7 +942,7 @@
def monitor_repository_installation( self, trans, **kwd ):
tsridslist = repository_util.get_tool_shed_repository_ids( **kwd )
if not tsridslist:
- tsridslist = suc.get_ids_of_tool_shed_repositories_being_installed( trans, as_string=False )
+ tsridslist = suc.get_ids_of_tool_shed_repositories_being_installed( trans.app, as_string=False )
kwd[ 'tool_shed_repository_ids' ] = tsridslist
return self.repository_installation_grid( trans, **kwd )
@@ -952,7 +952,7 @@
# Avoid caching
trans.response.headers['Pragma'] = 'no-cache'
trans.response.headers['Expires'] = '0'
- return suc.open_repository_files_folder( trans, folder_path )
+ return suc.open_repository_files_folder( folder_path )
@web.expose
@web.require_admin
@@ -1008,7 +1008,7 @@
# but the received repository id is from the Galaxy side (the caller is this controller's
# update_to_changeset_revision() method. We need to get the id of the same repository from the
# Tool Shed side.
- repository = suc.get_tool_shed_repository_by_id( trans, updating_repository_id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, updating_repository_id )
# For backward compatibility to the 12/20/12 Galaxy release.
try:
params = '?name=%s&owner=%s' % ( str( repository.name ), str( repository.owner ) )
@@ -1056,7 +1056,7 @@
encoded_updated_metadata_dict = kwd.get( 'encoded_updated_metadata_dict', None )
updated_changeset_revision = kwd.get( 'updated_changeset_revision', None )
updated_ctx_rev = kwd.get( 'updated_ctx_rev', None )
- repository = suc.get_tool_shed_repository_by_id( trans, updating_repository_id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, updating_repository_id )
decoded_updated_metadata = encoding_util.tool_shed_decode( encoded_updated_metadata )
# Now that the user has decided whether they will handle dependencies, we can update
# the repository to the latest revision.
@@ -1070,7 +1070,7 @@
install_tool_dependencies = CheckboxField.is_checked( install_tool_dependencies )
else:
install_tool_dependencies = False
- tool_path = suc.get_tool_path_by_shed_tool_conf_filename( trans, shed_tool_conf )
+ tool_path = suc.get_tool_path_by_shed_tool_conf_filename( trans.app, shed_tool_conf )
installation_dict = dict( install_repository_dependencies=install_repository_dependencies,
new_tool_panel_section_label=new_tool_panel_section_label,
no_changes_checked=False,
@@ -1112,7 +1112,7 @@
action='manage_repositories',
**kwd ) )
shed_tool_conf_select_field = tool_util.build_shed_tool_conf_select_field( trans )
- tool_path = suc.get_tool_path_by_shed_tool_conf_filename( trans, shed_tool_conf )
+ tool_path = suc.get_tool_path_by_shed_tool_conf_filename( trans.app, shed_tool_conf )
tool_panel_section_select_field = tool_util.build_tool_panel_section_select_field( trans )
if len( repo_info_dicts ) == 1:
# If we're installing or updating a single repository, see if it contains a readme or
@@ -2053,7 +2053,7 @@
updated_count = 0
for repository in trans.install_model.context.query( trans.install_model.ToolShedRepository ) \
.filter( trans.install_model.ToolShedRepository.table.c.deleted == False ):
- ok, updated = suc.check_or_update_tool_shed_status_for_installed_repository( trans, repository )
+ ok, updated = suc.check_or_update_tool_shed_status_for_installed_repository( trans.app, repository )
if ok:
success_count += 1
else:
@@ -2067,8 +2067,8 @@
message += ", ".join( repository_names_not_updated )
else:
repository_id = kwd.get( 'id', None )
- repository = suc.get_tool_shed_repository_by_id( trans, repository_id )
- ok, updated = suc.check_or_update_tool_shed_status_for_installed_repository( trans, repository )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, repository_id )
+ ok, updated = suc.check_or_update_tool_shed_status_for_installed_repository( trans.app, repository )
if ok:
if updated:
message = "The tool shed status for repository <b>%s</b> has been updated." % str( repository.name )
@@ -2122,7 +2122,7 @@
status = kwd.get( 'status', 'done' )
if workflow_name:
workflow_name = encoding_util.tool_shed_decode( workflow_name )
- repository = suc.get_tool_shed_repository_by_id( trans, repository_id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, repository_id )
changeset_revision = repository.changeset_revision
metadata = repository.metadata
return trans.fill_template( "/admin/tool_shed_repository/view_workflow.mako",
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/tool_shed/api/categories.py
--- a/lib/galaxy/webapps/tool_shed/api/categories.py
+++ b/lib/galaxy/webapps/tool_shed/api/categories.py
@@ -39,7 +39,7 @@
if not description:
# Default the description to the name.
description = name
- if suc.get_category_by_name( trans, name ):
+ if suc.get_category_by_name( trans.app, name ):
category_dict[ 'message' ] = 'A category with that name already exists'
category_dict[ 'status' ] = 'error'
else:
@@ -90,7 +90,7 @@
:param id: the encoded id of the Repository object
"""
# Example URL: http://localhost:9009/api/categories/f9cad7b01a472135
- category = suc.get_category( trans, id )
+ category = suc.get_category( trans.app, id )
if category is None:
category_dict = dict( message = 'Unable to locate category record for id %s.' % ( str( id ) ),
status = 'error' )
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/tool_shed/api/repositories.py
--- a/lib/galaxy/webapps/tool_shed/api/repositories.py
+++ b/lib/galaxy/webapps/tool_shed/api/repositories.py
@@ -498,7 +498,7 @@
repository_id = payload.get( 'repository_id', None )
if repository_id is not None:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
start_time = strftime( "%Y-%m-%d %H:%M:%S" )
log.debug( "%s...resetting metadata on repository %s" % ( start_time, str( repository.name ) ) )
results = handle_repository( trans, start_time, repository )
@@ -515,7 +515,7 @@
:param id: the encoded id of the Repository object
"""
# Example URL: http://localhost:9009/api/repositories/f9cad7b01a472135
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
if repository is None:
log.debug( "Unable to locate repository record for id %s." % ( str( id ) ) )
return {}
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/tool_shed/api/repository_revisions.py
--- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
+++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
@@ -141,7 +141,7 @@
"""
# Example URL: http://localhost:9009/api/repository_revisions/repository_dependencies/bb12…
repository_dependencies_dicts = []
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, id )
if repository_metadata is None:
log.debug( 'Invalid repository_metadata id received: %s' % str( id ) )
return repository_dependencies_dicts
@@ -214,12 +214,12 @@
:param id: the encoded id of the `RepositoryMetadata` object
"""
# Example URL: http://localhost:9009/api/repository_revisions/bb125606ff9ea620
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, id )
if repository_metadata is None:
log.debug( 'Cannot locate repository_metadata with id %s' % str( id ) )
return {}
encoded_repository_id = trans.security.encode_id( repository_metadata.repository_id )
- repository = suc.get_repository_by_id( trans, encoded_repository_id )
+ repository = suc.get_repository_by_id( trans.app, encoded_repository_id )
repository_metadata_dict = repository_metadata.to_dict( view='element',
value_mapper=self.__get_value_mapper( trans ) )
repository_metadata_dict[ 'url' ] = web.url_for( controller='repositories',
@@ -238,7 +238,7 @@
repository_metadata_id = kwd.get( 'id', None )
if repository_metadata_id is None:
raise HTTPBadRequest( detail="Missing required parameter 'id'." )
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
if repository_metadata is None:
decoded_repository_metadata_id = trans.security.decode_id( repository_metadata_id )
log.debug( 'Cannot locate repository_metadata with id %s' % str( decoded_repository_metadata_id ) )
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/tool_shed/api/users.py
--- a/lib/galaxy/webapps/tool_shed/api/users.py
+++ b/lib/galaxy/webapps/tool_shed/api/users.py
@@ -105,7 +105,7 @@
:param id: the encoded id of the User object.
"""
# Example URL: http://localhost:9009/api/users/f9cad7b01a472135
- user = suc.get_user( trans, id )
+ user = suc.get_user( trans.app, id )
if user is None:
user_dict = dict( message = 'Unable to locate user record for id %s.' % ( str( id ) ),
status = 'error' )
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/tool_shed/controllers/admin.py
--- a/lib/galaxy/webapps/tool_shed/controllers/admin.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/admin.py
@@ -43,14 +43,14 @@
if k.startswith( 'f-' ):
del kwd[ k ]
if 'user_id' in kwd:
- user = suc.get_user( trans, kwd[ 'user_id' ] )
+ user = suc.get_user( trans.app, kwd[ 'user_id' ] )
kwd[ 'f-email' ] = user.email
del kwd[ 'user_id' ]
else:
# The received id is the repository id, so we need to get the id of the user
# that uploaded the repository.
repository_id = kwd.get( 'id', None )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
kwd[ 'f-email' ] = repository.user.email
elif operation == "repositories_by_category":
# Eliminate the current filters if any exist.
@@ -58,7 +58,7 @@
if k.startswith( 'f-' ):
del kwd[ k ]
category_id = kwd.get( 'id', None )
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
kwd[ 'f-Category.name' ] = category.name
elif operation == "receive email alerts":
if kwd[ 'id' ]:
@@ -82,7 +82,7 @@
changeset_revision_str = 'changeset_revision_'
if k.startswith( changeset_revision_str ):
repository_id = trans.security.encode_id( int( k.lstrip( changeset_revision_str ) ) )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( tran.apps, repository_id )
if repository.tip( trans.app ) != v:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -103,7 +103,7 @@
# The received id is a RepositoryMetadata object id, so we need to get the
# associated Repository and redirect to view_or_manage_repository with the
# changeset_revision.
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, kwd[ 'id' ] )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, kwd[ 'id' ] )
repository = repository_metadata.repository
kwd[ 'id' ] = trans.security.encode_id( repository.id )
kwd[ 'changeset_revision' ] = repository_metadata.changeset_revision
@@ -124,7 +124,7 @@
if not name or not description:
message = 'Enter a valid name and a description'
status = 'error'
- elif suc.get_category_by_name( trans, name ):
+ elif suc.get_category_by_name( trans.app, name ):
message = 'A category with that name already exists'
status = 'error'
else:
@@ -158,7 +158,7 @@
count = 0
deleted_repositories = ""
for repository_id in ids:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
if repository:
if not repository.deleted:
# Mark all installable repository_metadata records as not installable.
@@ -199,7 +199,7 @@
ids = util.listify( id )
count = 0
for repository_metadata_id in ids:
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
trans.sa_session.delete( repository_metadata )
trans.sa_session.flush()
count += 1
@@ -225,7 +225,7 @@
action='manage_categories',
message=message,
status='error' ) )
- category = suc.get_category( trans, id )
+ category = suc.get_category( trans.app, id )
original_category_name = str( category.name )
original_category_description = str( category.description )
if kwd.get( 'edit_category_button', False ):
@@ -236,7 +236,7 @@
if not new_name:
message = 'Enter a valid name'
status = 'error'
- elif original_category_name != new_name and suc.get_category_by_name( trans, new_name ):
+ elif original_category_name != new_name and suc.get_category_by_name( trans.app, new_name ):
message = 'A category with that name already exists'
status = 'error'
else:
@@ -363,7 +363,7 @@
count = 0
undeleted_repositories = ""
for repository_id in ids:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
if repository:
if repository.deleted:
# Inspect all repository_metadata records to determine those that are installable, and mark
@@ -412,7 +412,7 @@
ids = util.listify( id )
message = "Deleted %d categories: " % len( ids )
for category_id in ids:
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
category.deleted = True
trans.sa_session.add( category )
trans.sa_session.flush()
@@ -442,7 +442,7 @@
purged_categories = ""
message = "Purged %d categories: " % len( ids )
for category_id in ids:
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
if category.deleted:
# Delete RepositoryCategoryAssociations
for rca in category.repositories:
@@ -469,7 +469,7 @@
count = 0
undeleted_categories = ""
for category_id in ids:
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
if category.deleted:
category.deleted = False
trans.sa_session.add( category )
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -127,7 +127,7 @@
operation = kwd[ 'operation' ].lower()
# The received id is a RepositoryMetadata id.
repository_metadata_id = kwd[ 'id' ]
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
repository_id = trans.security.encode_id( repository_metadata.repository_id )
changeset_revision = repository_metadata.changeset_revision
new_kwd = dict( id=repository_id,
@@ -146,7 +146,7 @@
return trans.response.send_redirect( web.url_for( controller='repository',
action='view_or_manage_repository',
**kwd ) )
- selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans.app, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -172,7 +172,7 @@
return trans.response.send_redirect( web.url_for( controller='repository',
action='deprecate',
**kwd ) )
- selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans.app, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -397,7 +397,7 @@
kwd[ 'message' ] = 'You must be logged in to set email alerts.'
kwd[ 'status' ] = 'error'
del kwd[ 'operation' ]
- selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans.app, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -428,19 +428,19 @@
# The received id is the repository id, so we need to get the id of the user that owns the repository.
repository_id = kwd.get( 'id', None )
if repository_id:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
user_id = trans.security.encode_id( repository.user.id )
kwd[ 'user_id' ] = user_id
else:
# The user selected a repository revision which results in a refresh_on_change.
- selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans.app, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='view_or_manage_repository',
id=trans.security.encode_id( repository.id ),
changeset_revision=selected_changeset_revision ) )
if user_id:
- user = suc.get_user( trans, user_id )
+ user = suc.get_user( trans.app, user_id )
trailing_string = 'Owned by %s' % str( user.username )
default = 'Repositories Owned by %s' % str( user.username )
else:
@@ -469,7 +469,7 @@
return trans.response.send_redirect( web.url_for( controller='repository',
action='deprecate',
**kwd ) )
- selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans.app, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -495,7 +495,7 @@
return trans.response.send_redirect( web.url_for( controller='repository',
action='deprecate',
**kwd ) )
- selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans.app, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -518,13 +518,13 @@
# The received id is the repository id, so we need to get the id of the user that owns the repository.
repository_id = kwd.get( 'id', None )
if repository_id:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
user_id = trans.security.encode_id( repository.user.id )
- user = suc.get_user( trans, user_id )
+ user = suc.get_user( trans.app, user_id )
self.repositories_by_user_grid.title = "Repositories owned by %s" % user.username
kwd[ 'user_id' ] = user_id
return self.repositories_by_user_grid( trans, **kwd )
- selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans.app, **kwd )
if repository:
# The user selected a repository revision which results in a refresh_on_change.
return trans.response.send_redirect( web.url_for( controller='repository',
@@ -533,7 +533,7 @@
changeset_revision=selected_changeset_revision ) )
category_id = kwd.get( 'id', None )
if category_id:
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
if category:
trailing_string = 'in Category %s' % str( category.name )
else:
@@ -718,7 +718,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
commit_message = kwd.get( 'commit_message', 'Deleted selected files' )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
# Update repository files for browsing.
hg_util.update_repository( repo )
@@ -740,7 +740,7 @@
operation = kwd[ 'operation' ].lower()
# The received id is a RepositoryMetadata id.
repository_metadata_id = kwd[ 'id' ]
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
repository_id = trans.security.encode_id( repository_metadata.repository_id )
changeset_revision = repository_metadata.changeset_revision
new_kwd = dict( id=repository_id,
@@ -761,7 +761,7 @@
operation = kwd[ 'operation' ].lower()
# The received id is a RepositoryMetadata id.
repository_metadata_id = kwd['id' ]
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
repository_id = trans.security.encode_id( repository_metadata.repository_id )
changeset_revision = repository_metadata.changeset_revision
new_kwd = dict( id=repository_id,
@@ -778,7 +778,7 @@
operation = kwd[ 'operation' ].lower()
# The received id is a RepositoryMetadata id.
repository_metadata_id = kwd[ 'id' ]
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
repository_id = trans.security.encode_id( repository_metadata.repository_id )
changeset_revision = repository_metadata.changeset_revision
new_kwd = dict( id=repository_id,
@@ -839,13 +839,13 @@
if 'f-Category.name' in kwd:
# The user browsed to a category and then entered a search string, so get the category associated with its value.
category_name = kwd[ 'f-Category.name' ]
- category = suc.get_category_by_name( trans, category_name )
+ category = suc.get_category_by_name( trans.app, category_name )
# Set the id value in kwd since it is required by the ValidRepositoryGrid.build_initial_query method.
kwd[ 'id' ] = trans.security.encode_id( category.id )
if 'operation' in kwd:
operation = kwd[ 'operation' ].lower()
if operation == "preview_tools_in_changeset":
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repository_metadata = metadata_util.get_latest_repository_metadata( trans, repository.id, downloadable=True )
latest_installable_changeset_revision = repository_metadata.changeset_revision
return trans.response.send_redirect( web.url_for( controller='repository',
@@ -858,9 +858,9 @@
if k.startswith( 'f-' ):
del kwd[ k ]
category_id = kwd.get( 'id', None )
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
kwd[ 'f-Category.name' ] = category.name
- selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans, **kwd )
+ selected_changeset_revision, repository = suc.get_repository_from_refresh_on_change( trans.app, **kwd )
if repository:
return trans.response.send_redirect( web.url_for( controller='repository',
action='preview_tools_in_changeset',
@@ -969,7 +969,7 @@
def contact_owner( self, trans, id, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
id,
repository.tip( trans.app ),
@@ -1046,7 +1046,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
repository_id = kwd.get( 'id', None )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
mark_deprecated = util.string_as_bool( kwd.get( 'mark_deprecated', False ) )
repository.deprecated = mark_deprecated
trans.sa_session.add( repository )
@@ -1080,7 +1080,7 @@
repository_id = kwd.get( 'repository_id', None )
relative_path_to_image_file = kwd.get( 'image_file', None )
if repository_id and relative_path_to_image_file:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
if repository:
repo_files_dir = repository.repo_path( trans.app )
path_to_file = suc.get_absolute_path_to_file_in_repository( repo_files_dir, relative_path_to_image_file )
@@ -1142,7 +1142,7 @@
"""Download an archive of the repository files compressed as zip, gz or bz2."""
# FIXME: thgis will currently only download the repository tip, no matter which installable changeset_revision is being viewed.
# This should be enhanced to use the export method below, which accounts for the currently viewed changeset_revision.
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
# Allow hgweb to handle the download. This requires the tool shed
# server account's .hgrc file to include the following setting:
# [web]
@@ -1164,7 +1164,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
export_repository_dependencies = kwd.get( 'export_repository_dependencies', '' )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
if kwd.get( 'export_repository_button', False ):
# We'll currently support only gzip-compressed tar archives.
file_type = 'gz'
@@ -1252,9 +1252,9 @@
is_admin = trans.user_is_admin()
if operation == "view_or_manage_repository":
# The received id is a RepositoryMetadata id, so we have to get the repository id.
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, item_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, item_id )
repository_id = trans.security.encode_id( repository_metadata.repository.id )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
kwd[ 'id' ] = repository_id
kwd[ 'changeset_revision' ] = repository_metadata.changeset_revision
if trans.webapp.name == 'tool_shed' and ( is_admin or repository.user == trans.user ):
@@ -1269,7 +1269,7 @@
encoded_repository_ids = []
changeset_revisions = []
for repository_metadata_id in util.listify( item_id ):
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
encoded_repository_ids.append( trans.security.encode_id( repository_metadata.repository.id ) )
changeset_revisions.append( repository_metadata.changeset_revision )
new_kwd = {}
@@ -1343,9 +1343,9 @@
is_admin = trans.user_is_admin()
if operation == "view_or_manage_repository":
# The received id is a RepositoryMetadata id, so we have to get the repository id.
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, item_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, item_id )
repository_id = trans.security.encode_id( repository_metadata.repository.id )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
kwd[ 'id' ] = repository_id
kwd[ 'changeset_revision' ] = repository_metadata.changeset_revision
if trans.webapp.name == 'tool_shed' and ( is_admin or repository.user == trans.user ):
@@ -1360,7 +1360,7 @@
encoded_repository_ids = []
changeset_revisions = []
for repository_metadata_id in util.listify( item_id ):
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, item_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, item_id )
encoded_repository_ids.append( trans.security.encode_id( repository_metadata.repository.id ) )
changeset_revisions.append( repository_metadata.changeset_revision )
new_kwd = {}
@@ -2161,7 +2161,7 @@
def manage_repository( self, trans, id, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
repository_type = kwd.get( 'repository_type', str( repository.type ) )
repo_dir = repository.repo_path( trans.app )
repo = hg_util.get_repo_for_repository( trans.app, repository=None, repo_path=repo_dir, create=False )
@@ -2387,7 +2387,7 @@
repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
malicious_check_box = CheckboxField( 'malicious', checked=is_malicious )
skip_tool_tests_check_box = CheckboxField( 'skip_tool_tests', checked=skip_tool_tests_checked )
- categories = suc.get_categories( trans )
+ categories = suc.get_categories( trans.app )
selected_categories = [ rca.category_id for rca in repository.categories ]
containers_dict = container_util.build_repository_containers_for_tool_shed( trans,
repository,
@@ -2433,7 +2433,7 @@
def manage_repository_admins( self, trans, id, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
changeset_revision = kwd.get( 'changeset_revision', repository.tip( trans.app ) )
metadata = None
if changeset_revision != hg_util.INITIAL_CHANGELOG_HASH:
@@ -2531,13 +2531,13 @@
# Avoid caching
trans.response.headers['Pragma'] = 'no-cache'
trans.response.headers['Expires'] = '0'
- return suc.open_repository_files_folder( trans, folder_path )
+ return suc.open_repository_files_folder( folder_path )
@web.expose
def preview_tools_in_changeset( self, trans, repository_id, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
changeset_revision = kwd.get( 'changeset_revision', repository.tip( trans.app ) )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans.app, repository_id, changeset_revision )
@@ -2646,7 +2646,7 @@
action='browse_repositories',
message='Select a repository to rate',
status='error' ) )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
changeset_revision = repository.tip( trans.app )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
if repository.user == trans.user:
@@ -2685,7 +2685,7 @@
# This method is called only from the ~/templates/webapps/tool_shed/repository/manage_repository.mako template.
invalid_file_tups, metadata_dict = metadata_util.reset_all_metadata_on_repository_in_tool_shed( trans, id, **kwd )
if invalid_file_tups:
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
message = tool_util.generate_message_for_invalid_tools( trans, invalid_file_tups, repository, metadata_dict )
status = 'error'
else:
@@ -2715,7 +2715,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
commit_message = kwd.get( 'commit_message', 'Deleted selected files' )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
repo_dir = repository.repo_path( trans.app )
repo = hg_util.get_repo_for_repository( trans.app, repository=None, repo_path=repo_dir, create=False )
selected_files_to_delete = kwd.get( 'selected_files_to_delete', '' )
@@ -2786,7 +2786,7 @@
@web.expose
def send_to_owner( self, trans, id, message='' ):
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
if not message:
message = 'Enter a message'
status = 'error'
@@ -2836,7 +2836,7 @@
total_alerts_removed = 0
flush_needed = False
for repository_id in repository_ids:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
if repository.email_alerts:
email_alerts = json.from_json_string( repository.email_alerts )
else:
@@ -3045,7 +3045,7 @@
owner = kwd.get( 'owner', None )
changeset_revision = kwd.get( 'changeset_revision', None )
if name and owner and changeset_revision:
- return suc.get_updated_changeset_revisions( trans, name, owner, changeset_revision )
+ return suc.get_updated_changeset_revisions( trans.app, name, owner, changeset_revision )
return ''
@web.expose
@@ -3078,7 +3078,7 @@
def view_changelog( self, trans, id, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
changesets = []
for changeset in repo.changelog:
@@ -3113,7 +3113,7 @@
def view_changeset( self, trans, id, ctx_str, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
ctx = hg_util.get_changectx_for_changeset( repo, ctx_str )
if ctx is None:
@@ -3183,7 +3183,7 @@
def view_or_manage_repository( self, trans, **kwd ):
repository_id = kwd.get( 'id', None )
if repository_id:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
user = trans.user
if repository:
if user is not None and ( trans.user_is_admin() or \
@@ -3202,7 +3202,7 @@
def view_repository( self, trans, id, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
avg_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, repository, webapp_model=trans.model )
changeset_revision = kwd.get( 'changeset_revision', repository.tip( trans.app ) )
@@ -3295,7 +3295,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
render_repository_actions_for = kwd.get( 'render_repository_actions_for', 'tool_shed' )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repo_files_dir = repository.repo_path( trans.app )
repo = hg_util.get_repo_for_repository( trans.app, repository=None, repo_path=repo_files_dir, create=False )
tool_metadata_dict = {}
@@ -3345,7 +3345,10 @@
basic_util.remove_dir( work_dir )
break
if guid:
- tool_lineage = tool_util.get_version_lineage_for_tool( trans, repository_id, repository_metadata, guid )
+ tool_lineage = tool_util.get_version_lineage_for_tool( trans.app,
+ repository_id,
+ repository_metadata,
+ guid )
else:
repository_metadata_id = None
metadata = None
@@ -3377,8 +3380,8 @@
render_repository_actions_for = kwd.get( 'render_repository_actions_for', 'tool_shed' )
if workflow_name:
workflow_name = encoding_util.tool_shed_decode( workflow_name )
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
- repository = suc.get_repository_in_tool_shed( trans, trans.security.encode_id( repository_metadata.repository_id ) )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, trans.security.encode_id( repository_metadata.repository_id ) )
changeset_revision = repository_metadata.changeset_revision
metadata = repository_metadata.metadata
return trans.fill_template( "/webapps/tool_shed/repository/view_workflow.mako",
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/tool_shed/controllers/repository_review.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository_review.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository_review.py
@@ -136,7 +136,7 @@
if repository_id:
if changeset_revision:
# Make sure there is not already a review of the revision by the user.
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
if review_util.get_review_by_repository_id_changeset_revision_user_id( trans=trans,
repository_id=repository_id,
changeset_revision=changeset_revision,
@@ -465,7 +465,7 @@
status = kwd.get( 'status', 'done' )
repository_id = kwd.get( 'id', None )
if repository_id:
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
metadata_revision_hashes = [ metadata_revision.changeset_revision for metadata_revision in repository.metadata_revisions ]
reviewed_revision_hashes = [ review.changeset_revision for review in repository.reviews ]
@@ -511,7 +511,7 @@
status = kwd.get( 'status', 'done' )
repository_id = kwd.get( 'id', None )
changeset_revision = kwd.get( 'changeset_revision', None )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
installable = changeset_revision in [ metadata_revision.changeset_revision for metadata_revision in repository.metadata_revisions ]
rev, changeset_revision_label = hg_util.get_rev_label_from_changeset_revision( repo, changeset_revision )
@@ -547,7 +547,7 @@
action='view_or_manage_repository',
**kwd ) )
# The user may not be the current user. The value of the received id is the encoded user id.
- user = suc.get_user( trans, kwd[ 'id' ] )
+ user = suc.get_user( trans.app, kwd[ 'id' ] )
self.repository_reviews_by_user_grid.title = "All repository revision reviews for user '%s'" % user.username
return self.repository_reviews_by_user_grid( trans, **kwd )
@@ -575,7 +575,7 @@
# The value of the received id is the encoded repository id.
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_repository_in_tool_shed( trans, kwd[ 'id' ] )
+ repository = suc.get_repository_in_tool_shed( trans.app, kwd[ 'id' ] )
changeset_revision = kwd.get( 'changeset_revision', None )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
previous_reviews_dict = review_util.get_previous_repository_reviews( trans, repository, changeset_revision )
@@ -591,7 +591,7 @@
@web.expose
@web.require_login( "view or manage repository" )
def view_or_manage_repository( self, trans, **kwd ):
- repository = suc.get_repository_in_tool_shed( trans, kwd[ 'id' ] )
+ repository = suc.get_repository_in_tool_shed( trans.app, kwd[ 'id' ] )
if trans.user_is_admin() or repository.user == trans.user:
return trans.response.send_redirect( web.url_for( controller='repository',
action='manage_repository',
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/galaxy/webapps/tool_shed/controllers/upload.py
--- a/lib/galaxy/webapps/tool_shed/controllers/upload.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/upload.py
@@ -35,9 +35,9 @@
status = kwd.get( 'status', 'done' )
commit_message = kwd.get( 'commit_message', 'Uploaded' )
category_ids = util.listify( kwd.get( 'category_id', '' ) )
- categories = suc.get_categories( trans )
+ categories = suc.get_categories( trans.app )
repository_id = kwd.get( 'repository_id', '' )
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repo_dir = repository.repo_path( trans.app )
repo = hg_util.get_repo_for_repository( trans.app, repository=None, repo_path=repo_dir, create=False )
uncompress_file = util.string_as_bool( kwd.get( 'uncompress_file', 'true' ) )
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
--- a/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
+++ b/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
@@ -103,7 +103,7 @@
class StatusColumn( grids.TextColumn ):
def get_value( self, trans, grid, tool_shed_repository ):
- return suc.get_tool_shed_repository_status_label( trans, tool_shed_repository )
+ return suc.get_tool_shed_repository_status_label( trans.app, tool_shed_repository )
class ToolShedColumn( grids.TextColumn ):
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -185,7 +185,7 @@
return repair_dict
def get_repo_info_dict( trans, repository_id, changeset_revision ):
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
repository_clone_url = common_util.generate_clone_url_for_repository_in_tool_shed( trans, repository )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans.app,
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/grids/repository_grids.py
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -579,7 +579,7 @@
filter = trans.app.repository_grid_filter_manager.get_filter( trans )
if filter == trans.app.repository_grid_filter_manager.filters.CERTIFIED_LEVEL_ONE:
if category_id:
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
if category:
return trans.sa_session.query( model.Repository ) \
.join( model.RepositoryMetadata.table ) \
@@ -596,7 +596,7 @@
.outerjoin( model.Category.table )
if filter == trans.app.repository_grid_filter_manager.filters.CERTIFIED_LEVEL_ONE_SUITES:
if category_id:
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
if category:
return trans.sa_session.query( model.Repository ) \
.filter( model.Repository.type == rt_util.REPOSITORY_SUITE_DEFINITION ) \
@@ -616,7 +616,7 @@
else:
# The value of filter is None.
if category_id:
- category = suc.get_category( trans, category_id )
+ category = suc.get_category( trans.app, category_id )
if category:
return trans.sa_session.query( model.Repository ) \
.filter( and_( model.Repository.table.c.deleted == False,
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/container_util.py
--- a/lib/tool_shed/util/container_util.py
+++ b/lib/tool_shed/util/container_util.py
@@ -1580,7 +1580,8 @@
tool_shed_repository_id = None
installation_status = 'unknown'
if tool_shed_repository_id:
- tool_shed_repository = suc.get_tool_shed_repository_by_id( trans, trans.security.encode_id( tool_shed_repository_id ) )
+ tool_shed_repository = suc.get_tool_shed_repository_by_id( trans.app,
+ trans.security.encode_id( tool_shed_repository_id ) )
if tool_shed_repository:
if tool_shed_repository.missing_repository_dependencies:
installation_status = '%s, missing repository dependencies' % installation_status
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/export_util.py
--- a/lib/tool_shed/util/export_util.py
+++ b/lib/tool_shed/util/export_util.py
@@ -52,7 +52,7 @@
def export_repository( trans, tool_shed_url, repository_id, repository_name, changeset_revision, file_type,
export_repository_dependencies, api=False ):
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repositories_archive_filename = generate_repository_archive_filename( tool_shed_url,
str( repository.name ),
str( repository.user.username ),
@@ -239,7 +239,7 @@
Return a list of dictionaries defining repositories that are required by the repository associated with the
received repository_id.
"""
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans.app, repository_id, changeset_revision )
# Get a dictionary of all repositories upon which the contents of the current repository_metadata record depend.
toolshed_base_url = str( web.url_for( '/', qualified=True ) ).rstrip( '/' )
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/import_util.py
--- a/lib/tool_shed/util/import_util.py
+++ b/lib/tool_shed/util/import_util.py
@@ -38,7 +38,7 @@
flush = True
# Do not allow dependent repository revisions to be automatically installed if population
# resulted in errors.
- dependent_downloadable_revisions = suc.get_dependent_downloadable_revisions( trans, repository_metadata )
+ dependent_downloadable_revisions = suc.get_dependent_downloadable_revisions( trans.app, repository_metadata )
for dependent_downloadable_revision in dependent_downloadable_revisions:
if dependent_downloadable_revision.downloadable:
dependent_downloadable_revision.downloadable = False
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -352,10 +352,10 @@
repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
for changeset in repo.changelog:
changeset_hash = str( repo.changectx( changeset ) )
- skip_tool_test = suc.get_skip_tool_test_by_changeset_revision( trans, changeset_hash )
+ skip_tool_test = suc.get_skip_tool_test_by_changeset_revision( trans.app, changeset_hash )
if skip_tool_test:
# We found a skip_tool_test record associated with the changeset_revision, so see if it has a valid repository_revision.
- repository_revision = suc.get_repository_metadata_by_id( trans, trans.security.encode_id( repository_metadata.id ) )
+ repository_revision = get_repository_metadata_by_id( trans.app, trans.security.encode_id( repository_metadata.id ) )
if repository_revision:
# The skip_tool_test record is associated with a valid repository_metadata record, so proceed.
continue
@@ -1117,9 +1117,10 @@
relative_path_to_file = relative_path_to_file[ len( shed_config_dict.get( 'tool_path' ) ) + 1: ]
return relative_path_to_file
-def get_repository_metadata_by_id( trans, id ):
+def get_repository_metadata_by_id( app, id ):
"""Get repository metadata from the database"""
- return trans.sa_session.query( trans.model.RepositoryMetadata ).get( trans.security.decode_id( id ) )
+ sa_session = app.model.context.current
+ return sa_session.query( app.model.RepositoryMetadata ).get( app.security.decode_id( id ) )
def get_repository_metadata_by_repository_id_changeset_revision( trans, id, changeset_revision, metadata_only=False ):
"""Get a specified metadata record for a specified repository in the tool shed."""
@@ -1692,30 +1693,31 @@
workflows=None )
return containers_dict
-def reset_all_metadata_on_installed_repository( trans, id ):
+def reset_all_metadata_on_installed_repository( app, id ):
"""Reset all metadata on a single tool shed repository installed into a Galaxy instance."""
invalid_file_tups = []
metadata_dict = {}
- repository = suc.get_installed_tool_shed_repository( trans.app, id )
- repository_clone_url = common_util.generate_clone_url_for_installed_repository( trans.app, repository )
- tool_path, relative_install_dir = repository.get_tool_relative_path( trans.app )
+ repository = suc.get_installed_tool_shed_repository( app, id )
+ repository_clone_url = common_util.generate_clone_url_for_installed_repository( app, repository )
+ tool_path, relative_install_dir = repository.get_tool_relative_path( app )
if relative_install_dir:
original_metadata_dict = repository.metadata
- metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app,
- repository=repository,
- changeset_revision=repository.changeset_revision,
- repository_clone_url=repository_clone_url,
- shed_config_dict = repository.get_shed_config_dict( trans.app ),
- relative_install_dir=relative_install_dir,
- repository_files_dir=None,
- resetting_all_metadata_on_repository=False,
- updating_installed_repository=False,
- persist=False )
+ metadata_dict, invalid_file_tups = \
+ generate_metadata_for_changeset_revision( app=app,
+ repository=repository,
+ changeset_revision=repository.changeset_revision,
+ repository_clone_url=repository_clone_url,
+ shed_config_dict = repository.get_shed_config_dict( app ),
+ relative_install_dir=relative_install_dir,
+ repository_files_dir=None,
+ resetting_all_metadata_on_repository=False,
+ updating_installed_repository=False,
+ persist=False )
repository.metadata = metadata_dict
if metadata_dict != original_metadata_dict:
- suc.update_in_shed_tool_config( trans.app, repository )
- trans.install_model.context.add( repository )
- trans.install_model.context.flush()
+ suc.update_in_shed_tool_config( app, repository )
+ app.install_model.context.add( repository )
+ app.install_model.context.flush()
log.debug( 'Metadata has been reset on repository %s.' % repository.name )
else:
log.debug( 'Metadata did not need to be reset on repository %s.' % repository.name )
@@ -1761,7 +1763,7 @@
repository_metadata.tool_versions = tool_versions_dict
trans.sa_session.add( repository_metadata )
trans.sa_session.flush()
- repository = suc.get_repository_in_tool_shed( trans, id )
+ repository = suc.get_repository_in_tool_shed( trans.app, id )
log.debug( "Resetting all metadata on repository: %s" % repository.name )
repo_dir = repository.repo_path( trans.app )
repo = hg_util.get_repo_for_repository( trans.app, repository=None, repo_path=repo_dir, create=False )
@@ -1881,14 +1883,14 @@
try:
if trans.webapp.name == 'tool_shed':
# We're in the tool shed.
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
owner = str( repository.user.username )
invalid_file_tups, metadata_dict = reset_all_metadata_on_repository_in_tool_shed( trans, repository_id )
else:
# We're in Galaxy.
repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
owner = str( repository.owner )
- invalid_file_tups, metadata_dict = reset_all_metadata_on_installed_repository( trans, repository_id )
+ invalid_file_tups, metadata_dict = reset_all_metadata_on_installed_repository( trans.app, repository_id )
if invalid_file_tups:
message = tool_util.generate_message_for_invalid_tools( trans, invalid_file_tups, repository, None, as_html=False )
log.debug( message )
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/repository_dependency_util.py
--- a/lib/tool_shed/util/repository_dependency_util.py
+++ b/lib/tool_shed/util/repository_dependency_util.py
@@ -269,10 +269,10 @@
message += '</table>'
return message
-def get_key_for_repository_changeset_revision( trans, toolshed_base_url, repository, repository_metadata, all_repository_dependencies ):
+def get_key_for_repository_changeset_revision( app, toolshed_base_url, repository, repository_metadata, all_repository_dependencies ):
# The received toolshed_base_url must include the port, but doesn't have to include the protocol.
prior_installation_required, only_if_compiling_contained_td = \
- get_prior_installation_required_and_only_if_compiling_contained_td( trans,
+ get_prior_installation_required_and_only_if_compiling_contained_td( app,
toolshed_base_url,
repository,
repository_metadata,
@@ -286,7 +286,7 @@
only_if_compiling_contained_td=only_if_compiling_contained_td )
return key
-def get_prior_installation_required_and_only_if_compiling_contained_td( trans, toolshed_base_url, repository, repository_metadata,
+def get_prior_installation_required_and_only_if_compiling_contained_td( app, toolshed_base_url, repository, repository_metadata,
all_repository_dependencies ):
"""
This method is called from the tool shed and never Galaxy. If all_repository_dependencies contains
@@ -312,7 +312,7 @@
metadata = repository_metadata.metadata
current_changeset_revision = str( repository_metadata.changeset_revision )
# Get the changeset revision to which the current value of required_repository_changeset_revision should be updated if it's not current.
- text = suc.get_updated_changeset_revisions( trans,
+ text = suc.get_updated_changeset_revisions( app,
name=str( repository.name ),
owner=str( repository.user.username ),
changeset_revision=current_changeset_revision )
@@ -401,7 +401,7 @@
# The value of the received toolshed_base_url must include the port, but doesn't have
# to include the protocol.
if 'repository_dependencies' in metadata:
- current_repository_key = get_key_for_repository_changeset_revision( trans,
+ current_repository_key = get_key_for_repository_changeset_revision( trans.app,
toolshed_base_url,
repository,
repository_metadata,
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/repository_maintenance_util.py
--- a/lib/tool_shed/util/repository_maintenance_util.py
+++ b/lib/tool_shed/util/repository_maintenance_util.py
@@ -152,7 +152,7 @@
category_ids = []
category_names = repository_archive_dict.get( 'category_names', [] )
for category_name in category_names:
- category = suc.get_category_by_name( trans, category_name )
+ category = suc.get_category_by_name( trans.app, category_name )
if category is None:
results_message += 'This Tool Shed does not have the category <b>%s</b> so it ' % str( category_name )
results_message += 'will not be associated with this repository.'
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -97,32 +97,32 @@
repositories_select_field.add_option( option_label, option_value )
return repositories_select_field
-def build_tool_dependencies_select_field( trans, tool_shed_repository, name, multiple=True, display='checkboxes', uninstalled_only=False ):
+def build_tool_dependencies_select_field( app, tool_shed_repository, name, multiple=True, display='checkboxes', uninstalled_only=False ):
"""Method called from Galaxy to generate the current list of tool dependency ids for an installed tool shed repository."""
tool_dependencies_select_field = SelectField( name=name, multiple=multiple, display=display )
for tool_dependency in tool_shed_repository.tool_dependencies:
if uninstalled_only:
- if tool_dependency.status not in [ trans.install_model.ToolDependency.installation_status.NEVER_INSTALLED,
- trans.install_model.ToolDependency.installation_status.UNINSTALLED ]:
+ if tool_dependency.status not in [ app.install_model.ToolDependency.installation_status.NEVER_INSTALLED,
+ app.install_model.ToolDependency.installation_status.UNINSTALLED ]:
continue
else:
- if tool_dependency.status in [ trans.install_model.ToolDependency.installation_status.NEVER_INSTALLED,
- trans.install_model.ToolDependency.installation_status.UNINSTALLED ]:
+ if tool_dependency.status in [ app.install_model.ToolDependency.installation_status.NEVER_INSTALLED,
+ app.install_model.ToolDependency.installation_status.UNINSTALLED ]:
continue
option_label = '%s version %s' % ( str( tool_dependency.name ), str( tool_dependency.version ) )
- option_value = trans.security.encode_id( tool_dependency.id )
+ option_value = app.security.encode_id( tool_dependency.id )
tool_dependencies_select_field.add_option( option_label, option_value )
return tool_dependencies_select_field
-def check_or_update_tool_shed_status_for_installed_repository( trans, repository ):
+def check_or_update_tool_shed_status_for_installed_repository( app, repository ):
updated = False
- tool_shed_status_dict = get_tool_shed_status_for_installed_repository( trans.app, repository )
+ tool_shed_status_dict = get_tool_shed_status_for_installed_repository( app, repository )
if tool_shed_status_dict:
ok = True
if tool_shed_status_dict != repository.tool_shed_status:
repository.tool_shed_status = tool_shed_status_dict
- trans.install_model.context.add( repository )
- trans.install_model.context.flush()
+ app.install_model.context.add( repository )
+ app.install_model.context.flush()
updated = True
else:
ok = False
@@ -368,21 +368,24 @@
return os.path.abspath( os.path.join( root, name ) )
return file_path
-def get_categories( trans ):
+def get_categories( app ):
"""Get all categories from the database."""
- return trans.sa_session.query( trans.model.Category ) \
- .filter( trans.model.Category.table.c.deleted==False ) \
- .order_by( trans.model.Category.table.c.name ) \
- .all()
+ sa_session = app.model.context.current
+ return sa_session.query( app.model.Category ) \
+ .filter( app.model.Category.table.c.deleted==False ) \
+ .order_by( app.model.Category.table.c.name ) \
+ .all()
-def get_category( trans, id ):
+def get_category( app, id ):
"""Get a category from the database."""
- return trans.sa_session.query( trans.model.Category ).get( trans.security.decode_id( id ) )
+ sa_session = app.model.context.current
+ return sa_session.query( app.model.Category ).get( app.security.decode_id( id ) )
-def get_category_by_name( trans, name ):
+def get_category_by_name( app, name ):
"""Get a category from the database via name."""
+ sa_session = app.model.context.current
try:
- return trans.sa_session.query( trans.model.Category ).filter_by( name=name ).one()
+ return sa_session.query( app.model.Category ).filter_by( name=name ).one()
except sqlalchemy.orm.exc.NoResultFound:
return None
@@ -419,21 +422,22 @@
return repository_metadata
return None
-def get_dependent_downloadable_revisions( trans, repository_metadata ):
+def get_dependent_downloadable_revisions( app, repository_metadata ):
"""
Return all repository_metadata records that are downloadable and that depend upon the received
repository_metadata record.
"""
# This method is called only from the tool shed.
+ sa_session = app.model.context.current
rm_changeset_revision = repository_metadata.changeset_revision
rm_repository = repository_metadata.repository
rm_repository_name = str( rm_repository.name )
rm_repository_owner = str( rm_repository.user.username )
dependent_downloadable_revisions = []
- for repository in trans.sa_session.query( trans.model.Repository ) \
- .filter( and_( trans.model.Repository.table.c.id != rm_repository.id,
- trans.model.Repository.table.c.deleted == False,
- trans.model.Repository.table.c.deprecated == False ) ):
+ for repository in sa_session.query( app.model.Repository ) \
+ .filter( and_( app.model.Repository.table.c.id != rm_repository.id,
+ app.model.Repository.table.c.deleted == False,
+ app.model.Repository.table.c.deprecated == False ) ):
downloadable_revisions = repository.downloadable_revisions
if downloadable_revisions:
for downloadable_revision in downloadable_revisions:
@@ -454,14 +458,14 @@
else:
# Make sure the defined changeset_revision is current.
defined_repository_metadata = \
- trans.sa_session.query( trans.model.RepositoryMetadata ) \
- .filter( trans.model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) \
- .first()
+ sa_session.query( app.model.RepositoryMetadata ) \
+ .filter( app.model.RepositoryMetadata.table.c.changeset_revision == changeset_revision ) \
+ .first()
if defined_repository_metadata is None:
# The defined changeset_revision is not associated with a repository_metadata
# record, so updates must be necessary.
- defined_repository = get_repository_by_name_and_owner( trans.app, name, owner )
- defined_repo = hg_util.get_repo_for_repository( trans.app,
+ defined_repository = get_repository_by_name_and_owner( app, name, owner )
+ defined_repo = hg_util.get_repo_for_repository( app,
repository=defined_repository,
repo_path=None,
create=False )
@@ -473,20 +477,21 @@
dependent_downloadable_revisions.append( downloadable_revision )
return dependent_downloadable_revisions
-def get_ids_of_tool_shed_repositories_being_installed( trans, as_string=False ):
+def get_ids_of_tool_shed_repositories_being_installed( app, as_string=False ):
installing_repository_ids = []
- new_status = trans.install_model.ToolShedRepository.installation_status.NEW
- cloning_status = trans.install_model.ToolShedRepository.installation_status.CLONING
- setting_tool_versions_status = trans.install_model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS
- installing_dependencies_status = trans.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES
- loading_datatypes_status = trans.install_model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES
- for tool_shed_repository in trans.install_model.context.query( trans.install_model.ToolShedRepository ) \
- .filter( or_( trans.install_model.ToolShedRepository.status == new_status,
- trans.install_model.ToolShedRepository.status == cloning_status,
- trans.install_model.ToolShedRepository.status == setting_tool_versions_status,
- trans.install_model.ToolShedRepository.status == installing_dependencies_status,
- trans.install_model.ToolShedRepository.status == loading_datatypes_status ) ):
- installing_repository_ids.append( trans.security.encode_id( tool_shed_repository.id ) )
+ new_status = app.install_model.ToolShedRepository.installation_status.NEW
+ cloning_status = app.install_model.ToolShedRepository.installation_status.CLONING
+ setting_tool_versions_status = app.install_model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS
+ installing_dependencies_status = app.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES
+ loading_datatypes_status = app.install_model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES
+ for tool_shed_repository in \
+ app.install_model.context.query( app.install_model.ToolShedRepository ) \
+ .filter( or_( app.install_model.ToolShedRepository.status == new_status,
+ app.install_model.ToolShedRepository.status == cloning_status,
+ app.install_model.ToolShedRepository.status == setting_tool_versions_status,
+ app.install_model.ToolShedRepository.status == installing_dependencies_status,
+ app.install_model.ToolShedRepository.status == loading_datatypes_status ) ):
+ installing_repository_ids.append( app.security.encode_id( tool_shed_repository.id ) )
if as_string:
return ','.join( installing_repository_ids )
return installing_repository_ids
@@ -723,12 +728,13 @@
repository = get_repository_by_name_and_owner( app, repository_name, repository_owner )
return repository, repository_dependencies
-def get_repository_by_id( trans, id ):
+def get_repository_by_id( app, id ):
"""Get a repository from the database via id."""
- if is_tool_shed_client( trans.app ):
- return trans.install_model.context.query( trans.install_model.ToolShedRepository ).get( trans.security.decode_id( id ) )
+ if is_tool_shed_client( app ):
+ return app.install_model.context.query( app.install_model.ToolShedRepository ).get( app.security.decode_id( id ) )
else:
- return trans.sa_session.query( trans.model.Repository ).get( trans.security.decode_id( id ) )
+ sa_session = app.model.context.current
+ return sa_session.query( app.model.Repository ).get( app.security.decode_id( id ) )
def get_repository_by_name( app, name ):
"""Get a repository from the database via name."""
@@ -851,7 +857,7 @@
beginning_on_size_error=True )
return safe_str
-def get_repository_files( trans, folder_path ):
+def get_repository_files( folder_path ):
"""Return the file hierarchy of a tool shed repository."""
contents = []
for item in os.listdir( folder_path ):
@@ -866,7 +872,7 @@
contents.sort()
return contents
-def get_repository_from_refresh_on_change( trans, **kwd ):
+def get_repository_from_refresh_on_change( app, **kwd ):
# The changeset_revision_select_field in several grids performs a refresh_on_change which sends in request parameters like
# changeset_revison_1, changeset_revision_2, etc. One of the many select fields on the grid performed the refresh_on_change,
# so we loop through all of the received values to see which value is not the repository tip. If we find it, we know the
@@ -876,9 +882,9 @@
for k, v in kwd.items():
changeset_revision_str = 'changeset_revision_'
if k.startswith( changeset_revision_str ):
- repository_id = trans.security.encode_id( int( k.lstrip( changeset_revision_str ) ) )
- repository = get_repository_in_tool_shed( trans, repository_id )
- if repository.tip( trans.app ) != v:
+ repository_id = app.security.encode_id( int( k.lstrip( changeset_revision_str ) ) )
+ repository = get_repository_in_tool_shed( app, repository_id )
+ if repository.tip( app ) != v:
return v, repository
# This should never be reached - raise an exception?
return v, None
@@ -919,9 +925,10 @@
prior_tsr_ids.append( encoded_repository_id )
return prior_tsr_ids
-def get_repository_in_tool_shed( trans, id ):
+def get_repository_in_tool_shed( app, id ):
"""Get a repository on the tool shed side from the database via id."""
- return trans.sa_session.query( trans.model.Repository ).get( trans.security.decode_id( id ) )
+ sa_session = app.model.context.current
+ return sa_session.query( app.model.Repository ).get( app.security.decode_id( id ) )
def get_repository_metadata_by_changeset_revision( app, id, changeset_revision ):
"""Get metadata for a specified repository change set from the database."""
@@ -944,9 +951,6 @@
return all_metadata_records[ 0 ]
return None
-def get_repository_metadata_by_id( trans, id ):
- return trans.sa_session.query( trans.model.RepositoryMetadata ).get( trans.security.decode_id( id ) )
-
def get_repository_owner( cleaned_repository_url ):
"""Gvien a "cleaned" repository clone URL, return the owner of the repository."""
items = cleaned_repository_url.split( '/repos/' )
@@ -996,12 +1000,13 @@
if shed_tool_conf == file_name:
return index, shed_tool_conf_dict
-def get_skip_tool_test_by_changeset_revision( trans, changeset_revision ):
+def get_skip_tool_test_by_changeset_revision( app, changeset_revision ):
"""Return a skip_tool_test record whose initial_changeset_revision is the received changeset_revision."""
# There should only be one, but we'll use first() so callers won't have to handle exceptions.
- return trans.sa_session.query( trans.model.SkipToolTest ) \
- .filter( trans.model.SkipToolTest.table.c.initial_changeset_revision == changeset_revision ) \
- .first()
+ sa_session = app.model.context.current
+ return sa_session.query( app.model.SkipToolTest ) \
+ .filter( app.model.SkipToolTest.table.c.initial_changeset_revision == changeset_revision ) \
+ .first()
def get_tool_panel_config_tool_path_install_dir( app, repository ):
"""
@@ -1026,12 +1031,12 @@
tool_path = shed_config_dict[ 'tool_path' ]
return shed_tool_conf, tool_path, relative_install_dir
-def get_tool_path_by_shed_tool_conf_filename( trans, shed_tool_conf ):
+def get_tool_path_by_shed_tool_conf_filename( app, shed_tool_conf ):
"""
Return the tool_path config setting for the received shed_tool_conf file by searching the tool box's in-memory list of shed_tool_confs for the
dictionary whose config_filename key has a value matching the received shed_tool_conf.
"""
- for shed_tool_conf_dict in trans.app.toolbox.shed_tool_confs:
+ for shed_tool_conf_dict in app.toolbox.shed_tool_confs:
config_filename = shed_tool_conf_dict[ 'config_filename' ]
if config_filename == shed_tool_conf:
return shed_tool_conf_dict[ 'tool_path' ]
@@ -1045,12 +1050,12 @@
tmp_url = common_util.remove_protocol_and_user_from_clone_url( repository_clone_url )
return tmp_url.split( '/repos/' )[ 0 ].rstrip( '/' )
-def get_tool_shed_repository_by_id( trans, repository_id ):
+def get_tool_shed_repository_by_id( app, repository_id ):
"""Return a tool shed repository database record defined by the id."""
# This method is used only in Galaxy, not the tool shed.
- return trans.install_model.context.query( trans.install_model.ToolShedRepository ) \
- .filter( trans.install_model.ToolShedRepository.table.c.id == trans.security.decode_id( repository_id ) ) \
- .first()
+ return app.install_model.context.query( app.install_model.ToolShedRepository ) \
+ .filter( app.install_model.ToolShedRepository.table.c.id == app.security.decode_id( repository_id ) ) \
+ .first()
def get_tool_shed_repository_by_shed_name_owner_changeset_revision( app, tool_shed, name, owner, changeset_revision ):
"""
@@ -1123,60 +1128,62 @@
log.exception( "Error attempting to get tool shed status for installed repository %s: %s" % ( str( repository.name ), str( e ) ) )
return {}
-def get_tool_shed_repository_status_label( trans, tool_shed_repository=None, name=None, owner=None, changeset_revision=None, repository_clone_url=None ):
+def get_tool_shed_repository_status_label( app, tool_shed_repository=None, name=None, owner=None, changeset_revision=None, repository_clone_url=None ):
"""Return a color-coded label for the status of the received tool-shed_repository installed into Galaxy."""
if tool_shed_repository is None:
if name is not None and owner is not None and repository_clone_url is not None:
tool_shed = get_tool_shed_from_clone_url( repository_clone_url )
- tool_shed_repository = get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( trans.app,
+ tool_shed_repository = get_tool_shed_repository_by_shed_name_owner_installed_changeset_revision( app,
tool_shed,
name,
owner,
changeset_revision )
if tool_shed_repository:
status_label = tool_shed_repository.status
- if tool_shed_repository.status in [ trans.install_model.ToolShedRepository.installation_status.CLONING,
- trans.install_model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS,
- trans.install_model.ToolShedRepository.installation_status.INSTALLING_REPOSITORY_DEPENDENCIES,
- trans.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES,
- trans.install_model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES ]:
- bgcolor = trans.install_model.ToolShedRepository.states.INSTALLING
- elif tool_shed_repository.status in [ trans.install_model.ToolShedRepository.installation_status.NEW,
- trans.install_model.ToolShedRepository.installation_status.UNINSTALLED ]:
- bgcolor = trans.install_model.ToolShedRepository.states.UNINSTALLED
- elif tool_shed_repository.status in [ trans.install_model.ToolShedRepository.installation_status.ERROR ]:
- bgcolor = trans.install_model.ToolShedRepository.states.ERROR
- elif tool_shed_repository.status in [ trans.install_model.ToolShedRepository.installation_status.DEACTIVATED ]:
- bgcolor = trans.install_model.ToolShedRepository.states.WARNING
- elif tool_shed_repository.status in [ trans.install_model.ToolShedRepository.installation_status.INSTALLED ]:
+ if tool_shed_repository.status in [ app.install_model.ToolShedRepository.installation_status.CLONING,
+ app.install_model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS,
+ app.install_model.ToolShedRepository.installation_status.INSTALLING_REPOSITORY_DEPENDENCIES,
+ app.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES,
+ app.install_model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES ]:
+ bgcolor = app.install_model.ToolShedRepository.states.INSTALLING
+ elif tool_shed_repository.status in [ app.install_model.ToolShedRepository.installation_status.NEW,
+ app.install_model.ToolShedRepository.installation_status.UNINSTALLED ]:
+ bgcolor = app.install_model.ToolShedRepository.states.UNINSTALLED
+ elif tool_shed_repository.status in [ app.install_model.ToolShedRepository.installation_status.ERROR ]:
+ bgcolor = app.install_model.ToolShedRepository.states.ERROR
+ elif tool_shed_repository.status in [ app.install_model.ToolShedRepository.installation_status.DEACTIVATED ]:
+ bgcolor = app.install_model.ToolShedRepository.states.WARNING
+ elif tool_shed_repository.status in [ app.install_model.ToolShedRepository.installation_status.INSTALLED ]:
if tool_shed_repository.repository_dependencies_being_installed:
- bgcolor = trans.install_model.ToolShedRepository.states.WARNING
- status_label = '%s, %s' % ( status_label, trans.install_model.ToolShedRepository.installation_status.INSTALLING_REPOSITORY_DEPENDENCIES )
+ bgcolor = app.install_model.ToolShedRepository.states.WARNING
+ status_label = '%s, %s' % ( status_label,
+ app.install_model.ToolShedRepository.installation_status.INSTALLING_REPOSITORY_DEPENDENCIES )
elif tool_shed_repository.missing_repository_dependencies:
- bgcolor = trans.install_model.ToolShedRepository.states.WARNING
+ bgcolor = app.install_model.ToolShedRepository.states.WARNING
status_label = '%s, missing repository dependencies' % status_label
elif tool_shed_repository.tool_dependencies_being_installed:
- bgcolor = trans.install_model.ToolShedRepository.states.WARNING
- status_label = '%s, %s' % (status_label, trans.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES )
+ bgcolor = app.install_model.ToolShedRepository.states.WARNING
+ status_label = '%s, %s' % ( status_label,
+ app.install_model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES )
elif tool_shed_repository.missing_tool_dependencies:
- bgcolor = trans.install_model.ToolShedRepository.states.WARNING
+ bgcolor = app.install_model.ToolShedRepository.states.WARNING
status_label = '%s, missing tool dependencies' % status_label
else:
- bgcolor = trans.install_model.ToolShedRepository.states.OK
+ bgcolor = app.install_model.ToolShedRepository.states.OK
else:
- bgcolor = trans.install_model.ToolShedRepository.states.ERROR
+ bgcolor = app.install_model.ToolShedRepository.states.ERROR
else:
- bgcolor = trans.install_model.ToolShedRepository.states.WARNING
+ bgcolor = app.install_model.ToolShedRepository.states.WARNING
status_label = 'unknown status'
return '<div class="count-box state-color-%s">%s</div>' % ( bgcolor, status_label )
-def get_updated_changeset_revisions( trans, name, owner, changeset_revision ):
+def get_updated_changeset_revisions( app, name, owner, changeset_revision ):
"""
Return a string of comma-separated changeset revision hashes for all available updates to the received changeset
revision for the repository defined by the received name and owner.
"""
- repository = get_repository_by_name_and_owner( trans.app, name, owner )
- repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
+ repository = get_repository_by_name_and_owner( app, name, owner )
+ repo = hg_util.get_repo_for_repository( app, repository=repository, repo_path=None, create=False )
# Get the upper bound changeset revision.
upper_bound_changeset_revision = get_next_downloadable_changeset_revision( repository, repo, changeset_revision )
# Build the list of changeset revision hashes defining each available update up to, but excluding
@@ -1208,9 +1215,10 @@
text = common_util.tool_shed_get( app, tool_shed_url, url )
return text
-def get_user( trans, id ):
+def get_user( app, id ):
"""Get a user from the database by id."""
- return trans.sa_session.query( trans.model.User ).get( trans.security.decode_id( id ) )
+ sa_session = app.model.context.current
+ return sa_session.query( app.model.User ).get( app.security.decode_id( id ) )
def get_user_by_username( app, username ):
"""Get a user from the database by username."""
@@ -1325,7 +1333,6 @@
return True
return False
-
def is_tool_shed_client( app ):
""" The tool shed and clients to the tool (i.e. Galaxy) require a lot
of similar functionality in this file but with small differences. This
@@ -1334,14 +1341,13 @@
"""
return hasattr( app, "install_model" )
-
-def open_repository_files_folder( trans, folder_path ):
+def open_repository_files_folder( folder_path ):
"""
Return a list of dictionaries, each of which contains information for a file or directory contained
within a directory in a repository file hierarchy.
"""
try:
- files_list = get_repository_files( trans, folder_path )
+ files_list = get_repository_files( folder_path )
except OSError, e:
if str( e ).find( 'No such file or directory' ) >= 0:
# We have a repository with no contents.
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/tool_util.py
--- a/lib/tool_shed/util/tool_util.py
+++ b/lib/tool_shed/util/tool_util.py
@@ -526,20 +526,20 @@
app.install_model.ToolVersionAssociation.table.c.tool_id == tool_version.id ) ) \
.first()
-def get_version_lineage_for_tool( trans, repository_id, repository_metadata, guid ):
+def get_version_lineage_for_tool( app, repository_id, repository_metadata, guid ):
"""
Return the tool version lineage chain in descendant order for the received guid contained in the received
repsitory_metadata.tool_versions.
"""
- repository = suc.get_repository_by_id( trans, repository_id )
- repo = hg_util.get_repo_for_repository( trans.app, repository=repository, repo_path=None, create=False )
+ repository = suc.get_repository_by_id( app, repository_id )
+ repo = hg_util.get_repo_for_repository( app, repository=repository, repo_path=None, create=False )
# Initialize the tool lineage
version_lineage = [ guid ]
# Get all ancestor guids of the received guid.
current_child_guid = guid
for changeset in hg_util.reversed_upper_bounded_changelog( repo, repository_metadata.changeset_revision ):
ctx = repo.changectx( changeset )
- rm = suc.get_repository_metadata_by_changeset_revision( trans.app, repository_id, str( ctx ) )
+ rm = suc.get_repository_metadata_by_changeset_revision( app, repository_id, str( ctx ) )
if rm:
parent_guid = rm.tool_versions.get( current_child_guid, None )
if parent_guid:
@@ -549,9 +549,9 @@
current_parent_guid = guid
for changeset in hg_util.reversed_lower_upper_bounded_changelog( repo,
repository_metadata.changeset_revision,
- repository.tip( trans.app ) ):
+ repository.tip( app ) ):
ctx = repo.changectx( changeset )
- rm = suc.get_repository_metadata_by_changeset_revision( trans.app, repository_id, str( ctx ) )
+ rm = suc.get_repository_metadata_by_changeset_revision( app, repository_id, str( ctx ) )
if rm:
tool_versions = rm.tool_versions
for child_guid, parent_guid in tool_versions.items():
@@ -853,12 +853,14 @@
def load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config_filename ):
"""
- Return a loaded tool whose tool config file name (e.g., filtering.xml) is the value of tool_config_filename. The value of changeset_revision
- is a valid (downloadable) changset revision. The tool config will be located in the repository manifest between the received valid changeset
- revision and the first changeset revision in the repository, searching backwards.
+ Return a loaded tool whose tool config file name (e.g., filtering.xml) is the value
+ of tool_config_filename. The value of changeset_revision is a valid (downloadable)
+ changset revision. The tool config will be located in the repository manifest between
+ the received valid changeset revision and the first changeset revision in the repository,
+ searching backwards.
"""
original_tool_data_path = trans.app.config.tool_data_path
- repository = suc.get_repository_in_tool_shed( trans, repository_id )
+ repository = suc.get_repository_in_tool_shed( trans.app, repository_id )
repo_files_dir = repository.repo_path( trans.app )
repo = hg_util.get_repo_for_repository( trans.app, repository=None, repo_path=repo_files_dir, create=False )
message = ''
@@ -869,7 +871,11 @@
can_use_disk_file = can_use_tool_config_disk_file( trans, repository, repo, tool_config_filepath, changeset_revision )
if can_use_disk_file:
trans.app.config.tool_data_path = work_dir
- tool, valid, message, sample_files = handle_sample_files_and_load_tool_from_disk( trans, repo_files_dir, repository_id, tool_config_filepath, work_dir )
+ tool, valid, message, sample_files = handle_sample_files_and_load_tool_from_disk( trans,
+ repo_files_dir,
+ repository_id,
+ tool_config_filepath,
+ work_dir )
if tool is not None:
invalid_files_and_errors_tups = check_tool_input_params( trans.app,
repo_files_dir,
@@ -885,7 +891,12 @@
displaying_invalid_tool=True )
message = concat_messages( message, message2 )
else:
- tool, message, sample_files = handle_sample_files_and_load_tool_from_tmp_config( trans, repo, repository_id, changeset_revision, tool_config_filename, work_dir )
+ tool, message, sample_files = handle_sample_files_and_load_tool_from_tmp_config( trans,
+ repo,
+ repository_id,
+ changeset_revision,
+ tool_config_filename,
+ work_dir )
basic_util.remove_dir( work_dir )
trans.app.config.tool_data_path = original_tool_data_path
# Reset the tool_data_tables by loading the empty tool_data_table_conf.xml file.
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c lib/tool_shed/util/workflow_util.py
--- a/lib/tool_shed/util/workflow_util.py
+++ b/lib/tool_shed/util/workflow_util.py
@@ -176,13 +176,13 @@
workflow_name = encoding_util.tool_shed_decode( workflow_name )
if trans.webapp.name == 'tool_shed':
# We're in the tool shed.
- repository_metadata = metadata_util.get_repository_metadata_by_id( trans, repository_metadata_id )
+ repository_metadata = metadata_util.get_repository_metadata_by_id( trans.app, repository_metadata_id )
repository_id = trans.security.encode_id( repository_metadata.repository_id )
changeset_revision = repository_metadata.changeset_revision
metadata = repository_metadata.metadata
else:
# We're in Galaxy.
- repository = suc.get_tool_shed_repository_by_id( trans, repository_id )
+ repository = suc.get_tool_shed_repository_by_id( trans.app, repository_id )
changeset_revision = repository.changeset_revision
metadata = repository.metadata
# metadata[ 'workflows' ] is a list of tuples where each contained tuple is
diff -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc -r 9a69f032d6d9a0d5ece25332db78a81b3a18d91c templates/admin/tool_shed_repository/repair_repository.mako
--- a/templates/admin/tool_shed_repository/repair_repository.mako
+++ b/templates/admin/tool_shed_repository/repair_repository.mako
@@ -56,7 +56,7 @@
for name, repo_info_tuple in repo_info_dict.items():
description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, tool_dependencies = repo_info_tuple
break
- status_label = get_tool_shed_repository_status_label( trans,
+ status_label = get_tool_shed_repository_status_label( trans.app,
tool_shed_repository=None,
name=name,
owner=repository_owner,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Add the ability to purge a "white ghost" tool shed repository from Galaxy.
by commits-noreply@bitbucket.org 12 Jun '14
by commits-noreply@bitbucket.org 12 Jun '14
12 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7d6f8afcac4d/
Changeset: 7d6f8afcac4d
User: greg
Date: 2014-06-12 20:16:00
Summary: Add the ability to purge a "white ghost" tool shed repository from Galaxy.
Affected #: 6 files
diff -r 08fe9352836ee4d18ac3d446c45d84e5a7db9611 -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc lib/galaxy/model/tool_shed_install/__init__.py
--- a/lib/galaxy/model/tool_shed_install/__init__.py
+++ b/lib/galaxy/model/tool_shed_install/__init__.py
@@ -238,7 +238,7 @@
def is_deactivated_or_installed( self ):
return self.status in [ self.installation_status.DEACTIVATED,
self.installation_status.INSTALLED ]
-
+
@property
def is_installed( self ):
return self.status == self.installation_status.INSTALLED
@@ -250,6 +250,10 @@
return False
@property
+ def is_new( self ):
+ return self.status == self.installation_status.NEW
+
+ @property
def missing_repository_dependencies( self ):
"""Return the repository's repository dependencies that are not currently installed, and may not ever have been installed."""
missing_required_repositories = []
@@ -629,11 +633,11 @@
def to_dict( self, view='element' ):
rval = super( ToolVersion, self ).to_dict( view=view )
- rval['tool_name'] = self.tool_id
+ rval[ 'tool_name' ] = self.tool_id
for a in self.parent_tool_association:
- rval['parent_tool_id'] = a.parent_id
+ rval[ 'parent_tool_id' ] = a.parent_id
for a in self.child_tool_association:
- rval['child_tool_id'] = a.tool_id
+ rval[ 'child_tool_id' ] = a.tool_id
return rval
diff -r 08fe9352836ee4d18ac3d446c45d84e5a7db9611 -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -45,7 +45,7 @@
def activate_repository( self, trans, **kwd ):
"""Activate a repository that was deactivated but not uninstalled."""
repository_id = kwd[ 'id' ]
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
try:
common_install_util.activate_repository( trans.app, repository )
except Exception, e:
@@ -71,7 +71,7 @@
def browse_repository( self, trans, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] )
+ repository = suc.get_installed_tool_shed_repository( trans.app, kwd[ 'id' ] )
return trans.fill_template( '/admin/tool_shed_repository/browse_repository.mako',
repository=repository,
message=message,
@@ -99,8 +99,13 @@
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='reset_to_install',
**kwd ) )
+ if operation == "purge":
+ kwd[ 'purge_repository' ] = True
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='purge_repository',
+ **kwd ) )
if operation == "activate or reinstall":
- repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] )
+ repository = suc.get_installed_tool_shed_repository( trans.app, kwd[ 'id' ] )
if repository.uninstalled:
# Since we're reinstalling the repository we need to find the latest changeset revision to which it can
# be updated so that we can reset the metadata if necessary. This will ensure that information about
@@ -134,7 +139,7 @@
**kwd ) )
else:
message = "Unable to get latest revision for repository <b>%s</b> from " % str( repository.name )
- message += "the Tool Shed, so repository reinstallation is not possible at this time."
+ message += "the Tool Shed, so repository re-installation is not possible at this time."
status = "error"
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='browse_repositories',
@@ -152,6 +157,10 @@
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='install_latest_repository_revision',
**kwd ) )
+ if operation == 'install':
+ # The user is attempting to install a white ghost.
+ kwd[ 'status' ] = 'error'
+ kwd[ 'message' ] = 'It seems you are attempting to install a "white ghost", which should instead be purged.'
return self.installed_repository_grid( trans, **kwd )
@web.expose
@@ -196,7 +205,7 @@
def check_for_updates( self, trans, **kwd ):
"""Send a request to the relevant tool shed to see if there are any updates."""
repository_id = kwd.get( 'id', None )
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) )
params = '?galaxy_url=%s&name=%s&owner=%s&changeset_revision=%s' % \
( web.url_for( '/', qualified=True ),
@@ -220,7 +229,7 @@
status = kwd.get( 'status', 'done' )
remove_from_disk = kwd.get( 'remove_from_disk', '' )
remove_from_disk_checked = CheckboxField.is_checked( remove_from_disk )
- tool_shed_repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] )
+ tool_shed_repository = suc.get_installed_tool_shed_repository( trans.app, kwd[ 'id' ] )
shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, tool_shed_repository )
if relative_install_dir:
if tool_path:
@@ -375,7 +384,7 @@
of the installed tool shed repository in Galaxy. We need it so that we can derive the tool shed from which
it was installed.
"""
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) )
if tool_shed_url is None or repository_name is None or repository_owner is None or changeset_revision is None:
message = "Unable to retrieve tool dependencies from the Tool Shed because one or more of the following required "
@@ -400,7 +409,7 @@
Send a request to the appropriate tool shed to retrieve the dictionary of information required to reinstall
an updated revision of an uninstalled tool shed repository.
"""
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) )
if tool_shed_url is None or repository_name is None or repository_owner is None or changeset_revision is None:
message = "Unable to retrieve updated repository information from the Tool Shed because one or more of the following "
@@ -495,7 +504,7 @@
status = kwd.get( 'status', 'done' )
repository_id = kwd.get( 'id', None )
if repository_id is not None:
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
if repository is not None:
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) )
name = str( repository.name )
@@ -553,7 +562,7 @@
dependencies are included in the updated revision.
"""
updating_repository_id = kwd.get( 'updating_repository_id', None )
- repository = suc.get_installed_tool_shed_repository( trans, updating_repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, updating_repository_id )
# All received dependencies need to be installed - confirmed by the caller.
encoded_tool_dependencies_dict = kwd.get( 'encoded_tool_dependencies_dict', None )
if encoded_tool_dependencies_dict is not None:
@@ -730,7 +739,7 @@
if repository_id is None:
return trans.show_error_message( 'Missing required encoded repository id.' )
operation = kwd.get( 'operation', None )
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
if repository is None:
return trans.show_error_message( 'Invalid repository specified.' )
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) )
@@ -1254,6 +1263,32 @@
@web.expose
@web.require_admin
+ def purge_repository( self, trans, **kwd ):
+ """Purge a "white ghost" repository from the database."""
+ repository_id = kwd.get( 'id', None )
+ new_kwd = {}
+ if repository_id is not None:
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
+ if repository:
+ if kwd.get( 'purge_repository', False ):
+ purge_status, purge_message = repository_util.purge_repository( trans.app, repository )
+ if purge_status == 'ok':
+ new_kwd[ 'status' ] = "done"
+ else:
+ new_kwd[ 'status' ] = 'error'
+ new_kwd[ 'message' ] = purge_message
+ else:
+ new_kwd[ 'status' ] = 'error'
+ new_kwd[ 'message' ] = 'Cannot locate the database record for the repository with encoded id %s.' % str( repository_id )
+ else:
+ new_kwd[ 'status' ] = 'error'
+ new_kwd[ 'message' ] = 'Invalid repository id value "None" received for repository to be purged.'
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ **new_kwd ) )
+
+ @web.expose
+ @web.require_admin
def reinstall_repository( self, trans, **kwd ):
"""
Reinstall a tool shed repository that has been previously uninstalled, making sure to handle all repository
@@ -1262,7 +1297,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
repository_id = kwd[ 'id' ]
- tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ tool_shed_repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
no_changes = kwd.get( 'no_changes', '' )
no_changes_checked = CheckboxField.is_checked( no_changes )
install_repository_dependencies = CheckboxField.is_checked( kwd.get( 'install_repository_dependencies', '' ) )
@@ -1407,7 +1442,7 @@
action='browse_repositories',
message=message,
status=status ) )
- tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ tool_shed_repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
if kwd.get( 'repair_repository_button', False ):
encoded_repair_dict = kwd.get( 'repair_dict', None )
if encoded_repair_dict:
@@ -1424,7 +1459,7 @@
repository = trans.install_model.context.query( trans.install_model.ToolShedRepository ).get( trans.security.decode_id( tsr_id ) )
repositories_for_repair.append( repository )
return self.repair_tool_shed_repositories( trans, repositories_for_repair, ordered_repo_info_dicts )
- tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ tool_shed_repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
repair_dict = repository_util.get_repair_dict( trans, tool_shed_repository )
encoded_repair_dict = encoding_util.tool_shed_encode( repair_dict )
ordered_tsr_ids = repair_dict.get( 'ordered_tsr_ids', [] )
@@ -1486,7 +1521,7 @@
repository_id = kwd.get( 'id', None )
latest_changeset_revision = kwd.get( 'latest_changeset_revision', None )
latest_ctx_rev = kwd.get( 'latest_ctx_rev', None )
- tool_shed_repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ tool_shed_repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
repository_clone_url = common_util.generate_clone_url_for_installed_repository( trans.app, tool_shed_repository )
metadata = tool_shed_repository.metadata
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( tool_shed_repository.tool_shed ) )
@@ -1672,7 +1707,7 @@
@web.require_admin
def reset_repository_metadata( self, trans, id ):
"""Reset all metadata on a single installed tool shed repository."""
- repository = suc.get_installed_tool_shed_repository( trans, id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, id )
repository_clone_url = common_util.generate_clone_url_for_installed_repository( trans.app, repository )
tool_path, relative_install_dir = repository.get_tool_relative_path( trans.app )
if relative_install_dir:
@@ -1711,7 +1746,7 @@
@web.require_admin
def reset_to_install( self, trans, **kwd ):
"""An error occurred while cloning the repository, so reset everything necessary to enable another attempt."""
- repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] )
+ repository = suc.get_installed_tool_shed_repository( trans.app, kwd[ 'id' ] )
if kwd.get( 'reset_repository', False ):
repository_util.set_repository_attributes( trans.app,
repository,
@@ -1721,7 +1756,7 @@
uninstalled=False,
remove_from_disk=True )
new_kwd = {}
- new_kwd[ 'message' ] = "You can now attempt to install the repository named <b>%s</b> again." % repository.name
+ new_kwd[ 'message' ] = "You can now attempt to install the repository named <b>%s</b> again." % str( repository.name )
new_kwd[ 'status' ] = "done"
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='browse_repositories',
@@ -1737,7 +1772,7 @@
Get the tool_versions from the tool shed for each tool in the installed revision of a selected tool shed
repository and update the metadata for the repository's revision in the Galaxy database.
"""
- repository = suc.get_installed_tool_shed_repository( trans, kwd[ 'id' ] )
+ repository = suc.get_installed_tool_shed_repository( trans.app, kwd[ 'id' ] )
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, str( repository.tool_shed ) )
params = '?name=%s&owner=%s&changeset_revision=%s' % ( str( repository.name ),
str( repository.owner ),
@@ -2052,7 +2087,7 @@
def view_tool_metadata( self, trans, repository_id, tool_id, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
repository_metadata = repository.metadata
shed_config_dict = repository.get_shed_config_dict( trans.app )
tool_metadata = {}
diff -r 08fe9352836ee4d18ac3d446c45d84e5a7db9611 -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
--- a/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
+++ b/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
@@ -214,7 +214,14 @@
target=None,
url_args=dict( controller='admin_toolshed',
action='browse_repositories',
- operation='activate or reinstall' ) ) ]
+ operation='activate or reinstall' ) ),
+ grids.GridOperation( label="Purge",
+ condition=( lambda item: item.is_new ),
+ allow_multiple=False,
+ target=None,
+ url_args=dict( controller='admin_toolshed',
+ action='browse_repositories',
+ operation='purge' ) ) ]
standard_filters = []
default_filter = dict( deleted="False" )
num_rows_per_page = 50
diff -r 08fe9352836ee4d18ac3d446c45d84e5a7db9611 -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -976,6 +976,117 @@
"""Pull changes from a remote repository to a local one."""
commands.pull( hg_util.get_configured_ui(), repo, source=repository_clone_url, rev=[ ctx_rev ] )
+def purge_repository( app, repository ):
+ """Purge a repository with status New (a white ghost) from the database."""
+ sa_session = app.model.context.current
+ status = 'ok'
+ message = ''
+ purged_tool_versions = 0
+ purged_tool_dependencies = 0
+ purged_required_repositories = 0
+ purged_orphan_repository_repository_dependency_association_records = 0
+ purged_orphan_repository_dependency_records = 0
+ if repository.is_new:
+ # Purge this repository's associated tool versions.
+ if repository.tool_versions:
+ for tool_version in repository.tool_versions:
+ try:
+ tool_version_association = tool_version.parent_tool_association
+ sa_session.delete( tool_version_association )
+ sa_session.flush()
+ except Exception, e:
+ status = 'error'
+ message = 'Error attempting to purge tool_versions for the repository named %s with status %s: %s.' % \
+ ( str( repository.name ), str( repository.status ), str( e ) )
+ return status, message
+ try:
+ tool_version_association = tool_version.child_tool_association
+ sa_session.delete( tool_version_association )
+ sa_session.flush()
+ except Exception, e:
+ status = 'error'
+ message = 'Error attempting to purge tool_versions for the repository named %s with status %s: %s.' % \
+ ( str( repository.name ), str( repository.status ), str( e ) )
+ return status, message
+ try:
+ sa_session.delete( tool_version )
+ sa_session.flush()
+ purged_tool_versions += 1
+ except Exception, e:
+ status = 'error'
+ message = 'Error attempting to purge tool_versions for the repository named %s with status %s: %s.' % \
+ ( str( repository.name ), str( repository.status ), str( e ) )
+ return status, message
+ # Purge this repository's associated tool dependencies.
+ if repository.tool_dependencies:
+ for tool_dependency in repository.tool_dependencies:
+ try:
+ sa_session.delete( tool_dependency )
+ sa_session.flush()
+ purged_tool_dependencies += 1
+ except Exception, e:
+ status = 'error'
+ message = 'Error attempting to purge tool_dependencies for the repository named %s with status %s: %s.' % \
+ ( str( repository.name ), str( repository.status ), str( e ) )
+ return status, message
+ # Purge this repository's associated required repositories.
+ if repository.required_repositories:
+ for rrda in repository.required_repositories:
+ try:
+ sa_session.delete( rrda )
+ sa_session.flush()
+ purged_required_repositories += 1
+ except Exception, e:
+ status = 'error'
+ message = 'Error attempting to purge required_repositories for the repository named %s with status %s: %s.' % \
+ ( str( repository.name ), str( repository.status ), str( e ) )
+ return status, message
+ # Purge any "orphan" repository_dependency records associated with the repository, but not with any
+ # repository_repository_dependency_association records.
+ for orphan_repository_dependency in \
+ sa_session.query( app.install_model.RepositoryDependency ) \
+ .filter( app.install_model.RepositoryDependency.table.c.tool_shed_repository_id == repository.id ):
+ # Purge any repository_repository_dependency_association records whose repository_dependency_id is
+ # the id of the orphan repository_dependency record.
+ for orphan_rrda in \
+ sa_session.query( app.install_model.RepositoryRepositoryDependencyAssociation ) \
+ .filter( app.install_model.RepositoryRepositoryDependencyAssociation.table.c.repository_dependency_id == orphan_repository_dependency.id ):
+ try:
+ sa_session.delete( orphan_rrda )
+ sa_session.flush()
+ purged_orphan_repository_repository_dependency_association_records += 1
+ except Exception, e:
+ status = 'error'
+ message = 'Error attempting to purge repository_repository_dependency_association records associated with '
+ message += 'an orphan repository_dependency record for the repository named %s with status %s: %s.' % \
+ ( str( repository.name ), str( repository.status ), str( e ) )
+ return status, message
+ try:
+ sa_session.delete( orphan_repository_dependency )
+ sa_session.flush()
+ purged_orphan_repository_dependency_records += 1
+ except Exception, e:
+ status = 'error'
+ message = 'Error attempting to purge orphan repository_dependency records for the repository named %s with status %s: %s.' % \
+ ( str( repository.name ), str( repository.status ), str( e ) )
+ return status, message
+ # Purge the repository.
+ sa_session.delete( repository )
+ sa_session.flush()
+ message = 'The repository named <b>%s</b> with status <b>%s</b> has been purged.<br/>' % \
+ ( str( repository.name ), str( repository.status ) )
+ message += 'Total associated tool_version records purged: %d<br/>' % purged_tool_versions
+ message += 'Total associated tool_dependency records purged: %d<br/>' % purged_tool_dependencies
+ message += 'Total associated repository_repository_dependency_association records purged: %d<br/>' % purged_required_repositories
+ message += 'Total associated orphan repository_repository_dependency_association records purged: %d<br/>' % \
+ purged_orphan_repository_repository_dependency_association_records
+ message += 'Total associated orphan repository_dependency records purged: %d<br/>' % purged_orphan_repository_dependency_records
+ else:
+ status = 'error'
+ message = 'A repository must have the status <b>New</b> in order to be purged. This repository has '
+ message += ' the status %s.' % str( repository.status )
+ return status, message
+
def repair_tool_shed_repository( trans, repository, repo_info_dict ):
def add_repair_dict_entry( repository_name, error_message ):
diff -r 08fe9352836ee4d18ac3d446c45d84e5a7db9611 -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc lib/tool_shed/util/metadata_util.py
--- a/lib/tool_shed/util/metadata_util.py
+++ b/lib/tool_shed/util/metadata_util.py
@@ -1696,7 +1696,7 @@
"""Reset all metadata on a single tool shed repository installed into a Galaxy instance."""
invalid_file_tups = []
metadata_dict = {}
- repository = suc.get_installed_tool_shed_repository( trans, id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, id )
repository_clone_url = common_util.generate_clone_url_for_installed_repository( trans.app, repository )
tool_path, relative_install_dir = repository.get_tool_relative_path( trans.app )
if relative_install_dir:
@@ -1886,7 +1886,7 @@
invalid_file_tups, metadata_dict = reset_all_metadata_on_repository_in_tool_shed( trans, repository_id )
else:
# We're in Galaxy.
- repository = suc.get_installed_tool_shed_repository( trans, repository_id )
+ repository = suc.get_installed_tool_shed_repository( trans.app, repository_id )
owner = str( repository.owner )
invalid_file_tups, metadata_dict = reset_all_metadata_on_installed_repository( trans, repository_id )
if invalid_file_tups:
diff -r 08fe9352836ee4d18ac3d446c45d84e5a7db9611 -r 7d6f8afcac4d6c208e864c9b8eb35d14d98725cc lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -491,9 +491,9 @@
return ','.join( installing_repository_ids )
return installing_repository_ids
-def get_installed_tool_shed_repository( trans, id ):
+def get_installed_tool_shed_repository( app, id ):
"""Get a tool shed repository record from the Galaxy database defined by the id."""
- return trans.install_model.context.query( trans.install_model.ToolShedRepository ).get( trans.security.decode_id( id ) )
+ return app.install_model.context.query( app.install_model.ToolShedRepository ).get( app.security.decode_id( id ) )
def get_latest_changeset_revision( app, repository, repo ):
repository_tip = repository.tip( app )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: davebgx: Merge fix for dataset stdio.
by commits-noreply@bitbucket.org 12 Jun '14
by commits-noreply@bitbucket.org 12 Jun '14
12 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/08fe9352836e/
Changeset: 08fe9352836e
User: davebgx
Date: 2014-06-12 19:59:49
Summary: Merge fix for dataset stdio.
Affected #: 1 file
diff -r 646b5877871b3b15c6fc6a9ecf111fceb23ea270 -r 08fe9352836ee4d18ac3d446c45d84e5a7db9611 test/base/interactor.py
--- a/test/base/interactor.py
+++ b/test/base/interactor.py
@@ -386,8 +386,7 @@
self.twill_test_case.verify_dataset_correctness( outfile, hid=hid, attributes=attributes, shed_tool_id=shed_tool_id, maxseconds=maxseconds )
def get_job_stream( self, history_id, output_data, stream ):
- encoded_id = self.twill_test_case.security.encode_id( output_data.get( 'id' ) )
- return self.twill_test_case._get_job_stream_output( encoded_id, stream=stream, format=False )
+ return self.twill_test_case._get_job_stream_output( output_data.get( 'id' ), stream=stream, format=False )
def stage_data_async( self, test_data, history, shed_tool_id, async=True ):
name = test_data.get( 'name', None )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: davebgx: Revert change that ended up breaking display of job stdio in functional tests.
by commits-noreply@bitbucket.org 12 Jun '14
by commits-noreply@bitbucket.org 12 Jun '14
12 Jun '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9b78595ec114/
Changeset: 9b78595ec114
Branch: stable
User: davebgx
Date: 2014-06-12 19:40:04
Summary: Revert change that ended up breaking display of job stdio in functional tests.
Affected #: 1 file
diff -r d6b1ea3a6a9ed2e7c3fa41518c5a690ed49c1265 -r 9b78595ec1142d75930dbfffd8baeaa689cb4c6c test/base/interactor.py
--- a/test/base/interactor.py
+++ b/test/base/interactor.py
@@ -386,8 +386,7 @@
self.twill_test_case.verify_dataset_correctness( outfile, hid=hid, attributes=attributes, shed_tool_id=shed_tool_id, maxseconds=maxseconds )
def get_job_stream( self, history_id, output_data, stream ):
- encoded_id = self.twill_test_case.security.encode_id( output_data.get( 'id' ) )
- return self.twill_test_case._get_job_stream_output( encoded_id, stream=stream, format=False )
+ return self.twill_test_case._get_job_stream_output( output_data.get( 'id' ), stream=stream, format=False )
def stage_data_async( self, test_data, history, shed_tool_id, async=True ):
name = test_data.get( 'name', None )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0