close

Filter

Importer Manual / Version 2110

Table Of Contents

3.4 Deployment and Operation of a Web Application Importer

The web application importer, in contrast to the coremedia-application importer, will continuously scan the inbox.

Building and Deploying the Importer

In order to get an importer as a web application, create a new web application module as follows:

  1. Take the importer-template example module and integrate it into your workspace, for example into modules/cmd-tools.

  2. Remove the importer module and create a new importer-webapp module with a POM file similar to the following example:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <artifactId>xml-importer-webapp</artifactId>
      <packaging>war</packaging>
    
      ...
    
      <dependencies>
        <dependency>
          <groupId>com.coremedia.cms</groupId>
          <artifactId>importer-component</artifactId>
          <scope>runtime</scope>
        </dependency>
    
        <dependency>
          <groupId>com.coremedia.blueprint</groupId>
          <artifactId>importer-config</artifactId>
          <type>coremedia-application</type>
          <version>${project.version}</version>
          <scope>runtime</scope>
        </dependency>
        <dependency>
          <groupId>com.coremedia.blueprint</groupId>
          <artifactId>importer-config</artifactId>
          <version>${project.version}</version>
          <type>pom</type>
          <scope>runtime</scope>
        </dependency>
     </dependencies>
    
      <build>
        <finalName>importer</finalName>
        <plugins>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
              <failOnMissingWebXml>false</failOnMissingWebXml>
            <overlays>
                <overlay>
                  <groupId>com.coremedia.blueprint</groupId>
                  <artifactId>importer-config</artifactId>
                  <type>coremedia-application</type>
                  <targetPath>WEB-INF</targetPath>
                </overlay>
              </overlays>
            </configuration>
          </plugin>
    
        </plugins>
      </build>
    
      ...
    
    </project>
    

    Example 3.1. Sample POM excerpt for an importer web application


    Your web application module depends on the importer-component component and on the importer-config module. The configuration is put as an overlay over the web application.

  3. Rename the cm-xmlimport.properties file in the importer-config module to the name of the servlet context of the importer (in the example POM, this would be importer.properties).

  4. Configure the importer in the properties file as described in Section 3.1, “General Configuration”.

    Note

    Note

    When you deploy the Importer as a web application, you have to define all Java classes (for example the multiResultGeneratorFactory or transformers) in the properties configuration file with fully qualified names.

  5. Build your importer web application with mvn install.

After the build, you will find an importer WAR file in the target directory. You can deploy the WAR file into your own Tomcat, or simply use the Maven Tomcat plugin as described below.

Starting the Importer

When you have build the importer web application, you can start the importer using the Maven Tomcat plugin from the module's directory.

mvn tomcat7:run <ImporterName>

The importer starts importing all content from the configured inbox.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.