Setting up the development environment
Set up the development environment in Eclipse IDE for writing your plugins. Use any Java EE IDE of your choice and make the required configurations mentioned in this topic. You need certain artifacts from <ASSET_PICKER_HOME> to complete the environment setup. This topic will provide information about project building and packaging using Apache Maven so ensure that you have Apache Maven installed.
About this task
To set up the development environment, complete the following steps:
Procedure
- From the <ASSET_PICKER_HOME>/dev-kits/ location, copy the asset-integration-starter project and place it in your development workspace.
- Open the Eclipse IDE.
-
Select
.The Select dialog appears.
-
Select WAR file and click
Next.
The WAR Import dialog appears.
- Click Browse, navigate to <ASSET_PICKER_HOME>, and select asset-viewer.war file.
-
Click Finish.
The WAR Import: Web libraries dialog appears.
- Click Finish.
-
Select
.The Show View dialog appears.
-
Select Servers and click
Open.
As an example, we will illustrate the use of Apache Tomcat 9.0 for running Content Integration. You can use any supported application server and make the required configurations.
- Open the conf/server.xml file from your Apache
Tomcat 9.0 installation directory and add the following entry, with
appropriate database details, inside the
<GlobalNamingResources> element. Please
replace <DRIVER_CLASS_NAME>,
<URL_TO_YOUR_PLATFORM_DATABASE>,
<DATABASE_USERNAME>, and
<DATABASE_PASSWORD> with Platform database
details:
<Resource auth="Container" driverClassName="{DRIVER_CLASS_NAME}" maxActive="20" maxIdle="0" maxWait="10000" name="UnicaPlatformDS" password="{DATABASE_PASSWORD}" username="{DATABASE_USERNAME}" type="javax.sql.DataSource" url="{URL_TO_YOUR_PLATFORM_DATABASE}"/>
- Open the conf/context.xml file from your Apache
Tomcat 9.0 installation directory and add the following entry inside the
<Context>
element:
<ResourceLink auth="Container" global="UnicaPlatformDS" name="UnicaPlatformDS" type="javax.sql.DataSource"/>
- Open the conf/server.xml file from your Apache
Tomcat 9.0 installation directory and add the following entry, with
appropriate database details, inside the
<GlobalNamingResources> element. Please
replace <DRIVER_CLASS_NAME>,
<URL_TO_YOUR_PLATFORM_DATABASE>,
<DATABASE_USERNAME>, and
<DATABASE_PASSWORD> with Platform database
details:
-
To add Apache Tomcat 9.0 as a new server in Eclipse, complete the following
steps:
-
To run the imported asset-viewer.war file on Apache Tomcat
9.0, right click the asset-viewer.war file and select .
The Run on Server dialog appears.
-
Click Finish.
The asset-viewer.war will start executing on Apache Tomcat. After the setup is verified, stop the server and import the plugin development starter project.
-
To install Content Integration SDK, complete
the following steps:
-
To import the plugin development starter project, select
.The Select dialog appears.
-
Select Existing Maven Projects and click
Next.
The Maven Projects dialog appears.
- Click Browse to select the project and click Finish.
- To update Maven dependencies of the asset-integration-starter project, right-click the asset-integration-starter project and select .
-
Ensure that newly imported project is using Java 8 to compile sources. Open
project properties and complete the following steps to setup the compiler:
- Select Java Compiler.
- If Compiler compliance level is non-editable, select Enable project specific settings.
- Change the Compiler compliance level to 1.8.
- Click Apply and Close.
-
To ensure that the right Java library is set up in the build path, complete the
following steps:
-
To enable annotation processing, complete the following steps:
- Select .
- Select Enable project specific settings.
- Select Apply and Close.
-
To install Lombok, complete the following steps:
-
To change the project name, complete the following steps:
- Open the file pom.xml and change its Maven project properties.
- Right-click the asset-integration-starter project and select .
- In the <ASSET_PICKER_HOME>/conf/custom-plugin-services.yml file, declare the plugin services. You can access this file later to add declarations when you introduce services for your plugins.
-
To add plugin project to the deployment assembly of the
asset-viewer.war project, complete the following steps:
- If necessary, clean the projects.
-
Make the appropriate configuration for your system in
<ASSET_PICKER_HOME>/conf/systems.properties (refer
sample-systems.properties file available in the
<ASSET_PICKER_HOME>/dev-kits/asset-integration-starter
project). All the system onboarding configurations mentioned in Unica Content
Integration Administration Guide are supported in
systems.properties
using relevant properties. - As you develop your plugin, check it by running the asset-viewer.war project on a previously configured application server. Since the project would already be added to the Deployment Assembly of asset-viewer.war, changes to your plugin project will be deployed whenever you run the asset-viewer.war project.
-
As you develop your plugin, by adding services to it, use a tool of your choice
to hit the following REST endpoints (change the context root to match your
setup) to verify the accuracy of your implementation: