cacofonix 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/.rvmrc +1 -0
- data/.travis.yml +10 -0
- data/CHANGELOG.md +205 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +22 -0
- data/README.md +76 -0
- data/Rakefile +6 -0
- data/TODO +14 -0
- data/bin/onix_extract_codelists +41 -0
- data/cacofonix.gemspec +39 -0
- data/data/9780194351898.xml +74 -0
- data/data/Ashgate Other.xml +382679 -0
- data/data/Bookwise_July_2008.xml +21611 -0
- data/data/Peribo Onix 0408.xml +17051 -0
- data/data/aau.xml +96 -0
- data/data/audience_range.xml +9 -0
- data/data/contributor.xml +6 -0
- data/data/control_chars.xml +74 -0
- data/data/entities.xml +78 -0
- data/data/extra_entities.xml +65 -0
- data/data/header.xml +21 -0
- data/data/header_invalid_sentdate.xml +21 -0
- data/data/hlasep08.xml +24519 -0
- data/data/imprint.xml +5 -0
- data/data/iso_8859_1.xml +58 -0
- data/data/jul.xml +24783 -0
- data/data/language.xml +7 -0
- data/data/market_representation.xml +11 -0
- data/data/measure.xml +6 -0
- data/data/media_file.xml +6 -0
- data/data/no_encoding.xml +78 -0
- data/data/no_xml_declaration.xml +95 -0
- data/data/other_text.xml +5 -0
- data/data/price.xml +5 -0
- data/data/product.xml +79 -0
- data/data/product_identifier.xml +5 -0
- data/data/product_invalid_pubdate.xml +42 -0
- data/data/publisher.xml +5 -0
- data/data/rba_FANT.xml +23 -0
- data/data/reference_with_release_attrib.xml +74 -0
- data/data/sales_restriction.xml +4 -0
- data/data/sales_rights.xml +35 -0
- data/data/sender_identifier.xml +5 -0
- data/data/series.xml +5 -0
- data/data/series_identifier.xml +6 -0
- data/data/short_tags.xml +191 -0
- data/data/short_tags_ivp.xml +231 -0
- data/data/sl_product.xml +81 -0
- data/data/stock.xml +5 -0
- data/data/subject.xml +6 -0
- data/data/supply_detail.xml +18 -0
- data/data/title.xml +6 -0
- data/data/two_products.xml +114 -0
- data/data/usd.xml +175 -0
- data/data/utf_16.xml +0 -0
- data/data/website.xml +6 -0
- data/examples/reader.rb +25 -0
- data/examples/reader_apa.rb +22 -0
- data/examples/writer.rb +13 -0
- data/examples/writer_apa.rb +38 -0
- data/lib/cacofonix.rb +151 -0
- data/lib/cacofonix/codelists/001.rb +16 -0
- data/lib/cacofonix/codelists/002.rb +11 -0
- data/lib/cacofonix/codelists/003.rb +13 -0
- data/lib/cacofonix/codelists/005.rb +20 -0
- data/lib/cacofonix/codelists/006.rb +82 -0
- data/lib/cacofonix/codelists/007.rb +129 -0
- data/lib/cacofonix/codelists/008.rb +13 -0
- data/lib/cacofonix/codelists/009.rb +13 -0
- data/lib/cacofonix/codelists/010.rb +52 -0
- data/lib/cacofonix/codelists/011.rb +17 -0
- data/lib/cacofonix/codelists/012.rb +17 -0
- data/lib/cacofonix/codelists/013.rb +13 -0
- data/lib/cacofonix/codelists/014.rb +10 -0
- data/lib/cacofonix/codelists/015.rb +19 -0
- data/lib/cacofonix/codelists/016.rb +12 -0
- data/lib/cacofonix/codelists/017.rb +96 -0
- data/lib/cacofonix/codelists/018.rb +11 -0
- data/lib/cacofonix/codelists/019.rb +13 -0
- data/lib/cacofonix/codelists/020.rb +7 -0
- data/lib/cacofonix/codelists/021.rb +39 -0
- data/lib/cacofonix/codelists/022.rb +15 -0
- data/lib/cacofonix/codelists/023.rb +19 -0
- data/lib/cacofonix/codelists/024.rb +17 -0
- data/lib/cacofonix/codelists/025.rb +35 -0
- data/lib/cacofonix/codelists/026.rb +86 -0
- data/lib/cacofonix/codelists/027.rb +90 -0
- data/lib/cacofonix/codelists/028.rb +14 -0
- data/lib/cacofonix/codelists/029.rb +25 -0
- data/lib/cacofonix/codelists/030.rb +22 -0
- data/lib/cacofonix/codelists/031.rb +9 -0
- data/lib/cacofonix/codelists/032.rb +8 -0
- data/lib/cacofonix/codelists/033.rb +43 -0
- data/lib/cacofonix/codelists/034.rb +21 -0
- data/lib/cacofonix/codelists/035.rb +12 -0
- data/lib/cacofonix/codelists/036.rb +9 -0
- data/lib/cacofonix/codelists/037.rb +12 -0
- data/lib/cacofonix/codelists/038.rb +43 -0
- data/lib/cacofonix/codelists/039.rb +14 -0
- data/lib/cacofonix/codelists/040.rb +12 -0
- data/lib/cacofonix/codelists/041.rb +12 -0
- data/lib/cacofonix/codelists/042.rb +22 -0
- data/lib/cacofonix/codelists/043.rb +12 -0
- data/lib/cacofonix/codelists/044.rb +22 -0
- data/lib/cacofonix/codelists/045.rb +19 -0
- data/lib/cacofonix/codelists/046.rb +15 -0
- data/lib/cacofonix/codelists/047.rb +10 -0
- data/lib/cacofonix/codelists/048.rb +17 -0
- data/lib/cacofonix/codelists/049.rb +91 -0
- data/lib/cacofonix/codelists/050.rb +14 -0
- data/lib/cacofonix/codelists/051.rb +36 -0
- data/lib/cacofonix/codelists/052.rb +7 -0
- data/lib/cacofonix/codelists/053.rb +10 -0
- data/lib/cacofonix/codelists/054.rb +29 -0
- data/lib/cacofonix/codelists/055.rb +23 -0
- data/lib/cacofonix/codelists/056.rb +8 -0
- data/lib/cacofonix/codelists/057.rb +11 -0
- data/lib/cacofonix/codelists/058.rb +29 -0
- data/lib/cacofonix/codelists/059.rb +13 -0
- data/lib/cacofonix/codelists/060.rb +8 -0
- data/lib/cacofonix/codelists/061.rb +9 -0
- data/lib/cacofonix/codelists/062.rb +11 -0
- data/lib/cacofonix/codelists/063.rb +7 -0
- data/lib/cacofonix/codelists/064.rb +19 -0
- data/lib/cacofonix/codelists/065.rb +34 -0
- data/lib/cacofonix/codelists/066.rb +10 -0
- data/lib/cacofonix/codelists/067.rb +8 -0
- data/lib/cacofonix/codelists/068.rb +22 -0
- data/lib/cacofonix/codelists/069.rb +10 -0
- data/lib/cacofonix/codelists/070.rb +8 -0
- data/lib/cacofonix/codelists/071.rb +16 -0
- data/lib/cacofonix/codelists/072.rb +13 -0
- data/lib/cacofonix/codelists/073.rb +42 -0
- data/lib/cacofonix/codelists/074.rb +495 -0
- data/lib/cacofonix/codelists/075.rb +8 -0
- data/lib/cacofonix/codelists/076.rb +18 -0
- data/lib/cacofonix/codelists/077.rb +25 -0
- data/lib/cacofonix/codelists/078.rb +173 -0
- data/lib/cacofonix/codelists/079.rb +25 -0
- data/lib/cacofonix/codelists/080.rb +26 -0
- data/lib/cacofonix/codelists/081.rb +45 -0
- data/lib/cacofonix/codelists/082.rb +23 -0
- data/lib/cacofonix/codelists/083.rb +74 -0
- data/lib/cacofonix/codelists/084.rb +16 -0
- data/lib/cacofonix/codelists/085.rb +29 -0
- data/lib/cacofonix/codelists/086.rb +11 -0
- data/lib/cacofonix/codelists/087.rb +12 -0
- data/lib/cacofonix/codelists/088.rb +7 -0
- data/lib/cacofonix/codelists/089.rb +7 -0
- data/lib/cacofonix/codelists/090.rb +17 -0
- data/lib/cacofonix/codelists/091.rb +257 -0
- data/lib/cacofonix/codelists/092.rb +14 -0
- data/lib/cacofonix/codelists/093.rb +19 -0
- data/lib/cacofonix/codelists/094.rb +9 -0
- data/lib/cacofonix/codelists/095.rb +9 -0
- data/lib/cacofonix/codelists/096.rb +191 -0
- data/lib/cacofonix/codelists/097.rb +7 -0
- data/lib/cacofonix/codelists/098.rb +27 -0
- data/lib/cacofonix/codelists/099.rb +30 -0
- data/lib/cacofonix/codelists/100.rb +12 -0
- data/lib/cacofonix/codelists/101.rb +8 -0
- data/lib/cacofonix/codelists/102.rb +9 -0
- data/lib/cacofonix/codelists/121.rb +164 -0
- data/lib/cacofonix/codelists/138.rb +12 -0
- data/lib/cacofonix/codelists/139.rb +76 -0
- data/lib/cacofonix/codelists/140.rb +13 -0
- data/lib/cacofonix/codelists/141.rb +16 -0
- data/lib/cacofonix/codelists/142.rb +18 -0
- data/lib/cacofonix/codelists/143.rb +13 -0
- data/lib/cacofonix/codelists/144.rb +12 -0
- data/lib/cacofonix/codelists/145.rb +13 -0
- data/lib/cacofonix/codelists/146.rb +9 -0
- data/lib/cacofonix/codelists/147.rb +16 -0
- data/lib/cacofonix/codelists/148.rb +9 -0
- data/lib/cacofonix/codelists/149.rb +10 -0
- data/lib/cacofonix/codelists/150.rb +130 -0
- data/lib/cacofonix/codelists/151.rb +13 -0
- data/lib/cacofonix/codelists/152.rb +8 -0
- data/lib/cacofonix/codelists/153.rb +20 -0
- data/lib/cacofonix/codelists/154.rb +15 -0
- data/lib/cacofonix/codelists/155.rb +11 -0
- data/lib/cacofonix/codelists/156.rb +10 -0
- data/lib/cacofonix/codelists/157.rb +10 -0
- data/lib/cacofonix/codelists/158.rb +32 -0
- data/lib/cacofonix/codelists/159.rb +12 -0
- data/lib/cacofonix/codelists/160.rb +10 -0
- data/lib/cacofonix/codelists/161.rb +9 -0
- data/lib/cacofonix/codelists/162.rb +12 -0
- data/lib/cacofonix/codelists/163.rb +17 -0
- data/lib/cacofonix/codelists/164.rb +11 -0
- data/lib/cacofonix/codelists/165.rb +9 -0
- data/lib/cacofonix/codelists/166.rb +9 -0
- data/lib/cacofonix/codelists/167.rb +9 -0
- data/lib/cacofonix/codelists/168.rb +8 -0
- data/lib/cacofonix/codelists/169.rb +9 -0
- data/lib/cacofonix/codelists/170.rb +7 -0
- data/lib/cacofonix/codelists/171.rb +8 -0
- data/lib/cacofonix/codelists/172.rb +7 -0
- data/lib/cacofonix/codelists/173.rb +8 -0
- data/lib/cacofonix/codelists/174.rb +8 -0
- data/lib/cacofonix/codelists/175.rb +206 -0
- data/lib/cacofonix/codelists/176.rb +20 -0
- data/lib/cacofonix/codelists/177.rb +8 -0
- data/lib/cacofonix/codelists/178.rb +24 -0
- data/lib/cacofonix/codelists/179.rb +7 -0
- data/lib/cacofonix/codelists/184.rb +11 -0
- data/lib/cacofonix/core/code.rb +106 -0
- data/lib/cacofonix/core/element.rb +275 -0
- data/lib/cacofonix/core/header.rb +45 -0
- data/lib/cacofonix/core/lists.rb +108 -0
- data/lib/cacofonix/core/reader.rb +166 -0
- data/lib/cacofonix/core/writer.rb +123 -0
- data/lib/cacofonix/elements/addressee_identifier.rb +6 -0
- data/lib/cacofonix/elements/agent_identifier.rb +6 -0
- data/lib/cacofonix/elements/audience.rb +8 -0
- data/lib/cacofonix/elements/audience_range.rb +15 -0
- data/lib/cacofonix/elements/batch_bonus.rb +7 -0
- data/lib/cacofonix/elements/bible.rb +12 -0
- data/lib/cacofonix/elements/complexity.rb +7 -0
- data/lib/cacofonix/elements/conference.rb +14 -0
- data/lib/cacofonix/elements/conference_sponsor.rb +8 -0
- data/lib/cacofonix/elements/conference_sponsor_identifier.rb +6 -0
- data/lib/cacofonix/elements/contained_item.rb +6 -0
- data/lib/cacofonix/elements/content_item.rb +21 -0
- data/lib/cacofonix/elements/contributor.rb +19 -0
- data/lib/cacofonix/elements/copyright_owner.rb +8 -0
- data/lib/cacofonix/elements/copyright_owner_identifier.rb +6 -0
- data/lib/cacofonix/elements/copyright_statement.rb +7 -0
- data/lib/cacofonix/elements/discount_coded.rb +8 -0
- data/lib/cacofonix/elements/extent.rb +8 -0
- data/lib/cacofonix/elements/identifier.rb +7 -0
- data/lib/cacofonix/elements/illustrations.rb +8 -0
- data/lib/cacofonix/elements/imprint.rb +9 -0
- data/lib/cacofonix/elements/language.rb +8 -0
- data/lib/cacofonix/elements/location_identifier.rb +8 -0
- data/lib/cacofonix/elements/main_subject.rb +9 -0
- data/lib/cacofonix/elements/market_date.rb +8 -0
- data/lib/cacofonix/elements/market_representation.rb +18 -0
- data/lib/cacofonix/elements/measure.rb +8 -0
- data/lib/cacofonix/elements/media_file.rb +16 -0
- data/lib/cacofonix/elements/name.rb +6 -0
- data/lib/cacofonix/elements/name_base.rb +17 -0
- data/lib/cacofonix/elements/new_supplier.rb +12 -0
- data/lib/cacofonix/elements/not_for_sale.rb +13 -0
- data/lib/cacofonix/elements/on_order_detail.rb +7 -0
- data/lib/cacofonix/elements/other_text.rb +17 -0
- data/lib/cacofonix/elements/page_run.rb +7 -0
- data/lib/cacofonix/elements/person_date.rb +8 -0
- data/lib/cacofonix/elements/person_name_identifier.rb +6 -0
- data/lib/cacofonix/elements/price.rb +46 -0
- data/lib/cacofonix/elements/prize.rb +10 -0
- data/lib/cacofonix/elements/product.rb +155 -0
- data/lib/cacofonix/elements/product_base.rb +61 -0
- data/lib/cacofonix/elements/product_classification.rb +8 -0
- data/lib/cacofonix/elements/product_form_feature.rb +8 -0
- data/lib/cacofonix/elements/product_identifier.rb +6 -0
- data/lib/cacofonix/elements/professional_affiliation.rb +7 -0
- data/lib/cacofonix/elements/publisher.rb +11 -0
- data/lib/cacofonix/elements/reissue.rb +9 -0
- data/lib/cacofonix/elements/related_product.rb +6 -0
- data/lib/cacofonix/elements/religious_text.rb +8 -0
- data/lib/cacofonix/elements/religious_text_feature.rb +8 -0
- data/lib/cacofonix/elements/sales_outlet.rb +7 -0
- data/lib/cacofonix/elements/sales_outlet_identifier.rb +6 -0
- data/lib/cacofonix/elements/sales_restriction.rb +7 -0
- data/lib/cacofonix/elements/sales_rights.rb +13 -0
- data/lib/cacofonix/elements/sender_identifier.rb +6 -0
- data/lib/cacofonix/elements/series.rb +11 -0
- data/lib/cacofonix/elements/series_identifier.rb +6 -0
- data/lib/cacofonix/elements/set.rb +13 -0
- data/lib/cacofonix/elements/stock.rb +16 -0
- data/lib/cacofonix/elements/stock_quantity_coded.rb +8 -0
- data/lib/cacofonix/elements/subject.rb +13 -0
- data/lib/cacofonix/elements/supplier_identifier.rb +6 -0
- data/lib/cacofonix/elements/supply_detail.rb +37 -0
- data/lib/cacofonix/elements/text_item.rb +11 -0
- data/lib/cacofonix/elements/text_item_identifier.rb +6 -0
- data/lib/cacofonix/elements/title.rb +11 -0
- data/lib/cacofonix/elements/website.rb +8 -0
- data/lib/cacofonix/elements/work_identifier.rb +6 -0
- data/lib/cacofonix/utils/code_list_extractor.rb +112 -0
- data/lib/cacofonix/utils/normaliser.rb +125 -0
- data/lib/cacofonix/version.rb +5 -0
- data/lib/cacofonix/wrappers/apa_product.rb +748 -0
- data/lib/cacofonix/wrappers/simple_product.rb +49 -0
- data/support/entities.txt +1499 -0
- data/support/extract.rb +25 -0
- data/support/switch-onix-2.1-short-to-reference.xsl +24 -0
- data/support/switch-onix-tagnames-1.1.xsl +25 -0
- data/support/switch-onix-tagnames-2.0.xsl +37 -0
- metadata +438 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Audience < Cacofonix::Element
|
4
|
+
xml_name "Audience"
|
5
|
+
onix_code_from_list :audience_code_type, "AudienceCodeType", :list => 29
|
6
|
+
xml_accessor :audience_code_type_name, "AudienceCodeTypeName"
|
7
|
+
xml_accessor :audience_code_value, "AudienceCodeValue"
|
8
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::AudienceRange < Cacofonix::Element
|
4
|
+
xml_name "AudienceRange"
|
5
|
+
onix_code_from_list :audience_range_qualifier, "AudienceRangeQualifier", :list => 30
|
6
|
+
onix_codes_from_list :audience_range_precisions, "AudienceRangePrecision", :list => 31
|
7
|
+
xml_accessor :audience_range_values, :from => "AudienceRangeValue", :as => [Integer]
|
8
|
+
# TODO: element AudienceRange: validity error :
|
9
|
+
# Element AudienceRange content does not follow the DTD, expecting
|
10
|
+
# (AudienceRangeQualifier , AudienceRangePrecision , AudienceRangeValue ,
|
11
|
+
# (AudienceRangePrecision , AudienceRangeValue)?),
|
12
|
+
# got
|
13
|
+
# (AudienceRangeQualifier AudienceRangePrecision AudienceRangePrecision
|
14
|
+
# AudienceRangeValue AudienceRangeValue )
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Bible < Cacofonix::Element
|
4
|
+
xml_name "Bible"
|
5
|
+
onix_codes_from_list :bible_contents, "BibleContents", :list => 82
|
6
|
+
onix_codes_from_list :bible_versions, "BibleVersion", :list => 83
|
7
|
+
onix_code_from_list :study_bible_type, "StudyBibleType", :list => 84
|
8
|
+
onix_codes_from_list :bible_purposes, "BiblePurpose", :list => 85
|
9
|
+
onix_code_from_list :bible_text_organization, "BibleTextOrganization", :list => 86
|
10
|
+
onix_code_from_list :bible_reference_location, "BibleReferenceLocation", :list => 87
|
11
|
+
onix_codes_from_list :bible_text_features, "BibleTextFeature", :list => 97
|
12
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Conference < Cacofonix::Element
|
4
|
+
xml_name "Conference"
|
5
|
+
onix_code_from_list :conference_role, "ConferenceRole", :list => 20
|
6
|
+
xml_accessor :conference_name, :from => "ConferenceName"
|
7
|
+
xml_accessor :conference_acronym, :from => "ConferenceAcronym"
|
8
|
+
xml_accessor :conference_number, :from => "ConferenceNumber"
|
9
|
+
xml_accessor :conference_theme, :from => "ConferenceTheme"
|
10
|
+
xml_accessor :conference_date, :from => "ConferenceDate"
|
11
|
+
xml_accessor :conference_place, :from => "ConferencePlace"
|
12
|
+
onix_composite :conference_sponsors, Cacofonix::ConferenceSponsor
|
13
|
+
onix_composite :websites, Cacofonix::Website
|
14
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::ConferenceSponsor < Cacofonix::Element
|
4
|
+
xml_name "ConferenceSponsor"
|
5
|
+
onix_composite :conference_sponsor_identifiers, Cacofonix::ConferenceSponsorIdentifier
|
6
|
+
xml_accessor :person_name, :from => "PersonName"
|
7
|
+
xml_accessor :corporate_name, :from => "CorporateName"
|
8
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::ContentItem < Cacofonix::Element
|
4
|
+
xml_name "ContentItem"
|
5
|
+
xml_accessor :level_sequence_number, :from => "LevelSequenceNumber"
|
6
|
+
onix_composite :text_item, Cacofonix::TextItem
|
7
|
+
onix_composite :website, Cacofonix::Website
|
8
|
+
xml_accessor :component_type_name, :from => "ComponentTypeName"
|
9
|
+
xml_accessor :component_number, :from => "ComponentNumber"
|
10
|
+
xml_accessor :distinctive_title, :from => "DistinctiveTitle"
|
11
|
+
onix_composite :titles, Cacofonix::Title
|
12
|
+
onix_composite :work_identifiers, Cacofonix::WorkIdentifier
|
13
|
+
onix_composite :contributors, Cacofonix::Contributor
|
14
|
+
xml_accessor :contributor_statement, :from => "ContributorStatement"
|
15
|
+
onix_composite :subjects, Cacofonix::Subject
|
16
|
+
onix_composite :person_as_subjects, Cacofonix::Contributor
|
17
|
+
xml_accessor :corporate_body_as_subject, :from => "CorporateBodyAsSubject", :as => []
|
18
|
+
xml_accessor :place_as_subject, :from => "PlaceAsSubject", :as => []
|
19
|
+
onix_composite :other_texts, Cacofonix::OtherText
|
20
|
+
onix_composite :media_files, Cacofonix::MediaFile
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Contributor < Cacofonix::NameBase
|
4
|
+
xml_name "Contributor"
|
5
|
+
xml_accessor :sequence_number, :from => "SequenceNumber", :as => Integer
|
6
|
+
onix_code_from_list :contributor_role, "ContributorRole", :list => 17
|
7
|
+
onix_code_from_list :language_code, "LanguageCode", :list => 74
|
8
|
+
xml_accessor :sequence_number_within_role, :from => "SequenceNumberWithinRole", :as => Integer
|
9
|
+
onix_composite :names, Cacofonix::Name
|
10
|
+
onix_composite :person_dates, Cacofonix::PersonDate
|
11
|
+
onix_composite :professional_affiliations, Cacofonix::ProfessionalAffiliation
|
12
|
+
xml_accessor :corporate_name, :from => "CorporateName"
|
13
|
+
xml_accessor :biographical_note, :from => "BiographicalNote"
|
14
|
+
onix_composite :websites, Cacofonix::Website
|
15
|
+
xml_accessor :contributor_description, :from => "ContributorDescription"
|
16
|
+
onix_code_from_list :unnamed_persons, "UnnamedPersons", :list => 19
|
17
|
+
onix_spaced_codes_from_list :country_codes, "CountryCode", :list => 91
|
18
|
+
onix_spaced_codes_from_list :region_codes, "RegionCode", :list => 49
|
19
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::CopyrightOwner < Cacofonix::Element
|
4
|
+
xml_name "CopyrightOwner"
|
5
|
+
onix_composite :copyright_owner_identifier, Cacofonix::CopyrightOwnerIdentifier, :singular => true
|
6
|
+
xml_accessor :person_name, :from => "PersonName"
|
7
|
+
xml_accessor :corporate_name, :from => "CorporateName"
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::DiscountCoded < Cacofonix::Element
|
4
|
+
xml_name "DiscountCoded"
|
5
|
+
onix_code_from_list :discount_code_type, "DiscountCodeType", :list => 100
|
6
|
+
xml_accessor :discount_code_type_name, :from => "DiscountCodeTypeName"
|
7
|
+
xml_accessor :discount_code
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Extent < Cacofonix::Element
|
4
|
+
xml_name "Extent"
|
5
|
+
onix_code_from_list :extent_type, "ExtentType", :list => 23
|
6
|
+
xml_accessor :extent_value, :from => "ExtentValue"
|
7
|
+
onix_code_from_list :extent_unit, "ExtentUnit", :list => 24
|
8
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Illustrations < Cacofonix::Element
|
4
|
+
xml_name "Illustrations"
|
5
|
+
onix_code_from_list :illustration_type, "IllustrationType", :list => 25
|
6
|
+
xml_accessor :illustration_type_description, :from => "IllustrationTypeDescription"
|
7
|
+
xml_accessor :number, :from => "Number", :as => Integer
|
8
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Imprint < Cacofonix::Element
|
4
|
+
xml_name "Imprint"
|
5
|
+
onix_code_from_list :name_code_type, "NameCodeType", :list => 44
|
6
|
+
xml_accessor :name_code_type_name, :from => "NameCodeTypeName"
|
7
|
+
xml_accessor :name_code_value, :from => "NameCodeValue"
|
8
|
+
xml_accessor :imprint_name, :from => "ImprintName"
|
9
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Language < Cacofonix::Element
|
4
|
+
xml_name "Language"
|
5
|
+
onix_code_from_list :language_role, "LanguageRole", :list => 22
|
6
|
+
onix_code_from_list :language_code, "LanguageCode", :list => 74
|
7
|
+
onix_code_from_list :country_code, "CountryCode", :list => 91
|
8
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::MainSubject < Cacofonix::Element
|
4
|
+
xml_name "MainSubject"
|
5
|
+
onix_code_from_list :main_subject_scheme_identifier, "MainSubjectSchemeIdentifier", :list => 26
|
6
|
+
xml_accessor :subject_scheme_version, :from => "SubjectSchemeVersion"
|
7
|
+
xml_accessor :subject_code, :from => "SubjectCode"
|
8
|
+
xml_accessor :subject_heading_text, :from => "SubjectHeadingText"
|
9
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::MarketDate < Cacofonix::Element
|
4
|
+
xml_name "MarketDate"
|
5
|
+
onix_code_from_list :market_date_role, "MarketDateRole", :list => 67
|
6
|
+
onix_code_from_list :date_format, "DateFormat", :list => 55
|
7
|
+
onix_date_accessor :date, "Date"
|
8
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::MarketRepresentation < Cacofonix::Element
|
4
|
+
xml_name "MarketRepresentation"
|
5
|
+
onix_composite :agent_identifiers, Cacofonix::AgentIdentifier
|
6
|
+
xml_accessor :agent_name, :from => "AgentName"
|
7
|
+
xml_accessor :telephone_number, :from => "TelephoneNumber"
|
8
|
+
xml_accessor :fax_number, :from => "FaxNumber"
|
9
|
+
xml_accessor :email_address, :from => "EmailAddress"
|
10
|
+
onix_composite :websites, Cacofonix::Website
|
11
|
+
onix_code_from_list :agent_role, "AgentRole", :list => 69
|
12
|
+
onix_spaced_codes_from_list :market_countries, "MarketCountry", :list => 91
|
13
|
+
onix_spaced_codes_from_list :market_territories, "MarketTerritory", :list => 49
|
14
|
+
onix_spaced_codes_from_list :market_countries_excluded, "MarketCountryExcluded", :list => 91
|
15
|
+
xml_accessor :market_restriction_detail, :from => "MarketRestrictionDetail"
|
16
|
+
onix_code_from_list :market_publishing_status, "MarketPublishingStatus", :list => 68
|
17
|
+
onix_composite :market_dates, Cacofonix::MarketDate
|
18
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::Measure < Cacofonix::Element
|
4
|
+
xml_name "Measure"
|
5
|
+
onix_code_from_list :measure_type_code, "MeasureTypeCode", :list => 48
|
6
|
+
xml_accessor :measurement, :from => "Measurement", :as => BigDecimal
|
7
|
+
xml_accessor :measure_unit_code, :from => "MeasureUnitCode"
|
8
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::MediaFile < Cacofonix::Element
|
4
|
+
xml_name "MediaFile"
|
5
|
+
onix_code_from_list :media_file_type_code, "MediaFileTypeCode", :list => 38
|
6
|
+
onix_code_from_list :media_file_format_code, "MediaFileFormatCode", :list => 39
|
7
|
+
xml_accessor :image_resolution, :from => "ImageResolution"
|
8
|
+
onix_code_from_list :media_file_link_type_code, "MediaFileLinkTypeCode", :list => 40
|
9
|
+
xml_accessor :media_file_link, :from => "MediaFileLink"
|
10
|
+
xml_accessor :text_with_download, :from => "TextWithDownload"
|
11
|
+
xml_accessor :download_caption, :from => "DownloadCaption"
|
12
|
+
xml_accessor :download_credit, :from => "DownloadCredit"
|
13
|
+
xml_accessor :download_copyright_notice, :from => "DownloadCopyrightNotice"
|
14
|
+
xml_accessor :download_terms, :from => "DownloadTerms"
|
15
|
+
onix_date_accessor :media_file_date, "MediaFileDate"
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# This is the abstract base class of Name and Contributor.
|
4
|
+
#
|
5
|
+
class Cacofonix::NameBase < Cacofonix::Element
|
6
|
+
xml_accessor :person_name, :from => "PersonName"
|
7
|
+
xml_accessor :person_name_inverted, :from => "PersonNameInverted"
|
8
|
+
xml_accessor :titles_before_names, :from => "TitlesBeforeNames"
|
9
|
+
xml_accessor :names_before_key, :from => "NamesBeforeKey"
|
10
|
+
xml_accessor :prefix_to_key, :from => "PrefixToKey"
|
11
|
+
xml_accessor :key_names, :from => "KeyNames"
|
12
|
+
xml_accessor :names_after_key, :from => "NamesAfterKey"
|
13
|
+
xml_accessor :suffix_to_key, :from => "SuffixToKey"
|
14
|
+
xml_accessor :letters_after_names, :from => "LettersAfterNames"
|
15
|
+
xml_accessor :titles_after_names, :from => "TitlesAfterNames"
|
16
|
+
onix_composite :person_name_identifiers, Cacofonix::PersonNameIdentifier
|
17
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::NewSupplier < Cacofonix::Element
|
4
|
+
xml_name "NewSupplier"
|
5
|
+
xml_accessor :supplier_ean_location_number, :from => "SupplierEANLocationNumber"
|
6
|
+
xml_accessor :supplier_san, :from => "SupplierSAN"
|
7
|
+
onix_composite :supplier_identifiers, Cacofonix::SupplierIdentifier
|
8
|
+
xml_accessor :supplier_name, :from => "SupplierName"
|
9
|
+
xml_accessor :telephone_number, :from => "TelephoneNumber"
|
10
|
+
xml_accessor :fax_number, :from => "FaxNumber"
|
11
|
+
xml_accessor :email_address, :from => "EmailAddress"
|
12
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
# See also: SalesRights. ONIX 2.1 prefers NotForSale blocks if a product is
|
4
|
+
# not for sale, but this can also be specified with SalesRightsType in
|
5
|
+
# SalesRights.
|
6
|
+
#
|
7
|
+
class Cacofonix::NotForSale < Cacofonix::Element
|
8
|
+
xml_name "NotForSale"
|
9
|
+
onix_spaced_codes_from_list :rights_countries, "RightsCountry", :list => 91
|
10
|
+
onix_spaced_codes_from_list :rights_territories, "RightsTerritory", :list => 49
|
11
|
+
onix_composite :product_identifiers, Cacofonix::ProductIdentifier
|
12
|
+
xml_accessor :publisher_name, :from => "PublisherName"
|
13
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::OtherText < Cacofonix::Element
|
4
|
+
xml_name "OtherText"
|
5
|
+
onix_code_from_list :text_type_code, "TextTypeCode", :list => 33
|
6
|
+
onix_code_from_list :text_format, "TextFormat", :list => 34
|
7
|
+
xml_accessor :text_format, :from => "TextFormat"
|
8
|
+
xml_accessor :text, :from => "Text"
|
9
|
+
onix_code_from_list :text_link_type, "TextLinkType", :list => 35
|
10
|
+
xml_accessor :text_link, :from => "TextLink"
|
11
|
+
xml_accessor :text_author, :from => "TextAuthor"
|
12
|
+
xml_accessor :text_source_corporate, :from => "TextSourceCorporate"
|
13
|
+
xml_accessor :text_source_title, :from => "TextSourceTitle"
|
14
|
+
onix_date_accessor :text_publication_date, "TextPublicationDate"
|
15
|
+
onix_date_accessor :start_date, "StartDate"
|
16
|
+
onix_date_accessor :end_date, "EndDate"
|
17
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
class Cacofonix::PersonDate < Cacofonix::Element
|
4
|
+
xml_name "PersonDate"
|
5
|
+
onix_code_from_list :person_date_role, "PersonDateRole", :list => 75
|
6
|
+
onix_code_from_list :date_format, "DateFormat", :list => 55
|
7
|
+
xml_accessor :date, :from => "Date"
|
8
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module Cacofonix
|
4
|
+
class Price < Cacofonix::Element
|
5
|
+
xml_name "Price"
|
6
|
+
|
7
|
+
|
8
|
+
def self.onix_decimal_accessor(name, tag_name)
|
9
|
+
options = {
|
10
|
+
:from => tag_name,
|
11
|
+
:as => BigDecimal,
|
12
|
+
:to_xml => Cacofonix::Formatters.decimal
|
13
|
+
}
|
14
|
+
xml_accessor(name, options)
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
onix_code_from_list :price_type_code, "PriceTypeCode", :list => 58
|
19
|
+
onix_code_from_list :price_type_qualifier, "PriceTypeQualifier", :list => 59
|
20
|
+
xml_accessor :price_type_description, :from => "PriceTypeDescription"
|
21
|
+
onix_code_from_list :price_per, "PricePer", :list => 60
|
22
|
+
xml_accessor :minimum_order_qty, :from => "MinimumOrderQuantity", :as => Integer
|
23
|
+
onix_composite :batch_bonuses, Cacofonix::BatchBonus
|
24
|
+
xml_accessor :class_of_trade, :from => "ClassOfTradeCode"
|
25
|
+
xml_accessor :bic_discount_group_code, :from => "BICDiscountGroupCode"
|
26
|
+
onix_composite :discount_codeds, Cacofonix::DiscountCoded
|
27
|
+
onix_decimal_accessor :discount_percentage, "DiscountPercentage"
|
28
|
+
onix_code_from_list :price_status, "PriceStatus", :list => 61
|
29
|
+
onix_decimal_accessor :price_amount, "PriceAmount"
|
30
|
+
onix_code_from_list :currency_code, "CurrencyCode", :list => 96
|
31
|
+
onix_spaced_codes_from_list :country_codes, "CountryCode", :list => 91
|
32
|
+
onix_spaced_codes_from_list :territories, "Territory", :list => 49
|
33
|
+
onix_spaced_codes_from_list :countries_excluded, "CountryExcluded", :list => 91
|
34
|
+
onix_spaced_codes_from_list :territories_excluded, "TerritoryExcluded", :list => 49
|
35
|
+
onix_code_from_list :tax_rate_code_1, "TaxRateCode1", :list => 62
|
36
|
+
onix_decimal_accessor :tax_rate_percent_1, "TaxRatePercent1"
|
37
|
+
onix_decimal_accessor :taxable_amount_1, "TaxableAmount1"
|
38
|
+
onix_decimal_accessor :tax_amount_1, "TaxAmount1"
|
39
|
+
onix_code_from_list :tax_rate_code_2, "TaxRateCode2", :list => 62
|
40
|
+
onix_decimal_accessor :tax_rate_percent_2, "TaxRatePercent2"
|
41
|
+
onix_decimal_accessor :taxable_amount_2, "TaxableAmount2"
|
42
|
+
onix_decimal_accessor :tax_amount_2, "TaxAmount2"
|
43
|
+
onix_date_accessor :price_effective_from, "PriceEffectiveFrom"
|
44
|
+
onix_date_accessor :price_effective_until, "PriceEffectiveUntil"
|
45
|
+
end
|
46
|
+
end
|