In GoodData project is possible to move your attributes and facts to some specific folder. I'm trying to do something like that by Ruby script. I have project blueprint and a list of attribute ids and information about their folders, but I'm still not sure how to change a folder. Because this code doesn't work:
blueprint = project.blueprint
blueprint.datasets.map do |dataset|
dataset.attributes.map do |attr|
attr.folder = dataset.title
end
end
Error:
NoMethodError: undefined method `folder='
In GoodData Ruby Cookbook is example how to find list of folders, but no more information.
# Currently there is not support in SDK to directly explore folders but we can reach to API directly
# You can also go to the project in your browser and look for folders there
client.get("#{project.md['query']}/dimensions")['query']['entries'].map {|i| i['title']} # => ["Dataset.Opportunities", "Awesome Sales Reps", "Dataset.Regions"]
client.get("#{project.md['query']}/folders")['query']['entries'].map {|i| i['title']} # => ["My Special Folder"]
Has somebody already tried to change folder of attributes or facts in your GoodData project?
here is SDK: http://www.rubydoc.info/gems/gooddata/GoodData/Model/BlueprintField and here are some examples how to work with a blueprint, but mostly it's just about creating new attributes: http://sdk.gooddata.com/gooddata-ruby-examples/#_12_working_with_blueprints
Thank you for any idea. Michal