cube 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +2 -0
- data/README.md +6 -4
- data/VERSION +1 -1
- data/cube.gemspec +7 -2
- data/lib/cube/cube.rb +23 -27
- data/lib/cube/xmla.rb +5 -12
- data/spec/cassettes/.yml +40 -0
- data/spec/cassettes/mondrian_broj_intervencija.yml +269 -0
- data/spec/cube_spec.rb +47 -27
- metadata +28 -15
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -8,6 +8,7 @@ GEM
|
|
8
8
|
crack (0.3.1)
|
9
9
|
diff-lcs (1.1.3)
|
10
10
|
git (1.2.5)
|
11
|
+
guerrilla_patch (2.0.0)
|
11
12
|
gyoku (0.4.4)
|
12
13
|
builder (>= 2.1.2)
|
13
14
|
httpi (0.9.5)
|
@@ -48,6 +49,7 @@ PLATFORMS
|
|
48
49
|
|
49
50
|
DEPENDENCIES
|
50
51
|
bundler (~> 1.0.0)
|
52
|
+
guerrilla_patch
|
51
53
|
jeweler (~> 1.6.4)
|
52
54
|
rspec (~> 2.3.0)
|
53
55
|
savon
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Cube
|
2
2
|
================
|
3
3
|
|
4
|
-
Use this gem talk to the OLAP based backend via
|
4
|
+
Use this gem talk to the OLAP based backend via XMLA SOAP messages from Ruby.
|
5
5
|
You can send (simple) MDX queries and get the result back in a human friendly from.
|
6
6
|
|
7
7
|
Installation
|
@@ -17,7 +17,7 @@ Configuration
|
|
17
17
|
Set up your catalog and endpoint
|
18
18
|
|
19
19
|
```
|
20
|
-
|
20
|
+
XMLA.configure do |c|
|
21
21
|
c.endpoint = "http://localhost:8282/icCube/xmla"
|
22
22
|
c.catalog = "GOSJAR"
|
23
23
|
end
|
@@ -26,14 +26,16 @@ end
|
|
26
26
|
Usage
|
27
27
|
-------
|
28
28
|
```
|
29
|
-
table = Cube.execute
|
29
|
+
table = XMLA::Cube.execute "select [Location].[City].children on COLUMNS,
|
30
|
+
[Measures].[Count] on ROWS
|
31
|
+
from [GOSJAR]"
|
30
32
|
```
|
31
33
|
|
32
34
|
Limitations
|
33
35
|
------------
|
34
36
|
* No drill down (fails to even parse the result)
|
35
37
|
* No multi named columns
|
36
|
-
* Tested only with icCube, in theory works with every
|
38
|
+
* Tested only with icCube and Mondrian XMLA, in theory works with every XMLA provider
|
37
39
|
|
38
40
|
Contributing to cube
|
39
41
|
-------------------------------
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
data/cube.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "cube"
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["drKreso"]
|
12
|
-
s.date = "2012-02-
|
12
|
+
s.date = "2012-02-12"
|
13
13
|
s.description = "Eases the pain I had to go through to get to the data of Xmla based OLAP provider"
|
14
14
|
s.email = "kresimir.bojcic@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -30,8 +30,10 @@ Gem::Specification.new do |s|
|
|
30
30
|
"lib/cube/cube.rb",
|
31
31
|
"lib/cube/xmla.rb",
|
32
32
|
"lib/wsdl/xmla.xml",
|
33
|
+
"spec/cassettes/.yml",
|
33
34
|
"spec/cassettes/kvartovi_u_recima.yml",
|
34
35
|
"spec/cassettes/kvatovi_u_koloni.yml",
|
36
|
+
"spec/cassettes/mondrian_broj_intervencija.yml",
|
35
37
|
"spec/cassettes/razlog_prijave_i_kvart.yml",
|
36
38
|
"spec/cube_spec.rb",
|
37
39
|
"spec/spec_helper.rb"
|
@@ -48,6 +50,7 @@ Gem::Specification.new do |s|
|
|
48
50
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
49
51
|
s.add_runtime_dependency(%q<savon>, [">= 0"])
|
50
52
|
s.add_runtime_dependency(%q<webmock>, [">= 0"])
|
53
|
+
s.add_runtime_dependency(%q<guerrilla_patch>, [">= 0"])
|
51
54
|
s.add_development_dependency(%q<vcr>, [">= 0"])
|
52
55
|
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
53
56
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
@@ -55,6 +58,7 @@ Gem::Specification.new do |s|
|
|
55
58
|
else
|
56
59
|
s.add_dependency(%q<savon>, [">= 0"])
|
57
60
|
s.add_dependency(%q<webmock>, [">= 0"])
|
61
|
+
s.add_dependency(%q<guerrilla_patch>, [">= 0"])
|
58
62
|
s.add_dependency(%q<vcr>, [">= 0"])
|
59
63
|
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
60
64
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
@@ -63,6 +67,7 @@ Gem::Specification.new do |s|
|
|
63
67
|
else
|
64
68
|
s.add_dependency(%q<savon>, [">= 0"])
|
65
69
|
s.add_dependency(%q<webmock>, [">= 0"])
|
70
|
+
s.add_dependency(%q<guerrilla_patch>, [">= 0"])
|
66
71
|
s.add_dependency(%q<vcr>, [">= 0"])
|
67
72
|
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
68
73
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
data/lib/cube/cube.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'savon'
|
2
|
+
require 'guerrilla_patch'
|
2
3
|
|
3
4
|
Savon.configure do |config|
|
4
5
|
config.soap_version = 1
|
@@ -7,11 +8,12 @@ end
|
|
7
8
|
|
8
9
|
HTTPI.log = false
|
9
10
|
|
10
|
-
module
|
11
|
+
module XMLA
|
11
12
|
|
12
13
|
class Cube
|
14
|
+
attr_reader :query, :catalog
|
13
15
|
|
14
|
-
def Cube.execute(query, catalog =
|
16
|
+
def Cube.execute(query, catalog = XMLA.catalog)
|
15
17
|
Cube.new(query, catalog).as_table
|
16
18
|
end
|
17
19
|
|
@@ -19,10 +21,10 @@ module Xmla
|
|
19
21
|
clean_table(table, y_size).reduce([]) { |result, row| result << row.flatten.join('|') }
|
20
22
|
end
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
let(:x_axe) { @x_axe ||= axes[0] }
|
25
|
+
let(:y_axe) { @y_axe ||= axes[1] }
|
26
|
+
let(:y_size) { y_axe[0].size }
|
27
|
+
let(:x_size) { x_axe.size }
|
26
28
|
|
27
29
|
private
|
28
30
|
|
@@ -38,24 +40,12 @@ module Xmla
|
|
38
40
|
def axes
|
39
41
|
axes = @response.to_hash[:execute_response][:return][:root][:axes][:axis].select { |axe| axe[:@name] != "SlicerAxis" }
|
40
42
|
@axes ||= axes.reduce([]) do |result, axe|
|
41
|
-
|
43
|
+
result << tuple(axe).reduce([]) { |y, member|
|
42
44
|
data = (member[0] == :member) ? member[1] : member[:member]
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
y << data[:caption].strip
|
47
|
-
else
|
48
|
-
z = []
|
49
|
-
data.each do |item_data|
|
50
|
-
if (item_data.class == Hash)
|
51
|
-
caption = item_data[:caption].strip
|
52
|
-
z << caption
|
53
|
-
end
|
54
|
-
end
|
55
|
-
y << z
|
56
|
-
end
|
45
|
+
y << ( data.class == Hash || data.size == 1 ?
|
46
|
+
[data[:caption].strip].flatten :
|
47
|
+
data.select { |item_data| item_data.class == Hash }.reduce([]) { |z,item_data| z << item_data[:caption].strip } )
|
57
48
|
}
|
58
|
-
result << y
|
59
49
|
end
|
60
50
|
end
|
61
51
|
|
@@ -69,13 +59,12 @@ module Xmla
|
|
69
59
|
def get_response
|
70
60
|
client = Savon::Client.new do
|
71
61
|
wsdl.document = File.expand_path("../../wsdl/xmla.xml", __FILE__)
|
72
|
-
wsdl.endpoint =
|
62
|
+
wsdl.endpoint = XMLA.endpoint
|
73
63
|
end
|
74
64
|
|
75
65
|
@response = client.request :execute, xmlns:"urn:schemas-microsoft-com:xml-analysis" do
|
76
|
-
soap.body =
|
77
|
-
|
78
|
-
end
|
66
|
+
soap.body = Cube.request_body(query, catalog)
|
67
|
+
end
|
79
68
|
end
|
80
69
|
|
81
70
|
#cleanup table so items don't repeat (if they are same)
|
@@ -94,7 +83,14 @@ module Xmla
|
|
94
83
|
@data ||= cell_data.reduce([]) { |data, cell| cell[1].reduce(data) { |data, value| data << value[:value] } }
|
95
84
|
end
|
96
85
|
|
97
|
-
|
86
|
+
let(:tuple) { |axe| axe[:tuples][:tuple] }
|
87
|
+
|
88
|
+
def Cube.request_body(query, catalog)
|
89
|
+
"<Command> <Statement> <![CDATA[ #{query} ]]> </Statement> </Command> <Properties> <PropertyList> <Catalog>#{catalog}</Catalog>
|
90
|
+
<Format>Multidimensional</Format> <AxisFormat>TupleFormat</AxisFormat> </PropertyList> </Properties>"
|
91
|
+
end
|
98
92
|
|
99
93
|
end
|
100
94
|
end
|
95
|
+
|
96
|
+
|
data/lib/cube/xmla.rb
CHANGED
@@ -1,16 +1,9 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
end
|
5
|
-
|
6
|
-
def self.endpoint=(value)
|
7
|
-
@endpoint = value
|
1
|
+
module XMLA
|
2
|
+
class << self
|
3
|
+
attr_accessor :endpoint, :catalog
|
8
4
|
end
|
9
5
|
|
10
|
-
def self.
|
11
|
-
|
6
|
+
def self.configure
|
7
|
+
yield self if block_given?
|
12
8
|
end
|
13
|
-
|
14
|
-
def self.endpoint() @endpoint end
|
15
|
-
def self.catalog() @catalog end
|
16
9
|
end
|
data/spec/cassettes/.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: http://localhost:8383/mondrian/xmla
|
6
|
+
body: ! "<?xml version=\"1.0\" encoding=\"UTF-8\"?><env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
|
7
|
+
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:wsdl=\"http://tempuri.org/wsdl/\"
|
8
|
+
xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ins0=\"http://tempuri.org/type\"><env:Body><Execute
|
9
|
+
xmlns=\"urn:schemas-microsoft-com:xml-analysis\"><Command> <Statement> <![CDATA[
|
10
|
+
\ ]]> </Statement> </Command> <Properties> <PropertyList> <Catalog></Catalog>\n
|
11
|
+
\ <Format>Multidimensional</Format> <AxisFormat>TupleFormat</AxisFormat>
|
12
|
+
</PropertyList> </Properties></Execute></env:Body></env:Envelope>"
|
13
|
+
headers:
|
14
|
+
soapaction:
|
15
|
+
- ! '"urn:schemas-microsoft-com:xml-analysis:Execute"'
|
16
|
+
content-type:
|
17
|
+
- text/xml;charset=UTF-8
|
18
|
+
content-length:
|
19
|
+
- '612'
|
20
|
+
response: !ruby/struct:VCR::Response
|
21
|
+
status: !ruby/struct:VCR::ResponseStatus
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
server:
|
26
|
+
- Apache-Coyote/1.1
|
27
|
+
content-type:
|
28
|
+
- text/xml
|
29
|
+
transfer-encoding:
|
30
|
+
- chunked
|
31
|
+
date:
|
32
|
+
- Sat, 11 Feb 2012 23:02:52 GMT
|
33
|
+
body: ! "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"
|
34
|
+
SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" >\n<SOAP-ENV:Header>\n</SOAP-ENV:Header>\n<SOAP-ENV:Body>\n<SOAP-ENV:Fault>\n
|
35
|
+
\ <faultcode>SOAP-ENV:Server.00HSBB01</faultcode>\n <faultstring>XMLA SOAP
|
36
|
+
Body processing error</faultstring>\n <faultactor>Mondrian</faultactor>\n <detail>\n
|
37
|
+
\ <XA:error xmlns:XA=\"http://mondrian.sourceforge.net\">\n <code>00HSBB01</code>\n
|
38
|
+
\ <desc>The Mondrian XML: Mondrian Error:Internal error: Unknown catalog
|
39
|
+
''</desc>\n </XA:error>\n </detail>\n</SOAP-ENV:Fault>\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>\n"
|
40
|
+
http_version: '1.1'
|
@@ -0,0 +1,269 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :post
|
5
|
+
uri: http://localhost:8383/mondrian/xmla
|
6
|
+
body: ! "<?xml version=\"1.0\" encoding=\"UTF-8\"?><env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
|
7
|
+
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:wsdl=\"http://tempuri.org/wsdl/\"
|
8
|
+
xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ins0=\"http://tempuri.org/type\"><env:Body><Execute
|
9
|
+
xmlns=\"urn:schemas-microsoft-com:xml-analysis\"><Command> <Statement> <![CDATA[
|
10
|
+
SELECT NON EMPTY {Hierarchize({[Measures].[Broj intervencija]})} ON COLUMNS,
|
11
|
+
NON EMPTY {Hierarchize({[Gradska cetvrt].[Gradska cetvrt].Members})} ON ROWS
|
12
|
+
FROM [Kvarovi] ]]> </Statement> </Command> <Properties> <PropertyList> <Catalog>GOSJAR</Catalog>\n
|
13
|
+
\ <Format>Multidimensional</Format> <AxisFormat>TupleFormat</AxisFormat>
|
14
|
+
</PropertyList> </Properties></Execute></env:Body></env:Envelope>"
|
15
|
+
headers:
|
16
|
+
soapaction:
|
17
|
+
- ! '"urn:schemas-microsoft-com:xml-analysis:Execute"'
|
18
|
+
content-type:
|
19
|
+
- text/xml;charset=UTF-8
|
20
|
+
content-length:
|
21
|
+
- '786'
|
22
|
+
response: !ruby/struct:VCR::Response
|
23
|
+
status: !ruby/struct:VCR::ResponseStatus
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
server:
|
28
|
+
- Apache-Coyote/1.1
|
29
|
+
content-type:
|
30
|
+
- text/xml;charset=UTF-8
|
31
|
+
transfer-encoding:
|
32
|
+
- chunked
|
33
|
+
date:
|
34
|
+
- Sun, 12 Feb 2012 14:58:54 GMT
|
35
|
+
body: ! "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"
|
36
|
+
SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" >\n<SOAP-ENV:Header>\n</SOAP-ENV:Header>\n<SOAP-ENV:Body>\n<cxmla:ExecuteResponse
|
37
|
+
xmlns:cxmla=\"urn:schemas-microsoft-com:xml-analysis\">\n <cxmla:return>\n
|
38
|
+
\ <root xmlns=\"urn:schemas-microsoft-com:xml-analysis:mddataset\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
|
39
|
+
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:EX=\"urn:schemas-microsoft-com:xml-analysis:exception\">\n
|
40
|
+
\ <xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" targetNamespace=\"urn:schemas-microsoft-com:xml-analysis:mddataset\"
|
41
|
+
xmlns=\"urn:schemas-microsoft-com:xml-analysis:mddataset\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
|
42
|
+
xmlns:sql=\"urn:schemas-microsoft-com:xml-sql\" elementFormDefault=\"qualified\">\n
|
43
|
+
\ <xsd:complexType name=\"MemberType\">\n <xsd:sequence>\n <xsd:element
|
44
|
+
name=\"UName\" type=\"xsd:string\"/>\n <xsd:element name=\"Caption\"
|
45
|
+
type=\"xsd:string\"/>\n <xsd:element name=\"LName\" type=\"xsd:string\"/>\n
|
46
|
+
\ <xsd:element name=\"LNum\" type=\"xsd:unsignedInt\"/>\n <xsd:element
|
47
|
+
name=\"DisplayInfo\" type=\"xsd:unsignedInt\"/>\n <xsd:sequence maxOccurs=\"unbounded\"
|
48
|
+
minOccurs=\"0\">\n <xsd:any processContents=\"lax\" maxOccurs=\"unbounded\"/>\n
|
49
|
+
\ </xsd:sequence>\n </xsd:sequence>\n <xsd:attribute
|
50
|
+
name=\"Hierarchy\" type=\"xsd:string\"/>\n </xsd:complexType>\n <xsd:complexType
|
51
|
+
name=\"PropType\">\n <xsd:attribute name=\"name\" type=\"xsd:string\"/>\n
|
52
|
+
\ </xsd:complexType>\n <xsd:complexType name=\"TupleType\">\n <xsd:sequence
|
53
|
+
maxOccurs=\"unbounded\">\n <xsd:element name=\"Member\" type=\"MemberType\"/>\n
|
54
|
+
\ </xsd:sequence>\n </xsd:complexType>\n <xsd:complexType
|
55
|
+
name=\"MembersType\">\n <xsd:sequence maxOccurs=\"unbounded\">\n <xsd:element
|
56
|
+
name=\"Member\" type=\"MemberType\"/>\n </xsd:sequence>\n <xsd:attribute
|
57
|
+
name=\"Hierarchy\" type=\"xsd:string\"/>\n </xsd:complexType>\n <xsd:complexType
|
58
|
+
name=\"TuplesType\">\n <xsd:sequence maxOccurs=\"unbounded\">\n <xsd:element
|
59
|
+
name=\"Tuple\" type=\"TupleType\"/>\n </xsd:sequence>\n </xsd:complexType>\n
|
60
|
+
\ <xsd:complexType name=\"CrossProductType\">\n <xsd:sequence>\n
|
61
|
+
\ <xsd:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n <xsd:element
|
62
|
+
name=\"Members\" type=\"MembersType\"/>\n <xsd:element name=\"Tuples\"
|
63
|
+
type=\"TuplesType\"/>\n </xsd:choice>\n </xsd:sequence>\n
|
64
|
+
\ <xsd:attribute name=\"Size\" type=\"xsd:unsignedInt\"/>\n </xsd:complexType>\n
|
65
|
+
\ <xsd:complexType name=\"OlapInfo\">\n <xsd:sequence>\n <xsd:element
|
66
|
+
name=\"CubeInfo\">\n <xsd:complexType>\n <xsd:sequence>\n
|
67
|
+
\ <xsd:element name=\"Cube\" maxOccurs=\"unbounded\">\n <xsd:complexType>\n
|
68
|
+
\ <xsd:sequence>\n <xsd:element name=\"CubeName\"
|
69
|
+
type=\"xsd:string\"/>\n </xsd:sequence>\n </xsd:complexType>\n
|
70
|
+
\ </xsd:element>\n </xsd:sequence>\n </xsd:complexType>\n
|
71
|
+
\ </xsd:element>\n <xsd:element name=\"AxesInfo\">\n <xsd:complexType>\n
|
72
|
+
\ <xsd:sequence>\n <xsd:element name=\"AxisInfo\"
|
73
|
+
maxOccurs=\"unbounded\">\n <xsd:complexType>\n <xsd:sequence>\n
|
74
|
+
\ <xsd:element name=\"HierarchyInfo\" minOccurs=\"0\"
|
75
|
+
maxOccurs=\"unbounded\">\n <xsd:complexType>\n <xsd:sequence>\n
|
76
|
+
\ <xsd:sequence maxOccurs=\"unbounded\">\n <xsd:element
|
77
|
+
name=\"UName\" type=\"PropType\"/>\n <xsd:element
|
78
|
+
name=\"Caption\" type=\"PropType\"/>\n <xsd:element
|
79
|
+
name=\"LName\" type=\"PropType\"/>\n <xsd:element
|
80
|
+
name=\"LNum\" type=\"PropType\"/>\n <xsd:element
|
81
|
+
name=\"DisplayInfo\" type=\"PropType\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n
|
82
|
+
\ </xsd:sequence>\n <xsd:sequence>\n
|
83
|
+
\ <xsd:any processContents=\"lax\" minOccurs=\"0\"
|
84
|
+
maxOccurs=\"unbounded\"/>\n </xsd:sequence>\n </xsd:sequence>\n
|
85
|
+
\ <xsd:attribute name=\"name\" type=\"xsd:string\"
|
86
|
+
use=\"required\"/>\n </xsd:complexType>\n </xsd:element>\n
|
87
|
+
\ </xsd:sequence>\n <xsd:attribute
|
88
|
+
name=\"name\" type=\"xsd:string\"/>\n </xsd:complexType>\n
|
89
|
+
\ </xsd:element>\n </xsd:sequence>\n </xsd:complexType>\n
|
90
|
+
\ </xsd:element>\n <xsd:element name=\"CellInfo\">\n <xsd:complexType>\n
|
91
|
+
\ <xsd:sequence>\n <xsd:sequence minOccurs=\"0\"
|
92
|
+
maxOccurs=\"unbounded\">\n <xsd:choice>\n <xsd:element
|
93
|
+
name=\"Value\" type=\"PropType\"/>\n <xsd:element name=\"FmtValue\"
|
94
|
+
type=\"PropType\"/>\n <xsd:element name=\"BackColor\" type=\"PropType\"/>\n
|
95
|
+
\ <xsd:element name=\"ForeColor\" type=\"PropType\"/>\n
|
96
|
+
\ <xsd:element name=\"FontName\" type=\"PropType\"/>\n <xsd:element
|
97
|
+
name=\"FontSize\" type=\"PropType\"/>\n <xsd:element name=\"FontFlags\"
|
98
|
+
type=\"PropType\"/>\n <xsd:element name=\"FormatString\"
|
99
|
+
type=\"PropType\"/>\n <xsd:element name=\"NonEmptyBehavior\"
|
100
|
+
type=\"PropType\"/>\n <xsd:element name=\"SolveOrder\"
|
101
|
+
type=\"PropType\"/>\n <xsd:element name=\"Updateable\"
|
102
|
+
type=\"PropType\"/>\n <xsd:element name=\"Visible\" type=\"PropType\"/>\n
|
103
|
+
\ <xsd:element name=\"Expression\" type=\"PropType\"/>\n
|
104
|
+
\ </xsd:choice>\n </xsd:sequence>\n <xsd:sequence
|
105
|
+
maxOccurs=\"unbounded\" minOccurs=\"0\">\n <xsd:any processContents=\"lax\"
|
106
|
+
maxOccurs=\"unbounded\"/>\n </xsd:sequence>\n </xsd:sequence>\n
|
107
|
+
\ </xsd:complexType>\n </xsd:element>\n </xsd:sequence>\n
|
108
|
+
\ </xsd:complexType>\n <xsd:complexType name=\"Axes\">\n <xsd:sequence
|
109
|
+
maxOccurs=\"unbounded\">\n <xsd:element name=\"Axis\">\n <xsd:complexType>\n
|
110
|
+
\ <xsd:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n <xsd:element
|
111
|
+
name=\"CrossProduct\" type=\"CrossProductType\"/>\n <xsd:element
|
112
|
+
name=\"Tuples\" type=\"TuplesType\"/>\n <xsd:element name=\"Members\"
|
113
|
+
type=\"MembersType\"/>\n </xsd:choice>\n <xsd:attribute
|
114
|
+
name=\"name\" type=\"xsd:string\"/>\n </xsd:complexType>\n </xsd:element>\n
|
115
|
+
\ </xsd:sequence>\n </xsd:complexType>\n <xsd:complexType
|
116
|
+
name=\"CellData\">\n <xsd:sequence>\n <xsd:element name=\"Cell\"
|
117
|
+
minOccurs=\"0\" maxOccurs=\"unbounded\">\n <xsd:complexType>\n
|
118
|
+
\ <xsd:sequence maxOccurs=\"unbounded\">\n <xsd:choice>\n
|
119
|
+
\ <xsd:element name=\"Value\"/>\n <xsd:element
|
120
|
+
name=\"FmtValue\" type=\"xsd:string\"/>\n <xsd:element name=\"BackColor\"
|
121
|
+
type=\"xsd:unsignedInt\"/>\n <xsd:element name=\"ForeColor\"
|
122
|
+
type=\"xsd:unsignedInt\"/>\n <xsd:element name=\"FontName\"
|
123
|
+
type=\"xsd:string\"/>\n <xsd:element name=\"FontSize\" type=\"xsd:unsignedShort\"/>\n
|
124
|
+
\ <xsd:element name=\"FontFlags\" type=\"xsd:unsignedInt\"/>\n
|
125
|
+
\ <xsd:element name=\"FormatString\" type=\"xsd:string\"/>\n
|
126
|
+
\ <xsd:element name=\"NonEmptyBehavior\" type=\"xsd:unsignedShort\"/>\n
|
127
|
+
\ <xsd:element name=\"SolveOrder\" type=\"xsd:unsignedInt\"/>\n
|
128
|
+
\ <xsd:element name=\"Updateable\" type=\"xsd:unsignedInt\"/>\n
|
129
|
+
\ <xsd:element name=\"Visible\" type=\"xsd:unsignedInt\"/>\n
|
130
|
+
\ <xsd:element name=\"Expression\" type=\"xsd:string\"/>\n
|
131
|
+
\ </xsd:choice>\n </xsd:sequence>\n <xsd:attribute
|
132
|
+
name=\"CellOrdinal\" type=\"xsd:unsignedInt\" use=\"required\"/>\n </xsd:complexType>\n
|
133
|
+
\ </xsd:element>\n </xsd:sequence>\n </xsd:complexType>\n
|
134
|
+
\ <xsd:element name=\"root\">\n <xsd:complexType>\n <xsd:sequence
|
135
|
+
maxOccurs=\"unbounded\">\n <xsd:element name=\"OlapInfo\" type=\"OlapInfo\"/>\n
|
136
|
+
\ <xsd:element name=\"Axes\" type=\"Axes\"/>\n <xsd:element
|
137
|
+
name=\"CellData\" type=\"CellData\"/>\n </xsd:sequence>\n </xsd:complexType>\n
|
138
|
+
\ </xsd:element>\n </xsd:schema>\n <OlapInfo>\n <CubeInfo>\n
|
139
|
+
\ <Cube>\n <CubeName>Kvarovi</CubeName>\n </Cube>\n
|
140
|
+
\ </CubeInfo>\n <AxesInfo>\n <AxisInfo name=\"Axis0\">\n
|
141
|
+
\ <HierarchyInfo name=\"Measures\">\n <UName name=\"[Measures].[MEMBER_UNIQUE_NAME]\"/>\n
|
142
|
+
\ <Caption name=\"[Measures].[MEMBER_CAPTION]\"/>\n <LName
|
143
|
+
name=\"[Measures].[LEVEL_UNIQUE_NAME]\"/>\n <LNum name=\"[Measures].[LEVEL_NUMBER]\"/>\n
|
144
|
+
\ <DisplayInfo name=\"[Measures].[DISPLAY_INFO]\"/>\n </HierarchyInfo>\n
|
145
|
+
\ </AxisInfo>\n <AxisInfo name=\"Axis1\">\n <HierarchyInfo
|
146
|
+
name=\"Gradska cetvrt.Gradska cetvrt\">\n <UName name=\"[Gradska
|
147
|
+
cetvrt].[MEMBER_UNIQUE_NAME]\"/>\n <Caption name=\"[Gradska cetvrt].[MEMBER_CAPTION]\"/>\n
|
148
|
+
\ <LName name=\"[Gradska cetvrt].[LEVEL_UNIQUE_NAME]\"/>\n <LNum
|
149
|
+
name=\"[Gradska cetvrt].[LEVEL_NUMBER]\"/>\n <DisplayInfo name=\"[Gradska
|
150
|
+
cetvrt].[DISPLAY_INFO]\"/>\n </HierarchyInfo>\n </AxisInfo>\n
|
151
|
+
\ <AxisInfo name=\"SlicerAxis\"/>\n </AxesInfo>\n <CellInfo>\n
|
152
|
+
\ <Value name=\"VALUE\"/>\n <FmtValue name=\"FORMATTED_VALUE\"/>\n
|
153
|
+
\ <FormatString name=\"FORMAT_STRING\"/>\n </CellInfo>\n </OlapInfo>\n
|
154
|
+
\ <Axes>\n <Axis name=\"Axis0\">\n <Tuples>\n <Tuple>\n
|
155
|
+
\ <Member Hierarchy=\"Measures\">\n <UName>[Measures].[Broj
|
156
|
+
intervencija]</UName>\n <Caption>Broj intervencija</Caption>\n
|
157
|
+
\ <LName>[Measures].[MeasuresLevel]</LName>\n <LNum>0</LNum>\n
|
158
|
+
\ <DisplayInfo>0</DisplayInfo>\n </Member>\n </Tuple>\n
|
159
|
+
\ </Tuples>\n </Axis>\n <Axis name=\"Axis1\">\n <Tuples>\n
|
160
|
+
\ <Tuple>\n <Member Hierarchy=\"Gradska cetvrt.Gradska
|
161
|
+
cetvrt\">\n <UName>[Gradska cetvrt].[DONJI GRAD]</UName>\n <Caption>DONJI
|
162
|
+
GRAD</Caption>\n <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n
|
163
|
+
\ <LNum>1</LNum>\n <DisplayInfo>0</DisplayInfo>\n
|
164
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
165
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
166
|
+
cetvrt].[GORNJI GRAD – MEDVEŠČAK]</UName>\n <Caption>GORNJI GRAD
|
167
|
+
– MEDVEŠČAK</Caption>\n <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n
|
168
|
+
\ <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
169
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
170
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
171
|
+
cetvrt].[TRNJE]</UName>\n <Caption>TRNJE</Caption>\n <LName>[Gradska
|
172
|
+
cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
173
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
174
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
175
|
+
cetvrt].[MAKSIMIR]</UName>\n <Caption>MAKSIMIR</Caption>\n <LName>[Gradska
|
176
|
+
cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
177
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
178
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
179
|
+
cetvrt].[PEŠČENICA - ŽITNJAK]</UName>\n <Caption>PEŠČENICA -
|
180
|
+
ŽITNJAK</Caption>\n <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n
|
181
|
+
\ <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
182
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
183
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
184
|
+
cetvrt].[NOVI ZAGREB – ISTOK]</UName>\n <Caption>NOVI ZAGREB
|
185
|
+
– ISTOK</Caption>\n <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n
|
186
|
+
\ <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
187
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
188
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
189
|
+
cetvrt].[NOVI ZAGREB – ZAPAD]</UName>\n <Caption>NOVI ZAGREB
|
190
|
+
– ZAPAD</Caption>\n <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n
|
191
|
+
\ <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
192
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
193
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
194
|
+
cetvrt].[TREŠNJEVKA – SJEVER]</UName>\n <Caption>TREŠNJEVKA –
|
195
|
+
SJEVER</Caption>\n <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n
|
196
|
+
\ <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
197
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
198
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
199
|
+
cetvrt].[TREŠNJEVKA – JUG]</UName>\n <Caption>TREŠNJEVKA – JUG</Caption>\n
|
200
|
+
\ <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n
|
201
|
+
\ <DisplayInfo>131072</DisplayInfo>\n </Member>\n
|
202
|
+
\ </Tuple>\n <Tuple>\n <Member Hierarchy=\"Gradska
|
203
|
+
cetvrt.Gradska cetvrt\">\n <UName>[Gradska cetvrt].[ČRNOMEREC]</UName>\n
|
204
|
+
\ <Caption>ČRNOMEREC</Caption>\n <LName>[Gradska
|
205
|
+
cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
206
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
207
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
208
|
+
cetvrt].[GORNJA DUBRAVA]</UName>\n <Caption>GORNJA DUBRAVA</Caption>\n
|
209
|
+
\ <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n
|
210
|
+
\ <DisplayInfo>131072</DisplayInfo>\n </Member>\n
|
211
|
+
\ </Tuple>\n <Tuple>\n <Member Hierarchy=\"Gradska
|
212
|
+
cetvrt.Gradska cetvrt\">\n <UName>[Gradska cetvrt].[DONJA DUBRAVA]</UName>\n
|
213
|
+
\ <Caption>DONJA DUBRAVA</Caption>\n <LName>[Gradska
|
214
|
+
cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
215
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
216
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
217
|
+
cetvrt].[STENJEVEC]</UName>\n <Caption>STENJEVEC</Caption>\n
|
218
|
+
\ <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n
|
219
|
+
\ <DisplayInfo>131072</DisplayInfo>\n </Member>\n
|
220
|
+
\ </Tuple>\n <Tuple>\n <Member Hierarchy=\"Gradska
|
221
|
+
cetvrt.Gradska cetvrt\">\n <UName>[Gradska cetvrt].[PODSUSED
|
222
|
+
– VRAPČE]</UName>\n <Caption>PODSUSED – VRAPČE</Caption>\n <LName>[Gradska
|
223
|
+
cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
224
|
+
\ </Member>\n </Tuple>\n <Tuple>\n <Member
|
225
|
+
Hierarchy=\"Gradska cetvrt.Gradska cetvrt\">\n <UName>[Gradska
|
226
|
+
cetvrt].[PODSLJEME ]</UName>\n <Caption>PODSLJEME </Caption>\n
|
227
|
+
\ <LName>[Gradska cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n
|
228
|
+
\ <DisplayInfo>131072</DisplayInfo>\n </Member>\n
|
229
|
+
\ </Tuple>\n <Tuple>\n <Member Hierarchy=\"Gradska
|
230
|
+
cetvrt.Gradska cetvrt\">\n <UName>[Gradska cetvrt].[SESVETE]</UName>\n
|
231
|
+
\ <Caption>SESVETE</Caption>\n <LName>[Gradska
|
232
|
+
cetvrt].[Gradska cetvrt]</LName>\n <LNum>1</LNum>\n <DisplayInfo>131072</DisplayInfo>\n
|
233
|
+
\ </Member>\n </Tuple>\n </Tuples>\n </Axis>\n
|
234
|
+
\ <Axis name=\"SlicerAxis\">\n <Tuples>\n <Tuple/>\n
|
235
|
+
\ </Tuples>\n </Axis>\n </Axes>\n <CellData>\n <Cell
|
236
|
+
CellOrdinal=\"0\">\n <Value xsi:type=\"xsd:int\">1422</Value>\n <FmtValue>1,422</FmtValue>\n
|
237
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"1\">\n
|
238
|
+
\ <Value xsi:type=\"xsd:int\">2259</Value>\n <FmtValue>2,259</FmtValue>\n
|
239
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"2\">\n
|
240
|
+
\ <Value xsi:type=\"xsd:int\">2148</Value>\n <FmtValue>2,148</FmtValue>\n
|
241
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"3\">\n
|
242
|
+
\ <Value xsi:type=\"xsd:int\">2733</Value>\n <FmtValue>2,733</FmtValue>\n
|
243
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"4\">\n
|
244
|
+
\ <Value xsi:type=\"xsd:int\">2004</Value>\n <FmtValue>2,004</FmtValue>\n
|
245
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"5\">\n
|
246
|
+
\ <Value xsi:type=\"xsd:int\">2607</Value>\n <FmtValue>2,607</FmtValue>\n
|
247
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"6\">\n
|
248
|
+
\ <Value xsi:type=\"xsd:int\">2829</Value>\n <FmtValue>2,829</FmtValue>\n
|
249
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"7\">\n
|
250
|
+
\ <Value xsi:type=\"xsd:int\">1611</Value>\n <FmtValue>1,611</FmtValue>\n
|
251
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"8\">\n
|
252
|
+
\ <Value xsi:type=\"xsd:int\">2581</Value>\n <FmtValue>2,581</FmtValue>\n
|
253
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"9\">\n
|
254
|
+
\ <Value xsi:type=\"xsd:int\">1945</Value>\n <FmtValue>1,945</FmtValue>\n
|
255
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"10\">\n
|
256
|
+
\ <Value xsi:type=\"xsd:int\">3602</Value>\n <FmtValue>3,602</FmtValue>\n
|
257
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"11\">\n
|
258
|
+
\ <Value xsi:type=\"xsd:int\">1356</Value>\n <FmtValue>1,356</FmtValue>\n
|
259
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"12\">\n
|
260
|
+
\ <Value xsi:type=\"xsd:int\">1696</Value>\n <FmtValue>1,696</FmtValue>\n
|
261
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"13\">\n
|
262
|
+
\ <Value xsi:type=\"xsd:int\">2327</Value>\n <FmtValue>2,327</FmtValue>\n
|
263
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"14\">\n
|
264
|
+
\ <Value xsi:type=\"xsd:int\">1228</Value>\n <FmtValue>1,228</FmtValue>\n
|
265
|
+
\ <FormatString/>\n </Cell>\n <Cell CellOrdinal=\"15\">\n
|
266
|
+
\ <Value xsi:type=\"xsd:int\">3186</Value>\n <FmtValue>3,186</FmtValue>\n
|
267
|
+
\ <FormatString/>\n </Cell>\n </CellData>\n </root>\n
|
268
|
+
\ </cxmla:return>\n</cxmla:ExecuteResponse>\n</SOAP-ENV:Body>\n</SOAP-ENV:Envelope>\n"
|
269
|
+
http_version: '1.1'
|
data/spec/cube_spec.rb
CHANGED
@@ -1,48 +1,68 @@
|
|
1
|
+
#encoding: utf-8
|
1
2
|
require 'cube'
|
2
3
|
require 'webmock'
|
3
4
|
require 'vcr'
|
5
|
+
require 'guerrilla_patch'
|
4
6
|
|
5
7
|
VCR.config do |c|
|
6
8
|
c.cassette_library_dir = 'spec/cassettes'
|
7
9
|
c.stub_with :webmock
|
8
10
|
end
|
9
11
|
|
10
|
-
|
12
|
+
XMLA.configure do |c|
|
11
13
|
c.endpoint = "http://localhost:8282/icCube/xmla"
|
12
14
|
c.catalog = "GOSJAR"
|
13
15
|
end
|
14
16
|
|
15
|
-
module Xmla
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
18
|
+
describe XMLA::Cube do
|
19
|
+
it 'supports multiple items on x axis' do
|
20
|
+
VCR.use_cassette('kvatovi_u_koloni') do
|
21
|
+
result = XMLA::Cube.execute("select [Lokacija].[Kvart].children on COLUMNS, [Measures].[Broj] on ROWS from [GOSJAR]")
|
22
|
+
result.size.should == 2
|
23
|
+
result[0].split('|').size.should == 18
|
24
|
+
result[1].should == "Broj|1422|2259|2148|2733|2004|2607|2829|1611|2581|1945|3602|1356|1696|2327|1228|3186|"
|
25
|
+
end
|
26
|
+
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
end
|
28
|
+
it 'supports multiple items on y axis' do
|
29
|
+
VCR.use_cassette('kvartovi_u_recima') do
|
30
|
+
result = XMLA::Cube.execute("select [Measures].[Broj] on COLUMNS, non empty topcount( [Lokacija].[Kvart].children, 100, [Measures].[Broj]) on ROWS from [GOSJAR]")
|
31
|
+
result.size.should == 17
|
32
|
+
result[0].should == '|Broj'
|
33
|
+
result[6].should == 'TRESNJEVKA - JUG|2607'
|
34
|
+
result[16].should == 'PODSLJEME|1228'
|
35
35
|
end
|
36
|
+
end
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
end
|
38
|
+
it 'support multiple items on y axis and multiple items on x axis' do
|
39
|
+
VCR.use_cassette('razlog_prijave_i_kvart') do
|
40
|
+
result = XMLA::Cube.execute("select [Measures].[Broj] on COLUMNS, non empty topcount ( [Razlog prijave].[Razlog].children * [Lokacija].[Kvart].children , 20, [Measures].[Broj] ) on ROWS from [GOSJAR]")
|
41
|
+
result.size.should == 21
|
42
|
+
result[0].should == "||Broj"
|
43
|
+
result[2].should == "|GORNJA DUBRAVA|1383"
|
44
|
+
result[20].should == "Redovna izmjena|GORNJA DUBRAVA|575"
|
45
45
|
end
|
46
|
+
end
|
46
47
|
|
48
|
+
it 'check if request is correct - to fix that bug with class varables not beign visible inside the block' do
|
49
|
+
XMLA::Cube.send(:request_body, "SELECT", "GOSJAR").should ==
|
50
|
+
"<Command> <Statement> <![CDATA[ SELECT ]]> </Statement> </Command> <Properties> <PropertyList> <Catalog>GOSJAR</Catalog>
|
51
|
+
<Format>Multidimensional</Format> <AxisFormat>TupleFormat</AxisFormat> </PropertyList> </Properties>"
|
47
52
|
end
|
53
|
+
|
54
|
+
it 'should connect to mondrian' do
|
55
|
+
XMLA.configure do |c|
|
56
|
+
c.endpoint = "http://localhost:8383/mondrian/xmla"
|
57
|
+
c.catalog = "GOSJAR"
|
58
|
+
end
|
59
|
+
|
60
|
+
VCR.use_cassette('mondrian_broj_intervencija') do
|
61
|
+
result = XMLA::Cube.execute("SELECT NON EMPTY {Hierarchize({[Measures].[Broj intervencija]})} ON COLUMNS, NON EMPTY {Hierarchize({[Gradska cetvrt].[Gradska cetvrt].Members})} ON ROWS FROM [Kvarovi]")
|
62
|
+
result.size.should == 17
|
63
|
+
result[0].should == "|Broj intervencija"
|
64
|
+
result[2].should == "GORNJI GRAD – MEDVEŠČAK|2259"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
48
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02-
|
12
|
+
date: 2012-02-12 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: savon
|
16
|
-
requirement: &
|
16
|
+
requirement: &70118415011960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70118415011960
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: webmock
|
27
|
-
requirement: &
|
27
|
+
requirement: &70118415011460 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,21 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70118415011460
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: guerrilla_patch
|
38
|
+
requirement: &70118415010940 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70118415010940
|
36
47
|
- !ruby/object:Gem::Dependency
|
37
48
|
name: vcr
|
38
|
-
requirement: &
|
49
|
+
requirement: &70118415010460 !ruby/object:Gem::Requirement
|
39
50
|
none: false
|
40
51
|
requirements:
|
41
52
|
- - ! '>='
|
@@ -43,10 +54,10 @@ dependencies:
|
|
43
54
|
version: '0'
|
44
55
|
type: :development
|
45
56
|
prerelease: false
|
46
|
-
version_requirements: *
|
57
|
+
version_requirements: *70118415010460
|
47
58
|
- !ruby/object:Gem::Dependency
|
48
59
|
name: rspec
|
49
|
-
requirement: &
|
60
|
+
requirement: &70118415009940 !ruby/object:Gem::Requirement
|
50
61
|
none: false
|
51
62
|
requirements:
|
52
63
|
- - ~>
|
@@ -54,10 +65,10 @@ dependencies:
|
|
54
65
|
version: 2.3.0
|
55
66
|
type: :development
|
56
67
|
prerelease: false
|
57
|
-
version_requirements: *
|
68
|
+
version_requirements: *70118415009940
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: bundler
|
60
|
-
requirement: &
|
71
|
+
requirement: &70118415009440 !ruby/object:Gem::Requirement
|
61
72
|
none: false
|
62
73
|
requirements:
|
63
74
|
- - ~>
|
@@ -65,10 +76,10 @@ dependencies:
|
|
65
76
|
version: 1.0.0
|
66
77
|
type: :development
|
67
78
|
prerelease: false
|
68
|
-
version_requirements: *
|
79
|
+
version_requirements: *70118415009440
|
69
80
|
- !ruby/object:Gem::Dependency
|
70
81
|
name: jeweler
|
71
|
-
requirement: &
|
82
|
+
requirement: &70118415008940 !ruby/object:Gem::Requirement
|
72
83
|
none: false
|
73
84
|
requirements:
|
74
85
|
- - ~>
|
@@ -76,7 +87,7 @@ dependencies:
|
|
76
87
|
version: 1.6.4
|
77
88
|
type: :development
|
78
89
|
prerelease: false
|
79
|
-
version_requirements: *
|
90
|
+
version_requirements: *70118415008940
|
80
91
|
description: Eases the pain I had to go through to get to the data of Xmla based OLAP
|
81
92
|
provider
|
82
93
|
email: kresimir.bojcic@gmail.com
|
@@ -99,8 +110,10 @@ files:
|
|
99
110
|
- lib/cube/cube.rb
|
100
111
|
- lib/cube/xmla.rb
|
101
112
|
- lib/wsdl/xmla.xml
|
113
|
+
- spec/cassettes/.yml
|
102
114
|
- spec/cassettes/kvartovi_u_recima.yml
|
103
115
|
- spec/cassettes/kvatovi_u_koloni.yml
|
116
|
+
- spec/cassettes/mondrian_broj_intervencija.yml
|
104
117
|
- spec/cassettes/razlog_prijave_i_kvart.yml
|
105
118
|
- spec/cube_spec.rb
|
106
119
|
- spec/spec_helper.rb
|
@@ -119,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
132
|
version: '0'
|
120
133
|
segments:
|
121
134
|
- 0
|
122
|
-
hash:
|
135
|
+
hash: -309596402643366136
|
123
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
137
|
none: false
|
125
138
|
requirements:
|