Configuration
The Sophora Media Finder (for ARD Core) uses the following configuration files:
application.yml
: This is the main configuration file.media-finder-executable.conf
(optional): Used to set the JVM properties (JAVA_OPTS
) such as heap size.loader.properties
: Used for adding the contents of the plugins folder to the classpath of the Media Finder.logback-spring.xml
: Logging configuration.
The Media Finder needs to be restarted for changes in any of these configuration files to take effect.
The following tables list all valid parameters for the application.yml
file.
Parameter | Description |
---|---|
ard-api .assetResearchServiceUrl | URL to ARD's Asset Research Service API |
ard-api . imageServiceUrl | URL to ARD's Image Service API |
ard -api. basicAuthToken | Token for the APIs. This token is a base64 encoded string of the username and password for the ARD APIs |
ar d-api.maxInMemorySizeInMB | Limit on the number of bytes that can be buffered whenever the webclient's input stream needs to be aggregated. |
media-finder.shows.schedule | The schedule to retrieve all current shows from the ARD API. This schedule is set to every 3 hours by default. You may not change this value to a lower value without consulting ARD. |
spring.application.spring-additional-base-packages | Packages that are scanned for components by Spring at application start. Put the package name of your plugin here. Additionally, if you connect to Sophora in your plugin via Spring Boot Sophora Commons (SBOC), add 'com.subshell.sophora.springbootsophoracommons ' |
Installation
The Media Finder is a Spring Boot application. It expects to find the configuration files next to the JAR file. So we recommend to put the executable application JAR and the configuration files into the same directory.
media-finder-executable.conf
file must exactly match the name of the JAR file, i.e., if the name of the JAR file includes the version number, the name of the conf file must include the version number as well.Recommended directory structure:
/cms
/sophora-media-finder
/logs
/plugins
application.yml
loader.properties
logback-spring.xml
media-finder-executable.conf
media-finder-executable.jar
media-finder-<version>-bin.tar.gz
that already contains that structure.Frontend
The application can be embedded and configured as a tool in the Deskclient. Learn more about configuring tools.
Alternatively, it can be configured as a browser tab in the Deskclient. Learn more about tabs.
It is delivered as a static HTML page via the Spring Backend and available at its port.
Mapping plugin
For an in-depth explanation on how to create your own plugin, consult the Developing Guide.
You need to provide a mapping plugin that provides a bean that implements the IMediaFinderMapper
interface.
The mapping plugin can be placed in the plugins directory. Please use a jar containing all necessary dependencies. An example plugin can be found as media-finder-example-plugin-<VERSION>-jar-with-dependencies.jar
in the maven repository.
You need to specify the package name of the mapping plugin in the option spring.application.spring-additional-base-packages
of the application.yml
.
Starting and Stopping
The executable Media Finder JAR file is a Spring Boot executable JAR. On Linux and MacOS, the Media Finder can be started by running the executable JAR as follows:
./media-finder-executable.jar
For running the Media Finder as a background daemon, we suggest to create a systemd service as /etc/systemd/system/media-finder-application.service
. You may need to adapt the user (line 6) and path to the installation (line 7-8) according to your setup.
[Unit]
Description=Sophora Media Finder (for ARD Core)
After=syslog.target
[Service]
User=sophora
WorkingDirectory=/cms/media-finder
ExecStart=/cms/sophora-media-finder/media-finder-executable.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
More options are documented in the Spring Boot documentation.
JAVA_OPTS
Options for the Java VM, such as heap size and proxy settings, can be set using the environment variable JAVA_OPTS
or using an entry in the media-finder-executable.conf
file. For example:
JAVA_OPTS="-Xmx1G"
Logging
Structured logging can be enabled by activating the json-logs
profile.
In the application.yml
:
spring:
profiles:
active: 'json-logs'
REST API
Independent of the Sophora connection, the Media Finder provides a REST API. The documentation can be reached at http://<host>:<port>/<context-path>/swagger-ui.html (see the log file of the Media Finder at startup and Web Server Configuration).
The default Swagger UI path can be changed in the application.yml
, e.g. to use http://<host>:<port>/<context-path>/media-finder-swagger-ui.html:
# Swagger UI
springdoc:
swagger-ui:
path: '/media-finder-swagger-ui.html'
Monitoring
The Media Finder provides a web server that offers some endpoints for monitoring. The base URL for accessing data is http://<host>:<port>/<context-path>/actuator/ (see Web Server Configuration).
Health Checks
The health page indicates if the Media Finder is running: /actuator/health
. It provides JSON with a "status".
Web Server Configuration
The default port of the web server for the REST-API and monitoring is 8080 and the default context-path is empty. Both can be changed in the application.yml
:
# Web Server
server:
port: 8080
servlet:
context-path: '/media-finder'
For more configuration options, see the Spring Boot Documentation.