Re: [Dhis2-devs] FileResources CleanUp Task

2016-07-29 Thread Halvdan Hoem Grelland
This should now be fixed in latest 2.25, 2.24 and 2.23 (currently building on CI, war-file available within the hour). Anyone using Tracker with File data values will need to upgrade. Please let me know if you have any more issues. On Mon, Jul 25, 2016 at 5:50 PM, Halvdan Hoem Grelland wrote: >

Re: [Dhis2-devs] FileResources CleanUp Task

2016-07-25 Thread Halvdan Hoem Grelland
To update everyone: this is definitely a bug with this stuff when using FileResource with Tracker (2.23 -> ). I'm currently working on a fix, but it will take some time. It hopefully won't take long, but as it's a pretty critical issue to have in production you will need to work around it in the m

Re: [Dhis2-devs] FileResources CleanUp Task

2016-07-25 Thread Halvdan Hoem Grelland
Ok. That task *should* detect *unreferenced* fileResource objects and delete them. If they are referenced, however (i.e. there is a data value referencing their UID) they should not be deleted. If the uid in your example is in fact stored in a data value with a FR data element there is a bug, if n

Re: [Dhis2-devs] FileResources CleanUp Task

2016-07-25 Thread Mike Nelushi
Hi Halvdan, We want the user to upload the file and be able to retrieve it but the files are deleted(purged) at 2AM everyday. * INFO 2016-07-25 02:00:00,072 'system-process' delete org.hisp.dhis.fileresource.FileResource, name: PERSONAL_CONSIDERATION_SUBMISSION. Samuel Mur 7910025121081.pdf, uid:

Re: [Dhis2-devs] FileResources CleanUp Task

2016-07-25 Thread Halvdan Hoem Grelland
This should be fine. Are you experiencing that it doesn't work as expected? (I didn't consider the tracker use case when I wrote 'dataset'. My bad...) Calle: your assumptions are correct. DV to FR is one-to-one. You would need a DE per specific file for your event/dataset, or alternately package m

Re: [Dhis2-devs] FileResources CleanUp Task

2016-07-25 Thread Mike Nelushi
Hi Halvdan, The following are the steps I'm using: 1. Save the file on the api/fileResource endpoint, get the UID back, then save the uid as of a dataValue on the event. Example: POST to api/fileResources, get id: “a1” back. 2. PUT the event: { "event" : "", "dataValues" : [

Re: [Dhis2-devs] FileResources CleanUp Task

2016-07-25 Thread Calle Hedberg
Hi, To be 100% clear: If a standard set of documents are to be uploaded - as is the case here - we simply need to create one text data element for each type of document to store the UID returned with the response field? There is no need for any other data values to reference the stored file? If

Re: [Dhis2-devs] FileResources CleanUp Task

2016-07-25 Thread Halvdan Hoem Grelland
Hi Mike, As is explained in the docs, the FR must be referenced by a data value. If the FR is referenced it will not be deleted. The FR object is not usable by itself, so the upload to the api/*/fileResources is step 1 of 2 in the process of uploading a file (it needs to be tied to a DV afterward

[Dhis2-devs] FileResources CleanUp Task

2016-07-24 Thread Mike Nelushi
Hi Halvdan/Morten, There seem to be a cleanup task which is ran at 2AM every 24H which necessary maintenance which removes orphaned files (FileResources) which have been posted to the instance but are marked for deletion as Halvdan explained here