Class: SiSU_Metadata::Summary
- Inherits:
-
Object
- Object
- SiSU_Metadata::Summary
- Includes:
- SiSU_Parts_XML
- Defined in:
- lib/sisu/shared_metadata.rb
Instance Attribute Summary collapse
-
#attrib ⇒ Object
Returns the value of attribute attrib.
-
#class ⇒ Object
Returns the value of attribute class.
-
#inf ⇒ Object
Returns the value of attribute inf.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
- #added_to_site ⇒ Object
- #amp ⇒ Object
- #audio ⇒ Object
- #author ⇒ Object
- #available ⇒ Object
- #bold ⇒ Object
- #br ⇒ Object
- #breaks ⇒ Object
- #char_enc(str) ⇒ Object
- #classify ⇒ Object
- #contributor ⇒ Object
- #copyright ⇒ Object
- #coverage ⇒ Object
- #created ⇒ Object
- #creator ⇒ Object
- #date ⇒ Object
- #dewey ⇒ Object
- #digitization ⇒ Object
- #digitized_by ⇒ Object
- #edition ⇒ Object
- #emphasis ⇒ Object
- #head ⇒ Object
- #headings ⇒ Object
- #html_display ⇒ Object
- #illustrations ⇒ Object
- #illustrator ⇒ Object
-
#initialize(md, display_heading = false) ⇒ Summary
constructor
A new instance of Summary.
- #isbn ⇒ Object
- #issued ⇒ Object
- #italics ⇒ Object
- #json ⇒ Object
- #language ⇒ Object
- #language_char ⇒ Object
- #license ⇒ Object
-
#loc ⇒ Object
def identifier if defined? @md.classify.identifier \ and @md.classify.identifier ‘ :identifier: ’ + @md.classify.identifier else nil end end.
- #main ⇒ Object
- #make ⇒ Object
- #manpage ⇒ Object
- #meta_content_clean(content = '') ⇒ Object
- #meta_para ⇒ Object
- #metadata ⇒ Object
- #metadata_alt ⇒ Object
- #metadata_base ⇒ Object
- #metadata_tags ⇒ Object
- #modified ⇒ Object
- #note ⇒ Object
- #num_top ⇒ Object
- #oclc ⇒ Object
- #odf ⇒ Object
- #pg ⇒ Object
- #photographer ⇒ Object
- #photographs ⇒ Object
- #plaintext ⇒ Object
- #prepared_by ⇒ Object
- #processing_tags ⇒ Object
- #published ⇒ Object
- #relation ⇒ Object
- #rights ⇒ Object
- #short ⇒ Object
- #sub ⇒ Object
- #subject ⇒ Object
- #texpdf_font ⇒ Object
- #text ⇒ Object
- #title ⇒ Object
- #topic_register ⇒ Object
- #translation ⇒ Object
- #translator ⇒ Object
- #type ⇒ Object
- #utf8 ⇒ Object
- #valid ⇒ Object
- #xhtml_display ⇒ Object
- #xhtml_scroll ⇒ Object
- #xml_docbook ⇒ Object
- #xml_dom ⇒ Object
- #xml_sax ⇒ Object
Methods included from SiSU_Parts_XML
#_url_path_image_base, #band1, #band2, #banner_band, #black, #blue_ink, #blue_tinge, #grey, #grey_medium, #grey_pale, #home_button_only, #ico, #png_home, #png_home_button, #set_face, #set_fonts, #table1, #table2, #the_banner, #the_color, #the_font, #the_line_break, #the_png, #the_table_close, #the_url_decoration, #txt_close, #txt_open, #white, #xml_close, #xml_open, #yellow_light
Methods included from SiSU_Parts_Generic
#footer_signature, #home, #home_txt, #i_choice, #i_home_button, #i_ico, #i_new, #rl_root, #root_http, #sisu, #sisu_txt, #sisudoc, #site, #the_icon, #the_text, #the_url, #txt_home, #txt_hp, #txt_hp_alias, #txt_signature, #urify, #url_close, #url_open
Constructor Details
#initialize(md, display_heading = false) ⇒ Summary
Returns a new instance of Summary.
61 62 63 64 |
# File 'lib/sisu/shared_metadata.rb', line 61 def initialize(md,display_heading=false) @md,@display_heading=md,display_heading @tag,@inf,@class,@attrib=nil end |
Instance Attribute Details
#attrib ⇒ Object
Returns the value of attribute attrib.
60 61 62 |
# File 'lib/sisu/shared_metadata.rb', line 60 def attrib @attrib end |
#class ⇒ Object
Returns the value of attribute class.
60 61 62 |
# File 'lib/sisu/shared_metadata.rb', line 60 def class @class end |
#inf ⇒ Object
Returns the value of attribute inf.
60 61 62 |
# File 'lib/sisu/shared_metadata.rb', line 60 def inf @inf end |
#tag ⇒ Object
Returns the value of attribute tag.
60 61 62 |
# File 'lib/sisu/shared_metadata.rb', line 60 def tag @tag end |
Instance Method Details
#added_to_site ⇒ Object
723 724 725 726 727 728 729 |
# File 'lib/sisu/shared_metadata.rb', line 723 def added_to_site if defined? @md.date.added_to_site \ and @md.date.added_to_site ' :added_to_site: ' + @md.date.added_to_site else nil end end |
#amp ⇒ Object
785 786 787 788 789 790 791 |
# File 'lib/sisu/shared_metadata.rb', line 785 def amp if @s \ and @s.is_a?(String) @s=@s.gsub(/&/u,'&') end @s end |
#audio ⇒ Object
539 540 541 542 543 544 545 546 547 548 549 550 |
# File 'lib/sisu/shared_metadata.rb', line 539 def audio x=if defined? @md.creator.audio_detail \ and @md.creator.audio_detail x='' @md.creator.audio_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :audio: ' + x else nil end end |
#author ⇒ Object
479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/sisu/shared_metadata.rb', line 479 def x=if defined? @md.creator. \ and @md.creator. x='' @md.creator..each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :author: ' + x else nil end end |
#available ⇒ Object
730 731 732 733 734 735 736 |
# File 'lib/sisu/shared_metadata.rb', line 730 def available if defined? @md.date.available \ and @md.date.available ' :available: ' + @md.date.available else nil end end |
#bold ⇒ Object
397 398 399 400 401 402 403 |
# File 'lib/sisu/shared_metadata.rb', line 397 def bold if defined? @md.make.bold \ and @md.make.bold ' :bold: ' + @md.make.bold[:regx].inspect else nil end end |
#br ⇒ Object
792 793 794 795 796 797 798 |
# File 'lib/sisu/shared_metadata.rb', line 792 def br if @s \ and @s.is_a?(String) @s=@s.gsub(/(?:#{Mx[:br_line]}|\\\\)+/,'<br />') end @s end |
#breaks ⇒ Object
377 378 379 380 381 382 383 384 385 386 387 388 389 |
# File 'lib/sisu/shared_metadata.rb', line 377 def breaks x=if defined? @md.make.breaks \ and @md.make.breaks x=' :breaks:' if @md.make.breaks[:page_break] x +=' break=' + @md.make.breaks[:page_break] + ';' end if @md.make.breaks[:page_new] x +=' new=' + @md.make.breaks[:page_new] + ';' end else nil end end |
#char_enc(str) ⇒ Object
783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 |
# File 'lib/sisu/shared_metadata.rb', line 783 def char_enc(str) @s=str def amp if @s \ and @s.is_a?(String) @s=@s.gsub(/&/u,'&') end @s end def br if @s \ and @s.is_a?(String) @s=@s.gsub(/(?:#{Mx[:br_line]}|\\\\)+/,'<br />') end @s end def utf8 if @s \ and @s.is_a?(String) @s=@s.gsub(/<br(?: \/)?>/u,Mx[:br_paragraph]). gsub(/</um,'<').gsub(/>/um,'>'). #gsub(/</um,'<').gsub(/>/um,'>'). gsub(/ /um,' '). # space identify gsub(/ /um,' '). # space identify gsub(/#{Mx[:br_paragraph]}/u,'<br />') end @s end self end |
#classify ⇒ Object
635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 |
# File 'lib/sisu/shared_metadata.rb', line 635 def classify def head '@classify:' end def coverage if defined? @md.classify.coverage \ and @md.classify.coverage ' :coverage: ' + @md.classify.coverage else nil end end def relation if defined? @md.classify.relation \ and @md.classify.relation ' :relation: ' + @md.classify.relation else nil end end def subject if defined? @md.classify.subject \ and @md.classify.subject ' :subject: ' + @md.classify.subject else nil end end def topic_register if defined? @md.classify.topic_register \ and @md.classify.topic_register ' :topic_register: ' + @md.classify.topic_register else nil end end def type # if defined? @md.classify.type \ # and @md.classify.type # ' :type: ' + @md.classify.type # else nil # end nil end #def identifier # if defined? @md.classify.identifier \ # and @md.classify.identifier # ' :identifier: ' + @md.classify.identifier # else nil # end #end def loc if defined? @md.classify.loc \ and @md.classify.loc ' :loc: ' + @md.classify.loc else nil end end def dewey if defined? @md.classify.dewey \ and @md.classify.dewey ' :dewey: ' + @md.classify.dewey else nil end end def oclc if defined? @md.classify.oclc \ and @md.classify.oclc ' :oclc: ' + @md.classify.oclc else nil end end def pg if defined? @md.classify.pg \ and @md.classify.pg ' :pg: ' + @md.classify.pg else nil end end def isbn if defined? @md.classify.isbn \ and @md.classify.isbn ' :isbn: ' + @md.classify.isbn else nil end end self end |
#contributor ⇒ Object
491 492 493 494 495 496 497 498 499 500 501 502 |
# File 'lib/sisu/shared_metadata.rb', line 491 def contributor x=if defined? @md.creator.contributor_detail \ and @md.creator.contributor_detail x='' @md.creator.contributor_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :contributor: ' + x else nil end end |
#copyright ⇒ Object
581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 |
# File 'lib/sisu/shared_metadata.rb', line 581 def copyright def text if defined? @md.rights.copyright.text \ and @md.rights.copyright.text ' :copyright: ' + @md.rights.copyright.text else nil end end def translation if defined? @md.rights.copyright.translation \ and @md.rights.copyright.translation ' :translation: ' + @md.rights.copyright.translation else nil end end def illustrations if defined? @md.rights.copyright.illustrations \ and @md.rights.copyright.illustrations ' :illustrations: ' + @md.rights.copyright.illustrations else nil end end def photographs if defined? @md.rights.copyright.photographs \ and @md.rights.copyright.photographs ' :photographs: ' + @md.rights.copyright.photographs else nil end end def digitization if defined? @md.rights.copyright.digitization \ and @md.rights.copyright.digitization ' :digitization: ' + @md.rights.copyright.digitization else nil end end def audio if defined? @md.rights.copyright.audio \ and @md.rights.copyright.audio ' :audio: ' + @md.rights.copyright.audio else nil end end self end |
#coverage ⇒ Object
639 640 641 642 643 644 645 |
# File 'lib/sisu/shared_metadata.rb', line 639 def coverage if defined? @md.classify.coverage \ and @md.classify.coverage ' :coverage: ' + @md.classify.coverage else nil end end |
#created ⇒ Object
737 738 739 740 741 742 743 |
# File 'lib/sisu/shared_metadata.rb', line 737 def created if defined? @md.date.created \ and @md.date.created ' :created: ' + @md.date.created else nil end end |
#creator ⇒ Object
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/sisu/shared_metadata.rb', line 475 def creator def head '@creator:' end def x=if defined? @md.creator. \ and @md.creator. x='' @md.creator..each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :author: ' + x else nil end end def contributor x=if defined? @md.creator.contributor_detail \ and @md.creator.contributor_detail x='' @md.creator.contributor_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :contributor: ' + x else nil end end def illustrator x=if defined? @md.creator.illustrator_detail \ and @md.creator.illustrator_detail x='' @md.creator.illustrator_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :illustrator: ' + x else nil end end def photographer x=if defined? @md.creator.photographer_detail \ and @md.creator.photographer_detail x='' @md.creator.photographer_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :photographer: ' + x else nil end end def translator x=if defined? @md.creator.translator_detail \ and @md.creator.translator_detail x='' @md.creator.translator_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :translator: ' + x else nil end end def audio x=if defined? @md.creator.audio_detail \ and @md.creator.audio_detail x='' @md.creator.audio_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :audio: ' + x else nil end end def digitized_by x=if defined? @md.creator.digitized_by_detail \ and @md.creator.digitized_by_detail x='' @md.creator.digitized_by_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :digitized_by: ' + x else nil end end def prepared_by x=if defined? @md.creator.prepared_by_detail \ and @md.creator.prepared_by_detail x='' @md.creator.prepared_by_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :prepared_by: ' + x else nil end end self end |
#date ⇒ Object
719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 |
# File 'lib/sisu/shared_metadata.rb', line 719 def date def head '@date:' end def added_to_site if defined? @md.date.added_to_site \ and @md.date.added_to_site ' :added_to_site: ' + @md.date.added_to_site else nil end end def available if defined? @md.date.available \ and @md.date.available ' :available: ' + @md.date.available else nil end end def created if defined? @md.date.created \ and @md.date.created ' :created: ' + @md.date.created else nil end end def issued if defined? @md.date.issued \ and @md.date.issued ' :issued: ' + @md.date.issued else nil end end def modified if defined? @md.date.modified \ and @md.date.modified ' :modified: ' + @md.date.modified else nil end end def published if defined? @md.date.published \ and @md.date.published ' :published: ' + @md.date.published else nil end end def valid if defined? @md.date.valid \ and @md.date.valid ' :valid: ' + @md.date.valid else nil end end self end |
#dewey ⇒ Object
689 690 691 692 693 694 695 |
# File 'lib/sisu/shared_metadata.rb', line 689 def dewey if defined? @md.classify.dewey \ and @md.classify.dewey ' :dewey: ' + @md.classify.dewey else nil end end |
#digitization ⇒ Object
610 611 612 613 614 615 616 |
# File 'lib/sisu/shared_metadata.rb', line 610 def digitization if defined? @md.rights.copyright.digitization \ and @md.rights.copyright.digitization ' :digitization: ' + @md.rights.copyright.digitization else nil end end |
#digitized_by ⇒ Object
551 552 553 554 555 556 557 558 559 560 561 562 |
# File 'lib/sisu/shared_metadata.rb', line 551 def digitized_by x=if defined? @md.creator.digitized_by_detail \ and @md.creator.digitized_by_detail x='' @md.creator.digitized_by_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :digitized_by: ' + x else nil end end |
#edition ⇒ Object
438 439 440 441 442 443 444 |
# File 'lib/sisu/shared_metadata.rb', line 438 def edition if defined? @md.title.edition \ and @md.title.edition ' :edition: ' + @md.title.edition else nil end end |
#emphasis ⇒ Object
390 391 392 393 394 395 396 |
# File 'lib/sisu/shared_metadata.rb', line 390 def emphasis if defined? @md.make.emphasis \ and @md.make.emphasis ' :emphasis: ' + @md.make.emphasis[:regx].inspect else nil end end |
#head ⇒ Object
476 477 478 |
# File 'lib/sisu/shared_metadata.rb', line 476 def head '@creator:' end |
#headings ⇒ Object
363 364 365 366 367 368 369 |
# File 'lib/sisu/shared_metadata.rb', line 363 def headings if defined? @md.make.headings \ and @md.make.headings ' :headings: ' + @md.make.headings[0].join('; ') else nil end end |
#html_display ⇒ Object
829 830 831 832 833 834 835 836 837 838 839 840 841 842 |
# File 'lib/sisu/shared_metadata.rb', line 829 def html_display def inf_xml=char_enc(@inf).amp inf_xml=char_enc(inf_xml).utf8 inf_xml=char_enc(inf_xml).br %{<p class="norm"> <b>#{@tag}</b>: #{inf_xml} </p>} end def SiSU_Metadata::Summary.new(@md,true). end self end |
#illustrations ⇒ Object
596 597 598 599 600 601 602 |
# File 'lib/sisu/shared_metadata.rb', line 596 def illustrations if defined? @md.rights.copyright.illustrations \ and @md.rights.copyright.illustrations ' :illustrations: ' + @md.rights.copyright.illustrations else nil end end |
#illustrator ⇒ Object
503 504 505 506 507 508 509 510 511 512 513 514 |
# File 'lib/sisu/shared_metadata.rb', line 503 def illustrator x=if defined? @md.creator.illustrator_detail \ and @md.creator.illustrator_detail x='' @md.creator.illustrator_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :illustrator: ' + x else nil end end |
#isbn ⇒ Object
710 711 712 713 714 715 716 |
# File 'lib/sisu/shared_metadata.rb', line 710 def isbn if defined? @md.classify.isbn \ and @md.classify.isbn ' :isbn: ' + @md.classify.isbn else nil end end |
#issued ⇒ Object
744 745 746 747 748 749 750 |
# File 'lib/sisu/shared_metadata.rb', line 744 def issued if defined? @md.date.issued \ and @md.date.issued ' :issued: ' + @md.date.issued else nil end end |
#italics ⇒ Object
404 405 406 407 408 409 410 |
# File 'lib/sisu/shared_metadata.rb', line 404 def italics if defined? @md.make.italics \ and @md.make.italics ' :italics: ' + @md.make.italics[:regx].inspect else nil end end |
#json ⇒ Object
954 955 956 957 958 959 960 961 962 963 964 965 |
# File 'lib/sisu/shared_metadata.rb', line 954 def json def <<WOK #{@tag.capitalize}: #{@inf} WOK end def SiSU_Metadata::Summary.new(@md). end self end |
#language ⇒ Object
356 357 358 359 360 361 362 |
# File 'lib/sisu/shared_metadata.rb', line 356 def language if defined? @md.make.language \ and @md.make.language ' :language: ' + @md.make.language.join(', ') else nil end end |
#language_char ⇒ Object
466 467 468 469 470 471 472 |
# File 'lib/sisu/shared_metadata.rb', line 466 def language_char if defined? @md.title.language_char \ and @md.title.language_char ' :language_char: ' + @md.title.language_char else nil end end |
#license ⇒ Object
626 627 628 629 630 631 632 |
# File 'lib/sisu/shared_metadata.rb', line 626 def license if defined? @md.rights.license \ and @md.rights.license ' :license: ' + @md.rights.license else nil end end |
#loc ⇒ Object
def identifier
if defined? @md.classify.identifier \
and @md.classify.identifier
' :identifier: ' + @md.classify.identifier
else nil
end
end
682 683 684 685 686 687 688 |
# File 'lib/sisu/shared_metadata.rb', line 682 def loc if defined? @md.classify.loc \ and @md.classify.loc ' :loc: ' + @md.classify.loc else nil end end |
#main ⇒ Object
424 425 426 427 428 429 430 |
# File 'lib/sisu/shared_metadata.rb', line 424 def main if defined? @md.title.main \ and @md.title.main '@title: ' + @md.title.main else '@title:' end end |
#make ⇒ Object
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/sisu/shared_metadata.rb', line 355 def make def language if defined? @md.make.language \ and @md.make.language ' :language: ' + @md.make.language.join(', ') else nil end end def headings if defined? @md.make.headings \ and @md.make.headings ' :headings: ' + @md.make.headings[0].join('; ') else nil end end def num_top if defined? @md.make.num_top \ and @md.make.num_top ' :num_top: ' + @md.make.num_top else nil end end def breaks x=if defined? @md.make.breaks \ and @md.make.breaks x=' :breaks:' if @md.make.breaks[:page_break] x +=' break=' + @md.make.breaks[:page_break] + ';' end if @md.make.breaks[:page_new] x +=' new=' + @md.make.breaks[:page_new] + ';' end else nil end end def emphasis if defined? @md.make.emphasis \ and @md.make.emphasis ' :emphasis: ' + @md.make.emphasis[:regx].inspect else nil end end def bold if defined? @md.make.bold \ and @md.make.bold ' :bold: ' + @md.make.bold[:regx].inspect else nil end end def italics if defined? @md.make.italics \ and @md.make.italics ' :italics: ' + @md.make.italics[:regx].inspect else nil end end def texpdf_font if defined? @md.make.texpdf_font \ and @md.make.texpdf_font ' :texpdf_font: ' + @md.make.texpdf_font.main else nil end end self end |
#manpage ⇒ Object
978 979 980 981 982 983 984 985 986 987 988 989 990 991 |
# File 'lib/sisu/shared_metadata.rb', line 978 def manpage def <<WOK .TP #{@tag.capitalize}: .I #{@inf} WOK end def SiSU_Metadata::Summary.new(@md). end self end |
#meta_content_clean(content = '') ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/sisu/shared_metadata.rb', line 71 def (content='') content=if not content.nil? content=content.tr('"',"'"). gsub(/&/,'&') content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) else content end end |
#meta_para ⇒ Object
814 815 816 817 818 819 820 821 822 823 |
# File 'lib/sisu/shared_metadata.rb', line 814 def inf_xml=char_enc(@inf).amp inf_xml=char_enc(inf_xml).utf8 inf_xml=char_enc(inf_xml).br <<WOK #{Ax[:tab]}<#{@tag}> #{Ax[:tab]*2}#{inf_xml} #{Ax[:tab]}</#{@tag}> WOK end |
#metadata ⇒ Object
824 825 826 |
# File 'lib/sisu/shared_metadata.rb', line 824 def SiSU_Metadata::Summary.new(@md). end |
#metadata_alt ⇒ Object
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/sisu/shared_metadata.rb', line 303 def =[] if @display_heading @tag,@inf=%{<b><u>Document Metadata</u></b>},'' << self. end if defined? @md.title.main \ and @md.title.main=~/\S+/ @tag='title' @inf=@md.title.main << self. end if defined? @md.title.sub \ and @md.title.sub=~/\S+/ @tag='subtitle' @inf=@md.title.sub << self. end if defined? @md.creator. \ and @md.creator.=~/\S+/ @tag='author' @inf=@md.creator. << self. end if defined? @md.creator.translator \ and @md.creator.translator=~/\S+/ @tag='translator' @inf=@md.creator.translator << self. end if defined? @md.creator.illustrator \ and @md.creator.illustrator=~/\S+/ @tag='illustrator' @inf=@md.creator.illustrator << self. end if defined? @md.rights.copyright.text \ and @md.rights.copyright.text=~/\S+/ @tag='copyright' @inf=@md.rights.copyright.text # year & holder @inf=@inf.gsub(/(?:Copyright|\(C\))+\s*/,'') << self. end if defined? @md.rights.license \ and @md.rights.license=~/\S+/ @tag='license' @inf=@md.rights.license << self. end end |
#metadata_base ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/sisu/shared_metadata.rb', line 65 def =[] l=SiSU_Env::StandardiseLanguage.new(@md.opt.lng).language language=l[:n] tr=SiSU_Translate::Source.new(@md,language) @attrib='md' def (content='') content=if not content.nil? content=content.tr('"',"'"). gsub(/&/,'&') content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) else content end end if @display_heading @tag,@inf=%{<b><u>Document Metadata</u></b>},'' << self. end if defined? @md.title.full \ and @md.title.full=~/\S+/ @tag,@inf,@class=tr.full_title,@md.title.full,'dc' #1 << self. end if defined? @md.creator. \ and @md.creator.=~/\S+/ @tag,@inf,@class=tr.,@md.creator.,'dc' #2 << self. end if defined? @md.creator.translator \ and @md.creator.translator=~/\S+/ @tag,@inf,@class=tr.translator,@md.creator.translator,'ext' << self. end if defined? @md.creator.illustrator \ and @md.creator.illustrator=~/\S+/ @tag,@inf,@class=tr.illustrator,@md.creator.illustrator,'ext' << self. end if defined? @md.creator.prepared_by \ and @md.creator.prepared_by=~/\S+/ @tag,@inf,@class=tr.prepared_by,@md.creator.prepared_by,'ext' << self. end if defined? @md.creator.digitized_by \ and @md.creator.digitized_by=~/\S+/ @tag,@inf,@class=tr.digitized_by,@md.creator.digitized_by,'ext' << self. end if defined? @md.creator.contributor \ and @md.creator.contributor=~/\S+/ @tag,@inf,@class=tr.contributor,@md.creator.contributor,'dc' #6 << self. end if defined? @md.rights.all \ and @md.rights.all=~/\S+/ @tag,@inf,@class=tr.rights,(@md.rights.all),'dc' #15 << self. end if defined? @md.classify.subject \ and @md.classify.subject=~/\S+/ @tag,@inf,@class=tr.subject,@md.classify.subject,'dc' #3 << self. end if defined? @md.classify.keywords \ and @md.classify.keywords=~/\S+/ @tag,@inf,@class=tr.keywords,@md.classify.keywords,'ext' << self. end if defined? @md.classify.loc \ and @md.classify.loc=~/\S+/ @tag,@inf,@class=tr.cls_loc,@md.classify.loc,'id' << self. end if defined? @md.classify.dewey \ and @md.classify.dewey=~/\S+/ @tag,@inf,@class=tr.cls_dewey,@md.classify.dewey,'id' << self. end if defined? @md.publisher \ and @md.publisher=~/\S+/ @tag,@inf,@class=tr.publisher,@md.publisher,'dc' #5 << self. end if defined? @md.date.created \ and @md.date.created=~/\S+/ @tag,@inf,@class=tr.date_created,@md.date.created,'dc' #7 << self. end if defined? @md.date.issued \ and @md.date.issued=~/\S+/ @tag,@inf,@class=tr.date_issued,@md.date.issued,'dc' #7 << self. end if defined? @md.date.available \ and @md.date.available=~/\S+/ @tag,@inf,@class=tr.date_available,@md.date.available,'dc' #7 << self. end if defined? @md.date.modified \ and @md.date.modified=~/\S+/ @tag,@inf,@class=tr.date_modified,@md.date.modified,'dc' #7 << self. end if defined? @md.date.valid \ and @md.date.valid=~/\S+/ @tag,@inf,@class=tr.date_valid,@md.date.valid,'dc' #7 << self. end if defined? @md.date.published \ and @md.date.published=~/\S+/ @tag,@inf,@class=tr.date,@md.date.published,'dc' #7 << self. end if defined? @md.identifier.isbn \ and @md.identifier.isbn=~/\S+/ @tag,@inf,@class=tr.cls_isbn,@md.identifier.isbn,'id' << self. end if defined? @md.identifier.oclc \ and @md.identifier.oclc=~/\S+/ @tag,@inf,@class=tr.cls_oclc,@md.identifier.oclc,'id' << self. end if defined? @md.notes.description \ and @md.notes.description=~/\S+/ @tag,@inf,@class=tr.description,@md.notes.description,'dc' #4 << self. end if defined? @md.notes.abstract \ and @md.notes.abstract=~/\S+/ @tag,@inf,@class=tr.abstract,@md.notes.abstract,'ext' << self. end if defined? @md.notes.comment \ and @md.notes.comment=~/\S+/ @tag,@inf,@class=tr.comments,@md.notes.comment,'ext' << self. end if defined? @md.notes.coverage \ and @md.notes.coverage=~/\S+/ @tag,@inf,@class=tr.coverage,@md.notes.coverage,'dc' #14 << self. end if defined? @md.notes.relation \ and @md.notes.relation=~/\S+/ @tag,@inf,@class=tr.relation,@md.notes.relation,'dc' #13 << self. end #if defined? @md.notes.source \ #and @md.notes.source=~/\S+/ # @tag,@inf,@class=tr.source,@md.notes.source,'dc' #11 # meta << self.meta_para #end if defined? @md.notes.history \ and @md.notes.history=~/\S+/ @tag,@inf,@class=tr.type,@md.notes.history,'dc' #8 << self. end if defined? @md.notes.type \ and @md.notes.type=~/\S+/ @tag,@inf,@class=tr.type,@md.notes.type,'dc' #8 << self. end if defined? @md.notes.format \ and @md.notes.format=~/\S+/ @tag,@inf,@class=tr.format,@md.notes.format,'dc' #9 << self. end if defined? @md.notes.prefix_a \ and @md.notes.prefix_a=~/\S+/ @tag,@inf,@class=tr.prefix_a,@md.notes.prefix_a,'inf' << self. end if defined? @md.notes.prefix_b \ and @md.notes.prefix_b=~/\S+/ @tag,@inf,@class=tr.prefix_b,@md.notes.prefix_b,'inf' << self. end if defined? @md.original.source \ and @md.original.source=~/\S+/ @tag,@inf,@class=tr.source,@md.original.source,'dc' #11 << self. end if defined? @md.title.language \ and @md.title.language=~/\S+/ @tag,@inf,@class=tr.language,@md.title.language,'dc' #12 << self. end if defined? @md.original.language \ and @md.original.language=~/\S+/ @tag,@inf,@class=tr.language_original,@md.original.language,'ext' << self. end if @display_heading @tag,@inf=%{<b><u>Version Information</u></b>},'' << self. end if defined? @md.fns \ and @md.fns=~/\S+/ @tag,@inf,@class=tr.sourcefile,@md.fns,'src' << self. end if defined? @md.file_encoding \ and @md.file_encoding=~/\S+/ @tag,@inf,@class='Filetype',@md.file_encoding,'src' << self. end if defined? @md.dgst \ and @md.dgst.is_a?(Array) @tag,@inf,@class='Source Digest',"#{@md.dgst[0]} #{@md.dgst[1]}",'src' << self. end if @display_heading @tag,@inf=%{<b><u>Generated</u></b>},'' << self. end if defined? @md.project_details \ and @md.project_details.version=~/\S+/ v="#{tr.sisu_version}: " + "#{@md.project_details.project} " + "#{@md.project_details.version} " + "of #{@md.project_details.date_stamp} " + "(#{@md.project_details.date})" @tag,@inf,@class='Generated by',v,'ver' << self. end if defined? @md.ruby_version \ and @md.ruby_version=~/\S+/ @tag,@inf,@class=tr.ruby_version,@md.ruby_version,'ver' << self. end if defined? @md.generated \ and @md.generated.is_a?(Time) @tag,@inf,@class=tr.last_generated,@md.generated,'date' << self. end end |
#metadata_tags ⇒ Object
422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 |
# File 'lib/sisu/shared_metadata.rb', line 422 def def title def main if defined? @md.title.main \ and @md.title.main '@title: ' + @md.title.main else '@title:' end end def sub if defined? @md.title.sub \ and @md.title.sub ' :subtitle: ' + @md.title.sub else nil end end def edition if defined? @md.title.edition \ and @md.title.edition ' :edition: ' + @md.title.edition else nil end end def note if defined? @md.title.note \ and @md.title.note ' :note: ' + @md.title.note else nil end end def short if defined? @md.title.short \ and @md.title.short ' :short: ' + @md.title.short else nil end end def language if defined? @md.title.language \ and @md.title.language ' :language: ' + @md.title.language else nil end end def language_char if defined? @md.title.language_char \ and @md.title.language_char ' :language_char: ' + @md.title.language_char else nil end end self end def creator def head '@creator:' end def x=if defined? @md.creator. \ and @md.creator. x='' @md.creator..each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :author: ' + x else nil end end def contributor x=if defined? @md.creator.contributor_detail \ and @md.creator.contributor_detail x='' @md.creator.contributor_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :contributor: ' + x else nil end end def illustrator x=if defined? @md.creator.illustrator_detail \ and @md.creator.illustrator_detail x='' @md.creator.illustrator_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :illustrator: ' + x else nil end end def photographer x=if defined? @md.creator.photographer_detail \ and @md.creator.photographer_detail x='' @md.creator.photographer_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :photographer: ' + x else nil end end def translator x=if defined? @md.creator.translator_detail \ and @md.creator.translator_detail x='' @md.creator.translator_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :translator: ' + x else nil end end def audio x=if defined? @md.creator.audio_detail \ and @md.creator.audio_detail x='' @md.creator.audio_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :audio: ' + x else nil end end def digitized_by x=if defined? @md.creator.digitized_by_detail \ and @md.creator.digitized_by_detail x='' @md.creator.digitized_by_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :digitized_by: ' + x else nil end end def prepared_by x=if defined? @md.creator.prepared_by_detail \ and @md.creator.prepared_by_detail x='' @md.creator.prepared_by_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :prepared_by: ' + x else nil end end self end def rights def head '@rights:' end def copyright def text if defined? @md.rights.copyright.text \ and @md.rights.copyright.text ' :copyright: ' + @md.rights.copyright.text else nil end end def translation if defined? @md.rights.copyright.translation \ and @md.rights.copyright.translation ' :translation: ' + @md.rights.copyright.translation else nil end end def illustrations if defined? @md.rights.copyright.illustrations \ and @md.rights.copyright.illustrations ' :illustrations: ' + @md.rights.copyright.illustrations else nil end end def photographs if defined? @md.rights.copyright.photographs \ and @md.rights.copyright.photographs ' :photographs: ' + @md.rights.copyright.photographs else nil end end def digitization if defined? @md.rights.copyright.digitization \ and @md.rights.copyright.digitization ' :digitization: ' + @md.rights.copyright.digitization else nil end end def audio if defined? @md.rights.copyright.audio \ and @md.rights.copyright.audio ' :audio: ' + @md.rights.copyright.audio else nil end end self end def license if defined? @md.rights.license \ and @md.rights.license ' :license: ' + @md.rights.license else nil end end self end def classify def head '@classify:' end def coverage if defined? @md.classify.coverage \ and @md.classify.coverage ' :coverage: ' + @md.classify.coverage else nil end end def relation if defined? @md.classify.relation \ and @md.classify.relation ' :relation: ' + @md.classify.relation else nil end end def subject if defined? @md.classify.subject \ and @md.classify.subject ' :subject: ' + @md.classify.subject else nil end end def topic_register if defined? @md.classify.topic_register \ and @md.classify.topic_register ' :topic_register: ' + @md.classify.topic_register else nil end end def type # if defined? @md.classify.type \ # and @md.classify.type # ' :type: ' + @md.classify.type # else nil # end nil end #def identifier # if defined? @md.classify.identifier \ # and @md.classify.identifier # ' :identifier: ' + @md.classify.identifier # else nil # end #end def loc if defined? @md.classify.loc \ and @md.classify.loc ' :loc: ' + @md.classify.loc else nil end end def dewey if defined? @md.classify.dewey \ and @md.classify.dewey ' :dewey: ' + @md.classify.dewey else nil end end def oclc if defined? @md.classify.oclc \ and @md.classify.oclc ' :oclc: ' + @md.classify.oclc else nil end end def pg if defined? @md.classify.pg \ and @md.classify.pg ' :pg: ' + @md.classify.pg else nil end end def isbn if defined? @md.classify.isbn \ and @md.classify.isbn ' :isbn: ' + @md.classify.isbn else nil end end self end def date def head '@date:' end def added_to_site if defined? @md.date.added_to_site \ and @md.date.added_to_site ' :added_to_site: ' + @md.date.added_to_site else nil end end def available if defined? @md.date.available \ and @md.date.available ' :available: ' + @md.date.available else nil end end def created if defined? @md.date.created \ and @md.date.created ' :created: ' + @md.date.created else nil end end def issued if defined? @md.date.issued \ and @md.date.issued ' :issued: ' + @md.date.issued else nil end end def modified if defined? @md.date.modified \ and @md.date.modified ' :modified: ' + @md.date.modified else nil end end def published if defined? @md.date.published \ and @md.date.published ' :published: ' + @md.date.published else nil end end def valid if defined? @md.date.valid \ and @md.date.valid ' :valid: ' + @md.date.valid else nil end end self end #def make # def headings # @md.make.headings \ # ? (' :headings: ' + @md.make.headings) \ # : nil # end #end self end |
#modified ⇒ Object
751 752 753 754 755 756 757 |
# File 'lib/sisu/shared_metadata.rb', line 751 def modified if defined? @md.date.modified \ and @md.date.modified ' :modified: ' + @md.date.modified else nil end end |
#note ⇒ Object
445 446 447 448 449 450 451 |
# File 'lib/sisu/shared_metadata.rb', line 445 def note if defined? @md.title.note \ and @md.title.note ' :note: ' + @md.title.note else nil end end |
#num_top ⇒ Object
370 371 372 373 374 375 376 |
# File 'lib/sisu/shared_metadata.rb', line 370 def num_top if defined? @md.make.num_top \ and @md.make.num_top ' :num_top: ' + @md.make.num_top else nil end end |
#oclc ⇒ Object
696 697 698 699 700 701 702 |
# File 'lib/sisu/shared_metadata.rb', line 696 def oclc if defined? @md.classify.oclc \ and @md.classify.oclc ' :oclc: ' + @md.classify.oclc else nil end end |
#odf ⇒ Object
914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 |
# File 'lib/sisu/shared_metadata.rb', line 914 def odf def if @inf.is_a?(String) @inf=@inf.gsub(/</,'<').gsub(/>/,'>'). gsub(/<br(?: \/)?>/,'<br />') if @inf =~/&/ inf_array=[] word=@inf.scan(/\S+|\n/) word.each do |w| # _ - / # | : ! ^ ~ w=w.gsub(/ /,' ') if w !~/&\S{2,7}?;/ w=w.gsub(/&/,'&') end inf_array << w end @inf=inf_array.join(' ') end @inf=@inf.gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, '<text:a xl:type="simple" xl:href="\1">\1</text:a>'). #http ftp matches escaped, no decoration gsub(/(#{Mx[:lnk_c]})#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, '\1<text:a xl:type="simple" xl:href="\2">\2</text:a>') #special case \{ e.g. \}http://url @inf=if @inf =~/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/ @inf.gsub(/#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, %{#{the_url_decoration.xml_open}<text:a xl:type="simple" xl:href="\\1">\\1</text:a>#{the_url_decoration.xml_close}}) #http ftp matches with decoration else @inf.gsub(/(https?:\/\/[^<>()'"\s]+)/, %{#{the_url_decoration.xml_open}<text:a xl:type="simple" xl:href="\\1">\\1</text:a>#{the_url_decoration.xml_close}}) #http ftp matches with decoration end @inf=@inf.gsub(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)/, %{#{the_url_decoration.xml_open}<text:a xl:type="simple" xl:href="mailto:\\1">\\1</text:a>#{the_url_decoration.xml_close}}) if @inf !~/http:\/\// # improve upon, document crash where url contains '@' symbol end <<WOK <text:p text:style-name="P1">#{@tag.capitalize}: #{@inf}</text:p> WOK end def SiSU_Metadata::Summary.new(@md). end self end |
#pg ⇒ Object
703 704 705 706 707 708 709 |
# File 'lib/sisu/shared_metadata.rb', line 703 def pg if defined? @md.classify.pg \ and @md.classify.pg ' :pg: ' + @md.classify.pg else nil end end |
#photographer ⇒ Object
515 516 517 518 519 520 521 522 523 524 525 526 |
# File 'lib/sisu/shared_metadata.rb', line 515 def photographer x=if defined? @md.creator.photographer_detail \ and @md.creator.photographer_detail x='' @md.creator.photographer_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :photographer: ' + x else nil end end |
#photographs ⇒ Object
603 604 605 606 607 608 609 |
# File 'lib/sisu/shared_metadata.rb', line 603 def photographs if defined? @md.rights.copyright.photographs \ and @md.rights.copyright.photographs ' :photographs: ' + @md.rights.copyright.photographs else nil end end |
#plaintext ⇒ Object
966 967 968 969 970 971 972 973 974 975 976 977 |
# File 'lib/sisu/shared_metadata.rb', line 966 def plaintext def <<WOK #{@tag.capitalize}: #{@inf} WOK end def SiSU_Metadata::Summary.new(@md). end self end |
#prepared_by ⇒ Object
563 564 565 566 567 568 569 570 571 572 573 574 |
# File 'lib/sisu/shared_metadata.rb', line 563 def prepared_by x=if defined? @md.creator.prepared_by_detail \ and @md.creator.prepared_by_detail x='' @md.creator.prepared_by_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :prepared_by: ' + x else nil end end |
#processing_tags ⇒ Object
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/sisu/shared_metadata.rb', line 354 def def make def language if defined? @md.make.language \ and @md.make.language ' :language: ' + @md.make.language.join(', ') else nil end end def headings if defined? @md.make.headings \ and @md.make.headings ' :headings: ' + @md.make.headings[0].join('; ') else nil end end def num_top if defined? @md.make.num_top \ and @md.make.num_top ' :num_top: ' + @md.make.num_top else nil end end def breaks x=if defined? @md.make.breaks \ and @md.make.breaks x=' :breaks:' if @md.make.breaks[:page_break] x +=' break=' + @md.make.breaks[:page_break] + ';' end if @md.make.breaks[:page_new] x +=' new=' + @md.make.breaks[:page_new] + ';' end else nil end end def emphasis if defined? @md.make.emphasis \ and @md.make.emphasis ' :emphasis: ' + @md.make.emphasis[:regx].inspect else nil end end def bold if defined? @md.make.bold \ and @md.make.bold ' :bold: ' + @md.make.bold[:regx].inspect else nil end end def italics if defined? @md.make.italics \ and @md.make.italics ' :italics: ' + @md.make.italics[:regx].inspect else nil end end def texpdf_font if defined? @md.make.texpdf_font \ and @md.make.texpdf_font ' :texpdf_font: ' + @md.make.texpdf_font.main else nil end end self end self end |
#published ⇒ Object
758 759 760 761 762 763 764 |
# File 'lib/sisu/shared_metadata.rb', line 758 def published if defined? @md.date.published \ and @md.date.published ' :published: ' + @md.date.published else nil end end |
#relation ⇒ Object
646 647 648 649 650 651 652 |
# File 'lib/sisu/shared_metadata.rb', line 646 def relation if defined? @md.classify.relation \ and @md.classify.relation ' :relation: ' + @md.classify.relation else nil end end |
#rights ⇒ Object
577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
# File 'lib/sisu/shared_metadata.rb', line 577 def rights def head '@rights:' end def copyright def text if defined? @md.rights.copyright.text \ and @md.rights.copyright.text ' :copyright: ' + @md.rights.copyright.text else nil end end def translation if defined? @md.rights.copyright.translation \ and @md.rights.copyright.translation ' :translation: ' + @md.rights.copyright.translation else nil end end def illustrations if defined? @md.rights.copyright.illustrations \ and @md.rights.copyright.illustrations ' :illustrations: ' + @md.rights.copyright.illustrations else nil end end def photographs if defined? @md.rights.copyright.photographs \ and @md.rights.copyright.photographs ' :photographs: ' + @md.rights.copyright.photographs else nil end end def digitization if defined? @md.rights.copyright.digitization \ and @md.rights.copyright.digitization ' :digitization: ' + @md.rights.copyright.digitization else nil end end def audio if defined? @md.rights.copyright.audio \ and @md.rights.copyright.audio ' :audio: ' + @md.rights.copyright.audio else nil end end self end def license if defined? @md.rights.license \ and @md.rights.license ' :license: ' + @md.rights.license else nil end end self end |
#short ⇒ Object
452 453 454 455 456 457 458 |
# File 'lib/sisu/shared_metadata.rb', line 452 def short if defined? @md.title.short \ and @md.title.short ' :short: ' + @md.title.short else nil end end |
#sub ⇒ Object
431 432 433 434 435 436 437 |
# File 'lib/sisu/shared_metadata.rb', line 431 def sub if defined? @md.title.sub \ and @md.title.sub ' :subtitle: ' + @md.title.sub else nil end end |
#subject ⇒ Object
653 654 655 656 657 658 659 |
# File 'lib/sisu/shared_metadata.rb', line 653 def subject if defined? @md.classify.subject \ and @md.classify.subject ' :subject: ' + @md.classify.subject else nil end end |
#texpdf_font ⇒ Object
411 412 413 414 415 416 417 |
# File 'lib/sisu/shared_metadata.rb', line 411 def texpdf_font if defined? @md.make.texpdf_font \ and @md.make.texpdf_font ' :texpdf_font: ' + @md.make.texpdf_font.main else nil end end |
#text ⇒ Object
582 583 584 585 586 587 588 |
# File 'lib/sisu/shared_metadata.rb', line 582 def text if defined? @md.rights.copyright.text \ and @md.rights.copyright.text ' :copyright: ' + @md.rights.copyright.text else nil end end |
#title ⇒ Object
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 |
# File 'lib/sisu/shared_metadata.rb', line 423 def title def main if defined? @md.title.main \ and @md.title.main '@title: ' + @md.title.main else '@title:' end end def sub if defined? @md.title.sub \ and @md.title.sub ' :subtitle: ' + @md.title.sub else nil end end def edition if defined? @md.title.edition \ and @md.title.edition ' :edition: ' + @md.title.edition else nil end end def note if defined? @md.title.note \ and @md.title.note ' :note: ' + @md.title.note else nil end end def short if defined? @md.title.short \ and @md.title.short ' :short: ' + @md.title.short else nil end end def language if defined? @md.title.language \ and @md.title.language ' :language: ' + @md.title.language else nil end end def language_char if defined? @md.title.language_char \ and @md.title.language_char ' :language_char: ' + @md.title.language_char else nil end end self end |
#topic_register ⇒ Object
660 661 662 663 664 665 666 |
# File 'lib/sisu/shared_metadata.rb', line 660 def topic_register if defined? @md.classify.topic_register \ and @md.classify.topic_register ' :topic_register: ' + @md.classify.topic_register else nil end end |
#translation ⇒ Object
589 590 591 592 593 594 595 |
# File 'lib/sisu/shared_metadata.rb', line 589 def translation if defined? @md.rights.copyright.translation \ and @md.rights.copyright.translation ' :translation: ' + @md.rights.copyright.translation else nil end end |
#translator ⇒ Object
527 528 529 530 531 532 533 534 535 536 537 538 |
# File 'lib/sisu/shared_metadata.rb', line 527 def translator x=if defined? @md.creator.translator_detail \ and @md.creator.translator_detail x='' @md.creator.translator_detail.each do |n| x += "#{n[:the]}, #{n[:others]}; " end x=x.gsub(/;\s*$/,'') ' :translator: ' + x else nil end end |
#type ⇒ Object
667 668 669 670 671 672 673 674 |
# File 'lib/sisu/shared_metadata.rb', line 667 def type # if defined? @md.classify.type \ # and @md.classify.type # ' :type: ' + @md.classify.type # else nil # end nil end |
#utf8 ⇒ Object
799 800 801 802 803 804 805 806 807 808 809 810 |
# File 'lib/sisu/shared_metadata.rb', line 799 def utf8 if @s \ and @s.is_a?(String) @s=@s.gsub(/<br(?: \/)?>/u,Mx[:br_paragraph]). gsub(/</um,'<').gsub(/>/um,'>'). #gsub(/</um,'<').gsub(/>/um,'>'). gsub(/ /um,' '). # space identify gsub(/ /um,' '). # space identify gsub(/#{Mx[:br_paragraph]}/u,'<br />') end @s end |
#valid ⇒ Object
765 766 767 768 769 770 771 |
# File 'lib/sisu/shared_metadata.rb', line 765 def valid if defined? @md.date.valid \ and @md.date.valid ' :valid: ' + @md.date.valid else nil end end |
#xhtml_display ⇒ Object
900 901 902 903 904 905 906 907 908 909 910 911 912 913 |
# File 'lib/sisu/shared_metadata.rb', line 900 def xhtml_display def inf_xml=char_enc(@inf).amp inf_xml=char_enc(inf_xml).utf8 inf_xml=char_enc(inf_xml).br %{<p class="norm"> <b>#{@tag}</b>: #{inf_xml} </p>} end def SiSU_Metadata::Summary.new(@md,true). end self end |
#xhtml_scroll ⇒ Object
880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 |
# File 'lib/sisu/shared_metadata.rb', line 880 def xhtml_scroll def inf_xml=char_enc(inf_xml).amp inf_xml=char_enc(@inf).utf8 inf_xml=char_enc(inf_xml).br <<WOK #{Ax[:tab]}<metadata> #{Ax[:tab]}<meta>#{@tag.capitalize}:</meta> #{Ax[:tab]}<#{@attrib} class="#{@class}"> #{Ax[:tab]*2}#{inf_xml} #{Ax[:tab]}</#{@attrib}> #{Ax[:tab]}</metadata> <br /> WOK end def SiSU_Metadata::Summary.new(@md). end self end |
#xml_docbook ⇒ Object
813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 |
# File 'lib/sisu/shared_metadata.rb', line 813 def xml_docbook def inf_xml=char_enc(@inf).amp inf_xml=char_enc(inf_xml).utf8 inf_xml=char_enc(inf_xml).br <<WOK #{Ax[:tab]}<#{@tag}> #{Ax[:tab]*2}#{inf_xml} #{Ax[:tab]}</#{@tag}> WOK end def SiSU_Metadata::Summary.new(@md). end self end |
#xml_dom ⇒ Object
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 |
# File 'lib/sisu/shared_metadata.rb', line 861 def xml_dom def inf_xml=char_enc(inf_xml).amp inf_xml=char_enc(@inf).utf8 inf_xml=char_enc(inf_xml).br <<WOK #{Ax[:tab]}<header> #{Ax[:tab]*2}<meta>#{@tag.capitalize}:</meta> #{Ax[:tab]*2}<#{@attrib}> #{Ax[:tab]*3}#{inf_xml} #{Ax[:tab]*2}</#{@attrib}> #{Ax[:tab]}</header> WOK end def SiSU_Metadata::Summary.new(@md). end self end |
#xml_sax ⇒ Object
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 |
# File 'lib/sisu/shared_metadata.rb', line 843 def xml_sax def inf_xml=char_enc(@inf).utf8 inf_xml=char_enc(inf_xml).br <<WOK <metadata> #{Ax[:tab]}<meta>#{@tag.capitalize}:</meta> #{Ax[:tab]}<data class="#{@attrib}"> #{Ax[:tab]*2}#{inf_xml} #{Ax[:tab]}</data> </metadata> WOK end def SiSU_Metadata::Summary.new(@md). end self end |