Studio Developer Manual / Version 2101
Table Of ContentsFor the database connection and schema evolution for the Editorial Comments feature Hibernate and Liquibase are used. Both frameworks support multiple databases and therefore must be configured correctly.
For each database CoreMedia delivers the appropriate configuration in an extra Maven module. The database driver for MySQL and PostgreSQL are already provided as runtime dependencies in the studio-server-app module. The Maven dependency has to be added to the studio-server-app and contains the properties to be set and a transitive dependency to the driver. Furthermore, the database schema and the database user are expected to be setup. The required schema name, username and password differs for each database and can be found in the detailed descriptions.
Further configuration options can be found in Section 4.5.6, “Editorial Comments Configuration” in Deployment Manual.
Note
In case you want to provide a schema or username, different to cm_editorial_comments
(current default), use the properties
editorial.comments.db.username
, editorial.comments.db.schema
and editorial.comments.db.password
.
MySQL
To configure MySQL, prepare the database as described in Database requirements and set the property
editorial.comments.datasource.url
.
Database requirements:
schema: cm_editorial_comments |
username: cm_editorial_comments |
password: cm_editorial_comments |
Maven Dependency:
<dependency> <groupId>com.coremedia.blueprint</groupId> <artifactId>database-drivers</artifactId> <type>pom</type> <scope>runtime</scope> </dependency> </dependencies>
Required properties:
editorial.comments.datasource.url=jdbc:mysql://${host}:${port}/cm_editorial_comments?useUnicode=yes&characterEncoding=UTF-8 |
PostgreSQL
To configure PostgreSQL, prepare the database as described in Database requirements and set the property editorial.comments.datasource.url.
Database requirements:
schema: cm_editorial_comments |
username: cm_editorial_comments |
password: cm_editorial_comments |
Maven Dependency:
<dependency> <groupId>com.coremedia.blueprint</groupId> <artifactId>database-drivers</artifactId> <type>pom</type> <scope>runtime</scope> </dependency> </dependencies>
Required Properties:
editorial.comments.datasource.url=jdbc:postgresql://${host}:${port}/coremedia |
Note
Should you use PostgreSQL hosted on Azure, it is necessary to provide a postfix with the domain to the username.
Use editorial.comments.db.username
to set the username with the postfix:
editorial.comments.db.username=cm_editorial_comments@domain |
editorial.comments.db.schema=cm_editorial_comments |
Microsoft SQL Server
To configure Microsoft SQL Server, prepare the database as described in Database requirements, add the Maven dependency and set the property editorial.comments.datasource.url.
Database requirements:
schema: cm_editorial_comments |
username: cm_editorial_comments |
password: cm_editorial_comments |
Maven Dependency:
<dependency> <groupId>com.coremedia.cms</groupId> <artifactId>editorial-comments-data-mssql</artifactId> </dependency>
Required Properties, replace username and password if required:
editorial.comments.datasource.url=jdbc:sqlserver://${host}:${db.port};DatabaseName=cm_editorial_comments;username=sa;password=admin |
IBM DB2
To configure DB2, prepare the database as described in Database requirements, add the Maven dependency and set the property editorial.comments.datasource.url.
Furthermore, the JDBC driver isn't part of a public Maven repository and has to be downloaded and deployed to the
studio-server-app
.
Database requirements:
schema: CMEDITORIALCOMMENTS |
username: cmeditorialcomments |
password: cmeditorialcomments |
Maven Dependencies:
<dependency> <groupId>com.coremedia.cms</groupId> <artifactId>editorial-comments-data-db2</artifactId> </dependency> <!-- Driver for db2 11.5, has to be adapted to your database version, download the according driver from ibm. --> <dependency> <groupId>com.ibm</groupId> <artifactId>db2jcc4</artifactId> <version>11.5</version> <scope>runtime</scope> </dependency>
Required Properties:
editorial.comments.datasource.url=jdbc:db2://${host}:${port}/CM |
Oracle
To configure Oracle DB, prepare the database as described in Database requirements, add the Maven dependency and set
the property editorial.comments.datasource.url
.
Database requirements:
schema: cm_editorial_comments |
username: cm_editorial_comments |
password: cm_editorial_comments |
Maven Dependencies:
<dependency> <groupId>com.coremedia.cms</groupId> <artifactId>editorial-comments-data-oracle</artifactId> </dependency>
Required Properties:
editorial.comments.datasource.url=jdbc:oracle:thin:@${host}:${port}:COMMENTS |
Working with Liquibase
Note
Should the startup of a Studio-Server instance be interrupted, it is possible that a lock is left by liquibase on the database schema cm_editorial_comments.
In this case it is necessary to remove the lock manually like described here.
It is also possible to disable Liquibase with the configuration
editorial.comments.liquibase.enabled
Should you decide to disable Liquibase, you need to make sure that the new changesets are applied manually after each upgrade of CMCC.
You can either do that by starting a studio server instance once with editorial.comments.liquibase.enabled=true
against the database, or use the
Liquibase command line tool.
Using the command line tool requires access to a database driver JAR file as well as the editorial-comments-data
JAR file.
editorial-comments-data
is a module that can be found in the CMCC release artifacts with the group id com.coremedia.cms
.
The following example shows an example liquibase.properties file for a MySQL setup:
changeLogFile=db/changelog/db.changelog-editorial-comments.xml username=cm_editorial_comments password=cm_editorial_comments driver=com.mysql.cj.jdbc.Driver url=jdbc:mysql://localhost:3306/cm_editorial_comments ?useUnicode=yes&characterEncoding=UTF-8 classpath=>pathToMySqlDriver>/mysql-connector-java-8.0.22.jar :<pathTo_editorial-comments-data-jar>editorial-comments-data-1-SNAPSHOT.jar
Example 3.1. Running Liquibase via cmd tool