← Back to team overview

dhis2-devs team mailing list archive

Re: FileResources CleanUp Task

 

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 uploaded documents are NOT standard (e.g. if you asked users to upload
let us say a number of photos), you will still need to create x data
elements to store the UID references to whatever is uploaded?

What if you want multiple data value records to reference the same document
- e.g. one with the doc UID, another with the date of the upload, and a
third a boolean data value indicating how many times the document has been
accessed. In that case, what is the exact construct used to link the
document to the other fields? (this is just for my own understanding of the
design).

Regards
Calle

On 25 July 2016 at 11:53, Halvdan Hoem Grelland <halvdan@xxxxxxxxx> wrote:

> 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 afterwards).
>
> In practice this means that in order to use FR you need to create data
> elements (and datasets) to contain your files.
>
> Hope that answers your question. If not, please let me know.
>
> On Mon, Jul 25, 2016 at 7:57 AM, Mike Nelushi <mikeevolution@xxxxxxxxx>
> wrote:
>
>> 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
>> <http://dhis-developers-list.1563109.n2.nabble.com/Re-Dhis2-users-Nightly-Batch-Jobs-td7604891.html>.
>> And from File resource constraints explained *here
>> <http://dhis2.github.io/dhis2-docs/2.23/en/developer/html/ch01s12.html#d0e2396> "Any
>> file resources which are in this state and are older than two hours will be
>> marked for deletion and will eventually be purged from the system." *
>>
>> Our new application allows users to upload files and would like to
>> prevent this from happening.
>> How do we stop the system from running this file deletion task or tag the
>> files to not be deleted?
>>
>> Please advice.
>>
>> Regards,
>> Mike
>>
>
>
>
> --
> Halvdan Hoem Grelland
> Software developer, DHIS 2
> University of Oslo
> http://www.dhis2.org <https://www.dhis2.org/>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 

*******************************************

Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@xxxxxxxxx

Skype: calle_hedberg

*******************************************

References