Wiki source code of Créer une variable serveur

Last modified by Aurelie Bertrand on 2025/11/14 11:59

Show last authors
1 (% class="wikigeneratedid" id="HCrE9erunevariableserveur" %)
2 It can sometimes be useful to create a server variable, particularly if you want to have a reference to your parent or root server directory (for example, to automate server creation).
3
4 These variables can then be used in this format: **${server.ServerVariableName}**.
5
6 To create a server variable :
7
8 1. Stop the server.
9 1. Edit the **serversettings.xml **file located in the **AppData/Enterprise Server/ddenterpriseapi/config** directory.
10 1. (((
11 Locate the line {{code language="XML"}}<group category="$uisrv.Advanced" id="serverParams" name="$uisrv.ServerParams"></group>{{/code}}
12 )))
13 1. Replace it with the following :
14
15 {{code}}
16 <group id="serverParams" name="$uisrv.ServerParams" category="$uisrv.Advanced" catMenuName="$uisrv.Servers" menu="0" submenu="5">
17 <input disabled="false" mandatory="false" name="ServerVariableName" reg="false" sample="" showif="" src="" text="ServerVariableName" type="textfield" userparam="false" value="value of my variable"/>
18 </group>
19 {{/code}}
20
21 in which:
22
23 * **ServerVariableName** is replaced by the desired name.
24 * Set the **value **attribute to the desired value.
25
26 (% start="5" %)
27 1. Save the file.
28 1. Restart the server.
29 ➡ The server variable is now created.
30 It is visible, and its value can be modified, in the new **Server** **Variables** tab added to Server Parameters.[[image:1763114374040-795.png]]
31
32 You can then use it, for example, in a document server in the **URL** field.
33
34 [[image:1763114550897-576.png]]
35
36 Server variables can also be used to create a [[database connection that is valid in several environments>>doc:Digdash.user_guide.studio.Create_datamodel.Data_connection.Connect_datasource_database.DB_connection_several_environments.WebHome]].