elibri_onix_generator 0.1.4 → 0.1.5
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.
- data/lib/elibri_onix_generator/version.rb +1 -1
- data/lib/elibri_onix_generator.rb +30 -10
- metadata +3 -3
@@ -10,7 +10,7 @@ module Elibri
|
|
10
10
|
|
11
11
|
SHORT_TAGS = YAML::load_file(File.dirname(__FILE__) + "/xml_tags.yml")
|
12
12
|
DOC_ORDER = ["record_identifiers", "publishing_status", "product_form", "contributors", "titles", "series_memberships", "measurement",
|
13
|
-
"sale_restrictions", "audience_range", "publisher_info", "extent", "edition", "languages", "epub_details",
|
13
|
+
"sale_restrictions", "territorial_rights", "audience_range", "publisher_info", "extent", "edition", "languages", "epub_details",
|
14
14
|
"texts", "supporting_resources", "subjects", "elibri_extensions"]
|
15
15
|
#"related_products", "supply_details"
|
16
16
|
|
@@ -328,19 +328,36 @@ module Elibri
|
|
328
328
|
tag(:ProductComposition, '00') #lista 2 - Single-item retail product
|
329
329
|
|
330
330
|
if product.product_form_onix_code
|
331
|
-
comment_dictionary "Format produktu", :ProductFormCode, :indent => 10, :kind => [:onix_product_form
|
331
|
+
comment_dictionary "Format produktu", :ProductFormCode, :indent => 10, :kind => [:onix_product_form]
|
332
332
|
tag(:ProductForm, product.product_form_onix_code)
|
333
333
|
end
|
334
334
|
end
|
335
335
|
|
336
336
|
|
337
337
|
# @hidden_tags RecordReference NotificationType ProductIdentifier TitleDetail PublishingDetail ProductComposition
|
338
|
-
# @title
|
338
|
+
# @title E-booki
|
339
339
|
# <strong><EpubTechnicalProtection></strong> Określa typ zabezpieczenia stosowanego przy publikacji e-booka.<br/>
|
340
340
|
#
|
341
341
|
# <strong><ProductFormDetail></strong> zawiera format w jakim rozprowadzany jest e-book.
|
342
342
|
# Aktualnie może przyjąć wartości takie jak:
|
343
|
-
# #{Elibri::ONIX::Dict::Release_3_0::ProductFormDetail::ALL.map(&:name).to_sentence(:last_word_connector => ' lub ')}
|
343
|
+
# #{Elibri::ONIX::Dict::Release_3_0::ProductFormDetail::ALL.map(&:name).to_sentence(:last_word_connector => ' lub ')}<br/>
|
344
|
+
#
|
345
|
+
# @render onix_epub_details_example
|
346
|
+
#
|
347
|
+
# Wydawca może również umieścić informacje o tym, czy pozwala na publikację fragmentu książki, a jeśli tak,
|
348
|
+
# to czy narzuca ograniczenie co do wielkości fragmentu (w ilości znaków albo procentowo). Ta informacja ma tylko wtedy
|
349
|
+
# znaczenie, gdy dystrybutor samodzielnie dokonuje konwersji, a tym samym tworzy ebooka z fragmentem publikacji.
|
350
|
+
# Wydawnictwa, które samodzielnie konwertują książki nie będą publikować tej informacji.<br/>
|
351
|
+
# @render onix_unlimited_book_sample_example
|
352
|
+
# @render onix_prohibited_book_sample_example
|
353
|
+
# @render onix_limited_book_sample_example
|
354
|
+
# <br/>
|
355
|
+
# Wydawnictwa podają też w systemie eLibri informację, czy prawo do sprzedaży ebook-a jest bezterminowe.
|
356
|
+
# W takim przypadku w opisie produktu wystąpi pusty tag <strong><elibri:SaleNotRestricted></strong> (ostatnie trzy przykłady).<br/><br/>
|
357
|
+
# Jeśli wydawca posiada licencję na określony czas, to w opisie produktu wystąpi tag
|
358
|
+
# <strong><elibri:SaleRestrictedTo></strong>, w którym będzie podana data wygaśnięcia licencji (w formacie YYYYMMDD).
|
359
|
+
# Przykład użycia w pierwszym przykładzie.
|
360
|
+
#
|
344
361
|
def export_epub_details!(product)
|
345
362
|
if product.product_form_detail_onix_codes.present? #lista 175
|
346
363
|
comment_dictionary "Dostępne formaty produktu", :ProductFormDetail, :indent => 10, :kind => :onix_epub_details
|
@@ -348,7 +365,7 @@ module Elibri
|
|
348
365
|
tag(:ProductFormDetail, onix_code)
|
349
366
|
end
|
350
367
|
end
|
351
|
-
|
368
|
+
|
352
369
|
if product.digital?
|
353
370
|
if product.epub_technical_protection
|
354
371
|
comment_dictionary "Zabezpieczenie", :EpubTechnicalProtection, :indent => 10, :kind => :onix_epub_details
|
@@ -357,8 +374,7 @@ module Elibri
|
|
357
374
|
|
358
375
|
if product.epub_fragment_info?
|
359
376
|
tag(:EpubUsageConstraint) do
|
360
|
-
|
361
|
-
:EpubUsageType, :indent => 12, :kind => :onix_epub_details
|
377
|
+
comment "Rodzaj ograniczenia - w tym przypadku zawsze dotyczy dostępności fragmentu książki", :indent => 12, :kind => :onix_epub_details
|
362
378
|
tag(:EpubUsageType, Elibri::ONIX::Dict::Release_3_0::EpubUsageType::PREVIEW)
|
363
379
|
|
364
380
|
comment_dictionary "Jaka jest decyzja wydawcy?", :EpubUsageStatus, :indent => 12, :kind => :onix_epub_details
|
@@ -464,11 +480,15 @@ module Elibri
|
|
464
480
|
end
|
465
481
|
end
|
466
482
|
|
467
|
-
# @hidden_tags RecordReference NotificationType ProductIdentifier DescriptiveDetail
|
468
|
-
# @title Terytorialne ograniczenia sprzedaży
|
483
|
+
# @hidden_tags RecordReference NotificationType ProductIdentifier DescriptiveDetail Publisher PublishingStatus
|
484
|
+
# @title Terytorialne ograniczenia sprzedaży.
|
485
|
+
# W tej chwili w systemie eLibri można zastrzec, że sprzedaż książek/ebooków jest ograniczona do terenu Polski,
|
486
|
+
# albo pozwolić na sprzedaż na całym świecie. Poniżej dwa przykłady, jeden dla wyłączości na terenie Polski, drugi
|
487
|
+
# dopuszczający sprzedaż na całym świecie. Informacja o ograniczeniu jest zawarta w obręcie <strong><SalesRights></strong>
|
469
488
|
def export_territorial_rights!(product)
|
470
489
|
tag(:SalesRights) do
|
471
|
-
|
490
|
+
comment "Typ restrykcji - sprzedaż tylko w wymienionym kraju, regionie, zawsze '01'", :kind => :onix_territorial_rights
|
491
|
+
tag(:SalesRightsType, "01")
|
472
492
|
tag(:Territory) do
|
473
493
|
if product.sale_restricted_to_poland?
|
474
494
|
tag(:CountriesIncluded, "PL")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elibri_onix_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 5
|
10
|
+
version: 0.1.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Marcin Urba\xC5\x84ski"
|