Novell Home

Link your IDE, VCS and Servlet Container and Develop Plugin with Minimal Tomcat Restarts

Novell Cool Solutions: Feature
By R Sathish

Digg This - Slashdot This

Posted: 17 Aug 2004
 

Please read my article on iManager development tips prior to using this procedure.
Please refer to Launching iManager with Eclipse to launch iManager in debug mode.

The strategies described in this article are applicable to any IDE, VCS and Servlet Container. I have illustrated them with Eclipse IDE, Continuus VCS and Tomcat servlet containers. These strategies reduce the time required to change the plugin, minimizing the number of Tomcat restarts required, and the number of CPU-intensive tasks.

Step 1 -- Make your work area modifiable

In Continuus:

  1. Right-click the work area.
  2. Select Work area properties.
  3. Select Maintain a work area.
  4. Select Make copies modifiable.
  5. Save the settings.

Click for larger view.
Step 2 -- Create a modular directory structure

Recommended work area structure
RED directories are created by any build task.
BLACK directories are part of work area.

Step 3 - Make the source path of your IDE project point to VCS work area

In Eclipse:

  1. Window - > Open perspective -> Java
  2. Right-click project in package explorer.
  3. Select Properties.
  4. In the pop-up window, select Java Build path -> Source.
  5. Click Add folder.
  6. Create new folder.
  7. Choose advanced-> Link to folder in file system.
  8. Enter a name.
  9. Select the Continuus work area \ plugin\src
  10. Save.

Click for larger view.

In the same steps
Include in the source path *.properties, if they are in different directory.

Step 4 - Make the output path of IDE project to Tomcat's classes

Output path = TOMCAT_HOME\webapps\nps\WEB_INF\classes

In Eclipse:

  1. Window - > Open perspective -> Java
  2. Right-click project in package explorer.
  3. Select Properties.
  4. In the pop-up window select Java Build path -> Source.
  5. Default output folder -> Browse
  6. Click Add folder.
  7. Create new folder.
  8. Choose advanced-> Link to folder in file system.
  9. Enter a name.
  10. Select path to TOMCAT_HOME\webapps\nps\WEB_INF\classes
  11. Save

Click for larger view.
Step 5 -- Make a batch file

Make a batch file in %WINDIR% (or a directory in your PATH) which

  1. Deletes plugin.jar
  2. Copies *.js from Tomcat to Work area
  3. Copies *.jsp from Tomcat to Work area

Run the batch file to delete plugin.jar

I:\Windows\EA.bat listing

Step 6 -- Modify Java source file in IDE, compile and reload NPS.

In Eclipse:

  1. Select Project -> Build automatically
  2. Modify the source code (Java or properties
  3. )
  4. Reload NPS
  5. Login to iManager

Click for larger view.
Step 7 -- Include plugin directory to IDE

PLUGIN_HOME = TOMCAT_HOME\webapps\nps\portal\modules\plugin

In Eclipse:

  • Window - > Open perspective -> Java
  • Right-click project in package explorer.
  • Select Properties.
  • In the pop-up window select Java Build path -> Source
  • Default output folder -> Browse
  • Click Add folder.
  • Create new folder.
  • Choose advanced-> Link to folder in file system.
  • Enter a name.
  • Select path to PLUGIN_HOME
  • Save.


  • Step 8 -- Modify JSP and JS in IDE.

    In Eclipse:

    1. Select Java perspective.
    2. Choose the PLUGIN_HOME.
    3. Navigate to Jsp / Js file.
    4. Modify the files.
    5. Reaccess the Jsp page.
    6. See your changes instantly.

    Please note:
    Tomcat class reloader does not work in sync with Jasper. Therefore, when you change method signatures in java and access that method in jsp, you need to restart Tomcat.

    Step 9 - Update work area
    1. Open a command shell
    2. Execute plugin.bat

    This will copy all Jsp and Js from Tomcat to Work area.

    Step 10-Reconcile the Continuus project


    Click for larger view.
    1. Choose Select task.
    2. Create a task.
    3. Reconcile.
    4. Choose advanced conflict resolution.
    5. Compare to ensure new changes.
    6. Select all conflicts.
    7. Choose Update database from work area.
    8. Check in the task.


    Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

    Novell® Making IT Work As One

    © 2008 Novell, Inc. All Rights Reserved.