You may have mistyped the address or the page may have moved.
64 |
65 |
If you are the application owner check the logs for more information.
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure static file server for tests with Cache-Control for performance.
16 | config.serve_static_files = true
17 | config.cache_store = :null_store
18 | config.static_cache_control = 'public, max-age=3600'
19 |
20 | # Show full error reports and disable caching.
21 | config.consider_all_requests_local = true
22 | config.action_controller.perform_caching = false
23 |
24 | # Raise exceptions instead of rendering exception templates.
25 | config.action_dispatch.show_exceptions = false
26 |
27 | # Disable request forgery protection in test environment.
28 | config.action_controller.allow_forgery_protection = false
29 |
30 | # Tell Action Mailer not to deliver emails to the real world.
31 | # The :test delivery method accumulates sent emails in the
32 | # ActionMailer::Base.deliveries array.
33 | config.action_mailer.delivery_method = :test
34 |
35 | # Randomize the order test cases are executed.
36 | config.active_support.test_order = :random
37 |
38 | # Print deprecation notices to the stderr.
39 | config.active_support.deprecation = :stderr
40 |
41 | # Raises error for missing translations
42 | # config.action_view.raise_on_missing_translations = true
43 | end
44 |
--------------------------------------------------------------------------------
/documentation/submission_flow.md:
--------------------------------------------------------------------------------
1 | Dash Submission Flow
2 |
3 | 1. Fill in metadata (DataCite)
4 | * Mostly AJAX in one page by way of JQuery and/or Rails Unobtrusive Javascript (UJS)
5 | * Other widgets in page include mapping (Leaflet), links out to ORCID login to validate user
6 | 2. Upload files
7 | * Upload files directly (get copied onto web server until successful submission)
8 | * Or choose URLs where files are located and can be retrieved by http(s). They are validated that they exist and a download can start.
9 | * Also some transformations of Google Drive/Box/Dropbox URLs into the download links
10 | 3. Review before submit
11 | * Missing required data shown
12 | * Review display
13 | * Private for peer review (embargo) delay can be set
14 | * Accept license
15 | 4. Submission
16 | * Update metadata with EZID/DataCite for the submitted item.
17 | * Uses SWORD to submit to Merritt in background process
18 | * SWORD submission is currently synchronous within background process
19 | * Package sent contains manifest (for URLs) or zip file with metadata files and data files
20 | * Mrt-datacite.xml, mrt-dataone-manifest.txt, mrt-embargo.txt, mrt-oaidc.xml, stash-wrapper.xml sent to merritt
21 | * If sending a manifest, these xml files are hosted on the Dash server and picked up by Merritt as part of its ingest.
22 | 5. Harvesting
23 | * When Merritt has successfully ingested the dataset, it shows up in the OAI-PMH feed it exposes.
24 | * Harvester runs every 5 minutes and checks for updates.
25 | * With new updates it adds metadata into SOLR
26 | * Notifies UI that update has finished.
27 | 6. UI finishes actions for successfully submitted dataset when notified
28 | * Sets download_uri and update_uri if needed
29 | * Changes state to ‘submitted’
30 | * Cleans up staged, temporary files for this submission
31 | * Delivers invitations for co-authors without ORCIDs
32 | * Updates the total dataset size by querying Merritt
33 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = false
11 |
12 | # Show full error reports and disable caching.
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send.
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger.
20 | config.active_support.deprecation = :log
21 |
22 | # Raise an error on page load if there are pending migrations.
23 | config.active_record.migration_error = :page_load
24 |
25 | # Debug mode disables concatenation and preprocessing of assets.
26 | # This option may cause significant delays in view rendering with a large
27 | # number of complex assets.
28 | config.assets.debug = true
29 |
30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31 | # yet still be able to expire them through the digest params.
32 | config.assets.digest = true
33 |
34 | # Adds additional error checking when serving assets at runtime.
35 | # Checks for improperly declared sprockets dependencies.
36 | # Raises helpful error messages.
37 | config.assets.raise_runtime_errors = true
38 |
39 | # Raises error for missing translations
40 | # config.action_view.raise_on_missing_translations = true
41 |
42 | config.action_mailer.delivery_method = :sendmail
43 | config.action_mailer.perform_deliveries = true
44 | config.action_mailer.raise_delivery_errors = true
45 | config.action_mailer.default_url_options = { :host => "https://dash2-dev.ucop.edu/stash" }
46 | end
47 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 | require File.join(File.dirname(__FILE__), 'lib', 'bundler_help.rb')
3 |
4 | # ############################################################
5 | # Rails
6 |
7 | gem 'mysql2', '~> 0.4'
8 | gem 'rails', '4.2.11'
9 |
10 | # ############################################################
11 | # Local engines
12 |
13 | path '../stash' do
14 | gem 'stash_api'
15 | gem 'stash_datacite'
16 | gem 'stash_discovery'
17 | gem 'stash_engine'
18 | # needs engines to load first
19 | gem 'stash-merritt'
20 | end
21 |
22 | # ############################################################
23 | # Deployment
24 |
25 | gem 'capistrano', '~> 3.4.1'
26 | gem 'capistrano-passenger'
27 | gem 'capistrano-rails', '~> 1.1'
28 | gem 'passenger'
29 | gem 'rubocop', '~> 0.52.1'
30 |
31 | # ############################################################
32 | # UI
33 |
34 | # TODO: why do we have uglifier AND yui-compressor?
35 | # asset pipeline problems with Joel's pre-minified CSS/JS caused errors with uglifier and had to revert to yui-compressor
36 |
37 | gem 'coffee-rails', '~> 4.1.0'
38 | gem 'jquery-rails'
39 | gem 'sass-rails', '~> 5.0'
40 | gem 'therubyracer', platforms: :ruby
41 | gem 'turbolinks'
42 |
43 | gem 'uglifier', '~> 3.0.4'
44 | gem 'yui-compressor'
45 |
46 | # ############################################################
47 | # Misc
48 |
49 | gem 'exception_notification'
50 | gem 'httparty'
51 | gem 'jbuilder', '~> 2.0'
52 |
53 | # ############################################################
54 | # Development and testing
55 |
56 | group :development do
57 | gem 'colorize', '~> 0.8'
58 | gem 'web-console', '~> 2.0'
59 | end
60 |
61 | group :test do
62 | gem 'capybara', '~> 2.16'
63 | gem 'chromedriver-helper', '~> 1.1'
64 | gem 'database_cleaner', '~> 1.5'
65 | gem 'selenium-webdriver', '~> 3.7'
66 | gem 'simplecov', '~> 0.14'
67 | gem 'simplecov-console', '~> 0.4'
68 | gem 'solr_wrapper', '~> 1.1'
69 | end
70 |
71 | group :development, :test do
72 | gem 'binding_of_caller'
73 | gem 'byebug'
74 | gem 'pry'
75 | gem 'pry-rails'
76 | gem 'pry-remote'
77 | gem 'rspec-rails', '~> 3.0'
78 | end
79 |
--------------------------------------------------------------------------------
/spec/features/review_spec.rb:
--------------------------------------------------------------------------------
1 | require 'features_helper'
2 | require 'byebug'
3 |
4 | describe 'review ' do
5 | before(:each) do
6 | start_new_dataset!
7 | end
8 |
9 | describe 'publication date' do
10 | DATE_FORMAT = '%B %e, %Y'.freeze
11 |
12 | before(:each) do
13 | navigate_to_review!
14 | end
15 |
16 | it 'defaults to today' do
17 | today_str = Date.today.strftime(DATE_FORMAT)
18 | expect(page).to have_content("Publication date: #{today_str}")
19 | end
20 |
21 | it 'reflects the embargo date, if any' do
22 | future_button = find_by_id('future_button')
23 | future_button.click
24 |
25 | end_date = Date.today + 3.months
26 | fill_in_future_pub_date(end_date)
27 |
28 | page.find('body').click # maybe needed if selenium doesn't trigger blur correctly
29 |
30 | navigate_to_metadata!
31 | navigate_to_review!
32 |
33 | end_date_str = end_date.strftime(DATE_FORMAT)
34 | expect(page).to have_content("Publication date: #{end_date_str}")
35 | end
36 | end
37 |
38 | describe 'without required fields' do
39 | before(:each) do
40 | navigate_to_review!
41 | end
42 |
43 | it 'disables submit' do
44 | submit = find_button('submit_dataset', disabled: :all)
45 | expect(submit).not_to be_nil
46 | expect(submit).to be_disabled
47 | end
48 | end
49 |
50 | describe 'with required fields' do
51 | before(:each) do
52 | fill_required_fields!
53 | navigate_to_review!
54 | find_by_id('agree_to_license').click
55 | end
56 |
57 | it 'allows submit' do
58 | submit = find_button('submit_dataset', disabled: :all)
59 | expect(submit).not_to be_nil
60 | expect(submit).not_to be_disabled
61 | end
62 |
63 | it 'submits' do
64 | # get these now since they're only on the edit pages
65 | resource_id = current_resource_id
66 | resource = current_resource
67 |
68 | expect(StashEngine.repository).to receive(:submit).with(resource_id: resource_id)
69 | submit = find_button('submit_dataset', disabled: :all)
70 | submit.click
71 |
72 | expect(page).to have_content('My Datasets')
73 | expect(page).to have_content resource.title
74 | end
75 | end
76 | end
77 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Dash
2 |
3 | [](https://travis-ci.org/CDLUC3/dashv2)
4 |
5 | ## Introduction
6 |
7 | **Dash** is the [UC Curation Center](http://www.cdlib.org/uc3/)'s
8 | implementation of the [Stash](https://github.com/CDLUC3/stash) application
9 | framework for research data publication and preservation, based on the
10 | [DataCite Metadata Schema](https://schema.datacite.org/) and the University
11 | of California’s [Merritt](https://merritt.cdlib.org/) repository service.
12 |
13 | - [About Dash](app/views/layouts/_about.html.md)
14 |
15 | ## Development
16 |
17 | ### Installation
18 |
19 | See
20 | [Dash2 Installation](https://github.com/CDLUC3/dashv2/blob/master/documentation/dash2_install.md)
21 | for installation notes.
22 |
23 | ### Quick Cheat Sheet
24 |
25 | #### Development environment setup
26 |
27 | At the same level as the `dashv2` directory:
28 |
29 | - Clone the [Stash](https://github.com/CDLUC3/stash) repository (public):
30 |
31 | ```
32 | git clone https://github.com/CDLUC3/stash.git
33 | ```
34 |
35 | - Clone the [dash2-config](https://github.com/cdlib/dash2-config/) repository
36 | (private to CDL developers):
37 |
38 | ```
39 | git clone git@github.com:cdlib/dash2-config.git
40 | ```
41 |
42 | - Symlink configuration files from `dash2-config` into the `dashv2`
43 | `config` directory:
44 |
45 | ```
46 | ./symlink_config.sh
47 | ```
48 |
49 | #### Running integration/feature tests locally
50 |
51 | In the `dashv2` directory:
52 |
53 | - run `travis-prep.sh`
54 | - run `bundle exec rake`
55 |
56 | #### Capistrano deployment
57 |
58 | To deploy the latest (committed) code from GitHub:
59 |
60 | ```
61 | bundle exec cap deploy [BRANCH=""]
62 | ```
63 |
64 | The `$BRANCH` environment variable is optional; if it’s omitted, the
65 | deploy script will prompt you.
66 |
67 | #### Miscellaneous tasks
68 |
69 | - The `rake app_data:clear` task will clear most database and SOLR data. It
70 | can be useful to run before testing data import and transformation from our
71 | previous version of the app. It will not erase data in the production
72 | environment or until it gets confirmation that you really want to erase the
73 | data.
74 |
75 | ```
76 | bundle exec rake app_data:clear RAILS_ENV=
77 | ```
78 |
--------------------------------------------------------------------------------
/.config-travis/settings.yml:
--------------------------------------------------------------------------------
1 | # Configurable Logo Used for CartoDB export
2 | APPLICATION_LOGO_URL: 'http://geoblacklight.org/images/geoblacklight-logo.png'
3 |
4 | # Carto OneClick Service https://carto.com/engine/open-in-carto/
5 | CARTO_ONECLICK_LINK: 'http://oneclick.cartodb.com/'
6 |
7 | # Download path can be configured using this setting
8 | #DOWNLOAD_PATH: "./tmp/cache/downloads"
9 |
10 | # DEPRECATED Main Solr geometry field used for spatial search and bounding box. Should be type 'rpt'
11 | GEOMETRY_FIELD: 'solr_geom'
12 |
13 | #Solr field mappings
14 | FIELDS:
15 | :FILE_FORMAT: 'dc_format_s'
16 | :GEOMETRY: 'solr_geom'
17 | :WXS_IDENTIFIER: 'layer_id_s'
18 | :RIGHTS: 'dc_rights_s'
19 | :PROVENANCE: 'dct_provenance_s'
20 | :GEOM_TYPE: 'layer_geom_type_s'
21 | :SPATIAL_COVERAGE: 'dct_spatial_sm'
22 | :SUBJECT: 'dc_subject_sm'
23 | :REFERENCES: 'dct_references_s'
24 | :YEAR: 'solr_year_i'
25 | :CREATOR: 'dc_creator_sm'
26 | :DESCRIPTION: 'dc_description_s'
27 | :PUBLISHER: 'dc_publisher_s'
28 | :PART_OF: 'dct_isPartOf_sm'
29 | :TEMPORAL: 'dct_temporal_sm'
30 | :TITLE: 'dc_title_s'
31 |
32 | # Institution deployed at
33 | INSTITUTION: 'Stanford'
34 |
35 | # Metadata shown in tool panel
36 | METADATA_SHOWN:
37 | - 'fgdc'
38 | - 'iso19139'
39 | - 'mods'
40 |
41 | # (For external Download) timeout and open_timeout parameters for Faraday
42 | TIMEOUT_DOWNLOAD: 16
43 |
44 | # (For WMS inspection) timeout and open_timeout parameters for Faraday
45 | TIMEOUT_WMS: 4
46 |
47 | # Web services shown in tool panel
48 | WEBSERVICES_SHOWN:
49 | - 'wms'
50 | - 'wfs'
51 | - 'iiif'
52 | - 'feature_layer'
53 | - 'tiled_map_layer'
54 | - 'dynamic_map_layer'
55 | - 'image_map_layer'
56 |
57 | # WMS Parameters
58 | WMS_PARAMS:
59 | :SERVICE: 'WMS'
60 | :VERSION: '1.1.1'
61 | :REQUEST: 'GetFeatureInfo'
62 | :STYLES: ''
63 | :SRS: 'EPSG:4326'
64 | :EXCEPTIONS: 'application/json'
65 | :INFO_FORMAT: 'text/html'
66 |
67 | # Settings for leaflet
68 | OPACITY_CONTROL: &opacity_control
69 | CONTROLS:
70 | - 'Opacity'
71 |
72 | LEAFLET:
73 | MAP:
74 | LAYERS:
75 | DETECT_RETINA: true
76 | VIEWERS:
77 | WMS:
78 | <<: *opacity_control
79 | TILEDMAPLAYER:
80 | <<: *opacity_control
81 | FEATURELAYER:
82 | <<: *opacity_control
83 | DYNAMICMAPLAYER:
84 | <<: *opacity_control
85 | IMAGEMAPLAYER:
86 | <<: *opacity_control
87 |
--------------------------------------------------------------------------------
/spec/features/admin_spec.rb:
--------------------------------------------------------------------------------
1 | require 'features_helper'
2 |
3 | describe 'admin' do
4 | fixtures :stash_engine_users, :stash_engine_resources, :stash_engine_identifiers, :stash_engine_resource_states,
5 | :stash_engine_versions, :stash_engine_authors, :dcs_descriptions, :dcs_affiliations_authors, :dcs_affiliations
6 |
7 | before(:each) do
8 | log_in!
9 | user = StashEngine::User.where(email: 'test@example.edu.test-google-a.com').first
10 | user.update(role: 'admin')
11 | end
12 |
13 | it 'has admin link' do
14 | visit('/')
15 | expect(page).to have_link('Admin')
16 | end
17 |
18 | it 'shows users for institution' do
19 | visit('/stash/admin')
20 | expect(page).to have_link('Leroy Jones')
21 | end
22 |
23 | it "shows a user's activity page" do
24 | visit('/stash/admin/user_dashboard/2')
25 | expect(page).to have_text("Leroy Jones's Activity")
26 | expect(page).to have_link('Evaluating Linked Lists')
27 | end
28 |
29 | it "shows a user's version history for a dataset" do
30 | visit('/stash/edit_histories?resource_id=5')
31 | expect(page).to have_text('2 (in progress)')
32 | end
33 |
34 | it 'allows editing a dataset' do
35 | visit('/stash/admin/user_dashboard/1')
36 | expect(page).to have_css('button.c-admin-edit-icon')
37 | first('button.c-admin-edit-icon').click
38 |
39 | wait_for_ajax!
40 | expect(page).to have_text("You are editing Mary McCormick's dataset.")
41 |
42 | click_link('Review and Submit')
43 | wait_for_ajax!
44 | expect(page).to have_css('input#user_comment')
45 | end
46 |
47 | describe 'superuser' do
48 |
49 | before(:each) do
50 | user = StashEngine::User.where(email: 'test@example.edu.test-google-a.com').first
51 | user.update(role: 'superuser')
52 | user.reload
53 | end
54 |
55 | it 'allows changing user role as a superuser' do
56 | visit('/stash/admin')
57 | wait_for_ajax!
58 |
59 | expect(page).to have_link('Leroy Jones')
60 | first('button.c-admin-edit-icon').click
61 | wait_for_ajax!
62 |
63 | expect(page).to have_css('input#role_admin')
64 | first('input#role_admin').click
65 | within(:css, 'div.o-admin-dialog') do
66 | find('input[name=commit]').click
67 | end
68 | wait_for_ajax!
69 |
70 | expect(page.find('#user_role_2')).to have_text('Admin')
71 | end
72 | end
73 |
74 | end
75 |
--------------------------------------------------------------------------------
/config/deploy/production.rb:
--------------------------------------------------------------------------------
1 | # server-based syntax
2 | # ======================
3 | # Defines a single server with a list of roles and multiple properties.
4 | # You can define all roles on a single server, or split them:
5 |
6 | # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
7 | # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8 | # server 'db.example.com', user: 'deploy', roles: %w{db}
9 |
10 | set :rails_env, 'production'
11 |
12 | set :server_host, ENV["SERVER_HOST"] || 'uc3-dash2-prd.cdlib.org'
13 | server fetch(:server_host), user: 'dash2', roles: %w{web app db}
14 |
15 | # role-based syntax
16 | # ==================
17 |
18 | # Defines a role with one or multiple servers. The primary server in each
19 | # group is considered to be the first unless any hosts have the primary
20 | # property set. Specify the username and a domain or IP for the server.
21 | # Don't use `:all`, it's a meta role.
22 |
23 | # role :app, %w{deploy@example.com}, my_property: :my_value
24 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
25 | # role :db, %w{deploy@example.com}
26 |
27 |
28 |
29 | # Configuration
30 | # =============
31 | # You can set any configuration variable like in config/deploy.rb
32 | # These variables are then only loaded and set in this stage.
33 | # For available Capistrano configuration variables see the documentation page.
34 | # http://capistranorb.com/documentation/getting-started/configuration/
35 | # Feel free to add new variables to customise your setup.
36 |
37 |
38 |
39 | # Custom SSH Options
40 | # ==================
41 | # You may pass any option but keep in mind that net/ssh understands a
42 | # limited set of options, consult the Net::SSH documentation.
43 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
44 | #
45 | # Global options
46 | # --------------
47 | # set :ssh_options, {
48 | # keys: %w(/home/rlisowski/.ssh/id_rsa),
49 | # forward_agent: false,
50 | # auth_methods: %w(password)
51 | # }
52 | #
53 | # The server-based syntax can be used to override options:
54 | # ------------------------------------
55 | # server 'example.com',
56 | # user: 'user_name',
57 | # roles: %w{web app},
58 | # ssh_options: {
59 | # user: 'user_name', # overrides user setting above
60 | # keys: %w(/home/user_name/.ssh/id_rsa),
61 | # forward_agent: false,
62 | # auth_methods: %w(publickey password)
63 | # # password: 'please use keys'
64 | # }
65 |
--------------------------------------------------------------------------------
/spec/solr_helper.rb:
--------------------------------------------------------------------------------
1 | require 'solr_wrapper'
2 | require 'colorize'
3 | require 'uri'
4 |
5 | # TODO: figure out how to move some of this to stash_discovery
6 | module SolrHelper
7 | SOLR_VERSION = '5.2.1'.freeze
8 | CONF_DIR = 'spec/config/solr/conf'.freeze
9 | BLACKLIGHT_YML = 'config/blacklight.yml'.freeze
10 | COLLECTION_NAME = 'geoblacklight'.freeze
11 |
12 | class << self
13 |
14 | def start
15 | return if solr_instance
16 | self.solr_instance = start_new_instance
17 | self.collection = create_collection
18 | rescue StandardError => ex
19 | warn(ex)
20 | stop
21 | raise
22 | end
23 |
24 | def stop
25 | return unless solr_instance
26 | begin
27 | info "Deleting collection #{collection}" if collection
28 | solr_instance.delete(collection) if collection
29 | self.collection = nil
30 | ensure
31 | info 'Stopping Solr'
32 | solr_instance.stop
33 | self.solr_instance = nil
34 | end
35 | end
36 |
37 | private
38 |
39 | attr_accessor :solr_instance
40 | attr_accessor :collection
41 |
42 | def solr_env
43 | # For macOS local development, run Solr under Java 8 even if Java 9 is the default
44 | @solr_env ||= begin
45 | return ENV unless ENV['JAVA_HOME']
46 | return ENV unless ENV['JAVA_HOME'].include?('jdk-9')
47 | mac_jdk8_home ||= `[[ -f /usr/libexec/java_home && -x /usr/libexec/java_home ]] && /usr/libexec/java_home -v 1.8`.strip!
48 | return ENV unless mac_jdk8_home
49 | ENV.to_h.merge!('JAVA_HOME' => mac_jdk8_home)
50 | end
51 | end
52 |
53 | def create_collection
54 | info "Creating collection #{COLLECTION_NAME} from configuration #{CONF_DIR}"
55 | new_collection = solr_instance.create(dir: CONF_DIR, name: COLLECTION_NAME)
56 | info 'Collection created'
57 | new_collection
58 | end
59 |
60 | def start_new_instance
61 | info "Starting Solr #{SOLR_VERSION} on port #{port} with JAVA_HOME=#{solr_env['JAVA_HOME']}"
62 | instance = SolrWrapper.instance(verbose: true, port: port, version: SOLR_VERSION, env: solr_env)
63 | instance.start
64 | info 'Solr started'
65 | instance
66 | end
67 |
68 | def port
69 | config[:port]
70 | end
71 |
72 | def config
73 | @config ||= begin
74 | blacklight_config = YAML.safe_load(File.read(BLACKLIGHT_YML))['test']
75 | solr_uri = URI.parse(blacklight_config['url'])
76 | {
77 | port: solr_uri.port,
78 | collection: solr_uri.path.split('/').last
79 | }
80 | end
81 | end
82 |
83 | def info(msg)
84 | puts msg.to_s.colorize(:blue)
85 | end
86 |
87 | def warn(msg)
88 | puts msg.to_s.colorize(:red)
89 | end
90 | end
91 | end
92 |
--------------------------------------------------------------------------------
/documentation/how_to_contribute.md:
--------------------------------------------------------------------------------
1 | # Introduction
2 |
3 | The Dryad (formerly Dash) software provides a platform for depositing and managing data, working with descriptive metadata and additional services such as scholarly identifier registration or usage and citation tracking.
4 |
5 | These guidelines are an attempt to ensure that we are able to provide a reliable system, stable APIs and clear communication.
6 |
7 |
8 | ## Pull request methodology
9 | We are using the "fork and pull model" for developing Dryad. [https://help.github.com/articles/about-collaborative-development-models/](https://help.github.com/articles/about-collaborative-development-models/)
10 |
11 | The basic flow of this model would be to:
12 |
13 | - Fork repo to your account or somewhere else.
14 | - Clone your own copy of the repo to a machine to do work on.
15 | - add upstream for repo if needed and use it to get upstream changes in the future.
16 |
17 | ```
18 | # for example
19 | git remote add upstream https://github.com/CDLUC3/dashv2.git
20 | git fetch upstream
21 | git merge upstream/master
22 | ```
23 |
24 | - Make all needed changes and push them to your fork.
25 | - Create pull request from your fork to get them incorporated back into the main upstream repository.
26 |
27 | (Please add feedback about this process since I may have missed details.)
28 |
29 | # Testing
30 | When creating pull requests travis.ci will run tests (TODO: which seem to break now and we need to fix), but you can generally run quick tests locally for just the areas you've changed and they'll run quickly if you don't want to wait around for Travis.ci or want to run them more iteratively to correct problems.
31 |
32 | TODO: there are some areas where tests need to be added (mostly our initial version of an API), so we need to schedule work time for these tasks before long.
33 |
34 | # Code review
35 | - Tag another user to review your pull request.
36 | - Changes at the model unit test level or UI level ("feature" level) should have rspec tests. In some cases, you may need to use test doubles, aka "mocks" to simulate external services or items with complicated dependencies.
37 |
38 | ## Pull request checklists
39 |
40 | Changes to database schemas or model classes
41 |
42 | - Did you add or update any unit tests?
43 | - Did you include any database migration?
44 | - If you needed to transform data, did you include the changes in the migration (you may need to drop to raw SQL) or create a rake task?
45 | - Did you also include the automatic updates to schema.rb when you committed?
46 |
47 | Changes to views
48 |
49 | - Did you add major UI changes such as new layouts, css styles or images to the [UI library](https://github.com/CDLUC3/stash/tree/master/stash_engine/ui-library) ?
50 | - Are feature tests (browser automation) added or modified in order to test the change?
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/config/deploy/demo.rb:
--------------------------------------------------------------------------------
1 | # server-based syntax
2 | # ======================
3 | # Defines a single server with a list of roles and multiple properties.
4 | # You can define all roles on a single server, or split them:
5 |
6 | # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
7 | # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8 | # server 'db.example.com', user: 'deploy', roles: %w{db}
9 |
10 | set :rails_env, 'demo'
11 |
12 | #set :bundle_env_variables, { 'RAILS_ENV' => 'demo' }
13 |
14 | # To override the default host, set $SERVER_HOST, e.g.
15 | # $ SERVER_HOST='localhost' bundle exec cap development deploy
16 | set :server_host, ENV["SERVER_HOST"] || 'uc3-dashdemo-stg.cdlib.org'
17 | server fetch(:server_host), user: 'dash2', roles: %w{web app db}
18 |
19 | #on roles(:all) do |host|
20 | # puts "setting server host: #{host.hostname}"
21 | #end
22 |
23 | #set :passenger_pid, "#{deploy_to}/passenger.pid"
24 | #set :passenger_log, "#{deploy_to}/passenger.log"
25 | #set :passenger_port, "3000"
26 |
27 | # role-based syntax
28 | # ==================
29 |
30 | # Defines a role with one or multiple servers. The primary server in each
31 | # group is considered to be the first unless any hosts have the primary
32 | # property set. Specify the username and a domain or IP for the server.
33 | # Don't use `:all`, it's a meta role.
34 |
35 | # role :app, %w{deploy@example.com}, my_property: :my_value
36 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
37 | # role :db, %w{deploy@example.com}
38 |
39 |
40 |
41 | # Configuration
42 | # =============
43 | # You can set any configuration variable like in config/deploy.rb
44 | # These variables are then only loaded and set in this stage.
45 | # For available Capistrano configuration variables see the documentation page.
46 | # http://capistranorb.com/documentation/getting-started/configuration/
47 | # Feel free to add new variables to customise your setup.
48 |
49 |
50 |
51 | # Custom SSH Options
52 | # ==================
53 | # You may pass any option but keep in mind that net/ssh understands a
54 | # limited set of options, consult the Net::SSH documentation.
55 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
56 | #
57 | # Global options
58 | # --------------
59 | # set :ssh_options, {
60 | # keys: %w(/home/rlisowski/.ssh/id_rsa),
61 | # forward_agent: false,
62 | # auth_methods: %w(password)
63 | # }
64 | #
65 | # The server-based syntax can be used to override options:
66 | # ------------------------------------
67 | # server 'example.com',
68 | # user: 'user_name',
69 | # roles: %w{web app},
70 | # ssh_options: {
71 | # user: 'user_name', # overrides user setting above
72 | # keys: %w(/home/user_name/.ssh/id_rsa),
73 | # forward_agent: false,
74 | # auth_methods: %w(publickey password)
75 | # # password: 'please use keys'
76 | # }
--------------------------------------------------------------------------------
/config/deploy/stage.rb:
--------------------------------------------------------------------------------
1 | # server-based syntax
2 | # ======================
3 | # Defines a single server with a list of roles and multiple properties.
4 | # You can define all roles on a single server, or split them:
5 |
6 | # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
7 | # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8 | # server 'db.example.com', user: 'deploy', roles: %w{db}
9 |
10 | set :rails_env, 'stage'
11 |
12 | #set :bundle_env_variables, { 'RAILS_ENV' => 'stage' }
13 |
14 | # To override the default host, set $SERVER_HOST, e.g.
15 | # $ SERVER_HOST='localhost' bundle exec cap development deploy
16 | set :server_host, ENV["SERVER_HOST"] || 'uc3-dash2-stg.cdlib.org'
17 | server fetch(:server_host), user: 'dash2', roles: %w{web app db}
18 |
19 | #on roles(:all) do |host|
20 | # puts "setting server host: #{host.hostname}"
21 | #end
22 |
23 | #set :passenger_pid, "#{deploy_to}/passenger.pid"
24 | #set :passenger_log, "#{deploy_to}/passenger.log"
25 | #set :passenger_port, "3000"
26 |
27 | # role-based syntax
28 | # ==================
29 |
30 | # Defines a role with one or multiple servers. The primary server in each
31 | # group is considered to be the first unless any hosts have the primary
32 | # property set. Specify the username and a domain or IP for the server.
33 | # Don't use `:all`, it's a meta role.
34 |
35 | # role :app, %w{deploy@example.com}, my_property: :my_value
36 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
37 | # role :db, %w{deploy@example.com}
38 |
39 |
40 |
41 | # Configuration
42 | # =============
43 | # You can set any configuration variable like in config/deploy.rb
44 | # These variables are then only loaded and set in this stage.
45 | # For available Capistrano configuration variables see the documentation page.
46 | # http://capistranorb.com/documentation/getting-started/configuration/
47 | # Feel free to add new variables to customise your setup.
48 |
49 |
50 |
51 | # Custom SSH Options
52 | # ==================
53 | # You may pass any option but keep in mind that net/ssh understands a
54 | # limited set of options, consult the Net::SSH documentation.
55 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
56 | #
57 | # Global options
58 | # --------------
59 | # set :ssh_options, {
60 | # keys: %w(/home/rlisowski/.ssh/id_rsa),
61 | # forward_agent: false,
62 | # auth_methods: %w(password)
63 | # }
64 | #
65 | # The server-based syntax can be used to override options:
66 | # ------------------------------------
67 | # server 'example.com',
68 | # user: 'user_name',
69 | # roles: %w{web app},
70 | # ssh_options: {
71 | # user: 'user_name', # overrides user setting above
72 | # keys: %w(/home/user_name/.ssh/id_rsa),
73 | # forward_agent: false,
74 | # auth_methods: %w(publickey password)
75 | # # password: 'please use keys'
76 | # }
--------------------------------------------------------------------------------
/spec/fixtures/stash_engine_resources.yml:
--------------------------------------------------------------------------------
1 | resource1:
2 | id: 1
3 | user_id: 1
4 | current_resource_state_id: 1
5 | created_at: 2017-08-24 21:00:44.000000000 Z
6 | updated_at: 2017-08-24 21:06:42.000000000 Z
7 | has_geolocation: 1
8 | download_uri: http://merritt-dev.cdlib.org/d/ark%3A%2Fb5072%2Ffk2ww7f97z
9 | identifier_id: 1
10 | update_uri: http://sword-aws-dev.cdlib.org:39001/mrtsword/edit/dash_ucb/doi%3A10.5072%2FFK2WW7F97Z
11 | title: Deconstructing the Lookaside Buffer
12 | current_editor_id: 1
13 | publication_date: 2017-08-24 21:06:21.000000000 Z
14 | tenant_id: localhost
15 |
16 | resource2:
17 | id: 2
18 | user_id: 1
19 | current_resource_state_id: 2
20 | created_at: 2017-08-24 21:10:18.000000000 Z
21 | updated_at: 2017-08-24 21:11:20.000000000 Z
22 | has_geolocation: 1
23 | download_uri: http://merritt-dev.cdlib.org/d/ark%3A%2Fb5072%2Ffk2ww7f97z
24 | identifier_id: 1
25 | update_uri: http://sword-aws-dev.cdlib.org:39001/mrtsword/edit/dash_ucb/doi%3A10.5072%2FFK2WW7F97Z
26 | title: Deconstructing the Lookaside Buffer
27 | current_editor_id: 1
28 | publication_date: 2017-08-24 21:06:21.000000000 Z
29 | tenant_id: localhost
30 |
31 | resource3:
32 | id: 3
33 | user_id: 1
34 | current_resource_state_id: 3
35 | created_at: 2017-08-24 21:12:10.000000000 Z
36 | updated_at: 2017-08-24 21:13:53.000000000 Z
37 | has_geolocation: 0
38 | download_uri: http://merritt-dev.cdlib.org/d/ark%3A%2Fb5072%2Ffk2s46qh43
39 | identifier_id: 2
40 | update_uri: http://sword-aws-dev.cdlib.org:39001/mrtsword/edit/dash_ucb/doi%3A10.5072%2FFK2S46QH43
41 | title: Decoupling the Producer-Consumer Problem from Byzantine Fault Tolerance in
42 | Digital-to-Analog Converters
43 | current_editor_id: 1
44 | publication_date: 2017-08-24 21:13:40.000000000 Z
45 | tenant_id: localhost
46 |
47 | resource4:
48 | id: 4
49 | user_id: 2
50 | current_resource_state_id: 4
51 | created_at: 2017-08-24 21:15:49.000000000 Z
52 | updated_at: 2017-08-24 21:23:22.000000000 Z
53 | has_geolocation: 0
54 | download_uri: http://merritt-dev.cdlib.org/d/ark%3A%2Fb5072%2Ffk2nc60q0s
55 | identifier_id: 3
56 | update_uri: http://sword-aws-dev.cdlib.org:39001/mrtsword/edit/dash_cdl/doi%3A10.5072%2FFK2NC60Q0S
57 | title: Evaluating Linked Lists and Web Services
58 | current_editor_id: 2
59 | publication_date: 2017-08-24 21:18:30.000000000 Z
60 | tenant_id: localhost
61 |
62 | resource5:
63 | id: 5
64 | user_id: 2
65 | current_resource_state_id: 5
66 | created_at: 2017-08-24 21:29:13.000000000 Z
67 | updated_at: 2017-08-24 21:29:13.000000000 Z
68 | has_geolocation: 0
69 | download_uri: http://merritt-dev.cdlib.org/d/ark%3A%2Fb5072%2Ffk2nc60q0s
70 | identifier_id: 3
71 | update_uri: http://sword-aws-dev.cdlib.org:39001/mrtsword/edit/dash_cdl/doi%3A10.5072%2FFK2NC60Q0S
72 | title: Evaluating Linked Lists and Web Services
73 | current_editor_id: 2
74 | publication_date: 2017-08-24 21:18:30.000000000 Z
75 | tenant_id: localhost
76 |
--------------------------------------------------------------------------------
/spec/fixtures/stash_engine_file_uploads.yml:
--------------------------------------------------------------------------------
1 | raw_attributes:
2 | id: 1
3 | upload_file_name: 65f897b9-9d7d-4480-adb0-6e124f002c75.jpg
4 | upload_content_type: image/jpeg
5 | upload_file_size: 505168
6 | resource_id: 1
7 | upload_updated_at: &4 2017-08-24 21:05:13.000000000 Z
8 | created_at: &5 2017-08-24 21:05:13.000000000 Z
9 | updated_at: &6 2017-08-24 21:05:13.000000000 Z
10 | temp_file_path: "/Users/scottfisher/workspace/dashv2/uploads/1/65f897b9-9d7d-4480-adb0-6e124f002c75.jpg"
11 | file_state: created
12 | url:
13 | status_code:
14 | timed_out: 0
15 | original_url:
16 | cloud_service:
17 |
18 | id: 2
19 | upload_file_name: 65f897b9-9d7d-4480-adb0-6e124f002c75.jpg
20 | upload_content_type: image/jpeg
21 | upload_file_size: 505168
22 | resource_id: 2
23 | upload_updated_at: &4 2017-08-24 21:05:13.000000000 Z
24 | created_at: &5 2017-08-24 21:10:18.000000000 Z
25 | updated_at: &6 2017-08-24 21:10:18.000000000 Z
26 | temp_file_path: "/Users/scottfisher/workspace/dashv2/uploads/1/65f897b9-9d7d-4480-adb0-6e124f002c75.jpg"
27 | file_state: copied
28 | url:
29 | status_code:
30 | timed_out: 0
31 | original_url:
32 | cloud_service:
33 |
34 | id: 3
35 | upload_file_name: admin_editing1.jpg
36 | upload_content_type: image/jpeg
37 | upload_file_size: 111067
38 | resource_id: 2
39 | upload_updated_at: &4 2017-08-24 21:11:06.000000000 Z
40 | created_at: &5 2017-08-24 21:11:06.000000000 Z
41 | updated_at: &6 2017-08-24 21:11:06.000000000 Z
42 | temp_file_path: "/Users/scottfisher/workspace/dashv2/uploads/2/admin_editing1.jpg"
43 | file_state: created
44 | url:
45 | status_code:
46 | timed_out: 0
47 | original_url:
48 | cloud_service:
49 |
50 | id: 4
51 | upload_file_name: admin_editing2.jpg
52 | upload_content_type: image/jpeg
53 | upload_file_size: 185621
54 | resource_id: 3
55 | upload_updated_at: &4 2017-08-24 21:13:33.000000000 Z
56 | created_at: &5 2017-08-24 21:13:33.000000000 Z
57 | updated_at: &6 2017-08-24 21:13:33.000000000 Z
58 | temp_file_path: "/Users/scottfisher/workspace/dashv2/uploads/3/admin_editing2.jpg"
59 | file_state: created
60 | url:
61 | status_code:
62 | timed_out: 0
63 | original_url:
64 | cloud_service:
65 |
66 | id: 9
67 | upload_file_name: stash-harvester-annotated-erd.pdf
68 | upload_content_type: application/pdf
69 | upload_file_size: 177988
70 | resource_id: 4
71 | upload_updated_at: &4 2017-08-24 21:23:02.000000000 Z
72 | created_at: &5 2017-08-24 21:23:02.000000000 Z
73 | updated_at: &6 2017-08-24 21:23:02.000000000 Z
74 | temp_file_path: "/Users/scottfisher/workspace/dashv2/uploads/4/stash-harvester-annotated-erd.pdf"
75 | file_state: created
76 | url:
77 | status_code:
78 | timed_out: 0
79 | original_url:
80 | cloud_service:
81 |
82 | id: 10
83 | upload_file_name: stash-harvester-annotated-erd.pdf
84 | upload_content_type: application/pdf
85 | upload_file_size: 177988
86 | resource_id: 5
87 | upload_updated_at: &4 2017-08-24 21:23:02.000000000 Z
88 | created_at: &5 2017-08-24 21:29:13.000000000 Z
89 | updated_at: &6 2017-08-24 21:29:13.000000000 Z
90 | temp_file_path: "/Users/scottfisher/workspace/dashv2/uploads/4/stash-harvester-annotated-erd.pdf"
91 | file_state: copied
92 | url:
93 | status_code:
94 | timed_out: 0
95 | original_url:
96 | cloud_service:
97 |
--------------------------------------------------------------------------------
/spec/features/add_geolocation_spec.rb:
--------------------------------------------------------------------------------
1 | require 'features_helper'
2 | require 'pry'
3 |
4 | describe 'add geolocation' do
5 |
6 | before(:each) do
7 | start_new_dataset!
8 | location_divider = find('summary', text: 'Location Information (optional)')
9 | location_divider.click
10 | wait_for_ajax!
11 | end
12 |
13 | describe 'points' do
14 | it 'adds by lat/long' do
15 | latitude = '37.8086'
16 | longitude = '-122.2674'
17 |
18 | point_latitude = find_blank_field_id('geolocation_point[latitude]')
19 | fill_in point_latitude, with: latitude
20 |
21 | point_longitude = find_blank_field_id('geolocation_point[longitude]')
22 | fill_in point_longitude, with: longitude
23 |
24 | add_geo_point_button = first(:link_or_button, 'add_geo_point')
25 | add_geo_point_button.click
26 |
27 | wait_for_ajax!
28 |
29 | locations = page.find('div .c-locations')
30 | expect(locations).to have_content(/#{latitude},\s+#{longitude}/)
31 |
32 | new_point = StashDatacite::GeolocationPoint.from_resource_id(current_resource_id).first
33 | expect(new_point).not_to be_nil
34 | expect(new_point.latitude).to eq(latitude.to_f)
35 | expect(new_point.longitude).to eq(longitude.to_f)
36 | end
37 | end
38 |
39 | describe 'boxes' do
40 | it 'adds by lat/long' do
41 | bbox_button = first(:link_or_button, 'Bounding Box')
42 | bbox_button.click
43 |
44 | s_latitude = '37.8086'
45 | w_longitude = '-122.3511'
46 |
47 | n_latitude = '47.6572'
48 | e_longitude = '-122.2674'
49 |
50 | sw_latitude = find_blank_field_id('geolocation_box[sw_latitude]')
51 | fill_in sw_latitude, with: s_latitude
52 |
53 | sw_longitude = find_blank_field_id('geolocation_box[sw_longitude]')
54 | fill_in sw_longitude, with: w_longitude
55 |
56 | ne_latitude = find_blank_field_id('geolocation_box[ne_latitude]')
57 | fill_in ne_latitude, with: n_latitude
58 |
59 | ne_longitude = find_blank_field_id('geolocation_box[ne_longitude]')
60 | fill_in ne_longitude, with: e_longitude
61 |
62 | add_geo_box_button = first(:link_or_button, 'add_geo_box')
63 | add_geo_box_button.click
64 |
65 | wait_for_ajax!
66 |
67 | locations = page.find('div .c-locations')
68 | expect(locations).to have_content(/SW\s+#{s_latitude},\s+#{w_longitude}/)
69 | expect(locations).to have_content(/NE\s+#{n_latitude},\s+#{e_longitude}/)
70 |
71 | new_box = StashDatacite::GeolocationBox.from_resource_id(current_resource_id).first
72 | expect(new_box).not_to be_nil
73 | expect(new_box.sw_latitude).to eq(s_latitude.to_f)
74 | expect(new_box.sw_longitude).to eq(w_longitude.to_f)
75 | expect(new_box.ne_latitude).to eq(n_latitude.to_f)
76 | expect(new_box.ne_longitude).to eq(e_longitude.to_f)
77 | end
78 | end
79 |
80 | describe 'google_geocoding' do
81 | xit 'adds a place by name' do
82 | item = find('div.leaflet-control-geosearch input.glass')
83 | item.set("Oakland, CA, USA\n")
84 | wait_for_ajax!
85 | # this triggers the leaflet map move and display but the 'geosearch/showlocation' event doesn't always trigger by geosearch library
86 | # binding.pry
87 | expect(find('div.geolocation_places').has_content?('Oakland, CA, USA')).to eq(true)
88 | end
89 | end
90 | end
91 |
--------------------------------------------------------------------------------
/app/views/tenants/ucd/_dda.html.erb:
--------------------------------------------------------------------------------
1 |
Data Deposit Agreement
2 |
3 |
4 | UC Davis Library is pleased to provide use of the UC Davis instance of
5 | the Dash data repository (Dash), maintained by
6 | California Digital Library (CDL), as a free service for UC Davis users.
7 |
8 |
9 |
By accepting the data deposit agreement, you acknowledge and agree that:
10 |
11 |
12 |
13 | This platform is intended for use only by UC Davis faculty, graduate students, postdocs, and professional
14 | researchers. Any deposits resulting from unauthorized use will be removed. If you do not hold an affiliation named
15 | above, but you believe you should have access to Dash based on your research contributions and needs,
16 | contact the Data Management Program. Permissions will be granted on a case-by-case basis.
17 |
18 |
19 |
20 | Any data you deposit will not contain any unlawful, private, confidential, or sensitive information.
21 |
22 |
23 |
24 | Any data you deposit will be comprised of your original work, public domain data, or data for which you have the
25 | necessary rights or permissions to deposit consistent with the terms of this agreement.
26 |
27 |
28 |
29 | UC Davis Library and CDL will have access to all content for the purposes of maintaining the system, creating backup
30 | copies, and publicly sharing the data. You grant data curators at the UC Davis Library and CDL the right to review
31 | and enhance the metadata of submitted datasets.
32 |
33 |
34 |
35 | In compliance with best practices in open data, all data deposited in the UC Davis Dash instance will be released
36 | under a CC0 public domain dedication.
37 | You may defer the release of deposited data for up to six months at the time
38 | of submission. At the end of six months, the data will be released under a CC0 dedication unless you actively
39 | request and justify a deferment.
40 |
41 |
42 |
43 | The total space allocation per UC Davis user is 200 GB. If you foresee the need to exceed this size, please contact
44 | the UC Davis Library at dataserv@ucdavis.edu.
45 |
46 |
47 |
48 | Access to the datasets through this repository is intended to last until at least 2027. In the event a decision is
49 | made to discontinue the use of Dash, CDL will transfer the existing data to an alternative repository or otherwise
50 | return them to the submitting party.
51 |
52 |
53 |
54 | Published datasets may not be removed by individual users. Data withdrawal requests and justifications should be
55 | directed to CDL.
56 |
57 |
58 |
59 | UC Davis Library and CDL retain the right to remove any material deemed, in their discretion, inappropriate or out
60 | of the scope of this repository.
61 |
62 |
63 |
64 | You agree to the terms of the CDL Terms of Use and Privacy Policy,
65 | and all applicable UC Davis Library Policies and Procedures.
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 |
3 | use_doorkeeper
4 | # The priority is based upon order of creation: first created -> highest priority.
5 | # See how all your routes lay out with "rake routes".
6 |
7 | root :requirements => { :protocol => 'http' }, :to => redirect(path: APP_CONFIG.stash_mount )
8 |
9 | #root :requirements => { :protocol => 'https' },
10 | # :to => redirect(path: APP_CONFIG.stash_mount, protocol: 'https' )
11 |
12 | #get '/', :requirements => { :protocol => 'http' }, to: redirect(path: APP_CONFIG.stash_mount, protocol: 'http' )
13 |
14 | #get '/', :requirements => { :protocol => 'https' }, to: redirect(path: APP_CONFIG.stash_mount, protocol: 'https' )
15 | # constraints: { protocol: 'https' }
16 |
17 | # You can have the root of your site routed with "root"
18 | #root 'host_pages#index'
19 | # map.redirect '/', controller: '/stash/pages', action: 'home'
20 | #match '/auth/:provider/callback', to: 'host_pages#test', via: [:get, :post]
21 |
22 | # Example of regular route:
23 | # get 'products/:id' => 'catalog#view'
24 |
25 | # Example of named route that can be invoked with purchase_url(id: product.id)
26 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
27 |
28 | # Example resource route (maps HTTP verbs to controller actions automatically):
29 | # resources :products
30 |
31 | # Example resource route with options:
32 | # resources :products do
33 | # member do
34 | # get 'short'
35 | # post 'toggle'
36 | # end
37 | #
38 | # collection do
39 | # get 'sold'
40 | # end
41 | # end
42 |
43 | # Example resource route with sub-resources:
44 | # resources :products do
45 | # resources :comments, :sales
46 | # resource :seller
47 | # end
48 |
49 | # Example resource route with more complex sub-resources:
50 | # resources :products do
51 | # resources :comments
52 | # resources :sales do
53 | # get 'recent', on: :collection
54 | # end
55 | # end
56 |
57 | # Example resource route with concerns:
58 | # concern :toggleable do
59 | # post 'toggle'
60 | # end
61 | # resources :posts, concerns: :toggleable
62 | # resources :photos, concerns: :toggleable
63 |
64 | # Example resource route within a namespace:
65 | # namespace :admin do
66 | # # Directs /admin/products/* to Admin::ProductsController
67 | # # (app/controllers/admin/products_controller.rb)
68 | # resources :products
69 | # end
70 |
71 | # this is a rack way of showing a 404 for some crazy old/speculative link that Google has stuck in its craw
72 | get '/search/facet/dc_creator_sm', to: proc { [410, {}, ['']] }
73 |
74 | mount StashEngine::Engine, at: APP_CONFIG.stash_mount
75 | mount StashDatacite::Engine, at: '/stash_datacite'
76 | mount StashApi::Engine, at: '/api'
77 |
78 | # we have to do this to make the geoblacklight routes come before catchall
79 | # http://blog.arkency.com/2015/02/how-to-split-routes-dot-rb-into-smaller-parts/
80 | #instance_eval(File.read(StashDiscovery::Engine.root.join("config/routes.rb")))
81 |
82 | # get 'xtf/search', to: 'catalog#index'
83 |
84 | get 'xtf/search', :to => redirect { |params, request| "/search?#{request.params.to_query}" }
85 |
86 | # this will route an item at the root of the site into the namespaced engine
87 | get 'sitemap.xml' => "stash_engine/pages#sitemap", :format => "xml", :as => 'sitemap'
88 |
89 | end
90 |
--------------------------------------------------------------------------------
/config/deploy/development.rb:
--------------------------------------------------------------------------------
1 | # server-based syntax
2 | # ======================
3 | # Defines a single server with a list of roles and multiple properties.
4 | # You can define all roles on a single server, or split them:
5 |
6 | # server 'example.com', user: 'deploy', roles: %w{app db web}, my_property: :my_value
7 | # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8 | # server 'db.example.com', user: 'deploy', roles: %w{db}
9 |
10 | set :rails_env, "development"
11 |
12 | # To override the default host, set $SERVER_HOST, e.g.
13 | # $ SERVER_HOST='localhost' bundle exec cap development deploy
14 | set :server_host, ENV["SERVER_HOST"] || 'uc3-dash2-dev.cdlib.org'
15 | server fetch(:server_host), user: 'dash2', roles: %w{web app db}
16 |
17 | #on roles(:all) do |host|
18 | # puts "setting server host: #{host.hostname}"
19 | #end
20 |
21 | #set :passenger_pid, "#{deploy_to}/passenger.pid"
22 | #set :passenger_log, "#{deploy_to}/passenger.log"
23 | #set :passenger_port, "3000"
24 |
25 |
26 | # role-based syntax
27 | # ==================
28 |
29 | # Defines a role with one or multiple servers. The primary server in each
30 | # group is considered to be the first unless any hosts have the primary
31 | # property set. Specify the username and a domain or IP for the server.
32 | # Don't use `:all`, it's a meta role.
33 |
34 | # role :app, %w{deploy@example.com}, my_property: :my_value
35 | # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
36 | # role :db, %w{deploy@example.com}
37 |
38 |
39 |
40 | # Configuration
41 | # =============
42 | # You can set any configuration variable like in config/deploy.rb
43 | # These variables are then only loaded and set in this stage.
44 | # For available Capistrano configuration variables see the documentation page.
45 | # http://capistranorb.com/documentation/getting-started/configuration/
46 | # Feel free to add new variables to customise your setup.
47 |
48 |
49 |
50 | # Custom SSH Options
51 | # ==================
52 | # You may pass any option but keep in mind that net/ssh understands a
53 | # limited set of options, consult the Net::SSH documentation.
54 | # http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
55 | #
56 | # Global options
57 | # --------------
58 | # set :ssh_options, {
59 | # keys: %w(/home/rlisowski/.ssh/id_rsa),
60 | # forward_agent: false,
61 | # auth_methods: %w(password)
62 | # }
63 | #
64 | # The server-based syntax can be used to override options:
65 | # ------------------------------------
66 | # server 'example.com',
67 | # user: 'user_name',
68 | # roles: %w{web app},
69 | # ssh_options: {
70 | # user: 'user_name', # overrides user setting above
71 | # keys: %w(/home/user_name/.ssh/id_rsa),
72 | # forward_agent: false,
73 | # auth_methods: %w(publickey password)
74 | # # password: 'please use keys'
75 | # }
76 |
77 | namespace :deploy do
78 |
79 | #desc 'update local engines to get around requiring version number changes in development'
80 | #task :update_local_engines do
81 | # on roles(:app) do
82 | # my_branch = capture("cat #{deploy_to}/current/branch_info")
83 | #
84 | # %w(stash_datacite stash_engine stash_discovery).each do |engine|
85 | # execute "cd #{deploy_to}/#{engine}; git checkout #{my_branch}; git reset --hard origin/#{my_branch}; git pull"
86 | # end
87 |
88 | # execute "cd #{deploy_to}/stash_datacite; git checkout #{my_branch}; git reset --hard origin/#{my_branch}; git pull"
89 | # execute "cd #{deploy_to}/stash_engine; git checkout #{my_branch}; git reset --hard origin/#{my_branch}; git pull"
90 | # end
91 | #end
92 |
93 | #after :published, :update_local_engines
94 | end
95 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # ######################################################
2 | # Miscellaneous
3 |
4 | # symlinked config files
5 | /config/*.yml
6 | /config/tenants/*.yml
7 | .config-secret/
8 |
9 | # MacOS noise
10 | .DS_Store
11 |
12 | # JetBrains noise
13 | .idea
14 | .raketasks
15 | *.iml
16 |
17 | # Temporary files
18 | public/assets/
19 | public/uploads/
20 | uploads/
21 | test-reports/
22 |
23 | # ######################################################
24 |
25 | #### joe made this: http://goel.io/joe
26 |
27 | #####=== Ruby ===#####
28 |
29 | *.gem
30 | *.rbc
31 | /.config
32 | /coverage/
33 | /InstalledFiles
34 | /pkg/
35 | /spec/reports/
36 | /spec/examples.txt
37 | /test/tmp/
38 | /test/version_tmp/
39 | /tmp/
40 |
41 | # Used by dotenv library to load environment variables.
42 | # .env
43 |
44 | ## Specific to RubyMotion:
45 | .dat*
46 | .repl_history
47 | build/
48 | *.bridgesupport
49 | build-iPhoneOS/
50 | build-iPhoneSimulator/
51 |
52 | ## Specific to RubyMotion (use of CocoaPods):
53 | #
54 | # We recommend against adding the Pods directory to your .gitignore. However
55 | # you should judge for yourself, the pros and cons are mentioned at:
56 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
57 | #
58 | # vendor/Pods/
59 |
60 | ## Documentation cache and generated files:
61 | /.yardoc/
62 | /_yardoc/
63 | /doc/
64 | /rdoc/
65 |
66 | ## Environment normalization:
67 | /.bundle/
68 | /vendor/bundle
69 | /lib/bundler/man/
70 |
71 | # for a library or gem, you might want to ignore these files since the code is
72 | # intended to run in multiple environments; otherwise, check them in:
73 | # Gemfile.lock
74 | # .ruby-version
75 | # .ruby-gemset
76 |
77 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
78 | .rvmrc
79 |
80 | #####=== Rails ===#####
81 |
82 | *.rbc
83 | capybara-*.html
84 | .rspec
85 | /log
86 | /tmp
87 | /db/*.sqlite3
88 | /db/*.sqlite3-journal
89 | /public/system
90 | /coverage/
91 | /spec/tmp
92 | **.orig
93 | rerun.txt
94 | pickle-email-*.html
95 |
96 | # TODO Comment out this rule if you are OK with secrets being uploaded to the repo
97 | config/initializers/secret_token.rb
98 |
99 | # Only include if you have production secrets in this file, which is no longer a Rails default
100 | # config/secrets.yml
101 |
102 | # dotenv
103 | # TODO Comment out this rule if environment variables can be committed
104 | .env
105 |
106 | ## Environment normalization:
107 | /.bundle
108 | /vendor/bundle
109 |
110 | # these should all be checked in to normalize the environment:
111 | # Gemfile.lock, .ruby-version, .ruby-gemset
112 |
113 | # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
114 | .rvmrc
115 |
116 | # if using bower-rails ignore default bower_components path bower.json files
117 | /vendor/assets/bower_components
118 | *.bowerrc
119 | bower.json
120 |
121 | # Ignore pow environment settings
122 | .powenv
123 |
124 | # Ignore Byebug command history file.
125 | .byebug_history
126 |
127 | #####=== Emacs ===#####
128 | # -*- mode: gitignore; -*-
129 | *~
130 | \#*\#
131 | /.emacs.desktop
132 | /.emacs.desktop.lock
133 | *.elc
134 | auto-save-list
135 | tramp
136 | .\#*
137 |
138 | # Org-mode
139 | .org-id-locations
140 | *_archive
141 |
142 | # flymake-mode
143 | *_flymake.*
144 |
145 | # eshell files
146 | /eshell/history
147 | /eshell/lastdir
148 |
149 | # elpa packages
150 | /elpa/
151 |
152 | # reftex files
153 | *.rel
154 |
155 | # AUCTeX auto folder
156 | /auto/
157 |
158 | # cask packages
159 | .cask/
160 | dist/
161 |
162 | # Flycheck
163 | flycheck_*.el
164 |
165 | # server auth directory
166 | /server/
167 |
168 | # projectiles files
169 | .projectile
170 |
171 | # directory configuration
172 | .dir-locals.el
173 |
--------------------------------------------------------------------------------
/app/views/tenants/ucsb/_dda.html.erb:
--------------------------------------------------------------------------------
1 |
Data Deposit Agreement
2 |
3 |
4 | UC Santa Barbara Library is pleased to provide use of
5 | the Dash data repository (Dash), maintained by
6 | California Digital Library (CDL), as a free service
7 | for UC Santa Barbara users.
8 |
9 |
10 |
By accepting the data deposit agreement, you acknowledge and agree to the following:
11 |
12 |
Who may use this service?
13 |
14 |
UCSB faculty, staff, and graduate students.
15 |
16 |
17 |
What may be deposited?
18 |
19 |
Data related to the research and teaching missions of UCSB.
20 |
21 | Deposited data must be your original work, or in the public domain, or for which you have obtained the necessary
22 | rights or permissions to deposit.
23 |
24 |
This repository is intended for final products, not for incomplete or in-progress works.
25 |
26 |
27 |
What may not be deposited?
28 |
29 |
Data containing unlawful, private, confidential, or sensitive information.
30 |
31 |
32 |
Licensing and availability
33 |
34 |
35 | In compliance with best practices in open data, all deposited data will be released under a
36 | CC0 public domain dedication.
37 | (While CC0 does not require attribution, growing community and data citation norms create an expectation that users
38 | will properly cite data in the same manner they would any other form of scholarly communication.)
39 |
40 |
41 | You may defer the release of deposited data for up to six months at the time of submission. At the end of six months,
42 | the data will be released under a CC0 dedication unless you request and justify an additional deferment.
43 |
44 |
45 |
46 |
Limits and limitations
47 |
48 |
There is a limit of 100GB per data publication.
49 |
If you anticipate uploading more than 500GB total, please contact the Data Curation Program first.
50 |
51 | Published datasets may not be removed by users. Data withdrawal requests and justifications should be directed
52 | to the Data Curation Program.
53 |
54 |
55 |
56 |
Retention period
57 |
58 |
59 | Data deposited in this repository will be retained and made accessible (by Dash or equivalent repository) for a
60 | minimum of 10 years from the time of submission. After that time, if continued accessibility of the data is desired
61 | and justified, curators at the UCSB Library will coordinate with the original depositor to transfer the data to an
62 | alternative repository.
63 |
64 |
65 |
66 |
Our rights
67 |
68 |
69 | The UCSB Library and CDL will have access to all content for the purposes of maintaining the system, creating backup
70 | copies, and publicly sharing the data. You grant data curators at the UCSB Library and CDL the right to review and
71 | enhance the metadata of submitted datasets.
72 |
73 |
74 | The UCSB Library and CDL retain the right to remove any material deemed, in their discretion, inappropriate or
75 | out of the scope of this repository.
76 |
77 |
All actions taken by curators will be communicated to the depositor first.
87 |
--------------------------------------------------------------------------------
/documentation/documentation_dump.md:
--------------------------------------------------------------------------------
1 | # Dash Technical Introductory Notes/Documentation Dump
2 |
3 | ## Demo Instance of Dash
4 |
5 | Our demo instance of Dash is available at [https://dashdemo.ucop.edu](https://dashdemo.ucop.edu) (available 7am-7pm Pacific time) and you may submit and test freely.
6 |
7 | ## Github Repositories & Similar
8 |
9 | * The main application for Dash is at [https://github.com/cdluc3/dashv2](https://github.com/cdluc3/dashv2) with minor customizations and configuration for an installation. The bulk of the code lives in the stash repository.
10 |
11 | * The repository at [https://github.com/CDLUC3/stash](https://github.com/CDLUC3/stash) holds most of our code.
12 |
13 | * The stash_engine and stash_datacite engines hold most of the code for the user interface.
14 |
15 | * The stash_api engine is where we've implemented our preliminary API.
16 |
17 | * The stash_discovery engine is a relatively thin wrapper and customization around Geoblacklight.
18 |
19 | * The repository contains some other libraries/gems for things such as sword or harvesting.
20 |
21 | * We have a repository at [https://github.com/cdlib/dash2-config](https://github.com/cdlib/dash2-config) which is private. We can re-derive some example configs from this (since our example is out of date) or give trusted others access to this repo so long as they keep any sensitive information here private.
22 |
23 | * The following repositories are used by or related to more minor aspects of the Dash service under the CDLUC3 workspace on github: dash2-harvester, datacite-mapping, resync-client, dash2-migrator
24 |
25 | * Travis.ci continuous integration builds for many of the Dash subcomponents are available at [https://travis-ci.org/CDLUC3](https://travis-ci.org/CDLUC3) .
26 |
27 | * We need to come up with contribution guidelines such as [Contribution Guidelines for DMPTool](https://github.com/DMPRoadmap/roadmap/blob/development/CONTRIBUTING.md), more to come soon. # TODO
28 |
29 | ## Documentation
30 |
31 | * We have an [installation guide](dash2_install.md) for installing the user-interface part of Dash along with some of the basic depedencies. Sorry, this is a bit out of date and probably needs to be updated but much of the information is still useful.
32 |
33 | * A basic generalized introduction to Dash is available at [https://dash.ucop.edu/stash/about](https://dash.ucop.edu/stash/about) .
34 |
35 | * Operations information (private) [https://confluence.ucop.edu/display/UC3/Stash+Operations](https://confluence.ucop.edu/display/UC3/Stash+Operations)
36 |
37 | * API documentation: [https://github.com/CDLUC3/stash/blob/master/stash_api/basic_submission.md](https://github.com/CDLUC3/stash/blob/master/stash_api/basic_submission.md) and [https://dash.ucop.edu/api/docs/](https://dash.ucop.edu/api/docs/)
38 |
39 | * A database [Entity-Relationship diagram](other_files/dash_er_2018-06.pdf).
40 |
41 | * Note most things are related to stash_engine_resources if you have trouble following all the lines. stash_engine_identifiers has many resources.
42 |
43 | * "dcs" means DataCite Schema
44 |
45 | * [Dataset submission flow](submission_flow.md), one of our longest and more complicated flows. (Login is also somewhat complicated, but people don’t spend a lot of time doing it.)
46 |
47 | * The UI Library from the UX team and how to integrate CSS and major UI changes into the Dash application. [https://github.com/CDLUC3/stash/blob/master/stash_engine/ui-library/README.md](https://github.com/CDLUC3/stash/blob/master/stash_engine/ui-library/README.md)
48 |
49 | * Please see [how to set up and run tests locally](local_testing_setup.md) so you can add tests and run current tests to be sure nothing breaks.
50 |
51 | ## Merritt
52 |
53 | * [Merritt Architecture](https://github.com/CDLUC3/mrt-doc/wiki/Architecture)
54 |
55 | * [Merritt’s low-level storage](https://github.com/CDLUC3/mrt-doc/wiki/Storage)
56 |
57 | ## Development Process
58 |
59 | * Development progress is tracked in the [GitHub CDL-Dryad Development Tracker](https://github.com/CDL-Dryad/dryad-product-roadmap/projects)
60 |
61 |
--------------------------------------------------------------------------------
/lib/tasks/dev_ops.rake:
--------------------------------------------------------------------------------
1 | require 'fileutils'
2 |
3 | # rubocop:disable Metrics/BlockLength
4 | namespace :dev_ops do
5 |
6 | # use like: bundle exec rake dev_ops:processing RAILS_ENV=development
7 | desc 'Shows processing submissions'
8 | task processing: :environment do
9 | unless ENV['RAILS_ENV']
10 | puts 'RAILS_ENV must be explicitly set before running this script'
11 | next
12 | end
13 | in_process = StashEngine::Resource.joins(:current_resource_state).where("stash_engine_resource_states.resource_state = 'processing'")
14 | puts "resource_id\tuser_id\tcurrent_status\tupdated at\ttitle" if in_process.count > 0
15 | in_process.each do |i|
16 | puts "#{i.id}\t#{i.user_id}\t#{i.current_resource_state_id}\t#{i.updated_at}\t#{i.title}"
17 | end
18 | end
19 |
20 | desc 'update unfilled sizes'
21 | task fill_size: :environment do
22 | unless ENV['RAILS_ENV']
23 | puts 'RAILS_ENV must be explicitly set before running this script'
24 | next
25 | end
26 | StashEngine::Identifier.where(storage_size: nil).each do |i|
27 | puts "Adding size to #{i}"
28 | ds_info = Stash::Repo::DatasetInfo.new(i)
29 | i.update(storage_size: ds_info.dataset_size)
30 | end
31 | end
32 |
33 | desc 'fill missing file sizes'
34 | task fill_file_size: :environment do
35 | unless ENV['RAILS_ENV']
36 | puts 'RAILS_ENV must be explicitly set before running this script'
37 | next
38 | end
39 | fus = StashEngine::FileUpload.where(upload_file_size: [0, nil])
40 | fus.each do |file_upload|
41 | resource = file_upload.resource
42 | next unless resource && resource.current_resource_state && resource.current_resource_state.resource_state == 'submitted'
43 | puts "updating resource #{resource.id} & #{resource.identifier}"
44 | ds_info = Stash::Repo::DatasetInfo.new(resource.identifier)
45 | file_upload.update(upload_file_size: ds_info.file_size(file_upload.upload_file_name))
46 | end
47 | end
48 |
49 | desc 'Update the description fields to have html content (generated from text)'
50 | task htmlize: :environment do
51 | require 'script/htmlize_descriptions'
52 |
53 | puts "Are you sure you want to update desciption text to html in #{Rails.env}? (Type 'yes' to proceed, 'no' to preview.)"
54 | response = STDIN.gets
55 | if response.strip.casecmp('YES').zero?
56 | StashDatacite::Description.all.each do |desc|
57 | item = Script::HtmlizeDescriptions.new(desc.description)
58 | next if item.html? || desc.description.blank?
59 | out_html = item.text_as_html
60 | desc.update(description: out_html)
61 | puts "Updated description id: #{desc.id}"
62 | puts out_html
63 | puts ''
64 | end
65 |
66 | else
67 | StashDatacite::Description.all.each do |desc|
68 | item = Script::HtmlizeDescriptions.new(desc.description)
69 | next if item.html? || desc.description.blank?
70 | puts desc.resource.id if desc.resource
71 | puts item.text_as_html
72 | puts ''
73 | end
74 | end
75 | end
76 |
77 | desc 'manually clean up temp files for successfully submitted resources'
78 | task cleanup_staged_files: :environment do
79 | unless ENV['RAILS_ENV']
80 | puts 'RAILS_ENV must be explicitly set before running this script'
81 | next
82 | end
83 | puts "Are you sure you want clean up staging files for #{Rails.env} on this machine? (Type 'yes' to proceed)"
84 | response = STDIN.gets
85 | next unless response.strip.casecmp('YES').zero? # they have to type yes
86 | Dir.glob(Rails.root.join('uploads', '*')).each do |path|
87 | fn = File.basename(path)
88 | next unless File.directory?(path) && fn.match(/^\d+$/)
89 | resources = StashEngine::Resource.where(id: fn)
90 | if resources.count < 1 || resources.first.current_resource_state.resource_state == 'submitted'
91 | puts "Cleaning up resource files #{fn}"
92 | FileUtils.rm_r path
93 | end
94 | end
95 | end
96 |
97 | end
98 | # rubocop:enable Metrics/BlockLength
99 |
--------------------------------------------------------------------------------
/public/images/logo_ucsd.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
48 |
--------------------------------------------------------------------------------
/spec/features/new_dataset_spec.rb:
--------------------------------------------------------------------------------
1 | require 'features_helper'
2 | require 'byebug'
3 |
4 | describe 'new dataset' do
5 | attr_reader :start_new_dataset
6 |
7 | before(:each) do
8 | log_in!
9 | @start_new_dataset = first(:link_or_button, 'Start New Dataset')
10 | expect(start_new_dataset).not_to be_nil
11 | end
12 |
13 | describe 'Start New Dataset' do
14 | before(:each) do
15 | start_new_dataset.click
16 | end
17 |
18 | it 'starts a new dataset' do
19 | expect(page).to have_content('Describe Your Dataset')
20 |
21 | # ##############################
22 | # Title
23 |
24 | title = find_blank_field_id('title')
25 | fill_in title, with: 'Of a peculiar Lead-Ore of Germany, and the Use thereof'
26 |
27 | # ##############################
28 | # Author
29 |
30 | author_first_name = find_field_id('author[author_first_name]')
31 | fill_in author_first_name, with: 'Robert'
32 | author_last_name = find_field_id('author[author_last_name]')
33 | fill_in author_last_name, with: 'Boyle'
34 | author_affiliation = find_field_id('affiliation') # TODO: make consistent with other author fields
35 | fill_in author_affiliation, with: 'Hogwarts'
36 | author_email = find_field_id('author[author_email]')
37 | fill_in author_email, with: 'boyle@hogwarts.edu'
38 |
39 | # TODO: additional author(s)
40 |
41 | # ##############################
42 | # Abstract
43 |
44 | # CKEditor is made up of two parts. A hidden textarea that will contain the value of the input after changes are made
45 | # and an iFrame where the actual editing takes place (in addition to controls and other things)
46 |
47 | abstract = find_blank_ckeditor_id('description_abstract')
48 |
49 | fill_in_ckeditor abstract, with: <<-ABSTRACT
50 | There was, not long since, sent hither out of Germany from
51 | an inquisitive Physician, a List of several Minerals and Earths
52 | of that Country, and of Hungary, together with a Specimen of each
53 | of them.
54 | ABSTRACT
55 |
56 | # ##############################
57 | # Optional fields
58 |
59 | description_divider = find('summary', text: 'Data Description (optional)')
60 | description_divider.click
61 |
62 | # ##############################
63 | # Funding
64 |
65 | # TODO: stop calling this section 'contributor'
66 |
67 | granting_organization = find_blank_field_id('contributor[contributor_name]')
68 | fill_in granting_organization, with: 'Ministry of Magic'
69 |
70 | award_number = find_blank_field_id('contributor[award_number]')
71 | fill_in award_number, with: '9¾'
72 |
73 | # ##############################
74 | # Keywords
75 |
76 | keywords = find_blank_field_id('subject') # TODO: rename field
77 | fill_in keywords, with: 'Optick Glasses'
78 |
79 | # ##############################
80 | # Methods
81 |
82 | methods = find_blank_ckeditor_id('description_methods')
83 |
84 | fill_in_ckeditor methods, with: <<-METHODS
85 | The Stone, according to the Letter of Mr. David Thomas, who sent this account
86 | to Mr. Boyle, is with Doctor Haughteyn of Salisbury, to whom he also referreth
87 | for further information.
88 | METHODS
89 |
90 | # ##############################
91 | # Usage
92 |
93 | usage_notes = find_blank_ckeditor_id('description_other')
94 |
95 | fill_in_ckeditor usage_notes, with: <<-USAGE
96 | 'Tis found in the Upper Palatinate, at a place called Freyung, and there are
97 | two sorts of it, whereof one is a kind of Crystalline Stone, and almost all
98 | good Leads the other not so rich, and more farinaceous.
99 | USAGE
100 |
101 | # ##############################
102 | # Related works
103 |
104 | select 'continues', from: 'related_identifier[relation_type]'
105 | select 'DOI', from: 'related_identifier[related_identifier_type]'
106 | related_identifier = find_blank_field_id('related_identifier[related_identifier]')
107 | fill_in related_identifier, with: 'doi:10.1098/rstl.1665.0007' # TODO: is this the preferred format?
108 |
109 | end
110 | end
111 | end
112 |
--------------------------------------------------------------------------------
/config/environments/development.rb.stagelike:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Code is not reloaded between requests.
5 | config.cache_classes = true
6 |
7 | # Eager load code on boot. This eager loads most of Rails and
8 | # your application in memory, allowing both threaded web servers
9 | # and those relying on copy on write to perform better.
10 | # Rake tasks automatically ignore this option for performance.
11 | config.eager_load = true
12 |
13 | # Full error reports are disabled and caching is turned on.
14 | config.consider_all_requests_local = false
15 | config.action_controller.perform_caching = true
16 |
17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application
18 | # Add `rack-cache` to your Gemfile before enabling this.
19 | # For large-scale production use, consider using a caching reverse proxy like
20 | # NGINX, varnish or squid.
21 | # config.action_dispatch.rack_cache = true
22 |
23 | # Disable serving static files from the `/public` folder by default since
24 | # Apache or NGINX already handles this.
25 | # config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26 | config.serve_static_files = true
27 |
28 | # Compress JavaScripts and CSS.
29 | config.assets.js_compressor = :uglifier
30 | config.assets.css_compressor = :yui
31 |
32 | # Do not fallback to assets pipeline if a precompiled asset is missed.
33 | config.assets.compile = false
34 |
35 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
36 | # yet still be able to expire them through the digest params.
37 | config.assets.digest = true
38 |
39 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
40 |
41 | # Specifies the header that your server uses for sending files.
42 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
43 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
44 |
45 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
46 | # config.force_ssl = true
47 |
48 | # Use the lowest log level to ensure availability of diagnostic information
49 | # when problems arise.
50 | config.log_level = :debug
51 |
52 | # Prepend all log lines with the following tags.
53 | # config.log_tags = [ :subdomain, :uuid ]
54 |
55 | # Use a different logger for distributed setups.
56 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
57 |
58 | # Use a different cache store in production.
59 | # config.cache_store = :mem_cache_store
60 |
61 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
62 | # config.action_controller.asset_host = 'http://assets.example.com'
63 |
64 | # Ignore bad email addresses and do not raise email delivery errors.
65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66 | # config.action_mailer.raise_delivery_errors = false
67 |
68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69 | # the I18n.default_locale when a translation cannot be found).
70 | config.i18n.fallbacks = true
71 |
72 | # Send deprecation notices to registered listeners.
73 | config.active_support.deprecation = :notify
74 |
75 | # Use default logging formatter so that PID and timestamp are not suppressed.
76 | config.log_formatter = ::Logger::Formatter.new
77 |
78 | # Do not dump schema after migrations.
79 | config.active_record.dump_schema_after_migration = false
80 |
81 | Rails.application.config.middleware.use ExceptionNotification::Rack,
82 | :email => {
83 | # :deliver_with => :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
84 | :email_prefix => "[Dash2 Exception]",
85 | :sender_address => %{"Dash2 Notifier" },
86 | :exception_recipients => %w{marisa.strong@ucop.edu scott.fisher@ucop.edu bhavi.vedula@ucop.edu}
87 | }
88 |
89 | config.action_mailer.delivery_method = :sendmail
90 | config.action_mailer.perform_deliveries = true
91 | config.action_mailer.raise_delivery_errors = true
92 | config.action_mailer.default_url_options = { :host => "https://dash2-dev.ucop.edu/stash" }
93 |
94 | end
95 |
--------------------------------------------------------------------------------
/app/assets/images/tenants/logo_ucsd.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
48 |
--------------------------------------------------------------------------------
/config/environments/stage.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Code is not reloaded between requests.
5 | config.cache_classes = true
6 |
7 | # force_ssl causes infinite redirects, only do in apache or rails, not both
8 | #config.force_ssl = true
9 |
10 | # Eager load code on boot. This eager loads most of Rails and
11 | # your application in memory, allowing both threaded web servers
12 | # and those relying on copy on write to perform better.
13 | # Rake tasks automatically ignore this option for performance.
14 | config.eager_load = true
15 |
16 | # Full error reports are disabled and caching is turned on.
17 | config.consider_all_requests_local = false
18 | config.action_controller.perform_caching = true
19 |
20 | # Enable Rack::Cache to put a simple HTTP cache in front of your application
21 | # Add `rack-cache` to your Gemfile before enabling this.
22 | # For large-scale production use, consider using a caching reverse proxy like
23 | # NGINX, varnish or squid.
24 | # config.action_dispatch.rack_cache = true
25 |
26 | # Disable serving static files from the `/public` folder by default since
27 | # Apache or NGINX already handles this.
28 | # config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
29 | config.serve_static_files = true
30 |
31 | # Compress JavaScripts and CSS.
32 | config.assets.js_compressor = :uglifier
33 | config.assets.css_compressor = :yui
34 |
35 | # Do not fallback to assets pipeline if a precompiled asset is missed.
36 | config.assets.compile = false
37 |
38 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
39 | # yet still be able to expire them through the digest params.
40 | config.assets.digest = true
41 |
42 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
43 |
44 | # Specifies the header that your server uses for sending files.
45 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
46 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
47 |
48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
49 | # config.force_ssl = true
50 |
51 | # Use the lowest log level to ensure availability of diagnostic information
52 | # when problems arise.
53 | config.log_level = :info
54 |
55 | # Prepend all log lines with the following tags.
56 | # config.log_tags = [ :subdomain, :uuid ]
57 |
58 | # Use a different logger for distributed setups.
59 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
60 |
61 | # Use a different cache store in production.
62 | # config.cache_store = :mem_cache_store
63 |
64 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
65 | # config.action_controller.asset_host = 'http://assets.example.com'
66 |
67 | # Ignore bad email addresses and do not raise email delivery errors.
68 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
69 | # config.action_mailer.raise_delivery_errors = false
70 |
71 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72 | # the I18n.default_locale when a translation cannot be found).
73 | config.i18n.fallbacks = true
74 |
75 | # Send deprecation notices to registered listeners.
76 | config.active_support.deprecation = :notify
77 |
78 | # Use default logging formatter so that PID and timestamp are not suppressed.
79 | config.log_formatter = ::Logger::Formatter.new
80 |
81 | # Do not dump schema after migrations.
82 | config.active_record.dump_schema_after_migration = false
83 |
84 | Rails.application.config.middleware.use ExceptionNotification::Rack,
85 | :email => {
86 | # :deliver_with => :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
87 | :email_prefix => "[Dash2 Exception]",
88 | :sender_address => %{"Dash2 Notifier" },
89 | :exception_recipients => %w{marisa.strong@ucop.edu scott.fisher@ucop.edu bhavi.vedula@ucop.edu}
90 | },
91 | :error_grouping => true,
92 | :error_grouping_period => 3.hours
93 |
94 | config.action_mailer.delivery_method = :sendmail
95 | config.action_mailer.perform_deliveries = true
96 | config.action_mailer.raise_delivery_errors = true
97 | config.action_mailer.default_url_options = { :host => "https://dash2-stg.ucop.edu/stash" }
98 |
99 | end
100 |
--------------------------------------------------------------------------------
/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Code is not reloaded between requests.
5 | config.cache_classes = true
6 |
7 | # force_ssl causes infinite redirects, only do in apache or rails, not both
8 | #config.force_ssl = true
9 |
10 | # Eager load code on boot. This eager loads most of Rails and
11 | # your application in memory, allowing both threaded web servers
12 | # and those relying on copy on write to perform better.
13 | # Rake tasks automatically ignore this option for performance.
14 | config.eager_load = true
15 |
16 | # Full error reports are disabled and caching is turned on.
17 | config.consider_all_requests_local = false
18 | config.action_controller.perform_caching = true
19 |
20 | # Enable Rack::Cache to put a simple HTTP cache in front of your application
21 | # Add `rack-cache` to your Gemfile before enabling this.
22 | # For large-scale production use, consider using a caching reverse proxy like
23 | # NGINX, varnish or squid.
24 | # config.action_dispatch.rack_cache = true
25 |
26 | # Disable serving static files from the `/public` folder by default since
27 | # Apache or NGINX already handles this.
28 | # config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
29 | config.serve_static_files = true
30 |
31 | # Compress JavaScripts and CSS.
32 | config.assets.js_compressor = :uglifier
33 | config.assets.css_compressor = :yui
34 |
35 | # Do not fallback to assets pipeline if a precompiled asset is missed.
36 | config.assets.compile = false
37 |
38 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
39 | # yet still be able to expire them through the digest params.
40 | config.assets.digest = true
41 |
42 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
43 |
44 | # Specifies the header that your server uses for sending files.
45 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
46 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
47 |
48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
49 | # config.force_ssl = true
50 |
51 | # Use the lowest log level to ensure availability of diagnostic information
52 | # when problems arise.
53 | config.log_level = :warn
54 |
55 | # Prepend all log lines with the following tags.
56 | # config.log_tags = [ :subdomain, :uuid ]
57 |
58 | # Use a different logger for distributed setups.
59 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
60 |
61 | # Use a different cache store in production.
62 | # config.cache_store = :mem_cache_store
63 |
64 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
65 | # config.action_controller.asset_host = 'http://assets.example.com'
66 |
67 | # Ignore bad email addresses and do not raise email delivery errors.
68 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
69 | # config.action_mailer.raise_delivery_errors = false
70 |
71 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72 | # the I18n.default_locale when a translation cannot be found).
73 | config.i18n.fallbacks = true
74 |
75 | # Send deprecation notices to registered listeners.
76 | config.active_support.deprecation = :notify
77 |
78 | # Use default logging formatter so that PID and timestamp are not suppressed.
79 | config.log_formatter = ::Logger::Formatter.new
80 |
81 | # Do not dump schema after migrations.
82 | config.active_record.dump_schema_after_migration = false
83 |
84 | #this is obnoxious because the initializers haven't run yet, so have to duplicate code to read config
85 | ac = YAML.load_file(File.join(Rails.root, 'config', 'app_config.yml'))[Rails.env]
86 | unless ac['page_error_email'].blank?
87 | Rails.application.config.middleware.use ExceptionNotification::Rack,
88 | :email => {
89 | # :deliver_with => :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
90 | :email_prefix => "[Dash Exception]",
91 | :sender_address => %{"Dash Notifier" },
92 | :exception_recipients => ac['page_error_email']
93 | },
94 | :error_grouping => true,
95 | :error_grouping_period => 3.hours
96 | end
97 |
98 | config.action_mailer.delivery_method = :sendmail
99 | config.action_mailer.perform_deliveries = true
100 | config.action_mailer.raise_delivery_errors = true
101 |
102 | end
103 |
--------------------------------------------------------------------------------
/config/environments/demo.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Code is not reloaded between requests.
5 | config.cache_classes = true
6 |
7 | # force_ssl causes infinite redirects, only do in apache or rails, not both
8 | #config.force_ssl = true
9 |
10 | # Eager load code on boot. This eager loads most of Rails and
11 | # your application in memory, allowing both threaded web servers
12 | # and those relying on copy on write to perform better.
13 | # Rake tasks automatically ignore this option for performance.
14 | config.eager_load = true
15 |
16 | # Full error reports are disabled and caching is turned on.
17 | config.consider_all_requests_local = false
18 | config.action_controller.perform_caching = true
19 |
20 | # Enable Rack::Cache to put a simple HTTP cache in front of your application
21 | # Add `rack-cache` to your Gemfile before enabling this.
22 | # For large-scale production use, consider using a caching reverse proxy like
23 | # NGINX, varnish or squid.
24 | # config.action_dispatch.rack_cache = true
25 |
26 | # Disable serving static files from the `/public` folder by default since
27 | # Apache or NGINX already handles this.
28 | # config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
29 | config.serve_static_files = true
30 |
31 | # Compress JavaScripts and CSS.
32 | config.assets.js_compressor = :uglifier
33 | config.assets.css_compressor = :yui
34 |
35 | # Do not fallback to assets pipeline if a precompiled asset is missed.
36 | config.assets.compile = false
37 |
38 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
39 | # yet still be able to expire them through the digest params.
40 | config.assets.digest = true
41 |
42 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
43 |
44 | # Specifies the header that your server uses for sending files.
45 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
46 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
47 |
48 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
49 | # config.force_ssl = true
50 |
51 | # Use the lowest log level to ensure availability of diagnostic information
52 | # when problems arise.
53 | config.log_level = :info
54 |
55 | # Prepend all log lines with the following tags.
56 | # config.log_tags = [ :subdomain, :uuid ]
57 |
58 | # Use a different logger for distributed setups.
59 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
60 |
61 | # Use a different cache store in production.
62 | # config.cache_store = :mem_cache_store
63 |
64 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
65 | # config.action_controller.asset_host = 'http://assets.example.com'
66 |
67 | # Ignore bad email addresses and do not raise email delivery errors.
68 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
69 | # config.action_mailer.raise_delivery_errors = false
70 |
71 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
72 | # the I18n.default_locale when a translation cannot be found).
73 | config.i18n.fallbacks = true
74 |
75 | # Send deprecation notices to registered listeners.
76 | config.active_support.deprecation = :notify
77 |
78 | # Use default logging formatter so that PID and timestamp are not suppressed.
79 | config.log_formatter = ::Logger::Formatter.new
80 |
81 | # Do not dump schema after migrations.
82 | config.active_record.dump_schema_after_migration = false
83 |
84 | #this is obnovious because the initializers haven't run yet, so have to duplicate code to read config
85 | ac = YAML.load_file(File.join(Rails.root, 'config', 'app_config.yml'))[Rails.env]
86 | unless ac['page_error_email'].blank?
87 | Rails.application.config.middleware.use ExceptionNotification::Rack,
88 | :email => {
89 | # :deliver_with => :deliver, # Rails >= 4.2.1 do not need this option since it defaults to :deliver_now
90 | :email_prefix => "[Dash Exception]",
91 | :sender_address => %{"Dash Notifier" },
92 | :exception_recipients => ac['page_error_email']
93 | },
94 | :error_grouping => true,
95 | :error_grouping_period => 3.hours
96 | end
97 |
98 | config.action_mailer.delivery_method = :sendmail
99 | config.action_mailer.perform_deliveries = true
100 | config.action_mailer.raise_delivery_errors = true
101 | config.action_mailer.default_url_options = { :host => "https://dash2-stg.ucop.edu/stash" }
102 |
103 | end
104 |
--------------------------------------------------------------------------------
/documentation/local_testing_setup.md:
--------------------------------------------------------------------------------
1 | # Setting up local testing
2 |
3 | Running tests locally on a development machine means an easier time writing and developing tests, running an individual test and
4 | also not needing to wait for travis.ci to run all tests in order to get results.
5 |
6 | ## Install MySQL if not installed
7 |
8 | ```
9 | # installing MySQL in an Ubuntu Linux distro, make note of any root password you set while installing
10 | sudo apt-get install mysql-server mysql-client libmysqlclient-dev
11 |
12 | # make sure MySQL is started
13 | sudo service mysql start
14 |
15 | # Depends how the MySQL installs, how it lets you in. If not working, try with and without sudo or with password
16 | # to be sure you can get into mysql
17 | sudo mysql -u root
18 |
19 | mysql> CREATE USER 'travis'@'%';
20 |
21 | # If you need to use sudo to get into mysql as a root user, please see instructions at
22 | # https://askubuntu.com/questions/766334/cant-login-as-mysql-user-root-from-normal-user-account-in-ubuntu-16-04/801950
23 | # to allow MySQL root access to the test/dev environment without having to use sudo. Note, MySQL root access should
24 | # be secured on production servers and not left open.
25 |
26 | # the travis_prep.sh script below assumes it can access MySQL root user without a password (or sudo) for setting up a testing environment.
27 | ```
28 |
29 | ## Get Oracle JRE installed if needed
30 |
31 | The OpenJRE did not work correctly with SOLR when I tested, so you may need to install an Oracle runtime.
32 |
33 | ```
34 | sudo add-apt-repository ppa:webupd8team/java
35 | sudo apt-get update
36 |
37 | sudo apt-get install oracle-java8-installer
38 |
39 | # this isn't for Java, but while you're in here, install the Chromium browser which gets automated for testing the UI
40 | sudo apt install -y chromium-browser
41 | ```
42 |
43 | ## Setting up and running tests
44 |
45 | It's usually convenient to run tests just on the part of the application where you have changed code. For example
46 | within an engine or in the main app for overall testing through the UI.
47 |
48 | Each component has a *travis-prep.sh* script for setting up the database for testing that component and it only needs to be run once
49 | if you continue to use the same test database.
50 |
51 | For example, to set up and run the tests in the stash_engine:
52 |
53 | ```
54 | cd stash/stash_engine
55 |
56 | # travis_prep only needs to be done the first time you use a database and sets it up for testing this component
57 | ./travis_prep.sh
58 |
59 | # bundle install if the bundle is not up to date
60 | bundle install
61 |
62 | # note, I had some weird errors after setting up my gems initially and had to reload my shell to get things working
63 |
64 | # this command runs the default rake task, which will run all tests for the component
65 | bundle exec rake
66 | ```
67 |
68 | ## Notes about Rubocop, .ruby-version, Bundler and Rake
69 |
70 | One component of the test suite runs Rubocop which is a style and convention checker. It uses a configuration
71 | file to allow modifications to its generally very strict (and sometimes unintelligent) checking. It also
72 | makes changes to its software and configuration on a fairly frequent basis. Different versions
73 | of Rubocop or for different target Ruby versions
74 | will bring up different suggestions or even bring in Rubocop configuration syntax changes. We've also tried
75 | to keep rubocop versions the same across different components as there is some inheritance of settings.
76 |
77 | You will probably want to run Rubocop outside of the test suite but use the same environment settings as used
78 | by the test suite. It's very common to run *rubocop -a* which will auto-fix (mostly) clear-cut conventions such as
79 | spacing irregularities or similar items. It's also nice to be able to fix problems and re-run rubocop
80 | separately from running the tests, iterating until all style suggestions are fixed or acknowledged.
81 |
82 | By appending *bundle exec* to a Ruby command in context of an application (or gem or engine), it runs that command
83 | in the environment defined for use by that application. It uses the external gems (libraries) and versions indicated in
84 | the Gemfile, pulled in by dependencies and locked in place by the Gemfile.lock. It should keep some random problems
85 | from occuring because of version differences between a gem locally instaled on the computer and an
86 | application-specific gem.
87 |
88 | The hidden .ruby-version file in the root of an application (or engine or gem) does something a little similar to Bundler
89 | but instead of locking a known set of gems and versions in place, it tells the version of Ruby that the application
90 | expects to use. Software such as rbenv or rvm will read this file and can do things such as automatically switching
91 | to using that version of Ruby when cd-ing to that directory (or prompting to install the expected version of Ruby).
92 | Also, some IDEs will look at the file for tailoring suggestions to a specific version of Ruby.
93 |
94 | Rake is a way to define utility or other tasks that might be run (note the similar name to Make). The default task for our
95 | components is to run tests. You can define other rake tasks and specify a task when running Rake to do other things.
96 |
--------------------------------------------------------------------------------
/spec/fixtures/dcs_descriptions.yml:
--------------------------------------------------------------------------------
1 | desc1:
2 | id: 1
3 | description: Recent advances in classical information and highly-available methodologies
4 | are based entirely on the assumption that erasure coding and RPCs are not in conflict
5 | with A* search. Given the current status of interactive algorithms, theorists
6 | particularly desire the investigation of erasure coding, which embodies the private
7 | principles of robotics. Such a hypothesis might seem perverse but is derived from
8 | known results. In order to achieve this purpose, we concentrate our efforts on
9 | verifying that robots and gigabit switches are continuously incompatible.
10 | description_type: abstract
11 | resource_id: 1
12 | created_at: 2017-08-24 21:00:45.000000000 Z
13 | updated_at: 2017-08-24 21:02:03.000000000 Z
14 |
15 | desc2:
16 | id: 2
17 | description: Collected with the SC121 data meter.
18 | description_type: methods
19 | resource_id: 1
20 | created_at: 2017-08-24 21:00:45.000000000 Z
21 | updated_at: 2017-08-24 21:02:57.000000000 Z
22 |
23 | desc3:
24 | id: 3
25 | description: Use correct median of 228.28 when analyzing.
26 | description_type: other
27 | resource_id: 1
28 | created_at: 2017-08-24 21:00:45.000000000 Z
29 | updated_at: 2017-08-24 21:03:23.000000000 Z
30 |
31 | desc4:
32 | id: 4
33 | description: Recent advances in classical information and highly-available methodologies
34 | are based entirely on the assumption that erasure coding and RPCs are not in conflict
35 | with A* search. Given the current status of interactive algorithms, theorists
36 | particularly desire the investigation of erasure coding, which embodies the private
37 | principles of robotics. Such a hypothesis might seem perverse but is derived from
38 | known results. In order to achieve this purpose, we concentrate our efforts on
39 | verifying that robots and gigabit switches are continuously incompatible.
40 | description_type: abstract
41 | resource_id: 2
42 | created_at: 2017-08-24 21:10:18.000000000 Z
43 | updated_at: 2017-08-24 21:10:18.000000000 Z
44 |
45 | desc5:
46 | id: 5
47 | description: Collected with the SC121 data meter.
48 | description_type: methods
49 | resource_id: 2
50 | created_at: 2017-08-24 21:10:18.000000000 Z
51 | updated_at: 2017-08-24 21:10:18.000000000 Z
52 |
53 | desc6:
54 | id: 6
55 | description: Use correct median of 228.28 when analyzing.
56 | description_type: other
57 | resource_id: 2
58 | created_at: 2017-08-24 21:10:18.000000000 Z
59 | updated_at: 2017-08-24 21:10:18.000000000 Z
60 |
61 | desc7:
62 | id: 7
63 | description: Replication must work. After years of confirmed research into simulated
64 | annealing, we confirm the analysis of reinforcement learning. Here, we propose
65 | a novel framework for the exploration of RAID (NotEmotion), disproving that the
66 | well-known psychoacoustic algorithm for the development of context-free grammar
67 | by Nehru et al. [24] is recursively enumerable.
68 | description_type: abstract
69 | resource_id: 3
70 | created_at: 2017-08-24 21:12:10.000000000 Z
71 | updated_at: 2017-08-24 21:13:14.000000000 Z
72 |
73 | desc8:
74 | id: 8
75 | description:
76 | description_type: methods
77 | resource_id: 3
78 | created_at: 2017-08-24 21:12:10.000000000 Z
79 | updated_at: 2017-08-24 21:12:10.000000000 Z
80 |
81 | desc9:
82 | id: 9
83 | description:
84 | description_type: other
85 | resource_id: 3
86 | created_at: 2017-08-24 21:12:10.000000000 Z
87 | updated_at: 2017-08-24 21:12:10.000000000 Z
88 |
89 | desc10:
90 | id: 10
91 | description: Analysts agree that pervasive algorithms are an interesting new topic
92 | in the field of steganography, and end-users concur. Given the current status
93 | of real-time modalities, futurists daringly desire the deployment of symmetric
94 | encryption. Opie, our new framework for linear-time models, is the solution to
95 | all of these issues.
96 | description_type: abstract
97 | resource_id: 4
98 | created_at: 2017-08-24 21:15:49.000000000 Z
99 | updated_at: 2017-08-24 21:16:56.000000000 Z
100 |
101 | desc11:
102 | id: 11
103 | description:
104 | description_type: methods
105 | resource_id: 4
106 | created_at: 2017-08-24 21:15:49.000000000 Z
107 | updated_at: 2017-08-24 21:15:49.000000000 Z
108 |
109 | desc12:
110 | id: 12
111 | description:
112 | description_type: other
113 | resource_id: 4
114 | created_at: 2017-08-24 21:15:49.000000000 Z
115 | updated_at: 2017-08-24 21:15:49.000000000 Z
116 |
117 | desc13:
118 | id: 13
119 | description: Analysts agree that pervasive algorithms are an interesting new topic
120 | in the field of steganography, and end-users concur. Given the current status
121 | of real-time modalities, futurists daringly desire the deployment of symmetric
122 | encryption. Opie, our new framework for linear-time models, is the solution to
123 | all of these issues.
124 | description_type: abstract
125 | resource_id: 5
126 | created_at: 2017-08-24 21:29:13.000000000 Z
127 | updated_at: 2017-08-24 21:29:13.000000000 Z
128 |
129 | desc14:
130 | id: 14
131 | description:
132 | description_type: methods
133 | resource_id: 5
134 | created_at: 2017-08-24 21:29:13.000000000 Z
135 | updated_at: 2017-08-24 21:29:13.000000000 Z
136 |
137 | desc15:
138 | id: 15
139 | description:
140 | description_type: other
141 | resource_id: 5
142 | created_at: 2017-08-24 21:29:13.000000000 Z
143 | updated_at: 2017-08-24 21:29:13.000000000 Z
144 |
--------------------------------------------------------------------------------
/app/views/layouts/_help.html.md:
--------------------------------------------------------------------------------
1 | ## Submission Basics
2 | We have some general reminders and suggestions for publishing your data with Dash:
3 |
4 | - We accept all file formats, although it is good practice to share data using open formats. See the [UK Data Archive](http://www.data-archive.ac.uk/create-manage/format/formats-table) for a list of optimal file formats
5 | - Any data submitted will be under the [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/) or CC0 license. We do not currently support any other license types, nor do we allow for restrictions on data access or use
6 | - It is your responsibility to ensure your data are being shared responsibly and ethically. Please be careful of sharing sensitive data and ensure you are complying with institutional and governmental regulations
7 | - When preparing your complete version of a dataset, remember to collate all relevant explantory documents and metadata. This includes relevant documentation necessary for the re-use and replication of your dataset (e.g., readme.txt files, formal metadata records, or other critical information, etc.)
8 |
9 | Dash has a REST API that allows for download and submission of data. Check out our [documentation](https://dash.ucop.edu/api/docs/index.html) as well as our [How-To Guide](https://github.com/CDLUC3/stash/blob/master/stash_api/basic_submission.md)
10 |
11 |
12 | ## Metadata
13 | Comprehensive data documentation (i.e. metadata) is the key to future understanding of data. Without a thorough description of the context of the data file, the context in which the data were collected, the measurements that were made, and the quality of the data, it is unlikely that the data can be easily discovered, understood, or effectively used. Metadata is important not only to help people understand and make proper use of a data resource, but metadata also makes the resource discoverable (for example through internet searches or data indexing services). Read more about metadata in the [DataONE Primer on Data Management Best Practices](http://www.dataone.org/sites/all/documents/DataONE_BP_Primer_020212.pdf)
14 | (PDF).
15 |
16 | A complete list of our default metadata fields is below. Additional metadata can be uploaded alongside the dataset (e.g., as a readme.txt file). Our default metadata entry form is based on fields from the metadata schema of the DOI issuing agency, DataCite.
17 |
18 | Required Fields:
19 |
20 | - Title : Title of the dataset. Make sure to be as descriptive as possible
21 | - Author(s): Name, email address, institutional affliation of main researcher(s) involved in producing the data. If you include your [ORCID](http://orcid.org), we will request the ORCID registry auto-populate this publication on your ORCID profile
22 | - Abstract: Short description of dataset
23 |
24 | Optional Fields (the more you describe your dataset, the wider the reach):
25 |
26 | - Keyword(s) : Descriptive words that may help others discover your dataset. We recommend that you determine whether your discipline has an existing controlled vocabulary from which to choose your keywords. Please enter as many keywords as applicable
27 | - Methods : Any technical or methodological information that may help others to understand how the data were generated (i.e. equipment/tools/reagents used, or procedures followed)
28 | - Usage Notes : Any technical or methodological information that may help others determine how the data may be properly re-used, replicated, or re-analyzed
29 | - Funding Information : Name of the funding organization that supported creation of the resource, including applicable grant number(s)
30 | - Related Works : Use this field to indicate other resources that are associated with the data. Examples include publications, other datasets, code etc.
31 | - Location information : Include the geo-coordinates or name of the location where your data were generated or the location that is the focus of your research
32 |
33 | ## Upload Methods
34 | We have two different options for uploading your data.
35 | - Upload directly from your computer: by using drag and drop or the upload button. We allow for 10gb of data per DOI to be uploaded this way.
36 | - Upload from a server or the cloud: by entering the URL of the location where data are held on a server, or the sharing link for Box, Dropbox, or Google Drive. We allow for 100gb of data per DOI to be validated and uploaded this way.
37 |
38 | Please note that you may only use one of these two upload methods per version, but you may do subsequent versions of your data publication and utilize different methods of upload this way.
39 |
40 | ## Publication and Citation
41 | - We do allow for you to delay the publication of your data if for the purposes of having a related article under peer review. If you do choose to utilize this feature we allow for up to a maximum of 180 days to delay publication.
42 | - As soon as your data publication is public we recommend citing and publicizing your work with your given DOI.
43 | - If you have edits, additional data, or subsequent related work we recommend versioning your data by using the "update" link. All versions of a dataset will be accessible and kept in the Merritt Repository, but the dataset DOI will always resolve to the newest version.
44 | - For more details about publication with Dash see our [Frequently Asked Questions (FAQ)](/stash/faq/)
45 |
46 | ## Institution, Organization, and Publisher Resources
47 |
48 | - [UC Davis](https://www.library.ucdavis.edu/service/data-management/)
49 | - [UC Berkeley](http://researchdata.berkeley.edu/)
50 | - [UC San Francisco](https://www.library.ucsf.edu/data-science/data/)
51 | - [UC Merced](http://library.ucmerced.edu/digital-curation-and-scholarship/)
52 | - [UC Santa Cruz](http://guides.library.ucsc.edu/datamanagement/)
53 | - [UC Irvine](http://guides.lib.uci.edu/datamanagement/)
54 | - [UC Riverside](https://library.ucr.edu/research-services/managing-your-data/)
55 | - [UC Press: Elementa](https://www.elementascience.org/about/data-guidelines/#deposit-of-primary-data/)
56 |
57 |
--------------------------------------------------------------------------------