gooddata 0.6.20 → 0.6.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -1
- data/DEPENDENCIES.md +816 -0
- data/LICENSE +1 -1
- data/LICENSE.rb +5 -0
- data/Rakefile +74 -22
- data/dependency_decisions.yml +102 -0
- data/gooddata.gemspec +39 -38
- data/lib/gooddata.rb +4 -0
- data/lib/gooddata/app/app.rb +4 -0
- data/lib/gooddata/bricks/base_downloader.rb +5 -1
- data/lib/gooddata/bricks/brick.rb +4 -0
- data/lib/gooddata/bricks/bricks.rb +5 -0
- data/lib/gooddata/bricks/middleware/aws_middleware.rb +5 -0
- data/lib/gooddata/bricks/middleware/base_middleware.rb +5 -0
- data/lib/gooddata/bricks/middleware/bench_middleware.rb +5 -0
- data/lib/gooddata/bricks/middleware/bulk_salesforce_middleware.rb +5 -0
- data/lib/gooddata/bricks/middleware/decode_params_middleware.rb +6 -0
- data/lib/gooddata/bricks/middleware/fs_download_middleware.rb +6 -0
- data/lib/gooddata/bricks/middleware/fs_upload_middleware.rb +6 -0
- data/lib/gooddata/bricks/middleware/gooddata_middleware.rb +6 -0
- data/lib/gooddata/bricks/middleware/logger_middleware.rb +5 -0
- data/lib/gooddata/bricks/middleware/middleware.rb +5 -0
- data/lib/gooddata/bricks/middleware/restforce_middleware.rb +4 -0
- data/lib/gooddata/bricks/middleware/stdout_middleware.rb +5 -0
- data/lib/gooddata/bricks/middleware/twitter_middleware.rb +5 -0
- data/lib/gooddata/bricks/middleware/undot_params_middleware.rb +4 -0
- data/lib/gooddata/bricks/pipeline.rb +4 -0
- data/lib/gooddata/bricks/utils.rb +4 -0
- data/lib/gooddata/cli/cli.rb +4 -0
- data/lib/gooddata/cli/commands/api_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/auth_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/console_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/domain_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/process_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/project_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/projects_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/run_ruby_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/scaffold_cmd.rb +4 -0
- data/lib/gooddata/cli/commands/user_cmd.rb +4 -0
- data/lib/gooddata/cli/hooks.rb +4 -0
- data/lib/gooddata/cli/shared.rb +4 -0
- data/lib/gooddata/cli/terminal.rb +4 -0
- data/lib/gooddata/client.rb +4 -0
- data/lib/gooddata/commands/api.rb +4 -0
- data/lib/gooddata/commands/auth.rb +4 -0
- data/lib/gooddata/commands/base.rb +4 -0
- data/lib/gooddata/commands/commands.rb +5 -0
- data/lib/gooddata/commands/datasets.rb +5 -1
- data/lib/gooddata/commands/datawarehouse.rb +4 -0
- data/lib/gooddata/commands/domain.rb +4 -0
- data/lib/gooddata/commands/process.rb +4 -0
- data/lib/gooddata/commands/project.rb +7 -9
- data/lib/gooddata/commands/projects.rb +4 -0
- data/lib/gooddata/commands/role.rb +4 -0
- data/lib/gooddata/commands/runners.rb +4 -0
- data/lib/gooddata/commands/scaffold.rb +4 -0
- data/lib/gooddata/commands/user.rb +4 -0
- data/lib/gooddata/connection.rb +83 -0
- data/lib/gooddata/core/core.rb +4 -0
- data/lib/gooddata/core/logging.rb +4 -0
- data/lib/gooddata/core/nil_logger.rb +4 -0
- data/lib/gooddata/core/project.rb +4 -0
- data/lib/gooddata/core/rest.rb +14 -16
- data/lib/gooddata/core/user.rb +4 -0
- data/lib/gooddata/data/data.rb +4 -0
- data/lib/gooddata/data/guesser.rb +4 -0
- data/lib/gooddata/exceptions/attr_element_not_found.rb +4 -0
- data/lib/gooddata/exceptions/command_failed.rb +4 -0
- data/lib/gooddata/exceptions/exceptions.rb +4 -0
- data/lib/gooddata/exceptions/execution_limit_exceeded.rb +4 -0
- data/lib/gooddata/exceptions/filter_maqlization.rb +16 -0
- data/lib/gooddata/exceptions/malformed_user.rb +15 -0
- data/lib/gooddata/exceptions/no_project_error.rb +4 -0
- data/lib/gooddata/exceptions/object_migration.rb +28 -0
- data/lib/gooddata/exceptions/project_not_found.rb +5 -0
- data/lib/gooddata/exceptions/uncomputable_report.rb +5 -0
- data/lib/gooddata/exceptions/user_in_different_domain.rb +4 -0
- data/lib/gooddata/exceptions/validation_error.rb +4 -0
- data/lib/gooddata/extensions/big_decimal.rb +4 -0
- data/lib/gooddata/extensions/enumerable.rb +4 -0
- data/lib/gooddata/extensions/extensions.rb +4 -0
- data/lib/gooddata/extensions/false.rb +4 -0
- data/lib/gooddata/extensions/hash.rb +4 -0
- data/lib/gooddata/extensions/nil.rb +4 -0
- data/lib/gooddata/extensions/numeric.rb +4 -0
- data/lib/gooddata/extensions/object.rb +4 -0
- data/lib/gooddata/extensions/symbol.rb +4 -0
- data/lib/gooddata/extensions/true.rb +4 -0
- data/lib/gooddata/extract.rb +4 -0
- data/lib/gooddata/goodzilla/goodzilla.rb +87 -77
- data/lib/gooddata/helpers/auth_helpers.rb +6 -2
- data/lib/gooddata/helpers/csv_helper.rb +4 -0
- data/lib/gooddata/helpers/data_helper.rb +4 -0
- data/lib/gooddata/helpers/global_helpers.rb +35 -6
- data/lib/gooddata/helpers/global_helpers_params.rb +34 -7
- data/lib/gooddata/helpers/helpers.rb +4 -0
- data/lib/gooddata/mixins/author.rb +4 -0
- data/lib/gooddata/mixins/content_getter.rb +4 -0
- data/lib/gooddata/mixins/content_property_reader.rb +4 -0
- data/lib/gooddata/mixins/content_property_writer.rb +4 -0
- data/lib/gooddata/mixins/contributor.rb +4 -0
- data/lib/gooddata/mixins/data_getter.rb +4 -0
- data/lib/gooddata/mixins/data_property_reader.rb +4 -0
- data/lib/gooddata/mixins/data_property_writer.rb +4 -0
- data/lib/gooddata/mixins/inspector.rb +4 -0
- data/lib/gooddata/mixins/is_attribute.rb +4 -0
- data/lib/gooddata/mixins/is_dimension.rb +4 -0
- data/lib/gooddata/mixins/is_fact.rb +4 -0
- data/lib/gooddata/mixins/is_label.rb +4 -0
- data/lib/gooddata/mixins/links.rb +4 -0
- data/lib/gooddata/mixins/md_finders.rb +4 -0
- data/lib/gooddata/mixins/md_id_to_uri.rb +4 -0
- data/lib/gooddata/mixins/md_json.rb +4 -0
- data/lib/gooddata/mixins/md_lock.rb +4 -0
- data/lib/gooddata/mixins/md_object_id.rb +5 -1
- data/lib/gooddata/mixins/md_object_indexer.rb +4 -0
- data/lib/gooddata/mixins/md_object_query.rb +4 -0
- data/lib/gooddata/mixins/md_relations.rb +4 -0
- data/lib/gooddata/mixins/meta_getter.rb +4 -0
- data/lib/gooddata/mixins/meta_property_reader.rb +4 -0
- data/lib/gooddata/mixins/meta_property_writer.rb +4 -0
- data/lib/gooddata/mixins/mixins.rb +4 -0
- data/lib/gooddata/mixins/not_attribute.rb +4 -0
- data/lib/gooddata/mixins/not_exportable.rb +4 -0
- data/lib/gooddata/mixins/not_fact.rb +4 -0
- data/lib/gooddata/mixins/not_label.rb +4 -0
- data/lib/gooddata/mixins/not_metric.rb +6 -0
- data/lib/gooddata/mixins/obj_id.rb +4 -0
- data/lib/gooddata/mixins/rest_getters.rb +4 -0
- data/lib/gooddata/mixins/rest_resource.rb +4 -0
- data/lib/gooddata/mixins/root_key_getter.rb +4 -0
- data/lib/gooddata/mixins/root_key_setter.rb +4 -0
- data/lib/gooddata/mixins/timestamps.rb +4 -0
- data/lib/gooddata/models/blueprint/anchor_field.rb +4 -0
- data/lib/gooddata/models/blueprint/attribute_field.rb +4 -0
- data/lib/gooddata/models/blueprint/blueprint.rb +4 -0
- data/lib/gooddata/models/blueprint/blueprint_field.rb +4 -0
- data/lib/gooddata/models/blueprint/dashboard_builder.rb +4 -0
- data/lib/gooddata/models/blueprint/dataset_blueprint.rb +6 -0
- data/lib/gooddata/models/blueprint/date_dimension.rb +4 -0
- data/lib/gooddata/models/blueprint/fact_field.rb +4 -0
- data/lib/gooddata/models/blueprint/label_field.rb +4 -0
- data/lib/gooddata/models/blueprint/project_blueprint.rb +6 -0
- data/lib/gooddata/models/blueprint/project_builder.rb +4 -0
- data/lib/gooddata/models/blueprint/reference_field.rb +4 -0
- data/lib/gooddata/models/blueprint/schema_blueprint.rb +4 -0
- data/lib/gooddata/models/blueprint/schema_builder.rb +4 -0
- data/lib/gooddata/models/blueprint/to_manifest.rb +17 -1
- data/lib/gooddata/models/blueprint/to_wire.rb +4 -0
- data/lib/gooddata/models/datawarehouse.rb +5 -0
- data/lib/gooddata/models/domain.rb +25 -7
- data/lib/gooddata/models/execution.rb +4 -0
- data/lib/gooddata/models/execution_detail.rb +4 -0
- data/lib/gooddata/models/from_wire.rb +4 -0
- data/lib/gooddata/models/invitation.rb +4 -0
- data/lib/gooddata/models/links.rb +4 -0
- data/lib/gooddata/models/membership.rb +4 -0
- data/lib/gooddata/models/metadata.rb +37 -10
- data/lib/gooddata/models/metadata/attribute.rb +6 -0
- data/lib/gooddata/models/metadata/dashboard.rb +54 -16
- data/lib/gooddata/models/metadata/dashboard/dashboard_item.rb +60 -0
- data/lib/gooddata/models/metadata/dashboard/filter_item.rb +15 -0
- data/lib/gooddata/models/metadata/dashboard/report_item.rb +51 -0
- data/lib/gooddata/models/metadata/dashboard_tab.rb +88 -0
- data/lib/gooddata/models/metadata/dataset.rb +4 -0
- data/lib/gooddata/models/metadata/dimension.rb +4 -0
- data/lib/gooddata/models/metadata/fact.rb +6 -0
- data/lib/gooddata/models/metadata/label.rb +15 -0
- data/lib/gooddata/models/metadata/metadata.rb +4 -0
- data/lib/gooddata/models/metadata/metric.rb +5 -4
- data/lib/gooddata/models/metadata/report.rb +62 -16
- data/lib/gooddata/models/metadata/report_definition.rb +44 -47
- data/lib/gooddata/models/metadata/variable.rb +4 -0
- data/lib/gooddata/models/model.rb +85 -36
- data/lib/gooddata/models/models.rb +4 -0
- data/lib/gooddata/models/module_constants.rb +4 -0
- data/lib/gooddata/models/process.rb +4 -0
- data/lib/gooddata/models/profile.rb +13 -0
- data/lib/gooddata/models/project.rb +173 -92
- data/lib/gooddata/models/project_creator.rb +18 -10
- data/lib/gooddata/models/project_metadata.rb +4 -0
- data/lib/gooddata/models/project_role.rb +4 -0
- data/lib/gooddata/models/report_data_result.rb +217 -125
- data/lib/gooddata/models/schedule.rb +140 -65
- data/lib/gooddata/models/tab_builder.rb +4 -0
- data/lib/gooddata/models/user_filters/mandatory_user_filter.rb +4 -0
- data/lib/gooddata/models/user_filters/user_filter.rb +4 -0
- data/lib/gooddata/models/user_filters/user_filter_builder.rb +98 -56
- data/lib/gooddata/models/user_filters/user_filters.rb +4 -0
- data/lib/gooddata/models/user_filters/variable_user_filter.rb +4 -0
- data/lib/gooddata/rest/client.rb +41 -38
- data/lib/gooddata/rest/connection.rb +91 -20
- data/lib/gooddata/rest/connections/rest_client_connection.rb +5 -1
- data/lib/gooddata/rest/object.rb +9 -1
- data/lib/gooddata/rest/object_factory.rb +5 -1
- data/lib/gooddata/rest/resource.rb +5 -1
- data/lib/gooddata/rest/rest.rb +4 -0
- data/lib/gooddata/version.rb +5 -1
- data/spec/bricks/bricks_spec.rb +4 -0
- data/spec/data/blueprints/test_project_model_spec.json +2 -2
- data/spec/data/gooddata_version_process/gooddata_version.rb +6 -0
- data/spec/data/hello_world_process/hello_world.rb +6 -0
- data/spec/data/manifests/test_project.json +5 -5
- data/spec/data/reports/left_attr_report.json +108 -0
- data/spec/data/reports/metric_only_one_line.json +83 -0
- data/spec/data/reports/report_1.json +197 -0
- data/spec/data/reports/top_attr_report.json +108 -0
- data/spec/data/ruby_params_process/ruby_params.rb +6 -0
- data/spec/data/ruby_process/process.rb +6 -0
- data/spec/environment/default.rb +5 -0
- data/spec/environment/develop.rb +10 -5
- data/spec/environment/environment.rb +4 -0
- data/spec/environment/hotfix.rb +5 -1
- data/spec/environment/production.rb +4 -0
- data/spec/environment/release.rb +4 -0
- data/spec/environment/staging.rb +30 -0
- data/spec/environment/staging_3.rb +37 -0
- data/spec/helpers/blueprint_helper.rb +4 -0
- data/spec/helpers/cli_helper.rb +4 -0
- data/spec/helpers/connection_helper.rb +24 -17
- data/spec/helpers/crypto_helper.rb +6 -0
- data/spec/helpers/csv_helper.rb +4 -0
- data/spec/helpers/process_helper.rb +5 -1
- data/spec/helpers/project_helper.rb +34 -29
- data/spec/helpers/schedule_helper.rb +4 -0
- data/spec/helpers/spec_helper.rb +4 -0
- data/spec/integration/blueprint_updates_spec.rb +28 -20
- data/spec/integration/command_datawarehouse_spec.rb +6 -0
- data/spec/integration/command_projects_spec.rb +6 -4
- data/spec/integration/create_from_template_spec.rb +6 -0
- data/spec/integration/create_project_spec.rb +6 -0
- data/spec/integration/deprecated_load_spec.rb +58 -0
- data/spec/integration/full_process_schedule_spec.rb +9 -0
- data/spec/integration/full_project_spec.rb +63 -9
- data/spec/integration/over_to_user_filters_spec.rb +7 -2
- data/spec/integration/partial_md_export_import_spec.rb +6 -0
- data/spec/integration/project_spec.rb +12 -6
- data/spec/integration/rest_spec.rb +6 -2
- data/spec/integration/schedule_spec.rb +627 -0
- data/spec/integration/user_filters_spec.rb +122 -21
- data/spec/integration/variables_spec.rb +8 -15
- data/spec/logging_in_logging_out_spec.rb +58 -0
- data/spec/spec_helper.rb +10 -5
- data/spec/unit/bricks/bricks_spec.rb +4 -0
- data/spec/unit/bricks/middleware/aws_middelware_spec.rb +4 -0
- data/spec/unit/bricks/middleware/bench_middleware_spec.rb +4 -0
- data/spec/unit/bricks/middleware/bulk_salesforce_middleware_spec.rb +4 -0
- data/spec/unit/bricks/middleware/gooddata_middleware_spec.rb +4 -0
- data/spec/unit/bricks/middleware/logger_middleware_spec.rb +4 -0
- data/spec/unit/bricks/middleware/restforce_middleware_spec.rb +4 -0
- data/spec/unit/bricks/middleware/stdout_middleware_spec.rb +4 -0
- data/spec/unit/bricks/middleware/twitter_middleware_spec.rb +4 -0
- data/spec/unit/cli/cli_spec.rb +4 -0
- data/spec/unit/cli/commands/cmd_api_spec.rb +4 -0
- data/spec/unit/cli/commands/cmd_auth_spec.rb +4 -0
- data/spec/unit/cli/commands/cmd_domain_spec.rb +4 -0
- data/spec/unit/cli/commands/cmd_process_spec.rb +4 -0
- data/spec/unit/cli/commands/cmd_project_spec.rb +4 -0
- data/spec/unit/cli/commands/cmd_role_spec.rb +4 -0
- data/spec/unit/cli/commands/cmd_run_ruby_spec.rb +4 -0
- data/spec/unit/cli/commands/cmd_scaffold_spec.rb +6 -0
- data/spec/unit/cli/commands/cmd_user_spec.rb +6 -0
- data/spec/unit/commands/command_api_spec.rb +6 -0
- data/spec/unit/commands/command_auth_spec.rb +6 -0
- data/spec/unit/commands/command_dataset_spec.rb +10 -4
- data/spec/unit/commands/command_process_spec.rb +6 -0
- data/spec/unit/commands/command_projects_spec.rb +6 -0
- data/spec/unit/commands/command_scaffold_spec.rb +6 -0
- data/spec/unit/commands/command_user_spec.rb +6 -0
- data/spec/unit/core/connection_spec.rb +6 -0
- data/spec/unit/core/logging_spec.rb +4 -0
- data/spec/unit/core/nil_logger_spec.rb +4 -0
- data/spec/unit/core/project_spec.rb +4 -0
- data/spec/unit/data/guesser_spec.rb +6 -2
- data/spec/unit/extensions/hash_spec.rb +4 -0
- data/spec/unit/godzilla/goodzilla_spec.rb +4 -0
- data/spec/unit/helpers/csv_helper_spec.rb +4 -0
- data/spec/unit/helpers/data_helper_spec.rb +4 -0
- data/spec/unit/helpers/global_helpers_spec.rb +54 -0
- data/spec/unit/helpers_spec.rb +6 -1
- data/spec/unit/models/blueprint/attributes_spec.rb +5 -0
- data/spec/unit/models/blueprint/dataset_spec.rb +5 -0
- data/spec/unit/models/blueprint/labels_spec.rb +5 -0
- data/spec/unit/models/blueprint/project_blueprint_spec.rb +5 -0
- data/spec/unit/models/blueprint/reference_spec.rb +5 -0
- data/spec/unit/models/blueprint/schema_builder_spec.rb +4 -0
- data/spec/unit/models/blueprint/to_wire_spec.rb +5 -0
- data/spec/unit/models/domain_spec.rb +9 -7
- data/spec/unit/models/execution_spec.rb +6 -0
- data/spec/unit/models/from_wire_spec.rb +4 -0
- data/spec/unit/models/invitation_spec.rb +4 -0
- data/spec/unit/models/membership_spec.rb +4 -0
- data/spec/unit/models/metadata_spec.rb +46 -0
- data/spec/unit/models/metric_spec.rb +4 -0
- data/spec/unit/models/model_spec.rb +4 -0
- data/spec/unit/models/params_spec.rb +4 -0
- data/spec/unit/models/profile_spec.rb +4 -0
- data/spec/unit/models/project_creator_spec.rb +127 -0
- data/spec/unit/models/project_role_spec.rb +4 -0
- data/spec/unit/models/project_spec.rb +4 -0
- data/spec/unit/models/report_result_data_spec.rb +193 -0
- data/spec/unit/models/schedule_spec.rb +241 -386
- data/spec/unit/models/to_manifest_spec.rb +21 -0
- data/spec/unit/models/{unit_project.rb → unit_project_spec.rb} +21 -18
- data/spec/unit/models/user_filters_spec.rb +7 -1
- data/spec/unit/models/variable_spec.rb +6 -0
- data/spec/unit/rest/polling_spec.rb +8 -5
- data/spec/unit/rest/resource_spec.rb +4 -0
- metadata +190 -129
- data/.autotest +0 -2
- data/.travis.yml +0 -22
- data/examples.rb +0 -69
- data/lib/gooddata/models/data_result.rb +0 -38
- data/lib/gooddata/models/empty_result.rb +0 -57
- data/spec/unit/models/project_creator.rb +0 -73
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative 'attribute_field'
|
|
4
8
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative 'blueprint_field'
|
|
4
8
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require 'pathname'
|
|
4
8
|
base = Pathname(__FILE__).dirname.expand_path
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative 'schema_builder'
|
|
4
8
|
require_relative 'schema_blueprint'
|
|
@@ -372,6 +376,8 @@ module GoodData
|
|
|
372
376
|
end
|
|
373
377
|
end
|
|
374
378
|
|
|
379
|
+
alias_method :suggest_measures, :suggest_metrics
|
|
380
|
+
|
|
375
381
|
def to_blueprint
|
|
376
382
|
GoodData::Model::ProjectBlueprint.new(datasets: [to_hash])
|
|
377
383
|
end
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative 'schema_blueprint'
|
|
4
8
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative 'blueprint_field'
|
|
4
8
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative 'blueprint_field'
|
|
4
8
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
module GoodData
|
|
4
8
|
module Model
|
|
@@ -561,6 +565,8 @@ module GoodData
|
|
|
561
565
|
stars.zip(metrics)
|
|
562
566
|
end
|
|
563
567
|
|
|
568
|
+
alias_method :suggest_measures, :suggest_metrics
|
|
569
|
+
|
|
564
570
|
def to_blueprint
|
|
565
571
|
self
|
|
566
572
|
end
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative 'dashboard_builder'
|
|
4
8
|
require_relative 'schema_builder'
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative 'blueprint_field'
|
|
4
8
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
module GoodData
|
|
4
8
|
module Model
|
|
@@ -34,6 +38,8 @@ module GoodData
|
|
|
34
38
|
label_to_manifest(project, dataset, c, mode)
|
|
35
39
|
when :fact
|
|
36
40
|
fact_to_manifest(project, dataset, c, mode)
|
|
41
|
+
when :date_fact
|
|
42
|
+
fact_to_manifest(project, dataset, c, mode)
|
|
37
43
|
when :reference
|
|
38
44
|
reference_to_manifest(project, dataset, c, mode)
|
|
39
45
|
when :date
|
|
@@ -97,6 +103,16 @@ module GoodData
|
|
|
97
103
|
}]
|
|
98
104
|
end
|
|
99
105
|
|
|
106
|
+
# Generates safe name for upload
|
|
107
|
+
# @param dataset_path [String] Input name
|
|
108
|
+
# @return [String] Generated upload filename
|
|
109
|
+
def self.generate_upload_filename(dataset_path)
|
|
110
|
+
sanitized_name = dataset_path.gsub(/[^0-9a-z]/i, '_')
|
|
111
|
+
# ts = DateTime.now.strftime('%Y%m%d%H%M%S%6N')
|
|
112
|
+
# "#{sanitized_name}-#{ts}.csv"
|
|
113
|
+
"#{sanitized_name}.csv"
|
|
114
|
+
end
|
|
115
|
+
|
|
100
116
|
# Converts label to manifest
|
|
101
117
|
#
|
|
102
118
|
# @param project [GoodData::Model::ProjectBlueprint] Project blueprint
|
|
@@ -130,7 +146,7 @@ module GoodData
|
|
|
130
146
|
'dataSetSLIManifest' => {
|
|
131
147
|
'parts' => columns.mapcat { |c| column_to_manifest(project, dataset, c, mode) },
|
|
132
148
|
'dataSet' => dataset[:id],
|
|
133
|
-
'file' =>
|
|
149
|
+
'file' => ToManifest.generate_upload_filename(dataset[:id]), # should be configurable
|
|
134
150
|
'csvParams' => {
|
|
135
151
|
'quoteChar' => '"',
|
|
136
152
|
'escapeChar' => '"',
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
6
|
+
|
|
2
7
|
require_relative '../rest/resource'
|
|
3
8
|
|
|
4
9
|
module GoodData
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require 'cgi'
|
|
4
8
|
|
|
@@ -83,8 +87,17 @@ module GoodData
|
|
|
83
87
|
begin
|
|
84
88
|
url = "/gdc/account/domains/#{domain_name}/users"
|
|
85
89
|
response = c.post(url, :accountSetting => data)
|
|
86
|
-
rescue RestClient::BadRequest
|
|
87
|
-
|
|
90
|
+
rescue RestClient::BadRequest => e
|
|
91
|
+
error = MultiJson.load(e.response)
|
|
92
|
+
error_type = GoodData::Helpers.get_path(error, %w(error errorClass))
|
|
93
|
+
case error_type
|
|
94
|
+
when 'com.gooddata.webapp.service.userprovisioning.LoginNameAlreadyRegisteredException'
|
|
95
|
+
raise GoodData::UserInDifferentDomainError, "User #{data[:login]} is already in different domain"
|
|
96
|
+
when 'com.gooddata.json.validator.exception.MalformedMessageException'
|
|
97
|
+
raise GoodData::MalformedUserError, "User #{data[:login]} is malformed. The message from API is #{GoodData::Helpers.interpolate_error_message(error)}"
|
|
98
|
+
else
|
|
99
|
+
raise GoodData::Helpers.interpolate_error_message(error)
|
|
100
|
+
end
|
|
88
101
|
end
|
|
89
102
|
|
|
90
103
|
url = response['uri']
|
|
@@ -191,10 +204,13 @@ module GoodData
|
|
|
191
204
|
page_limit = opts[:page_limit] || 1000
|
|
192
205
|
offset = opts[:offset] || 0
|
|
193
206
|
loop do
|
|
194
|
-
|
|
207
|
+
begin
|
|
208
|
+
tmp = client(opts).get("#{domain.uri}/users", params: { offset: offset, limit: page_limit })
|
|
209
|
+
end
|
|
210
|
+
|
|
195
211
|
tmp['accountSettings']['items'].each do |user_data|
|
|
196
212
|
user = client.create(GoodData::Profile, user_data)
|
|
197
|
-
y << user
|
|
213
|
+
y << user if user
|
|
198
214
|
end
|
|
199
215
|
break if tmp['accountSettings']['items'].count < page_limit
|
|
200
216
|
offset += page_limit
|
|
@@ -213,23 +229,25 @@ module GoodData
|
|
|
213
229
|
default_domain_name = default_domain.respond_to?(:name) ? default_domain.name : default_domain
|
|
214
230
|
domain = client.domain(default_domain_name)
|
|
215
231
|
|
|
232
|
+
# Prepare cache for domain users
|
|
216
233
|
domain_users_cache = Hash[domain.users.map { |u| [u.login, u] }]
|
|
234
|
+
|
|
217
235
|
list.pmapcat do |user|
|
|
218
236
|
begin
|
|
219
237
|
user_data = user.to_hash
|
|
220
238
|
domain_user = domain_users_cache[user_data[:login]]
|
|
221
239
|
if !domain_user
|
|
222
240
|
added_user = domain.add_user(user_data, opts)
|
|
223
|
-
[{ type: :user_added_to_domain, user: added_user }]
|
|
241
|
+
[{ type: :successful, :action => :user_added_to_domain, user: added_user }]
|
|
224
242
|
else
|
|
225
243
|
fields_to_check = opts[:fields_to_check] || user_data.keys
|
|
226
244
|
diff = GoodData::Helpers.diff([domain_user.to_hash], [user_data], key: :login, fields: fields_to_check)
|
|
227
245
|
next [] if diff[:changed].empty?
|
|
228
246
|
updated_user = domain.update_user(domain_user.to_hash.merge(user_data.compact), opts)
|
|
229
|
-
[{ type: :user_changed_in_domain, user: updated_user }]
|
|
247
|
+
[{ type: :successful, :action => :user_changed_in_domain, user: updated_user }]
|
|
230
248
|
end
|
|
231
249
|
rescue RuntimeError => e
|
|
232
|
-
[{ type: :
|
|
250
|
+
[{ type: :failed, :user => user, message: e }]
|
|
233
251
|
end
|
|
234
252
|
end
|
|
235
253
|
end
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative '../rest/resource'
|
|
4
8
|
require_relative '../extensions/hash'
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative '../rest/resource'
|
|
4
8
|
require_relative '../extensions/hash'
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative '../rest/object'
|
|
4
8
|
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require 'multi_json'
|
|
4
8
|
require 'pmap'
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2010-2015 GoodData Corporation. All rights reserved.
|
|
4
|
+
# This source code is licensed under the BSD-style license found in the
|
|
5
|
+
# LICENSE file in the root directory of this source tree.
|
|
2
6
|
|
|
3
7
|
require_relative '../core/project'
|
|
4
8
|
|
|
@@ -10,7 +14,7 @@ module GoodData
|
|
|
10
14
|
MD_OBJ_CTG = 'obj'
|
|
11
15
|
IDENTIFIERS_CFG = 'instance-identifiers'
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
attr_accessor :json
|
|
14
18
|
|
|
15
19
|
alias_method :raw_data, :json
|
|
16
20
|
alias_method :to_hash, :json
|
|
@@ -31,7 +35,7 @@ module GoodData
|
|
|
31
35
|
end
|
|
32
36
|
end
|
|
33
37
|
|
|
34
|
-
metadata_property_reader :uri, :identifier, :title, :summary, :tags, :
|
|
38
|
+
metadata_property_reader :uri, :identifier, :title, :summary, :tags, :category
|
|
35
39
|
metadata_property_writer :tags, :summary, :title, :identifier
|
|
36
40
|
|
|
37
41
|
def initialize(data)
|
|
@@ -61,13 +65,22 @@ module GoodData
|
|
|
61
65
|
client.connection.server_url + meta['uri']
|
|
62
66
|
end
|
|
63
67
|
|
|
68
|
+
def deprecated
|
|
69
|
+
if meta['deprecated'] == '1'
|
|
70
|
+
true
|
|
71
|
+
else
|
|
72
|
+
false
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
alias_method :deprecated?, :deprecated
|
|
76
|
+
|
|
64
77
|
def deprecated=(flag)
|
|
65
|
-
if flag == '1' || flag == 1
|
|
78
|
+
if flag == '1' || flag == 1 || flag == true
|
|
66
79
|
meta['deprecated'] = '1'
|
|
67
|
-
elsif flag == '0' || flag == 0
|
|
80
|
+
elsif flag == '0' || flag == 0 || flag == false
|
|
68
81
|
meta['deprecated'] = '0'
|
|
69
82
|
else
|
|
70
|
-
fail 'You have to provide flag as either 1 or "1" or 0 or "0"'
|
|
83
|
+
fail 'You have to provide flag as either 1 or "1" or 0 or "0" or true/false'
|
|
71
84
|
end
|
|
72
85
|
end
|
|
73
86
|
|
|
@@ -80,11 +93,6 @@ module GoodData
|
|
|
80
93
|
self
|
|
81
94
|
end
|
|
82
95
|
|
|
83
|
-
def saved?
|
|
84
|
-
res = uri.nil?
|
|
85
|
-
!res
|
|
86
|
-
end
|
|
87
|
-
|
|
88
96
|
def save
|
|
89
97
|
fail('Validation failed') unless validate
|
|
90
98
|
|
|
@@ -150,6 +158,25 @@ module GoodData
|
|
|
150
158
|
other.respond_to?(:uri) && other.uri == uri && other.respond_to?(:to_hash) && other.to_hash == to_hash
|
|
151
159
|
end
|
|
152
160
|
|
|
161
|
+
def listed?
|
|
162
|
+
!unlisted?
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
def unlisted
|
|
166
|
+
meta['unlisted'] == '1'
|
|
167
|
+
end
|
|
168
|
+
alias_method :unlisted?, :unlisted
|
|
169
|
+
|
|
170
|
+
def unlisted=(flag)
|
|
171
|
+
if flag == true
|
|
172
|
+
meta['unlisted'] = '1'
|
|
173
|
+
elsif flag == false
|
|
174
|
+
meta['unlisted'] = '0'
|
|
175
|
+
else
|
|
176
|
+
fail 'You have to provide flag as either true or false'
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
153
180
|
def validate
|
|
154
181
|
true
|
|
155
182
|
end
|