Setting up the Development Environment
Developers can create their own development environment by downloading the source code to build and set up a project.
Contents
System requirements
Before programming, make sure that the following software has been installed. For system requirements in general, see System requirements.
Getting the source code
- Download the source code for the GlobalSight system from GlobalSight.com. For more details on downloading the software, see Installing GlobalSight.
- Unzip or un-package the code into a new directory, for example GlobalSight7.1.
In this root directory, main6/envoy means GlobalSight7.1/main6/envoy and so on for other default paths.
When you have downloaded the code successfully, the package structure is as follows:
Building a project
Before setting up a project or development, you need to build a project once since the javacc command generates other special source code needed.
- Open a command window
- Forward to the HOME/main6/tools/build/ folder
- Execute the following ant script:
The dist target compiles the whole project. It also deploys it as a zip file in the dist sub-folder in the build folder. For more details on building, see Building and Deploying GlobalSight.
Setting up a project
To set up a project, you need to know:
- Source folders:
- main6/diplomat/dev/src/java/*
- main6/envoy/src/java/*
- main6/ling/ You only need the com/* sub-folder
- Source code encoding: ISO-8859-1. This is needed when compiling codes
- Library files: in .classpath file, all required jars have been added. They include:
- files in main6/tools/lib/common directory
- required jar files from WildFly in main6/tools/j2eeVendor/jboss/wildfly-10.0.0.Final/server/modules/system/layers/base folder
Eclipse is used as an example to demonstrate how to set up a project in it. Download version 3.2.x or later of Eclipse from Eclipse.org.
Creating a project
- Open the Eclipse environment
- Select File->New->Java Project
Importing the source code
- Enter a project name, such as GlobalSight
- Select Create project from existing source in Contents under the project name
- Click Browse
- Forward to the root folder of the source code, HOME
- Click Next to import the source code into Eclipse
Do NOT click Finish. Some default settings need to be modified later.
Removing all default source folders
The default settings of the GlobalSight appear in Eclipse, as shown below. This can take a few seconds or even minutes.
- Select all of the default source folders. This is basically everything except the last folder, main6
- Click the Remove from Java build path link to remove them from the source folder list
When all folders have been removed successfully, only the main6 folder remains.
Adding real source folders
Add the real source folders needed in the system:
- main6/diplomat/dev/src/java
- main6/envoy/src/java
- main6/ling
Using the first folder as an example:
- Select the main6/diplomat/dev/src/java folder
- Click Add folder 'java' to build path link to add it as source folder
When you have added all source folders successfully, you see the following:
Improving the project environment
You have now almost built a new project using the system source code. Add the following more detailed settings to improve the project environment.
Filtering files from the source folder
Filtering unnecessary files from the source folder reduces the load on the system memory and speeds up the Eclipse environment.
Using the main6/ling folder as an example:
- Select the source folder
- Click the Configure inclusion and exclusion filters link
The configuration window for Inclusion and Exclusion shows.
- Click Add Multiple ... in the Exclusion pattern frame
- Select the sub-folders and files except the com folder
- Click OK in Selection
- Click Finish in Inclusion and Exclusion Patterns
After this, you can see there are more description sentence after source folder “main6/ling”, such as “6 items excluded”.
Other files that you can also exclude from the source folder:
- main6/envoy/src/java/com/globalsight/resources/**
- main6/ling/com/globalsight/resources/
Modifying the default output folder
To make it easier to find or use the classes files, you can change the default output folder that shows at the bottom of the project window to something more familiar. For example, you can change from GlobalSight/main6/tools/build/cxeclasses to GlobalSight/main6/bin, or whatever you want.
Encoding
You can now click Finish to complete the creation process.
If you have changed the output folder directory, a window may pop up asking you to copy files from the original directory to the new one. Click Yes, and a new project is created successfully.
Eclipse also performs some tasks after creation.
For any future errors when compiling, edit the file encoding of the project as follows:
- Right-click the project name
- Select Properties from bottom of the pop-up menu
- Click Resource in the menu on the left. This is often default
- Change the Text file encoding to ISO-8859-1
Notes to deploy changes to server
When developer does any changes in IDE such as Eclipse, changed files need to be synchronized to server for testing or debugging.
For java files, you need copy the compiled class files into "globalsight.jar" in "jboss\server\standalone\deployments\globalsight.ear\lib" folder. Restart is required.
For other files such as jsp, js, css etc, it is enough to just copy them to server to replace the old ones.