Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Install Google Web Toolkit, Google App Engine SDK, and Google plug-in for Eclipse using Eclipse new software from Google's update site - http://dl.google.com/eclipse/plugin/3.6.  Note if you were using an older version of this plugin you will need to uninstall it and then re-install it to ensure it has GWT 2.4.0 support.
  2. Install the Maven2Eclipse plugin
  3. Install the EGit eclipse plugin
  4. The best way to get Eclipse to recognize your project as a Git project is to import it as one. This includes the remote clone from GitHub.
    1. File -> Import -> Git -> Projects from Git
      1. NOTE: If you have cloned the code already, go to the "Git Repository" Perspective, add your repository, then right click for "Import Project" and go to step "g" below 
    2. Next, Select URI: (COPY YOUR "HTTP" URL FROM THE GITHUB PAGE: https://github.com/Sage-Bionetworks/SynapseWebClient)
      1. e.x. READ-ONLY: https://git@github.com/Sage-Bionetworks/SynapseWebClient.git
    3. Connection : Protocol : select "https"
    4. Authentication : Password : enter your GitHub password
    5. Next, select all branches (default)
    6. Next, select where you want to store the files
    7. Next, choose "Import as general project"
    8. Next, Finish
  5. Next you need to enable Maven Dependency Management in eclipse. This is already enabled if you created the project by importing with the Maven plugin. If not, Right-Click on the project in package explorer and select: Maven->Enable Dependency Management.  This will generate a maven .classpath file. 
    1. Alternatively, go to the command line and run "mvn eclipse:eclipse" and refresh the project.
  6. Next we need to tell the GWT Eclipse-plugin that this is a GWT project. Do this by Right-Clicking on the project in the package explorer and select: Google->Web Toolkit Settings...
    1. From the resulting dialog make sure the "Use Google Web Tookit" check box is selected.
    2. Also make sure you are using GWT 2.4.0.
  7. Next we need to tell the Google plugin where our web app directory can be found.  Right-click on the project in the package explorer and select Properties.
    1.  From the tree on the left of the dialog navigate to Google->Web Application
    2. Check the the check box: "This project has a WAR directory"
    3. With the "Browse" button, select "src/main/webapp"
    4. UN-CHECK the "Launch and deploy from this directory"  This is very important, if you keep this checked then Maven will not be able to generate a clean WAR file.  If you see "GWT needs to recompile" when you deploy your WAR then you probably have this box checked.
  8.  Next you need to make sure the GWT xml files are on the classpath. All of these resources can be found in src/main/resources directory.  You will probably need to remove the "Exclude **" filter on that folder in your build configuration dialog (Right-click->Build Path>Configure Build Path... and remove the exclude from the source tab on the resources directory.
  9. Now that the Portal.gwt.xml file is on the classpath, make sure GWT knows it is the entry point.
    1. Right-Click on the project from the package explorer.
    2. Select Google->Web Toolkit Settings...
    3. Under the "entry point modules" you should see "Portal - org.sagebionetworks.web",  if not, then add it with the add button.
  10. Now make sure GWT can compile your code
    1. Right-Click on the project in the package explorer
    2. Google->GWT Compile
    3. The first time you run this you will be asked to select the output directory where GWT will compile the code. You want this to match the Maven WAR output directory, so use "target/portal-<VERSION>-SNAPSHOT"
  11. Our web.xml is setup to redirect all traffic to HTTPS for security reasons. While GWT + Eclipse's development plugin is supposed to support this by ignoring the security-constraint, in my experience it does not ignore the constraint and instead gives a 403 error when you try running in development mode from Eclipse. For development only purposes, you should comment out the secutiy-constraint in the web.xml. Do not check this change in. 
    1. Code Block
      languagexml
      <!-- Comment the below security constraint out if you are working in GWT development mode -->
      <!-- 	<security-constraint>
      		<web-resource-collection>
      			<web-resource-name>Protected Context</web-resource-name>
      			<url-pattern>/*</url-pattern>
      		</web-resource-collection>
      		<user-data-constraint>
      			<transport-guarantee>CONFIDENTIAL</transport-guarantee>
      		</user-data-constraint>
      	</security-constraint>
       -->
  12. You are finally ready to run the application in development mode.
    1. Right-Click on the project in the package explorer
    2. Select: Run As->Web Application
    3. Double-click on the link provided in the Development Mode window to view the portal in your browser.  If you get asked what page to start on choose Portal.html

...