← Back to team overview

dhis2-devs-core team mailing list archive

Re: DataSetElements

 

Hm ok, I will have a look Mark

-- 
Morten Olav Hansen
Senior Engineer, DHIS 2
University of Oslo
http://www.dhis2.org

On Tue, Sep 27, 2016 at 7:56 PM, Mark Polak <mark@xxxxxxxxx> wrote:

> It seems like that the `/api/25/metadata` endpoint fails with the same
> errors when trying to send the payload there.
>
> On Tue, Sep 27, 2016 at 2:39 PM, Mark Polak <mark@xxxxxxxxx> wrote:
>
>> Hey Guys,
>>
>> I'm having the following "issues" with the new dataElementSet stuff.
>>
>> *Scenario 1: *
>> GET a dataSet using http://localhost:8080/dhis/api
>> /25/dataSets/TuL8IOPzpHh.json?fields=:owner
>>
>> PUT the identical payload back http://localhost:8080/dhis/api
>> /25/dataSets/TuL8IOPzpHh.json
>>
>> Result: The dataElementSet collection is cleared out.
>>
>> *Scenario 2: *Since 1 didn't work i figured i would load dataSetElements
>> as an additional field (@Morten: Lars will fix this one)
>>
>> GET a dataSet http://localhost:8080/dhis/api
>> /25/dataSets/V8MHeZHIrcP.json?fields=:owner,dataSetElements
>>
>> PUT the received payload.
>>
>> Result:
>> {
>>   "httpStatus": "Internal Server Error",
>>   "httpStatusCode": 500,
>>   "status": "ERROR"
>> }
>>
>> *Scenario 3*: I figured i might need to send back more complete objects
>>
>> GET the dataSet with more complete dataSetElements
>> http://localhost:8080/dhis/api/25/dataSets/V8MHeZHIrcP.json?
>> fields=:owner,dataSetElements[id,dataSet,dataElement,categoryCombo]
>>
>> PUT back the received payload.
>>
>> Result:
>> {
>>   "httpStatus": "Conflict",
>>   "httpStatusCode": 409,
>>   "status": "ERROR",
>>   "message": "About to execute actions, but there are unresolved entity
>> insert actions."
>> }
>>
>> I'll attempt to use the metadata endpoint to see if i can resolve it this
>> way, but we will probably need a solution for Scenario 1 and Scenario 3.
>>
>> --
>> Regards,
>>
>>
>> Mark Polak
>> Software developer, DHIS 2
>> University of Oslo
>> http://www.dhis2.org <https://www.dhis2.org/>
>> mark@xxxxxxxxx
>>
>
>
>
> --
> Regards,
>
>
> Mark Polak
> Software developer, DHIS 2
> University of Oslo
> http://www.dhis2.org <https://www.dhis2.org/>
> mark@xxxxxxxxx
>

References