# How to use a setting defined in the ApplicationName-UserSettings.json on server side?

**URL:** https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185
**Category:** Development
**Created:** [January 17, 2023, 10:03am UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185 "2023-01-17T10:03:35Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![guillaume\_Peillex](https://discourse.paraview.org/user_avatar/discourse.paraview.org/guillaume_peillex/32/10449_2.png) [@guillaume\_Peillex](https://discourse.paraview.org/u/guillaume_Peillex)
#### Post date: [January 17, 2023, 10:03am UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185/1 "2023-01-17T10:03:35Z")

</div>

Hi all,

I’am using the [PipelineSourceName property](https://discourse.paraview.org/t/name-configuration-for-reader-pipeline-source/10541) and want our users be able to specifiy a regex that can be used in the renaming process.

I was thinking about setting this regex in the user (or site) settings file but the problem is that this file is read only by the client when the renaming process occurs on the server.

How can i retrive on server side the setting i put in the user settings file?

I saw the `DistributeSettings` method of the `vtkSMSettings` class, but it is effective only for batch process…

Thanks in advance

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 17, 2023, 11:19am UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185/2 "2023-01-17T11:19:11Z")

</div>

Hi @guillaume_Peillex

- A plugin can add a setting
- A filter can use a setting to initialize a property
- A filter can use the reader name mechanism and the property to position the registration name

hth

FYI @nicolas.vuaille

---

<div class="post-metadata">

### Author: ![guillaume\_Peillex](https://discourse.paraview.org/user_avatar/discourse.paraview.org/guillaume_peillex/32/10449_2.png) [@guillaume\_Peillex](https://discourse.paraview.org/u/guillaume_Peillex)
#### Post date: [January 17, 2023, 3:18pm UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185/3 "2023-01-17T15:18:51Z")

</div>

@mwestphal thanks for your answer.

Have you got some examples or doc explaining a bit more the process?

Thanks.

---

<div class="post-metadata">

### Author: ![guillaume\_Peillex](https://discourse.paraview.org/user_avatar/discourse.paraview.org/guillaume_peillex/32/10449_2.png) [@guillaume\_Peillex](https://discourse.paraview.org/u/guillaume_Peillex)
#### Post date: [January 18, 2023, 8:53am UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185/4 "2023-01-18T08:53:29Z")

</div>

@mwestphal i added a setting through a plugin as done here: [ThemysSettings · main · themys / ThemysServerPlugins · GitLab](https://gitlab.com/themys/themysserverplugins/-/tree/main/ThemysSettings)  
This way i can see the settings in the `Edit` → `Settings` panel.  
Now the question i have is how can i use this settings to initialize a property? As the settings file are read from the client, i suppose i should build a client only plugin that will read this settings and set it as a property through the source proxy?

Thanks in advance

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 18, 2023, 8:55am UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185/5 "2023-01-18T08:55:38Z")

</div>

> [@guillaume\_Peillex](#):
>
> i suppose i should build a client only plugin that will read this settings and set it as a property through the source proxy?

That would be a classic filter in a plugin, but with a xml property like this:

```auto
          <DoubleVectorProperty default_values="1.0 1.0 1.0"
                                name="GridColor"
                                command="SetColor"
                                number_of_elements="3"
                                panel_widget="color_selector">
            <DoubleRangeDomain max="1 1 1" min="0 0 0" name="range" />
            <Documentation>Color used when coloring the grid wireframe</Documentation>
            <Hints>
              <PropertyLink group="settings" proxy="ColorPalette" property="ForegroundColor"
                unlink_if_modified="1" />
            </Hints>
          </DoubleVectorProperty>

```

---

<div class="post-metadata">

### Author: ![guillaume\_Peillex](https://discourse.paraview.org/user_avatar/discourse.paraview.org/guillaume_peillex/32/10449_2.png) [@guillaume\_Peillex](https://discourse.paraview.org/u/guillaume_Peillex)
#### Post date: [January 18, 2023, 10:00am UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185/6 "2023-01-18T10:00:29Z")

</div>

@mwestphal if i understand well, i have to add this Property with its PropertyLink into my reader xml file.  
Thus if i set the setting through the `Edit` → `Settings` panel, then this setting is “transmitted” to my reader object.  
Am i right or dit i miss something?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 18, 2023, 10:02am UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185/7 "2023-01-18T10:02:12Z")

</div>

Yes, that sounds right.

---

<div class="post-metadata">

### Author: ![guillaume\_Peillex](https://discourse.paraview.org/user_avatar/discourse.paraview.org/guillaume_peillex/32/10449_2.png) [@guillaume\_Peillex](https://discourse.paraview.org/u/guillaume_Peillex)
#### Post date: [January 18, 2023, 10:20am UTC](https://discourse.paraview.org/t/how-to-use-a-setting-defined-in-the-applicationname-usersettings-json-on-server-side/11185/8 "2023-01-18T10:20:29Z")

</div>

@mwestphal thanks a lot. It seems to be ok!
