- Timestamp:
- 2015-09-03T20:59:30+12:00 (9 years ago)
- Location:
- main/trunk/greenstone3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/build.xml
r30170 r30196 1855 1855 <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> <!-- password won't be visible on screen --> 1856 1856 </input> 1857 <input addproperty="user.groups" defaultvalue="" message="Groups (comma-separated list ):>"/>1857 <input addproperty="user.groups" defaultvalue="" message="Groups (comma-separated list, e.g. personal-collections-editor):>"/> 1858 1858 <input addproperty="user.status" defaultvalue="true" message="Enabled (true/false):>"/> 1859 1859 <input addproperty="user.comment" defaultvalue="" message="Comment:>"/> … … 1889 1889 <java classname="org.greenstone.gsdl3.util.ModifyUsersDB"> 1890 1890 <classpath refid="compile.classpath"/> <!--for ${web.lib}/gsdl3.jar and supporting files--> 1891 <sysproperty key="gsdl3.writablehome" value="${gsdl3.writablehome}" /> <!-- passes -D<syspropKey=syspropVal> to java class ModifyUsersDB. Available in java code as System.getProperty("syspropKey") --> 1891 1892 <arg file="${web.home}/etc/usersDB"/> 1892 1893 <arg value="${user.username}"/> -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/DerbyWrapper.java
r30055 r30196 35 35 public class DerbyWrapper 36 36 { 37 static final String PORT = GlobalProperties.getProperty("derby.server.port", "1527"); 38 static final String DERBYSERVER = GlobalProperties.getProperty("derby.server", "localhost"); 39 static final String PROTOCOL = "jdbc:derby://"+DERBYSERVER+":"+PORT+"/"; // "jdbc:derby://localhost:1527"; 40 static final String DRIVER = "org.apache.derby.jdbc.ClientDriver"; //"org.apache.derby.jdbc.EmbeddedDriver"; 37 static final String PORT; 38 static final String DERBYSERVER; 39 static final String PROTOCOL; 40 41 // static code block to initialise the above 42 static { 43 // GlobalProperties won't be loaded at this point if running ant config-admin or ant config-user 44 // from the command line (both of which call ant update-userdb which in turn calls ModifyUsersDB.java) 45 // In such a case, the ant command will have set the system property (-Dgsdl3_writablehome) 46 // and passed this to ModifyUsersDB.java. Use that to load the GlobalProperties at this point 47 48 if(GlobalProperties.getGSDL3Home() == null) { // testing whether GlobalProperties is already loaded 49 String gsdl3_writablehome = System.getProperty("gsdl3.writablehome"); // set by 'ant update-userdb' cmd 50 51 //System.err.println("@@@@@ writablehome: " + gsdl3_writablehome); 52 GlobalProperties.loadGlobalProperties(gsdl3_writablehome); 53 } 54 55 //System.err.println("@@@@@ GlobalProperties.getGSDL3Home(): " + GlobalProperties.getGSDL3Home()); //test 56 57 // No more fallback values, use exactly what's propagated into global.properties from build.properties 58 PORT = GlobalProperties.getProperty("derby.server.port");//, "1527"); 59 DERBYSERVER = GlobalProperties.getProperty("derby.server");//, "localhost"); 60 PROTOCOL = "jdbc:derby://"+DERBYSERVER+":"+PORT+"/"; // "jdbc:derby://localhost:1527"; // by default 61 } 62 63 64 static final String DRIVER = "org.apache.derby.jdbc.ClientDriver"; //"org.apache.derby.jdbc.EmbeddedDriver"; 41 65 static final String USERSDB = "usersDB"; 42 66 static final String USERS = "users"; -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/ModifyUsersDB.java
r30055 r30196 23 23 //import org.greenstone.admin.guiext.PropertiesStep; 24 24 25 // To run this from the command-line, first make sure that the tomcat server is stopped, then run: 26 // java -cp /full/path/to/GS3/web/WEB-INF/lib/gsdl3.jar:/full/path/to/GS3/web/WEB-INF/lib/derby.jar org.greenstone.gsdl3.util.usersDB2txt web/etc/usersDB/ 25 /** 26 To run this from the command-line, first make sure that the networked derby server is running (ant start-derby), 27 then run: 28 29 java -Dgsdl3.writablehome=/Scratch/ak19/gs3-svn-2Sep2015/web -cp web/WEB-INF/lib/gsdl3.jar:web/WEB-INF/lib/gutil.jar:web/WEB-INF/lib/derby.jar:web/WEB-INF/lib/derbyclient.jar:web/WEB-INF/lib/log4j-1.2.8.jar:web/WEB-INF/lib/commons-codec-1.7.jar:web/WEB-INF/classes org.greenstone.gsdl3.util.ModifyUsersDB web/etc/usersDB/ <username> [options specifying user fields to change, e.g.: password=me!] 30 31 Don't forget to stop the networked derby server again at the end, if you had started it: ant stop-derby 32 33 or if using embedded derby, ensure that tomcat is stopped, then run: 34 java -cp /full/path/to/GS3/web/WEB-INF/lib/gsdl3.jar:/full/path/to/GS3/web/WEB-INF/lib/derby.jar org.greenstone.gsdl3.util.ModifyUsersDB web/etc/usersDB/ 35 */ 27 36 public class ModifyUsersDB 28 37 { -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/txt2usersDB.java
r28202 r30196 27 27 import org.greenstone.gsdl3.service.Authentication; 28 28 29 /** 30 To run this from the command-line, first make sure that the derby networked server is running (ant start-derby), 31 then run: 32 33 java -Dgsdl3.writablehome=/full/path/to/GS3/web -cp web/WEB-INF/lib/gsdl3.jar:web/WEB-INF/lib/gutil.jar:web/WEB-INF/lib/derby.jar:./web/WEB-INF/lib/derbyclient.jar:./web/WEB-INF/lib/log4j-1.2.8.jar:./web/WEB-INF/classes org.greenstone.gsdl3.util.txt2usersDB <filename>.txt web/etc/usersDB/ [-append] 34 35 Don't forget to stop the networked derby server again at the end, if you had started it: ant stop-derby 36 37 Or if using embedded derby, ensure that tomcat is stopped, then run: 38 java -cp /full/path/to/GS3/web/WEB-INF/lib/gsdl3.jar:/full/path/to/GS3/web/WEB-INF/lib/derby.jar org.greenstone.gsdl3.util.txt2usersDB <filename>.txt web/etc/usersDB/ [-append] 39 */ 29 40 public class txt2usersDB 30 41 { -
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/usersDB2txt.java
r27135 r30196 29 29 import java.util.Properties; 30 30 31 // Run as java org.greenstone.gsdl3.util.usersDB2txt <usersDB file> 31 /** 32 To run this from the command-line, first make sure that the networked derby server is running (ant start-derby) 33 then run: 34 35 java -Dgsdl3.writablehome=/full/path/to/GS3/web -cp ./web/WEB-INF/lib/gsdl3.jar:./web/WEB-INF/lib/gutil.jar:./web/WEB-INF/lib/derby.jar:./web/WEB-INF/lib/derbyclient.jar:./web/WEB-INF/lib/log4j-1.2.8.jar:./web/WEB-INF/classes org.greenstone.gsdl3.util.usersDB2txt web/etc/usersDB/ 36 37 if redirecting to a file append ">& filename.txt" to the above command 38 since the usersDB2txt program output goes to System.err and needs to be redirected to the file too 39 40 Don't forget to stop the networked derby server again at the end, if you had started it: ant stop-derby 41 42 Or if using embedded derby, ensure that tomcat is stopped, then run: 43 java -cp /full/path/to/GS3/web/WEB-INF/lib/gsdl3.jar:/full/path/to/GS3/web/WEB-INF/lib/derby.jar org.greenstone.gsdl3.util.usersDB2txt web/etc/usersDB/ [>& <output file>] 44 */ 32 45 public class usersDB2txt 33 46 {
Note:
See TracChangeset
for help on using the changeset viewer.