Changeset 479
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/PublicationController.groovy
r437 r479 14 14 def index = { 15 15 redirect(action: "list", params: params) 16 } 17 18 /** 19 * Shows a form to add a new publication by searching pubmed 20 */ 21 def add = {} 22 23 /** 24 * Adds publication selected from pubmed 25 */ 26 def createFromPubmed = { 27 // instantiate term with parameters 28 def publication = new Publication( 29 title: params.get( 'publication-title' ), 30 authorsList: params.get( 'publication-authorsList' ), 31 pubMedID: params.get( 'publication-pubMedID' ), 32 DOI: params.get( 'publication-doi' ) 33 ) 34 35 def message; 36 def errors = ''; 37 38 // validate term 39 if (publication.validate()) { 40 println "Publication validated correctly" 41 publication.save() 42 message = "Publication added to the system" 43 } else { 44 println "Publication validation failed" 45 println "errors:" 46 publication.errors.getAllErrors().each() { 47 println it 48 } 49 errors = publications.errors.getAllErrors.join( ', ' ); 50 message = "Publication addition failed" 51 } 52 53 render( 'view': 'add', model:[ message: message, errors: errors ] ); 16 54 } 17 55 -
trunk/grails-app/views/publication/show.gsp
r437 r479 50 50 <td valign="top" class="name"><g:message code="publication.DOI.label" default="DOI" /></td> 51 51 52 <td valign="top" class="value">${fieldValue(bean: publicationInstance, field: "DOI")}</td> 52 <td valign="top" class="value"> 53 <g:if test="${publicationInstance.DOI}"> 54 <a href="http://dx.doi.org/${fieldValue(bean: publicationInstance, field: "DOI")}"> 55 ${fieldValue(bean: publicationInstance, field: "DOI")} 56 </a> 57 </g:if> 58 </td> 53 59 54 60 </tr>
Note: See TracChangeset
for help on using the changeset viewer.