You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
(14) |
May
(36) |
Jun
(148) |
Jul
(33) |
Aug
(2) |
Sep
(17) |
Oct
(42) |
Nov
(137) |
Dec
(88) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(89) |
Feb
(80) |
Mar
(217) |
Apr
(76) |
May
(5) |
Jun
(39) |
Jul
(35) |
Aug
(4) |
Sep
(7) |
Oct
(14) |
Nov
(12) |
Dec
(9) |
2011 |
Jan
(6) |
Feb
(4) |
Mar
(11) |
Apr
(55) |
May
(90) |
Jun
(39) |
Jul
(15) |
Aug
(15) |
Sep
(23) |
Oct
(12) |
Nov
(17) |
Dec
(20) |
2012 |
Jan
(22) |
Feb
(63) |
Mar
|
Apr
(1) |
May
(6) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(3) |
Feb
(6) |
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <yo...@us...> - 2010-07-14 20:45:18
|
Revision: 733 http://treebase.svn.sourceforge.net/treebase/?rev=733&view=rev Author: youjun Date: 2010-07-14 20:45:11 +0000 (Wed, 14 Jul 2010) Log Message: ----------- handshaking controller and util Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/CitationParser.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java 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 2010-07-14 02:16:55 UTC (rev 732) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2010-07-14 20:45:11 UTC (rev 733) @@ -21,11 +21,7 @@ public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { - String importKey = null; - if(request.getParameter("importKey") != null){ - importKey = (String)request.getAttribute("importKey"); - request.getSession().setAttribute("importKey",importKey); - } + String importKey = (String)request.getSession().getAttribute("importKey"); if (importKey != null && importKey.length()>0) { Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java 2010-07-14 02:16:55 UTC (rev 732) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java 2010-07-14 20:45:11 UTC (rev 733) @@ -25,6 +25,7 @@ import org.cipres.treebase.domain.study.SubmissionService; import org.cipres.treebase.web.Constants; import org.cipres.treebase.web.model.MyProgressionListener; +import org.cipres.treebase.web.util.CitationParser; import org.cipres.treebase.web.util.ControllerUtil; import org.cipres.treebase.web.util.DryadUtil; @@ -106,28 +107,7 @@ String importKey = (String)request.getSession().getAttribute("importKey"); request.getSession().removeAttribute("importKey"); - if (request.getParameter(ACTION_SUBMIT) != null) { - // Study must be submitted with citation together - // here we are just saving the data to the session - // request.getSession().setAttribute(Constants.STUDY_KEY, study); - - // BeanUtils.copyProperties(citationCommand.getCitationMap(citationType), - // citationCommand); - - // FIXME citation - // Citation c = new ArticleCitation(); - // c.setStudy(study); - // study.setCitation(c); - - // retrieve Study object from session to be submitted with citation - // Study study = (Study) request.getSession().getAttribute(Constants.STUDY_KEY); - // citationCommand.getCitationMap(citationType).setStudy(study); - Submission submission = mSubmissionService.createSubmission(user, study); - - // save Study object to session and remove - ControllerUtil.saveStudy(request, submission.getStudy()); - - } else if(importKey != null && importKey.length()>0){ + if(importKey != null && importKey.length()>0){ String uploadpath = getServletContext() .getRealPath(TreebaseUtil.FILESEP + "DryadFileUpload") + TreebaseUtil.FILESEP + importKey; @@ -149,13 +129,14 @@ try{ Submission submission = mSubmissionService.createSubmission(user, new Study()); - Citation citation = DryadUtil.createCitation(dataPath); + CitationParser cparser= new CitationParser(dataPath); + Citation citation = cparser.getCitation(); submission.getStudy().setCitation(citation); citation.setStudy(submission.getStudy()); Collection<File> files = DryadUtil.getDataFiles(dataPath); MyProgressionListener listener = new MyProgressionListener(); - getSubmissionService().addNexusFilesJDBC(submission, files, listener); + //getSubmissionService().addNexusFilesJDBC(submission, files, listener); // save Study object to session ControllerUtil.saveStudy(request, submission.getStudy()); importStatus = "OK"; @@ -167,7 +148,32 @@ //request.getSession().removeAttribute("importKey"); return new ModelAndView(new RedirectView("submissionList.html")); - }else if (request.getParameter(ACTION_UPDATE) != null) { + } + + + + if (request.getParameter(ACTION_SUBMIT) != null) { + // Study must be submitted with citation together + // here we are just saving the data to the session + // request.getSession().setAttribute(Constants.STUDY_KEY, study); + + // BeanUtils.copyProperties(citationCommand.getCitationMap(citationType), + // citationCommand); + + // FIXME citation + // Citation c = new ArticleCitation(); + // c.setStudy(study); + // study.setCitation(c); + + // retrieve Study object from session to be submitted with citation + // Study study = (Study) request.getSession().getAttribute(Constants.STUDY_KEY); + // citationCommand.getCitationMap(citationType).setStudy(study); + Submission submission = mSubmissionService.createSubmission(user, study); + + // save Study object to session and remove + ControllerUtil.saveStudy(request, submission.getStudy()); + + } else if (request.getParameter(ACTION_UPDATE) != null) { mStudyService.update(study); } else if (request.getParameter(ACTION_DELETE) != null) { @@ -208,6 +214,10 @@ request.getSession().removeAttribute(Constants.STUDY_MAP); return new Study(); } + + if(request.getSession().getAttribute("importKey") != null) + return new Study(); + // if we are updating a data that's already in the db (access from RHS menu) study = ControllerUtil.findStudy(request, mStudyService); return study; Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/CitationParser.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/CitationParser.java 2010-07-14 02:16:55 UTC (rev 732) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/CitationParser.java 2010-07-14 20:45:11 UTC (rev 733) @@ -3,6 +3,7 @@ import java.io.File; import java.util.List; +import org.cipres.treebase.domain.admin.Person; import org.cipres.treebase.domain.study.ArticleCitation; import org.cipres.treebase.domain.study.Citation; import org.dom4j.Document; @@ -14,21 +15,18 @@ import org.dom4j.io.SAXReader; public class CitationParser { - + private ArticleCitation citation; private static final Namespace xs = new Namespace("xs","http://www.w3.org/2001/XMLSchema"); private static final Namespace dwc= new Namespace("dwc", "http://rs.tdwg.org/dwc/terms/"); private static final Namespace dcterms= new Namespace("dcterms", "http://purl.org/dc/terms/"); private static final Namespace prism= new Namespace("prism", "http://prismstandard.org/namespaces/basic/2.0/"); - private ArticleCitation citation; private Element pubRoot; private Element pkgRoot; public CitationParser(File path){ - - citation = new ArticleCitation(); - + File pubFile = new File(path, "dryadpub.xml"); SAXReader pubReader = new SAXReader(); Document pubDoc= null ; @@ -52,31 +50,69 @@ e.printStackTrace(); } + citation = new ArticleCitation(); loadData(); } private void loadData(){ - - citation.setAbstract(getNode(pubRoot,"description",dcterms).getText()); - citation.setDoi(getNode(pubRoot,"identifier",dcterms).getText());; + + Node description = getNode(pubRoot,"description",dcterms); + if(description!=null)citation.setAbstract(description.getText()); - citation.setTitle(getNode(pubRoot,"title",dcterms).getText()); - citation.setIssue(getNode(pubRoot,"issueIdentifier",prism).getText()); - citation.setJournal(getNode(pubRoot,"publicationName",prism).getText()); - citation.setVolume(getNode(pubRoot,"volume",prism).getText()); - citation.setPages(getNode(pubRoot,":pageRange",prism).getText()); + Node identifier = getNode(pubRoot,"identifier",dcterms); + if(identifier!=null)citation.setDoi(identifier.getText());; - //citation.setKeywords(getNode(pubRoot,"description",dcterms).getText()); - //citation.setAuthors(pAuthors); + Node title = getNode(pubRoot,"title",dcterms); + if(title!=null)citation.setTitle(title.getText()); - //citation.setPublishYear(getNode(pubRoot,"issued",dcterms).getText()); - //citation.setPublished(getNode(pubRoot,"description",dcterms).getText()); + Node issueIdentifier = getNode(pubRoot,"issueIdentifier",prism); + if(issueIdentifier!=null)citation.setIssue(issueIdentifier.getText()); + Node publicationName = getNode(pubRoot,"publicationName",prism); + if(publicationName!=null)citation.setJournal(publicationName.getText()); + + Node volume = getNode(pubRoot,"volume",prism); + if(volume!=null)citation.setVolume(volume.getText()); + + Node pageRange = getNode(pubRoot,"pageRange",prism); + if(pageRange!=null)citation.setPages(pageRange.getText()); + + List<Node> kl = getNodes(pkgRoot,"subject",dcterms); + String keywords=""; + for(int i = 0; i<kl.size(); i++) { + keywords+= kl.get(i).getText()+","; + } + citation.setKeywords(keywords.substring(0, keywords.length()-1)); + + List<Node> al = getNodes(pubRoot,"creator",dcterms); + for(int i = 0; i<al.size(); i++) { + String []names = al.get(i).getText().split(","); + if(names.length >1 ){ + Person p = new Person (); + p.setFirstName(names[1]); + p.setLastName(names[0]); + citation.addAuthor(p); + } + } + + try{ + int issue = Integer.parseInt(getNode(pubRoot,"issued",dcterms).getText()); + citation.setPublishYear(issue); + }catch(Exception e){ + + } + + + if(getNode(pubRoot,"pubStatus",null).getText()!=null){ + if("published".compareToIgnoreCase(getNode(pubRoot,"pubStatus",null).getText())==0) + citation.setPublished(true); + else citation.setPublished(false); + } } private Node getNode(Element root, String localName, Namespace namespace){ - + if(namespace==null)return root.element(new QName(localName)); return root.element(new QName(localName, namespace)); } @@ -85,8 +121,7 @@ return root.elements(new QName(localName, namespace)); } - - public Citation getCitation() { + public ArticleCitation getCitation() { return citation; } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java 2010-07-14 02:16:55 UTC (rev 732) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java 2010-07-14 20:45:11 UTC (rev 733) @@ -1,7 +1,9 @@ package org.cipres.treebase.web.util; import java.io.File; +import java.io.FileFilter; import java.io.FilenameFilter; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Iterator; @@ -14,41 +16,26 @@ public class DryadUtil { - - - public static Citation createCitation(File path){ - Citation citation = new Citation(); - - File f = new File(path, "citation.xml"); - SAXReader reader = new SAXReader(); - Document doc= null ; - try { - doc = reader.read(f); - } catch (DocumentException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - Element root = doc.getRootElement(); - Element node; - for (Iterator i = root.elementIterator("author"); i.hasNext();) { - node = (Element) i.next(); - Person p = new Person(); - //node.getName(); - citation.addAuthor(p); - } - citation.setTitle(root.element("title").getName()); - - - return citation; - } - public static Collection<File> getDataFiles(File path) { // TODO Auto-generated method stub - List<File> flist=Arrays.asList(path.listFiles(new FilenameFilter() { - public boolean accept(File file, String name) { - boolean ret = !(name.endsWith("xml")); - return ret; - }})); + File[] files = path.listFiles(new FileFilter() { + public boolean accept(File file) { + return file.isDirectory(); + }}); + + List<File> flist = new ArrayList<File>(); + + for(int i=0; i<files.length; i++){ + + File[] nexus = files[i].listFiles(new FilenameFilter() { + public boolean accept(File file, String name) { + boolean ret = !(name.endsWith("nexus")); + return ret; + }}); + + if (nexus!=null && nexus.length>0) flist.addAll(Arrays.asList(nexus)); + } + return flist; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2010-07-14 02:17:04
|
Revision: 732 http://treebase.svn.sourceforge.net/treebase/?rev=732&view=rev Author: youjun Date: 2010-07-14 02:16:55 +0000 (Wed, 14 Jul 2010) Log Message: ----------- handshaking page, controller, util Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/loginForm.jsp Added Paths: ----------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/CitationParser.java 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 2010-07-13 16:38:00 UTC (rev 731) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2010-07-14 02:16:55 UTC (rev 732) @@ -21,7 +21,12 @@ public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { - String importKey = (String)request.getSession().getAttribute("importKey"); + String importKey = null; + if(request.getParameter("importKey") != null){ + importKey = (String)request.getAttribute("importKey"); + request.getSession().setAttribute("importKey",importKey); + } + if (importKey != null && importKey.length()>0) { return new ModelAndView("redirect:/user/studyForm.html"); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java 2010-07-13 16:38:00 UTC (rev 731) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java 2010-07-14 02:16:55 UTC (rev 732) @@ -2,6 +2,7 @@ package org.cipres.treebase.web.controllers; import java.io.File; +import java.io.FileFilter; import java.util.Collection; import javax.servlet.ServletException; @@ -127,32 +128,41 @@ ControllerUtil.saveStudy(request, submission.getStudy()); } else if(importKey != null && importKey.length()>0){ - - String uploadDir = getServletContext() - .getRealPath(TreebaseUtil.FILESEP + "DryadUpload") - + TreebaseUtil.FILESEP + importKey; + String uploadpath = getServletContext() + .getRealPath(TreebaseUtil.FILESEP + "DryadFileUpload") + + TreebaseUtil.FILESEP + importKey; String importStatus=""; - File bagitPath= new File(uploadDir, "data"); - if(!bagitPath.exists())importStatus = "NOT FOUND"; - else{ - try{ + File uploadDir=new File(uploadpath); + if(!uploadDir.exists()){ + importStatus = "NOT FOUND"; + return new ModelAndView(new RedirectView("submissionList.html")); + } + + File[] uploadFiles = uploadDir.listFiles(new FileFilter(){public boolean accept(File file){return file.isDirectory();}}); + if(uploadDir.length()==0){ + importStatus = "NOT FOUND"; + return new ModelAndView(new RedirectView("submissionList.html")); + } + File bagitPath = uploadFiles[0]; + File dataPath = new File(bagitPath, "data"); + + try{ Submission submission = mSubmissionService.createSubmission(user, new Study()); - - Citation citation = DryadUtil.createCitation(bagitPath); + Citation citation = DryadUtil.createCitation(dataPath); submission.getStudy().setCitation(citation); citation.setStudy(submission.getStudy()); - Collection<File> files = DryadUtil.getDataFiles(bagitPath); + Collection<File> files = DryadUtil.getDataFiles(dataPath); MyProgressionListener listener = new MyProgressionListener(); getSubmissionService().addNexusFilesJDBC(submission, files, listener); // save Study object to session ControllerUtil.saveStudy(request, submission.getStudy()); importStatus = "OK"; - }catch (Exception e) { + }catch (Exception e) { importStatus = "FAILED"; - } } + request.setAttribute("importStatus", importStatus); //request.getSession().removeAttribute("importKey"); return new ModelAndView(new RedirectView("submissionList.html")); Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/CitationParser.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/CitationParser.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/CitationParser.java 2010-07-14 02:16:55 UTC (rev 732) @@ -0,0 +1,93 @@ +package org.cipres.treebase.web.util; + +import java.io.File; +import java.util.List; + +import org.cipres.treebase.domain.study.ArticleCitation; +import org.cipres.treebase.domain.study.Citation; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.Namespace; +import org.dom4j.Node; +import org.dom4j.QName; +import org.dom4j.io.SAXReader; + +public class CitationParser { + + private static final Namespace xs = new Namespace("xs","http://www.w3.org/2001/XMLSchema"); + private static final Namespace dwc= new Namespace("dwc", "http://rs.tdwg.org/dwc/terms/"); + private static final Namespace dcterms= new Namespace("dcterms", "http://purl.org/dc/terms/"); + private static final Namespace prism= new Namespace("prism", "http://prismstandard.org/namespaces/basic/2.0/"); + + private ArticleCitation citation; + private Element pubRoot; + private Element pkgRoot; + + + public CitationParser(File path){ + + citation = new ArticleCitation(); + + File pubFile = new File(path, "dryadpub.xml"); + SAXReader pubReader = new SAXReader(); + Document pubDoc= null ; + try { + pubDoc = pubReader.read(pubFile); + pubRoot = pubDoc.getRootElement(); + } catch (DocumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + + File pkgFile = new File(path, "dryadpkg.xml"); + SAXReader pkgReader = new SAXReader(); + Document pkgDoc= null ; + try { + pkgDoc = pkgReader.read(pkgFile); + pkgRoot = pkgDoc.getRootElement(); + } catch (DocumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + loadData(); + } + + + private void loadData(){ + + citation.setAbstract(getNode(pubRoot,"description",dcterms).getText()); + citation.setDoi(getNode(pubRoot,"identifier",dcterms).getText());; + + citation.setTitle(getNode(pubRoot,"title",dcterms).getText()); + citation.setIssue(getNode(pubRoot,"issueIdentifier",prism).getText()); + citation.setJournal(getNode(pubRoot,"publicationName",prism).getText()); + citation.setVolume(getNode(pubRoot,"volume",prism).getText()); + citation.setPages(getNode(pubRoot,":pageRange",prism).getText()); + + //citation.setKeywords(getNode(pubRoot,"description",dcterms).getText()); + //citation.setAuthors(pAuthors); + + //citation.setPublishYear(getNode(pubRoot,"issued",dcterms).getText()); + //citation.setPublished(getNode(pubRoot,"description",dcterms).getText()); + + } + + private Node getNode(Element root, String localName, Namespace namespace){ + + return root.element(new QName(localName, namespace)); + } + + private List<Node> getNodes(Element root, String localName, Namespace namespace){ + + return root.elements(new QName(localName, namespace)); + } + + + public Citation getCitation() { + return citation; + } + +} Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java 2010-07-13 16:38:00 UTC (rev 731) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java 2010-07-14 02:16:55 UTC (rev 732) @@ -15,6 +15,7 @@ public class DryadUtil { + public static Citation createCitation(File path){ Citation citation = new Citation(); Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/loginForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/loginForm.jsp 2010-07-13 16:38:00 UTC (rev 731) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/loginForm.jsp 2010-07-14 02:16:55 UTC (rev 732) @@ -2,13 +2,15 @@ <form method="post" id="loginForm" action="<c:url value="/j_security_check"/>" > +<!-- <% if(request.getParameter("importKey") != null){ session.setAttribute("importKey",request.getParameter("importKey")); } %> - +--> + <fieldset> <legend>Login</legend> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2010-07-13 16:38:10
|
Revision: 731 http://treebase.svn.sourceforge.net/treebase/?rev=731&view=rev Author: youjun Date: 2010-07-13 16:38:00 +0000 (Tue, 13 Jul 2010) Log Message: ----------- Modified Paths: -------------- trunk/treebase-web/pom.xml trunk/treebase-web/src/main/webapp/WEB-INF/web.xml Added Paths: ----------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/UnTarTool.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/webservices/DryadImportor.java Modified: trunk/treebase-web/pom.xml =================================================================== --- trunk/treebase-web/pom.xml 2010-07-07 19:32:38 UTC (rev 730) +++ trunk/treebase-web/pom.xml 2010-07-13 16:38:00 UTC (rev 731) @@ -21,6 +21,9 @@ </resource> </resources> <finalName>treebase-web</finalName> + + + <plugins> <!-- Ant Task plugin--> @@ -80,26 +83,20 @@ <repository> <id>org.tuckey.urlrewritefilter</id> <url>http://repository.jboss.org/maven2/org/tuckey/urlrewritefilter/</url> - </repository> - + </repository> + <repository> + <id>java.net</id> + <url>http://download.java.net/maven/2</url> + </repository> + + </repositories> + - <pluginRepositories> - <pluginRepository> - <id>Maven Snapshots</id> - <url>http://snapshots.maven.codehaus.org/maven2</url> - <snapshots> - <enabled>true</enabled> - </snapshots> - <releases> - <enabled>false</enabled> - </releases> - </pluginRepository> - </pluginRepositories> - <dependencies> - - + + + <dependencies> <dependency> <groupId>org.nexml.model</groupId> @@ -341,5 +338,36 @@ <artifactId>velocity-tools-view</artifactId> <version>1.1</version> </dependency> - </dependencies> + +<dependency> +<groupId>com.sun.jersey</groupId> +<artifactId>jersey-client</artifactId> +<version>1.1.5</version> +</dependency> + +<dependency> +<groupId>com.sun.jersey</groupId> +<artifactId>jersey-server</artifactId> +<version>1.1.5</version> +</dependency> + +<dependency> +<groupId>com.sun.jersey.contribs</groupId> +<artifactId>jersey-multipart</artifactId> +<version>1.1.5</version> +</dependency> + +<dependency> +<groupId>com.sun.jersey</groupId> +<artifactId>jersey-bundle</artifactId> +<version>1.1.5</version> +</dependency> + +<dependency> +<groupId>javax.ws.rs</groupId> +<artifactId>jsr311-api</artifactId> +<version>1.0</version> +</dependency> +</dependencies> + </project> Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/UnTarTool.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/UnTarTool.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/UnTarTool.java 2010-07-13 16:38:00 UTC (rev 731) @@ -0,0 +1,69 @@ +package org.cipres.treebase.web.util; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.zip.GZIPInputStream; + +import org.apache.tools.tar.TarEntry; +import org.apache.tools.tar.TarInputStream; + +public class UnTarTool +{ + + public static void unTarGz(File file,File outDir) throws IOException{ + + TarInputStream tarIn = null; + + try{ + + tarIn = new TarInputStream(new GZIPInputStream( + new BufferedInputStream(new FileInputStream(file))), + 1024); + + TarEntry entry = null; + //tarIn.getNextEntry(); + //File outputDir = new File(outDir, "myBag"); + //outputDir.mkdirs(); + while( (entry = tarIn.getNextEntry()) != null ){ + File f = new File(outDir,entry.getName()); + if(entry.isDirectory()){ + f.mkdirs(); + }else{ + f.getParentFile().mkdirs(); + f.createNewFile(); + OutputStream out = null; + try{ + out = new FileOutputStream(f); + int length = 0; + byte[] b = new byte[1024]; + while((length = tarIn.read(b)) != -1){ + out.write(b, 0, length); + } + + }catch(IOException ex){ + throw ex; + }finally{ + if(out!=null) + out.close(); + } + } + } + }catch(IOException ex){ + throw ex; + } finally{ + try{ + if(tarIn != null){ + tarIn.close(); + } + }catch(IOException ex){ + throw ex; + } + } + + } + +} Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/webservices/DryadImportor.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/webservices/DryadImportor.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/webservices/DryadImportor.java 2010-07-13 16:38:00 UTC (rev 731) @@ -0,0 +1,104 @@ +package org.cipres.treebase.web.webservices; + + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; + +import com.sun.jersey.multipart.*; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.Consumes; +//import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.core.Context; + +import org.cipres.treebase.TreebaseUtil; +import org.cipres.treebase.web.util.UnTarTool; + + + +@Path("/dryadImport") + +public class DryadImportor { + + @Context + HttpServletRequest httpRequest; + + @PUT + //@POST + //@GET + + @Consumes("multipart/mixed") + +public String processMultiparts(MultiPart multiPart) { + + String ip = httpRequest.getRemoteAddr(); + if(!AllowIP.isAllowIP(ip))return "not authorized"; + + BodyPartEntity bpe = (BodyPartEntity) multiPart.getBodyParts().get(0).getEntity(); + File unzipFold; + String systemTime; + + do{ + systemTime = "" + System.currentTimeMillis(); + String uploadDir = httpRequest.getSession().getServletContext() + .getRealPath(TreebaseUtil.FILESEP + "DryadFileUpload") + + TreebaseUtil.FILESEP + systemTime; + unzipFold = new File(uploadDir); + }while(unzipFold.exists()); + + + File zipfile = new File(unzipFold,"data.tar.gz"); + + try { + unzipFold.mkdirs(); + zipfile.createNewFile(); + InputStream in = bpe.getInputStream(); + OutputStream out=new FileOutputStream(zipfile); + + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0){ + out.write(buf, 0, len); + } + in.close(); + out.close(); + UnTarTool.unTarGz(zipfile,unzipFold); + + } catch (IOException e) { + // TODO Auto-generated catch block + StringWriter sw = new StringWriter(); + e.printStackTrace(new PrintWriter(sw)); + return sw.getBuffer().toString(); + } + String[] baseURL=httpRequest.getRequestURL().toString().split("handshaking"); + String importURL= baseURL[0] + "login.jsp?importKey=" + systemTime; + + return importURL; + + } + +} + +class AllowIP{ + private static final String dryad1 = "152.1.24.8"; + private static final String dryad2 = "152.3.105.16"; + private static final String yale1 = "130.132.27.141"; + private static final String yale2 = "130.132.27.212"; + + static boolean isAllowIP(String ip){ + + if (ip.compareTo(dryad1)==0) return true; + if (ip.compareTo(dryad2)==0) return true; + if (ip.compareTo(yale1)==0)return true; + if (ip.compareTo(yale2)==0)return true; + + return false; + } + +} Modified: trunk/treebase-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-07-07 19:32:38 UTC (rev 730) +++ trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2010-07-13 16:38:00 UTC (rev 731) @@ -120,13 +120,67 @@ <!-- ========================================================== --> <filter-mapping> <filter-name>securityFilter</filter-name> - <url-pattern>/*</url-pattern> + <url-pattern>/*</url-pattern> </filter-mapping> - <filter-mapping> + + <filter-mapping> <filter-name>sitemesh</filter-name> - <url-pattern>/*</url-pattern> + <url-pattern>*.html</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> + </filter-mapping> + + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>*.jsp</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> + + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>*.htm</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> + + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>*.rdf</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> + + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>/</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>/phylows/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> + + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>/top/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> + + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>/services/*</url-pattern> + <dispatcher>REQUEST</dispatcher> + <dispatcher>FORWARD</dispatcher> + </filter-mapping> + + <filter-mapping> + <filter-name>hibernateFilter</filter-name> + <url-pattern>*.html</url-pattern> </filter-mapping> <filter-mapping> <filter-name>hibernateFilter</filter-name> @@ -197,8 +251,22 @@ </servlet-class> </servlet> - + <!-- ========================================================== --> + <!-- Processed by Jersey --> + <!-- ========================================================== --> + <servlet> + <servlet-name>HandshakingServlet</servlet-name> + <servlet-class> + com.sun.jersey.spi.container.servlet.ServletContainer + </servlet-class> + <init-param> + <param-name>com.sun.jersey.config.property.packages</param-name> + <param-value>org.cipres.treebase.web.webservices</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + <!-- ========================================================== --> <!-- url pattern that will be processed by DispatcherServlet --> <!-- ========================================================== --> @@ -239,6 +307,14 @@ <servlet-mapping> <servlet-name>CXFServlet</servlet-name> <url-pattern>/services/*</url-pattern> + </servlet-mapping> + + <!-- ========================================================== --> + <!-- url pattern that will be processed by CXFServlet --> + <!-- ========================================================== --> + <servlet-mapping> + <servlet-name>HandshakingServlet</servlet-name> + <url-pattern>/handshaking/*</url-pattern> </servlet-mapping> <!-- ========================================================== --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <yo...@us...> - 2010-07-07 20:08:39
|
Revision: 730 http://treebase.svn.sourceforge.net/treebase/?rev=730&view=rev Author: youjun Date: 2010-07-07 19:32:38 +0000 (Wed, 07 Jul 2010) Log Message: ----------- handshacking web path Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/loginForm.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionList.jsp Added Paths: ----------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java 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 2010-07-02 16:30:32 UTC (rev 729) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2010-07-07 19:32:38 UTC (rev 730) @@ -21,7 +21,11 @@ public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { + String importKey = (String)request.getSession().getAttribute("importKey"); + if (importKey != null && importKey.length()>0) { + return new ModelAndView("redirect:/user/studyForm.html"); + } if (request.isUserInRole(UserRole.ROLE_ADMIN) || request.isUserInRole(UserRole.ROLE_ASSO_EDITOR)) { return new ModelAndView("redirect:/admin/administrationPage.html"); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java 2010-07-02 16:30:32 UTC (rev 729) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudyFormController.java 2010-07-07 19:32:38 UTC (rev 730) @@ -1,6 +1,9 @@ package org.cipres.treebase.web.controllers; +import java.io.File; +import java.util.Collection; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -14,12 +17,15 @@ import org.cipres.treebase.domain.admin.User; import org.cipres.treebase.domain.admin.UserService; +import org.cipres.treebase.domain.study.Citation; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.study.StudyService; import org.cipres.treebase.domain.study.Submission; import org.cipres.treebase.domain.study.SubmissionService; import org.cipres.treebase.web.Constants; +import org.cipres.treebase.web.model.MyProgressionListener; import org.cipres.treebase.web.util.ControllerUtil; +import org.cipres.treebase.web.util.DryadUtil; /** * StudyFormController.java @@ -96,7 +102,9 @@ Study study = (Study) command; User user = ControllerUtil.getUser(request, mUserService); - + String importKey = (String)request.getSession().getAttribute("importKey"); + request.getSession().removeAttribute("importKey"); + if (request.getParameter(ACTION_SUBMIT) != null) { // Study must be submitted with citation together // here we are just saving the data to the session @@ -118,7 +126,38 @@ // save Study object to session and remove ControllerUtil.saveStudy(request, submission.getStudy()); - } else if (request.getParameter(ACTION_UPDATE) != null) { + } else if(importKey != null && importKey.length()>0){ + + String uploadDir = getServletContext() + .getRealPath(TreebaseUtil.FILESEP + "DryadUpload") + + TreebaseUtil.FILESEP + importKey; + String importStatus=""; + File bagitPath= new File(uploadDir, "data"); + if(!bagitPath.exists())importStatus = "NOT FOUND"; + else{ + + try{ + Submission submission = mSubmissionService.createSubmission(user, new Study()); + + Citation citation = DryadUtil.createCitation(bagitPath); + submission.getStudy().setCitation(citation); + citation.setStudy(submission.getStudy()); + + Collection<File> files = DryadUtil.getDataFiles(bagitPath); + MyProgressionListener listener = new MyProgressionListener(); + getSubmissionService().addNexusFilesJDBC(submission, files, listener); + // save Study object to session + ControllerUtil.saveStudy(request, submission.getStudy()); + importStatus = "OK"; + }catch (Exception e) { + importStatus = "FAILED"; + } + } + request.setAttribute("importStatus", importStatus); + //request.getSession().removeAttribute("importKey"); + return new ModelAndView(new RedirectView("submissionList.html")); + + }else if (request.getParameter(ACTION_UPDATE) != null) { mStudyService.update(study); } else if (request.getParameter(ACTION_DELETE) != null) { Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/util/DryadUtil.java 2010-07-07 19:32:38 UTC (rev 730) @@ -0,0 +1,54 @@ +package org.cipres.treebase.web.util; + +import java.io.File; +import java.io.FilenameFilter; +import java.util.Arrays; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; + +import org.cipres.treebase.domain.admin.Person; +import org.cipres.treebase.domain.study.Citation; +import org.dom4j.*; +import org.dom4j.io.*; + +public class DryadUtil { + + + public static Citation createCitation(File path){ + Citation citation = new Citation(); + + File f = new File(path, "citation.xml"); + SAXReader reader = new SAXReader(); + Document doc= null ; + try { + doc = reader.read(f); + } catch (DocumentException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + Element root = doc.getRootElement(); + Element node; + for (Iterator i = root.elementIterator("author"); i.hasNext();) { + node = (Element) i.next(); + Person p = new Person(); + //node.getName(); + citation.addAuthor(p); + } + citation.setTitle(root.element("title").getName()); + + + return citation; + } + + public static Collection<File> getDataFiles(File path) { + // TODO Auto-generated method stub + List<File> flist=Arrays.asList(path.listFiles(new FilenameFilter() { + public boolean accept(File file, String name) { + boolean ret = !(name.endsWith("xml")); + return ret; + }})); + return flist; + } + +} Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/loginForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/loginForm.jsp 2010-07-02 16:30:32 UTC (rev 729) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/loginForm.jsp 2010-07-07 19:32:38 UTC (rev 730) @@ -2,6 +2,13 @@ <form method="post" id="loginForm" action="<c:url value="/j_security_check"/>" > +<% + if(request.getParameter("importKey") != null){ + + session.setAttribute("importKey",request.getParameter("importKey")); + } +%> + <fieldset> <legend>Login</legend> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionList.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionList.jsp 2010-07-02 16:30:32 UTC (rev 729) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/submissionList.jsp 2010-07-07 19:32:38 UTC (rev 730) @@ -101,7 +101,19 @@ </display:footer> <display:setProperty name="basic.empty.showtable" value="true"/> - + </display:table> </fieldset> +<fieldset> +<legend>Dryad Import Result +<a href="#" class="openHelp" onclick="openHelp('dryadImport')"><img class="iconButton" src="<fmt:message key="icons.help"/>" /></a> +</legend> + <div align="center"> + <c:choose> + <c:when test="${importStatus =='NOT FOUND'}"><c:out value="Sorry, we cannot find your data"/></c:when> + <c:when test="${importStatus =='OK'}"><c:out value="Import finished"/></c:when> + <c:when test="${importStatus =='FAILED'}"><c:out value="Sorry, One or more data file cannot parsed correctly, you may add your data via treebase interfaces"/></c:when> + </c:choose> + </div> +</fieldset> </form> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2010-07-06 16:25:18
|
Bugs item #3025925, was opened at 2010-07-06 12:25 Message generated for change (Tracker Item Submitted) made by sfrgpiel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3025925&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Priority: 6 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: Nobody/Anonymous (nobody) Summary: Yikes when viewing taxa for S10508 Initial Comment: Looking at the taxa for S10508: http://treebase.nescent.org/treebase-web/search/study/taxa.html?id=10508 generates a Yikes! re. "javax.servlet.jsp.JspException: No bean specified" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3025925&group_id=248804 |
From: <sfr...@us...> - 2010-07-02 16:30:38
|
Revision: 729 http://treebase.svn.sourceforge.net/treebase/?rev=729&view=rev Author: sfrgpiel Date: 2010-07-02 16:30:32 +0000 (Fri, 02 Jul 2010) Log Message: ----------- This is Jon Auman's fix for the problem when the tuckey.org site is unavailable. Modified Paths: -------------- trunk/treebase-web/src/main/webapp/WEB-INF/urlrewrite.xml Modified: trunk/treebase-web/src/main/webapp/WEB-INF/urlrewrite.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/urlrewrite.xml 2010-07-02 16:29:45 UTC (rev 728) +++ trunk/treebase-web/src/main/webapp/WEB-INF/urlrewrite.xml 2010-07-02 16:30:32 UTC (rev 729) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN" - "http://tuckey.org/res/dtds/urlrewrite3.2.dtd"> + "./dtd/urlrewrite3.2.dtd"> <!-- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2010-07-02 16:29:54
|
Revision: 728 http://treebase.svn.sourceforge.net/treebase/?rev=728&view=rev Author: sfrgpiel Date: 2010-07-02 16:29:45 +0000 (Fri, 02 Jul 2010) Log Message: ----------- Adding the dtd file for urlrewrite from tuckey.org Added Paths: ----------- trunk/treebase-web/src/main/webapp/WEB-INF/dtd/ trunk/treebase-web/src/main/webapp/WEB-INF/dtd/urlrewrite3.2.dtd Added: trunk/treebase-web/src/main/webapp/WEB-INF/dtd/urlrewrite3.2.dtd =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/dtd/urlrewrite3.2.dtd (rev 0) +++ trunk/treebase-web/src/main/webapp/WEB-INF/dtd/urlrewrite3.2.dtd 2010-07-02 16:29:45 UTC (rev 728) @@ -0,0 +1,90 @@ +<!-- + UrlRewriteFilter DTD + http://tuckey.org/urlrewrite/ +--> + +<!ELEMENT urlrewrite ((rule|class-rule|outbound-rule)*, catch*)> +<!ATTLIST urlrewrite +use-query-string (true|false) "false" +use-context (true|false) "false" +decode-using CDATA #IMPLIED +default-match-type (regex|wildcard) #IMPLIED +> + +<!ELEMENT rule (name?, note?, condition*, from?, set*, run*, to?)> +<!ATTLIST rule +enabled (true|false) "true" +match-type (regex|wildcard) #IMPLIED +> + +<!ELEMENT class-rule EMPTY> +<!ATTLIST class-rule +class CDATA #IMPLIED +method CDATA "matches" +last (true|false) "true" +> + +<!ELEMENT outbound-rule (name?, note?, condition*, from, set*, run*, to?)> +<!ATTLIST outbound-rule +enabled (true|false) "true" +encodefirst (true|false) "false" +match-type (regex|wildcard) #IMPLIED +> + +<!ELEMENT name (#PCDATA)> +<!ELEMENT note (#PCDATA)> + +<!ELEMENT condition (#PCDATA)> +<!ATTLIST condition +type (time|year|month|dayofmonth|dayofweek|ampm|hourofday|minute|second|millisecond|attribute|auth-type|character-encoding|content-length|content-type|context-path|cookie|header|local-port|method|parameter|path-info|path-translated|protocol|query-string|remote-addr|remote-host|remote-user|requested-session-id|request-uri|request-url|session-attribute|session-isnew|port|server-name|scheme|user-in-role|exception) "header" +name CDATA #IMPLIED +next (and|or) "and" +casesensitive (true|false) "false" +operator (equal|notequal|greater|less|greaterorequal|lessorequal|instanceof) "equal" +> + +<!ELEMENT from (#PCDATA)> +<!ATTLIST from +casesensitive (true|false) "false" +> + +<!ELEMENT set (#PCDATA)> +<!ATTLIST set +type (request|session|response-header|cookie|content-type|charset|locale|status|expires|parameter|method) "request" +name CDATA #IMPLIED +> + +<!ELEMENT to (#PCDATA)> +<!ATTLIST to +type (redirect|temporary-redirect|permanent-redirect|pre-include|post-include|forward|passthrough|proxy) "forward" +last (true|false) "false" +encode (true|false) #IMPLIED +context CDATA #IMPLIED +> + +<!-- +eg, +<run class="org.tuckey.web.filters.urlrewrite.TestTargetOther" method="runMeFool" /> +<run class="org.tuckey.web.filters.urlrewrite.TestTargetOther" method="run"> + <init-param> + <param-name>biteMe</param-name> + <param-value>10</param-value> + </init-param> +</run> +--> +<!ELEMENT run (init-param*)> +<!ATTLIST run +class CDATA #IMPLIED +method CDATA #IMPLIED +jsonhandler (true|false) "false" +neweachtime (true|false) "false" +> + +<!ELEMENT init-param (param-name, param-value)> +<!ELEMENT param-name (#PCDATA)> +<!ELEMENT param-value (#PCDATA)> + +<!ELEMENT catch (run?)> +<!ATTLIST catch +class CDATA #IMPLIED +> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2010-06-29 16:07:39
|
Revision: 727 http://treebase.svn.sourceforge.net/treebase/?rev=727&view=rev Author: sfrgpiel Date: 2010-06-29 16:07:30 +0000 (Tue, 29 Jun 2010) Log Message: ----------- Image of Junli Ping Added Paths: ----------- trunk/treebase-web/src/main/webapp/images/people/jping.jpg Added: trunk/treebase-web/src/main/webapp/images/people/jping.jpg =================================================================== (Binary files differ) Property changes on: trunk/treebase-web/src/main/webapp/images/people/jping.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2010-06-29 16:07:12
|
Revision: 726 http://treebase.svn.sourceforge.net/treebase/?rev=726&view=rev Author: sfrgpiel Date: 2010-06-29 16:07:03 +0000 (Tue, 29 Jun 2010) Log Message: ----------- Added Junli Ping Modified Paths: -------------- trunk/treebase-web/src/main/webapp/WEB-INF/pages/people.jsp Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/people.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/people.jsp 2010-06-29 15:44:37 UTC (rev 725) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/people.jsp 2010-06-29 16:07:03 UTC (rev 726) @@ -32,13 +32,18 @@ <br/>Prototype Dev </td> <td> - <img src="images/people/mplaza.jpg" width="81" height="108" alt="Melanie Plaza"/> - <br/><strong>Melanie Plaza</strong> + <img src="http://www.treebase.org/treebase-web/images/people/jping.jpg" width="81" height="108" alt="Junli Ping"/> + <br/><strong>Junli Ping</strong> <br/>Metadata Editor </td> </tr> <tr> <td> + <img src="http://www.treebase.org/treebase-web/images/people/mplaza.jpg" width="81" height="108" alt="Melanie Plaza"/> + <br/><strong>Melanie Plaza</strong> + <br/>Metadata Editor + </td> + <td> <img src="images/people/vtannen.jpeg" width="81" height="108" alt="Val Tannen"/> <br/><strong>Val Tannen</strong> <br/>Development Leader @@ -64,11 +69,6 @@ <br/><strong>Volunteeers?</strong> <br/>Please sign up! </td> - <td> - <img src="images/people/anon.jpg" width="81" height="108" alt="Volunteeers"/> - <br/><strong>Volunteeers?</strong> - <br/>Please sign up! - </td> </tr> </table> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2010-06-29 15:44:47
|
Revision: 725 http://treebase.svn.sourceforge.net/treebase/?rev=725&view=rev Author: sfrgpiel Date: 2010-06-29 15:44:37 +0000 (Tue, 29 Jun 2010) Log Message: ----------- Added text to direct users with older published study IDs to search by "Legacy Study ID" Modified Paths: -------------- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp 2010-06-22 15:16:15 UTC (rev 724) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp 2010-06-29 15:44:37 UTC (rev 725) @@ -1,6 +1,7 @@ <%@ include file="/common/taglibs.jsp"%> <form id="searchSimple" method="post"> <fieldset> + For study IDs with values less than 3000, please search using the "Legacy Study ID" button.<br> Search: <input type="hidden" name="formName" value="searchKeyword"/> <input type="text" class="textCell" style="width:150px" name="searchTerm" id="keyword" value="${searchTerm}"/> <button type="submit" name="searchButton" value="studyID">Study ID</button> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-22 15:16:21
|
Revision: 724 http://treebase.svn.sourceforge.net/treebase/?rev=724&view=rev Author: rvos Date: 2010-06-22 15:16:15 +0000 (Tue, 22 Jun 2010) Log Message: ----------- The baseURL session attribute is now set to the PURL domain (which is obtained from the JNDI configuration) instead of trying (and failing) to compute it from the local domain address. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2010-06-22 15:02:32 UTC (rev 723) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2010-06-22 15:16:15 UTC (rev 724) @@ -156,7 +156,7 @@ baseURL.append("/treebase-web/phylows"); request.getSession().setAttribute("recordSchema", schema); request.getSession().setAttribute("format", request.getParameter("format")); - request.getSession().setAttribute("baseURL", baseURL.toString()); + request.getSession().setAttribute("baseURL", TreebaseUtil.getPurlBase()); request.getSession().setAttribute("domainAddress", domainAddress.toString()); request.getSession().setAttribute("phyloWSPath", phyloWSPath); request.getSession().setAttribute("originalSection", original); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-22 15:02:40
|
Revision: 723 http://treebase.svn.sourceforge.net/treebase/?rev=723&view=rev Author: rvos Date: 2010-06-22 15:02:32 +0000 (Tue, 22 Jun 2010) Log Message: ----------- Apparently there are situations where the list with authors has null elements in it. This probably due to some inconsistency in the database, but it was causing null pointer exceptions in the code here. I've coded more defensively to take this possibility into account. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.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 2010-06-16 15:01:17 UTC (rev 722) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2010-06-22 15:02:32 UTC (rev 723) @@ -482,13 +482,13 @@ if (size > 0) { for (int i = 0; i < size; i++) { - - authorsCitationStyle.append(authors.get(i).getFullNameCitationStyle()); - - if (size > 1 && i == size - 2) { - authorsCitationStyle.append(", & "); - } else if (size > 1 && i < size - 2) { - authorsCitationStyle.append(", "); + if ( null != authors.get(i) ) { + authorsCitationStyle.append(authors.get(i).getFullNameCitationStyle()); + if (size > 1 && i == size - 2) { + authorsCitationStyle.append(", & "); + } else if (size > 1 && i < size - 2) { + authorsCitationStyle.append(", "); + } } } @@ -510,12 +510,14 @@ int size = authors.size(); if (size > 0) { for ( int i = 0; i < size; i++ ) { - authorsCitationStyle.append(authors.get(i).getFullNameCitationStyle()); - if ( size > 1 && i == size - 2 ) { - authorsCitationStyle.append(", & "); - } - else if (size > 1 && i < size - 2) { - authorsCitationStyle.append(", "); + if ( null != authors.get(i) ) { + authorsCitationStyle.append(authors.get(i).getFullNameCitationStyle()); + if ( size > 1 && i == size - 2 ) { + authorsCitationStyle.append(", & "); + } + else if (size > 1 && i < size - 2) { + authorsCitationStyle.append(", "); + } } } } @@ -696,8 +698,10 @@ annotations.add(new Annotation(Constants.DCURI,"dc:title",getTitle())); annotations.add(new Annotation(Constants.DCURI,"dc:creator",getAuthorsAsString())); for ( Person person : getAuthors() ) { - String personName = person.getFullNameCitationStyle(); - annotations.add(new Annotation(Constants.DCURI,"dc:contributor",personName)); + if ( null != person ) { + String personName = person.getFullNameCitationStyle(); + annotations.add(new Annotation(Constants.DCURI,"dc:contributor",personName)); + } } try { if ( null != getPublishYear() ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2010-06-17 11:55:35
|
Bugs item #2977283, was opened at 2010-03-26 21:18 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2977283&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: easy Status: Open Priority: 5 Private: No Submitted By: Mike Keesey (tmkeesey) Assigned to: Rutger Vos (rvos) Summary: crossdomain.xml Initial Comment: In order for Adobe Flash-based web applications to be able to use the PhyloWS API, there needs to be a permissions file at <http://treebase.org/crossdomain.xml>. See, for example, <http://static.flickr.com/crossdomain.xml>. More information on cross-domain policy files can be found here: <http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html>. Attahced is an example crossdomain.xml which would allow the fewest retrictions. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2010-06-17 11:55 Message: This would be nice to have, yes. I have asked the sysadmin to place your suggested file on our server if he thinks that's a good idea. I don't have access to the production server, and I can't oversee what security or performance implications this might have, but we are investigating. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-06-17 11:55 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2977283&group_id=248804 |
From: SourceForge.net <no...@so...> - 2010-06-16 15:51:33
|
Bugs item #2846456, was opened at 2009-08-28 19:28 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2846456&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: data Group: None Status: Open Priority: 6 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: Rutger Vos (rvos) Summary: Need PhyloWS API search by date-time-stamp Initial Comment: We need to be sure that our API can search using data-time-stamps. i.e. "find all studies that were modified since Jan 23, 2010." (and separately, "find all studies that were made public after Jan 23, 2010"). This may require investigating how and where TreeBASE2 is currently tracking modification stamps. If it does not do so yet, we should probably add modification stamp fields on some key tables -- and it's probably easier to do this with a postgresql-level trigger or part of the schema. At any rate, any of the following modifications should stamped and searchable by the API: modifications to the citation, matrix metadata (including row-segment additions/subtractions), tree metadata (including re-rooting a tree), taxon labels, and mapping between taxon labels and taxon variants, and mapping between taxon variants and taxa. i.e., if a study contains a matrix for which a taxon label gets re-mapped to a different taxon variant or taxon at time/date x, then the whole study should be considered changed at time/date x. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2010-06-16 15:51 Message: "If it does not do so yet, we should probably add modification stamp fields on some key tables -- and it's probably easier to do this with a postgresql-level trigger or part of the schema." I have no idea how to do this. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-06-16 15:51 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2846456&group_id=248804 |
From: SourceForge.net <no...@so...> - 2010-06-16 15:30:44
|
Bugs item #2960840, was opened at 2010-02-28 20:05 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2960840&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ui Group: None >Status: Closed Priority: 7 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: Rutger Vos (rvos) Summary: PhyloWS API Issues Need Fixing Initial Comment: A couple of things should be fixed with PhyloWS, some are higher value than others. I would rank items 1 and 4 at level "9," with the other ones lower (but if they are low-hanging easy fixes, it would be great to fix them before the release). 1. Failure with Safari RSS browser: Originally we thought that this failed because RSS results are not delivered with <?xml version="1.0" encoding="utf-8"?> at the top -- but that's not the case. 2. The initial url (e.g. http://purl.org/phylo/treebase/phylows/taxon/find?query=dcterms.title==%22Homo%20sapiens%22&recordSchema=study&format=rss1) uses purl.org but returns a list where the domains change from purl.org to nescent.org -- I'd rather that we not proliferate synonymous URIs that have different domains. Let's keep all "/phylows/" urls with the purl.org domain. 3. Let's add some verbiage to each RSS 1.0 result so that a minium synopsis of readable info is provided to users of RSS browsers. For studies, provide the citation; for matrices, provide matrix name and data type; for trees, provide tree name, tree title, tree type; for taxa, provide the taxon name. So, for example, while the current implementation looks like this: <item rdf:about="http://treebase-dev.nescent.org:6666/treebase-web/phylows/study/TB2:S1925"> <title>TB2:S1925</title> <link>http://treebase-dev.nescent.org:6666/treebase-web/phylows/study/TB2:S1925</link> <description>TB2:S1925</description> </item> ...We need to be more verbose, not only in the <description> so that the user reading the RSS feed has some idea what it is about, but also in the <prism> and <dc> contents, so that machines reading this feed can do something useful with it. In the case of a study, let's return this: <item rdf:about="http://purl.org/phylo/treebase/phylows/study/TB2:S1925"> <title><![CDATA[[Study] Phylogenetic study of clavicipitaceous fungi using acetaldehyde dehydrogenase gene sequences]]></title> <link>http://purl.org/phylo/treebase/phylows/study/TB2:S1925</link> <description><![CDATA[Tanaka, E. and C. Tanaka. 2008. Phylogenetic study of clavicipitaceous fungi using acetaldehyde dehydrogenase gene sequences. Mycoscience, 49(20): 115-125.]]></description> <dc:creator><![CDATA[Tanaka, E.; Tanaka, C.]]></dc:creator> <dc:date>2007-01-01</dc:date> <dc:subject><![CDATA[Phylogenies]]></dc:subject> <dc:title><![CDATA[[Study] Phylogenetic study of clavicipitaceous fungi using acetaldehyde dehydrogenase gene sequences]]></dc:title> <dc:publisher>Mycoscience</dc:publisher> <prism:publicationName>Mycoscience</prism:publicationName> <prism:contributor>Tanaka, Eiji</prism:contributor> <prism:contributor>Tanaka, Chihiro</prism:contributor> <prism:volume>49</prism:volume> <prism:pageRange>115-125</prism:pageRange> <prism:startingPage>115</prism:startingPage> <prism:endingPage>125</prism:endingPage> <prism:doi>10.1007/s10267-007-0401-5</prism:doi> <dcterms:bibliographicCitation>Tanaka, E. and C. Tanaka. 2008. Phylogenetic study of clavicipitaceous fungi using acetaldehyde dehydrogenase gene sequences. Mycoscience, 49(20): 115-125.</dcterms:bibliographicCitation> <prism:publicationDate>2007-01-01</prism:publicationDate> <prism:section>Study</prism:section> </item> 4. PhyloWS requests that search on taxa to return a list of trees are so slow as to be unusable. This problem may be fixed by Youjun, seeing as it is also slow in the web GUI interface and Youjun is tackling the problem there. http://purl.org/phylo/treebase/phylows/taxon/find?query=dcterms.title==%22Homo%20sapiens%22&recordSchema=tree&format=rss1 5. My understanding is that our /phylows/study/find? queries do not support searching on the journal name of an article. It would be great if this were offered because that would let us give journal editors RSS feeds into their own data. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2010-06-16 15:30 Message: 1. Failure with Safari RSS browser: this is a two-part problem, which made it hard to disentangle. One part is that in some cases, non-UTF-8 characters crept in. I've added a static method that filters out these characters from risky strings such as citation titles and abstracts. The other problem seemed to be the previous way in which the client was redirected to the search RSS. This was previously done using a "RedirectView" class, and Safari's feed:// pseudo-protocol didn't like that. This explains why everything seemed fine offline, under some testing scenarios. I changed the implementation to instead return a "ModelAndView" class, and things work now. 2. fixed: the links listed in the RSS are purls. 3. fixed: the returned metadata is now much more extensive, as per the example. 4. not applicable: this isn't a function of the PhyloWS API but of the underlying performance of the core. I am ignoring this item for this ticket. 5. fixed: the predicate for journal names is prism.publicationName, and you can do exact matching ("==") so that you get all matches for "Evolution" (and not also those for "Evolutionary Bioinformatics" etc.) ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-06-16 15:30 Message: Your bug has been resolved. Thanks for the report. ---------------------------------------------------------------------- Comment By: Hilmar Lapp (hlapp) Date: 2010-04-27 16:05 Message: Needs fixing but not threatening TB2 operation. Downgraded to priority 7. ---------------------------------------------------------------------- Comment By: William Piel (sfrgpiel) Date: 2010-04-27 13:12 Message: For the record, I'm adding the following correspondence with Rutger: Hi Rutger, Regarding the RSS problem, I've been playing around with this validator: http://www.ldodds.com/rss_validator/1.0/validator.html ... with some success, but not 100%. One thing I noticed is that if I download the source with Firefox, the saved file has characters in Latin1 instead of UTF8. Thinking that that might be the problem, I posted both original and converted files for this (http://treebase.nescent.org/treebase-web/phylows/study/find?query=prism.publicationName=Nature&format=rss1) feed here: http://treebase.peabody.yale.edu/~piel/nature_orig.rdf http://treebase.peabody.yale.edu/~piel/nature_utf8.rdf Oddly enough, it doesn't seem to make a difference -- in that Safari happily reads and displays both of these. Also, the validator gives the same result whether using the original URL (http://treebase.nescent.org/treebase-web/phylows/study/find?query=prism.publicationName=Nature&format=rss1) or one of these two (it's not happy about the namespace resolution, but other than that, it's okay). So presumably, Safari's problem must have something to do with the mime type or headers communicating the data if they're coming directly from TreeBASE. Next I wanted to look at the case where Firefox won't display it: http://treebase.nescent.org/treebase-web/phylows/study/find?query=prism.publicationName=%22Systematic+Biology%22&format=rss1 If I put this string into the validator, I get: "An invalid XML character (Unicode: 0x1a) was found in the element content of the document." So I put the files here, both original and utf8 converted: http://treebase.peabody.yale.edu/~piel/sysbio_orig.rdf http://treebase.peabody.yale.edu/~piel/sysbio_utf8.rdf Same error with the validator, and Firefox won't render either of them, but oddly enough, Safari is happy to render both of them. So I opened the file in TextWrangler and ran the "Zap Gremlins" feature, and then saved the file here: http://treebase.peabody.yale.edu/~piel/sysbio_zap.rdf With this file, both Firefox and Safari render it okay. However the validator now has a different error: Using org.apache.xerces.parsers.SAXParser Exception net.sf.saxon.trans.XPathException: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. So... at any rate, it looks like the following is the case: 1. Character coding needs to be in UTF8, even if Safari and Firefox don't have a problem with this -- others might. 2. Safari's problem is in the delivery of the RDF file -- if Apache delivers a static RDF file, Safari has no problem. So it's not the content of the file at issue. 3. Firefox's problem is with hidden control characters. take care, Bill ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-03-12 23:47 Message: 1. I think this might be due to the extension(!), I created a mapping so that we give these feeds a .rdf extension and with mime-type application/rss+xml. They now render as expected. 2. we now use purls throughout. 3. this is much harder to do than you'd think. I'll try. 4. this has been fixed already, apparently. 5. we can now use prism.publicationName as a search predicate. I've committed this progress so far, but it has not been reloaded on the server yet. ---------------------------------------------------------------------- Comment By: Hilmar Lapp (hlapp) Date: 2010-03-10 18:25 Message: Downgrading to priority 8 as per conversation with Bill. Itrem #4 has been ifxed already. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-03-01 16:09 Message: Ok, I'll work on this. ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-03-01 16:09 Message: Thanks for reporting this bug. We'll look into it as soon as possible. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=2960840&group_id=248804 |
From: <rv...@us...> - 2010-06-16 15:01:24
|
Revision: 722 http://treebase.svn.sourceforge.net/treebase/?rev=722&view=rev Author: rvos Date: 2010-06-16 15:01:17 +0000 (Wed, 16 Jun 2010) Log Message: ----------- Fixes for issue 2960840: * we want more information in the "description" elements of search RSS. To this end, a @Transient getDescription() method has been added to the NexmlWritable interface, and a default implementation (which returns an empty string) has been added to AbstractPersistedObject. For the Study object, this method is overridden to return the associated Article's abstract (if available). Some classes already have getDescription() methods based on table columns. To these an @Override annotation has been added. * because there are troublesome characters in some abstracts and titles, a method to deal with these has been added to TreebaseUtil ("removeTroublesomeCharacters"), which is invoked by the Study class to process the abstract and title strings that are returned. * the issue with Safari not displaying RSS seems to have to do with the way the view was previously returned, using new ModelAndView(new RedirectView("templateName"));. It seems that this redirecting doesn't play well with Safari's feed:// pseudoprotocol. By instead just returning new ModelAndView("templateName") this issue seems to be fixed. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/GapMode.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/ItemDefinition.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/Matrix.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixDataType.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixKind.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PolyTCount.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/StateFormat.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/CitationStatus.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Software.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/StudyStatus.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonAuthority.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeKind.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeQuality.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeType.java trunk/treebase-core/src/test/java/org/cipres/treebase/TBMockObject.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchResultsAsRDF.jsp Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2010-06-16 15:01:17 UTC (rev 722) @@ -6,6 +6,11 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CodingErrorAction; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; @@ -151,6 +156,25 @@ return buf.toString(); } + public static String removeTroublesomeCharacters(String inString) { + if ( inString == null ) { + return null; + } + StringBuilder newString = new StringBuilder(); + for (int i = 0; i < inString.length(); i++) { + char ch = inString.charAt(i); + // remove any characters outside the valid UTF-8 range as well as all control characters + // except tabs and new lines + if ((ch < 0x00FD && ch > 0x001F) || ch == '\t' || ch == '\n' || ch == '\r') { + newString.append(ch); + } + } + return newString.toString(); + + } + + + /** * Reads the contents of a file into a string * @param file Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2010-06-16 15:01:17 UTC (rev 722) @@ -145,4 +145,13 @@ return null; } + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.NexmlWritable#getDescription() + */ + @Transient + public String getDescription() { + return this.getNamespacedGUID().toString(); + } + } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/NexmlWritable.java 2010-06-16 15:01:17 UTC (rev 722) @@ -5,4 +5,5 @@ public interface NexmlWritable { public List<Annotation> getAnnotations (); public String getLabel(); + public String getDescription(); } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/DiscreteCharState.java 2010-06-16 15:01:17 UTC (rev 722) @@ -92,6 +92,7 @@ * * @return String */ + @Override @Column(name = "Description", nullable = true, length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/GapMode.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/GapMode.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/GapMode.java 2010-06-16 15:01:17 UTC (rev 722) @@ -41,6 +41,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/ItemDefinition.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/ItemDefinition.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/ItemDefinition.java 2010-06-16 15:01:17 UTC (rev 722) @@ -40,6 +40,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/Matrix.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/Matrix.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/Matrix.java 2010-06-16 15:01:17 UTC (rev 722) @@ -83,6 +83,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixDataType.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixDataType.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixDataType.java 2010-06-16 15:01:17 UTC (rev 722) @@ -57,6 +57,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixKind.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixKind.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixKind.java 2010-06-16 15:01:17 UTC (rev 722) @@ -58,6 +58,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_100) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PhyloChar.java 2010-06-16 15:01:17 UTC (rev 722) @@ -53,6 +53,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PolyTCount.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PolyTCount.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/PolyTCount.java 2010-06-16 15:01:17 UTC (rev 722) @@ -40,6 +40,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/StateFormat.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/StateFormat.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/StateFormat.java 2010-06-16 15:01:17 UTC (rev 722) @@ -40,6 +40,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Algorithm.java 2010-06-16 15:01:17 UTC (rev 722) @@ -51,6 +51,7 @@ * * @return String mDescription */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/CitationStatus.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/CitationStatus.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/CitationStatus.java 2010-06-16 15:01:17 UTC (rev 722) @@ -71,6 +71,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_50) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Software.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Software.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Software.java 2010-06-16 15:01:17 UTC (rev 722) @@ -45,6 +45,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Study.java 2010-06-16 15:01:17 UTC (rev 722) @@ -694,11 +694,20 @@ @Override @Transient + public String getDescription() { + if ( null != getCitation() ) { + return TreebaseUtil.removeTroublesomeCharacters(getCitation().getAbstract()); + } + return ""; + } + + @Override + @Transient public String getLabel() { if ( null != getCitation() ) { - return getCitation().getTitle(); + return TreebaseUtil.removeTroublesomeCharacters(getCitation().getTitle()); } - return getName(); + return TreebaseUtil.removeTroublesomeCharacters(getName()); } @Transient Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/StudyStatus.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/StudyStatus.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/StudyStatus.java 2010-06-16 15:01:17 UTC (rev 722) @@ -47,6 +47,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/Taxon.java 2010-06-16 15:01:17 UTC (rev 722) @@ -72,6 +72,7 @@ * * @return String */ + @Override @Column(name = "Description", nullable = true, length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonAuthority.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonAuthority.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonAuthority.java 2010-06-16 15:01:17 UTC (rev 722) @@ -55,6 +55,7 @@ * * @return String */ + @Override @Column(name = "Description", nullable = true, length = TBPersistable.COLUMN_LENGTH_STRING_NOTES) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeKind.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeKind.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeKind.java 2010-06-16 15:01:17 UTC (rev 722) @@ -47,6 +47,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_100) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeQuality.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeQuality.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeQuality.java 2010-06-16 15:01:17 UTC (rev 722) @@ -62,6 +62,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeType.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeType.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/TreeType.java 2010-06-16 15:01:17 UTC (rev 722) @@ -59,6 +59,7 @@ * * @return String */ + @Override @Column(name = "Description", length = TBPersistable.COLUMN_LENGTH_STRING) public String getDescription() { return mDescription; Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/TBMockObject.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/TBMockObject.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/TBMockObject.java 2010-06-16 15:01:17 UTC (rev 722) @@ -80,4 +80,9 @@ return null; } + public String getDescription() { + // TODO Auto-generated method stub + return null; + } + } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2010-06-16 15:01:17 UTC (rev 722) @@ -163,7 +163,7 @@ if ( null != root ) { request.getSession().setAttribute("normalizedCQLQuery", URLEncoder.encode(root.toCQL(),"UTF-8")); } - return new ModelAndView(new RedirectView("searchResultsAsRDF.rdf")); + return new ModelAndView("searchResultsAsRDF"); } protected <E extends TBPersistable> SearchResults<E> intersectSearchResults( Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchResultsAsRDFController.java 2010-06-16 15:01:17 UTC (rev 722) @@ -5,16 +5,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.cipres.treebase.NamespacedGUID; -import org.cipres.treebase.PhyloWSPath; -import org.cipres.treebase.TreebaseIDString; import org.cipres.treebase.TreebaseUtil; -import org.cipres.treebase.domain.matrix.Matrix; import org.cipres.treebase.domain.search.SearchResults; import org.cipres.treebase.domain.search.SearchResultsFrozen; -import org.cipres.treebase.domain.search.SearchResultsType; -import org.cipres.treebase.domain.study.Study; -import org.cipres.treebase.domain.tree.PhyloTree; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; import org.z3950.zing.cql.CQLNode; Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchResultsAsRDF.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchResultsAsRDF.jsp 2010-06-15 17:56:12 UTC (rev 721) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/searchResultsAsRDF.jsp 2010-06-16 15:01:17 UTC (rev 722) @@ -26,9 +26,9 @@ </image--%> <c:forEach var="result" items="${searchResultsThawed.results}" varStatus="status"> <item rdf:about="${baseURL}<c:out value="${result.phyloWSPath}"/>"> - <title><c:out value="${result.label}"/></title> + <title><![CDATA[<c:out value="${result.label}"/>]]></title> <link>${baseURL}<c:out value="${result.phyloWSPath}"/></link> - <description><c:out value="${result.namespacedGUID}"/></description> + <description><![CDATA[<c:out value="${result.description}"/>]]></description> <c:forEach var="anno" items="${result.annotations}" varStatus="annoStatus"> <<c:out value="${anno.property}"/> xmlns:<c:out value="${anno.prefix}"/>="<c:out value="${anno.URI}"/>"><c:out value="${anno.value}" escapeXml="true"/></<c:out value="${anno.property}"/>> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2010-06-15 18:09:11
|
Bugs item #3014899, was opened at 2010-06-11 16:24 Message generated for change (Comment added) made by rvos You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3014899&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ui Group: None >Status: Closed Priority: 7 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: Rutger Vos (rvos) Summary: dcterms.description not available as CQL predicate Initial Comment: People complain that they cannot search by legacy matrix ID. One solution is if we allowed "dcterms.description" to be used as a CQL predicate for matrices. That would allow people to use the advanced search "dcterms.description=M4788" (where "M4788" is a legacy ID number). Alternatively, it would be good to allow the predicate "tb.identifier.matrix.tb1" to search on the "tb_matrixid" field in the "matrix" table. ---------------------------------------------------------------------- >Comment By: Rutger Vos (rvos) Date: 2010-06-15 18:09 Message: Fixed, you can now search on TreeBASE1 identifiers using the "b.identifier.matrix.tb1" predicate, i.e.: http://purl.org/phylo/treebase/dev/phylows/matrix/find?query=tb.identifier.matrix.tb1=M3207&format=rss1 ...and the result is embedded in the nexml/rdf: http://purl.org/phylo/treebase/dev/phylows/matrix/TB2:M1853?format=nexml ---------------------------------------------------------------------- Comment By: Rutger Vos (rvos) Date: 2010-06-15 18:09 Message: Your bug has been resolved. Thanks for the report. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3014899&group_id=248804 |
From: <rv...@us...> - 2010-06-15 17:56:18
|
Revision: 721 http://treebase.svn.sourceforge.net/treebase/?rev=721&view=rev Author: rvos Date: 2010-06-15 17:56:12 +0000 (Tue, 15 Jun 2010) Log Message: ----------- Syntax fix: HQL constructs the query based on the name of the object property, not of that of the underlying table column. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java 2010-06-15 17:24:23 UTC (rev 720) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java 2010-06-15 17:56:12 UTC (rev 721) @@ -623,7 +623,7 @@ */ public Matrix findByTB1StudyID(String pTB1MatrixID) { Criteria c = getSession().createCriteria(Matrix.class); - c.add(Expression.eq("TB_MatrixID", pTB1MatrixID)); + c.add(Expression.eq("TB1MatrixID", pTB1MatrixID)); return (Matrix) c.uniqueResult(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-15 17:24:29
|
Revision: 720 http://treebase.svn.sourceforge.net/treebase/?rev=720&view=rev Author: rvos Date: 2010-06-15 17:24:23 +0000 (Tue, 15 Jun 2010) Log Message: ----------- Adding functionality to fix bug 3014899. This commit makes it possible to: * attach TreeBASE1 matrix ids to NeXML (and RDF) serializations. This involves an addition to NexmlMatrixConverter (to add the annotation during serialization) and to treebase.owl (to add the identifier.matrix.tb1 predicate to the treebase terms vocabulary). * allow searching on TreeBASE1 matrix ids by the core. This involves extending the MatrixService and MatrixHome interfaces, and implementing in MatrixServiceImpl which dispatches to the specified MatrixHome implementation, i.e. MatrixDAO, which does the actual searching. * using identifier.matrix.tb1 as a CQL search predicate. This involves some modification to the predicate handling in the MatrixSearchController so that the right search method is dispatched. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixService.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/MatrixServiceImpl.java trunk/treebase-core/src/main/resources/treebase.owl trunk/treebase-core/src/test/java/org/cipres/treebase/auxdata/AuxDataTest.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/matrix/MatrixDAO.java 2010-06-15 17:24:23 UTC (rev 720) @@ -28,6 +28,7 @@ import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.study.Submission; import org.cipres.treebase.domain.study.SubmissionHome; +import org.cipres.treebase.domain.taxon.Taxon; import org.cipres.treebase.domain.taxon.TaxonLabel; import org.cipres.treebase.domain.taxon.TaxonLabelHome; import org.cipres.treebase.domain.taxon.TaxonLabelSet; @@ -36,6 +37,7 @@ import org.hibernate.Criteria; import org.hibernate.Hibernate; import org.hibernate.Query; +import org.hibernate.criterion.Expression; /** * MatrixDAO.java @@ -614,4 +616,14 @@ returnVal = (MatrixKind) c.uniqueResult(); return returnVal; } + + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.matrix.MatrixHome#findByTB1StudyID(java.lang.String) + */ + public Matrix findByTB1StudyID(String pTB1MatrixID) { + Criteria c = getSession().createCriteria(Matrix.class); + c.add(Expression.eq("TB_MatrixID", pTB1MatrixID)); + return (Matrix) c.uniqueResult(); + } } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixHome.java 2010-06-15 17:24:23 UTC (rev 720) @@ -168,5 +168,14 @@ * @return MatrixKind */ MatrixKind findKindByDescription(String pDescription); + + /** + * Return a Matrix object by its legacy TreeBASE1 id. The Matrix object is fully inflated + * with colum, row and elements data + * + * @param pTB1MatrixID + * @return + */ + Matrix findByTB1StudyID(String pTB1MatrixID); } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixService.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixService.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/MatrixService.java 2010-06-15 17:24:23 UTC (rev 720) @@ -26,6 +26,15 @@ * @return */ Matrix findByID(Long pMatrixID); + + /** + * Return a Matrix object by its legacy TreeBASE1 id. The Matrix object is fully inflated + * with colum, row and elements data + * + * @param pTB1MatrixID + * @return + */ + Matrix findByTB1StudyID(String pTB1MatrixID); /** * Delete a matrix and its assoicated objects. Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-06-15 17:24:23 UTC (rev 720) @@ -276,6 +276,10 @@ } xmlMatrix.setLabel(tbMatrix.getTitle()); attachTreeBaseID((Annotatable)xmlMatrix, tbMatrix,Matrix.class); + String tb1MatrixID = tbMatrix.getTB1MatrixID(); + if ( null != tb1MatrixID ) { + ((Annotatable)xmlMatrix).addAnnotationValue("tb:identifier.matrix.tb1", Constants.TBTermsURI, tb1MatrixID); + } return xmlMatrix; } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/MatrixServiceImpl.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/MatrixServiceImpl.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/matrix/MatrixServiceImpl.java 2010-06-15 17:24:23 UTC (rev 720) @@ -145,4 +145,8 @@ public Class defaultResultClass() { return Matrix.class; } + + public Matrix findByTB1StudyID(String pTB1MatrixID) { + return getMatrixHome().findByTB1StudyID(pTB1MatrixID); + } } Modified: trunk/treebase-core/src/main/resources/treebase.owl =================================================================== --- trunk/treebase-core/src/main/resources/treebase.owl 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/main/resources/treebase.owl 2010-06-15 17:24:23 UTC (rev 720) @@ -68,6 +68,14 @@ + <!-- http://purl.org/phylo/treebase/2.0/terms#identifier.matrix.tb1 --> + + <owl:ObjectProperty rdf:about="identifier.matrix.tb1"> + <rdfs:subPropertyOf rdf:resource="http://purl.org/dc/elements/1.1/identifier"/> + </owl:ObjectProperty> + + + <!-- http://purl.org/phylo/treebase/2.0/terms#identifier.ncbi --> <owl:ObjectProperty rdf:about="identifier.ncbi"> Modified: trunk/treebase-core/src/test/java/org/cipres/treebase/auxdata/AuxDataTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/auxdata/AuxDataTest.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/auxdata/AuxDataTest.java 2010-06-15 17:24:23 UTC (rev 720) @@ -212,6 +212,11 @@ Boolean caseSensitive) { // TODO Auto-generated method stub return null; + } + + public Matrix findByTB1StudyID(String pTB1MatrixID) { + // TODO Auto-generated method stub + return null; } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java 2010-06-15 16:05:56 UTC (rev 719) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java 2010-06-15 17:24:23 UTC (rev 720) @@ -56,6 +56,7 @@ byType, byNTAX, byNCHAR, + byTB1ID } protected ModelAndView onSubmit( @@ -153,8 +154,10 @@ String index = term.getIndex(); if ( index.startsWith("tb.title") ) { results.addAll(doSearch(request, response, SearchType.byTitle, errors, term.getTerm())); - } else if ( index.startsWith("tb.identifier") ) { + } else if ( index.equals("tb.identifier.matrix") ) { results.addAll(doSearch(request, response, SearchType.byID, errors, term.getTerm())); + } else if ( index.equals("tb.identifier.matrix.tb1") ) { + results.addAll(doSearch(request, response, SearchType.byTB1ID, errors, term.getTerm())); } else if ( index.startsWith("tb.type") ) { results.addAll(doSearch(request, response, SearchType.byType, errors, term.getTerm())); } else if ( index.startsWith("tb.ntax") ) { @@ -185,7 +188,12 @@ case byID: matches = (Collection<Matrix>) doSearchByIDString(request, matrixService, Matrix.class, searchTerm); break; - + + case byTB1ID: + matches = new HashSet<Matrix>(); + matches.add(matrixService.findByTB1StudyID(searchTerm)); + break; + case byTitle: matches = matrixService .findSomethingBySubstring(Matrix.class, "title", searchTerm); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-15 16:06:02
|
Revision: 719 http://treebase.svn.sourceforge.net/treebase/?rev=719&view=rev Author: rvos Date: 2010-06-15 16:05:56 +0000 (Tue, 15 Jun 2010) Log Message: ----------- Attaching DarwinCore geocoding predicates to OTUs, bugfix Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-06-09 12:40:28 UTC (rev 718) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-06-15 16:05:56 UTC (rev 719) @@ -333,16 +333,14 @@ xmlMatrix.setSeq(seq,xmlOTU); } for ( RowSegment tbSegment : tbSegments ) { - if ( tbSegment.getStartIndex() <= charIndex && charIndex <= tbSegment.getEndIndex() ) { - Double latitude = tbSegment.getSpecimenLabel().getLatitude(); - Double longitude = tbSegment.getSpecimenLabel().getLongitude(); - if ( null != latitude ) { - xmlOTU.addAnnotationValue("DwC:DecimalLatitude", Constants.DwCURI, latitude); - } - if ( null != longitude ) { - xmlOTU.addAnnotationValue("DwC:DecimalLongitude", Constants.DwCURI, longitude); - } + Double latitude = tbSegment.getSpecimenLabel().getLatitude(); + Double longitude = tbSegment.getSpecimenLabel().getLongitude(); + if ( null != latitude ) { + xmlOTU.addAnnotationValue("DwC:DecimalLatitude", Constants.DwCURI, latitude); } + if ( null != longitude ) { + xmlOTU.addAnnotationValue("DwC:DecimalLongitude", Constants.DwCURI, longitude); + } } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2010-06-11 16:24:52
|
Bugs item #3014899, was opened at 2010-06-11 12:24 Message generated for change (Tracker Item Submitted) made by sfrgpiel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3014899&group_id=248804 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: ui Group: None Status: Open Priority: 7 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: Rutger Vos (rvos) Summary: dcterms.description not available as CQL predicate Initial Comment: People complain that they cannot search by legacy matrix ID. One solution is if we allowed "dcterms.description" to be used as a CQL predicate for matrices. That would allow people to use the advanced search "dcterms.description=M4788" (where "M4788" is a legacy ID number). Alternatively, it would be good to allow the predicate "tb.identifier.matrix.tb1" to search on the "tb_matrixid" field in the "matrix" table. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3014899&group_id=248804 |
From: <rv...@us...> - 2010-06-09 12:40:35
|
Revision: 718 http://treebase.svn.sourceforge.net/treebase/?rev=718&view=rev Author: rvos Date: 2010-06-09 12:40:28 +0000 (Wed, 09 Jun 2010) Log Message: ----------- Attaching DarwinCore geocoding predicates to OTUs Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-06-04 11:29:49 UTC (rev 717) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2010-06-09 12:40:28 UTC (rev 718) @@ -306,17 +306,14 @@ attachTreeBaseID((Annotatable)xmlCell,tbCell,DiscreteMatrixElement.class); for ( RowSegment tbSegment : tbSegments ) { if ( tbSegment.getStartIndex() <= charIndex && charIndex <= tbSegment.getEndIndex() ) { - if ( tbSegment.getSpecimenLabel().getLatitude() != null ) { - ((Annotatable)xmlCell).addAnnotationValue("DwC:DecimalLatitude", Constants.DwCURI, tbSegment.getSpecimenLabel().getLatitude()); + Double latitude = tbSegment.getSpecimenLabel().getLatitude(); + Double longitude = tbSegment.getSpecimenLabel().getLongitude(); + if ( null != latitude ) { + ((Annotatable)xmlCell).addAnnotationValue("DwC:DecimalLatitude", Constants.DwCURI, latitude); } - if ( tbSegment.getSpecimenLabel().getLongitude() != null ) { - ((Annotatable)xmlCell).addAnnotationValue("DwC:DecimalLongitude", Constants.DwCURI, tbSegment.getSpecimenLabel().getLongitude()); + if ( null != longitude ) { + ((Annotatable)xmlCell).addAnnotationValue("DwC:DecimalLongitude", Constants.DwCURI, longitude); } - /* - if ( tbSegment.getSpecimenLabel().getGenBankAccession() != null ) { - ((Annotatable)xmlCell).addAnnotationValue(arg0, arg1, arg2) - } - */ } } charIndex++; @@ -335,6 +332,18 @@ } xmlMatrix.setSeq(seq,xmlOTU); } + for ( RowSegment tbSegment : tbSegments ) { + if ( tbSegment.getStartIndex() <= charIndex && charIndex <= tbSegment.getEndIndex() ) { + Double latitude = tbSegment.getSpecimenLabel().getLatitude(); + Double longitude = tbSegment.getSpecimenLabel().getLongitude(); + if ( null != latitude ) { + xmlOTU.addAnnotationValue("DwC:DecimalLatitude", Constants.DwCURI, latitude); + } + if ( null != longitude ) { + xmlOTU.addAnnotationValue("DwC:DecimalLongitude", Constants.DwCURI, longitude); + } + } + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-04 11:29:55
|
Revision: 717 http://treebase.svn.sourceforge.net/treebase/?rev=717&view=rev Author: rvos Date: 2010-06-04 11:29:49 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Adding CQL searching on TreeBASE1 legacy identifiers for taxon and taxonVariant objects. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java 2010-06-04 11:28:42 UTC (rev 716) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java 2010-06-04 11:29:49 UTC (rev 717) @@ -125,6 +125,8 @@ else if ( node instanceof CQLTermNode ) { CQLTermNode term = (CQLTermNode)node; String index = term.getIndex(); + + // CQL predicate is a title, will do a text search if ( index.startsWith("tb.title") ) { boolean exactMatch = term.getRelation().getBase().equals("=="); SearchTable searchTable = null; @@ -143,6 +145,8 @@ } results.addAll(doTextSearch(term.getTerm(), caseSensitive, exactMatch, searchTable)); } + + // CQL predicate is an identifier, will do id search else if ( index.startsWith("tb.identifier") ) { NamingAuthority namingAuthority = null; if ( index.endsWith("ncbi") ) { @@ -154,7 +158,7 @@ else { namingAuthority = NamingAuthority.TREEBASE; } - results.addAll(doIdentifierSearch(request, term.getTerm(), namingAuthority)); + results.addAll(doIdentifierSearch(request, term.getTerm(), namingAuthority, index)); } else { // issue warnings addMessage(request, "Unsupported index: " + index); @@ -214,7 +218,7 @@ } break; case ID: - taxa.addAll(doIdentifierSearch(request,searchTerm, namingAuthority)); + taxa.addAll(doIdentifierSearch(request,searchTerm, namingAuthority, null)); break; } @@ -232,20 +236,47 @@ * @param request * @param results */ - private Collection<Taxon> doIdentifierSearch(HttpServletRequest request, String identifier, NamingAuthority namingAuthority) { + private Collection<Taxon> doIdentifierSearch(HttpServletRequest request, String identifier, NamingAuthority namingAuthority, String index) { Collection<Taxon> taxaFound = new ArrayList<Taxon>(); switch(namingAuthority) { case TREEBASE : LOGGER.debug("Going to search for TreeBASE IDs"); - TreebaseIDString idstr; - try { - idstr = new TreebaseIDString(identifier, Taxon.class, true); - Taxon match = getTaxonHome().findPersistedObjectByID(idstr.getTBClass(), idstr.getId()); - if ( match != null ) { - taxaFound.add(match); + if ( ! index.endsWith(".tb1") ) { + TreebaseIDString idstr; + try { + idstr = new TreebaseIDString(identifier, Taxon.class, true); + Taxon match = getTaxonHome().findPersistedObjectByID(idstr.getTBClass(), idstr.getId()); + if ( match != null ) { + taxaFound.add(match); + } + } catch (MalformedTreebaseIDString e) { + addMessage(request, "Ignoring malformed taxon ID string '" + identifier + "'; try 'Tx####' or just a number"); + } + } + // looking up by legacy IDs, which we might have for Taxon and TaxonVariant + else { + LOGGER.debug("Searching for legacy " + index); + Integer tb1LegacyId = null; + try { + tb1LegacyId = Integer.parseInt(identifier); + } catch ( NumberFormatException e ) { + addMessage(request, "Ignoring malformed TreeBASE1 ID string '" + identifier + "', because: " + e.getMessage()); + LOGGER.error("Couldn't parse legacy ID: "+e.getMessage()); + } + if ( null != tb1LegacyId && index.matches(".*taxonVariant.*") ) { + TaxonVariant tv = getTaxonHome().findVariantByTB1LegacyId(tb1LegacyId); + LOGGER.debug("Found taxon variant: " + tv.getId()); + if ( null != tv.getTaxon() ) { + taxaFound.add(tv.getTaxon()); + } + } + else if ( null != tb1LegacyId ){ + Taxon taxon = getTaxonHome().findByTB1LegacyId(tb1LegacyId); + LOGGER.debug("Found taxon: " + taxon.getId()); + if ( null != taxon ) { + taxaFound.add(taxon); + } } - } catch (MalformedTreebaseIDString e) { - addMessage(request, "Ignoring malformed taxon ID string '" + identifier + "'; try 'Tx####' or just a number"); } break; case NCBI : This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-04 11:28:47
|
Revision: 716 http://treebase.svn.sourceforge.net/treebase/?rev=716&view=rev Author: rvos Date: 2010-06-04 11:28:42 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Adding interfaces and implementations of findByTB1LegacyId and findVariantByTB1LegacyId Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonDAO.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonHome.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonDAO.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonDAO.java 2010-06-04 11:27:31 UTC (rev 715) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/dao/taxon/TaxonDAO.java 2010-06-04 11:28:42 UTC (rev 716) @@ -150,4 +150,24 @@ } return result; } + + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.taxon.TaxonHome#findByTB1LegacyId(java.lang.Integer) + */ + public Taxon findByTB1LegacyId(Integer tb1LegacyId) { + Criteria c = getSession().createCriteria(Taxon.class); + c.add(Expression.eq("TB1LegacyId", tb1LegacyId)); + return (Taxon) c.uniqueResult(); + } + + /* + * (non-Javadoc) + * @see org.cipres.treebase.domain.taxon.TaxonHome#findVariantByTB1LegacyId(java.lang.Integer) + */ + public TaxonVariant findVariantByTB1LegacyId(Integer tb1LegacyId) { + Criteria c = getSession().createCriteria(TaxonVariant.class); + c.add(Expression.eq("TB1LegacyId", tb1LegacyId)); + return (TaxonVariant) c.uniqueResult(); + } } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonHome.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonHome.java 2010-06-04 11:27:31 UTC (rev 715) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonHome.java 2010-06-04 11:28:42 UTC (rev 716) @@ -85,14 +85,30 @@ Taxon findByNcbiTaxId(Integer genbankId); /** - * Find the taxon that has the specified NCBI genBank ID + * Find the taxon that has the specified uBio namebank ID * * Throw an exception if there are multiple matches * - * @param genbankId + * @param nameBankId * @return the taxon object, or null if none is found * @author mjd 20080821 * @throws NonUniqueObjectException */ Taxon findByUBIOTaxId(Long nameBankId); + + /** + * Find the taxon that has the specified TreeBASE1 legacy ID + * + * @param tb1LegacyId + * @return the taxon object, or null if none is found + */ + Taxon findByTB1LegacyId(Integer tb1LegacyId); + + /** + * Find the taxonVariant that has the specified TreeBASE1 legacy ID + * + * @param tb1LegacyId + * @return the taxonVariant object, or null if none is found + */ + TaxonVariant findVariantByTB1LegacyId(Integer tb1LegacyId); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-06-04 11:27:38
|
Revision: 715 http://treebase.svn.sourceforge.net/treebase/?rev=715&view=rev Author: rvos Date: 2010-06-04 11:27:31 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Adding annotations of tb:identifier.taxon.tb1 and tb:identifier.taxonVariants.tb1, if applicable Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java 2010-06-04 11:26:33 UTC (rev 714) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java 2010-06-04 11:27:31 UTC (rev 715) @@ -265,13 +265,19 @@ } if ( null != getNcbiTaxID() ) { annotations.add(new Annotation(Constants.SKOSURI, "skos:closeMatch", URI.create(String.format(Constants.NCBITaxonomyFormat, getNcbiTaxID())))); - String taxonName = tv.getTaxon().getLabel(); + Taxon taxon = tv.getTaxon(); + String taxonName = taxon.getLabel(); if ( ! fullName.equals(taxonName) ) { annotations.add(new Annotation(Constants.SKOSURI, "skos:prefLabel",taxonName)); } - + if ( null != taxon.getTB1LegacyId() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxon.tb1", taxon.getTB1LegacyId())); + } } } + if ( null != tv.getTB1LegacyId() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxonVariant.tb1", tv.getTB1LegacyId())); + } } } catch ( Exception e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |