Project

General

Profile

redmine2976.patch

Skye Roseboom, 2012-06-25 23:27

Download (5.89 KB)

View differences:

src/main/java/org/dataone/cn/indexer/parser/utility/TemplateStringProcessor.java (working copy)
34 34
                result = result.replaceAll("\\[" + key + "\\]", value);
35 35
            }
36 36
        }
37
        if (result != null) {
38
            result = result.trim();
39
        }
37 40
        return result;
38 41
    }
39 42
}
src/test/java/org/dataone/cn/index/SolrFieldXPathEmlTest.java (working copy)
71 71
        eml210Expected.put("beginDate", dateConverter.convert("1998"));
72 72
        eml210Expected.put("endDate", dateConverter.convert("2004-02-13"));
73 73
        eml210Expected.put("pubDate", "");
74
        eml210Expected.put("author", "SANParks Steve");
74
        eml210Expected.put("author", "SANParks");
75 75
        eml210Expected.put("authorLastName", "SANParks#Garcia#Freeman");
76 76
        eml210Expected.put("investigator", "SANParks#Garcia#Freeman");
77 77
        eml210Expected.put("contactOrganization", "SANParks#The Awesome Store");
78 78
        eml210Expected.put("fileID", "https://" + hostname + "/cn/v1/resolve/peggym.130.4");
79 79

  
80
        eml210Expected.put("origin",
81
                "Steve SANParks Freddy Garcia#Gordon Freeman#The Awesome Store");
80
        eml210Expected.put("origin", "SANParks Freddy Garcia#Gordon Freeman#The Awesome Store");
82 81

  
83 82
        // system metadata
84 83
        eml210Expected.put("id", "peggym.130.4");
......
107 106

  
108 107
        eml210Expected
109 108
                .put("text",
110
                        "Augrabies falls National Park census data.   SANParks  Steve    Garcia  Freddy   SANParks  Regional Ecologists   Private Bag x402 Skukuza, 1350 South Africa     Freeman  Gordon   SANParks  Regional Ecologists   Private Bag x402 Skukuza, 1350 South Africa    The Awesome Store  Regional Ecologists   Private Bag x402 Skukuza, 1350 South Africa    This metadata record fred, describes a 12-34 TT-12 long-term data document can't frank.  This is a test.  If this was not a lower, an abstract \"double\" or 'single' would be present in UPPER (parenthized) this location.   SANParks, South Africa  Augrabies Falls National Park,South Africa  Census data    Agulhas falls national Park   -120.311210  -120.311210  26.0  26.0       1998    2004-02-13       Genus  Antidorcas   Species  marsupialis  Hartmans Zebra     Genus  Cercopithecus   Species  aethiops  Vervet monkey     Genus  Diceros   Species  bicornis  Baboon     Genus  Equus   Species  hartmannae  Giraffe     Genus  Giraffa   Species  camelopardalis  Kudu     Genus  Oreotragus   Species  oreotragus  Gemsbok     Genus  Oryz   Species  gazella  Eland     Genus  Papio   Species  hamadryas     Genus  Taurotragus   Species  oryx  Black rhino     Genus  Tragelaphus   Species  strepsiceros  Klipspringer      1251095992100 peggym.130.4");
109
                        "Augrabies falls National Park census data.   SANParks    Garcia  Freddy   SANParks  Regional Ecologists   Private Bag x402 Skukuza, 1350 South Africa     Freeman  Gordon   SANParks  Regional Ecologists   Private Bag x402 Skukuza, 1350 South Africa    The Awesome Store  Regional Ecologists   Private Bag x402 Skukuza, 1350 South Africa    This metadata record fred, describes a 12-34 TT-12 long-term data document can't frank.  This is a test.  If this was not a lower, an abstract \"double\" or 'single' would be present in UPPER (parenthized) this location.   SANParks, South Africa  Augrabies Falls National Park,South Africa  Census data    Agulhas falls national Park   -120.311210  -120.311210  26.0  26.0       1998    2004-02-13       Genus  Antidorcas   Species  marsupialis  Hartmans Zebra     Genus  Cercopithecus   Species  aethiops  Vervet monkey     Genus  Diceros   Species  bicornis  Baboon     Genus  Equus   Species  hartmannae  Giraffe     Genus  Giraffa   Species  camelopardalis  Kudu     Genus  Oreotragus   Species  oreotragus  Gemsbok     Genus  Oryz   Species  gazella  Eland     Genus  Papio   Species  hamadryas     Genus  Taurotragus   Species  oryx  Black rhino     Genus  Tragelaphus   Species  strepsiceros  Klipspringer      1251095992100 peggym.130.4");
111 110
    }
112 111

  
113 112
    /**
src/main/resources/application-context-eml-base.xml (working copy)
90 90
		<property name="multivalue" value="false" />
91 91
	</bean>	
92 92

  
93
	<bean id="eml.author" class="org.dataone.cn.indexer.parser.SolrField">
94
		<constructor-arg name="name" value="author" />
95
		<constructor-arg name="xpath"
96
			value="concat (//dataset/creator/individualName/surName/text(),' ',//dataset/creator/individualName/givenName/text())" />
97
		<property name="multivalue" value="false" />
93
	<bean id="eml.author" class="org.dataone.cn.indexer.parser.CommonRootSolrField"
94
			p:multivalue="false"
95
			p:root-ref="authorNameRoot">
96
			<constructor-arg name="name" value="author" />
98 97
	</bean>
99 98
	
99
	<bean id="authorNameRoot" class="org.dataone.cn.indexer.parser.utility.RootElement"
100
		p:name="author"
101
		p:xPath="//dataset/creator/individualName"
102
		p:template="[givenName] [surName]">
103
		<property name="leafs">
104
			<list>
105
				<ref bean="givenNameLeaf"/>
106
				<ref bean="surNameLeaf"/>
107
			</list>
108
		</property>
109
	</bean>
110
	
100 111
	<bean id="eml.author_lname" class="org.dataone.cn.indexer.parser.SolrField">
101 112
		<constructor-arg name="name" value="authorLastName" />
102 113
		<constructor-arg name="xpath"
Add picture from clipboard (Maximum size: 14.8 MB)