Revision 9dc896c9
Added by Andreas Müller almost 7 years ago
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/pilotOutputHtml/PilotOutputDocumentBuilder.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
20 | 20 |
|
21 | 21 |
import eu.etaxonomy.cdm.io.jaxb.CdmMarshallerListener; |
22 | 22 |
import eu.etaxonomy.cdm.io.sdd.out.SDDDataSet; |
23 |
import eu.etaxonomy.cdm.model.common.Language; |
|
24 |
import eu.etaxonomy.cdm.model.common.LanguageString; |
|
25 | 23 |
import eu.etaxonomy.cdm.model.common.Representation; |
26 | 24 |
import eu.etaxonomy.cdm.model.description.CategoricalData; |
27 | 25 |
import eu.etaxonomy.cdm.model.description.DescriptionElementBase; |
... | ... | |
32 | 30 |
import eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue; |
33 | 31 |
import eu.etaxonomy.cdm.model.description.TaxonDescription; |
34 | 32 |
import eu.etaxonomy.cdm.model.description.TextData; |
35 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
|
|
33 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
36 | 34 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
37 | 35 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
38 | 36 |
|
39 | 37 |
/** |
40 |
* Writes the SDD XML file.
|
|
41 |
*
|
|
38 |
* Writes the SDD XML file. |
|
39 |
* |
|
42 | 40 |
* @author h.fradin |
43 | 41 |
* @created 10.12.2008 |
44 | 42 |
* @version 1.0 |
... | ... | |
59 | 57 |
public void marshal(SDDDataSet cdmSource, String sddDestination) throws IOException { |
60 | 58 |
|
61 | 59 |
this.cdmSource = cdmSource; |
62 |
Marshaller marshaller;
|
|
60 |
Marshaller marshaller; |
|
63 | 61 |
CdmMarshallerListener marshallerListener = new CdmMarshallerListener(); |
64 | 62 |
logger.info("Start marshalling"); |
65 | 63 |
writeCDMtoHTML(sddDestination); |
... | ... | |
104 | 102 |
*/ |
105 | 103 |
public String writeTaxonDescriptionsToHTML(Taxon taxon, String texte) throws IOException { |
106 | 104 |
|
107 |
TaxonNameBase taxonName = taxon.getName();
|
|
105 |
TaxonName taxonName = taxon.getName(); |
|
108 | 106 |
String name = taxonName.getTitleCache(); |
109 | 107 |
Set<TaxonDescription> descriptions = taxon.getDescriptions(); |
110 | 108 |
for (Iterator<TaxonDescription> td = descriptions.iterator() ; td.hasNext() ;){ |
... | ... | |
125 | 123 |
texte += "<ul type=\"circle\">\n"; |
126 | 124 |
|
127 | 125 |
for (Iterator<? extends DescriptionElementBase> dep = description.getElements().iterator() ; dep.hasNext() ;){ |
128 |
DescriptionElementBase descriptionElement = (DescriptionElementBase) dep.next();
|
|
126 |
DescriptionElementBase descriptionElement = dep.next(); |
|
129 | 127 |
|
130 | 128 |
if (descriptionElement instanceof CategoricalData) { |
131 | 129 |
CategoricalData categorical = (CategoricalData) descriptionElement; |
... | ... | |
133 | 131 |
Representation representation = (Representation) feature.getRepresentations().toArray()[0]; |
134 | 132 |
texte += "<li>Categorical data associated with feature: <b>" + representation.getLabel() + "</b><br/>\nStates: "; |
135 | 133 |
for (Iterator<? extends StateData> sd = categorical.getStateData().iterator() ; sd.hasNext() ;){ |
136 |
StateData stateData = (StateData) sd.next();
|
|
134 |
StateData stateData = sd.next(); |
|
137 | 135 |
texte += ((Representation) stateData.getState().getRepresentations().toArray()[0]).getLabel(); |
138 |
if (sd.hasNext()) texte += "; "; else texte += ".<br/>\n"; |
|
136 |
if (sd.hasNext()) { |
|
137 |
texte += "; "; |
|
138 |
} else { |
|
139 |
texte += ".<br/>\n"; |
|
140 |
} |
|
139 | 141 |
} |
140 | 142 |
texte += "<br/>\n"; |
141 | 143 |
} |
... | ... | |
147 | 149 |
texte += "<li>Quantitative data associated with feature: <b>" + representation.getLabel() + "</b><br/>\n"; |
148 | 150 |
MeasurementUnit mu = quantitative.getUnit(); |
149 | 151 |
String unit = ((Representation) mu.getRepresentations().toArray()[0]).getLabel(); |
150 |
if (!unit.equals("")) texte += "Measurement unit: " + unit + "<br/>\n"; |
|
152 |
if (!unit.equals("")) { |
|
153 |
texte += "Measurement unit: " + unit + "<br/>\n"; |
|
154 |
} |
|
151 | 155 |
for (Iterator<? extends StatisticalMeasurementValue> smv = quantitative.getStatisticalValues().iterator() ; smv.hasNext() ;){ |
152 |
StatisticalMeasurementValue statistical = (StatisticalMeasurementValue) smv.next();
|
|
156 |
StatisticalMeasurementValue statistical = smv.next(); |
|
153 | 157 |
texte += ((Representation) statistical.getType().getRepresentations().toArray()[0]).getLabel(); |
154 | 158 |
texte += " = " + statistical.getValue() + "<br/>\n"; |
155 | 159 |
} |
... | ... | |
161 | 165 |
Feature feature = text.getFeature(); |
162 | 166 |
Representation representation = (Representation) feature.getRepresentations().toArray()[0]; |
163 | 167 |
texte += "<li>Text data associated with feature: <b>" + representation.getLabel() + "</b><br/>\n"; |
164 |
texte += "Text: " + ((LanguageString) text.getMultilanguageText().get(((Language) text.getMultilanguageText().keySet().toArray()[0]))).getText() + "<br/>\n";
|
|
168 |
texte += "Text: " + text.getMultilanguageText().get((text.getMultilanguageText().keySet().toArray()[0])).getText() + "<br/>\n";
|
|
165 | 169 |
texte += "<br/>\n"; |
166 | 170 |
} |
167 | 171 |
|
Also available in: Unified diff
fix #6368 rename table and class TaxonNameBase