Skip to content

Instantly share code, notes, and snippets.

@mankind
Forked from ashikajith/rif_export_doc.md
Created August 9, 2019 14:24
Show Gist options
  • Save mankind/e6f54ca31730f78f19da33fb4b844e73 to your computer and use it in GitHub Desktop.
Save mankind/e6f54ca31730f78f19da33fb4b844e73 to your computer and use it in GitHub Desktop.

Revisions

  1. @ashikajith ashikajith revised this gist Aug 9, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rif_export_doc.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ and process the fetched record to render in RIF fromat.
    - A Controller Concern is added to handle the processing of data in Rif format (`app/controllers/concerns/ubiquity/citations_export_concern.rb`)

    Basically we have a hash which consist of code and the fields that needs to map. Please find the hash below
    ```
    ```ruby
    {
    'T1' => :title, 'T2' => %i[book_title alt_title], 'CR' => :creator, 'ED' => :editor, 'AB' => :abstract,
    'DA' => :date_published, 'DO' => :doi, 'JO' => :journal_title, 'LA' => :language, 'N1' => :add_info,
  2. @ashikajith ashikajith created this gist Aug 9, 2019.
    19 changes: 19 additions & 0 deletions rif_export_doc.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    ## RIF Doc
    For Rif template all the fileds have unique codes and we represent eah codes to the corresponding value. Following are the
    steps we follow to generate the report

    - Fetch the corresponding work from the controller `CitationExportsController` (app/controllers/ubiquity/citation_exports_controller.rb)
    and process the fetched record to render in RIF fromat.
    - A Controller Concern is added to handle the processing of data in Rif format (`app/controllers/concerns/ubiquity/citations_export_concern.rb`)

    Basically we have a hash which consist of code and the fields that needs to map. Please find the hash below
    ```
    {
    'T1' => :title, 'T2' => %i[book_title alt_title], 'CR' => :creator, 'ED' => :editor, 'AB' => :abstract,
    'DA' => :date_published, 'DO' => :doi, 'JO' => :journal_title, 'LA' => :language, 'N1' => :add_info,
    'KW' => :keyword, 'IS' => :issue, 'PB' => :publisher, 'PP' => :place_of_publication, 'PY' => :date_published,
    'SN' => %i[isbn issn eissn], 'SP' => %i[pagination article_num], 'UR' => :official_link, 'VL' => :volume
    }
    ```
    We will iterate the above hash and for each codes we call the corresponding field using the fetched record to generate the RIF
    Template.