Difference between revisions of "WebProtegeDeveloperHowTo"

From Protege Wiki

Jump to: navigation, search
(incremental save of new work)
(incremental save of new work)
Line 20: Line 20:
 
#* Select an empty directory for the "existing source".
 
#* Select an empty directory for the "existing source".
 
#* The New Project dialog should now look something like the following:<br /><br />[[Image:WebProtege-new-java-project.jpg|none]]<br />
 
#* The New Project dialog should now look something like the following:<br /><br />[[Image:WebProtege-new-java-project.jpg|none]]<br />
# Click the Finish button.<br /><br />
+
# Click the Finish button. At this point, Eclipse will check out the source code and create a new Java project for WebProtege.  Once the checkout is complete, you will notice that there are many compilation errors.  We will fix these later.
 
+
# In the Java perspective, go to the Package Explorer and right-click on the newly created projectSelect Delete in the context menu and in the resulting Confirm Project Delete dialog, choose the "Do not delete contents" option, and click the Yes button.
At this point, Eclipse will check out the source code and create a new Java project for WebProtege.  Once the checkout is complete, you will notice that there are many compilation errors.  We will fix these later.  For now, '''close the Eclipse development environment''' and proceed with the next steps.
+
# '''Close the Eclipse development environment''' and proceed with the next steps.
  
 
=== Rename the src directory ===
 
=== Rename the src directory ===
Line 31: Line 31:
 
=== Run the GWT projectCreator script ===
 
=== Run the GWT projectCreator script ===
  
# Open a Command Prompt (or equivalent on other platforms) and change to the root directory of the Eclipse project you just created.
+
# Open a Command Prompt (or equivalent on other platforms) and change to the root directory of the "web-protege" Eclipse project.
 
# Run the GWT projectCreator script using the syntax <code>projectCreator -eclipse <your-project-name> -overwrite</code>.  More documentation about the [http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.html#projectCreator projectCreator tool] can be found on the GWT Web site.  You should see something like the following after running the script:<br /><br />[[Image:WebProtege-project-creator.jpg|none]]<br />
 
# Run the GWT projectCreator script using the syntax <code>projectCreator -eclipse <your-project-name> -overwrite</code>.  More documentation about the [http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.html#projectCreator projectCreator tool] can be found on the GWT Web site.  You should see something like the following after running the script:<br /><br />[[Image:WebProtege-project-creator.jpg|none]]<br />
  
Line 37: Line 37:
  
 
# In the same directory in the Command Prompt, run the GWT applicationCreator script using the syntax <code>applicationCreator -eclipse <your-project-name> edu.stanford.bmir.protege.web.client.WebProtege</code>. More documentation about the [http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.html#applicationCreator applicationCreator tool] can be found on the GWT Web site.  You should see something like the following after running the script:<br /><br />[[Image:WebProtege-app-creator.jpg|none]]<br />
 
# In the same directory in the Command Prompt, run the GWT applicationCreator script using the syntax <code>applicationCreator -eclipse <your-project-name> edu.stanford.bmir.protege.web.client.WebProtege</code>. More documentation about the [http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.html#applicationCreator applicationCreator tool] can be found on the GWT Web site.  You should see something like the following after running the script:<br /><br />[[Image:WebProtege-app-creator.jpg|none]]<br />
 +
# If you successfully executed both the projectCreator and applicationCreator scripts, your file structure should now look something like the following:<br /><br />[[Image:WebProtege-after-app-creator.jpg|none]]<br />
  
 
=== Restore the original src directory ===
 
=== Restore the original src directory ===

Revision as of 15:50, April 16, 2008

Jennifer & Tania's selp-help page for developing WebProtege :)

Contents


Checkout, compile, and run WebProtege using Eclipse

Note that WebProtege uses the Google Web Toolkit (http://code.google.com/webtoolkit/) and these instructions assume that you have already installed GWT.

Checkout the source code

  1. Open Eclipse and go to the SVN Respository Exploring perspective.
  2. Navigate to the top-level "web-protege-eclipse" directory in the Protege Subversion repository (URL for Protege's SVN is: http://smi-protege.stanford.edu/repos/protege).
  3. Right-click on web-protege-eclipse and choose Checkout...
  4. Choose the following options in the Checkout from SVN dialog:

    WebProtege-checkout-from-svn.jpg

  5. Click the Finish button.
  6. In the New Project dialog, select Java Project, and click Next.
  7. In the resulting New Java Project dialog:
    • Give the project a name (like "web-protege" for example).
    • In the Contents pane, select "Create project from existing source" (there is no existing source at the moment - this is just part of the process to make GWT and Eclipse work together for WebProtege).
    • Select an empty directory for the "existing source".
    • The New Project dialog should now look something like the following:

      WebProtege-new-java-project.jpg

  8. Click the Finish button. At this point, Eclipse will check out the source code and create a new Java project for WebProtege. Once the checkout is complete, you will notice that there are many compilation errors. We will fix these later.
  9. In the Java perspective, go to the Package Explorer and right-click on the newly created project. Select Delete in the context menu and in the resulting Confirm Project Delete dialog, choose the "Do not delete contents" option, and click the Yes button.
  10. Close the Eclipse development environment and proceed with the next steps.

Rename the src directory

  1. Open Windows Explorer (or equivalent on other platforms) and navigate to the directory where Eclipse created the "web-protege" project.
  2. Rename the "src" directory to something else, like "src1" for example. This is a temporary measure that will prevent the source code from getting overwritten when we generate the necessary GWT project and application files. Your file structure should now look something like the following:

    WebProtege-rename-src-dir.jpg

Run the GWT projectCreator script

  1. Open a Command Prompt (or equivalent on other platforms) and change to the root directory of the "web-protege" Eclipse project.
  2. Run the GWT projectCreator script using the syntax projectCreator -eclipse <your-project-name> -overwrite. More documentation about the projectCreator tool can be found on the GWT Web site. You should see something like the following after running the script:

    WebProtege-project-creator.jpg

Run the GWT applicationCreator script

  1. In the same directory in the Command Prompt, run the GWT applicationCreator script using the syntax applicationCreator -eclipse <your-project-name> edu.stanford.bmir.protege.web.client.WebProtege. More documentation about the applicationCreator tool can be found on the GWT Web site. You should see something like the following after running the script:

    WebProtege-app-creator.jpg

  2. If you successfully executed both the projectCreator and applicationCreator scripts, your file structure should now look something like the following:

    WebProtege-after-app-creator.jpg

Restore the original src directory

  1. In Windows Explorer (or equivalent on other platforms), navigate to your project directory and delete the "src" directory that was generated by GWT's applicationCreator script.
  2. Rename "src1" back to "src".

Import your project into Eclipse

  1. Reopen the Eclipse development environment.
  2. Select File | Import...
  3. In the Import dialog, choose General -> Existing Projects into Workspace and click Next.
Personal tools