Wiki

Clone wiki

ieeg / DevelopmentSetup

Introduction

This page outlines the required steps to setup a local development environment for the IEEG-Portal project. This includes checking out the code from the repository, importing the database in mysql, and configuring eclipse.

Details

Clone the project from Bitbucket.

The code for this project is stored in an Git repository.

Creating a local version of the MySQL database

Creating a local storage of the raw MEF files

The easiest way to have data available on the local version of the portal is to copy 1, or more data set to your local drive (or external hard-drive). You'll need to put the files using the same folder structure as is used on the portal.

  1. Create a folder called: "Mayo_IEED_data"
  2. In this folder, you'll put the folders for each datasets. Currently, I (Joost) have on dataset on my local portal version ("Mayo_IEED_005"). In this folder, you'll have the data associated with this dataset (i.e. IC folder with MEF files)

Importing the maven project into Eclipse

The IEEG-Portal is a maven-project using the GWT Toolbox. Therefore, we need to configure eclipse to be able to use these packages.

  1. Get the Eclipse IDE for Java EE Developers, package from http://www.eclipse.org/downloads/
  2. Once you have Eclipse installed, use the Eclipse marketplace (Under "Help" menu) to get the following plugins:
    • Google Plugin for Eclipse and Google Web Toolkit parts of the Google Plugin for Eclipse. There are a number of other subplugins in there that you don't need, and have gotten in the way in the past. If you do not see a version of the plugin for your version of Eclipse listed in the marketplace try https://developers.google.com/eclipse/docs/download.
    • EGit. You'll need the Maven SCM Handler for Eclipse too.
  3. Fire up Eclipse. From the File menu select Import, then in the popup choose "Check out Maven Projects from SCM" from under Maven.
  4. Choose git as the SCM URL type and paste in the URL found in the clone popup for the repository.
  5. Hit Finish . This should import the entire Maven project into Eclipse. It is composed of several modules each of which becomes its own project in Eclipse. Some of us like to choose the Name Template IEEG-[artifactId] under Advanced to keep them all next to each other in Eclipse, but this is not required.
  6. Copy the contents of the [ieegview/src/main/config] folder of the checked out project to a separate folder outside of the project (i.e. to MyDocument/ieeg-conf). You'll need to change these files to configure your local machine and you do not want to upload/change the files for anybody else.
  7. Change the contents of the ieegview.properties file according to your local settings. In particular the sourcepath needs to point to the directory where you placed your data. This would be the directory containing Mayo_IEED_data in the example above.
  8. Check the contents of the hibernate.properties file and make sure that it points to your local IEEG-Portal MySQL database and that the username and password are correct. In other words change hibernate.connection.url, hibernate.connection.username, and hibernate.connection.password to suit your needs.
  9. Check the contents of the drupal-hibernate.properties file and make sure it points at your local Drupal database and that the username and password are correct. In other words change hibernate.connection.url, hibernate.connection.username, and hibernate.connection.password to suit your needs.
  10. Decide between Super Dev Mode or Classic (deprecated)

Run in Super Dev Mode

  1. These instructions were written using the Luna version of the Java EE Eclipse, Google Plugin for Eclipse 4.4 (3.8.0.v201410302155), and GWT 2.7.0.
  2. If you have Super Dev Mode Launch Configurations from earlier versions of GWT you should delete them since they will contain older gwt-dev jar references.
  3. Run Maven install on the project. Right-click the parent module, called ieeg and select Run As -> Maven Install. This will generate a directory we will use in a following step.
  4. Right click the ieegview submodule and select Run As -> Web Application (GWT Super Dev Mode).
  5. A file chooser will popup asking you to select a WAR directory. This is why we ran Maven install. Select the ieegview-<version> directory under ieegview/target in your workspace.
  6. In the Run Configurations menu, add the location of the "ieeg-conf" folder as a user-entry to the class path. It's important to make it the FIRST entry so it takes precedence.
  7. Also, in the Arguments tab of your Run Configuration change the VM argument -Xmx512m to something higher, otherwise you will run out of heap space when the javascript is compiling. Using -Xmx768m worked for me.
  8. Go to http://127.0.0.1:8888/main.html. You will see a message letting you know mefview is compiling. Once that is finished the portal should load.
  9. If you make any changes to client-side Java you can reload the page and the javascript will be recompiled.
  10. At this point you can use Eclipse to debug server-side code and your browser's development tools to debug client-side code. We will install an Eclipse plugin that allows client-side debugging in Eclipse.
  11. Install the SDBG plugin using their update site.
  12. Start Super Dev Mode and copy the URL http://127.0.0.1:8888/main.html. This needs to be running to supply the server-side and code server.
  13. Choose Debug Configurations... under the debug menu.
  14. In the Debug Configurations dialog choose the Launch Chrome selection on the left and click the new launch configuration icon.
  15. Paste the URL into the URL box and Browse to the ieegview project in the Project box. Change the Name to something other than New_configuration.
  16. Click Apply and then Debug.
  17. A new Chrome instance will open and launch the portal, perhaps first compiling mefview if necessary. This is the instance that is connected to the debug session in Eclipse and will trigger any client-side breakpoints you have added in Eclipse. Opening the Chrome developer tools in this instance will terminate the connection to Eclipse but not the Launch. If you do this you'll have to re-Launch Chrome.
  18. Visit the SDBG site for a screencast version of these instructions and a list of the debugging limitations.

Run in Classic Dev Mode

  1. Now, in Eclipse, go to the Run-Run Configurations menu. Create a new Web Application run configuration. For now this defaults to Classic Dev Mode but you can check the GWT tab to make sure. Make sure that the main project is "ieegview" and the Main class is "com.google.gwt.dev.DevMode"
  2. In the Run Configurations menu, add the location of the "ieeg-conf" folder as a user-entry to the class path. It's important to make it the FIRST entry so it takes precedence.
  3. In the Run Configurations menu, add the argument -XX:MaxPermSize=128M to the VM arguments of the arguments tab. If you don't do this, you may get a confusing error message about being out of memory telling you to do -Xmx
  4. The portal requests a username and password combination. Use a username password combination contained in your local drupal database.

Updated