DHIS 2.22 Web API 'userSettings' issue

Hi,

‘userSettings’ Web API in DHIS 2.22 have problem saving. (While it works well in DHIS 2.21)

It keeps on saying “Key is not supported: —KeyName—”.

The attached images are ‘userSettings’ with some key tried for ‘play.dhis2.org/demo’.

Could not use ‘userDataStore’ instead, since it is only available from DHIS 2.23.

image

image

Hi James,

AFAIK, /api/userSettings endpoint supports only pre-defined keys. You can find the list of supported keys here:

http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7336e11178

A hack would be to store the custom user setting key in "systemSettings" (as it supports arbitrary keys). To associate the key with with the user, you can probably use the userId in the key name. For example you can save a key called “keyTestSetting_XYZ” in the system settings where “XYZ” is the userId.

I am not sure if there is any other way to achieve this in DHIS 2.22 as you rightly said that ‘userDataStore’ is only available in later versions.

Regards

Adheesh

···

On Fri, Jul 1, 2016 at 7:12 PM, James Chang jamesbchang@gmail.com wrote:

Hi,

‘userSettings’ Web API in DHIS 2.22 have problem saving. (While it works well in DHIS 2.21)

It keeps on saying “Key is not supported: —KeyName—”.

The attached images are ‘userSettings’ with some key tried for ‘play.dhis2.org/demo’.

Could not use ‘userDataStore’ instead, since it is only available from DHIS 2.23.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Adheesh Bhatia

Chief Developer

BITS PIlani Goa Campus.

Hi James,

Adheesh is right here. User settings only supports a predefined list of keys. For app storage for user specific data structures you can use the user data store:

http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s70.html

regards,

Lars

···

On Fri, Jul 1, 2016 at 5:05 PM, adheesh bhatia adheeshbhatia@gmail.com wrote:

Hi James,

AFAIK, /api/userSettings endpoint supports only pre-defined keys. You can find the list of supported keys here:

http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7336e11178

A hack would be to store the custom user setting key in "systemSettings" (as it supports arbitrary keys). To associate the key with with the user, you can probably use the userId in the key name. For example you can save a key called “keyTestSetting_XYZ” in the system settings where “XYZ” is the userId.

I am not sure if there is any other way to achieve this in DHIS 2.22 as you rightly said that ‘userDataStore’ is only available in later versions.

Regards

Adheesh


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Fri, Jul 1, 2016 at 7:12 PM, James Chang jamesbchang@gmail.com wrote:

Hi,

‘userSettings’ Web API in DHIS 2.22 have problem saving. (While it works well in DHIS 2.21)

It keeps on saying “Key is not supported: —KeyName—”.

The attached images are ‘userSettings’ with some key tried for ‘play.dhis2.org/demo’.

Could not use ‘userDataStore’ instead, since it is only available from DHIS 2.23.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Adheesh Bhatia

Chief Developer

BITS PIlani Goa Campus.

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Thanks for the info, Adheesh and Lars.

···

On Fri, Jul 1, 2016 at 10:39 AM, Lars Helge Øverland lars@dhis2.org wrote:

Hi James,

Adheesh is right here. User settings only supports a predefined list of keys. For app storage for user specific data structures you can use the user data store:

http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s70.html

regards,

Lars

On Fri, Jul 1, 2016 at 5:05 PM, adheesh bhatia adheeshbhatia@gmail.com wrote:

Hi James,

AFAIK, /api/userSettings endpoint supports only pre-defined keys. You can find the list of supported keys here:

http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual_full.html#d7336e11178

A hack would be to store the custom user setting key in "systemSettings" (as it supports arbitrary keys). To associate the key with with the user, you can probably use the userId in the key name. For example you can save a key called “keyTestSetting_XYZ” in the system settings where “XYZ” is the userId.

I am not sure if there is any other way to achieve this in DHIS 2.22 as you rightly said that ‘userDataStore’ is only available in later versions.

Regards

Adheesh


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

On Fri, Jul 1, 2016 at 7:12 PM, James Chang jamesbchang@gmail.com wrote:

Hi,

‘userSettings’ Web API in DHIS 2.22 have problem saving. (While it works well in DHIS 2.21)

It keeps on saying “Key is not supported: —KeyName—”.

The attached images are ‘userSettings’ with some key tried for ‘play.dhis2.org/demo’.

Could not use ‘userDataStore’ instead, since it is only available from DHIS 2.23.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Adheesh Bhatia

Chief Developer

BITS PIlani Goa Campus.