SystemSettings API to post other data types

Hello all,

While trying to store *"*keyHideUnapprovedDataInAnalytics" as false using the system settings api, we realised that it stores it as a String, while the DefaultAnalyticsSecurityManager when reading the value back tries to type cast it to a Boolean and it fails.

Right now, the system settings api does not expose an endpoint to store other data types except String.

We were thinking of exposing another api all together, which can take a JSON as post body,

ex: {“keyHideUnapprovedDataInAnalytics”:true} and then store the values along with type information.

Please suggest if there are better alternatives.

Thanks,
Aravind

Hi Aravind,

you are correct. We only support string based values in the API at the moment, which is a weakness. I think your suggestion makes sense. Could you provide an example payload with type information the way you envision it?

best regards,

Lars

···

On Thu, May 15, 2014 at 10:40 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

While trying to store *"*keyHideUnapprovedDataInAnalytics" as false using the system settings api, we realised that it stores it as a String, while the DefaultAnalyticsSecurityManager when reading the value back tries to type cast it to a Boolean and it fails.

Right now, the system settings api does not expose an endpoint to store other data types except String.

We were thinking of exposing another api all together, which can take a JSON as post body,

ex: {“keyHideUnapprovedDataInAnalytics”:true} and then store the values along with type information.

Please suggest if there are better alternatives.

Thanks,
Aravind


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

Hi Lars,

Sample payload looks like this:

{

“key0”: true,

“key1”: “true”

“key2”: {

“name”: “some name”

},

“key3”: 3

}

key0 will be stored as boolean, key1 will be stored as string, key2 will be stored as a map, key3 will be stored as integer.

···

Thanks,
Aravind

On Thu, May 15, 2014 at 2:17 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

you are correct. We only support string based values in the API at the moment, which is a weakness. I think your suggestion makes sense. Could you provide an example payload with type information the way you envision it?

best regards,

Lars

On Thu, May 15, 2014 at 10:40 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

While trying to store *"*keyHideUnapprovedDataInAnalytics" as false using the system settings api, we realised that it stores it as a String, while the DefaultAnalyticsSecurityManager when reading the value back tries to type cast it to a Boolean and it fails.

Right now, the system settings api does not expose an endpoint to store other data types except String.

We were thinking of exposing another api all together, which can take a JSON as post body,

ex: {“keyHideUnapprovedDataInAnalytics”:true} and then store the values along with type information.

Please suggest if there are better alternatives.

Thanks,
Aravind


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

I think that is a good idea. Much appreciated if you take that on.

best regards,

Lars

···

On Thu, May 15, 2014 at 10:51 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hi Lars,

Sample payload looks like this:

{

“key0”: true,

“key1”: “true”

“key2”: {

“name”: “some name”

},

“key3”: 3

}

key0 will be stored as boolean, key1 will be stored as string, key2 will be stored as a map, key3 will be stored as integer.

Thanks,
Aravind

On Thu, May 15, 2014 at 2:17 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

you are correct. We only support string based values in the API at the moment, which is a weakness. I think your suggestion makes sense. Could you provide an example payload with type information the way you envision it?

best regards,

Lars

On Thu, May 15, 2014 at 10:40 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

While trying to store *"*keyHideUnapprovedDataInAnalytics" as false using the system settings api, we realised that it stores it as a String, while the DefaultAnalyticsSecurityManager when reading the value back tries to type cast it to a Boolean and it fails.

Right now, the system settings api does not expose an endpoint to store other data types except String.

We were thinking of exposing another api all together, which can take a JSON as post body,

ex: {“keyHideUnapprovedDataInAnalytics”:true} and then store the values along with type information.

Please suggest if there are better alternatives.

Thanks,
Aravind


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

Thanks Lars. We will pick this up.

···

-Aravind

On Thu, May 15, 2014 at 2:24 PM, Lars Helge Øverland larshelge@gmail.com wrote:

I think that is a good idea. Much appreciated if you take that on.

best regards,

Lars

On Thu, May 15, 2014 at 10:51 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hi Lars,

Sample payload looks like this:

{

“key0”: true,

“key1”: “true”

“key2”: {

“name”: “some name”

},

“key3”: 3

}

key0 will be stored as boolean, key1 will be stored as string, key2 will be stored as a map, key3 will be stored as integer.

Thanks,
Aravind

On Thu, May 15, 2014 at 2:17 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

you are correct. We only support string based values in the API at the moment, which is a weakness. I think your suggestion makes sense. Could you provide an example payload with type information the way you envision it?

best regards,

Lars

On Thu, May 15, 2014 at 10:40 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

While trying to store *"*keyHideUnapprovedDataInAnalytics" as false using the system settings api, we realised that it stores it as a String, while the DefaultAnalyticsSecurityManager when reading the value back tries to type cast it to a Boolean and it fails.

Right now, the system settings api does not expose an endpoint to store other data types except String.

We were thinking of exposing another api all together, which can take a JSON as post body,

ex: {“keyHideUnapprovedDataInAnalytics”:true} and then store the values along with type information.

Please suggest if there are better alternatives.

Thanks,
Aravind


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

Great. Let us know how it goes.

regards,

Lars

···

On Thu, May 15, 2014 at 11:04 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Thanks Lars. We will pick this up.

-Aravind

On Thu, May 15, 2014 at 2:24 PM, Lars Helge Øverland larshelge@gmail.com wrote:

I think that is a good idea. Much appreciated if you take that on.

best regards,

Lars

On Thu, May 15, 2014 at 10:51 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hi Lars,

Sample payload looks like this:

{

“key0”: true,

“key1”: “true”

“key2”: {

“name”: “some name”

},

“key3”: 3

}

key0 will be stored as boolean, key1 will be stored as string, key2 will be stored as a map, key3 will be stored as integer.

Thanks,
Aravind

On Thu, May 15, 2014 at 2:17 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

you are correct. We only support string based values in the API at the moment, which is a weakness. I think your suggestion makes sense. Could you provide an example payload with type information the way you envision it?

best regards,

Lars

On Thu, May 15, 2014 at 10:40 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

While trying to store *"*keyHideUnapprovedDataInAnalytics" as false using the system settings api, we realised that it stores it as a String, while the DefaultAnalyticsSecurityManager when reading the value back tries to type cast it to a Boolean and it fails.

Right now, the system settings api does not expose an endpoint to store other data types except String.

We were thinking of exposing another api all together, which can take a JSON as post body,

ex: {“keyHideUnapprovedDataInAnalytics”:true} and then store the values along with type information.

Please suggest if there are better alternatives.

Thanks,
Aravind


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

Hello Lars,

We have committed the changes to tw-msf branch of DHIS2.

Commit message: “Aravind,Simij | Exposed an endpoint to create system settings with json payload”

Please review it, and merge it to trunk if it looks ok.

···

Thanks,
Aravind

On Thu, May 15, 2014 at 3:05 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Great. Let us know how it goes.

regards,

Lars

On Thu, May 15, 2014 at 11:04 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Thanks Lars. We will pick this up.

-Aravind

On Thu, May 15, 2014 at 2:24 PM, Lars Helge Øverland larshelge@gmail.com wrote:

I think that is a good idea. Much appreciated if you take that on.

best regards,

Lars

On Thu, May 15, 2014 at 10:51 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hi Lars,

Sample payload looks like this:

{

“key0”: true,

“key1”: “true”

“key2”: {

“name”: “some name”

},

“key3”: 3

}

key0 will be stored as boolean, key1 will be stored as string, key2 will be stored as a map, key3 will be stored as integer.

Thanks,
Aravind

On Thu, May 15, 2014 at 2:17 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

you are correct. We only support string based values in the API at the moment, which is a weakness. I think your suggestion makes sense. Could you provide an example payload with type information the way you envision it?

best regards,

Lars

On Thu, May 15, 2014 at 10:40 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

While trying to store *"*keyHideUnapprovedDataInAnalytics" as false using the system settings api, we realised that it stores it as a String, while the DefaultAnalyticsSecurityManager when reading the value back tries to type cast it to a Boolean and it fails.

Right now, the system settings api does not expose an endpoint to store other data types except String.

We were thinking of exposing another api all together, which can take a JSON as post body,

ex: {“keyHideUnapprovedDataInAnalytics”:true} and then store the values along with type information.

Please suggest if there are better alternatives.

Thanks,
Aravind


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

Thanks Aravind. Applied patch in r 15281. Looks good.

regards,

Lars

···

On Thu, May 15, 2014 at 12:57 PM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello Lars,

We have committed the changes to tw-msf branch of DHIS2.

Commit message: “Aravind,Simij | Exposed an endpoint to create system settings with json payload”

Please review it, and merge it to trunk if it looks ok.

Thanks,
Aravind

On Thu, May 15, 2014 at 3:05 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Great. Let us know how it goes.

regards,

Lars

On Thu, May 15, 2014 at 11:04 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Thanks Lars. We will pick this up.

-Aravind

On Thu, May 15, 2014 at 2:24 PM, Lars Helge Øverland larshelge@gmail.com wrote:

I think that is a good idea. Much appreciated if you take that on.

best regards,

Lars

On Thu, May 15, 2014 at 10:51 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hi Lars,

Sample payload looks like this:

{

“key0”: true,

“key1”: “true”

“key2”: {

“name”: “some name”

},

“key3”: 3

}

key0 will be stored as boolean, key1 will be stored as string, key2 will be stored as a map, key3 will be stored as integer.

Thanks,
Aravind

On Thu, May 15, 2014 at 2:17 PM, Lars Helge Øverland larshelge@gmail.com wrote:

Hi Aravind,

you are correct. We only support string based values in the API at the moment, which is a weakness. I think your suggestion makes sense. Could you provide an example payload with type information the way you envision it?

best regards,

Lars

On Thu, May 15, 2014 at 10:40 AM, Aravind Muralikrishnan aravindm@thoughtworks.com wrote:

Hello all,

While trying to store *"*keyHideUnapprovedDataInAnalytics" as false using the system settings api, we realised that it stores it as a String, while the DefaultAnalyticsSecurityManager when reading the value back tries to type cast it to a Boolean and it fails.

Right now, the system settings api does not expose an endpoint to store other data types except String.

We were thinking of exposing another api all together, which can take a JSON as post body,

ex: {“keyHideUnapprovedDataInAnalytics”:true} and then store the values along with type information.

Please suggest if there are better alternatives.

Thanks,
Aravind


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