With WebSphere or Tomcat Web servers, it is possible to specify resources external to a Web application that are accessed via a URL. Adelia first attempts to use the URL; if no URL has been specified, Adelia searches for the file in the execution context.
The following Adelia runtime configuration files are managed as external resources:
The CfgConfiguration.properties file
URL: url/adelia/CfgConfiguration.Middleware session pool configuration files
URL: url/adelia/poolSession_<PoolName>
(where PoolName = Pool in the case of the Pool.properties file (pool by default))Middleware session preparer configuration files
URL: url/adelia/SessionPrep_<SessionPreparerName>The MWCLIENT.INI file
The reference to the file or URL is made via the ID_FILE_CONFIG key:
ID_FILE_CONFIG = [URL]<reference resource name>;<(complete) name of real file>
Example: ID_FILE_CONFIG =[URL]url/myMwClient;MWCLIENT.INI
The MWSERVER.INI file
The reference to the file or URL is made via the ID_FILE_CONFIG_SRV key:
ID_FILE_CONFIG_SRV = [URL]<reference resource name>;<(complete) name of real file>The apiva.properties file
The reference to the file or URL is made via the ID_FILE_CONFIG_APIVA key:
ID_FILE_CONFIG_APIVA =[URL]url/apiva;apiva.propertiesThe CfgWebServices.xml file
The reference to the file or URL is made via the ID_FILE_CONFIG_WEBSERVICES key:
ID_FILE_CONFIG_WEBSERVICES=[URL]url/cfgwebservices;CfgWebServices.xmlThe log4j2.xml file
The reference to the file or URL is made via the ID_FILE_CONFIG_LOG4J key:
ID_FILE_CONFIG_LOG4J=[URL]url/log4j;log4j2.xml
Implementation
Any external resources must be declared in the Web application's web.xml file, as follows:
<resource-ref id="ResourceUrl_on_myfile">
<description>url on myfile</description>
<res-ref-name>url/myfile</res-ref-name>
<res-type>java.net.URL</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
Click the following link for information on defining resources in WebSphere:
http://www-128.ibm.com/developerworks/websphere/library/techarticles/0502_botzum/0502_botzum.html. Information is also available from the Websphere Infocenter, using the keywords "Using URL resources within an application", or "Outsourcing Web application resources".
For Tomcat, a resource is defined by specifying the following <Resource> tag in the server.xml file or associated context XML file (conf/localhost/MyApp.xml):
<Context crossContext="true" debug="5" docBase="MonAppli" path="/MonAppli" reloadable="true">
...
<Resource auth="Container" name="url/monfichier" factory="com.hardis.adelia.common.URLFactory" type="java.net.URL" url="file:///c:/MonRepertoire/fichier.xxx" />
...
</Context>
Note:
In order to allow ".properties" files that contain application settings to be accessed as external resources, the VaToolBxJavaQueryValue function in the VaToolBx DLL takes into account any resources defined as URLs.