CVS maven2

From EChase
Jump to: navigation, search

CVS Repository[edit]

In order to access the CVS repository you'll each have to create yourselves a public and private key pair (SSH2 RSA, 1024 bit key). Having done this, you'll then need to send your public key to me (szh@it-innovation.soton.ac.uk). Once authorised, access the repository using the following information:

  • protocol: ssh
  • repository path: /project/cvs/mks
  • username: (your altano username - confirmed by Shahbaz or other ITI developer)
  • hostname: altano.it-innovation.soton.ac.uk

The module to be checked out is called mks

The main jist of the repository is that we have 3 areas:

  • a common modules directory;
  • an echase directory;
  • an openmks directory

The idea is that code which is common to eCHASE and OpenMKS should reside within the modules directory. Any project specific files (i.e. documentation, stylesheets, configuration files etc.) should be stored in the relevant area following the appropriate directory structure. This is based on the suggested Maven 2 directory structure.


Committing Code[edit]

Implementation should only be carried out if there's a JIRA task associated with it. There's a restriction based on this and you'll only be able to commit to CVS if commit against a JIRA task IssueID. In order to commit simply include a comment which starts with "IssueId: XXX-YYY" where XXX denotes the 3 letter project abbreviation (in our case 'ECH') and YYY the identification number of the issue, i.e. "IssueId: ECH-324". If you wish to add an additional comment about the commit you may do so starting on a new line.

For those who don't know JIRA is an issue tracking management system we're using to keep track of bugs and tasks that need to be carried out within eCHASE and our cultural heritage projects.


Config files (ECS specific)[edit]

  • mks/echase/srw/src/main/webapp/WEB-INF/classes/srw-config.properties

Add two lines to the end of the file:

media.service.url=http://campin:xxxx
(MediaEngine URL)
media.service.table=echase_mediaengine.query
(databasename.query)
  • mks/echase/webapp/src/main/webapp/WEB-INF/web.xml

Copy appropriate init params into the 3 servlets: XmlRpcProxyServlet, ColourPicker, and UploadServlet. (should look like below):

	<servlet>
	   <servlet-name>XmlRpcProxyServlet</servlet-name>
	   <servlet-class>uk.ac.soton.itinnovation.modules.mks.webapp.XmlRpcProxyServlet</servlet-class>
	   <init-param>
	   <param-name>url</param-name>
	   <param-value>http://campin:7802/</param-value>
	  </init-param>
	   <load-on-startup>1</load-on-startup>
	</servlet>

Config files (Universal)[edit]

  • <tomcat_directory>/conf/server.xml

Webapp security requires you to edit tomcat's server config to enable it to access the user database. Comment out the realm configured on lines 150-151, and add this realm instead: (Note that if you have changed your database names you may need to alter this realm)

	  <Realm 
		className="org.apache.catalina.realm.JDBCRealm" 
				 debug="99"
		driverName="com.mysql.jdbc.Driver" 
		connectionURL="jdbc:mysql://localhost:3306/lightboxdb"
		connectionName="mksuser"
				 connectionPassword="mkspass"
				 userTable="mks_user" 
				 userNameCol="username" 
				 userCredCol="password"
				 userRoleTable="mks_security_userroles" 
				 roleNameCol="rolename"
				 digest="SHA-1"
		/>
  • mks/echase/webapp/src/main/webapp/WEB-INF/web.xml

Lines 162-189 contain the information which governs security - to disable it, simply comment out these lines.

  • <tomcat_directory>/server/lib

You will need to obtain a mysql connector (mysql-connector-java-3.1.13.jar) and copy it into this directory.

Building Code[edit]

Maven 2 is being used to compile code and generate the necessary WARs for deployment.

Having checked out mks from the repository, follow the instructions below:

Database & Users[edit]

install MySQL 5.0 set up the database/users as follows:

  • create user echase with password: echase
  • create srwdb database and populate it by running the mks\modules\srw\src\main\resources\database\sql\CREATE_SRW_DB_SCHEMA.sql script
  • create echase_metadata_schema database and populate it by running the mks\echase\srw\src\main\resources\database\sql\echase_metadata_schema.sql
  • create crm_core with mks/echase/srw/src/main/resources/database/sql/crmcore_db_structure.sql
  • and populate with with mks/echase/srw/src/main/resources/database/sql/crmcore_db_data.sql
  • create user mksuser with password: mkspass
  • create lightboxdb database and populate it by running the mks\modules\lightbox\src\main\resources\database\sql\create_lightbox_tables.sql script
  • create lightbox_srwdb database and populate it by running the mks\echase\lightbox\srw\src\main\resources\database\sql\CREATE_LIGHTBOX_SRW_DB_SCHEMA.sql script

The MySQL users echase and mksuser must have persmission to access the databases created above.

Maven[edit]

Download and install the v2.0.4 of the Maven 2 software (from http://maven.apache.org/), making sure to set the MAVEN_HOME environment variable correctly. Maven 2 also has a nice feature which allows you to import all the necessary jars/libraries into eclipse (if you choose this as your editor) so it takes the hassle out of setting up classpaths manually.


Compiling code[edit]

Execute the following commands from the specified directories:

  • mks\mks\modules>mvn install
  • mks\mks\echase>mvn package


During development its best to do a cleanup of the target directories before building and creating new web archives. To do this, the following commands must be done from the specified directories:

  • mks\mks\modules>mvn clean:clean
  • mks\mks\echase>mvn clean:clean

Deployment to Apache Tomcat[edit]

install tomcat 5.5+ (zip version preferably)

copy the following files from mks/echase/target to %CATALINA_HOME%/webapps then start the tomcat server to unpack the WARs:

  • echasesrw.war
  • echaselightboxsrw.war
  • echaselightbox.war
  • echase.war

Having copied all the above, restart Tomcat and access the eCHASE web application by pointing your browser to http://localhost:8080/echase

By default eCHASE will now use the CRM Core database. This (for the time being is being hosted on an internal server machine which is not accessible outside ITI), therefore content will fail to load for external developers. Once the media has been moved to the external server (Piltdownman), you will need to register your IP address of the machine youre accessing it from. This IP registration security layer will be removed when we want it to be 'publically' accessible.