viaacode / vrt_avo_transfer

[deprecated] Transfers files from the VRT tenant to the 'Archief voor Onderwijs' tenant
Apache License 2.0
0 stars 0 forks source link

Change parsing of JSON-result from Skryv #5

Open maartends opened 6 years ago

maartends commented 6 years ago

Structure for the JSON resonses from Skryv has changed. Multiline text fields (as the ones used for "Lijst media-ID's VRT VIDEO", "Lijst media-ID's VRT AUDIO" and "Lijst VIAA pids" in the briefing documents) can now contain text en markup sub-fields instead of just the content in the lijst_mediaids_video-field. Compare:

a5066321-abff-497e-8b54-57c488123eaa

{
    "finale_selectie_gemaakt_1": {
        "uitvoerder_4": "Fien Lauwaerts", 
        "datum_6": "2018-08-07", 
        "selectedOption": "ja_3", 
        "lijst_mediaids_video": "WP00050211\nWP00111932\nAIM00126580\nvid-mc-4abb70c3-55dc-4350-a242-88230336bf43-2\nvid-mc-971c1444-f2ef-4338-b927-6d7e4c89f607-1\nvid-mc-176153a5-9ac4-47f2-a327-6285d4553a0d-2"
    }
}

with: 56df1a6e-bc9d-47e6-a910-7f61fbac55e5

{
    "finale_selectie_gemaakt_1": {
        "uitvoerder_4": "Eva Perremans", 
        "lijst_viaa_pids": {
            "text": "h707w7x20z", 
            "markup": "none"
        }, 
        "datum_6": "2018-08-14", 
        "selectedOption": "ja_3", 
        "lijst_mediaids_video": {
            "text": "WP00121029\nWP00121409\nWP00119145\nWP00136804\nWP00136805\nWP00119148", 
            "markup": "none"
        }
    }
}

Parsing of the JSON-response should be adapted accordingly. Ideally, both the MEL-expressions AND the DataWeave-component should be changed --> Python replacement.

Offending line: https://github.com/viaacode/vrt_avo_transfer/blob/ca2bb61fd28ca61ae1bb42e9005a53c348cf1fba/src/main/app/briefing_api.xml#L252 and following.

maartends commented 6 years ago

Change parsing of JSON-result from Skryv

maartends commented 6 years ago

Commit 11f5248 basically fixes this issue (ie., the JSON is now correctly parsed). However, problems remain:

2018-08-28 17:10:51,358 [amqpReceiver.03] ERROR org.mule.retry.notifiers.ConnectNotifier - Failed to connect/reconnect: EEFtpConnector
{
  name=FTP
  lifecycle=start
  this=56de5d7e
  numberOfConcurrentTransactedReceivers=4
  createMultipleTransactedReceivers=true
  connected=true
  supportedProtocols=[ftp]
  serviceOverrides=<none>
}
. Root Exception was: Ftp login failed: 530. Type: class java.io.IOException
2018-08-28 17:10:51,361 [amqpReceiver.03] ERROR org.mule.exception.CatchMessagingExceptionStrategy - 
********************************************************************************
Message               : Ftp login failed: 530 (java.io.IOException)
Element               : /FTP @ app:poller.xml:21 (FTP)
--------------------------------------------------------------------------------
Exception stack is:
Ftp login failed: 530 (java.io.IOException) (org.mule.transport.ConnectException)
  org.mule.transport.ftp.FtpConnectionFactory.makeObject(FtpConnectionFactory.java:58)
  org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)
  org.mule.transport.ftp.FtpConnector.getFtp(FtpConnector.java:181)
  org.mule.transport.ftp.FtpConnector.createFtpClient(FtpConnector.java:700)
  (215 more...)

  (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************