Permalink
Browse files

Merge remote-tracking branch 'rsim/master'

  • Loading branch information...
2 parents e60b708 + c90b048 commit 74d564bc1b315f9d2f0456c7356b3522c0292ccb @eeng committed Dec 11, 2012
View
@@ -1,3 +1,21 @@
+### 0.4.0 / 2012-12-03
+
+* New features
+ * upgraded to latest Mondrian 3.5 version (build from 2012-11-29)
+ as well as corresponding olap4j 1.0.1 version
+ * support for JRuby 1.7 and Java 7 VM
+ * user defined functions and formatters in JavaScript, CoffeeScript and Ruby
+ * shared user defined functions in Ruby
+ * all exceptions are wrapped in Mondrian::OLAP::Error exception with root_cause_message method
+ * drill through from result cell to source measure and dimension table rows
+ * support for Mondrian schema roles to limit cube data access
+* Improvements
+ * get description of cube, dimension, hierarchy and level from schema definition
+ * visible? method for measures and calculated members
+ * nonempty_crossjoin query builder method
+ * schema definition with nested table joins
+ * added approx_row_count schema level attribute
+
### 0.3.0 / 2011-11-12
* New features
View
@@ -12,9 +12,10 @@ group :development do
gem 'jdbc-postgres'
gem 'jdbc-luciddb'
gem 'jdbc-jtds'
- gem 'activerecord', '= 3.0.10'
- gem 'activerecord-jdbc-adapter', '= 1.1.1'
+ gem 'activerecord', '= 3.2.8'
+ gem 'activerecord-jdbc-adapter', '= 1.2.2'
gem 'activerecord-oracle_enhanced-adapter', :require => false
gem 'coffee-script', '~> 2.2.0'
gem 'therubyrhino', '~> 1.73.1'
+ gem 'pry', :require => false
end
View
@@ -1,6 +1,6 @@
(The MIT License)
-Copyright (c) 2010-2011 Raimonds Simanovskis
+Copyright (c) 2010-2012 Raimonds Simanovskis
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
265 README.md

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -20,12 +20,12 @@ Create tables with test data using
rake db:create_data
-or specify which database driver to use
+or specify which database driver to use
rake db:create_data MONDRIAN_DRIVER=mysql
rake db:create_data MONDRIAN_DRIVER=postgresql
rake db:create_data MONDRIAN_DRIVER=oracle
- rake db:create_data MONDRIAN_DRIVER=mssql
+ rake db:create_data MONDRIAN_DRIVER=mssql
rake db:create_data MONDRIAN_DRIVER=sqlserver
In case of LucidDB data are not generated and inserted directly into database but are imported from MySQL mondrian_test database (because inserting individual records into LucidDB is very inefficient). Therefore at first generate test data with mysql (using default database settings) and then run data creation task for LucidDB.
@@ -63,4 +63,4 @@ You can also run all tests on all databases with
== JRuby versions
-It is recommended to use RVM (http://rvm.beginrescueend.com) to run tests with different JRuby implementations. mondrian-olap is being tested with latest versions of JRuby 1.6 on Java 6.
+It is recommended to use RVM (http://rvm.beginrescueend.com) to run tests with different JRuby implementations. mondrian-olap is being tested with latest versions of JRuby 1.6 and 1.7 on Java 6 and 7.
View
@@ -1 +1 @@
-0.3.0
+0.4.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -82,12 +82,40 @@ def flush_schema_cache
raw_cache_control.flushSchemaCache
end
+ def available_role_names
+ @raw_connection.getAvailableRoleNames.to_a
+ end
+
+ def role_name
+ @raw_connection.getRoleName
+ end
+
+ def role_names
+ @raw_connection.getRoleNames.to_a
+ end
+
+ def role_name=(name)
+ Error.wrap_native_exception do
+ @raw_connection.setRoleName(name)
+ end
+ end
+
+ def role_names=(names)
+ Error.wrap_native_exception do
+ @raw_connection.setRoleNames(Array(names))
+ end
+ end
+
private
def connection_string
string = "jdbc:mondrian:Jdbc=#{quote_string(jdbc_uri)};JdbcDrivers=#{jdbc_driver};"
# by default use content checksum to reload schema when catalog has changed
string << "UseContentChecksum=true;" unless @params[:use_content_checksum] == false
+ if role = @params[:role] || @params[:roles]
+ roles = Array(role).map{|r| r && r.to_s.gsub(',', ',,')}.compact
+ string << "Role=#{quote_string(roles.join(','))};" unless roles.empty?
+ end
string << (@params[:catalog] ? "Catalog=#{catalog_uri}" : "CatalogContent=#{quote_string(catalog_content)}")
end
@@ -20,7 +20,7 @@ def define(name = nil, attributes = {}, &block)
name, attributes = self.class.pre_process_arguments(name, attributes)
pre_process_attributes(attributes)
@attributes[:name] = name || @attributes[:name] || 'default' # otherwise connection with empty name fails
- instance_eval &block if block
+ instance_eval(&block) if block
self
end
@@ -50,7 +50,7 @@ def pre_process_attributes(attributes)
public
attributes :name, :description
- elements :cube, :user_defined_function
+ elements :cube, :role, :user_defined_function
class Cube < SchemaElement
attributes :name, :description,
@@ -303,6 +303,81 @@ class AggExclude < SchemaElement
data_dictionary_names :name, :pattern
end
+ class Role < SchemaElement
+ attributes :name
+ elements :schema_grant, :union
+ end
+
+ class SchemaGrant < SchemaElement
+ # access may be "all", "all_dimensions", "custom" or "none".
+ # If access is "all_dimensions", the role has access to all dimensions but still needs explicit access to cubes.
+ # If access is "custom", no access will be inherited by cubes for which no explicit rule is set.
+ # If access is "all_dimensions", an implicut access is given to all dimensions of the schema's cubes,
+ # provided the cube's access attribute is either "custom" or "all"
+ attributes :access
+ elements :cube_grant
+ end
+
+ class CubeGrant < SchemaElement
+ # access may be "all", "custom", or "none".
+ # If access is "custom", no access will be inherited by the dimensions of this cube,
+ # unless the parent SchemaGrant is set to "all_dimensions"
+ attributes :access,
+ # The unique name of the cube
+ :cube
+ elements :dimension_grant, :hierarchy_grant
+ end
+
+ class DimensionGrant < SchemaElement
+ # access may be "all", "custom" or "none".
+ # Note that a role is implicitly given access to a dimension when it is given "all" acess to a cube.
+ # If access is "custom", no access will be inherited by the hierarchies of this dimension.
+ # If the parent schema access is "all_dimensions", this timension will inherit access "all".
+ # See also the "all_dimensions" option of the "SchemaGrant" element.
+ attributes :access,
+ # The unique name of the dimension
+ :dimension
+ end
+
+ class HierarchyGrant < SchemaElement
+ # access may be "all", "custom" or "none".
+ # If access is "custom", you may also specify the attributes :top_level, :bottom_level, and the member grants.
+ # If access is "custom", the child levels of this hierarchy will not inherit access rights from this hierarchy,
+ # should there be no explicit rules defined for the said child level.
+ attributes :access,
+ # The unique name of the hierarchy
+ :hierarchy,
+ # Unique name of the highest level of the hierarchy from which this role is allowed to see members.
+ # May only be specified if the HierarchyGrant.access is "custom".
+ # If not specified, role can see members up to the top level.
+ :top_level,
+ # Unique name of the lowest level of the hierarchy from which this role is allowed to see members.
+ # May only be specified if the HierarchyGrant.access is "custom".
+ # If not specified, role can see members down to the leaf level.
+ :bottom_level,
+ # Policy which determines how cell values are calculated if not all of the children of the current cell
+ # are visible to the current role.
+ # Allowable values are "full" (the default), "partial", and "hidden".
+ :rollup_policy
+ elements :member_grant
+ end
+
+ class MemberGrant < SchemaElement
+ # The children of this member inherit that access.
+ # You can implicitly see a member if you can see any of its children.
+ attributes :access,
+ # The unique name of the member
+ :member
+ end
+
+ class Union < SchemaElement
+ elements :role_usage
+ end
+
+ class RoleUsage < SchemaElement
+ attributes :role_name
+ end
+
end
end
end
@@ -22,7 +22,7 @@ def initialize(name = nil, attributes = {}, &block)
instance_variable_set("@#{pluralize(element)}", [])
end
@xml_fragments = []
- instance_eval &block if block
+ instance_eval(&block) if block
end
def self.attributes(*names)
@@ -221,7 +221,7 @@ def ruby(*options, &block)
self.class.const_set(udf_class_name, udf_class) if udf_class_name
end
udf_class.function_name = name
- udf_class.class_eval &block
+ udf_class.class_eval(&block)
udf_java_class = udf_class.become_java!(false)
class_name udf_java_class.getName
View
@@ -4,16 +4,15 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{mondrian-olap}
- s.version = "0.3.0"
- s.platform = %q{java}
+ s.name = "mondrian-olap"
+ s.version = "0.4.0"
+ s.platform = "java"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = [%q{Raimonds Simanovskis}]
- s.date = %q{2012-01-12}
- s.description = %q{JRuby gem for performing multidimensional queries of relational database data using Mondrian OLAP Java library
-}
- s.email = %q{raimonds.simanovskis@gmail.com}
+ s.authors = ["Raimonds Simanovskis"]
+ s.date = "2012-12-03"
+ s.description = "JRuby gem for performing multidimensional queries of relational database data using Mondrian OLAP Java library\n"
+ s.email = "raimonds.simanovskis@gmail.com"
s.extra_rdoc_files = [
"README.md"
]
@@ -45,12 +44,14 @@ Gem::Specification.new do |s|
"lib/mondrian/olap.rb",
"lib/mondrian/olap/connection.rb",
"lib/mondrian/olap/cube.rb",
+ "lib/mondrian/olap/error.rb",
"lib/mondrian/olap/query.rb",
"lib/mondrian/olap/result.rb",
"lib/mondrian/olap/schema.rb",
"lib/mondrian/olap/schema_element.rb",
"lib/mondrian/olap/schema_udf.rb",
"mondrian-olap.gemspec",
+ "spec/connection_role_spec.rb",
"spec/connection_spec.rb",
"spec/cube_spec.rb",
"spec/fixtures/MondrianTest.xml",
@@ -62,73 +63,66 @@ Gem::Specification.new do |s|
"spec/spec_helper.rb",
"spec/support/matchers/be_like.rb"
]
- s.homepage = %q{http://github.com/rsim/mondrian-olap}
- s.require_paths = [%q{lib}]
- s.rubygems_version = %q{1.8.9}
- s.summary = %q{JRuby API for Mondrian OLAP Java library}
- s.test_files = [
- "spec/connection_spec.rb",
- "spec/cube_spec.rb",
- "spec/mondrian_spec.rb",
- "spec/query_spec.rb",
- "spec/rake_tasks.rb",
- "spec/schema_definition_spec.rb",
- "spec/spec_helper.rb",
- "spec/support/matchers/be_like.rb"
- ]
+ s.homepage = "http://github.com/rsim/mondrian-olap"
+ s.require_paths = ["lib"]
+ s.rubygems_version = "1.8.24"
+ s.summary = "JRuby API for Mondrian OLAP Java library"
if s.respond_to? :specification_version then
s.specification_version = 3
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<nokogiri>, ["~> 1.5.0"])
s.add_development_dependency(%q<jruby-openssl>, [">= 0"])
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.3"])
s.add_development_dependency(%q<rdoc>, [">= 0"])
- s.add_development_dependency(%q<rspec>, ["~> 2.5"])
+ s.add_development_dependency(%q<rspec>, ["~> 2.10"])
s.add_development_dependency(%q<autotest>, [">= 0"])
s.add_development_dependency(%q<jdbc-mysql>, [">= 0"])
s.add_development_dependency(%q<jdbc-postgres>, [">= 0"])
s.add_development_dependency(%q<jdbc-luciddb>, [">= 0"])
s.add_development_dependency(%q<jdbc-jtds>, [">= 0"])
- s.add_development_dependency(%q<activerecord>, ["= 3.0.10"])
- s.add_development_dependency(%q<activerecord-jdbc-adapter>, ["= 1.1.1"])
+ s.add_development_dependency(%q<activerecord>, ["= 3.2.8"])
+ s.add_development_dependency(%q<activerecord-jdbc-adapter>, ["= 1.2.2"])
s.add_development_dependency(%q<activerecord-oracle_enhanced-adapter>, [">= 0"])
- s.add_development_dependency(%q<coffee-script>, [">= 0"])
- s.add_development_dependency(%q<therubyrhino>, [">= 0"])
+ s.add_development_dependency(%q<coffee-script>, ["~> 2.2.0"])
+ s.add_development_dependency(%q<therubyrhino>, ["~> 1.73.1"])
+ s.add_development_dependency(%q<pry>, [">= 0"])
else
s.add_dependency(%q<nokogiri>, ["~> 1.5.0"])
s.add_dependency(%q<jruby-openssl>, [">= 0"])
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
s.add_dependency(%q<rdoc>, [">= 0"])
- s.add_dependency(%q<rspec>, ["~> 2.5"])
+ s.add_dependency(%q<rspec>, ["~> 2.10"])
s.add_dependency(%q<autotest>, [">= 0"])
s.add_dependency(%q<jdbc-mysql>, [">= 0"])
s.add_dependency(%q<jdbc-postgres>, [">= 0"])
s.add_dependency(%q<jdbc-luciddb>, [">= 0"])
s.add_dependency(%q<jdbc-jtds>, [">= 0"])
- s.add_dependency(%q<activerecord>, ["= 3.0.10"])
- s.add_dependency(%q<activerecord-jdbc-adapter>, ["= 1.1.1"])
+ s.add_dependency(%q<activerecord>, ["= 3.2.8"])
+ s.add_dependency(%q<activerecord-jdbc-adapter>, ["= 1.2.2"])
s.add_dependency(%q<activerecord-oracle_enhanced-adapter>, [">= 0"])
- s.add_dependency(%q<coffee-script>, [">= 0"])
- s.add_dependency(%q<therubyrhino>, [">= 0"])
+ s.add_dependency(%q<coffee-script>, ["~> 2.2.0"])
+ s.add_dependency(%q<therubyrhino>, ["~> 1.73.1"])
+ s.add_dependency(%q<pry>, [">= 0"])
end
else
s.add_dependency(%q<nokogiri>, ["~> 1.5.0"])
s.add_dependency(%q<jruby-openssl>, [">= 0"])
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
+ s.add_dependency(%q<jeweler>, ["~> 1.8.3"])
s.add_dependency(%q<rdoc>, [">= 0"])
- s.add_dependency(%q<rspec>, ["~> 2.5"])
+ s.add_dependency(%q<rspec>, ["~> 2.10"])
s.add_dependency(%q<autotest>, [">= 0"])
s.add_dependency(%q<jdbc-mysql>, [">= 0"])
s.add_dependency(%q<jdbc-postgres>, [">= 0"])
s.add_dependency(%q<jdbc-luciddb>, [">= 0"])
s.add_dependency(%q<jdbc-jtds>, [">= 0"])
- s.add_dependency(%q<activerecord>, ["= 3.0.10"])
- s.add_dependency(%q<activerecord-jdbc-adapter>, ["= 1.1.1"])
+ s.add_dependency(%q<activerecord>, ["= 3.2.8"])
+ s.add_dependency(%q<activerecord-jdbc-adapter>, ["= 1.2.2"])
s.add_dependency(%q<activerecord-oracle_enhanced-adapter>, [">= 0"])
- s.add_dependency(%q<coffee-script>, [">= 0"])
- s.add_dependency(%q<therubyrhino>, [">= 0"])
+ s.add_dependency(%q<coffee-script>, ["~> 2.2.0"])
+ s.add_dependency(%q<therubyrhino>, ["~> 1.73.1"])
+ s.add_dependency(%q<pry>, [">= 0"])
end
end
Oops, something went wrong.

0 comments on commit 74d564b

Please sign in to comment.