From: <rv...@us...> - 2009-06-23 12:49:16
|
Revision: 76 http://treebase.svn.sourceforge.net/treebase/?rev=76&view=rev Author: rvos Date: 2009-06-23 10:57:15 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Fix: now no longer returns PhyloTreenull as a default title. Instead, if getId() returns a value, return a TreebaseIDString, otherwise return null. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2009-06-23 10:56:13 UTC (rev 75) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2009-06-23 10:57:15 UTC (rev 76) @@ -46,6 +46,7 @@ import mesquite.lib.MesquiteDouble; import mesquite.lib.StringUtil; +import org.cipres.treebase.TreebaseIDString; import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.domain.AbstractPersistedObject; import org.cipres.treebase.domain.TBPersistable; @@ -224,8 +225,11 @@ if ( ! TreebaseUtil.isEmpty(mTitle) ) { return mTitle; } + else if ( null != getId() ){ + return TreebaseIDString.getIDString(this); + } else { - return "PhyloTree" + getId(); + return null; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-15 01:16:49
|
Revision: 581 http://treebase.svn.sourceforge.net/treebase/?rev=581&view=rev Author: rvos Date: 2010-03-15 01:16:43 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2010-03-15 01:15:19 UTC (rev 580) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2010-03-15 01:16:43 UTC (rev 581) @@ -4,6 +4,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.Set; import javax.persistence.AttributeOverride; @@ -25,9 +26,11 @@ import mesquite.lib.MesquiteDouble; import mesquite.lib.StringUtil; +import org.cipres.treebase.Constants; import org.cipres.treebase.TreebaseIDString; import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.domain.AbstractPersistedObject; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.TBPersistable; import org.cipres.treebase.domain.study.Study; import org.cipres.treebase.domain.taxon.TaxonLabel; @@ -227,6 +230,7 @@ * * @return String */ + @Override @Column(name = "Label", length = TBPersistable.COLUMN_LENGTH_STRING) public String getLabel() { return mLabel; @@ -778,4 +782,26 @@ setRootNode(null); setNewickString(null); } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + if ( null != getId() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.tree", getId())); + } + if ( null != getKindDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:kind.tree", getKindDescription())); + } + if ( null != getTypeDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:type.tree", getTypeDescription())); + } + if ( null != getQualityDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:quality.tree", getQualityDescription())); + } + if ( null != getnTax() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:ntax.tree", getnTax())); + } + return annotations; + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rv...@us...> - 2010-03-16 17:00:56
|
Revision: 609 http://treebase.svn.sourceforge.net/treebase/?rev=609&view=rev Author: rvos Date: 2010-03-16 17:00:50 +0000 (Tue, 16 Mar 2010) Log Message: ----------- Implemented getContext, which returns the containing study. Wrapped annotation generation inside a try {} block (I was getting some lazy initialization exceptions), changed the fetch mode to join, to prevent lazy initialization exceptions. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2010-03-16 16:58:15 UTC (rev 608) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2010-03-16 17:00:50 UTC (rev 609) @@ -37,6 +37,8 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import org.hibernate.annotations.Fetch; +import org.hibernate.annotations.FetchMode; import org.hibernate.annotations.NamedNativeQuery; /** @@ -284,6 +286,7 @@ */ @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY) @JoinColumn(name = "TREEQUALITY_ID") + @Fetch(FetchMode.JOIN) public TreeQuality getTreeQuality() { return mTreeQuality; } @@ -320,6 +323,7 @@ */ @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "TREEKIND_ID") + @Fetch(FetchMode.JOIN) public TreeKind getTreeKind() { return mTreeKind; } @@ -338,6 +342,7 @@ */ @ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY) @JoinColumn(name = "TREETYPE_ID") + @Fetch(FetchMode.JOIN) public TreeType getTreeType() { return mTreeType; } @@ -786,22 +791,29 @@ @Transient public List<Annotation> getAnnotations() { List<Annotation> annotations = super.getAnnotations(); - if ( null != getId() ) { - annotations.add(new Annotation(Constants.TBTermsURI, "tb:identifier.tree", getId())); + try { + if ( null != getKindDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:kind.tree", getKindDescription())); + } + if ( null != getTypeDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:type.tree", getTypeDescription())); + } + if ( null != getQualityDescription() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:quality.tree", getQualityDescription())); + } + if ( null != getnTax() ) { + annotations.add(new Annotation(Constants.TBTermsURI, "tb:ntax.tree", getnTax())); + } + } catch ( Exception e ) { + e.printStackTrace(); } - if ( null != getKindDescription() ) { - annotations.add(new Annotation(Constants.TBTermsURI, "tb:kind.tree", getKindDescription())); - } - if ( null != getTypeDescription() ) { - annotations.add(new Annotation(Constants.TBTermsURI, "tb:type.tree", getTypeDescription())); - } - if ( null != getQualityDescription() ) { - annotations.add(new Annotation(Constants.TBTermsURI, "tb:quality.tree", getQualityDescription())); - } - if ( null != getnTax() ) { - annotations.add(new Annotation(Constants.TBTermsURI, "tb:ntax.tree", getnTax())); - } return annotations; } + + @Override + @Transient + public Study getContext() { + return getStudy(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-10 19:41:41
|
Revision: 909 http://treebase.svn.sourceforge.net/treebase/?rev=909&view=rev Author: hshyket Date: 2011-06-10 19:41:35 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Fixing issue with semicolon not being at the end of the tree in a nexus file. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-10 16:47:32 UTC (rev 908) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-10 19:41:35 UTC (rev 909) @@ -569,6 +569,14 @@ } } + + //check to see if the NewickString has a semicolon in it + String newWick = getNewickString(); + + if (newWick.indexOf(';') == -1) { + newWick.concat(";"); + } + pBuilder.append(getNewickString()).append("\n"); pBuilder.append("[! TreeBASE tree URI: ").append(getPhyloWSPath().getPurl()).append("]\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-10 20:41:48
|
Revision: 910 http://treebase.svn.sourceforge.net/treebase/?rev=910&view=rev Author: hshyket Date: 2011-06-10 20:41:41 +0000 (Fri, 10 Jun 2011) Log Message: ----------- Fixing error with last commit. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-10 19:41:35 UTC (rev 909) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-10 20:41:41 UTC (rev 910) @@ -577,7 +577,7 @@ newWick.concat(";"); } - pBuilder.append(getNewickString()).append("\n"); + pBuilder.append(newWick).append("\n"); pBuilder.append("[! TreeBASE tree URI: ").append(getPhyloWSPath().getPurl()).append("]\n"); pBuilder.append("\n\nEND;\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-14 19:14:44
|
Revision: 917 http://treebase.svn.sourceforge.net/treebase/?rev=917&view=rev Author: hshyket Date: 2011-06-14 19:14:38 +0000 (Tue, 14 Jun 2011) Log Message: ----------- Fixing newWick string Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-14 13:06:13 UTC (rev 916) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/tree/PhyloTree.java 2011-06-14 19:14:38 UTC (rev 917) @@ -574,10 +574,11 @@ String newWick = getNewickString(); if (newWick.indexOf(';') == -1) { - newWick.concat(";"); + newWick = newWick + ";"; } pBuilder.append(newWick).append("\n"); + pBuilder.append("[! TreeBASE tree URI: ").append(getPhyloWSPath().getPurl()).append("]\n"); pBuilder.append("\n\nEND;\n"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |