Transition
From ZenWiki
Contents |
Subversion Repository
- Create a new user 'svn' on pcfg.sei.cmu.edu with the home directory at /home/svn. The following steps should be done as the 'svn' user.
- Create the repository: svnadmin create --fs-type fsfs /home/svn/zen-tool-svn [1]
- Load the repository: svnadmin load /home/svn/zen-tool-svn < team-zen-svn.dump [2]
- Edit the svnserve.conf and passwd files in /home/svn/zen-tool-svn/conf [3]
- Start up svnserve: svnserve -d -r /home/svn/zen-tool-svn [4]
- Open firewall for port 3690
Development with Eclipse
- Install JDK 5.0. Although newer version of JDK may work, the third-party JCE provider in the repository depends on JDK 5.0. It is possible to upgrade JDK to newer version if the third-party JCE provider is also updated.
- Set up Eclipse by following these steps.
- Customize JRE with the third-party JCE provider by following these teps.
- Checkout from the repository all the projects in the following directories:
- /common/trunk/
- /client/trunk/
- /server/trunk/
- To launch the ZEN Client from Eclipse
- Initialize the database
- Edit "database.properties" in the "properties" folder in the "zen.client.standalone.common" project.
- Run "InstallationController" in "zen.client.standalone.installation" project as a java application, and following the instructions.
- Edit "preference.ini" in "zen.client.core" project with the your database settings and save the changes
- Go to "zen.client.application"
- Open "client.product"
- In "Testing" section, click "Synchronize" and "Launch an Eclipse application".
- Initialize the database
Nightly Build
Environment Setup
The base directory $BASE_DIR is assumed to be /root/zen-tool.
Directory Structure
An overview of the build environment's directory structure.
- $BASE_DIR/win32-jre: The WIN32 JRE for binary release.
- $BASE_DIR/web-root: The final location of nightly build results
- $BASE_DIR/eclipse: Installation of Eclipse, Eclipse test framework and RCP delta pack
- $BASE_DIR/emma-2.0.5312: Java code coverage tool
- $BASE_DIR/pmd-3.9: Static Java code analysis tool
- $BASE_DIR/birt-runtime-2_2_x: BIRT Runtime
- $BASE_DIR/zen-client-build: The directory where the release build is produced.
- features/: All feature projects should be placed here.
- plugins/: All plugin projects should be placed here.
- zen.client.builder/: The build configuration files.
- $BASE_DIR/zen-client-test-build: The directory where the test build is produced.
- features/: All feature projects should be placed here.
- plugins/: All plugin projects should be placed here.
- zen.client.test.builder/: The build configuration files.
- $BASE_DIR/zen-server-build: The directory where the server build is produced.
A list of feature projects:
- zen.client.admin.feature
- zen.client.admin.test.feature
- zen.client.authentication.feature
- zen.client.authentication.test.feature
- zen.client.core.feature
- zen.client.core.test.feature
- zen.client.interivew.test.feature
- zen.client.interview.feature
- zen.client.report.feature
- zen.client.report.test.feature
Eclipse
The setup of Eclipse for nightly build is similar to that for desktop development, but with additional plug-ins as follows:
- Eclipse Test Framework
- RCP Delta Pack
Download the right version for your Eclipse Platform from here.
PMD
PMD is a static code analysis tool, which is incorporated in nightly build. Download and unzip the file to /home/nightly
EMMA
EMMA is a code coverage tool. Download and unzip the file to /home/nightly
BIRT Runtime
BIRT Runtime is used for integration with web application.
Download and unzip the following files to /home/nightly The latest release can be accessed here.
ANT
Download and install Apache ANT.
Configuration Changes
The following files need to be changed to match your environment.
build.properties
There are two build.properties files: one in zen.client.test.builder project; the other in zen.client.builder project.
- Change the following properties in zen.client.test.builder:
- configs=linux, gtk, x86
- buildDirectory=/root/zen-tool/zen-client-test-build
- base=/root/zen-tool
- baseos=linux
- basews=gtk
...
...
# The list of {os, ws, arch} configurations to build. This
# value is a '&' separated list of ',' separate triples. For example,
# configs=win32,win32,x86 & linux,motif,x86
# By default the value is *,*,*
configs=linux, gtk, x86
...
...
# The directory into which the build elements are fetched and where
# the build takes place.
buildDirectory=/root/zen-tool/zen-client-test-build
...
...
# Settings for the base Eclipse components and Java class libraries
# against which you are building.
# Base location for anything the build needs to compile against. For example,^M# in most RCP app or a plug-in, the baseLocation should be the location of a previously
# installed Eclipse against which the application or plug-in code will be compiled and the RCP delta pack.
base=/root/zen-tool
baseLocation=${base}/eclipse
#Os/Ws/Arch/nl of the eclipse specified by baseLocation
baseos=linux
basews=gtk
basearch=x86
...
...
- Change the following properties in zen.client.builder:
- buildDirectory=/root/zen-tool/zen-client-build
- base=/root/zen-tool
- baseos=linux
- basews=gtk
...
...
# The directory into which the build elements are fetched and where
# the build takes place.
buildDirectory=/root/zen-tool/zen-client-build
...
...
# Settings for the base Eclipse components and Java class libraries
# against which you are building.
# Base location for anything the build needs to compile against. For example,^M# in most RCP app or a plug-in, the baseLocation should be the location of a previously
# installed Eclipse against which the application or plug-in code will be compiled and the RCP delta pack.
base=/root/zen-tool
baseLocation=${base}/eclipse
#Os/Ws/Arch/nl of the eclipse specified by baseLocation
baseos=linux
basews=gtk
basearch=x86
...
...
As you may have noticed, the only different between these two files is that the target platform (the configs property) for testing must be the same as the platform running the build (the baseos, basews and basearch properties).
build.sh
Both zen.client.test.builder and zen.client.builder have a build.sh file. Change the paths to match your environment.
- In zen.client.test.builder
java -jar /root/zen-tool/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar -application org.eclipse.ant.core.antRunner -buildfile /root/zen-tool/eclipse/plugins/org.eclipse.pde.build_3.3.2.R331_v20071019/scripts/productBuild/productBuild.xml -Dbuilder=/root/zen-tool/zen-client-test-build/zen.client.test.builder -Dpmd.dir=/root/zen-tool/pmd-3.9/lib -Demma.dir=/root/zen-tool/emma-2.0.5312/lib
- In zen.client.builder
java -jar /root/zen-tool/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20070828.jar -application org.eclipse.ant.core.antRunner -buildfile /root/zen-tool/eclipse/plugins/org.eclipse.pde.build_3.3.2.R331_v20071019/scripts/productBuild/productBuild.xml -Dbuilder=/root/zen-tool/zen-client-build/zen.client.builder -Dpmd.dir=/root/zen-tool/pmd-3.9/lib
For the server, the build.sh can be found in zen.server.builder. Edit the paths to match your environment. JAVA_HOME is needed for running ANT successfully.
export JAVA_HOME=/usr/java/jdk1.5.0_13 ant -Declipse.home=/root/zen-tool/eclipse -Dbirt.runtime=/root/zen-tool/birt-runtime-2_2_1_1
Manaul Build
Go to /root/zen-tool/zen-client-test-build/zen.client.test.builder and /root/zen-tool/zen-client-build/zen.client.builder respectively and run build.sh. Check the following outputs:
- The test binary, TestBuild-linux.gtk.x86.zip, is in /root/zen-tool/zen-client-test-build/I.TestBuild.
- PMD results are in /root/zen-tool/zen-client-test-build/pmd-results.
- Unit test results are in /root/zen-tool/zen-client-test-build/tests/test-results.
- Code coverage results are in /root/zen-tool/zen-client-test-build/tests/coverage.
- The release binary. ReleaseBuild-win32.win32.x86.zip, is in /root/zen-tool/zen-client-build/S.ReleaseBuild.
Automatic Build
The nightly build is automated using a master build script, which is located in the build folder in SVN root.
- Check out the build folder from SVN to /root/zen-tool/build.
- Change directory to /root/zen-tool/build.
- Edit BASE_DIR in build_all.sh to match your environment.
- Edit user name and password for accessing SVN in build_all.sh.
- Execute build_all.sh.
- Check all the outputs in /root/zen-tool/web-root/build/.
ZenWiki
- Install the latest version of MediaWiki (mediawiki-1.11.0.tar.gz) by following the instruction here.
- Your PHP installation must include DOM support to enable the ImageMap extension.
- Import mysql dump wikidb.dump.zip.
- See mysqlimport.
- Replace wiki directory with given wiki.zip.
Special Note
Three columns in zen_image table must be corrected for PNG files.
Significant Piece of Code
Marc
The most complex piece of code I wrote is probably for the smig input/output. The related classes are:
- zen.server/src/edu/cmu/sei/smart/zen/server/smigimportexport/SMIGImport.java
- zen.server/src/edu/cmu/sei/smart/zen/server/smigimportexport/SMIGExport.java
Session
The most interesting/challenging piece for me was the SMIG tree viewer that combined JSP, Java, Struts 2, Dojo, and JSON. The related classes are:
- zen.server/src/edu/cmu/sei/smart/zen/server/smigmaintenance/SMIGNavigation.java
- zen.server/src/edu/cmu/sei/smart/zen/server/smigmaintenance/ProcessNavigationButtons.java
- zen.server/src/edu/cmu/sei/smart/zen/server/smigmaintenance/CategoryEditor.java
- zen.server/src/edu/cmu/sei/smart/zen/server/smigmaintenance/QuestionEditor.java
- zen.server/src/edu/cmu/sei/smart/zen/server/smigmaintenance/AnswerEditor.java
- zen.server/src/edu/cmu/sei/smart/zen/server/smigmaintenance/RiskEditor.java
- zen.server/src/edu/cmu/sei/smart/zen/server/smigmaintenance/MitigationEditor.java
Sajjad
The complicated piece of code is the zen data model (the model code itself might be simple, but it was hard & complex to refine it to the level where it is now). Additional pieces of complicated code are those relating to SMIG maintenance & general consolidation handling:
- zen.common.core/src/edu/cmu/sei/smart/zen/common/core/model/*
- zen.common.core/src/edu/cmu/sei/smart/zen/common/core/dao/internal/SqlMapSmigMaintenanceDAO.java
- zen.common.core/src/edu/cmu/sei/smart/zen/common/core/dao/internal/SqlMapEngagementDAO.java
- zen.common.core/src/edu/cmu/sei/smart/zen/common/core/dao/internal/SqlMapServerDAO.java
Somakala
The complicated piece of code is for reading from and writing to XML. The related classes are:
- zen.common.communication/src/edu/cmu/sei/smart/zen/common/communication/ZenXmlStructure.java
- zen.common.communication/src/edu/cmu/sei/smart/zen/common/communication/XmlParser.java
- zen.common.communication/src/edu/cmu/sei/smart/zen/common/communication/XmlBuilder.java
Allen
The most intricate piece of code I wrote is probably the one that deals with status update in the SmigView. The related classes are:
- zen.client.interview.ui/src/edu/cmu/sei/smart/zen/client/interview/ui/editors/AnswerEditor.java
- zen.client.interview.ui/src/edu/cmu/sei/smart/zen/client/interview/ui/views/SmigView.java
- zen.client.interview.ui/src/edu/cmu/sei/smart/zen/client/interview/ui/actions/AnswerAction.java
Action items
Move com.vladium.emma to common/trunkAll the user and password that are required to run and why: See Development with Eclipse section, Zen Client Installation & Configuration and Zen Server Installation & ConfigurationUpdate the module dependenciesMost complex piece of code each one has writtenNightly buildUpgrade MediaWiki to the latest version
Known Issues
- Next Question: Deleting a question that is referenced by another question or an answer as the "next question"
- SMIG Tree expansion: Reloading the SMIG tree at the same level of expansion as it was left at
