From: <rv...@us...> - 2012-02-01 23:16:05
|
Revision: 1040 http://treebase.svn.sourceforge.net/treebase/?rev=1040&view=rev Author: rvos Date: 2012-02-01 23:15:59 +0000 (Wed, 01 Feb 2012) Log Message: ----------- This revision places attachTreeBaseID() earlier in the NeXML object creation, before any annotations are attached. This so that the about attribute is set correctly, by computing it from the TreeBASE ID instead of the internal object ID from the NeXML API. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUWriter.java trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockWriter.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUWriter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUWriter.java 2012-02-01 21:52:11 UTC (rev 1039) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlOTUWriter.java 2012-02-01 23:15:59 UTC (rev 1040) @@ -30,13 +30,12 @@ */ public OTUs fromTreeBaseToXml(TaxonLabelSet taxonLabelSet) { OTUs xmlOTUs = getDocument().createOTUs(); + attachTreeBaseID(xmlOTUs,taxonLabelSet,TaxonLabelSet.class); - // attach base uri and skos:historyNote xmlOTUs.setBaseURI(mTaxonBaseURI); - xmlOTUs.addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using "+this.toString()+" $Rev$"); - + xmlOTUs.addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using "+this.toString()+" $Rev$"); xmlOTUs.setLabel(taxonLabelSet.getTitle()); - attachTreeBaseID(xmlOTUs,taxonLabelSet,TaxonLabelSet.class); + for ( TaxonLabel taxonLabel : taxonLabelSet.getTaxonLabelsReadOnly() ) { fromTreeBaseToXml(taxonLabel,xmlOTUs); } Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockWriter.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockWriter.java 2012-02-01 21:52:11 UTC (rev 1039) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/nexus/nexml/NexmlTreeBlockWriter.java 2012-02-01 23:15:59 UTC (rev 1040) @@ -52,15 +52,17 @@ TaxonLabelSet taxonLabelSet = treeBlock.getTaxonLabelSet(); OTUs xmlOTUs = getOTUsById(taxonLabelSet.getId()); org.nexml.model.TreeBlock xmlTreeBlock = getDocument().createTreeBlock(xmlOTUs); + attachTreeBaseID((Annotatable)xmlTreeBlock,treeBlock,TreeBlock.class); // attach base uri and skos:historyNote xmlTreeBlock.addAnnotationValue("skos:historyNote", Constants.SKOSURI, "Mapped from TreeBASE schema using "+this.toString()+" $Rev$"); xmlTreeBlock.setBaseURI(mTreeBaseURI); + xmlTreeBlock.setLabel(treeBlock.getLabel()); if ( null != treeBlock.getTitle() ) { xmlTreeBlock.setLabel(treeBlock.getTitle()); } - attachTreeBaseID((Annotatable)xmlTreeBlock,treeBlock,TreeBlock.class); + for ( PhyloTree phyloTree : treeBlock.getTreeList() ) { fromTreeBaseToXml(phyloTree,xmlTreeBlock); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |