From topology point of view the CaptainCasa Toolset is a web application itself that can be deployed to any servlet environment.
“By default” it is part of the CaptainCasa-setup, which either comes as “setup.exe”-file for Windows system and which comes as “.tar”-file for Linux based systems and MacOS. During the installation a Tomcat instance is installed (directory “<installdir>/server/tomcattools”), in the corresponding webapp-folder you will find the “editor” web application.
But...: the web application is also available as “.war” Maven artifact. This “.war” file can be used in two ways:
It can be deployed as “.war” file into any servlet container environment
The same “.war” file can be started stand-alone without any servlet container environment. The reason for this is that the .war file is incorporating a Spring Boot runtime. As consequence it can be started by:
java -jar eclnteditor_springboot-<version>.war
The Spring Boot runtime is started using http-port 51000. After starting you can access the toolset by opening the URL:
http://localhost:51000/editor
Of course the first advantage is: there is a direct, “lightweight” way to install the CaptainCasa Toolset – without the environment installation that is part of the default installation.
The real, important advantage is a consequence out of this: it is now possible to embed the installation and the updates of the toolset into the build of your project. Speaking “in Maven” this means:
When updating the version of CaptainCasa within the “pom.xml” you can directly include the download of the corresponding version of the CaptainCasa Toolset. Your project is automatically in sync with the CaptainCasa tool environment.
Before you always had to explicitly manually upgrade the CaptainCasa Toolset by executing the “default installation” via “setup.exe”/”.tar”. Especially when working in a team of developers this was a constant source of problems, because there was no ensuring that all developers are using the exact same version of the CaptainCasa Toolset. - Now project and toolset are synchronized automatically.
The Maven artifact for the CaptainCasa toolset is:
<groupId>org.eclnt</groupId>
<artifactId>eclnteditor_springboot</artifactId>
<version>...version...</version>
The artifact is a “.war” file – it is not a “.jar” file!
It is part of the CaptainCasa repository at:
https://www.CaptainCasa.com/mavenrepository
Open the URL in your browser and you will directly get access to the newest version.
The following explanations are focusing on Maven-builds. If using Gradle as build-system then please adapt the few steps accordingly.
In your “pom.xml” add the following “plugin” definition:
...
<repositories>
<repository>
<id>org.eclnt</id>
<url>https://www.captaincasa.com/mavenrepository</url>
</repository>
...
</repositories>
...
<properties>
<cc.version>20221107</cc.version>
</properties>
...
...
<dependency>
<groupId>org.eclnt</groupId>
<artifactId>eclntjsfserverRISC</artifactId>
<version>${cc.version}</version>
</dependency>
<dependency>
<groupId>org.eclnt</groupId>
<artifactId>eclntjsfserver_jsfimpl</artifactId>
<version>${cc.version}</version>
</dependency>...
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>cctoolset-copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.eclnt</groupId>
<artifactId>eclnteditor_springboot</artifactId>
<version>${cc.version}</version>
<type>war</type>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}/cctoolset</outputDirectory>
<destFileName>eclnteditor_springboot.war</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
...
The plugin downloads the “.war” artifact into the project's “cctoolset” directory.
Please make sure that this directory is available before running the Maven-build. After running the Maven build (“clean package”) you will find the file “cctoolset/eclnteditor_springboot.war” inside your project:
<project>
...
cctoolset/
eclnteditor_springboot.war
...
src/
main/
src/
test/
...
You may add a start script into the same directory, e.g. for Windows:
<project>
...
cctoolset/
eclnteditor_springboot.war
start.bat
Content of start.bat:
java -jar eclnteditor_springboot.war
Result: due to the integration of the toolset download into the “pom.xml” the toolset will be automatically downloaded when changing the CaptainCasa version number “cc.version”.
Please pay attention: as with all artifacts of CaptainCasa there are two versions:
One for the JEE line (“javax.” packages) – her the artifact is:
<groupId>org.eclnt</groupId>
<artifactId>eclnteditor_springboot</artifactId>
One for the Jakarta (“jakarta” packages) – here the artifact is:
<groupId>org.eclnt</groupId>
<artifactId>eclnteditor_springboot_jakarta</artifactId>
The CaptainCasa Toolset itself stores some configuration data:
Some own configuration parameters
For each project: the location of the project
By default the toolset will store its configuration data within the default user-directory of the operating system. In Windows this is “c:\Users\<userName>\cceditor”. But you can explicitly define the location of this directory:
java -jar eclnteditor_springboot-<version>.war configDir=...directory...
You can pass the directory in two ways:
As absolute directory
As relative directory. Example:
java -jar eclnteditor_springboot.war configDir=../cctoolsetconfig
By using relative directory definitions you can e.g. define the following scenario:
<project>
...
cctoolset/
eclnteditor_springboot.war
start.bat
cctoolsetconfig/
...
...
If starting the toolset from the “/cctoolset” directory, then the configuration data is stored in a relative directory accordingly.
Compare to the “default” installation (“setup.exe”/”.tar”) there is only one issue that needs to be defined: the location of the directory into which applications are deployed by default.
This configuration can be done in the toolset itself:
Example:
<config>
<defaultdeployment
webappsdir="C:\EnterpriseClientRISC\server\tomcat\webapps"
port="50000"
/>
</config>
When creating a project of when importing a project into the toolset then one configuration file will be created in the “/projects” directory of the configuration directory.
Example: after creating project “test” there will be the following file:
<tooolConfigDirectory>
projects/
test.xml
The content of the file is simple – it just contains the location of the project:
<project projectdirectory="c:/projects/test"
projectfilestoredinprojectdirectory="true">
</project>
In team scenarios you do not want the location of the project directory to be defined in a more general way.
As with any other configuration file within CaptainCasa you can access system and environment properties by using “${sys.*}” and “{env.*}” definitions. Example:
<project projectdirectory="${sys.user.dir}/.."
projectfilestoredinprojectdirectory="true">
</project>
In the example the toolset will read the project from a directory that is positioned relatively to the toolset directory (“user.dir” points to the directory in which “java” was s started).