Revision 34758
Added by Katerina Iatropoulou over 9 years ago
modules/uoa-web-generic/trunk/build/ivy.xml | ||
---|---|---|
1 |
<ivy-module version="1.0"> |
|
2 |
<info organisation="driver" module="uoa-web-generic" status="integration" /> |
|
3 |
<configurations defaultconfmapping="*->default"> |
|
4 |
<conf name="default" /> |
|
5 |
<conf name="junit" visibility="private" extends="default" /> |
|
6 |
</configurations> |
|
7 |
<publications> |
|
8 |
<artifact name="uoa-web-generic" type="jar" /> |
|
9 |
<artifact name="uoa-web-generic" type="war" /> |
|
10 |
<artifact name="uoa-web-generic" type="src" ext="zip" /> |
|
11 |
</publications> |
|
12 |
<dependencies> |
|
13 |
<dependency org="log4j" name="log4j" rev="+" /> |
|
14 |
<dependency org="javax" name="mail" rev="1.4" /> |
|
15 |
|
|
16 |
<dependency org="javax.servlet" name="servlet-api" rev="2.5" /> |
|
17 |
|
|
18 |
<dependency org="org.apache.struts" name="struts2-core" rev="${struts2.version}" /> |
|
19 |
<dependency org="org.apache.struts" name="struts2-spring-plugin" rev="${struts2.version}" /> |
|
20 |
<dependency org="org.apache.struts" name="struts2-dojo-plugin" rev="${struts2.version}" /> |
|
21 |
|
|
22 |
<dependency org="google" name="jsonplugin" rev="+" /> |
|
23 |
|
|
24 |
<dependency org="org.apache.cxf" name="cxf-api" rev="${cxf.version}" /> |
|
25 |
<dependency org="org.apache.cxf" name="cxf-rt-core" rev="${cxf.version}" /> |
|
26 |
<dependency org="org.apache.cxf" name="cxf-rt-bindings-soap" rev="${cxf.version}" /> |
|
27 |
<dependency org="org.apache.cxf" name="cxf-rt-transports-http" rev="${cxf.version}" /> |
|
28 |
<dependency org="org.apache.cxf" name="cxf-rt-transports-http-jetty" rev="${cxf.version}" /> |
|
29 |
<dependency org="org.apache.cxf" name="cxf-rt-frontend-jaxws" rev="${cxf.version}" /> |
|
30 |
|
|
31 |
<dependency org="driver" name="uoa-commons" rev="0.0.+" /> |
|
32 |
<dependency org="driver" name="uoa-hcm" rev="0.0.+" /> |
|
33 |
<dependency org="driver" name="uoa-clients" rev="0.0.+" /> |
|
34 |
<dependency org="driver" name="dnet-runtime" rev="0.0.+" /> |
|
35 |
<dependency org="driver" name="dlms-jdbc-connector" rev="0.+" /> |
|
36 |
<dependency org="driver" name="uoa-web-utils" rev="0.0.+" /> |
|
37 |
|
|
38 |
<dependency org="org.mockito" name="mockito-core" rev="1.6" conf="junit"/> |
|
39 |
|
|
40 |
<exclude org="apache" module="xerces" /> |
|
41 |
</dependencies> |
|
42 |
|
|
43 |
</ivy-module> |
modules/uoa-web-generic/trunk/build/ivysettings.xml | ||
---|---|---|
1 |
<ivysettings> |
|
2 |
|
|
3 |
<include file="${yvy.build.dir}/ivysettings.xml"/> |
|
4 |
<settings defaultResolver="yvy-resolver" default="yvy.default.cache" defaultCacheDir="${yvy.cache.dir}"/> |
|
5 |
|
|
6 |
</ivysettings> |
modules/uoa-web-generic/trunk/build/build.properties | ||
---|---|---|
1 |
source.dirs = main |
|
2 |
|
|
3 |
project.name = uoa-web-generic |
|
4 |
project.version = 0.0.7 |
|
5 |
project.label = staticize |
|
6 |
|
|
7 |
static.src.dir = ../../uoa-web-static/src |
|
8 |
pages.src.dir = ../../uoa-web-jsp/src |
modules/uoa-web-generic/trunk/build/build.xml | ||
---|---|---|
1 |
<project name="uoa-web-generic" default="build"> |
|
2 |
<!-- |
|
3 |
organisation: driver |
|
4 |
module: uoa-web-generic |
|
5 |
--> |
|
6 |
|
|
7 |
<property file="local.properties"/> |
|
8 |
|
|
9 |
<!-- Layout paths properties --> |
|
10 |
<property file="../../build/yvy-setup.properties"/> |
|
11 |
<property file="../../../../build/yvy-trunk.properties"/> |
|
12 |
<property file="../../../../../build/yvy-tag.properties"/> |
|
13 |
|
|
14 |
<property file="build.properties"/> |
|
15 |
<property name="yvy.build.common" value="${yvy.root.dir}/build/build-common.xml"/> |
|
16 |
|
|
17 |
<!-- Common build definitions --> |
|
18 |
<import file="${yvy.build.common}"/> |
|
19 |
|
|
20 |
<target name="build" depends="jar"/> |
|
21 |
|
|
22 |
<target name="default"> |
|
23 |
<antcall target="${yvy.target.build}" inheritAll="true" inheritRefs="true"/> |
|
24 |
</target> |
|
25 |
|
|
26 |
<target name="recolecta"> |
|
27 |
<property name="setup.name" value="recolecta"/> |
|
28 |
<antcall target="generic.war" inheritAll="true" inheritRefs="true"/> |
|
29 |
</target> |
|
30 |
|
|
31 |
<target name="polish"> |
|
32 |
<property name="setup.name" value="polish" /> |
|
33 |
<antcall target="generic.war" inheritAll="true" inheritRefs="true" /> |
|
34 |
</target> |
|
35 |
|
|
36 |
<target name="driver"> |
|
37 |
<property name="setup.name" value="driver"/> |
|
38 |
<antcall target="generic.war" inheritAll="true" inheritRefs="true"/> |
|
39 |
</target> |
|
40 |
|
|
41 |
<target name="generic.war" depends="yvy.jar,yvy.war.not_required" unless="yvy.war.build.not_required"> |
|
42 |
<delete dir="${main.bin.dir}/${webapp.dirs}" /> |
|
43 |
<mkdir dir="${main.bin.dir}/${webapp.dirs}" /> |
|
44 |
|
|
45 |
<copy todir="${main.bin.dir}/${webapp.dirs}"> |
|
46 |
<fileset dir="${main.src.dir}/${webapp.dirs}"> |
|
47 |
<include name="**/*.*" /> |
|
48 |
<exclude name="**/.svn" /> |
|
49 |
<exclude name="**/.svn/**" /> |
|
50 |
</fileset> |
|
51 |
</copy> |
|
52 |
<copy todir="${main.bin.dir}/${webapp.dirs}/static-content" overwrite="true"> |
|
53 |
<fileset dir="${static.src.dir}/default"> |
|
54 |
<include name="**/*.*" /> |
|
55 |
<exclude name="**/.svn" /> |
|
56 |
<exclude name="**/.svn/**" /> |
|
57 |
</fileset> |
|
58 |
</copy> |
|
59 |
<copy todir="${main.bin.dir}/${webapp.dirs}/static-content" overwrite="true"> |
|
60 |
<fileset dir="${static.src.dir}/${setup.name}"> |
|
61 |
<include name="**/*.*" /> |
|
62 |
<exclude name="**/.svn" /> |
|
63 |
<exclude name="**/.svn/**" /> |
|
64 |
</fileset> |
|
65 |
</copy> |
|
66 |
<copy todir="${main.bin.dir}/${webapp.dirs}/pages" overwrite="true"> |
|
67 |
<fileset dir="${pages.src.dir}/default"> |
|
68 |
<include name="**/*.*" /> |
|
69 |
<exclude name="**/.svn" /> |
|
70 |
<exclude name="**/.svn/**" /> |
|
71 |
</fileset> |
|
72 |
</copy> |
|
73 |
<copy todir="${main.bin.dir}/${webapp.dirs}/pages" overwrite="true"> |
|
74 |
<fileset dir="${pages.src.dir}/${setup.name}"> |
|
75 |
<include name="**/*.*" /> |
|
76 |
<exclude name="**/.svn" /> |
|
77 |
<exclude name="**/.svn/**" /> |
|
78 |
</fileset> |
|
79 |
</copy> |
|
80 |
<build-war sources="${webapp.dirs}" /> |
|
81 |
</target> |
|
82 |
</project> |
modules/uoa-web-generic/trunk/test/junit/gr/uoa/di/webui/search/CriteriaManagerTest.java | ||
---|---|---|
1 |
package gr.uoa.di.webui.search; |
|
2 |
|
|
3 |
import org.apache.log4j.BasicConfigurator; |
|
4 |
import org.junit.Test; |
|
5 |
|
|
6 |
import eu.dnetlib.utils.cql.CqlException; |
|
7 |
|
|
8 |
public class CriteriaManagerTest { |
|
9 |
|
|
10 |
@Test |
|
11 |
public void convertDateTest() throws CqlException { |
|
12 |
BasicConfigurator.configure(); |
|
13 |
// LayoutManager layoutManager = mock(LayoutManager.class); |
|
14 |
// CriteriaManager criteriaManager = new CriteriaManager(layoutManager, new HashMap<String, Vocabulary>()); |
|
15 |
// |
|
16 |
// String url = "title = title OR title = given AND me"; |
|
17 |
// System.out.println("1: " + criteriaManager.convert(url, Target.URL)); |
|
18 |
// |
|
19 |
// System.out.println("=============================================="); |
|
20 |
// url = "me AND title = title"; |
|
21 |
// System.out.println("2: " + criteriaManager.convert(url, Target.URL)); |
|
22 |
// |
|
23 |
} |
|
24 |
} |
modules/uoa-web-generic/trunk/test/junit/gr/uoa/di/webui/search/QueryCollectionEnhancementTest.java | ||
---|---|---|
1 |
package gr.uoa.di.webui.search; |
|
2 |
|
|
3 |
import gr.uoa.di.web.utils.search.query.QueryCollectionEnhancer; |
|
4 |
|
|
5 |
import java.util.ArrayList; |
|
6 |
|
|
7 |
import junit.framework.Assert; |
|
8 |
import junit.framework.TestCase; |
|
9 |
|
|
10 |
public class QueryCollectionEnhancementTest extends TestCase { |
|
11 |
|
|
12 |
private QueryCollectionEnhancer enhancer = new QueryCollectionEnhancer(); |
|
13 |
private String query = "no matter what query"; |
|
14 |
|
|
15 |
public void testEmptyCollectionList(){ |
|
16 |
enhancer.setCollectionIds(new ArrayList<String>()); |
|
17 |
Assert.assertEquals(query, enhancer.enhanceQuery(query)); |
|
18 |
} |
|
19 |
|
|
20 |
public void testNonEmptyCollectionList(){ |
|
21 |
enhancer.setCollectionIds(new ArrayList<String>()); |
|
22 |
|
|
23 |
enhancer.getCollectionIds().add("12345"); |
|
24 |
Assert.assertEquals(query + " AND ( (collection = \"12345\") )",enhancer.enhanceQuery(query)); |
|
25 |
|
|
26 |
enhancer.getCollectionIds().add("67890"); |
|
27 |
Assert.assertEquals |
|
28 |
(query + " AND ( (collection = \"12345\") OR (collection = \"67890\") )", |
|
29 |
enhancer.enhanceQuery(query)); |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
|
|
34 |
} |
modules/uoa-web-generic/trunk/src/test/junit/gr/uoa/di/webui/search/QueryCollectionEnhancementTest.java | ||
---|---|---|
1 |
package gr.uoa.di.webui.search; |
|
2 |
|
|
3 |
import gr.uoa.di.web.utils.search.query.QueryCollectionEnhancer; |
|
4 |
|
|
5 |
import java.util.ArrayList; |
|
6 |
|
|
7 |
import junit.framework.Assert; |
|
8 |
import junit.framework.TestCase; |
|
9 |
|
|
10 |
public class QueryCollectionEnhancementTest extends TestCase { |
|
11 |
|
|
12 |
private QueryCollectionEnhancer enhancer = new QueryCollectionEnhancer(); |
|
13 |
private String query = "no matter what query"; |
|
14 |
|
|
15 |
public void testEmptyCollectionList(){ |
|
16 |
enhancer.setCollectionIds(new ArrayList<String>()); |
|
17 |
Assert.assertEquals(query, enhancer.enhanceQuery(query)); |
|
18 |
} |
|
19 |
|
|
20 |
public void testNonEmptyCollectionList(){ |
|
21 |
enhancer.setCollectionIds(new ArrayList<String>()); |
|
22 |
|
|
23 |
enhancer.getCollectionIds().add("12345"); |
|
24 |
Assert.assertEquals(query + " AND ( (collection = \"12345\") )",enhancer.enhanceQuery(query)); |
|
25 |
|
|
26 |
enhancer.getCollectionIds().add("67890"); |
|
27 |
Assert.assertEquals |
|
28 |
(query + " AND ( (collection = \"12345\") OR (collection = \"67890\") )", |
|
29 |
enhancer.enhanceQuery(query)); |
|
30 |
|
|
31 |
} |
|
32 |
|
|
33 |
|
|
34 |
} |
modules/uoa-web-generic/trunk/src/test/junit/gr/uoa/di/webui/search/CriteriaManagerTest.java | ||
---|---|---|
1 |
package gr.uoa.di.webui.search; |
|
2 |
|
|
3 |
import org.apache.log4j.BasicConfigurator; |
|
4 |
import org.junit.Test; |
|
5 |
|
|
6 |
import eu.dnetlib.utils.cql.CqlException; |
|
7 |
|
|
8 |
public class CriteriaManagerTest { |
|
9 |
|
|
10 |
@Test |
|
11 |
public void convertDateTest() throws CqlException { |
|
12 |
BasicConfigurator.configure(); |
|
13 |
// LayoutManager layoutManager = mock(LayoutManager.class); |
|
14 |
// CriteriaManager criteriaManager = new CriteriaManager(layoutManager, new HashMap<String, Vocabulary>()); |
|
15 |
// |
|
16 |
// String url = "title = title OR title = given AND me"; |
|
17 |
// System.out.println("1: " + criteriaManager.convert(url, Target.URL)); |
|
18 |
// |
|
19 |
// System.out.println("=============================================="); |
|
20 |
// url = "me AND title = title"; |
|
21 |
// System.out.println("2: " + criteriaManager.convert(url, Target.URL)); |
|
22 |
// |
|
23 |
} |
|
24 |
} |
Also available in: Unified diff
mavenizing and refactoring uoa-web-generic - deleting not used folders