System properties
A number of TDS configuration settings can be set as Java system properties. Default values for some of these
properties are defined in the TDS properties file:
${TOMCAT_HOME}/webapps/thredds/WEB-INF/classes/thredds/server/tds.properties
.
Modifying tds.properties
is an alternative means of changing those configuration settings. However,
tds.properties
lives in the ${TOMCAT_HOME}/webapps/
directory, meaning that it’ll be overwritten whenever the TDS
is upgraded. So, if you make any edits to that file, make sure to back them up before deploying a new version of
thredds.war
, and then restore them after depoloyment.
The Java system properties that TDS uses for configuration are:
Property name | Description | Default value from tds.properties |
---|---|---|
|
Root path for TDS content directory |
None. The user must provide this value. |
|
TDS version number |
|
|
TDS build date |
|
|
URL to the top level of the TDS installation |
"catalog.html" |
|
TDS web page URL |
"/tds/4.6/adminguide/TDS.html" |
|
TDS documentation URL |
"/tds/4.6/adminguide/reference/index.html" |
|
TDS logo URL |
"threddsIcon.gif" |
|
TDS logo alternate text |
"TDS" |
|
Full path for TDS content directory (relative to |
"thredds" |
|
Location of default startup files. Used if |
"WEB-INF/altContent/startup" |
|
Name of TDS configuration file (relative to |
"threddsConfig.xml" |
Content Root
tds.content.root.path
must be found before anything else is done. Typically, Tomcat is started from
${TOMCAT_HOME}/bin
, and the content root is ${TOMCAT_HOME}/content
.
Catalog Substitution
It’s possible to define property keys and use them in configuration catalogs. Values for those properties will be
substituted at runtime. In ${TOMCAT_HOME}/webapps/thredds/WEB-INF/applicationContext-tdsConfig.xml
, you’ll find:
<util:map id="dataRootLocationAliasExpanders" map-class="java.util.HashMap">
<entry key="cdmUnitTest" value="${unidata.testdata.path}/cdmUnitTest/"/>
</util:map>
Here we’ve defined a property called cdmUnitTest
that will be assigned the value of
${unidata.testdata.path}/cdmUnitTest/
[1] at runtime. You can define more
by adding additional entry
elements to the util:map
.
Implementation Details
The dataRootLocationAliasExpanders
map will be injected into the thredds.servlet.DataRootHandler
class by Spring:
@Resource(name = "dataRootLocationAliasExpanders")
public void setDataRootLocationAliasExpanders(Map<String, String> aliases) {
dataRootLocationAliasExpanders = PathAliasReplacementImpl.makePathAliasReplacements(aliases);
}
If a path in a catalog starts with a defined alias, the value will be substituted in the following places:
-
when
DataRootHandler.addRoot()
is called -
the
dataRootLocationAliasExpanders
are injected intothredds.catalog.parser.jdom.InvCatalogFactory10
:-
readFeatureCollection()
: spec string -
readDatasetRoot()
: location / dirLocation -
readDatasetScan()
: dirLocation -
readDatasetScanNew()
: location
-
Note: the thredds.featurecollection.FeatureCollectionConfig
objects themselves are not modified.
This is a problem with TDS.