enju_nii 0.1.0.pre8 → 0.1.0.pre9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/enju_nii.rb +5 -0
  3. data/lib/enju_nii/cinii_book.rb +1 -1
  4. data/lib/enju_nii/version.rb +1 -1
  5. data/spec/dummy/app/controllers/application_controller.rb +4 -0
  6. data/spec/dummy/config/application.rb +1 -1
  7. data/spec/dummy/db/development.sqlite3 +0 -0
  8. data/spec/dummy/db/migrate/{001_create_patrons.rb → 001_create_agents.rb} +8 -8
  9. data/spec/dummy/db/migrate/005_create_manifestations.rb +7 -18
  10. data/spec/dummy/db/migrate/012_create_owns.rb +2 -2
  11. data/spec/dummy/db/migrate/015_create_creates.rb +2 -2
  12. data/spec/dummy/db/migrate/047_create_produces.rb +2 -2
  13. data/spec/dummy/db/migrate/077_create_user_groups.rb +12 -0
  14. data/spec/dummy/db/migrate/080_create_library_groups.rb +25 -0
  15. data/spec/dummy/db/migrate/125_create_donates.rb +2 -2
  16. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +2 -2
  17. data/spec/dummy/db/migrate/{20080905191442_create_patron_types.rb → 20080905191442_create_agent_types.rb} +2 -2
  18. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +22 -0
  19. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
  20. data/spec/dummy/db/migrate/{20090812151902_create_patron_relationship_types.rb → 20090812151902_create_agent_relationship_types.rb} +2 -2
  21. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
  22. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
  23. data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +9 -0
  24. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +13 -0
  25. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +11 -0
  26. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +12 -0
  27. data/spec/dummy/db/migrate/20110115022329_add_position_to_library_group.rb +9 -0
  28. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
  29. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +11 -0
  30. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +11 -0
  31. data/spec/dummy/db/migrate/20111020063828_remove_dsbl_from_library_group.rb +11 -0
  32. data/spec/dummy/db/migrate/20111201155456_create_users.rb +0 -5
  33. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +8 -16
  34. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +5 -0
  35. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
  36. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +6 -0
  37. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +5 -0
  38. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +5 -0
  39. data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +6 -0
  40. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +26 -0
  41. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +5 -0
  42. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +7 -0
  43. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +5 -0
  44. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +6 -0
  45. data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +6 -0
  46. data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +6 -0
  47. data/spec/dummy/db/migrate/20130504195916_add_subject_heading_type_id_to_subject.rb +5 -0
  48. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +12 -0
  49. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +14 -0
  50. data/spec/dummy/db/migrate/20130511144310_add_manifestation_id_to_item.rb +5 -0
  51. data/spec/dummy/db/schema.rb +225 -210
  52. data/spec/dummy/db/test.sqlite3 +0 -0
  53. data/spec/fixtures/{patron_types.yml → agent_types.yml} +4 -4
  54. data/spec/fixtures/identifiers.yml +113 -0
  55. data/spec/fixtures/library_groups.yml +33 -0
  56. data/spec/fixtures/manifestations.yml +1883 -0
  57. metadata +95 -59
  58. data/spec/dummy/app/models/role.rb +0 -47
  59. data/spec/dummy/app/models/user_has_role.rb +0 -4
  60. data/spec/dummy/db/migrate/143_create_subject_has_classifications.rb +0 -16
  61. data/spec/dummy/db/migrate/20080606052544_create_work_has_subjects.rb +0 -18
  62. data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +0 -22
  63. data/spec/dummy/db/migrate/20090208044541_create_subject_heading_type_has_subjects.rb +0 -16
  64. data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +0 -13
  65. data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +0 -11
  66. data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +0 -12
  67. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +0 -11
  68. data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +0 -9
  69. data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +0 -9
  70. data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +0 -13
  71. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
  72. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +0 -13
  73. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +0 -5
  74. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +0 -5
  75. data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
  76. data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +0 -9
  77. data/spec/dummy/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +0 -6
  78. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +0 -5
  79. data/spec/dummy/lib/master_model.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37497caead451ebf73b150d1bd4187e7719f1254
