How to check from a script if a template was updated on the server

Dear Sirs.

I’m preparing a process, where I use script to determine, if particular document should be printed, or not. The decision is made on several conditions (for example the scripts checks, if imported data has changed since previous import).

One of the requirements is to generate the documents if document template was modified. Regarding this, is there any way for a script to check which templates are used in particular process and whether the template was updated? I was thinking about checking the files in ProgramData\Objectif Lune\PlanetPress Workflow 8\PlanetPress Watch\OLConnect\Template folder and simply comparing their modified date, but maybe there is some better way to do it.

I will be very grateful for any hint.

Best regards,
Piotr Mioduszewski

An option is to use the PlanetPress Connect REST API. Because in that case you can 1) ‘Authenticating with the Server (link)’, 2) ‘Uploading a Template to the File Store (link)’ and, for example, 3) ‘Download Managed File or Directory (link)’ to check if you are able to download a uploaded Template file.

Thank you for reply, but I’m afraid, that REST API will not be useful for me.

Even if I download the template file, I will not be able to tell, if it was updated by the user. However, following the suggestion, I checked REST API reference and found List Resources method, but it seems, that it still will not be adequate for me. As reference mentions, it returns following information about each resource:

  • id (integer)
  • name (string)
  • path (string)
  • type (string)
  • size (integer)

There is no information about modification date.

What I need to know, is whether the tamplate was updated by the user (for example by sending modified template from Designer using Send to Server) since previous process iteration.

Best regards.

I guess you are looking for the Get Report end point, this returns a report for the respective resource. This includes a timestamp.

https://help.objectiflune.com/en/planetpress-connect-rest-api-cookbook/2021.1/#Cookbook/REST_API_Reference/File_Store_Service/Get_Report.htm?TocPath=REST%2520API%2520Reference%257CFile%2520Store%2520Service%257C_____5

Erik

1 Like