package gw.solr.mapper uses gw.xsd.config.solr_search_config.DataProperty uses java.lang.StringBuilder uses java.util.List @ReadOnly class BuildURN implements ISolrIndexMapper { /** * Constructs the URN from key fields, typically the publicID's of a subset of the entities from which the document is constructed. * * @param inputDataProperties array of entity properties, describing the entities and the properties * that constitute the publicID's from which the urn is to be constructed. * @param beanMap map mapping names of beans to beans * * @return urn string for a Solr document */ override function mapIndex(inputDataProperties : List, dataHolder : IDataHolder) : String { var sb = new StringBuilder(128) var delimit = false for (idp in inputDataProperties) { if (delimit) { sb.append('&') } else { delimit = true } sb.append(dataHolder.lookupKey(idp)).append('=') sb.append(dataHolder.lookup(idp)) } return sb.toString() } }