4
- data.tar.gz: a4161c15e20e1e98ac437833b7abd27d9f0be772
3
+ metadata.gz: 3b816114b9d3862fee169629d8f509274a4099e4
4
+ data.tar.gz: ba1fd44f9a1b59a2e1763dba450aeae043816823
5
5
  SHA512:
6
- metadata.gz: c8398008cae23b6b889df63d3841cdb2ff4d33dfd7a3da9a8c21f8f9f748986d12717f959653df7f4ee3a4365617f667bd726d0430cc04a012f6aa8783b3abd3
7
- data.tar.gz: 3321518a786224248040821cc0919ec00a834219bd933a0bc53b3cf515b8c241eab919c0bf9356564eb0db60903fca66c6b055d77e644d2d82c9a7b623997921
6
+ metadata.gz: 1fb5b4b0df03b962dca428354c8f9f149236cdc6bc3ff4fecbab7e789e620eec2e93847b12fd030f60c1057ccc23f00c3ddd40af59491ad07d4d8497d54b5edf
7
+ data.tar.gz: 06f07433b63baa9b207b5419982cbedb31c479daf6707af6bf3eb97d5dd949443bdb03e2dcb2793ea612fe6e619edb286dc1109642dd48deb94b1f2dd9b6be91
@@ -13,6 +13,11 @@ module EnjuNii
13
13
  def enju_nii_cinii_books
14
14
  include EnjuNii::CiNiiBook
15
15
  end
16
+
17
+ def import_isbn(isbn)
18
+ manifestation = Manifestation.import_from_ndl_search(:isbn => isbn)
19
+ manifestation
20
+ end
16
21
  end
17
22
  end
18
23
 
@@ -13,7 +13,7 @@ module EnjuNii
13
13
  #end
14
14
 
15
15
  manifestation = Manifestation.find_by_isbn(lisbn.isbn)
16
- return manifestation if manifestation
16
+ return manifestation if manifestation.present?
17
17
 
18
18
  doc = return_rdf(lisbn.isbn)
19
19
  raise EnjuNii::RecordNotFound unless doc
@@ -1,3 +1,3 @@
1
1
  module EnjuNii
2
- VERSION = "0.1.0.pre8"
2
+ VERSION = "0.1.0.pre9"
3
3
  end
@@ -1,3 +1,7 @@
1
1
  class ApplicationController < ActionController::Base
2
2
  protect_from_forgery
3
+
4
+ enju_leaf
5
+ enju_biblio
6
+ enju_library
3
7
  end
@@ -43,5 +43,5 @@ module Dummy
43
43
  end
44
44
  end
45
45
 
46
- require 'enju_biblio'
46
+ require 'enju_leaf'
47
47
  require 'enju_subject'
@@ -1,6 +1,6 @@
1
- class CreatePatrons < ActiveRecord::Migration
1
+ class CreateAgents < ActiveRecord::Migration
2
2
  def change
3
- create_table :patrons do |t|
3
+ create_table :agents do |t|
4
4
  t.integer :user_id
5
5
  t.string :last_name
6
6
  t.string :middle_name
@@ -35,7 +35,7 @@ class CreatePatrons < ActiveRecord::Migration
35
35
  t.datetime :date_of_death
36
36
  t.integer :language_id, :default => 1, :null => false
37
37
  t.integer :country_id, :default => 1, :null => false
38
- t.integer :patron_type_id, :default => 1, :null => false
38
+ t.integer :agent_type_id, :default => 1, :null => false
39
39
  t.integer :lock_version, :default => 0, :null => false
40
40
  t.text :note
41
41
  t.integer :required_role_id, :default => 1, :null => false
@@ -44,10 +44,10 @@ class CreatePatrons < ActiveRecord::Migration
44
44
  t.text :email
45
45
  t.text :url
46
46
  end
47
- add_index :patrons, :user_id, :unique => true
48
- add_index :patrons, :language_id
49
- add_index :patrons, :country_id
50
- add_index :patrons, :required_role_id
51
- add_index :patrons, :full_name
47
+ add_index :agents, :user_id, :unique => true
48
+ add_index :agents, :language_id
49
+ add_index :agents, :country_id
50
+ add_index :agents, :required_role_id
51
+ add_index :agents, :full_name
52
52
  end
53
53
  end
@@ -19,18 +19,11 @@ class CreateManifestations < ActiveRecord::Migration
19
19
  t.integer :height
20
20
  t.integer :width
21
21
  t.integer :depth
22
- t.string :isbn
23
- t.string :isbn10
24
- t.string :wrong_isbn
25
- t.string :nbn
26
- t.string :lccn
27
- t.string :oclc_number
28
- t.string :issn
29
22
  t.integer :price # TODO: 通貨単位
30
23
  t.text :fulltext
31
- t.string :volume_number_list
32
- t.string :issue_number_list
33
- t.string :serial_number_list
24
+ t.string :volume_number_string
25
+ t.string :issue_number_string
26
+ t.string :serial_number_string
34
27
  t.integer :edition
35
28
  t.text :note
36
29
  t.boolean :repository_content, :default => false, :null => false
@@ -41,16 +34,12 @@ class CreateManifestations < ActiveRecord::Migration
41
34
  t.integer :frequency_id, :default => 1, :null => false
42
35
  t.boolean :subscription_master, :default => false, :null => false
43
36
  end
44
- add_index :manifestations, :carrier_type_id
45
- add_index :manifestations, :required_role_id
46
- add_index :manifestations, :isbn
47
- add_index :manifestations, :nbn
48
- add_index :manifestations, :lccn
49
- add_index :manifestations, :oclc_number
50
- add_index :manifestations, :issn
37
+ #add_index :manifestations, :carrier_type_id
38
+ #add_index :manifestations, :required_role_id
51
39
  add_index :manifestations, :access_address
52
- add_index :manifestations, :frequency_id
40
+ #add_index :manifestations, :frequency_id
53
41
  add_index :manifestations, :manifestation_identifier
54
42
  add_index :manifestations, :updated_at
43
+ add_index :manifestations, :date_of_publication
55
44
  end
56
45
  end
@@ -1,12 +1,12 @@
1
1
  class CreateOwns < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :owns do |t|
4
- t.references :patron, :null => false
4
+ t.references :agent, :null => false
5
5
  t.references :item, :null => false
6
6
  t.integer :position
7
7
  t.timestamps
8
8
  end
9
- add_index :owns, :patron_id
9
+ add_index :owns, :agent_id
10
10
  add_index :owns, :item_id
11
11
  end
12
12
  end
@@ -1,12 +1,12 @@
1
1
  class CreateCreates < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :creates do |t|
4
- t.references :patron, :null => false
4
+ t.references :agent, :null => false
5
5
  t.references :work, :null => false
6
6
  t.integer :position
7
7
  t.timestamps
8
8
  end
9
- add_index :creates, :patron_id
9
+ add_index :creates, :agent_id
10
10
  add_index :creates, :work_id
11
11
  end
12
12
  end
@@ -1,12 +1,12 @@
1
1
  class CreateProduces < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :produces do |t|
4
- t.references :patron, :null => false
4
+ t.references :agent, :null => false
5
5
  t.references :manifestation, :null => false
6
6
  t.integer :position
7
7
  t.timestamps
8
8
  end
9
- add_index :produces, :patron_id
9
+ add_index :produces, :agent_id
10
10
  add_index :produces, :manifestation_id
