elibri_onix_generator 0.4.8 → 0.4.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 890e53d5c02d7c7ea2df8bc59df5d796f2563da7
4
- data.tar.gz: 201618a6f721f235a466695dc2c188c575746b74
2
+ SHA256:
3
+ metadata.gz: 54edee4f4f12797cac83cc7a2d2d621edab2c6ab99825fd0f6d15bb4615a24c5
4
+ data.tar.gz: 86d295e4483a62b47e724b864ba998f643a0ef734d877683196f331669b29d5a
5
5
  SHA512:
6
- metadata.gz: 2ec5a5e67df83d6b39736c228e5ee4fdbe9b04f8920277e6123adc472db8c6bf5908e2bcfe17d169de3f9d3446a0e42afbb626c269e380dc432309bb06f8a541
7
- data.tar.gz: 970546da98ac1672e64d342c2bd853dc4fb9f5100b5564d0031601d9d859b16a8c7673d199f5a6e4580d4a4f770a9544699d3370c92764e2761dd63a80435038
6
+ metadata.gz: db8997a10b54b24f14990e0502c1488a29c39b01cfd0983fdce25ee58eba71bc6fb14c8caf739281277efe3f9e862be27a739092e2b0763de10864856113b9cf
7
+ data.tar.gz: c2224efcb2d06a509af681e9bd4b7b5a90833d998df9e65b80d9efae3c4a403ac7cabf508356bfc9cc8be362d0e90ab0ff41dfc6081b8785ffeaeccc3db2e573
data/README.md ADDED
@@ -0,0 +1,81 @@
1
+ XML Generator gem used by elibri.
2
+
3
+ ```ruby
4
+
5
+ class OnixGenerator
6
+ include Elibri::ONIX::Generator
7
+ end
8
+
9
+ book = OpenStruct.new(
10
+ product_form_onix_code: "BC",
11
+ public?: true,
12
+ publisher_name_for_onix: "Czarne",
13
+ record_reference: "6e9b713797aba6a41c0f",
14
+ notification_type: OpenStruct.new(onix_code: Elibri::ONIX::Dict::Release_3_0::NotificationType::ADVANCED_NOTIFICATION),
15
+ isbn_value: "9788380499997",
16
+ title_parts: [
17
+ OpenStruct.new(level: Elibri::ONIX::Dict::Release_3_0:: TitleType::DISTINCTIVE_TITLE,
18
+ title: "Tragedia na Przełęczy Diatłowa",
19
+ subtitle: "Historia bez końca")
20
+ ],
21
+ authorship_kind: "user_given",
22
+ edition_statement: "wydanie pierwsze",
23
+ contributors: [
24
+ OpenStruct.new(
25
+ role_onix_code: Elibri::ONIX::Dict::Release_3_0::ContributorRole::AUTHOR,
26
+ generated_full_name: "Alice Lugen",
27
+ name: "Alice",
28
+ last_name: "Lugen",
29
+ ),
30
+ ],
31
+ publishing_status_onix_code: Elibri::ONIX::Dict::Release_3_0::PublishingStatusCode::FORTHCOMING,
32
+ publication_date_with_onix_format_code: [ "20200415", Elibri::ONIX::Dict::Release_3_0::DateFormat::YYYYMMDD ],
33
+ attachments: [
34
+ OpenStruct.new(
35
+ onix_resource_mode: Elibri::ONIX::Dict::Release_3_0::ResourceMode::IMAGE,
36
+ attachment_type_code: Elibri::ONIX::Dict::Release_3_0::ResourceContentType::FRONT_COVER,
37
+ updated_at: Time.now,
38
+ url_for_onix: "http://www.elibri.com.pl/system/product_attachments/production/000/157/528/original/3d270120/tragedia_na_przeleczy.jpg"
39
+ ),
40
+ ],
41
+ other_texts: [
42
+ OpenStruct.new(
43
+ text: "<p>\r Pod koniec stycznia 1959 roku grupa turystów...</p>",
44
+ type_onix_code: Elibri::ONIX::Dict::Release_3_0::OtherTextType::MAIN_DESCRIPTION,
45
+ exportable?: true
46
+ )
47
+ ],
48
+ original_title: "",
49
+ languages: [
50
+ OpenStruct.new(
51
+ language_onix_code: "pol",
52
+ role_onix_code: Elibri::ONIX::Dict::Release_3_0::LanguageRole::LANGUAGE_OF_TEXT,
53
+ )
54
+ ],
55
+ kind_of_measurable?: true,
56
+ width: 133,
57
+ height: 215,
58
+ thema_codes_for_onix_with_heading_text: [ "DNP" ],
59
+ series_membership_kind: "user_given",
60
+ series_memberships: [ OpenStruct.new(series_name: "Poza serią") ],
61
+ product_availabilities: [
62
+ OpenStruct.new(
63
+ supplier_role_onix_code: Elibri::ONIX::Dict::Release_3_0::SupplierRole::PUB_TO_RET,
64
+ supplier: OpenStruct.new(name: "Czarne"),
65
+ product_availability_onix_code: Elibri::ONIX::Dict::Release_3_0::ProductAvailabilityType::CONTACT_SUPPLIER,
66
+ price_infos: [
67
+ OpenStruct.new(
68
+ amount: "39.9",
69
+ vat: 5,
70
+ currency_code: "PLN",
71
+ )
72
+ ]
73
+ )
74
+ ]
75
+ )
76
+
77
+
78
+ generator = OnixGenerator.new(book, pure_onix: true)
79
+ puts generator.to_s
80
+
81
+ ```
@@ -1,5 +1,6 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
3
4
  require "elibri_onix_generator/version"
4
5
  require "elibri_onix_generator/model/product"
5
6
  require "elibri_onix_generator/model/contributor"
@@ -79,8 +79,8 @@ module Elibri
79
79
 
80
80
  def attachments
81
81
  if cover_url
82
- [OpenStruct.new({"onix_resource_mode" => "03", "attachment_type_code" => "01",
83
- "file" => OpenStruct.new({ "url" => cover_url })})]
82
+ [OpenStruct.new({"onix_resource_mode" => "03", "attachment_type_code" => "01",
83
+ "url_for_onix" => cover_url, "file" => OpenStruct.new({ "url" => cover_url })})]
84
84
  else
85
85
  []
86
86
  end
@@ -117,7 +117,7 @@ module Elibri
117
117
  publisher_name
118
118
  end
119
119
 
120
- def thema_codes_for_onix
120
+ def thema_codes_for_onix_with_heading_text
121
121
  thema_codes || []
122
122
  end
123
123
 
@@ -1,3 +1,3 @@
1
1
  module ElibriOnixGenerator
2
- VERSION = "0.4.8"
2
+ VERSION = "0.4.53"
3
3
  end