Skip to content

Commit 6d6dbdd

Browse files
authored
Merge pull request mysticfall#206 from mzko/master
Pentaho CDE Widget improvement
2 parents e91a5a4 + 6017b43 commit 6d6dbdd

File tree

3 files changed

+35
-9
lines changed

3 files changed

+35
-9
lines changed

pivot4j-analytics/src/main/webapp/resources/pivot4j/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,4 +717,8 @@ body.ie-compat .ui-toolbar .ui-separator {
717717

718718
.migration-dialog .ui-layout-container .ui-layout-pane-north {
719719
border: none;
720+
}
721+
722+
.wrap {
723+
white-space: normal !important;
720724
}

pivot4j-pentaho/src/main/webapp/cde/component.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<Property>width</Property>
1717
<Property>height</Property>
1818
<Property>filePath</Property>
19+
<Property name="parameters">xActionArrayParameter</Property>
1920
<Property>listeners</Property>
2021
<Property>preExecution</Property>
2122
<Property>postExecution</Property>

pivot4j-pentaho/src/main/webapp/cde/pivot4j-widget.js

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,48 @@
11
var Pivot4JComponent = BaseComponent.extend({
22

33
update : function() {
4-
if (!this.htmlObject) {
4+
myself = this;
5+
if (!myself.htmlObject) {
56
return;
67
}
78

8-
var widget = $("#" + this.htmlObject);
9-
var iframe = $(document.createElement("iframe"));
9+
var widget = $("#" + myself.htmlObject);
10+
var iframe = $("#id_" + myself.htmlObject + "_iframe");
11+
if (iframe.length != 0) {
12+
iframe.remove();
13+
}
14+
15+
iframe = $(document.createElement("iframe"));
16+
iframe.attr("id", "id_" + myself.htmlObject + "_iframe");
17+
if (myself.width) {
18+
iframe.width(myself.width);
19+
}
1020

11-
if (this.width) {
12-
iframe.width(this.width);
21+
if (myself.width) {
22+
iframe.height(myself.height);
1323
}
1424

15-
if (this.width) {
16-
iframe.height(this.height);
25+
var query = "";
26+
if (myself.parameters) {
27+
var p = new Array(myself.parameters?myself.parameters.length:0);
28+
for(var i= 0, len = p.length; i < len; i++) {
29+
var key = myself.parameters[i][0];
30+
var value = myself.parameters[i][1] == "" || myself.parameters[i][1] == "NIL" ? myself.parameters[i][2] : myself.parameters[i][1];
31+
if (window.hasOwnProperty(value)) {
32+
value = window[value];
33+
} else {
34+
value = Dashboards.getParameterValue(value);
35+
}
36+
query = query + "&" + encodeURIComponent(key) + "=" + encodeURIComponent(value);
37+
}
1738
}
1839

19-
var path = encodeURIComponent(this.filePath);
40+
var path = encodeURIComponent(myself.filePath);
2041

2142
iframe.attr("frameBorder", "none").attr(
2243
"src",
2344
webAppPath + "/plugin/pivot4j/faces/open.xhtml?embeded=true&path="
24-
+ path);
45+
+ path + query);
2546

2647
widget.append(iframe);
2748
}

0 commit comments

Comments
 (0)