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: <rv...@us...> - 2011-04-25 22:15:25
|
Revision: 803 http://treebase.svn.sourceforge.net/treebase/?rev=803&view=rev Author: rvos Date: 2011-04-25 22:15:19 +0000 (Mon, 25 Apr 2011) Log Message: ----------- Added more descriptive id parsing error message; not adding null parameters to new redirect string; only pruning one character from query string. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java 2011-04-25 21:54:29 UTC (rev 802) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java 2011-04-25 22:15:19 UTC (rev 803) @@ -75,7 +75,7 @@ url = createResourceUrl(namespacedGUID, req); } } catch ( MalformedTreebaseIDString e ) { - res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad ID string: " + e.getMessage()); + res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad ID string from path info '" + pathInfo + "' message: " + e.getMessage()); } catch ( ObjectNotFoundException e ) { res.sendError(HttpServletResponse.SC_NOT_FOUND, "Object not found: " + e.getMessage()); } @@ -127,9 +127,18 @@ StringBuffer sb = new StringBuffer(searchBase); sb.append(getSearchPage()); Map<String,String> params = new HashMap<String,String>(); - params.put("query", request.getParameter("query")); - params.put("format", createSerializationFormat(request)); - params.put("recordSchema", request.getParameter("recordSchema")); + String query = request.getParameter("query"); + if ( ! TreebaseUtil.isEmpty(query) ) { + params.put("query", query); + } + String format = createSerializationFormat(request); + if ( ! TreebaseUtil.isEmpty(format) ) { + params.put("format", format); + } + String recordSchema = request.getParameter("recordSchema"); + if ( ! TreebaseUtil.isEmpty(recordSchema) ) { + params.put("recordSchema", recordSchema); + } return createUrl(sb,params,request); } @@ -168,7 +177,7 @@ base.append(key).append('=').append(params.get(key)).append('&'); } String url = base.toString(); - return url.substring(0, url.length() - 2 ); + return url.substring(0, url.length() - 1 ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-25 21:54:35
|
Revision: 802 http://treebase.svn.sourceforge.net/treebase/?rev=802&view=rev Author: rvos Date: 2011-04-25 21:54:29 +0000 (Mon, 25 Apr 2011) Log Message: ----------- Removed abstract bean from servlet configuration. Modified Paths: -------------- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-04-25 21:46:23 UTC (rev 801) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-04-25 21:54:29 UTC (rev 802) @@ -40,9 +40,6 @@ <bean id="nexusFilesController" class="org.cipres.treebase.web.controllers.NexusFilesController"> <property name="studyService"><ref bean="studyService"></ref></property> - </bean> - - <bean id="phyloWSController" class="org.cipres.treebase.web.controllers.PhyloWSController"> </bean> <bean id="phyloWSStudyController" class="org.cipres.treebase.web.controllers.PhyloWSStudyController"> @@ -915,8 +912,7 @@ <property name="alwaysUseFullPath" value="true"/> <property name="mappings"> <props> - <prop key="/top/**">OAIPMHController</prop> - <prop key="/phylows/**">phyloWSController</prop> + <prop key="/top/**">OAIPMHController</prop> <prop key="/phylows/study/**">phyloWSStudyController</prop> <prop key="/phylows/taxon/**">phyloWSTaxonController</prop> <prop key="/phylows/tree/**">phyloWSTreeController</prop> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-25 21:46:30
|
Revision: 801 http://treebase.svn.sourceforge.net/treebase/?rev=801&view=rev Author: rvos Date: 2011-04-25 21:46:23 +0000 (Mon, 25 Apr 2011) Log Message: ----------- PhyloWS sub-controllers now re-factored Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTaxonController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java 2011-04-25 18:46:13 UTC (rev 800) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java 2011-04-25 21:46:23 UTC (rev 801) @@ -1,5 +1,9 @@ package org.cipres.treebase.web.controllers; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -10,163 +14,93 @@ import org.cipres.treebase.TreebaseIDString; import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.TreebaseIDString.MalformedTreebaseIDString; -import org.cipres.treebase.domain.matrix.Matrix; -import org.cipres.treebase.domain.matrix.MatrixService; -import org.cipres.treebase.domain.study.Study; -import org.cipres.treebase.domain.study.StudyService; -import org.cipres.treebase.domain.tree.PhyloTree; -import org.cipres.treebase.domain.tree.PhyloTreeService; import org.cipres.treebase.web.Constants; -public class PhyloWSController implements Controller { - private static String ncbiBaseUrl = "http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id="; - private static String uBioBaseUrl = "http://www.ubio.org/browser/details.php?namebankID="; +public abstract class PhyloWSController implements Controller { private static final long serialVersionUID = 1L; - private MatrixService mMatrixService; - private PhyloTreeService mPhyloTreeService; - private StudyService mStudyService; - private static String format = "format"; - - /* - * this array is used to identify whether a path fragment maps to an object - * for which web pages are available. Maybe this should be an enum or a map - * instead. - */ - private static String[] classesWithPages = { "tree", "study", "matrix" }; + private static String searchBase = "/treebase-web/search/"; /** - * Given an object prefix ("tree", "study" or "matrix") and an object ID, constructs + * + * @return + */ + abstract String getDisplayPage(); + + /** + * Given an object ID and a servlet request object, constructs * a relative URL to an HTML page about that object. - * @param prefix identifies either studies, matrices or trees * @param objectId is the primary key for the requested object * @param request is the servlet request, which we need to check for reviewer access - * @return a relative URL to an HTML page, or an empty string - * @throws Exception + * @return a relative URL to an HTML page + * @throws ObjectNotFoundException */ - private String createUrl(String prefix, Long objectId,HttpServletRequest request) throws Exception { - String url = ""; - StringBuffer base = new StringBuffer("/treebase-web/search/study"); - - // requested object is a study - if ( prefix.equals(TreebaseIDString.getPrefixForClass(Study.class)) ) { - Study study = getStudyService().findByID(objectId); - if ( study == null ) { - throw new ObjectNotFoundException("Can't find study " + objectId); - } - if ( ! TreebaseUtil.isEmpty(request.getParameter(Constants.X_ACCESS_CODE))) { - request.setAttribute("initialReviewerRedirect", true); - return base - .append("/summary.html?id=") - .append(objectId) - .append('&') - .append(Constants.X_ACCESS_CODE) - .append('=') - .append(request.getParameter(Constants.X_ACCESS_CODE)) - .toString(); - } - else { - return base - .append("/summary.html?id=") - .append(objectId) - .toString(); - } - } - - // requested object is a matrix - else if ( prefix.equals(TreebaseIDString.getPrefixForClass(Matrix.class)) ) { - Matrix matrix = getMatrixService().findByID(objectId); - if ( matrix == null ) { - throw new ObjectNotFoundException("Can't find matrix " + objectId); - } - Study study = matrix.getStudy(); - return base - .append("/matrix.html?id=") - .append(study.getId()) - .append("&matrixid=") - .append(objectId) - .toString(); - } - - // requested object is a tree - else if ( prefix.equals(TreebaseIDString.getPrefixForClass(PhyloTree.class)) ) { - PhyloTree phyloTree = getPhyloTreeService().findByID(objectId); - if ( phyloTree == null ) { - throw new ObjectNotFoundException("Can't find tree " + objectId); - } - Study study = phyloTree.getStudy(); - return base - .append("/tree.html?id=") - .append(study.getId()) - .append("&treeid=") - .append(objectId) - .toString(); - } - return url; + private String createDisplayUrl(Long objectId,HttpServletRequest request) throws ObjectNotFoundException { + StringBuffer base = new StringBuffer(searchBase + "study/"); + base.append(getDisplayPage()); + Map<String,String> params = getObjectQueryParameters(objectId); + return createUrl(base, params, request); } - - public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse res) - throws Exception { - res.setContentType("text/plain"); - String url = null; - //String domain = "http://" + req.getServerName() + ":" + req.getServerPort(); - if ( ! TreebaseUtil.isEmpty(req.getParameter(Constants.X_ACCESS_CODE)) ) { - req.getSession().setAttribute( - Constants.X_ACCESS_CODE, - req.getParameter(Constants.X_ACCESS_CODE)); - } - try { - String pathInfo = req.getPathInfo(); - if ( TreebaseUtil.isEmpty(pathInfo) ) { - throw new InvalidRequestException( - "Invalid request '" - + pathInfo - + "', should be /${class}/${NamespacedGUID}"); - } - String[] pathComponents = pathInfo.split("/"); - if ( pathComponents[pathComponents.length-1].equals("find") ) { - //url = domain + createSearchUrl(pathComponents[pathComponents.length-2],req); - url = createSearchUrl(pathComponents[pathComponents.length-2],req); - } else { - String rawNamespacedGUID = pathComponents[pathComponents.length-1]; - if ( rawNamespacedGUID.startsWith("uBio:") ) { // XXX be polite, use real URL - url = uBioBaseUrl + rawNamespacedGUID.substring("uBio:".length()); + + /** + * + */ + public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse res) throws IOException { + String url = null; + String pathInfo = req.getPathInfo(); + + // url has "find" in it, re-direct to search services + if ( pathInfo.indexOf("find") != -1 ) { + url = createSearchUrl(req); + } + else { + try { + NamespacedGUID namespacedGUID = new NamespacedGUID(pathInfo); + TreebaseIDString tbID = namespacedGUID.getTreebaseIDString(); + String serializationFormat = createSerializationFormat(req); + if ( hasWebPage(tbID.getClass()) && ! TreebaseUtil.isEmpty(serializationFormat) ) { + + // output format is html, re-direct to display services + if ( serializationFormat.equals("html") ) { + url = createDisplayUrl(tbID.getId(),req); + } + + // output format is something else, re-direct to download services + else { + url = createDownloadUrl(tbID.getId(),serializationFormat,req); + } } - else if ( rawNamespacedGUID.startsWith("NCBI:") ) { // XXX be polite, use real URL - url = ncbiBaseUrl + rawNamespacedGUID.substring("NCBI:".length()); - } + + // no output format, re-direct to base resource url else { - NamespacedGUID namespacedGUID = new NamespacedGUID(rawNamespacedGUID); - TreebaseIDString tbID = namespacedGUID.getTreebaseIDString(); - if ( hasWebPage(pathComponents) ) { - String serializationFormat = createSerializationFormat(req); - if ( TreebaseUtil.isEmpty(serializationFormat) ) { - url = "/treebase-web/search/study/anyObjectAsRDF.rdf?namespacedGUID=" + namespacedGUID.toString(); - } - else if ( serializationFormat.equals("html") ) { - url = createUrl(tbID.getTypePrefix(),tbID.getId(),req); - } - else { - url = createDownloadUrl(tbID.getTypePrefix(),tbID.getId(),serializationFormat); - } - } - else { - url = "/treebase-web/search/study/anyObjectAsRDF.rdf?namespacedGUID=" + namespacedGUID.toString(); - } + url = createResourceUrl(namespacedGUID, req); } - } - } catch ( MalformedTreebaseIDString e ) { - res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad ID string: " + e.getMessage()); - } catch ( ObjectNotFoundException e ) { - res.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage()); - } catch ( InvalidRequestException e ) { - res.sendError(HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); + } catch ( MalformedTreebaseIDString e ) { + res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad ID string: " + e.getMessage()); + } catch ( ObjectNotFoundException e ) { + res.sendError(HttpServletResponse.SC_NOT_FOUND, "Object not found: " + e.getMessage()); + } } + if ( ! TreebaseUtil.isEmpty(url) ) { + res.setContentType("text/plain"); res.setStatus(HttpServletResponse.SC_SEE_OTHER); res.setHeader("Location", url); } return null; } + + /** + * + * @param guid + * @param req + * @return + */ + private String createResourceUrl(NamespacedGUID guid,HttpServletRequest req) { + StringBuffer base = new StringBuffer(searchBase + "study/anyObjectAsRDF.rdf"); + Map<String,String> params = new HashMap<String,String>(); + params.put("namespacedGUID", guid.toString()); + return createUrl(base,params,req); + } /** * This is a placeholder method that might parse accept headers for content-negotiation @@ -175,20 +109,28 @@ * @return */ private String createSerializationFormat(HttpServletRequest request) { - return request.getParameter(format); + return request.getParameter("format"); } - private String createSearchUrl(String path,HttpServletRequest request) { - StringBuilder sb = new StringBuilder("/treebase-web/search/"); - sb - .append(path) - .append("Search.html?query=") - .append(request.getParameter("query")) - .append("&format=") - .append(request.getParameter("format")) - .append("&recordSchema=") - .append(request.getParameter("recordSchema")); - return sb.toString(); + /** + * + * @return + */ + abstract String getSearchPage(); + + /** + * + * @param request + * @return + */ + private String createSearchUrl(HttpServletRequest request) { + StringBuffer sb = new StringBuffer(searchBase); + sb.append(getSearchPage()); + Map<String,String> params = new HashMap<String,String>(); + params.put("query", request.getParameter("query")); + params.put("format", createSerializationFormat(request)); + params.put("recordSchema", request.getParameter("recordSchema")); + return createUrl(sb,params,request); } /** @@ -197,110 +139,70 @@ * @param pathComponents * @return true of web page exists, false otherwise */ - private boolean hasWebPage(String[] pathComponents) { - for ( int i = ( pathComponents.length - 1 ); i >= 0; i-- ) { - for ( int j = 0; j < classesWithPages.length; j++ ) { - if ( pathComponents[i].equals(classesWithPages[j]) ) { - return true; - } - } - } - return false; - } + abstract boolean hasWebPage(Class<?> theClass); + + /** + * + * @param objectId + * @return + * @throws ObjectNotFoundException + */ + abstract Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException; - private String createDownloadUrl(String prefix, Long objectId, String format) throws Exception { - if ( format.equals("xml") ) { - format = "nexml"; + /** + * + * @param base + * @param params + * @return + */ + private String createUrl(StringBuffer base,Map<String,String> params,HttpServletRequest req) { + if ( ! TreebaseUtil.isEmpty(req.getParameter(Constants.X_ACCESS_CODE))) { + req.setAttribute("initialReviewerRedirect", true); + params.put(Constants.X_ACCESS_CODE, req.getParameter(Constants.X_ACCESS_CODE)); + req.getSession().setAttribute(Constants.X_ACCESS_CODE,req.getParameter(Constants.X_ACCESS_CODE)); } - String url = ""; - StringBuffer base = new StringBuffer("/treebase-web/search"); - if ( prefix.equals(TreebaseIDString.getPrefixForClass(Study.class)) ) { - Study study = getStudyService().findByID(objectId); - if ( study == null ) { - throw new ObjectNotFoundException("Can't find study " + objectId); - } - return base - .append("/downloadAStudy.html?id=") - .append(objectId) - .append("&format=") - .append(format) - .toString(); - } - else if ( prefix.equals(TreebaseIDString.getPrefixForClass(Matrix.class)) ) { - Matrix matrix = getMatrixService().findByID(objectId); - if ( matrix == null ) { - throw new ObjectNotFoundException("Can't find matrix " + objectId); - } - Study study = matrix.getStudy(); - if ( study == null ) { - throw new ObjectNotFoundException("Can't find study for matrix "+objectId); - } - return base - .append("/downloadAMatrix.html?id=") - .append(study.getId()) - .append("&matrixid=") - .append(objectId) - .append("&format=") - .append(format) - .toString(); - } - else if ( prefix.equals(TreebaseIDString.getPrefixForClass(PhyloTree.class)) ) { - PhyloTree phyloTree = getPhyloTreeService().findByID(objectId); - if ( phyloTree == null ) { - throw new ObjectNotFoundException("Can't find tree " + objectId); - } - Study study = phyloTree.getStudy(); - if ( study == null ) { - throw new ObjectNotFoundException("Can't find study for tree "+objectId); - } - return base - .append("/downloadATree.html?id=") - .append(study.getId()) - .append("&treeid=") - .append(objectId) - .append("&format=") - .append(format) - .toString(); - } - return url; + if ( ! params.isEmpty() ) { + base.append('?'); + } + for ( String key : params.keySet() ) { + base.append(key).append('=').append(params.get(key)).append('&'); + } + String url = base.toString(); + return url.substring(0, url.length() - 2 ); } - - public MatrixService getMatrixService() { - return mMatrixService; - } - public void setMatrixService(MatrixService matrixService) { - mMatrixService = matrixService; - } - public PhyloTreeService getPhyloTreeService() { - return mPhyloTreeService; - } + /** + * + * @return + */ + abstract String getDownloadPage(); - public void setPhyloTreeService(PhyloTreeService phyloTreeService) { - mPhyloTreeService = phyloTreeService; + /** + * + * @param objectId + * @param format + * @return + * @throws ObjectNotFoundException + */ + private String createDownloadUrl(Long objectId, String format,HttpServletRequest req) throws ObjectNotFoundException { + StringBuffer base = new StringBuffer(searchBase); + base.append(getDownloadPage()); + Map<String,String> params = getObjectQueryParameters(objectId); + params.put("format", format); + return createUrl(base,params,req); } - - public StudyService getStudyService() { - return mStudyService; - } - - public void setStudyService(StudyService studyService) { - mStudyService = studyService; - } + /** + * + * @author rvosa + * + */ class ObjectNotFoundException extends Exception { private static final long serialVersionUID = 1L; public ObjectNotFoundException(String message) { super(message); } } - - class InvalidRequestException extends Exception { - private static final long serialVersionUID = 1L; - public InvalidRequestException(String message) { - super(message); - } - } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java 2011-04-25 18:46:13 UTC (rev 800) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java 2011-04-25 21:46:23 UTC (rev 801) @@ -1,5 +1,58 @@ package org.cipres.treebase.web.controllers; +import java.util.HashMap; +import java.util.Map; + +import org.cipres.treebase.domain.matrix.Matrix; +import org.cipres.treebase.domain.matrix.MatrixService; +import org.cipres.treebase.domain.study.Study; + public class PhyloWSMatrixController extends PhyloWSController { + private MatrixService mMatrixService; + + @Override + String getSearchPage() { + return "matrixSearch.html"; + } + + @Override + String getDownloadPage() { + return "downloadAMatrix.html"; + } + + @Override + Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException { + Matrix matrix = getMatrixService().findByID(objectId); + if ( matrix == null ) { + throw new ObjectNotFoundException("Can't find matrix " + objectId); + } + Study study = matrix.getStudy(); + if ( study == null ) { + throw new ObjectNotFoundException("Can't find study for matrix "+objectId); + } + Map<String,String> params = new HashMap<String,String>(); + params.put("id", ""+study.getId()); + params.put("matrixid", ""+objectId); + return params; + } + + @Override + String getDisplayPage() { + return "matrix.html"; + } + + @Override + boolean hasWebPage(Class<?> theClass) { + return Matrix.class.isAssignableFrom(theClass); + } + + public MatrixService getMatrixService() { + return mMatrixService; + } + + public void setMatrixService(MatrixService matrixService) { + mMatrixService = matrixService; + } + } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java 2011-04-25 18:46:13 UTC (rev 800) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java 2011-04-25 21:46:23 UTC (rev 801) @@ -1,5 +1,52 @@ package org.cipres.treebase.web.controllers; +import java.util.HashMap; +import java.util.Map; + +import org.cipres.treebase.domain.study.Study; +import org.cipres.treebase.domain.study.StudyService; + public class PhyloWSStudyController extends PhyloWSController { + private StudyService mStudyService; + + @Override + String getSearchPage() { + return "studySearch.html"; + } + + @Override + String getDownloadPage() { + return "downloadAStudy.html"; + } + + @Override + Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException { + Study study = getStudyService().findByID(objectId); + if ( study == null ) { + throw new ObjectNotFoundException("Can't find study " + objectId); + } + Map<String,String> params = new HashMap<String,String>(); + params.put("id", ""+objectId); + return params; + } + + @Override + String getDisplayPage() { + return "summary.html"; + } + + @Override + boolean hasWebPage(Class<?> theClass) { + return Study.class.isAssignableFrom(theClass); + } + + public StudyService getStudyService() { + return mStudyService; + } + + public void setStudyService(StudyService studyService) { + mStudyService = studyService; + } + } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTaxonController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTaxonController.java 2011-04-25 18:46:13 UTC (rev 800) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTaxonController.java 2011-04-25 21:46:23 UTC (rev 801) @@ -1,5 +1,37 @@ package org.cipres.treebase.web.controllers; +import java.util.HashMap; +import java.util.Map; + +import org.cipres.treebase.domain.taxon.TaxonLabel; + public class PhyloWSTaxonController extends PhyloWSController { + @Override + String getSearchPage() { + return "taxonSearch.html"; + } + + @Override + String getDownloadPage() { + return "downloadATaxon.html"; + } + + @Override + Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException { + // TODO Auto-generated method stub + return new HashMap<String,String>(); + } + + @Override + String getDisplayPage() { + // TODO Auto-generated method stub + return "taxon.html"; + } + + @Override + boolean hasWebPage(Class<?> theClass) { + return TaxonLabel.class.isAssignableFrom(theClass); + } + } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java 2011-04-25 18:46:13 UTC (rev 800) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java 2011-04-25 21:46:23 UTC (rev 801) @@ -1,5 +1,58 @@ package org.cipres.treebase.web.controllers; +import java.util.HashMap; +import java.util.Map; + +import org.cipres.treebase.domain.study.Study; +import org.cipres.treebase.domain.tree.PhyloTree; +import org.cipres.treebase.domain.tree.PhyloTreeService; + public class PhyloWSTreeController extends PhyloWSController { + private PhyloTreeService mPhyloTreeService; + + @Override + String getSearchPage() { + return "treeSearch.html"; + } + + @Override + String getDownloadPage() { + return "downloadATree.html"; + } + + @Override + Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException { + PhyloTree phyloTree = getPhyloTreeService().findByID(objectId); + if ( phyloTree == null ) { + throw new ObjectNotFoundException("Can't find tree " + objectId); + } + Study study = phyloTree.getStudy(); + if ( study == null ) { + throw new ObjectNotFoundException("Can't find study for tree "+objectId); + } + Map<String,String> params = new HashMap<String,String>(); + params.put("id",""+study.getId()); + params.put("treeid", ""+objectId); + return params; + } + + @Override + String getDisplayPage() { + return "tree.html"; + } + + @Override + boolean hasWebPage(Class<?> theClass) { + return PhyloTree.class.isAssignableFrom(theClass); + } + + public PhyloTreeService getPhyloTreeService() { + return mPhyloTreeService; + } + + public void setPhyloTreeService(PhyloTreeService phyloTreeService) { + mPhyloTreeService = phyloTreeService; + } + } Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-04-25 18:46:13 UTC (rev 800) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-04-25 21:46:23 UTC (rev 801) @@ -42,34 +42,22 @@ <property name="studyService"><ref bean="studyService"></ref></property> </bean> - <bean id="phyloWSController" class="org.cipres.treebase.web.controllers.PhyloWSController"> - <property name="matrixService"><ref bean="matrixService"></ref></property> - <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> - <property name="studyService"><ref bean="studyService"></ref></property> + <bean id="phyloWSController" class="org.cipres.treebase.web.controllers.PhyloWSController"> </bean> <bean id="phyloWSStudyController" class="org.cipres.treebase.web.controllers.PhyloWSStudyController"> - <property name="matrixService"><ref bean="matrixService"></ref></property> - <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> <property name="studyService"><ref bean="studyService"></ref></property> </bean> - <bean id="phyloWSTaxonController" class="org.cipres.treebase.web.controllers.PhyloWSTaxonController"> - <property name="matrixService"><ref bean="matrixService"></ref></property> - <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> - <property name="studyService"><ref bean="studyService"></ref></property> + <bean id="phyloWSTaxonController" class="org.cipres.treebase.web.controllers.PhyloWSTaxonController"> </bean> <bean id="phyloWSMatrixController" class="org.cipres.treebase.web.controllers.PhyloWSMatrixController"> - <property name="matrixService"><ref bean="matrixService"></ref></property> - <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> - <property name="studyService"><ref bean="studyService"></ref></property> + <property name="matrixService"><ref bean="matrixService"></ref></property> </bean> <bean id="phyloWSTreeController" class="org.cipres.treebase.web.controllers.PhyloWSTreeController"> - <property name="matrixService"><ref bean="matrixService"></ref></property> <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> - <property name="studyService"><ref bean="studyService"></ref></property> </bean> <bean id="filenameController" class="org.cipres.treebase.web.controllers.ShortPathUrlFilenameViewController"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-25 18:46:19
|
Revision: 800 http://treebase.svn.sourceforge.net/treebase/?rev=800&view=rev Author: rvos Date: 2011-04-25 18:46:13 +0000 (Mon, 25 Apr 2011) Log Message: ----------- Adding empty PhyloWS sub-controllers Modified Paths: -------------- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml Added Paths: ----------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTaxonController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java 2011-04-25 18:46:13 UTC (rev 800) @@ -0,0 +1,5 @@ +package org.cipres.treebase.web.controllers; + +public class PhyloWSMatrixController extends PhyloWSController { + +} Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java 2011-04-25 18:46:13 UTC (rev 800) @@ -0,0 +1,5 @@ +package org.cipres.treebase.web.controllers; + +public class PhyloWSStudyController extends PhyloWSController { + +} Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTaxonController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTaxonController.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTaxonController.java 2011-04-25 18:46:13 UTC (rev 800) @@ -0,0 +1,5 @@ +package org.cipres.treebase.web.controllers; + +public class PhyloWSTaxonController extends PhyloWSController { + +} Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java 2011-04-25 18:46:13 UTC (rev 800) @@ -0,0 +1,5 @@ +package org.cipres.treebase.web.controllers; + +public class PhyloWSTreeController extends PhyloWSController { + +} Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-04-22 14:33:09 UTC (rev 799) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-04-25 18:46:13 UTC (rev 800) @@ -47,6 +47,30 @@ <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> <property name="studyService"><ref bean="studyService"></ref></property> </bean> + + <bean id="phyloWSStudyController" class="org.cipres.treebase.web.controllers.PhyloWSStudyController"> + <property name="matrixService"><ref bean="matrixService"></ref></property> + <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> + <property name="studyService"><ref bean="studyService"></ref></property> + </bean> + + <bean id="phyloWSTaxonController" class="org.cipres.treebase.web.controllers.PhyloWSTaxonController"> + <property name="matrixService"><ref bean="matrixService"></ref></property> + <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> + <property name="studyService"><ref bean="studyService"></ref></property> + </bean> + + <bean id="phyloWSMatrixController" class="org.cipres.treebase.web.controllers.PhyloWSMatrixController"> + <property name="matrixService"><ref bean="matrixService"></ref></property> + <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> + <property name="studyService"><ref bean="studyService"></ref></property> + </bean> + + <bean id="phyloWSTreeController" class="org.cipres.treebase.web.controllers.PhyloWSTreeController"> + <property name="matrixService"><ref bean="matrixService"></ref></property> + <property name="phyloTreeService"><ref bean="phyloTreeService"></ref></property> + <property name="studyService"><ref bean="studyService"></ref></property> + </bean> <bean id="filenameController" class="org.cipres.treebase.web.controllers.ShortPathUrlFilenameViewController"/> <!--bean id="filenameController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/ --> @@ -905,6 +929,10 @@ <props> <prop key="/top/**">OAIPMHController</prop> <prop key="/phylows/**">phyloWSController</prop> + <prop key="/phylows/study/**">phyloWSStudyController</prop> + <prop key="/phylows/taxon/**">phyloWSTaxonController</prop> + <prop key="/phylows/tree/**">phyloWSTreeController</prop> + <prop key="/phylows/matrix/**">phyloWSMatrixController</prop> <prop key="/about.html">filenameController</prop> <prop key="/home.html">filenameController</prop> <prop key="/login.html">filenameController</prop> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2011-04-22 16:38:58
|
Bugs item #3291519, was opened at 2011-04-22 12:38 Message generated for change (Tracker Item Submitted) made by sfrgpiel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3291519&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: 8 Private: No Submitted By: William Piel (sfrgpiel) Assigned to: hshyket (hshyket) Summary: Charsets not tokenized and treeblocks not inked to taxa bloc Initial Comment: With regard's to Mark Holder's complaint (below), we need to ensure that the titles of charsets are properly tokenized (see /treebase/domain/matrix/UserDefinedCharSet.java) and that tree blocks properly reference the correct Taxon Block title using the "LINK TAXA" command. For the Link Taxa issue, the solution may be to edit line 229 in treebase/domain/tree/TreeBlock.java to add the following: pBuilder.append("\tLINK TAXA = " + StringUtil.tokenize(taxaTitle.replaceAll("Input|Output", "")) + ";").append(TreebaseUtil.LINESEP); ...which is the solution used on line 437 of treebase/domain/matrix/Matrix.java, and is somewhat similar to the solution on line 561 of treebase/domain/tree/PhyloTree.java For the LINK TAXA issue, the trick is to get the result of: http://purl.org/phylo/treebase/phylows/study/TB2:S2012?format=nexml To look like a fusion of these two files: http://treebase.org/treebase-web/search/downloadAnAnalysisStep.html?analysisid=4172&id=2012 http://treebase.org/treebase-web/search/downloadAnAnalysisStep.html?analysisid=4173&id=2012 On Apr 21, 2011, at 11:09 PM, Mark Holder wrote: >Hi, > I just downloaded S2012.nex (I can send it along if needed, but I > won't clutter your inboxes unless it is needed. The url is > http://purl.org/phylo/treebase/phylows/study/TB2:S2012 ). > > My NEXUS parser is choking on a couple of things: > 1. The names of the CHARSET commands in the SETS block have spaces, > but the names have not been "escaped" to convert them to single NEXUS > tokens. > > 2. There are multiple TAXA blocks but the TREES blocks do not use > the LINK command to disambiguate. Mesquite is smart enough to figure > out which TAXA block is correct. I suppose I could add taxa-block-detection > code to NCL (the NEXUS parsing library that I use), but it would > be much easier if TreeBase used LINK to clarify the connections. > > all the best, > Mark ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3291519&group_id=248804 |
From: <sfr...@us...> - 2011-04-22 14:33:16
|
Revision: 799 http://treebase.svn.sourceforge.net/treebase/?rev=799&view=rev Author: sfrgpiel Date: 2011-04-22 14:33:09 +0000 (Fri, 22 Apr 2011) Log Message: ----------- I'm reversing the change I just made because Hudson can't seem to build. My bad (?) Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/UserDefinedCharSet.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/UserDefinedCharSet.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/UserDefinedCharSet.java 2011-04-22 13:59:21 UTC (rev 798) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/UserDefinedCharSet.java 2011-04-22 14:33:09 UTC (rev 799) @@ -76,7 +76,8 @@ @Override public String getNexusString() { StringBuilder sb = new StringBuilder(); - sb.append(getNexusPrefix()).append(StringUtil.tokenize(getTitle())).append(" (CHARACTERS = ").append(StringUtil.tokenize(getMatrix().getTitle())).append(") = "); + sb.append(getNexusPrefix()).append(getTitle()).append(" (CHARACTERS = ").append(StringUtil.tokenize(getMatrix().getTitle())).append(") = "); + // sb.append(getNexusPrefix()).append(StringUtil.tokenize(getTitle())).append(" (CHARACTERS = ").append(StringUtil.tokenize(getMatrix().getTitle())).append(") = "); for (ColumnRange colRange : getColumns()) { sb.append(" "); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2011-04-22 13:59:28
|
Revision: 798 http://treebase.svn.sourceforge.net/treebase/?rev=798&view=rev Author: sfrgpiel Date: 2011-04-22 13:59:21 +0000 (Fri, 22 Apr 2011) Log Message: ----------- Added StringUtil.tokenize() to the getTitle() in an effort to tokenize the title of a charset Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/UserDefinedCharSet.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/UserDefinedCharSet.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/UserDefinedCharSet.java 2011-04-19 11:27:54 UTC (rev 797) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/UserDefinedCharSet.java 2011-04-22 13:59:21 UTC (rev 798) @@ -76,7 +76,7 @@ @Override public String getNexusString() { StringBuilder sb = new StringBuilder(); - sb.append(getNexusPrefix()).append(getTitle()).append(" (CHARACTERS = ").append(StringUtil.tokenize(getMatrix().getTitle())).append(") = "); + sb.append(getNexusPrefix()).append(StringUtil.tokenize(getTitle())).append(" (CHARACTERS = ").append(StringUtil.tokenize(getMatrix().getTitle())).append(") = "); for (ColumnRange colRange : getColumns()) { sb.append(" "); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:28:00
|
Revision: 797 http://treebase.svn.sourceforge.net/treebase/?rev=797&view=rev Author: rvos Date: 2011-04-19 11:27:54 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Added maven2 nature to project file. Modified Paths: -------------- trunk/treebase-web/.project Modified: trunk/treebase-web/.project =================================================================== --- trunk/treebase-web/.project 2011-04-19 11:27:04 UTC (rev 796) +++ trunk/treebase-web/.project 2011-04-19 11:27:54 UTC (rev 797) @@ -1,24 +1,37 @@ -<projectDescription> - <name>treebase-web</name> - <comment/> - <projects> - <project>treebase-core</project> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - </buildCommand> - <buildCommand> - <name>org.eclipse.wst.common.project.facet.core.builder</name> - </buildCommand> - <buildCommand> - <name>org.eclipse.wst.validation.validationbuilder</name> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.wst.common.project.facet.core.nature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> - <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> - </natures> -</projectDescription> \ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>treebase-web</name> + <comment></comment> + <projects> + <project>treebase-core</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + </natures> +</projectDescription> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:27:10
|
Revision: 796 http://treebase.svn.sourceforge.net/treebase/?rev=796&view=rev Author: rvos Date: 2011-04-19 11:27:04 +0000 (Tue, 19 Apr 2011) Log Message: ----------- This object shouldn't need hibernate annotations, so I removed them. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/model/CitationCommand.java Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/model/CitationCommand.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/model/CitationCommand.java 2011-04-19 11:24:16 UTC (rev 795) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/model/CitationCommand.java 2011-04-19 11:27:04 UTC (rev 796) @@ -5,8 +5,6 @@ import java.util.HashMap; import java.util.Map; -import javax.persistence.Transient; - import org.cipres.treebase.domain.study.ArticleCitation; import org.cipres.treebase.domain.study.BookCitation; import org.cipres.treebase.domain.study.Citation; @@ -101,7 +99,6 @@ * @see org.cipres.treebase.domain.study.Citation#getRealCitationType() */ @Override - @Transient protected String getRealCitationType() { return "CitationCommand"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:24:22
|
Revision: 795 http://treebase.svn.sourceforge.net/treebase/?rev=795&view=rev Author: rvos Date: 2011-04-19 11:24:16 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Added maven2 nature to project file. Modified Paths: -------------- trunk/treebase-core/.project Modified: trunk/treebase-core/.project =================================================================== --- trunk/treebase-core/.project 2011-04-19 11:23:21 UTC (rev 794) +++ trunk/treebase-core/.project 2011-04-19 11:24:16 UTC (rev 795) @@ -1,22 +1,36 @@ -<projectDescription> - <name>treebase-core</name> - <comment/> - <projects/> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - </buildCommand> - <buildCommand> - <name>org.eclipse.wst.common.project.facet.core.builder</name> - </buildCommand> - <buildCommand> - <name>org.eclipse.wst.validation.validationbuilder</name> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.wst.common.project.facet.core.nature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> - <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> - </natures> -</projectDescription> \ No newline at end of file +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>treebase-core</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.validation.validationbuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + </natures> +</projectDescription> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:23:27
|
Revision: 794 http://treebase.svn.sourceforge.net/treebase/?rev=794&view=rev Author: rvos Date: 2011-04-19 11:23:21 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Adding simple test for NeXML serialization. Added Paths: ----------- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlSerializationTest.java Added: trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlSerializationTest.java =================================================================== --- trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlSerializationTest.java (rev 0) +++ trunk/treebase-core/src/test/java/org/cipres/treebase/domain/nexus/NexmlSerializationTest.java 2011-04-19 11:23:21 UTC (rev 794) @@ -0,0 +1,60 @@ +package org.cipres.treebase.domain.nexus; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.io.Writer; + +import junit.framework.Assert; + +import org.cipres.treebase.Constants; +import org.cipres.treebase.dao.AbstractDAOTest; +import org.cipres.treebase.domain.study.Study; +import org.cipres.treebase.domain.taxon.TaxonLabelHome; +import org.cipres.treebase.domain.nexus.nexml.NexmlDocumentConverter; +import org.nexml.model.DocumentFactory; +import org.nexml.model.Document; + +public class NexmlSerializationTest extends AbstractDAOTest { + private TaxonLabelHome mTaxonLabelHome; + + public void testSerializeStudy() { + long studyId = 1787; + Study study = (Study)loadObject(Study.class, studyId); + Document doc = DocumentFactory.safeCreateDocument(); + NexmlDocumentConverter conv = new NexmlDocumentConverter(study,getTaxonLabelHome(),doc); + String xml = conv.fromTreeBaseToXml(study).getXmlString(); +// File file = new File("/Users/rvosa/Desktop/NexmlSerializationTest.xml"); +// try { +// Writer output = new BufferedWriter(new FileWriter(file)); +// output.write(xml); +// } catch (FileNotFoundException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + System.out.println(xml); + Assert.assertNotNull(xml); + } + + /** + * Return the TaxonLabelHome field. + * + * @return TaxonLabelHome mTaxonLabelHome + */ + public TaxonLabelHome getTaxonLabelHome() { + return mTaxonLabelHome; + } + + /** + * Set the TaxonLabelHome field. + */ + public void setTaxonLabelHome(TaxonLabelHome pNewTaxonLabelHome) { + mTaxonLabelHome = pNewTaxonLabelHome; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:22:38
|
Revision: 793 http://treebase.svn.sourceforge.net/treebase/?rev=793&view=rev Author: rvos Date: 2011-04-19 11:22:32 +0000 (Tue, 19 Apr 2011) Log Message: ----------- No longer returning owl:sameAs annotations because we are using the TreebaseIDString values as xml id's directly. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 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 2011-04-19 11:20:14 UTC (rev 792) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/AbstractPersistedObject.java 2011-04-19 11:22:32 UTC (rev 793) @@ -111,10 +111,9 @@ @Transient public List<Annotation> getAnnotations() { // This is called by child classes using super.getAnnotations() - // to get the common annotations out of the way + // to get the common annotations out of the way. We no longer need + // to do owl:sameAs because we use TreeBASE ID strings as XML IDs. List<Annotation> annotations = new ArrayList<Annotation>(); - URI uri = URI.create(TreebaseUtil.getPurlBase()+getPhyloWSPath()); - annotations.add(new Annotation(Constants.OWLURI,"owl:sameAs",uri)); TBPersistable context = getContext(); if ( null != context ) { URI contextUri = URI.create(TreebaseUtil.getPurlBase()+context.getPhyloWSPath()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:20:20
|
Revision: 792 http://treebase.svn.sourceforge.net/treebase/?rev=792&view=rev Author: rvos Date: 2011-04-19 11:20:14 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Now giving a sane default base URI if it can't be read from JNDI. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2011-04-19 11:19:03 UTC (rev 791) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/TreebaseUtil.java 2011-04-19 11:20:14 UTC (rev 792) @@ -483,7 +483,7 @@ */ public static String getPurlBase() { if (null == mPurlBase) - mPurlBase = lookupJndiEnvironmentString("tb2/PurlBase", "http://DUMMY_PURL_BASE/"); + mPurlBase = lookupJndiEnvironmentString("tb2/PurlBase", Constants.BaseURI.toString()); return mPurlBase; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:19:09
|
Revision: 791 http://treebase.svn.sourceforge.net/treebase/?rev=791&view=rev Author: rvos Date: 2011-04-19 11:19:03 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Now setting the xml:base attribute to <phylowsPurl>/tree/TB2: on every tree block, and using the TreeBaseIDString as the xml id on every node. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java 2011-04-19 11:17:37 UTC (rev 790) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockConverter.java 2011-04-19 11:19:03 UTC (rev 791) @@ -99,6 +99,7 @@ TaxonLabelSet taxonLabelSet = treeBlock.getTaxonLabelSet(); OTUs xmlOTUs = getOTUsById(taxonLabelSet.getId()); org.nexml.model.TreeBlock xmlTreeBlock = getDocument().createTreeBlock(xmlOTUs); + xmlTreeBlock.setBaseURI(mTreeBaseURI); if ( null != treeBlock.getTitle() ) { xmlTreeBlock.setLabel(treeBlock.getTitle()); } @@ -143,6 +144,7 @@ } for ( PhyloTreeNode tbChildNode : tbNode.getChildNodes() ) { Node xmlChildNode = xmlTree.createNode(); + xmlChildNode.setId(tbChildNode.getTreebaseIDString().toString()); FloatEdge xmlEdge = xmlTree.createEdge(xmlNode, xmlChildNode); if ( null != tbChildNode.getBranchLength() ) { xmlEdge.setLength(tbChildNode.getBranchLength()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:17:43
|
Revision: 790 http://treebase.svn.sourceforge.net/treebase/?rev=790&view=rev Author: rvos Date: 2011-04-19 11:17:37 +0000 (Tue, 19 Apr 2011) Log Message: ----------- No longer returning the context (i.e. the defining tree) so that we don't emit rdfs:isDefinedBy annotations, which are not useful on tree nodes anyway - because they have no other annotations, so why turn them into RDF? Things are less verbose this way. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java 2011-04-19 11:16:03 UTC (rev 789) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTreeNode.java 2011-04-19 11:17:37 UTC (rev 790) @@ -595,9 +595,15 @@ return getTaxonLabelAsString(); } + + /* + * If there are no annotations on individual nodes there is no good reason to have them + * be "seen" in the RDF anyway, which they would be if we state them as being defined by + * their containing tree. So let's skip that for now. @Override @Transient public PhyloTree getContext() { return getTree(); } + */ } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:16:09
|
Revision: 789 http://treebase.svn.sourceforge.net/treebase/?rev=789&view=rev Author: rvos Date: 2011-04-19 11:16:03 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Now checking to make sure the "legacy" id and the current one aren't the same thing. Only attaching them if they aren't. 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 2011-04-19 11:10:53 UTC (rev 788) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/taxon/TaxonLabel.java 2011-04-19 11:16:03 UTC (rev 789) @@ -270,13 +270,15 @@ 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())); + Integer tb1LegacyID = taxon.getTB1LegacyId(); + if ( null != tb1LegacyID && taxon.getId() != tb1LegacyID.longValue() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxon.tb1", tb1LegacyID.longValue())); } } } - if ( null != tv.getTB1LegacyId() ) { - annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxonVariant.tb1", tv.getTB1LegacyId())); + Integer tb1TvId = tv.getTB1LegacyId(); + if ( null != tb1TvId && tv.getId() != tb1TvId.longValue() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxonVariant.tb1", tb1TvId.longValue() )); } annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.taxonVariant", tv.getId())); Taxon taxon = tv.getTaxon(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 11:10:59
|
Revision: 788 http://treebase.svn.sourceforge.net/treebase/?rev=788&view=rev Author: rvos Date: 2011-04-19 11:10:53 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Now setting the xml:base attribute to <phylowsPurl>/study/TB2: on every document. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java 2011-04-19 10:59:49 UTC (rev 787) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java 2011-04-19 11:10:53 UTC (rev 788) @@ -26,6 +26,7 @@ protected URI mTaxonBaseURI = URI.create(mBaseURI.toString() + "taxon/TB2:"); protected URI mMatrixBaseURI = URI.create(mBaseURI.toString() + "matrix/TB2:"); protected URI mTreeBaseURI = URI.create(mBaseURI.toString() + "tree/TB2:"); + protected static URI mStudyBaseURI = URI.create(Constants.BaseURI.toString() + "study/TB2:"); // private static String mBaseURIString = "http://purl.org/PHYLO/TREEBASE/PHYLOWS/"; // private static String mDCIdentifier = "dcterms:identifier"; public static String TreeBASE2Prefix = "TreeBASE2"; @@ -38,8 +39,7 @@ */ public NexmlObjectConverter(Study study, TaxonLabelHome taxonLabelHome, Document document, String baseURI) { if ( null != baseURI ) { - mBaseURI = URI.create(baseURI); - document.setBaseURI(mBaseURI); + document.setBaseURI(URI.create(baseURI)); } document.setId(study.getTreebaseIDString().toString()); setTaxonLabelHome(taxonLabelHome); @@ -48,7 +48,7 @@ } public NexmlObjectConverter(Study study, TaxonLabelHome taxonLabelHome, Document document) { - this(study,taxonLabelHome,document,Constants.BaseURI.toString()); + this(study,taxonLabelHome,document,mStudyBaseURI.toString()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 10:59:55
|
Revision: 787 http://treebase.svn.sourceforge.net/treebase/?rev=787&view=rev Author: rvos Date: 2011-04-19 10:59:49 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Now setting the xml:base attribute to <phylowsPurl>/taxon/TB2: on every taxa block. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java 2011-04-19 10:55:10 UTC (rev 786) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUConverter.java 2011-04-19 10:59:49 UTC (rev 787) @@ -1,5 +1,7 @@ package org.cipres.treebase.domain.nexus.nexml; +import java.net.URI; + import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabel; import org.cipres.treebase.domain.taxon.TaxonLabelHome; @@ -46,6 +48,7 @@ */ public OTUs fromTreeBaseToXml(TaxonLabelSet taxonLabelSet) { OTUs xmlOTUs = getDocument().createOTUs(); + xmlOTUs.setBaseURI(mTaxonBaseURI); xmlOTUs.setLabel(taxonLabelSet.getTitle()); attachTreeBaseID(xmlOTUs,taxonLabelSet,TaxonLabelSet.class); for ( TaxonLabel taxonLabel : taxonLabelSet.getTaxonLabelsReadOnly() ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 10:55:16
|
Revision: 786 http://treebase.svn.sourceforge.net/treebase/?rev=786&view=rev Author: rvos Date: 2011-04-19 10:55:10 +0000 (Tue, 19 Apr 2011) Log Message: ----------- We now always set the xml:base attribute on the document root, and the Study TreeBaseIDString as the xml id. This won't be written out, but the about attribute based on it will. Also, we place the TreeBaseIDString on all objects that pass through the attachTreeBaseID method. Taxa are now found by simply checking their ID strings as opposed to having to iterate over their annotations looking for the right owl:sameAs statement. The base URIs for matrix, taxon and tree are declared as protected variables in this class. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java 2011-04-19 10:49:22 UTC (rev 785) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlObjectConverter.java 2011-04-19 10:55:10 UTC (rev 786) @@ -23,6 +23,9 @@ public class NexmlObjectConverter extends AbstractNexusConverter { private Logger logger = Logger.getLogger(NexmlObjectConverter.class); protected URI mBaseURI = Constants.BaseURI; + protected URI mTaxonBaseURI = URI.create(mBaseURI.toString() + "taxon/TB2:"); + protected URI mMatrixBaseURI = URI.create(mBaseURI.toString() + "matrix/TB2:"); + protected URI mTreeBaseURI = URI.create(mBaseURI.toString() + "tree/TB2:"); // private static String mBaseURIString = "http://purl.org/PHYLO/TREEBASE/PHYLOWS/"; // private static String mDCIdentifier = "dcterms:identifier"; public static String TreeBASE2Prefix = "TreeBASE2"; @@ -38,13 +41,14 @@ mBaseURI = URI.create(baseURI); document.setBaseURI(mBaseURI); } + document.setId(study.getTreebaseIDString().toString()); setTaxonLabelHome(taxonLabelHome); setStudy(study); setDocument(document); } public NexmlObjectConverter(Study study, TaxonLabelHome taxonLabelHome, Document document) { - this(study,taxonLabelHome,document,null); + this(study,taxonLabelHome,document,Constants.BaseURI.toString()); } @@ -65,10 +69,7 @@ */ protected void attachTreeBaseID(Annotatable annotatable,TBPersistable tbPersistable,Class<?> persistableClass) { if ( null != tbPersistable.getId() ) { - //attachAnnotation(mDCIdentifier,makeNamespacedID(tbPersistable,persistableClass),mDCURI,annotatable); -// String uriString = getDocument().getBaseURI().toString() + tbPersistable.getPhyloWSPath().toString(); -// annotatable.addAnnotationValue("owl:sameAs",Constants.OWLURI, URI.create(uriString)); -// annotatable.addAnnotationValue("dcterms:relation",Constants.DCURI, URI.create(uriString)); + annotatable.setId(tbPersistable.getTreebaseIDString().toString()); for ( org.cipres.treebase.domain.Annotation anno : tbPersistable.getAnnotations() ) { annotatable.addAnnotationValue(anno.getProperty(), anno.getURI(), anno.getValue()); } @@ -93,27 +94,15 @@ * @return */ protected Long readTreeBaseID(Annotatable annotatable) { - - // this will return the value object associated with a - // dc:identifier predicate in a nexml meta annotation, - // e.g. <meta property="dc:identifier" content="TB2:Tr231"/> - // this will return something that stringifies to TB2:Tr231 - Set<Object> dublinCoreRelationObjects = annotatable.getRelValues("owl:sameAs"); - Iterator<Object> objectIterator = dublinCoreRelationObjects.iterator(); - while ( objectIterator.hasNext() ) { - URI relationURI = (URI)objectIterator.next(); - String urlFragment = getDocument().getBaseURI().toString() + "taxon/TB2:"; - if ( relationURI.toString().startsWith(urlFragment) ) { - String rawTreebaseIDString = relationURI.toString().substring(urlFragment.length()); - try { - TreebaseIDString treebaseIDString = new TreebaseIDString(rawTreebaseIDString); - return treebaseIDString.getId(); - } catch ( MalformedTreebaseIDString e ) { - e.printStackTrace(); - } - } - } - return null; + // we no longer need to read owl:sameAs annotations because we + // use the TreebaseIDString objects as xml IDs + try { + TreebaseIDString treebaseIDString = new TreebaseIDString(annotatable.getId()); + return treebaseIDString.getId(); + } catch (MalformedTreebaseIDString e) { + e.printStackTrace(); + } + return null; } protected OTUs getOTUsById(Long taxonLabelSetId) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2011-04-19 10:49:28
|
Revision: 785 http://treebase.svn.sourceforge.net/treebase/?rev=785&view=rev Author: rvos Date: 2011-04-19 10:49:22 +0000 (Tue, 19 Apr 2011) Log Message: ----------- Now setting the xml:base attribute on each matrix to <phylowsPurl>/matrix/TB2: so that we can use TreeBASE ID strings as XML IDs instead of doing the owl:sameAs stuff to attach identifiers. 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 2011-04-14 21:09:54 UTC (rev 784) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlMatrixConverter.java 2011-04-19 10:49:22 UTC (rev 785) @@ -171,6 +171,7 @@ public CategoricalMatrix fromTreeBaseToXml(StandardMatrix tbMatrix) { OTUs xmlOTUs = getOTUsById(tbMatrix.getTaxa().getId()); CategoricalMatrix xmlMatrix = getDocument().createCategoricalMatrix(xmlOTUs); + xmlMatrix.setBaseURI(mMatrixBaseURI); List<List<DiscreteCharState>> tbStateLabels = tbMatrix.getStateLabels(); List<MatrixColumn> tbColumns = tbMatrix.getColumnsReadOnly(); for ( int i = 0; i < tbColumns.size(); i++ ) { @@ -219,6 +220,7 @@ xmlMatrix = getDocument().createMolecularMatrix(xmlOTUs, MolecularMatrix.Protein); xmlStateSet = ((MolecularMatrix)xmlMatrix).getProteinCharacterStateSet(); } + xmlMatrix.setBaseURI(mMatrixBaseURI); for ( MatrixColumn tbColumn : tbMatrix.getColumnsReadOnly() ) { org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(xmlStateSet); PhyloChar tbCharacter = tbColumn.getCharacter(); @@ -242,6 +244,7 @@ public org.nexml.model.ContinuousMatrix fromTreeBaseToXml(ContinuousMatrix tbMatrix) { OTUs xmlOTUs = getOTUsById(tbMatrix.getTaxa().getId()); org.nexml.model.ContinuousMatrix xmlMatrix = getDocument().createContinuousMatrix(xmlOTUs); + xmlMatrix.setBaseURI(mMatrixBaseURI); for ( MatrixColumn tbColumn : tbMatrix.getColumnsReadOnly() ) { org.nexml.model.Character xmlCharacter = xmlMatrix.createCharacter(); PhyloChar tbCharacter = tbColumn.getCharacter(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: SourceForge.net <no...@so...> - 2011-04-15 19:16:18
|
Bugs item #3232414, was opened at 2011-03-21 12:00 Message generated for change (Settings changed) made by sfrgpiel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3232414&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: hshyket (hshyket) Summary: Citation created by Dryad has duplicate author names Initial Comment: When a submission is created in Dryad and the data are pushed to TreeBASE, the citation is auto-entered into TreeBASE. However, typically it seems to duplicate one of the authors (namely the submitter's name). I'm inclined to not simply solve the bug as it is, but rather to list the authors (in their proper order) in the notes field for the submission with instructions for the submitter to enter the author's names de-novo. The reason for this is because when author names are auto-entered from Dryad, they tend to create redundant entries in the event that the authors already exist in TreeBASE. So we really need to prompt the submitter to enter author names using the TreeBASE interface. My recommendation then is to remove the feature that auto-enters author names and instead store the author names (in proper order) in the Notes field, and append the following text: "Please enter these author names into the TreeBASE citation by clicking on the highlighted "Authors" item in the Tool Box" ---------------------------------------------------------------------- >Comment By: William Piel (sfrgpiel) Date: 2011-04-15 15:16 Message: I'm going to close this bug because the source of the problem is with Dryad: the XML file contains duplicate <dc:creator> tags, one for the submitter and one as an author on the paper. The folks at Dryad will fix this. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3232414&group_id=248804 |
From: SourceForge.net <no...@so...> - 2011-04-15 19:14:16
|
Bugs item #3287818, was opened at 2011-04-15 15:14 Message generated for change (Tracker Item Submitted) made by sfrgpiel You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3287818&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: hshyket (hshyket) Summary: Select errors should prevent Changing to Ready State Initial Comment: When a submitter tries to toggle the submission to "Ready" state, s/he is taken to this page: http://www.treebase.org/treebase-web/user/readyState.html?submissionid=xxxxx. At that point the submitter is warned if some taxon labels have not been matched. The warning says "We notice that some of your taxon labels have failed to be validated against an external taxonomy. Unless it is impossible to validate these labels, TreeBASE may refuse or delay the acceptance of your data." This test and warning is excessively stringent and should be disabled. However, there are other warnings that should be inserted, as follows. The Tool Box has a system where if an item has not be visited or has an error, the item is highlighted in yellow. One of those items is "Notes", which appears in yellow if the user has not entered information in the "Notes for study" filed. This is an excessive warning, especially seeing as these Notes are not shown to the public. Instead, yellow highlighting warning should be removed from the Notes. What remains are highlight warnings for Citation, Authors, Files, Taxa, Matrices, Trees, and Analyses -- which is fine. So, having removed the Notes highlighting and the taxon labels warning, what we need is a new quality check that hides the "Submit" button from the user unless there are no more remaining yellow highlighted items. If the Submit button is hidden because of a yellow highlighted item, the message to show is the following: ------------- The items in the Tool Box on the right that are highlighted in yellow indicate that the item either has not been visited or there is an error. Hovering your mouse over the item will indicate the nature of the problem. Your submission cannot be changed to "Ready" state until all highlighted items are addressed. Please return to your submission to complete it. If you think this request is in error, please contact <a href='mailto:he...@tr...?subject=TreeBASE Submission Sxxxxx'>help</a>. The most common problems include: (1) The submitter has not entered a citation that at a minimum must include the authors, year, title, and journal name. (2) The submitter has "orphaned" matrices or trees: i.e., there are matrices that are not listed as inputs to at least one analysis; or trees that are not listed as outputs from at least one analysis. If your paper does not include a tree, please submit a generic neighbor joining tree to satisfy this requirement. (3) The output tree of an analysis has taxon labels that do not match with the input matrix (i.e. there are taxon labels in the tree that are missing from the matrix or matrices that produced the tree). Preparing your submission using <a href='http://mesquiteproject.org/'>Mesquite</a>, in which both matrices and trees are part of the same Mesquite project and share a common taxon block, will avoid the problem of mismatched taxon labels. (4) The submitter has not attempted to validate the taxon labels by clicking the "Validate Taxon Labels" button in the Taxa section. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=1126676&aid=3287818&group_id=248804 |
From: <hs...@us...> - 2011-04-14 21:10:00
|
Revision: 784 http://treebase.svn.sourceforge.net/treebase/?rev=784&view=rev Author: hshyket Date: 2011-04-14 21:09:54 +0000 (Thu, 14 Apr 2011) Log Message: ----------- Setting limit for the number of trees allowed in a block. This is set in the treebase.properties file. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/SubmissionServiceImpl.java trunk/treebase-core/src/main/resources/applicationContext-service.xml trunk/treebase-core/src/main/resources/treebase.properties Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/SubmissionServiceImpl.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/SubmissionServiceImpl.java 2011-04-12 20:16:48 UTC (rev 783) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/service/study/SubmissionServiceImpl.java 2011-04-14 21:09:54 UTC (rev 784) @@ -7,7 +7,10 @@ import java.util.Collection; import java.util.Date; import java.util.HashSet; +import java.util.Iterator; +import java.util.List; + import org.apache.log4j.Logger; import org.cipres.treebase.dao.jdbc.MatrixJDBC; import org.cipres.treebase.dao.jdbc.NexusDataSetJDBC; @@ -65,6 +68,8 @@ private CitationService mCitationService; private StudyService mStudyService; private NexusService mNexusService; + + private int mMaxTreeCount; /** * Constructor. @@ -297,8 +302,25 @@ return sub; } + + /** + * Return the MaxTreeCount field. + * + * @return MatrixDataTypeHome mMatrixDataTypeHome + */ + private int getMaxTreeCount() { + return mMaxTreeCount; + } /** + * Set the MaxTreeCount field. + */ + public void setMaxTreeCount(int maxTreeCount) { + mMaxTreeCount = maxTreeCount; + } + + + /** * * @see org.cipres.treebase.domain.study.SubmissionService#createSubmission(org.cipres.treebase.domain.admin.User, * org.cipres.treebase.domain.study.Study) @@ -680,8 +702,30 @@ // alltrees.addAll(block.getTreeList()); // } // getPhyloTreeHome().storeAll(alltrees); + + + //If there are more than the number of trees in getMaxTreeCount trees in a TreeBlock we need to remove them + for (TreeBlock treeblock : data.getTreeBlocks()) { + if (treeblock.getTreeCount() > getMaxTreeCount()) { + Iterator tree = treeblock.getTreeListIterator(); + int treecount = 1; + + while(tree.hasNext()) { + if (treecount > getMaxTreeCount()) { + tree.remove(); + } + tree.next(); + treecount++; + } + } + } + getPhyloTreeHome().storeAll(data.getTreeBlocks()); sub.addPhyloTreeBlocks(data.getTreeBlocks()); + + + + getPhyloTreeHome().flush(); update(sub); Modified: trunk/treebase-core/src/main/resources/applicationContext-service.xml =================================================================== --- trunk/treebase-core/src/main/resources/applicationContext-service.xml 2011-04-12 20:16:48 UTC (rev 783) +++ trunk/treebase-core/src/main/resources/applicationContext-service.xml 2011-04-14 21:09:54 UTC (rev 784) @@ -243,6 +243,7 @@ <property name="taxonHome" ref="taxonHome"/> <property name="taxonLabelHome" ref="taxonLabelHome"/> <property name="userHome" ref="userHome"/> + <property name="maxTreeCount" value="${treeblock.trees.max_count}"/> </bean> </property> </bean> Modified: trunk/treebase-core/src/main/resources/treebase.properties =================================================================== --- trunk/treebase-core/src/main/resources/treebase.properties 2011-04-12 20:16:48 UTC (rev 783) +++ trunk/treebase-core/src/main/resources/treebase.properties 2011-04-14 21:09:54 UTC (rev 784) @@ -1,6 +1,9 @@ #options are: NexusServiceMesquite | NexusServiceNCL nexus.parser.impl=NexusServiceMesquite +#The number of trees allowed in a treeblock +treeblock.trees.max_count=30 + ######################################################################## ### Prior to 2010-04-29, these were in jdbc.properties, ### which now contains only properties not used by the web app @@ -18,6 +21,8 @@ hibernate.format_sql=true hibernate.generate_statistics=false + + # options are: validate | update | create | create-drop hibernate.hbm2ddl.auto= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-04-12 20:16:54
|
Revision: 783 http://treebase.svn.sourceforge.net/treebase/?rev=783&view=rev Author: hshyket Date: 2011-04-12 20:16:48 +0000 (Tue, 12 Apr 2011) Log Message: ----------- When Dryad data is imported the authors are removed from the citation and placed as a string in the Notes field Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2011-04-11 19:01:05 UTC (rev 782) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/study/Citation.java 2011-04-12 20:16:48 UTC (rev 783) @@ -470,7 +470,31 @@ getDetailedPublicationInformation(authorsCitationStyle, true); return authorsCitationStyle.toString(); } + + @Transient + public String getAuthorsDryadNotes() { + StringBuilder authorsDryad = new StringBuilder(); + List<Person> authors = getAuthors(); + int size = authors.size(); + + if (size > 0) { + + for (int i = 0; i < size; i++) { + authorsDryad.append(authors.get(i).getLastName()); + authorsDryad.append(", "); + authorsDryad.append(authors.get(i).getFirstName()); + + if (size > 1) { + authorsDryad.append("\n"); + } + } + + } + + return authorsDryad.toString(); + } + @Transient public String getAuthorsCitationStyleWithoutHtml() { Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2011-04-11 19:01:05 UTC (rev 782) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2011-04-12 20:16:48 UTC (rev 783) @@ -91,9 +91,17 @@ Citation citation = cparser.getCitation(); Study study = new Study(); study.setName(bagitPath.getName()); - study.setCitation(citation); - citation.setStudy(study); + study.setCitation(citation); + citation.setStudy(study); + + study.setNotes("Please enter these author names into the TreeBASE citation " + + "by clicking on the highlighted \"Authors\" item in the Tool Box." + + "\n\n" + citation.getAuthorsDryadNotes()); + + citation.setAuthors(null); + Submission submission = mSubmissionService.createSubmission(user, study); + long unixTime = System.currentTimeMillis() / 1000L; List<File> files = DryadUtil.getDataFiles(dataPath); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-04-11 19:01:11
|
Revision: 782 http://treebase.svn.sourceforge.net/treebase/?rev=782&view=rev Author: hshyket Date: 2011-04-11 19:01:05 +0000 (Mon, 11 Apr 2011) Log Message: ----------- Prefixing a number to the timestamp to avoid the issue of duplicate file uploads 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/UploadFileController.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 2011-04-08 17:53:18 UTC (rev 781) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/ProcessUserController.java 2011-04-11 19:01:05 UTC (rev 782) @@ -4,7 +4,9 @@ import java.io.FileFilter; import java.util.Collection; import java.util.List; +import java.util.HashMap; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -94,15 +96,39 @@ Submission submission = mSubmissionService.createSubmission(user, study); long unixTime = System.currentTimeMillis() / 1000L; - List<File> files = DryadUtil.getDataFiles(dataPath); - for(int i=0; i<files.size(); i++ ) { + List<File> files = DryadUtil.getDataFiles(dataPath); + HashMap<String, Integer> filenamesHash = new HashMap<String, Integer>(); + for(int i=0; i<files.size(); i++ ) { + + int filecount = 1; + + File originalFile = new File(files.get(i).getAbsolutePath()); + + /* This keeps a hashmap of the files so that going through it knows the count of each file + * Each file then has a prefix of the count and unix timestamp of the upload + */ + + if (filenamesHash.containsKey(originalFile.getName())) { + filecount = filenamesHash.get(originalFile.getName()) + 1; + filenamesHash.put(originalFile.getName(), filecount); + } + else { + filenamesHash.put(originalFile.getName(), filecount); + } + String copyDir = request.getSession().getServletContext() .getRealPath(TreebaseUtil.FILESEP + "NexusFileUpload") + TreebaseUtil.FILESEP + request.getRemoteUser(); - File originalFile = new File(files.get(i).getAbsolutePath()); - File copyFile = new File(copyDir + TreebaseUtil.FILESEP + unixTime + "_" + files.get(i).getName()); + File copyFile = new File(copyDir + + TreebaseUtil.FILESEP + + filenamesHash.get(originalFile.getName()) + + "_" + + unixTime + + "_" + + files.get(i).getName()); + FileUtils.copyFile(originalFile, copyFile); files.remove(i); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/UploadFileController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/UploadFileController.java 2011-04-08 17:53:18 UTC (rev 781) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/UploadFileController.java 2011-04-11 19:01:05 UTC (rev 782) @@ -3,6 +3,7 @@ import java.io.File; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -169,14 +170,29 @@ String firstFile = null; long unixTime = System.currentTimeMillis() / 1000L; - + HashMap<String, Integer> filenamesHash = new HashMap<String, Integer>(); + for (FileBean file : getFiles(request)) { if (LOGGER.isDebugEnabled()) { LOGGER .debug("Uploading file to =>" + uploadDir + TreebaseUtil.FILESEP + file.getName()); //$NON-NLS-1$ } - file.setName(unixTime + "_" + file.getName()); + /* This keeps a hashmap of the files so that going through it knows the count of each file + * Each file then has a prefix of the count and unix timestamp of the upload + */ + + int filecount = 1; + + if (filenamesHash.containsKey(file.getName())) { + filecount = filenamesHash.get(file.getName()) + 1; + filenamesHash.put(file.getName(), filecount); + } + else { + filenamesHash.put(file.getName(), filecount); + } + + file.setName(filecount + "_" + unixTime + "_" + file.getName()); File uploadedFile = new File(uploadDir + TreebaseUtil.FILESEP + file.getName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |