Revision 401fe405
Added by Andreas Müller over 13 years ago
app-import/src/main/java/eu/etaxonomy/cdm/io/PalmaeProtologueImport.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.io; |
11 | 11 |
|
12 |
import java.net.URI; |
|
13 |
import java.net.URISyntaxException; |
|
12 | 14 |
import java.util.ArrayList; |
13 | 15 |
import java.util.HashMap; |
14 | 16 |
import java.util.HashSet; |
... | ... | |
81 | 83 |
logger.warn("no taxon with this name found: " + species + ", idInSource: " + taxonId); |
82 | 84 |
}else{ |
83 | 85 |
|
84 |
MediaRepresentationPart representationPart = MediaRepresentationPart.NewInstance(linkProto, 0); |
|
85 |
MediaRepresentation representation = MediaRepresentation.NewInstance("text/html", null); |
|
86 |
representation.addRepresentationPart(representationPart); |
|
87 |
|
|
88 |
Media media = Media.NewInstance(); |
|
89 |
media.addRepresentation(representation); |
|
86 |
URI uri; |
|
87 |
try { |
|
88 |
uri = new URI(linkProto); |
|
89 |
MediaRepresentationPart representationPart = MediaRepresentationPart.NewInstance(uri, 0); |
|
90 |
MediaRepresentation representation = MediaRepresentation.NewInstance("text/html", null); |
|
91 |
representation.addRepresentationPart(representationPart); |
|
92 |
|
|
93 |
Media media = Media.NewInstance(); |
|
94 |
media.addRepresentation(representation); |
|
90 | 95 |
|
91 |
TaxonNameDescription description = TaxonNameDescription.NewInstance(); |
|
92 |
TextData protolog = TextData.NewInstance(Feature.PROTOLOGUE()); |
|
93 |
protolog.addMedia(media); |
|
94 |
description.addElement(protolog); |
|
95 |
taxonNameBase.addDescription(description); |
|
96 |
TaxonNameDescription description = TaxonNameDescription.NewInstance(); |
|
97 |
TextData protolog = TextData.NewInstance(Feature.PROTOLOGUE()); |
|
98 |
protolog.addMedia(media); |
|
99 |
description.addElement(protolog); |
|
100 |
taxonNameBase.addDescription(description); |
|
101 |
} catch (URISyntaxException e) { |
|
102 |
String message= "URISyntaxException when trying to convert: " + linkProto; |
|
103 |
logger.error(message); |
|
104 |
e.printStackTrace(); |
|
105 |
} |
|
96 | 106 |
|
97 | 107 |
taxonNameStore.add(taxonNameBase); |
98 | 108 |
if(count % 50 == 0){ |
Also available in: Unified diff
merge cdmlib-app-3.0.2 to trunk (app-import)