You are not logged in. Click here to log in.

codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Tags:  Word export

How to Setup Word Export Server

This functionality requires additional licensing, to claim it contact your Intland Sales representative!

Prerequisite

  • Locate the cb-msoffice-integration-<version>.jar file in <CB install directory>/msoffice/ directory.

Since Codebeamer release 22.10 (GINA), the files in the <CB install directory>/msoffice/ directory have been renamed to cb-word-export-impl-<version>.jar and cb-word-import-impl-22.10-SP8.jar .

  • Installed Java version, check the java version of Codebeamer.
Using Codebeamer release 22.10 (GINA) or above, the following switches must be added to the java parameters:
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED
--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
  • Certificate files in case HTTPS is needed.

How to Setup a Server on Linux

Create a wordexport.service file in /etc/systemd/system/ directory, with the following content:

[Unit]
Description=Word Export application
After=syslog.target network.target


[Service]
SuccessExitStatus=143


Type=simple


ExecStart=java -jar <CB install dir>/msoffice/cb-word-export.jar --rest.export.maxRequests=<NUMBER OF PARALLEL REQUESTS> --server.ssl.key-store-type=PKCS12 --server.ssl.key-store=<Path of your keystore>/keystore.p12 --server.ssl.key-store-password=<PASSWORD> --server.ssl.key-alias=<ALIAS> --security.require-ssl=true --server.port=443
ExecStop=/bin/kill -15 $MAINPID


[Install]
WantedBy=multi-user.target

How to Start wordimport.service

Run the following commands in the terminal:

  1. sudo systemctl daemon-reload
  2. sudo systemctl start wordexport
  3. sudo systemctl status wordexport

Word Import service should be up and running, see the returned status message in the terminal:

wordexport.service - Word Export application
     Loaded: loaded (/etc/systemd/system/wordexport.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-02-04 14:17:19 CET; 6s ago


Healthcheck URL

https://<your domain>/actuator/health

How to Create a Docker Image

Create a dockerfile with the following content:

FROM adoptopenjdk/openjdk8:ubi # 21.09 and below
FROM adoptopenjdk/openjdk11:ubi # after 21.09


# Create user - End
RUN groupadd -g 1001 appuser && \
    useradd -m -r -u 1001 -g appuser appuser
# Create user - End


# Setup user directory - Start
COPY rootfs /home/appuser/
# Setup user directory - End


RUN echo '\
jarFile=$(find /home/appuser/ -name \*.jar | head -n 1); \
echo "Run: java $JAVA_OPTS -jar $jarFile --rest.export.maxRequests=${MAX_REQUESTS:-3}"; \
java $JAVA_OPTS \
    -jar $jarFile \
    --rest.export.maxRequests=${MAX_REQUESTS:-3} \
    --server.ssl.key-store-type=PKCS12 \
    --server.ssl.key-store=/home/appuser/keystore.p12 \
    --server.ssl.key-store-password=${PASSWORD} \
    --server.ssl.key-alias=${ALIAS} \
    --security.require-ssl=true \
    --server.port=8443; \
' > /home/appuser/run.sh


RUN chmod +x /home/appuser/run.sh


HEALTHCHECK --interval=30s --timeout=3s --start-period=1m --retries=10 \
  CMD curl -f --insecure https://localhost:8443/actuator/health || exit 1


WORKDIR /home/appuser
ENTRYPOINT [ "bash", "-c", "/home/appuser/run.sh" ]
  1. Create a rootfs directory.
  2. Copy the keystore.p12 file into rootfs directory.
  3. Copy the cb-msoffice-integration-<version>.jar file into rootfs directory.
  4. Run docker build -t wordexport.
  5. Push it into the docker registry.

Docker Compose

Creater a docker-compose.yml file, with the following content:

version: '2.1'


services:


  wordexport:
    image: <YOUR IMAGE>
    environment:
    - "JAVA_OPTS=-XX:+HeapDumpOnOutOfMemoryError -XX:InitialCodeCacheSize=128m -XX:ReservedCodeCacheSize=128m -XX:+UseCodeCacheFlushing -Xss1m -Xms2500m -Xmx2500m"
    - LOG4J_FORMAT_MSG_NO_LOOKUPS=true
    ports:
      - "443:8081"
    volumes:
      - /tmp:/tmp


Run docker-compose -f docker-compose.yml up -d to start Word Export server.

How to Setup a Server on Windows

Download Windows Service Wrapper

Download the latest version of https://github.com/winsw/winsw, please use the WinSW.NETCore31.x64.exe.

Set Up a Service

  1. Rename the WinSW.NETCore31.x64.exe to wordexport.exe.
  2. Create a wordexport.xmlfile with the following content:
    <service>
      <id>wordexport</id>
      <name>Word Export</name>
      <description>This service runs Word Export application.</description>
      <executable>java</executable>
      <arguments>-Xms6G -Xmx6G -jar "%BASE%\cb-msoffice-integration-<VERSION>.jar" --server.port=443 --rest.export.maxRequests=<NUMBER OF PARALLEL REQUESTS> --server.ssl.key-store-type=PKCS12 --server.ssl.key-store=%BASE%\keystore.p12 --server.ssl.key-store-password=<PASSWORD> --server.ssl.key-alias=<ALIAS> --security.require-ssl=true</arguments>
      <log mode="roll"></log>
      <logpath>%BASE%\logs</logpath>
      <onfailure action="restart" />
    </service>
  3. Create a keystore.p12 file with certificates.
  4. Open the 443 port on the Windows Firewall.
  5. Open the 443 port on the Security Group on AWS.
  6. Install service by running in CLI: wordexport.exe install.
  7. Start service by running in CLI: wordexport.exe start.
  8. Check status by running in CLI: wordexport.exe status.
  9. Check healthcheck URL: https://localhost/actuator/health.