Project

General

Profile

« Previous | Next » 

Revision 37604

added expansion of BoolField type

View differences:

modules/dnet-mapreduce-jobs/branches/yarn/src/main/java/eu/dnetlib/data/mapreduce/util/XmlRecordFactory.java
20 20
import javax.xml.transform.stream.StreamResult;
21 21

  
22 22
import org.apache.commons.lang.StringUtils;
23
import org.apache.commons.logging.Log;
24
import org.apache.commons.logging.LogFactory;
25 23
import org.dom4j.Document;
26 24
import org.dom4j.DocumentException;
27 25
import org.dom4j.Element;
......
44 42
import eu.dnetlib.data.mapreduce.hbase.index.config.EntityConfigTable;
45 43
import eu.dnetlib.data.mapreduce.hbase.index.config.LinkDescriptor;
46 44
import eu.dnetlib.data.mapreduce.hbase.index.config.RelClasses;
45
import eu.dnetlib.data.proto.FieldTypeProtos.BoolField;
47 46
import eu.dnetlib.data.proto.FieldTypeProtos.DataInfo;
48 47
import eu.dnetlib.data.proto.FieldTypeProtos.ExtraInfo;
49 48
import eu.dnetlib.data.proto.FieldTypeProtos.KeyValue;
......
65 64

  
66 65
public class XmlRecordFactory {
67 66

  
68
	private static final Log log = LogFactory.getLog(XmlRecordFactory.class); // NOPMD by marko on 11/24/08 5:02 PM
67
	// private static final Log log = LogFactory.getLog(XmlRecordFactory.class); // NOPMD by marko on 11/24/08 5:02 PM
69 68

  
70 69
	protected Set<String> specialDatasourceTypes = Sets.newHashSet("scholarcomminfra", "infospace", "pubsrepository::mock", "entityregistry");
71 70

  
......
465 464
					metadata.add(sb.toString());
466 465
				}
467 466
			}
467

  
468
			if (BoolField.getDescriptor().equals(fd.getMessageType())) {
469
				final BoolField bf = (BoolField) o;
470
				final StringBuilder sb = new StringBuilder("<" + fd.getName());
471
				if (bf.hasDataInfo()) {
472
					final DataInfo dataInfo = bf.getDataInfo();
473
					dataInfoAsAttributes(sb, dataInfo);
474
				}
475
				sb.append(">" + bf.getValue() + "</" + fd.getName() + ">");
476
				metadata.add(sb.toString());
477
			}
478

  
468 479
			if (Journal.getDescriptor().equals(fd.getMessageType()) && (o != null)) {
469 480
				final Journal j = (Journal) o;
470 481
				metadata.add("<journal " + "issn=\"" + escapeXml(j.getIssnPrinted()) + "\" " + "eissn=\"" + escapeXml(j.getIssnOnline()) + "\" " + "lissn=\""

Also available in: Unified diff