Application Extension Environment: Basic Usage
Add-In Manager Application Extension Environment
Application Extension Environment: Basic Usage
Running Web Central
To start Web Central from Eclipse:
- Right-click on the /webcentral-war-root/webcentral.launch file.
- Select the Run As / webcentral menu item.
- Eclipse will start the embedded Tomcat server with the Web Central web application.
If you intend to debug any Java code that is invoked from the web application, that is, not invoked from a unit test, add breakpoints in Java code and then use the Debug As / webcentral menu item.
To see all SQL statements issued by application code in the Eclipse console, or in
archibus.log
, set the
app.debug
property to True in the
WEB-INF\config\core.properties
file.
Editing and Debugging Java Code
As in previous versions, Eclipse automatically compiles Java code when you save the .java file from Eclipse code editor. We recommend testing Java code using unit tests. To run a unit test:
- Select the unit test class in the Package Explorer window, or in the editor.
- Right-click to invoke the context menu.
- Select the Run As / <unit-test-name> menu item.
If you need to debug Java code under test, add breakpoints in Java code and then use the Debug As / <unit-test-name> menu item.
Editing and Debugging View Code
The schema and WEB-INF folders are located in the webcentral-war project:
To edit .axvw or .js files, you can use Eclipse or any external editor. Save the file and reload the view in the browser to test the change. You may need to clear your browser's Java Script cache to observe changes in Java Script code.
You may want to use WebStorm to edit complex Java Script code. WebStorm provides intelligent code analysis, code completion, code navigation, and refactoring.
Running Build Tasks
All build tasks are available in the Gradle Tasks view. To open this view, select the Window > Show View > Other menu command, and select Gradle > Gradle Tasks in the dialog.
Make sure the Show Project Tasks option is selected in the Gradle Tasks view's drop-down menu:
The table below lists typical build tasks:
Objective |
Gradle task |
---|---|
Compile changed Java classes into a JAR file |
webcentral-application-<appName> \ build \ jar |
Compile changed core control Java Script files into ab-core.js |
webcentral-war-root \ build \ minifyJsCore |
Compile changed page navigation Java Script files into ab-pgnav.js |
webcentral-war-root \ build \ minifyJsPgNav |
Compile changed .less files into CSS |
webcentral-war-root \ build \ minifyCoreCss |
Create a WAR file |
webcentral-war-root \ build \ war |
Gradle tasks create output files, such as .jar files, in the build subfolder of the corresponding project. For example, running the webcentral-application-arcgis\ build\ jar task creates the webcentral-platform-arcgis.jar file in the /webcentral-application-arcgis/build folder.
Java build tasks automatically run unit tests for the corresponding project. If any unit test fails, the build task stops without creating output files.
Fetching New Dependencies
Eclipse automatically generates Eclipse project and classpath files from Gradle scripts.
If you change Gradle scripts (e.g. add new dependency, or change version of a dependency), do the following:
- Right-click on the webcentral-war-root project.
- Select the Gradle / Refresh Gradle project menu option.
These steps fetch required library files, and cache them in the C:\eclipse-archibus-<version number>\gradle\bin\caches\modules-2\files-2.1 folder. The updated library files load when you start Web Central from Eclipse.