/
fgsconfig-basic.xml
116 lines (89 loc) · 6.86 KB
/
fgsconfig-basic.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: fgsconfig-basic.xml $ -->
<project name="FgsConfigBasic" default="configFgsBasic" basedir=".">
<description>
Fedora Generic Search Service configuration
This ant script is run from command line:
>ant -f fgsconfig-basic.xml
Be sure you have permissions to write to finalConfigPath.
</description>
<property file="fgsconfig-basic.properties" />
<property name="templateConfigPath" location="."/>
<property name="templateConfigName" value="FgsConfigTemplate"/>
<property name="finalConfigName" value="fgsconfigFinal"/>
<property name="indexBase" value="defaultindexBase"/>
<target name="configFgsBasic"
description="copy template files and insert property values">
<ant antfile="fgsconfig-basic.xml" target="configFgsRoot">
</ant>
<ant antfile="fgsconfig-basic.xml" target="configFgsRepos">
<property name="reposName" value="${namesOfRepositories}"/>
</ant>
<ant antfile="fgsconfig-basic.xml" target="configFgsIndex">
<property name="indexName" value="${namesOfIndexes}"/>
</ant>
<copy file="fgsconfig-basic.properties" tofile="fgsconfig-basic-${configDisplayName}.properties" preservelastmodified="true" />
<copy file="fgsconfig-basic.properties" tofile="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fgsconfig-basic-${configDisplayName}.properties" preservelastmodified="true" />
<delete dir="${finalConfigPath}/${finalConfigName}" />
<mkdir dir="${finalConfigPath}/${finalConfigName}" />
<copy todir="${finalConfigPath}/${finalConfigName}" preservelastmodified="true">
<fileset dir="${templateConfigPath}/${configDisplayName}/${finalConfigName}"/>
</copy>
<copy file="${templateConfigPath}/${configDisplayName}/log4j.xml" todir="${finalConfigPath}" preservelastmodified="true" />
</target>
<target name="configFgsRoot"
description="insert config values into config files">
<delete dir="${templateConfigPath}/${configDisplayName}/${finalConfigName}" />
<mkdir dir="${templateConfigPath}/${configDisplayName}/${finalConfigName}" />
<copy todir="${templateConfigPath}/${configDisplayName}/${finalConfigName}" preservelastmodified="true">
<fileset dir="${templateConfigPath}/${templateConfigName}"/>
</copy>
<copy file="${templateConfigPath}/log4j.xml" todir="${templateConfigPath}/${configDisplayName}" preservelastmodified="true" />
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fgsconfigObjects.properties" token="FGSCONFIGOBJECTSBASE" value="${fedoraBase}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fgsconfigObjects.properties" token="FGSCONFIGOBJECTSAPPNAME" value="${fedoraAppName}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fgsconfigObjects.properties" token="FGSCONFIGOBJECTSUSER" value="${fedoraUser}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fgsconfigObjects.properties" token="FGSCONFIGOBJECTSPASS" value="${fedoraPass}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fgsconfigObjects.properties" token="FGSCONFIGOBJECTSPATH" value="${finalConfigPath}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fedoragsearch.properties" token="GSEARCHBASE" value="${gsearchBase}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fedoragsearch.properties" token="GSEARCHAPPNAME" value="${gsearchAppName}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fedoragsearch.properties" token="GSEARCHUSER" value="${gsearchUser}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fedoragsearch.properties" token="GSEARCHPASS" value="${gsearchPass}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fedoragsearch.properties" token="CONFIGPATH" value="${templateConfigPath}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fedoragsearch.properties" token="REPOSNAMES" value="${namesOfRepositories}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/fedoragsearch.properties" token="INDEXNAMES" value="${namesOfIndexes}"/>
<replace file="${templateConfigPath}/${configDisplayName}/${finalConfigName}/rest/adminCommonToHtml.xslt" token="FGSCONFIGNAME" value="${configDisplayName}"/>
<replace file="${templateConfigPath}/${configDisplayName}/log4j.xml" token="LOGPATH" value="${logFilePath}"/>
<replace file="${templateConfigPath}/${configDisplayName}/log4j.xml" token="LOGLEVEL" value="${logLevel}"/>
</target>
<target name="configFgsRepos"
description="insert config values into config files">
<property name="templateConfigReposPath" value="${templateConfigPath}/FgsConfigReposTemplate"/>
<property name="finalConfigReposPath" value="${templateConfigPath}/${configDisplayName}/${finalConfigName}/repository/${reposName}"/>
<delete dir="${finalConfigReposPath}" />
<mkdir dir="${finalConfigReposPath}" />
<copy todir="${finalConfigReposPath}" preservelastmodified="true">
<fileset dir="${templateConfigReposPath}"/>
</copy>
<replace file="${finalConfigReposPath}/repository.properties" token="REPOSNAME" value="${reposName}"/>
<replace file="${finalConfigReposPath}/repository.properties" token="FEDORABASE" value="${fedoraBase}"/>
<replace file="${finalConfigReposPath}/repository.properties" token="FEDORAAPPNAME" value="${fedoraAppName}"/>
<replace file="${finalConfigReposPath}/repository.properties" token="FEDORAUSER" value="${fedoraUser}"/>
<replace file="${finalConfigReposPath}/repository.properties" token="FEDORAPASS" value="${fedoraPass}"/>
<replace file="${finalConfigReposPath}/repository.properties" token="FEDORAVERSION" value="${fedoraVersion}"/>
<replace file="${finalConfigReposPath}/repository.properties" token="FEDORAOBJECTDIR" value="${objectStoreBase}"/>
</target>
<target name="configFgsIndex"
description="insert config values into config files">
<property name="templateConfigIndexPath" value="${templateConfigPath}/FgsConfigIndexTemplate/${indexEngine}"/>
<property name="finalConfigIndexPath" value="${templateConfigPath}/${configDisplayName}/${finalConfigName}/index/${indexName}"/>
<delete dir="${finalConfigIndexPath}" />
<mkdir dir="${finalConfigIndexPath}" />
<copy todir="${finalConfigIndexPath}" preservelastmodified="true">
<fileset dir="${templateConfigIndexPath}"/>
</copy>
<replace file="${finalConfigIndexPath}/index.properties" token="INDEXNAME" value="${indexName}"/>
<replace file="${finalConfigIndexPath}/index.properties" token="INDEXBASE" value="${indexBase}"/>
<replace file="${finalConfigIndexPath}/index.properties" token="INDEXDIR" value="${indexDir}"/>
<replace file="${finalConfigIndexPath}/index.properties" token="INDEXINGDOCXSLT" value="${indexingDocXslt}"/>
</target>
</project>