11
11
  end
12
12
  end
@@ -0,0 +1,12 @@
1
+ class CreateUserGroups < ActiveRecord::Migration
2
+ def change
3
+ create_table :user_groups do |t|
4
+ t.string :name, :not_null => true
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+ t.timestamps
9
+ t.datetime :deleted_at
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,25 @@
1
+ class CreateLibraryGroups < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :library_groups do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.string :short_name, :null => false
7
+ t.string :email
8
+ t.text :my_networks
9
+ t.boolean :use_dsbl, :default => false, :null => false
10
+ t.text :dsbl_list
11
+ t.text :login_banner
12
+ t.text :note
13
+ t.integer :valid_period_for_new_user, :default => 365, :null => false
14
+ t.boolean :post_to_union_catalog, :default => false, :null => false
15
+ t.integer :country_id
16
+
17
+ t.timestamps
18
+ end
19
+ add_index :library_groups, :short_name
20
+ end
21
+
22
+ def self.down
23
+ drop_table :library_groups
24
+ end
25
+ end
@@ -1,12 +1,12 @@
1
1
  class CreateDonates < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :donates do |t|
4
- t.integer :patron_id, :null => false
4
+ t.integer :agent_id, :null => false
5
5
  t.integer :item_id, :null => false
6
6
 
7
7
  t.timestamps
8
8
  end
9
- add_index :donates, :patron_id
9
+ add_index :donates, :agent_id
10
10
  add_index :donates, :item_id
11
11
  end
12
12
  end
@@ -1,13 +1,13 @@
1
1
  class CreateRealizes < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :realizes do |t|
4
- t.references :patron, :null => false
4
+ t.references :agent, :null => false
5
5
  t.references :expression, :null => false
6
6
  t.integer :position
7
7
 
8
8
  t.timestamps
9
9
  end
10
- add_index :realizes, :patron_id
10
+ add_index :realizes, :agent_id
11
11
  add_index :realizes, :expression_id
12
12
  end
13
13
  end
@@ -1,6 +1,6 @@
1
- class CreatePatronTypes < ActiveRecord::Migration
1
+ class CreateAgentTypes < ActiveRecord::Migration
2
2
  def change
3
- create_table :patron_types do |t|
3
+ create_table :agent_types do |t|
4
4
  t.string :name, :null => false
5
5
  t.text :display_name
6
6
  t.text :note
@@ -0,0 +1,22 @@
1
+ class CreateAgentImportFiles < ActiveRecord::Migration
2
+ def change
3
+ create_table :agent_import_files do |t|
4
+ t.integer :parent_id
5
+ t.string :content_type
6
+ t.integer :size
7
+ t.integer :user_id
8
+ t.text :note
9
+ t.datetime :executed_at
10
+ t.string :state
11
+ t.string :agent_import_file_name
12
+ t.string :agent_import_content_type
13
+ t.integer :agent_import_file_size
14
+ t.datetime :agent_import_updated_at
15
+
16
+ t.timestamps
17
+ end
18
+ add_index :agent_import_files, :parent_id
19
+ add_index :agent_import_files, :user_id
20
+ add_index :agent_import_files, :state
21
+ end
22
+ end
@@ -6,7 +6,7 @@ class CreateResourceImportFiles < ActiveRecord::Migration
6
6
  t.integer :size
7
7
  t.integer :user_id
8
8
  t.text :note
9
- t.datetime :imported_at
9
+ t.datetime :executed_at
10
10
  t.string :state
11
11
  t.string :resource_import_file_name
12
12
  t.string :resource_import_content_type
@@ -1,6 +1,6 @@
1
- class CreatePatronRelationshipTypes < ActiveRecord::Migration
1
+ class CreateAgentRelationshipTypes < ActiveRecord::Migration
2
2
  def change
3
- create_table :patron_relationship_types do |t|
3
+ create_table :agent_relationship_types do |t|
4
4
  t.string :name, :null => false
5
5
  t.text :display_name
6
6
  t.text :note
@@ -1,7 +1,7 @@
1
1
  class AddDcndlSchema < ActiveRecord::Migration
2
2
  def self.up
3
3
  add_column :manifestations, :title_alternative_transcription, :text
4
- add_column :patrons, :full_name_alternative_transcription, :text
4
+ add_column :agents, :full_name_alternative_transcription, :text
5
5
  add_column :manifestations, :description, :text
6
6
  add_column :manifestations, :abstract, :text
7
7
  add_column :manifestations, :available_at, :timestamp
@@ -14,7 +14,7 @@ class AddDcndlSchema < ActiveRecord::Migration
14
14
 
15
15
  def self.down
16
16
  remove_column :manifestations, :title_alternative_transcription
17
- remove_column :patrons, :full_name_alternative_transcription
17
+ remove_column :agents, :full_name_alternative_transcription
18
18
  remove_column :manifestations, :description
19
19
  remove_column :manifestations, :abstract
20
20
  remove_column :manifestations, :available_at
@@ -0,0 +1,9 @@
1
+ class AddAdminNetworksToLibraryGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :library_groups, :admin_networks, :text
4
+ end
5
+
6
+ def self.down
7
+ remove_column :library_groups, :admin_networks
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddAllowBookmarkExternalUrlToLibraryGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :library_groups, :allow_bookmark_external_url, :boolean, :null => false, :default => false
4
+ end
5
+
6
+ def self.down
7
+ remove_column :library_groups, :allow_bookmark_external_url
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ class CreateAgentRelationships < ActiveRecord::Migration
2
+ def change
3
+ create_table :agent_relationships do |t|
4
+ t.integer :parent_id
5
+ t.integer :child_id
6
+ t.integer :agent_relationship_type_id
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :agent_relationships, :parent_id
11
+ add_index :agent_relationships, :child_id
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ class AddPositionToAgentRelationship < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestation_relationships, :position, :integer
4
+ add_column :agent_relationships, :position, :integer
5
+ end
6
+
7
+ def self.down
8
+ remove_column :agent_relationships, :position
9
+ remove_column :manifestation_relationships, :position
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ class CreateAgentImportResults < ActiveRecord::Migration
2
+ def change
3
+ create_table :agent_import_results do |t|
4
+ t.integer :agent_import_file_id
5
+ t.integer :agent_id
6
+ t.integer :user_id
7
+ t.text :body
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ class AddPositionToLibraryGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :library_groups, :position, :integer
4
+ end
5
+
6
+ def self.down
7
+ remove_column :library_groups, :position
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddUrlToLibraryGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :library_groups, :url, :string, :default => 'http://localhost:3000/'
4
+ end
5
+
6
+ def self.down
7
+ remove_column :library_groups, :url
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class AddBirthDateAndDeathDateToAgent < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :agents, :birth_date, :string
4
+ add_column :agents, :death_date, :string
5
+ end
6
+
7
+ def self.down
8
+ remove_column :agents, :death_date
9
+ remove_column :agents, :birth_date
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class AddValidPeriodForNewUserToUserGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :user_groups, :valid_period_for_new_user, :integer, :default => 0, :null => false
4
+ add_column :user_groups, :expired_at, :timestamp
5
+ end
6
+
7
+ def self.down
8
+ remove_column :user_groups, :valid_period_for_new_user
9
+ remove_column :user_groups, :expired_at
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ class RemoveDsblFromLibraryGroup < ActiveRecord::Migration
2
+ def up
3
+ remove_column :library_groups, :use_dsbl
4
+ remove_column :library_groups, :dsbl_list
5
+ end
6
+
7
+ def down
8
+ add_column :library_groups, :dsbl_list, :text
9
+ add_column :library_groups, :use_dsbl, :boolean
10
+ end
11
+ end