To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / vendor / plugins / redmine_bibliography / app / controllers / publications_controller.rb @ 384:4be6b16bc6f9
History | View | Annotate | Download (1.07 KB)
| 1 | 328:aed18b463206 | luis | class PublicationsController < ApplicationController |
|---|---|---|---|
| 2 | |||
| 3 | 384:4be6b16bc6f9 | luis | def parse_bibtex_text |
| 4 | |||
| 5 | logger.error "BBBBBBBB"
|
||
| 6 | |||
| 7 | bibtex_entry = params[:bibtex_entry]
|
||
| 8 | |||
| 9 | |||
| 10 | |||
| 11 | |||
| 12 | # logger.error bibtex_entry
|
||
| 13 | |||
| 14 | if bibtex_entry
|
||
| 15 | Bibtex::Parser.parse_string(bibtex_entry).map do |entry| |
||
| 16 | logger.error entry[:title]
|
||
| 17 | logger.error entry[:year]
|
||
| 18 | logger.error entry.type |
||
| 19 | end
|
||
| 20 | end
|
||
| 21 | |||
| 22 | logger.error "FIM"
|
||
| 23 | |||
| 24 | end
|
||
| 25 | |||
| 26 | 329:4575b631f6ce | luis | def new |
| 27 | 384:4be6b16bc6f9 | luis | |
| 28 | logger.error "AAAAAA"
|
||
| 29 | |||
| 30 | logger.error request.request_method |
||
| 31 | |||
| 32 | if request.post?
|
||
| 33 | parse_bibtex_text |
||
| 34 | @publication = Publication.new(params[:publication]) |
||
| 35 | |||
| 36 | if @publication.save |
||
| 37 | logger.error "GRAVOU XXXdsfgXXX"
|
||
| 38 | else
|
||
| 39 | logger.error "nao gravou"
|
||
| 40 | end
|
||
| 41 | |||
| 42 | 376:ad71d0604ac2 | luis | end
|
| 43 | 384:4be6b16bc6f9 | luis | |
| 44 | 328:aed18b463206 | luis | end
|
| 45 | |||
| 46 | def create |
||
| 47 | 384:4be6b16bc6f9 | luis | |
| 48 | 376:ad71d0604ac2 | luis | logger.error "AAAA create"
|
| 49 | 384:4be6b16bc6f9 | luis | |
| 50 | 334:d750431a4102 | luis | @publication.save
|
| 51 | 329:4575b631f6ce | luis | end
|
| 52 | |||
| 53 | def index |
||
| 54 | @publications = Publication.find(:all) |
||
| 55 | 328:aed18b463206 | luis | end
|
| 56 | |||
| 57 | def edit |
||
| 58 | 384:4be6b16bc6f9 | luis | logger.error "AAAA edit"
|
| 59 | 376:ad71d0604ac2 | luis | |
| 60 | 328:aed18b463206 | luis | end
|
| 61 | |||
| 62 | def update |
||
| 63 | 384:4be6b16bc6f9 | luis | |
| 64 | logger.error "AAAA update"
|
||
| 65 | 376:ad71d0604ac2 | luis | |
| 66 | |||
| 67 | 328:aed18b463206 | luis | end
|
| 68 | 329:4575b631f6ce | luis | |
| 69 | def show |
||
| 70 | @publication = Publication.find(params[id]) |
||
| 71 | @authors = @publication.authors |
||
| 72 | end
|
||
| 73 | |||
| 74 | |||
| 75 | 328:aed18b463206 | luis | end |