- Timestamp:
- Jun 3, 2010, 12:27:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/dbnp/studycapturing/PublicationController.groovy
r496 r518 144 144 } 145 145 } 146 147 /** 148 * Searches for an ID in the current database, based on the pubMedID 149 * If the publication is not found in the database, it is added 150 */ 151 def getID = { 152 // Find the ID 153 def pubMedID = params.get( 'publication-pubMedID' ); 154 if( pubMedID ) { 155 def publication = Publication.findByPubMedID( pubMedID ); 156 if( !publication ) { 157 publication = new Publication( 158 title: params.get( 'publication-title' ), 159 authorsList: params.get( 'publication-authorsList' ), 160 pubMedID: params.get( 'publication-pubMedID' ), 161 DOI: params.get( 'publication-doi' ) 162 ).save(flush:true); 163 } 164 165 // Return the ID 166 render publication.id; 167 } else { 168 response.status = 500; 169 render "No pubMedID found in request"; 170 } 171 } 146 172 }
Note: See TracChangeset
for help on using the changeset viewer.