From: <hs...@us...> - 2011-04-12 20:16:54
|
Revision: 783 http://treebase.svn.sourceforge.net/treebase/?rev=783&view=rev Author: hshyket Date: 2011-04-12 20:16:48 +0000 (Tue, 12 Apr 2011) Log Message: ----------- When Dryad data is imported the authors are removed from the citation and placed as a string in the Notes field Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2011-04-11 19:01:05 UTC (rev 782) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2011-04-12 20:16:48 UTC (rev 783) @@ -470,7 +470,31 @@ getDetailedPublicationInformation(authorsCitationStyle, true); return authorsCitationStyle.toString(); } + + @Transient + public String getAuthorsDryadNotes() { + StringBuilder authorsDryad = new StringBuilder(); + List<Person> authors = getAuthors(); + int size = authors.size(); + + if (size > 0) { + + for (int i = 0; i < size; i++) { + authorsDryad.append(authors.get(i).getLastName()); + authorsDryad.append(", "); + authorsDryad.append(authors.get(i).getFirstName()); + + if (size > 1) { + authorsDryad.append("\n"); + } + } + + } + + return authorsDryad.toString(); + } + @Transient public String getAuthorsCitationStyleWithoutHtml() { Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2011-04-11 19:01:05 UTC (rev 782) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2011-04-12 20:16:48 UTC (rev 783) @@ -91,9 +91,17 @@ Citation citation = cparser.getCitation(); Study study = new Study(); study.setName(bagitPath.getName()); - study.setCitation(citation); - citation.setStudy(study); + study.setCitation(citation); + citation.setStudy(study); + + study.setNotes("Please enter these author names into the TreeBASE citation " + + "by clicking on the highlighted \"Authors\" item in the Tool Box." + + "\n\n" + citation.getAuthorsDryadNotes()); + + citation.setAuthors(null); + Submission submission = mSubmissionService.createSubmission(user, study); + long unixTime = System.currentTimeMillis() / 1000L; List<File> files = DryadUtil.getDataFiles(dataPath); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |