Project

General

Profile

« Previous | Next » 

Revision 57287

[maven-release-plugin] copy for tag uoa-search-3.5.4

View differences:

modules/uoa-search/tags/uoa-search-3.5.4/deploy.info
1
{
2
  "type_source": "SVN", 
3
  "goal": "package -U -T 4C source:jar", 
4
  "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/uoa-search/trunk", 
5
  "deploy_repository": "dnet45-snapshots", 
6
  "version": "4", 
7
  "mail": "antleb@di.uoa.gr, kiatrop@di.uoa.gr", 
8
  "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-snapshots", 
9
  "name": "uoa-search"
10
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/app/plan/CollectionRewriteRuleTest.java
1
package eu.dnetlib.data.search.app.plan;
2

  
3
import eu.dnetlib.domain.functionality.Collection;
4
import eu.dnetlib.utils.cql.CqlException;
5
import gr.uoa.di.driver.enabling.ISLookUp;
6
import org.junit.After;
7
import org.junit.Before;
8
import org.junit.Test;
9

  
10
import static org.mockito.Mockito.mock;
11
import static org.mockito.Mockito.when;
12

  
13
public class CollectionRewriteRuleTest {
14

  
15
	final String field = "colid";
16
	final String value = "foo-col";
17
	final String retrieval = "f = v";
18
	CollectionRewriteRule rule = null;
19

  
20
	@SuppressWarnings("unchecked")
21
	@Before
22
	public void setUp() throws Exception {
23
		rule = new CollectionRewriteRule(null, field);
24
		ISLookUp<Collection> lookup = mock(ISLookUp.class);
25
		Collection collection = mock(Collection.class);
26
		rule.setCollectionLookUp(lookup);
27
		when(collection.getRetrievalCondition()).thenReturn(retrieval);
28
		when(lookup.getById(value)).thenReturn(collection);
29
	}
30

  
31
	@After
32
	public void tearDown() throws Exception {
33
		rule = null;
34
	}
35
	
36
	@Test
37
	public void testApply() throws CqlException {
38
	/*	CqlClause clause = rule.apply(new CqlRelation(field, "=", "\"" + value +  "\""));
39
		assertEquals(Cql.parse(retrieval).getRoot().toCqlString(),
40
				clause.toCqlString());*/
41
	}
42
}
43

  
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/app/plan/PrefixRuleTest.java
1
package eu.dnetlib.data.search.app.plan;
2

  
3
import eu.dnetlib.utils.cql.CqlException;
4
import org.junit.After;
5
import org.junit.Before;
6
import org.junit.Test;
7

  
8
public class PrefixRuleTest {
9

  
10
	//Query query = null;
11
	final String text = "foo and bar"; 
12
	
13
	@Before
14
	public void setUp() throws Exception {
15
		//query = new Query(text);
16
	}
17

  
18
	@After
19
	public void tearDown() throws Exception {
20
		//query = null;
21
	}
22

  
23
	@Test
24
	public void testPrefixRule() throws CqlException {
25
		PrefixRule rule = new PrefixRule(null, "baz");
26
	//	query = rule.apply(query);
27
	//	assertEquals("baz AND (" + text + ")", query.getText());
28
	}
29

  
30
	@Test
31
	public void testBadPrefix() {
32
		/*PrefixRule rule = new PrefixRule(null, "a b");
33
		try {
34
			query = rule.apply(query);
35
			fail();
36
			
37
		} catch (CqlException cqle) {
38
			assertEquals(text, query.getText());
39
		}*/
40
	}
41
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/app/plan/QueryTest.java
1
package eu.dnetlib.data.search.app.plan;
2

  
3
import eu.dnetlib.utils.cql.CqlException;
4
import org.junit.After;
5
import org.junit.Before;
6
import org.junit.Test;
7

  
8
import static org.junit.Assert.assertEquals;
9

  
10
public class QueryTest {
11

  
12
	@Before
13
	public void setUp() throws Exception {
14
	}
15

  
16
	@After
17
	public void tearDown() throws Exception {
18
	}
19

  
20
	@Test
21
	public void testQuery() throws CqlException {
22
		String text = "foo and bar";
23
		Query query = new Query(text);
24
		assertEquals(text, query.getText());
25
		
26
		//CqlQuery cql = query.getCqlQuery();
27
		//assertNotNull(cql);
28
		//assertEquals(cql.toString(), Cql.parse(text).toString());
29
	}
30

  
31
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/app/plan/web/api/APIResponseFormatterTest.java
1
package eu.dnetlib.data.search.app.plan.web.api;
2

  
3
import eu.dnetlib.data.search.web.api.APIResponseFormatter;
4
import junit.framework.Assert;
5
import org.apache.commons.lang.StringEscapeUtils;
6
import org.apache.log4j.BasicConfigurator;
7
import org.junit.Before;
8
import org.junit.Test;
9
import org.mockito.Mockito;
10

  
11
import javax.servlet.http.HttpServletRequest;
12
import javax.ws.rs.core.MediaType;
13
import java.util.Arrays;
14

  
15
import static org.mockito.Mockito.when;
16

  
17

  
18
/**
19
 * Created by kiatrop on 22/11/2016.
20
 */
21
public class APIResponseFormatterTest {
22
    HttpServletRequest requestMock;
23

  
24
    @Before
25
    public  void before() {
26
        BasicConfigurator.configure();
27
        requestMock = Mockito.mock(HttpServletRequest.class);
28
        when(requestMock.getRequestURL()).thenReturn(new StringBuffer().append("http://demo.url/search"));
29
    }
30

  
31
    @Test
32
    public void createMetaTest() {
33
        //Meta only with query
34
        Assert.assertEquals("{\"status\": \"success\", \"code\":\"200\", \"query\":\"oaftype=result\", \"filters\":[], \"total\":\"0\", \"page\":\"0\", \"size\":\"0\", \"_links\": {\"self\": {\"href\":\"http://demo.url/search?page=0&size=0\"}}}",
35
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_JSON, "oaftype=result", null, 0, 0, 0));
36

  
37
        Assert.assertEquals("<status>success</status><code>200</code><query>oaftype=result</query><filters></filters><total>0</total><page>0</page><size>0</size><links><self>"
38
                + StringEscapeUtils.escapeXml("http://demo.url/search?page=0&size=0") + "</self></links>",
39
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_XML, "oaftype=result", null, 0, 0, 0));
40

  
41
        //Meta only with query and filters
42
        Assert.assertEquals("{\"status\": \"success\", \"code\":\"200\", \"query\":\"oaftype=result\", \"filters\":[\"(resultfunderid:ec____::EC)\",\"(resultfundinglevel1:1) (resultfundinglevel1:2)\"], \"total\":\"0\", \"page\":\"0\", \"size\":\"0\", \"_links\": {\"self\": {\"href\":\"http://demo.url/search?page=0&size=0\"}}}",
43
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_JSON, "oaftype=result", Arrays.asList(new String[]{"(resultfunderid:ec____::EC)", "(resultfundinglevel1:1) (resultfundinglevel1:2)"}), 0, 0, 0));
44

  
45
        Assert.assertEquals("<status>success</status><code>200</code><query>oaftype=result</query><filters><filter>(resultfunderid:ec____::EC)</filter><filter>(resultfundinglevel1:1) (resultfundinglevel1:2)</filter></filters><total>0</total><page>0</page><size>0</size><links><self>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=0&size=0") + "</self></links>",
46
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_XML, "oaftype=result", Arrays.asList(new String[]{"(resultfunderid:ec____::EC)", "(resultfundinglevel1:1) (resultfundinglevel1:2)"}), 0, 0, 0));
47

  
48
        //Meta with query and paging
49
        Assert.assertEquals("{\"status\": \"success\", \"code\":\"200\", \"query\":\"oaftype=result\", \"filters\":[\"(resultfunderid:ec____::EC)\",\"(resultfundinglevel1:1) (resultfundinglevel1:2)\"], \"total\":\"10\", \"page\":\"1\", \"size\":\"5\", \"_links\": {\"first\": {\"href\":\"http://demo.url/search?page=0&size=5\"},  \"last\": {\"href\":\"http://demo.url/search?page=1&size=5\"},  \"previous\": {\"href\":\"http://demo.url/search?page=0&size=5\"},   \"next\": {\"href\":\"http://demo.url/search?page=1&size=5\"},   \"self\": {\"href\":\"http://demo.url/search?page=1&size=5\"}}}",
50
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_JSON, "oaftype=result", Arrays.asList(new String[]{"(resultfunderid:ec____::EC)", "(resultfundinglevel1:1) (resultfundinglevel1:2)"}), 10, 1, 5));
51

  
52
        Assert.assertEquals("<status>success</status><code>200</code><query>oaftype=result</query><filters><filter>(resultfunderid:ec____::EC)</filter><filter>(resultfundinglevel1:1) (resultfundinglevel1:2)</filter></filters><total>10</total><page>1</page><size>5</size>" +
53
                "<links><first>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=0&size=5") + "</first><last>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=1&size=5") + "</last><previous>" +
54
                StringEscapeUtils.escapeXml("http://demo.url/search?page=0&size=5") +"</previous><next>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=1&size=5") +
55
                "</next><self>" + StringEscapeUtils.escapeXml("http://demo.url/search?page=1&size=5") +"</self></links>",
56
                APIResponseFormatter.createMeta(requestMock, MediaType.APPLICATION_XML, "oaftype=result", Arrays.asList(new String[]{"(resultfunderid:ec____::EC)", "(resultfundinglevel1:1) (resultfundinglevel1:2)"}), 10, 1, 5));
57

  
58
    }
59

  
60
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/utils/cql/QueryEnhancerTest.java
1
package eu.dnetlib.data.search.utils.cql;
2

  
3
import org.apache.log4j.BasicConfigurator;
4
import org.junit.Assert;
5
import org.junit.Before;
6
import org.junit.Test;
7

  
8
/**
9
 * Created by kiatrop on 30/11/2016.
10
 */
11
public class QueryEnhancerTest {
12
    String indexfieldName = "indexfieldName";
13
    String fieldvalue = "fieldvalue";
14

  
15
    @Before
16
    public  void before() {
17
        BasicConfigurator.configure();
18
    }
19

  
20
    @Test
21
    public void testExact(){
22
        StringBuilder queryBuilder1 = new StringBuilder();
23
        StringBuilder queryBuilder = new StringBuilder();
24

  
25
        ParameterQueryEnhancer.addExactQueryTerm(indexfieldName, fieldvalue, queryBuilder1);
26
        CQLQueryBuilder.appendFieldQuotedTerm(queryBuilder, CQLQueryBuilder.Operator.AND, indexfieldName, CQLQueryBuilder.Operator.EXACT, fieldvalue);
27

  
28
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder.toString());
29
    }
30

  
31
    @Test
32
    public void testEqual(){
33
        StringBuilder queryBuilder1 = new StringBuilder();
34
        StringBuilder queryBuilder2 = new StringBuilder();
35

  
36
        ParameterQueryEnhancer.addEqualQueryTerm(indexfieldName, fieldvalue, queryBuilder1);
37
        CQLQueryBuilder.appendFieldQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, indexfieldName, CQLQueryBuilder.Operator.EQUAL, fieldvalue);
38

  
39
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder2.toString());
40
    }
41

  
42
    @Test
43
    public void testNotEqual(){
44
        StringBuilder queryBuilder1 = new StringBuilder();
45
        StringBuilder queryBuilder2 = new StringBuilder();
46

  
47
        ParameterQueryEnhancer.addNotEqualQueryTerm(indexfieldName, fieldvalue, queryBuilder1);
48
        CQLQueryBuilder.appendFieldQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.NOT, indexfieldName, CQLQueryBuilder.Operator.EQUAL, fieldvalue);
49

  
50
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder2.toString());
51
    }
52

  
53
    @Test
54
    public void testDifferentEqual(){
55
        StringBuilder queryBuilder1 = new StringBuilder();
56
        StringBuilder queryBuilder2 = new StringBuilder();
57

  
58
        ParameterQueryEnhancer.addDifferentQueryTerm(indexfieldName, fieldvalue, queryBuilder1);
59
        CQLQueryBuilder.appendFieldQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, indexfieldName, CQLQueryBuilder.Operator.NOTEQUAL, fieldvalue);
60

  
61
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder2.toString());
62
    }
63

  
64
    @Test
65
    public void testKeywords() {
66
        StringBuilder queryBuilder1 = new StringBuilder();
67
        StringBuilder queryBuilder2 = new StringBuilder();
68

  
69
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keywords");
70
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "keywords");
71

  
72
        Assert.assertEquals(queryBuilder1.toString(), queryBuilder2.toString());
73
    }
74

  
75
    @Test
76
    public void appendKeywordsTest() {
77
        StringBuilder queryBuilder1 = new StringBuilder();
78
        StringBuilder queryBuilder2 = new StringBuilder();
79

  
80
        //keyword1 and (__all exact "quoted term")
81
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"quoted term\"");
82
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.NONE, "keyword1");
83
        CQLQueryBuilder.appendSimpleQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "\"quoted term\"");
84
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
85

  
86
        //keyword1 and wrong and quoted and term
87
        queryBuilder1 = new StringBuilder();
88
        queryBuilder2 = new StringBuilder();
89
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"wrong quoted term");
90
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.NONE, "keyword1");
91
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "wrong");
92
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "quoted");
93
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "term");
94
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
95

  
96
        //keyword1 and wrong and quoted and term
97
        queryBuilder1 = new StringBuilder();
98
        queryBuilder2 = new StringBuilder();
99
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 wrong quoted term\"");
100
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.NONE, "keyword1");
101
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "wrong");
102
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "quoted");
103
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "term");
104
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
105

  
106
        //(__all exact "quoted term")
107
        queryBuilder1 = new StringBuilder();
108
        queryBuilder2 = new StringBuilder();
109
        CQLQueryBuilder.appendKeywords(queryBuilder1, "\"quoted term\"");
110
        CQLQueryBuilder.appendSimpleQuotedTerm(queryBuilder2, CQLQueryBuilder.Operator.NONE, "\"quoted term\"");
111
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
112

  
113
        //
114
        queryBuilder1 = new StringBuilder();
115
        queryBuilder2 = new StringBuilder();
116
        CQLQueryBuilder.appendKeywords(queryBuilder1, "");
117
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
118

  
119
        //
120
        queryBuilder1 = new StringBuilder();
121
        queryBuilder2 = new StringBuilder();
122
        CQLQueryBuilder.appendKeywords(queryBuilder1, null);
123
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
124

  
125

  
126
        //existing_query and keyword1 and wrong and quoted and term
127
        queryBuilder1 = new StringBuilder();
128
        queryBuilder2 = new StringBuilder();
129
        queryBuilder1.append("existing_query");
130
        queryBuilder2.append("existing_query");
131
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"wrong quoted term");
132
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "keyword1");
133
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "wrong");
134
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "quoted");
135
        CQLQueryBuilder.appendSimpleTerm(queryBuilder2, CQLQueryBuilder.Operator.AND, "term");
136
        Assert.assertEquals(queryBuilder2.toString(), queryBuilder1.toString());
137

  
138
        queryBuilder2 = new StringBuilder();
139

  
140
        //existing_query and keyword1 and (__all exact "quoted term")
141
        queryBuilder1 = new StringBuilder();
142
        queryBuilder1.append("existing_query");
143
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"quoted term\"");
144
        Assert.assertEquals(queryBuilder1.toString(), "existing_query and (keyword1) and (__all exact \"quoted term\")" );
145

  
146
        //existing_query and (__all exact "quoted term")
147
        queryBuilder1 = new StringBuilder();
148
        queryBuilder1.append("existing_query");
149
        CQLQueryBuilder.appendKeywords(queryBuilder1, "keyword1 \"quoted term\"");
150
        Assert.assertEquals(queryBuilder1.toString(), "existing_query and (keyword1) and (__all exact \"quoted term\")");
151

  
152
        //existing query
153
        queryBuilder1 = new StringBuilder();
154
        queryBuilder1.append("existing_query");
155
        CQLQueryBuilder.appendKeywords(queryBuilder1, "");
156
        Assert.assertEquals(queryBuilder1.toString(), "existing_query");
157

  
158
        //existing query
159
        queryBuilder1 = new StringBuilder();
160
        queryBuilder1.append("existing_query");
161
        CQLQueryBuilder.appendKeywords(queryBuilder1, null);
162
        Assert.assertEquals(queryBuilder1.toString(), "existing_query");
163

  
164
    }
165
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/utils/solr/SolrUtilsTest.java
1
package eu.dnetlib.data.search.utils.solr;
2

  
3
import eu.dnetlib.data.search.app.SearchServiceImpl;
4
import eu.dnetlib.data.search.solr.SolrResultSet;
5
import eu.dnetlib.data.search.web.api.SearchApiService;
6
import eu.dnetlib.data.search.web.utils.RequestResponseHandler;
7
import eu.dnetlib.functionality.cql.CqlTranslator;
8
import eu.dnetlib.functionality.cql.CqlTranslatorImpl;
9
import org.apache.log4j.BasicConfigurator;
10
import org.apache.solr.client.solrj.impl.CloudSolrClient;
11
import org.apache.solr.common.util.NamedList;
12
import org.junit.Assert;
13
import org.junit.Before;
14
import org.junit.Test;
15
import org.mockito.Mockito;
16
import org.z3950.zing.cql.CQLParseException;
17

  
18
import javax.servlet.http.HttpServletRequest;
19
import java.io.IOException;
20
import java.util.ArrayList;
21
import java.util.Arrays;
22
import java.util.List;
23

  
24
import static org.mockito.Matchers.anyString;
25
import static org.mockito.Mockito.doNothing;
26

  
27

  
28
/**
29
 * Created by kiatrop on 9/11/2016.
30
 */
31
public class SolrUtilsTest {
32

  
33
    private org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(SearchApiService.class);
34

  
35
    HttpServletRequest requestMock;
36
    RequestResponseHandler.Entity entity;
37
    List<String> refineFields = new ArrayList<String>();
38
    List<String> specialFacets = new ArrayList<String>();
39
    List<String> fieldQueries = new ArrayList<String>();
40
    List<String> fieldQueriesWithComma = new ArrayList<String>();
41
    CloudSolrClient mockSolrClient;
42
    SolrResultSet mockRS;
43

  
44
    @Before
45
    public  void before() {
46
        BasicConfigurator.configure();
47
        mockSolrClient = Mockito.mock(CloudSolrClient.class);
48
        doNothing().when(mockSolrClient).setDefaultCollection(anyString());
49

  
50
        mockRS = Mockito.mock(SolrResultSet.class);
51

  
52
        refineFields = Arrays.asList(new String[]{"relfunderid", "relfundinglevel0_id", "relfundinglevel1_id", "relfundinglevel2_id"});
53

  
54
        specialFacets =  Arrays.asList(new String[]{"relfundinglevel0_id", "relfundinglevel1_id"});
55

  
56
        fieldQueries = Arrays.asList(new String[]{"(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)",
57
                "relfundinglevel0_id exact ec___::EC::SP1" , "(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)"});
58

  
59
        fieldQueriesWithComma = Arrays.asList(new String[]{"(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)",
60
                "relfundinglevel0_id exact \"ec___::EC::SP1,ec___::EC::SP2\"" });
61

  
62
    }
63

  
64

  
65
    @Test
66
    public void createEprQuery() {
67
        String query = SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, specialFacets, fieldQueries);
68
        Assert.assertEquals("query=(oaftype=result)" +
69
                "&groupby=relfunderid,relfundinglevel0_id,relfundinglevel1_id,relfundinglevel2_id" +
70
                "&sf=relfundinglevel0_id,relfundinglevel1_id"+
71
                "&fq=(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT),relfundinglevel0_id exact ec___::EC::SP1," +
72
                        "(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)", query);
73

  
74

  
75
        //empty refine, empty fq, empty fc
76
        query = SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), new ArrayList<>(),new ArrayList<String>());
77
        Assert.assertEquals("query=(oaftype=result)" +
78
                "&groupby=" +
79
                "&sf="+
80
                "&fq=", query);
81

  
82
        //empty refine, empty fq
83
        query = SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), specialFacets,new ArrayList<String>());
84
        Assert.assertEquals("query=(oaftype=result)" +
85
                "&groupby=" +
86
                "&sf=relfundinglevel0_id,relfundinglevel1_id"+
87
                "&fq=", query);
88

  
89

  
90
        //empty fq, empty sf
91
        query = SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, new ArrayList<>(),  new ArrayList<String>());
92
        Assert.assertEquals("query=(oaftype=result)" +
93
                "&groupby=relfunderid,relfundinglevel0_id,relfundinglevel1_id,relfundinglevel2_id" +
94
                "&sf="+
95
                "&fq=", query);
96

  
97
        //empty refine, empty sf
98
        query = SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), new ArrayList<>(), fieldQueries);
99
        Assert.assertEquals("query=(oaftype=result)" +
100
                "&groupby=" +
101
                "&sf="+
102
                "&fq=(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT),relfundinglevel0_id exact ec___::EC::SP1," +
103
                "(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)", query);
104

  
105
        //empty refine, empty sf
106
        query = SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), new ArrayList<>(), fieldQueries);
107
        Assert.assertEquals("query=(oaftype=result)" +
108
                "&groupby=" +
109
                "&sf="+
110
                "&fq=(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT),relfundinglevel0_id exact ec___::EC::SP1," +
111
                "(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)", query);
112

  
113
        //empty query, empty fc
114
        query = SearchServiceImpl.createEprQuery("", new ArrayList<String>(), new ArrayList<>(), new ArrayList<String>());
115
        Assert.assertEquals("query=" +
116
                "&groupby=" +
117
                "&sf="+
118
                "&fq=", query);
119

  
120
        //null values
121
        query = SearchServiceImpl.createEprQuery(null, null, null,null);
122
        Assert.assertEquals("query=" +
123
                "&groupby=" +
124
                "&sf="+
125
                "&fq=", query);
126

  
127
    }
128

  
129
    @Test
130
    public void extractQueryOptions() throws IOException, CQLParseException {
131
        CqlTranslator cqlTranslator = new CqlTranslatorImpl();
132

  
133
        NamedList<String> actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, specialFacets, fieldQueries));
134
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
135
        Assert.assertEquals("__result", actual.get("fl"));
136
        Assert.assertEquals("true", actual.get("shards.tolerant"));
137
        Assert.assertEquals("true", actual.get("facet"));
138
        Assert.assertEquals("1", actual.get("facet.mincount"));
139
        Assert.assertEquals(refineFields.size() + "", actual.get("facet.threads"));
140
        Assert.assertEquals(refineFields.size(), actual.getAll("facet.field").size());
141
        Assert.assertTrue(actual.getAll("facet.field").contains("relfunderid"));
142
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel1_id"));
143
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel2_id"));
144
        Assert.assertFalse(actual.getAll("facet.field").contains("relfundinglevel3_id"));
145

  
146
        Assert.assertNotNull(actual.get("f.relfundinglevel0_id.facet.limit"));
147
        Assert.assertEquals(actual.get("f.relfundinglevel0_id.facet.limit"), "-1");
148
        Assert.assertNotNull(actual.get("f.relfundinglevel1_id.facet.limit"));
149
        Assert.assertEquals(actual.get("f.relfundinglevel1_id.facet.limit"), "-1");
150
        Assert.assertNull(actual.get("f.relfundinglevel3_id.facet.limit"));
151

  
152
        Assert.assertEquals(fieldQueries.size(), actual.getAll("fq").size());
153
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)")));
154
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("relfundinglevel0_id exact ec___::EC::SP1")));
155
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)")));
156

  
157
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, specialFacets, fieldQueriesWithComma));
158
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)")));
159
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("relfundinglevel0_id exact \"ec___::EC::SP1,ec___::EC::SP2\"")));
160

  
161
        //empty refine, empty fc, empty fq
162
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), new ArrayList<>(), new ArrayList<String>()));
163
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
164
        Assert.assertEquals("__result", actual.get("fl"));
165
        Assert.assertNull(actual.get("q.op"));
166
        Assert.assertEquals("true", actual.get("shards.tolerant"));
167
        Assert.assertNull(actual.get("facet"));
168
        Assert.assertNull(actual.get("facet.mincount"));
169
        Assert.assertNull(actual.get("facet.threads"));
170
        Assert.assertNull(actual.get("facet.field"));
171
        Assert.assertTrue(actual.getAll("facet.field").isEmpty());
172
        Assert.assertNull(actual.get("fq"));
173
        Assert.assertTrue(actual.getAll("fq").isEmpty());
174

  
175
        //empty fq, empty fc
176
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, new ArrayList<>(), new ArrayList<String>()));
177
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
178
        Assert.assertEquals("__result", actual.get("fl"));
179
        Assert.assertNull(actual.get("q.op"));
180
        Assert.assertEquals("true", actual.get("shards.tolerant"));
181
        Assert.assertEquals("true", actual.get("facet"));
182
        Assert.assertEquals("1", actual.get("facet.mincount"));
183
        Assert.assertEquals(refineFields.size() + "", actual.get("facet.threads"));
184
        Assert.assertEquals(refineFields.size(), actual.getAll("facet.field").size());
185
        Assert.assertTrue(actual.getAll("facet.field").contains("relfunderid"));
186
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel1_id"));
187
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel2_id"));
188
        Assert.assertFalse(actual.getAll("facet.field").contains("relfundinglevel3_id"));
189
        Assert.assertNull(actual.get("f.relfundinglevel0_id.facet.limit"));
190
        Assert.assertNull(actual.get("f.relfundinglevel1_id.facet.limit"));
191
        Assert.assertNull(actual.get("fq"));
192
        Assert.assertTrue(actual.getAll("fq").isEmpty());
193

  
194
        //null fc, null fq
195
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", refineFields, null, null));
196
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
197
        Assert.assertEquals("__result", actual.get("fl"));
198
        Assert.assertNull(actual.get("q.op"));
199
        Assert.assertEquals("true", actual.get("shards.tolerant"));
200
        Assert.assertEquals("true", actual.get("facet"));
201
        Assert.assertEquals("1", actual.get("facet.mincount"));
202
        Assert.assertEquals(refineFields.size() + "", actual.get("facet.threads"));
203
        Assert.assertEquals(refineFields.size(), actual.getAll("facet.field").size());
204
        Assert.assertTrue(actual.getAll("facet.field").contains("relfunderid"));
205
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel1_id"));
206
        Assert.assertTrue(actual.getAll("facet.field").contains("relfundinglevel2_id"));
207
        Assert.assertFalse(actual.getAll("facet.field").contains("relfundinglevel3_id"));
208
        Assert.assertNull(actual.get("fq"));
209
        Assert.assertTrue(actual.getAll("fq").isEmpty());
210

  
211
        //empty refine, empty fc
212
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", new ArrayList<String>(), new ArrayList<>(), fieldQueries));
213
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
214
        Assert.assertEquals("__result", actual.get("fl"));
215
//        Assert.assertEquals("AND", actual.get("q.op"));
216
        Assert.assertEquals("true", actual.get("shards.tolerant"));
217
        Assert.assertNull(actual.get("facet"));
218
        Assert.assertNull(actual.get("facet.mincount"));
219
        Assert.assertNull(actual.get("facet.threads"));
220
        Assert.assertNull(actual.get("facet.field"));
221
        Assert.assertTrue(actual.getAll("facet.field").isEmpty());
222
        Assert.assertEquals(fieldQueries.size(), actual.getAll("fq").size());
223
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)")));
224
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("relfundinglevel0_id exact ec___::EC::SP1")));
225
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)")));
226

  
227
        //null refine, null fc
228
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", null, null, fieldQueries));
229
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
230
        Assert.assertEquals("__result", actual.get("fl"));
231
  //      Assert.assertEquals("AND", actual.get("q.op"));
232
        Assert.assertEquals("true", actual.get("shards.tolerant"));
233
        Assert.assertNull(actual.get("facet"));
234
        Assert.assertNull(actual.get("facet.mincount"));
235
        Assert.assertNull(actual.get("facet.threads"));
236
        Assert.assertNull(actual.get("facet.field"));
237
        Assert.assertTrue(actual.getAll("facet.field").isEmpty());
238
        Assert.assertEquals(fieldQueries.size(), actual.getAll("fq").size());
239
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene(("(relfunderid exact ec___::EC) and (relfunderid exact wt___::WT)"))));
240
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("relfundinglevel0_id exact ec___::EC::SP1")));
241
        Assert.assertTrue(actual.getAll("fq").contains(cqlTranslator.toLucene("(relfundinglevel1_id exact ec___::EC::SP1::VALUE1) or (relfundinglevel1_id exact ec___::EC::SP1::VALUE2)")));
242

  
243
        //null refine, null fc, null fq
244
        actual = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery("(oaftype=result)", null, null, null));
245
        Assert.assertEquals(cqlTranslator.toLucene("(oaftype=result)"), actual.get("q"));
246
        Assert.assertEquals("__result", actual.get("fl"));
247
        Assert.assertNull(actual.get("q.op"));
248
        Assert.assertEquals("true", actual.get("shards.tolerant"));
249
        Assert.assertNull(actual.get("facet"));
250
        Assert.assertNull(actual.get("facet.mincount"));
251
        Assert.assertNull(actual.get("facet.threads"));
252
        Assert.assertNull(actual.get("facet.field"));
253
        Assert.assertTrue(actual.getAll("facet.field").isEmpty());
254
        Assert.assertNull(actual.get("fq"));
255
        Assert.assertTrue(actual.getAll("fq").isEmpty());
256
    }
257

  
258
    @Test(expected=CQLParseException.class)
259
    public void extractQueryOptionsEmptyQuery() throws IOException, CQLParseException {
260
        NamedList<String> actual  = SolrResultSetOptionsUtil.extractQueryOptions(SearchServiceImpl.createEprQuery(null, null, null, null));
261
    }
262

  
263
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/SSTest.java
1
package eu.dnetlib.data.search;
2

  
3
/**
4
 * Created by kiatrop on 2/12/2016.
5
 */
6
public class SSTest {
7

  
8
/*    SearchServiceImpl ss = new SearchServiceImpl();
9
    ServiceLocator<IndexService> mockIndexServiceServiceLocator = mock(ServiceLocator.class);
10
    SolrIndexClient mockIndexService = mock(SolrIndexClient.class);
11

  
12
    @Before
13
    public void setup() {
14
        BasicConfigurator.configure();
15

  
16
        System.out.println(ss.getIndexLocator());
17
        //when(ss.getIndexLocator()).thenReturn(mockIndexServiceServiceLocator);
18
        when(mockIndexServiceServiceLocator.getService()).thenReturn(mockIndexService);
19
        ss.setIndexLocator(mockIndexServiceServiceLocator);
20
        //doNothing().when(((SearchServiceImpl) ss).getIndexLocator().getService());
21

  
22
    }
23

  
24
    @Test
25
    public void test() throws SearchServiceException {
26
        ss.search("oaftype=result", null, "", 1,1);
27
    }
28
*/
29
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/transform/FormatterTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import eu.dnetlib.data.search.transform.formatter.SimpleFormatter;
4
import org.apache.log4j.BasicConfigurator;
5
import org.junit.Before;
6
import org.junit.Test;
7

  
8
import java.io.IOException;
9
import java.util.ArrayList;
10
import java.util.Locale;
11

  
12
public class FormatterTest {
13
	@Before
14
	public void setup() throws IOException {
15
		BasicConfigurator.configure();
16
	}
17
	@Test
18
	public void TestFormatter() throws Exception{
19
		
20
		String per1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <record xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" type=\"person\">    <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Egecioglu\" label=\"personId\" indexId=\"dri:objIdentifier\"/>    <field name=\"fullname\" multiplicity=\"false\" value=\"E. Egecioglu\" label=\"Fullname\" indexId=\"\"/>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_K._P._Skibicka\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"K. P. Skibicka\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Hrabovszky\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Hrabovszky\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_Z._Liposits\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"Z. Liposits\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_J._A._Engel\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"J. A. Engel\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Jerlhag\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Jerlhag\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._S._Molnar\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. S. Molnar\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_S._L._Dickson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"S. L. Dickson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_M._Alvarez-Crespo\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"M. Alvarez-Crespo\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._Hansson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. Hansson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"result\">       <field name=\"resultId\" multiplicity=\"false\" value=\"WOS:000285231000019\" label=\"resultId\" indexId=\"\"/>       <field name=\"title\" multiplicity=\"true\" value=\"BLOCKADE OF CENTRAL NICOTINE ACETYLCHOLINE RECEPTOR SIGNALING ATTENUATE GHRELIN-INDUCED FOOD INTAKE IN RODENTS\" label=\"Title\" indexId=\"\"/>       <field name=\"publicationYear\" multiplicity=\"false\" value=\"2010\" label=\"Publication Year\" indexId=\"\"/>    </field> </record>";
21
		
22
		String per2 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <record xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" type=\"person\">    <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Egecioglu\" label=\"personId\" indexId=\"dri:objIdentifier\"/>    <field name=\"fullname\" multiplicity=\"false\" value=\"E. Egecioglu\" label=\"Fullname\" indexId=\"\"/>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_K._P._Skibicka\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"K. P. Skibicka\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Hrabovszky\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Hrabovszky\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_Z._Liposits\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"Z. Liposits\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_J._A._Engel\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"J. A. Engel\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Jerlhag\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Jerlhag\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._S._Molnar\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. S. Molnar\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_S._L._Dickson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"S. L. Dickson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_M._Alvarez-Crespo\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"M. Alvarez-Crespo\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._Hansson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. Hansson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"result\">       <field name=\"resultId\" multiplicity=\"false\" value=\"WOS:000285231000019\" label=\"resultId\" indexId=\"\"/>       <field name=\"title\" multiplicity=\"true\" value=\"BLOCKADE OF CENTRAL NICOTINE ACETYLCHOLINE RECEPTOR SIGNALING ATTENUATE GHRELIN-INDUCED FOOD INTAKE IN RODENTS\" label=\"Title\" indexId=\"\"/>       <field name=\"publicationYear\" multiplicity=\"false\" value=\"2010\" label=\"Publication Year\" indexId=\"\"/>    </field> </record>";
23
		
24
		String per3 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <record xmlns:dri=\"http://www.driver-repository.eu/namespace/dri\" xmlns:oaf=\"http://namespace.openaire.eu/oaf\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" type=\"person\">    <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Egecioglu\" label=\"personId\" indexId=\"dri:objIdentifier\"/>    <field name=\"fullname\" multiplicity=\"false\" value=\"E. Egecioglu\" label=\"Fullname\" indexId=\"\"/>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_K._P._Skibicka\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"K. P. Skibicka\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Hrabovszky\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Hrabovszky\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_Z._Liposits\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"Z. Liposits\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_J._A._Engel\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"J. A. Engel\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_E._Jerlhag\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"E. Jerlhag\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._S._Molnar\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. S. Molnar\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_S._L._Dickson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"S. L. Dickson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_M._Alvarez-Crespo\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"M. Alvarez-Crespo\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"coauthor\">       <field name=\"personId\" multiplicity=\"false\" value=\"WOS:000285231000019_C._Hansson\" label=\"personId\" indexId=\"\"/>       <field name=\"fullname\" multiplicity=\"false\" value=\"C. Hansson\" label=\"Fullname\" indexId=\"\"/>    </field>    <field multiplicity=\"true\" name=\"result\">       <field name=\"resultId\" multiplicity=\"false\" value=\"WOS:000285231000019\" label=\"resultId\" indexId=\"\"/>       <field name=\"title\" multiplicity=\"true\" value=\"BLOCKADE OF CENTRAL NICOTINE ACETYLCHOLINE RECEPTOR SIGNALING ATTENUATE GHRELIN-INDUCED FOOD INTAKE IN RODENTS\" label=\"Title\" indexId=\"\"/>       <field name=\"publicationYear\" multiplicity=\"false\" value=\"2010\" label=\"Publication Year\" indexId=\"\"/>    </field> </record>";
25
		
26
		String output = null;
27
		Locale locale = new Locale("en");
28
		
29
		ArrayList<String> initResults = new ArrayList<String>();
30
		ArrayList<String> cleanResults = new ArrayList<String>();
31
		
32
		initResults.add(per1);
33
		initResults.add(per2);
34
		initResults.add(per3);
35
		
36
		SimpleFormatter formatter = new SimpleFormatter(); 
37

  
38
		cleanResults = (ArrayList<String>) formatter.clearDeclarations(initResults);
39
		System.out.println(initResults.toString());
40
		
41
	}
42
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/transform/ConfigurationTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import eu.dnetlib.data.search.transform.config.ConfigurationFactoryException;
4
import org.junit.Before;
5
import org.junit.Test;
6

  
7
import javax.xml.xpath.XPathExpressionException;
8
import java.io.IOException;
9

  
10

  
11

  
12
public class ConfigurationTest {
13
	
14
	@Before
15
	public void setup() throws IOException {
16
		
17
	}
18
	
19
	@Test
20
	public void testParse() throws XPathExpressionException, IOException, ConfigurationFactoryException {
21
//		ConfigurationFactory factory = new ConfigurationFactory();
22
//		factory.setConfigurationName("configuration.xml");
23
//		factory.createConfiguration("config");
24
//		
25
//		Configuration configuration = factory.createConfiguration("testConfig");
26
//		assertEquals("testConfig", configuration.getConfigurationName());
27
//		
28
//		assertEquals(new Locale("en","US"), configuration.getDefaultLocale());
29
//		
30
//		assertEquals(3, configuration.getVocabulariesMap().keySet().size());
31
//		assertNotNull(configuration.getVocabulariesMap().get("languages"));
32
//		
33
//		assertEquals(configuration.getLocales().size(), configuration.getVocabulariesMap().get("languages").keySet().size());
34
//		
35
//		for (Locale locale: configuration.getLocales()) {
36
//			assertEquals("src/main/eu/dnetlib/data/search/transform/xmls/"+"languages"+"_"+locale+".xml", 
37
//					configuration.getVocabulariesMap().get("languages").get(locale));
38
//		}
39
	}
40
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/transform/VocabularyTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import eu.dnetlib.api.data.SearchService;
4
import eu.dnetlib.api.data.SearchServiceException;
5
import gr.uoa.di.driver.enabling.vocabulary.ISVocabularyLoader;
6
import gr.uoa.di.driver.util.StaticServiceLocator;
7
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
8
import org.junit.Before;
9
import org.junit.Ignore;
10
import org.junit.Test;
11

  
12
import javax.xml.bind.JAXBException;
13
import javax.xml.transform.TransformerException;
14
import javax.xml.transform.TransformerFactoryConfigurationError;
15
import java.io.IOException;
16

  
17
public class VocabularyTest {
18

  
19
	private static String registryAddress = "http://node1.t.openaire.research-infrastructures.eu:8280/is/services/isRegistry";
20
	private static String lookupAddress = "http://node1.t.openaire.research-infrastructures.eu:8280/is/services/isLookUp";
21

  
22
    private static String searchAddress = "http://services.openaire.eu:8380/search/services/searchWebService/search";
23

  
24
	private ISVocabularyLoader loader;
25
	
26
	@Before
27
	public void setup() throws JAXBException, SearchServiceException {
28
		JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
29
        factory.setServiceClass(SearchService.class);
30
        factory.setAddress(searchAddress);
31
        SearchService searchService  = (SearchService) factory.create();
32

  
33
        StaticServiceLocator<SearchService> searchServiceStaticServiceLocator = new StaticServiceLocator<eu.dnetlib.api.data.SearchService>();
34
        searchServiceStaticServiceLocator.setService(searchService);
35

  
36

  
37
    //    searchServiceStaticServiceLocator.getService().search("1", "", "", 1, 1);
38

  
39
    //    searchServiceStaticServiceLocator.getService().search("1", "", "", "", 1, 1);
40
/*		factory.setServiceClass(ISRegistryService.class);
41
		factory.setAddress(registryAddress);
42
		ISRegistryService registryEndpoint = (ISRegistryService) factory
43
				.create();
44

  
45
		factory = new JaxWsProxyFactoryBean();
46
		factory.setServiceClass(ISLookUpService.class);
47
		factory.setAddress(lookupAddress);
48
		ISLookUpService lookupEndpoint = (ISLookUpService) factory.create();
49

  
50
		ISRegistryClient registryClient = new ISRegistryClient();
51
		registryClient.setIsRegistry(registryEndpoint);
52

  
53
		ISLookUpClient lookupClient = new ISLookUpClient();
54
		lookupClient.setIsLookUp(lookupClient);
55
		StaticServiceLocator<eu.dnetlib.api.enabling.ISLookUpService> lookupLocator = new StaticServiceLocator<eu.dnetlib.api.enabling.ISLookUpService>();
56
		lookupLocator.setService(lookupClient);
57

  
58
		ISLookUpImpl<Vocabulary> islookup = new ISLookUpImpl<Vocabulary>();*/
59
//		islookup.setConverter(new VocabularyXmlConverter());
60
//		islookup.setLookupLocator(lookupLocator);
61
//		loader = new ISVocabularyLoader();
62
//		loader.setLookUp(islookup);
63
	}
64

  
65
    @Test
66
    public void testaki(){
67

  
68
    }
69

  
70
	public static String donothing(){
71
		return registryAddress;
72
	}
73
	
74
	@Ignore
75
	@Test
76
	public void test() throws IOException, TransformerFactoryConfigurationError, TransformerException {
77
//		
78
//		Vocabulary v = loader.getVocabulary("Names of languages", new Locale("en") ,Locale.ROOT);
79
//		//System.out.println(v.getEnglishNames());
80
//		HashMap hm = new HashMap<String, Vocabulary>();
81
//		hm.put("languages", v);
82
//		TestVocabRegistry vr = new TestVocabRegistry(hm);
83
//		//Vocabulary vl = vr.getVocabulary("languages");
84
//		//System.out.println(vl.getEnglishName("eng"));
85
//		
86
//		//System.out.println(vr.getValue("languages", "eng"));
87
//		
88
//		//VocabularyManager vocabularyManager = new VocabularyManagerImpl();
89
//		
90
//		//Katerina krina = new Katerina();
91
//		//krina.setVocabularyManager(vocabularyManager);
92
//		
93
//		File xmlf = new File("/home/dimitra/saxon6-5-5/katerinatest/lang.xml");
94
//		String xml= FileUtils.readFileToString(xmlf);
95
//		System.out.println("read xml");
96
//		//first xsl		
97
//		File sxslf = new File("/home/dimitra/saxon6-5-5/katerinatest/browse.xsl");
98
//		String sxsl = FileUtils.readFileToString(sxslf);
99
//		javax.xml.transform.Transformer sTransformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(sxsl)));
100
//		System.out.println("read sxsl");
101
//		//second xsl
102
//		File jxslf = new File("/home/dimitra/saxon6-5-5/katerinatest/fromvel.xsl");
103
//		String jxsl = FileUtils.readFileToString(jxslf);
104
//		javax.xml.transform.Transformer jTransformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(jxsl)));
105
//		System.out.println("read jxsl");
106
//		//are they working?
107
//		StringWriter xmlResultResource = new StringWriter();
108
//		//simple
109
//		StreamResult sts = new StreamResult(xmlResultResource);
110
//	    //xmlResultResource.getBuffer().setLength(0);		
111
//	    //sTransformer.transform(new StreamSource(new StringReader(xml)), sts);
112
//	    //System.out.println("transformed xml: "+xmlResultResource.getBuffer().toString());
113
//	    //System.out.println("first transform: ok");
114
//	    //java
115
//	    StreamResult stj = new StreamResult(xmlResultResource);
116
//	    //xmlResultResource.getBuffer().setLength(0);		
117
//	    //jTransformer.transform(new StreamSource(new StringReader(xml)), stj);
118
//	    //System.out.println("transformed xml: "+xmlResultResource.getBuffer().toString());
119
//	    //System.out.println("second transform: ok");
120
//	    
121
//		
122
//	    long startTime = System.currentTimeMillis();
123
//	    //make 1000 translations with the first way and measure the time
124
//		/*for(int i=0;i<1000;i++){
125
//			xmlResultResource.getBuffer().setLength(0);		
126
//		    sTransformer.transform(new StreamSource(new StringReader(xml)), sts);
127
//		}*/	    
128
//	    long stopTime = System.currentTimeMillis();
129
//	    long elapsedTime = stopTime - startTime;
130
//	    //System.out.println("simple way: "+elapsedTime);		
131
//		//make 1000 translations with the second way and measure the time
132
//	    startTime = System.currentTimeMillis();
133
//	    for(int i=0;i<1000;i++){
134
//			xmlResultResource.getBuffer().setLength(0);		
135
//			jTransformer.transform(new StreamSource(new StringReader(xml)), stj);
136
//	    }
137
//	    stopTime = System.currentTimeMillis();
138
//	    elapsedTime = stopTime - startTime;
139
//	    System.out.println("java way: "+elapsedTime);
140
//	    //Assert.assertEquals("eu.dnetlib.data.search.utils.vοcabulary.VocabularyManagerImpl", "eu.dnetlib.data.search.utils.vocabulary.VocabularyManagerImpl");
141
	}
142
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/transform/TransformerFactoryTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import eu.dnetlib.data.search.transform.config.ConfigurationFactory;
4
import org.apache.log4j.BasicConfigurator;
5
import org.junit.BeforeClass;
6
import org.junit.Test;
7

  
8
import java.io.IOException;
9

  
10

  
11
public class TransformerFactoryTest {
12

  
13
	private static String registryAddress = "http://node1.t.openaire.research-infrastructures.eu:8280/is/services/isRegistry";
14
	private static String lookupAdress = "http://node1.t.openaire.research-infrastructures.eu:8280/is/services/isLookUp";
15
	
16
	@BeforeClass
17
	public static void setup() throws IOException {
18
		BasicConfigurator.configure();
19
		
20
	}
21
	@Test
22
	public void TestTransformerFactory() throws Exception{
23
		ConfigurationFactory factory = new ConfigurationFactory();
24
		/*factory.setConfigurationName("/home/dimitra/projects/uoa-trunk/uoa-search/test/junit/eu/dnetlib/data/search/transform/configuration.xml");
25
		factory.init();
26
		factory.setVocabulariesPath("/home/dimitra/vocabularies/");
27
		Configuration config = factory.createConfiguration("");
28
		SearchRegistry sr = new SearchRegistry();
29
		sr.setConfig(config);*/
30
		
31
		/*LocalVocabularyLoader lvl = new LocalVocabularyLoader();
32
		
33
		
34
		IndexVocabularyLoader ivl = new IndexVocabularyLoader();
35
		ivl.setSearchServiceLocator(new ServiceLocator<SearchService>());
36
		
37
		
38
		VocabularyManagerImpl vocman = new VocabularyManagerImpl();
39
		vocman.setConfig(config);
40
		vocman.setIndexVocabularyLoader(new IndexVocabularyLoader());
41
		
42
		vocman.init();*/
43
		
44
		//ChainTransformer ct = (ChainTransformer)sr.getTransformer("results_openaire", config.getLocales().get(0));
45
		//List<Transformer> all = ct.getTransformers();
46
		
47
		//XsltTransformer tr = (XsltTransformer)all.get(1);
48
		//System.out.println(tr.getXslt());
49
	
50
	}
51
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/java/eu/dnetlib/data/search/transform/XsltTransformerTest.java
1
package eu.dnetlib.data.search.transform;
2

  
3
import org.apache.log4j.BasicConfigurator;
4
import org.junit.Before;
5
import org.junit.Test;
6

  
7
import java.io.IOException;
8

  
9
public class XsltTransformerTest {
10
	@Before
11
	public void setup() throws IOException {
12
		BasicConfigurator.configure();
13
	}
14
	@Test
15
	public void TestTransformer() throws Exception{
16
		String xslt = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\"><xsl:output method=\"xml\" indent=\"yes\" encoding=\"UTF-8\"/><xsl:template match=\"/\"><xsl:apply-templates/></xsl:template>";
17
		xslt += "<xsl:template match=\"@*|node()\"><xsl:copy><xsl:apply-templates select=\"@*|node()\"/></xsl:copy></xsl:template></xsl:stylesheet>";
18
		
19
		String input = "<record type=\"result\"><field name=\"resultId\" value=\"WOS:000285231000019\" label=\"resultId\" indexId=\"\"/>";
20
		input += "<field name=\"title\" label=\"Title\" indexId=\"\" value=\"BLOCKADE OF CENTRAL NICOTINE ACETYLCHOLINE RECEPTOR \"/>";
21
		input += "<field name=\"description\" label=\"Description\" indexId=\"\" value=\"Here we sought ...\"/>";
22
		input += "</record>";
23
		
24
		String cur = "";
25
		String prev = "";
26
		
27
		XsltTransformer TR = new XsltTransformer(xslt); 
28

  
29
		long start = System.nanoTime();
30
		
31
		prev = TR.transform(input);
32
		for(int i =2; i<10000;i++) {
33
			cur = TR.transform(input);
34
			if(!cur.equals(prev)) {
35
				System.out.println("Error in "+i+" time");
36
				System.out.println(prev);
37
				System.out.println(cur);
38
				break;
39
			}
40
			prev = cur;				
41
		}
42
		long end = System.nanoTime();
43
		System.out.println(end-start);
44
	}
45
}
modules/uoa-search/tags/uoa-search-3.5.4/src/test/resources/eu/dnetlib/data/search/transform/bibtexConfig.xml
1
<bibTexConfig name="type">
2
	<case value="article" bibTexType="article">
3
		<term bibtexname="author" indexname="dc:creator"/>
4
		<term bibtexname="title" indexname="title"/>
5
		<term bibtexname="journal" indexname="dc:source"/>
6
		<term bibtexname="year" indexname="publicationyear"/>
7
	</case>
8
	<case value="book" bibTexType="book">
9
		<term bibtexname="editor" indexname="dc:creator"/>
10
		<term bibtexname="title" indexname="title"/>
11
		<term bibtexname="publisher" indexname="publisher"/>
12
		<term bibtexname="year" indexname="publicationyear"/>
13
	</case>
14
	<case value="bookPart" bibTexType="incollection">
15
		<term bibtexname="author" indexname="dc:creator"/>
16
		<term bibtexname="title indexname="title"/">
17
		<term bibtexname="booktitle" indexname="source or dc:relation"/>
18
		<term bibtexname="year" indexname="publicationyear"/>
19
	</case>
20
	<case value="conferenceObject" bibTexType="inproceedings">
21
		<term bibtexname="author" indexname="dc:creator"/>
22
		<term bibtexname="title" indexname="title"/>
23
		<term bibtexname="booktitle" indexname="source or dc:relation"/>
24
		<term bibtexname="year" indexname="publicationyear"/>
25
	</case>
26
	<case value="masterThesis" bibTexType="masterthesis">
27
		<term bibtexname="author" indexname="dc:creator"/>
28
		<term bibtexname="title" indexname="title"/>
29
		<term bibtexname="school" indexname="affiliationname"/>
30
		<term bibtexname="year" indexname="publicationyear"/>
31
	</case>
32
	<case value="doctoralThesis" bibTexType="phdthesis">
33
		<term bibtexname="author" indexname="dc:creator"/>
34
		<term bibtexname="title" indexname="title"/>
35
		<term bibtexname="school" indexname="affiliationname"/>
36
		<term bibtexname="year" indexname="publicationyear"/>
37
	</case>
38
	<case value="report" bibTexType="techreport">
39
		<term bibtexname="author" indexname="dc:creator"/>
40
		<term bibtexname="title" indexname="title"/>
41
		<term bibtexname="institution" indexname="affiliationname"/>	
42
	</case>
43
	<defaultcase bibTexType="misc">
44
		<term bibtexname="author" indexname="dc:creator"/>
45
		<term bibtexname="title" indexname="title"/>
46
		<term bibtexname="year" indexname="publicationyear"/>
47
	</case>
48
</bibTexConfig>
49

  
modules/uoa-search/tags/uoa-search-3.5.4/src/test/resources/eu/dnetlib/data/search/transform/configuration.xml
1
<?xml version="1.0" encoding="UTF-8"?> 
2
<configuration>
3
	<locales>
4
		<locale name="en_US" default="true" />
5
		<locale name="fr_FR" default="false" />
6
		<locale name="gr_GR" default="false" />
7
	</locales>
8

  
9
	<vocabularies>
10
	 	<is_vocabulary name="languages" xml_name="Names of Languages" />
11
		<is_vocabulary name="countries" xml_name="Names of Countries" />
12
		<is_vocabulary name="labels" xml_name="Short list of language names" />
13

  
14
		<index_vocabulary name="datasources" query="oaftype=datasource" transformer="datasourceVocabularyTransformer"/>
15
		<index_vocabulary name="projects" query="oaftype=project" transformer="projectVocabularyTransformer"/>
16

  
17
		<local_vocabulary name="funders" file="funders.xml" />
18
		<local_vocabulary name="programmes" file="programmes.xml" />  
19
		<local_vocabulary name="areas" file="areas.xml" />
20
		<local_vocabulary name="compatibility" file="compatibility.xml" />
21
		<local_vocabulary name="accessModes" file="accessmode.xml" />
22
	</vocabularies>
23

  
24
	<transformers>
25
		<transformer name="datasourceVocabularyTransformer">
26
			<transformation xslt="datasource_mini.xsl" />
27
		</transformer>
28

  
29
		<transformer name="projectVocabularyTransformer">
30
			<transformation xslt="project_mini.xsl" />
31
		</transformer>
32

  
33
		<transformer name="results_openaire">
34
			<transformation xslt="result.xsl" />
35
	 		<transformation match="language" change="value" vocabulary="languages" />
36
			<transformation match="funding.funding_level_0" change="value" vocabulary="funders" />
37
			<transformation match="funding.funding_level_1" change="value" vocabulary="programmes" />
38
			<transformation match="funding.funding_level_2" change="value" vocabulary="areas" />
39
			<transformation match="datasource.hostedby" change="value" vocabulary="datasources" />
40
			<transformation match="datasource.licenceid" change="value" vocabulary="accessModes" />
41
		</transformer>
42

  
43
		<transformer name="projects_openaire">
44
			<transformation xslt="project.xsl" />
45
		</transformer>
46

  
47
		<transformer name="datasources_openaire">
48
			<transformation xslt="datasource.xsl" />
49
		</transformer>
50

  
51
		<!-- valid for every browse result of every entity type -->
52
		<transformer name="results_openaire_browse">
53
			<transformation xslt="browse.xsl" />
54
			<transformation match="resultlanguageid.value" change="value" vocabulary="languages" />
55
			<transformation match="organizationcountryid.value" change="value" vocabulary="countries" />
56

  
57
			<transformation match="relfundinglevel0_id.value" change="value" vocabulary="funders" />
58
			<transformation match="relfundinglevel1_id.value" change="value" vocabulary="programmes" />
59
			<transformation match="relfundinglevel2_id.value" change="value" vocabulary="areas" />
60
			<transformation match="resulthostingdatasourceid.value" change="value" vocabulary="datasources" />
61

  
62
			<transformation match="datasourcecompatibilityid.value" change="value" vocabulary="compatibility"/>
63
			<transformation match="resultrightsid.value" change="value" vocabulary="accessModes" />
64
			<transformation match="relprojectid.value" change="value" vocabulary="projects" />
65
		</transformer>
66

  
67
		<transformer name="persons_openaire">
68
			<transformation xslt="person.xsl" />
69
		</transformer>
70

  
71
		<transformer name="organizations_openaire">
72
			<transformation xslt="organization.xsl" />
73
		</transformer>
74
		
75
	</transformers>
76

  
77
	<formatters>
78
		<formatter name="json" xslt="json.xsl"/> 
79
		<formatter name="xml" xslt="simple.xsl"/>
80
		<formatter name="vocabulary" xslt="vocabulary.xsl"/>
81
	</formatters>
82
</configuration>
83
	
modules/uoa-search/tags/uoa-search-3.5.4/src/vocabularies/Namesof TextObjectTypologies_es_ES.xml
1
<RESOURCE_PROFILE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="10a89de8-8f16-4e8c-824c-f76646438fa6_Vm9jYWJ1bGFyeURTUmVzb3VyY2VzL1ZvY2FidWxhcnlEU1Jlc291cmNlVHlwZQ=="/>
4
        <RESOURCE_TYPE value="VocabularyDSResourceType"/>
5
        <RESOURCE_KIND value="VocabularyDSResources"/>
6
        <RESOURCE_URI value="String"/>
7
        <DATE_OF_CREATION value="2010-12-23T19:05:23+01:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <VOCABULARY_NAME>Names of Text Object Typologies_es_ES</VOCABULARY_NAME>
12
            <VOCABULARY_DESCRIPTION>List of typology types provided by the DRIVER Guidelines for Repository content</VOCABULARY_DESCRIPTION>
13
            <TERMS>
14
                <TERM encoding="0000" english_name="Desconocido" native_name="">
15
                    <SYNONYMS/>
16
                </TERM>
17
                <TERM encoding="0001" english_name="Artículo" native_name="">
18
                    <SYNONYMS>
19
                        <SYNONYM encoding="DRIVER" term="Article in monograph or in proceedings"/>
20
                        <SYNONYM encoding="DRIVER" term="Article/Letter to editor"/>
21
                        <SYNONYM encoding="DRIVER" term="Article / Letter to the editor"/>
22
                        <SYNONYM encoding="DRIVER" term="Article / Letter to editor"/>
23
                        <SYNONYM encoding="DRIVER" term="Article-letter to the editor"/>
24
                        <SYNONYM encoding="DRIVER" term="Article - letter to the editor"/>
25
                        <SYNONYM encoding="DRIVER" term="Journal article"/>
26
                        <SYNONYM encoding="DRIVER" term="Journal article (on-line or printed)"/>
27
                        <SYNONYM encoding="DRIVER" term="Peer-reviewed Article"/>
28
                        <SYNONYM encoding="DRIVER" term="Article / Newspaper"/>
29
                        <SYNONYM encoding="DRIVER" term="Aufsatz"/>
30
                    </SYNONYMS>
31
                </TERM>
32
                <TERM encoding="0002" english_name="Libro" native_name="">
33
                    <SYNONYMS>
34
                        <SYNONYM encoding="DRIVER" term="Book (monograph)"/>
35
                        <SYNONYM encoding="DRIVER" term="Book - monograph - editorial book"/>
36
                        <SYNONYM encoding="DRIVER" term="Book Section"/>
37
                        <SYNONYM encoding="DRIVER" term="Monograph"/>
38
                    </SYNONYMS>
39
                </TERM>
40
                <TERM encoding="0003" english_name="Lectura de Conferencia" native_name="">
41
                    <SYNONYMS/>
42
                </TERM>
43
                <TERM encoding="0004" english_name="Informe de Conferencia" native_name="">
44
                    <SYNONYMS>
45
                        <SYNONYM encoding="DRIVER" term="Conference or Workshop Item"/>
46
                        <SYNONYM encoding="DRIVER" term="Conference Paper"/>
47
                        <SYNONYM encoding="DRIVER" term="Conference contribution"/>
48
                        <SYNONYM encoding="DRIVER" term="Conference Paper"/>
49
                    </SYNONYMS>
50
                </TERM>
51
                <TERM encoding="0005" english_name="Contribución a periódico o pulicación semanal" native_name="">
52
                    <SYNONYMS/>
53
                </TERM>
54
                <TERM encoding="0006" english_name="Tesis doctoral" native_name="">
55
                    <SYNONYMS>
56
                        <SYNONYM encoding="DINI" term="Text.Thesis.Doctoral"/>
57
                        <SYNONYM encoding="DRIVER" term="Thesis.Doctoral"/>
58
                        <SYNONYM encoding="DRIVER" term="Dissertation"/>
59
                        <SYNONYM encoding="DRIVER" term="Diss"/>
60
                        <SYNONYM encoding="DRIVER" term="DoctoralThesis"/>
61
                    </SYNONYMS>
62
                </TERM>
63
                <TERM encoding="0007" english_name="Tesis de Master" native_name="">
64
                    <SYNONYMS>
65
                        <SYNONYM encoding="DINI" term="Masters-Thesis.Magister"/>
66
                        <SYNONYM encoding="DRIVER" term="Thesis.Master"/>
67
                        <SYNONYM encoding="DRIVER" term="Masters thesis"/>
68
                    </SYNONYMS>
69
                </TERM>
70
                <TERM encoding="0008" english_name="Proyecto fin de carrera" native_name="">
71
                    <SYNONYMS/>
72
                </TERM>
73
                <TERM encoding="0009" english_name="Informe de Investigación Externo" native_name="">
74
                    <SYNONYMS>
75
                        <SYNONYM encoding="DINI" term="Tech-Report"/>
76
                    </SYNONYMS>
77
                </TERM>
78
                <TERM encoding="0010" english_name="Lectura" native_name="">
79
                    <SYNONYMS>
80
                        <SYNONYM encoding="DINI" term="Public-Lecture"/>
81
                        <SYNONYM encoding="DRIVER" term="Inaugural lecture"/>
82
                    </SYNONYMS>
83
                </TERM>
84
                <TERM encoding="0011" english_name="Informe Interno" native_name="">
85
                    <SYNONYMS/>
86
                </TERM>
87
                <TERM encoding="0012" english_name="Noticia" native_name="">
88
                    <SYNONYMS/>
89
                </TERM>
90
                <TERM encoding="0013" english_name="Parte de Libro o Capítulo de Libro" native_name="">
91
                    <SYNONYMS>
92
                        <SYNONYM encoding="DRIVER" term="Part of book - chapter"/>
93
                        <SYNONYM encoding="DRIVER" term="Book editorial"/>
94
                        <SYNONYM encoding="DRIVER" term="Book section"/>
95
                    </SYNONYMS>
96
                </TERM>
97
                <TERM encoding="0014" english_name="Trabajo de Investigación" native_name="">
98
                    <SYNONYMS>
99
                        <SYNONYM encoding="DINI" term="Research-Paper"/>
100
                        <SYNONYM encoding="DINI" term="Paper"/>
101
                        <SYNONYM encoding="DINI" term="ResearchPaper"/>
102
                    </SYNONYMS>
103
                </TERM>
104
            </TERMS>
105
        </CONFIGURATION>
106
        <STATUS>
107
            <LAST_UPDATE value="2007-05-06T23:02:07+02:00"/>
108
        </STATUS>
109
        <SECURITY_PARAMETERS/>
110
    </BODY>
111
</RESOURCE_PROFILE>
112

  
modules/uoa-search/tags/uoa-search-3.5.4/src/vocabularies/NamesofCountries_es_ES.xml
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="e540db9e-768a-4c75-8f37-5d0f8d0f3115_Vm9jYWJ1bGFyeURTUmVzb3VyY2VzL1ZvY2FidWxhcnlEU1Jlc291cmNlVHlwZQ=="/>
4
        <RESOURCE_TYPE value="VocabularyDSResourceType"/>
5
        <RESOURCE_KIND value="VocabularyDSResources"/>
6
        <RESOURCE_URI value="String"/>
7
        <DATE_OF_CREATION value="2010-12-23T19:12:24+01:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <VOCABULARY_NAME>Names of Countries_es_ES</VOCABULARY_NAME>
12
            <VOCABULARY_DESCRIPTION>OASIS list of country codes Country Code List: ISO 3166-1993 (E). No mappings provided.</VOCABULARY_DESCRIPTION>
13
            <TERMS>
14
                <TERM encoding="AD" english_name="Andorra" native_name="">
15
                    <SYNONYMS/>
16
                </TERM>
17
                <TERM encoding="AE" english_name="Emiratos Árabes Unidos" native_name="">
18
                    <SYNONYMS/>
19
                </TERM>
20
                <TERM encoding="AF" english_name="Afganistán" native_name="">
21
                    <SYNONYMS/>
22
                </TERM>
23
                <TERM encoding="AG" english_name="Antigua y Barbuda" native_name="">
24
                    <SYNONYMS/>
25
                </TERM>
26
                <TERM encoding="AI" english_name="Anguila" native_name="">
27
                    <SYNONYMS/>
28
                </TERM>
29
                <TERM encoding="AL" english_name="Albania" native_name="">
30
                    <SYNONYMS/>
31
                </TERM>
32
                <TERM encoding="AM" english_name="Armenia" native_name="">
33
                    <SYNONYMS/>
34
                </TERM>
35
                <TERM encoding="AN" english_name="Antillas Holandesas" native_name="">
36
                    <SYNONYMS/>
37
                </TERM>
38
                <TERM encoding="AO" english_name="Angola" native_name="">
39
                    <SYNONYMS/>
40
                </TERM>
41
                <TERM encoding="AQ" english_name="Antartida" native_name="">
42
                    <SYNONYMS/>
43
                </TERM>
44
                <TERM encoding="AR" english_name="Argentina" native_name="">
45
                    <SYNONYMS/>
46
                </TERM>
47
                <TERM encoding="AS" english_name="Samoa Americana" native_name="">
48
                    <SYNONYMS/>
49
                </TERM>
50
                <TERM encoding="AT" english_name="Austria" native_name="">
51
                    <SYNONYMS/>
52
                </TERM>
53
                <TERM encoding="AU" english_name="Australia" native_name="">
54
                    <SYNONYMS/>
55
                </TERM>
56
                <TERM encoding="AW" english_name="Aruba" native_name="">
57
                    <SYNONYMS/>
58
                </TERM>
59
                <TERM encoding="AZ" english_name="Azerbaiyán" native_name="">
60
                    <SYNONYMS/>
61
                </TERM>
62
                <TERM encoding="BA" english_name="Bosnia y Herzegovina" native_name="">
63
                    <SYNONYMS/>
64
                </TERM>
65
                <TERM encoding="BB" english_name="Barbados" native_name="">
66
                    <SYNONYMS/>
67
                </TERM>
68
                <TERM encoding="BD" english_name="Bangladesh" native_name="">
69
                    <SYNONYMS/>
70
                </TERM>
71
                <TERM encoding="BE" english_name="Bélgica" native_name="">
72
                    <SYNONYMS/>
73
                </TERM>
74
                <TERM encoding="BF" english_name="Burkina Faso" native_name="">
75
                    <SYNONYMS/>
76
                </TERM>
77
                <TERM encoding="BG" english_name="Bulgaria" native_name="">
78
                    <SYNONYMS/>
79
                </TERM>
80
                <TERM encoding="BH" english_name="Bahréin" native_name="">
81
                    <SYNONYMS/>
82
                </TERM>
83
                <TERM encoding="BI" english_name="Burundi" native_name="">
84
                    <SYNONYMS/>
85
                </TERM>
86
                <TERM encoding="BJ" english_name="Benín" native_name="">
87
                    <SYNONYMS/>
88
                </TERM>
89
                <TERM encoding="BM" english_name="Bermudas" native_name="">
90
                    <SYNONYMS/>
91
                </TERM>
92
                <TERM encoding="BN" english_name="Brunéi" native_name="">
93
                    <SYNONYMS/>
94
                </TERM>
95
                <TERM encoding="BO" english_name="Bolivia" native_name="">
96
                    <SYNONYMS/>
97
                </TERM>
98
                <TERM encoding="BR" english_name="Brasil" native_name="">
99
                    <SYNONYMS/>
100
                </TERM>
101
                <TERM encoding="BS" english_name="Bahamas" native_name="">
102
                    <SYNONYMS/>
103
                </TERM>
104
                <TERM encoding="BT" english_name="Bután" native_name="">
105
                    <SYNONYMS/>
106
                </TERM>
107
                <TERM encoding="BU" english_name="Birmania (ya no existe)" native_name="">
108
                    <SYNONYMS/>
109
                </TERM>
110
                <TERM encoding="BV" english_name="Isla Bouvet" native_name="">
111
                    <SYNONYMS/>
112
                </TERM>
113
                <TERM encoding="BW" english_name="Botsuana" native_name="">
114
                    <SYNONYMS/>
115
                </TERM>
116
                <TERM encoding="BY" english_name="Bielorrusia" native_name="">
117
                    <SYNONYMS/>
118
                </TERM>
119
                <TERM encoding="BZ" english_name="Belice" native_name="">
120
                    <SYNONYMS/>
121
                </TERM>
122
                <TERM encoding="CA" english_name="Canada" native_name="">
123
                    <SYNONYMS/>
124
                </TERM>
125
                <TERM encoding="CC" english_name="Islas Cocos (Keeling)" native_name="">
126
                    <SYNONYMS/>
127
                </TERM>
128
                <TERM encoding="CF" english_name="República Centroafricana" native_name="">
129
                    <SYNONYMS/>
130
                </TERM>
131
                <TERM encoding="CG" english_name="República del Congo" native_name="">
132
                    <SYNONYMS/>
133
                </TERM>
134
                <TERM encoding="CH" english_name="Suiza" native_name="">
135
                    <SYNONYMS/>
136
                </TERM>
137
                <TERM encoding="CI" english_name="Costa de Marfil" native_name="">
138
                    <SYNONYMS/>
139
                </TERM>
140
                <TERM encoding="CK" english_name="Islas Cook" native_name="">
141
                    <SYNONYMS/>
142
                </TERM>
143
                <TERM encoding="CL" english_name="Chile" native_name="">
144
                    <SYNONYMS/>
145
                </TERM>
146
                <TERM encoding="CM" english_name="Camerún" native_name="">
147
                    <SYNONYMS/>
148
                </TERM>
149
                <TERM encoding="CN" english_name="China" native_name="">
150
                    <SYNONYMS/>
151
                </TERM>
152
                <TERM encoding="CO" english_name="Colombia" native_name="">
153
                    <SYNONYMS/>
154
                </TERM>
155
                <TERM encoding="CR" english_name="Costa Rica" native_name="">
156
                    <SYNONYMS/>
157
                </TERM>
158
                <TERM encoding="CS" english_name="Checoslovaquia (ya no existe)" native_name="">
159
                    <SYNONYMS/>
160
                </TERM>
161
                <TERM encoding="CU" english_name="Cuba" native_name="">
162
                    <SYNONYMS/>
163
                </TERM>
164
                <TERM encoding="CV" english_name="Cabo Verde" native_name="">
165
                    <SYNONYMS/>
166
                </TERM>
167
                <TERM encoding="CX" english_name="Isla de Navidad" native_name="">
168
                    <SYNONYMS/>
169
                </TERM>
170
                <TERM encoding="CY" english_name="Chipre" native_name="">
171
                    <SYNONYMS/>
172
                </TERM>
173
                <TERM encoding="CZ" english_name="República Checa" native_name="">
174
                    <SYNONYMS/>
175
                </TERM>
176
                <TERM encoding="DD" english_name="República Democrática Alemana (ya no existe)" native_name="">
177
                    <SYNONYMS/>
178
                </TERM>
179
                <TERM encoding="DE" english_name="Alemania" native_name="">
180
                    <SYNONYMS/>
181
                </TERM>
182
                <TERM encoding="DJ" english_name="Yibuti" native_name="">
183
                    <SYNONYMS/>
184
                </TERM>
185
                <TERM encoding="DK" english_name="Dinamarca" native_name="">
186
                    <SYNONYMS/>
187
                </TERM>
188
                <TERM encoding="DM" english_name="Dominica" native_name="">
189
                    <SYNONYMS/>
190
                </TERM>
191
                <TERM encoding="DO" english_name="República Dominicana" native_name="">
192
                    <SYNONYMS/>
193
                </TERM>
194
                <TERM encoding="DZ" english_name="Argelia" native_name="">
195
                    <SYNONYMS/>
196
                </TERM>
197
                <TERM encoding="EC" english_name="Ecuador" native_name="">
198
                    <SYNONYMS/>
199
                </TERM>
200
                <TERM encoding="EE" english_name="Estonia" native_name="">
201
                    <SYNONYMS/>
202
                </TERM>
203
                <TERM encoding="EG" english_name="Egipto" native_name="">
204
                    <SYNONYMS/>
205
                </TERM>
206
                <TERM encoding="EH" english_name="Sahara Occidental" native_name="">
207
                    <SYNONYMS/>
208
                </TERM>
209
                <TERM encoding="ER" english_name="Eritrea" native_name="">
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff