citation.setValue("");
if (dqSource.getRef() != null) {
gedxSourceDescription.setId(dqSource.getRef() + "-" + Long.toHexString(SequentialIdentifierGenerator.getNextId()));
SourceReference componentOf = new SourceReference();
componentOf.setDescriptionRef(URI.create(CommonMapper.getSourceDescriptionReference(dqSource.getRef())));
gedxSourceDescription.setComponentOf(componentOf);
sourceDescriptionHasData = true;
if (dqSource.getDate() != null) {
CitationField field = new CitationField();
field.setName(URI.create("gedcom5:citation-template/date"));
field.setValue(dqSource.getDate());
citation.getFields().add(field);
citation.setValue(citation.getValue() + (citation.getValue().length() > 0 ? ", " + dqSource.getDate() : dqSource.getDate()));
}
if (dqSource.getPage() != null) {
CitationField field = new CitationField();
field.setName(URI.create("gedcom5:citation-template/page"));
field.setValue(dqSource.getPage());
citation.getFields().add(field);
citation.setValue(citation.getValue() + (citation.getValue().length() > 0 ? ", " + dqSource.getPage() : dqSource.getPage()));
}
} else if (dqSource.getValue() != null) {
gedxSourceDescription.setId("SOUR-" + Long.toHexString(SequentialIdentifierGenerator.getNextId()));
citation.setValue(dqSource.getValue());
citation.setCitationTemplate(null);
sourceDescriptionHasData = true;
}
String entryName = CommonMapper.getSourceDescriptionReference(gedxSourceDescription.getId());
SourceReference gedxSourceReference = new SourceReference();
gedxSourceReference.setDescriptionRef(URI.create(entryName));
if (dqSource.getText() != null) {
logger.warn(ConversionContext.getContext(), "GEDCOM X does not currently support text extracted from a source.");
// dqSource.getText(); // see GEDCOM X issue 121 // TODO: address when the associated issue is resolved; log for now
// sourceDescriptionHasData = true;