Changeset 25338 for main/trunk/greenstone3/build.xml
- Timestamp:
- 2012-04-03T20:56:04+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/build.xml
r25321 r25338 1117 1117 </target> 1118 1118 1119 <target name="check-tomcat-running"> 1119 <target name="check-tomcat-running"><!--if you update this target, may want to change similar elements in config-admin--> 1120 1120 <!--can also try the "socket" condition in place of the "http" condition--> 1121 1121 <condition property="tomcat.isrunning"><!--<waitfor maxwait="5" maxwaitunit="second" timeoutproperty="tomcat.isstopped">--> … … 1179 1179 </if> 1180 1180 </target> 1181 1182 <!-- ======================= Admin Targets ============================ --> 1183 1184 <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it. 1185 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant 1186 But you can do: echo mypassword | ant config-admin --> 1187 <target name="config-admin" description="Reset admin password"> 1188 <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3-8 characters):>"> 1189 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen --> 1190 </input> 1191 <echo>PWD: ${admin.password}</echo> 1192 <antcall target="update-userdb"> 1193 <param name="user.username" value="admin"/> 1194 <param name="user.password" value="${admin.password}"/> 1195 <param name="user.groups" value=""/> 1196 <param name="user.status" value=""/> 1197 <param name="user.comment" value="Password updated."/> 1198 <param name="user.email" value=""/> 1199 </antcall> 1200 </target> 1201 1202 <target name="config-user" description="Add or modify users" depends="get-user-data,update-userdb"/> 1203 1204 <target name="get-user-data" description="Get user details"> 1205 <input addproperty="user.username" message="Username:>"/> 1206 <input addproperty="user.password" defaultvalue="" message="Password (3-8 characters):>"> 1207 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen --> 1208 </input> 1209 <input addproperty="user.groups" defaultvalue="" message="Groups (comma-separated list):>"/> 1210 <input addproperty="user.status" defaultvalue="true" message="Enabled (true/false):>"/> 1211 <input addproperty="user.comment" defaultvalue="" message="Comment:>"/> 1212 <input addproperty="user.email" defaultvalue="" message="Email:>"/> 1213 </target> 1214 1215 <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it. 1216 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant 1217 But you can do: echo mypassword | ant config-admin --> 1218 <target name="update-userdb" description="Add or modify users"> 1219 <echo>username: ${user.username}</echo> 1220 <echo>groups: ${user.groups}</echo> 1221 1222 <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time 1223 See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html --> 1224 <!--<antcall target="check-tomcat-running"/>--><!--won't set the tomcat.isrunning property for use below--> 1225 <condition property="tomcat.isrunning"> 1226 <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/><!--can also try the "socket" condition in place of the "http" condition--> 1227 </condition> 1228 <if> 1229 <bool> 1230 <istrue value="${tomcat.isrunning}"/> 1231 </bool> 1232 <antcall target="force-stop-tomcat"/> 1233 </if> 1234 1235 <!--<echo>${admin.password}</echo>--> <!-- for testing --> 1236 <java classname="org.greenstone.gsdl3.util.ModifyUsersDB"> 1237 <classpath refid="compile.classpath"/> <!--for ${web.lib}/gsdl3.jar and supporting files--> 1238 <arg file="${web.home}/sites/localsite/etc/usersDB"/> 1239 <arg value="${user.username}"/> 1240 <arg value="password=${user.password}"/> 1241 <arg value="groups=${user.groups}"/> 1242 <arg value="status=${user.status}"/> 1243 <arg value="comment=${user.comment}"/> 1244 <arg value="email=${user.email}"/> 1245 </java> 1246 1247 <!-- run tomcat again if it used to be running --> 1248 <if> 1249 <bool> 1250 <istrue value="${tomcat.isrunning}"/> 1251 </bool> 1252 <antcall target="start-tomcat"/> 1253 </if> 1254 </target> 1255 1181 1256 1182 1257 <!-- ======================= Axis Targets ============================ --> … … 1225 1300 </else> 1226 1301 1227 </if>1228 </target>1229 1230 <!-- This target won't work with Eclipse because the SecureInputHandler used below conflicts with it.1231 See http://www.dcepler.net/post.cfm/hiding-password-input-in-ant1232 But you can do: echo mypassword | ant config-admin -->1233 <target name="config-admin" description="Reset admin password">1234 <input addproperty="admin.password" defaultvalue="admin" message="New admin password (3-8 characters):>">1235 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen -->1236 </input>1237 1238 <!-- stop tomcat if running, since derby db is embedded and only allows connections from one jvm instance at a time1239 See http://db.apache.org/derby/papers/DerbyTut/embedded_intro.html -->1240 1241 <!--<antcall target="check-tomcat-running"/>--><!--won't set the tomcat.isrunning property for use below-->1242 <condition property="tomcat.isrunning">1243 <http url="http://${tomcat.server}:${tomcat.port}${app.path}"/><!--can also try the "socket" condition in place of the "http" condition-->1244 </condition>1245 <if>1246 <bool>1247 <istrue value="${tomcat.isrunning}"/>1248 </bool>1249 <antcall target="force-stop-tomcat"/>1250 </if>1251 1252 <!--<echo>${admin.password}</echo>--> <!-- for testing -->1253 <java classname="org.greenstone.gsdl3.util.ChangePwdUsersDB">1254 <classpath refid="compile.classpath"/> <!--for ${web.lib}/gsdl3.jar and supporting files-->1255 <arg file="${web.home}/sites/localsite/etc/usersDB"/>1256 <arg value="admin"/>1257 <arg value="${admin.password}"/>1258 </java>1259 1260 <!-- run tomcat again if it used to be running -->1261 <if>1262 <bool>1263 <istrue value="${tomcat.isrunning}"/>1264 </bool>1265 <antcall target="start-tomcat"/>1266 1302 </if> 1267 1303 </target>
Note:
See TracChangeset
for help on using the changeset viewer.