virtUOS / edusharing-opencast-importer

This importer harvests episodes (lecture recordings) from Opencast instances and push it as external references to an Edusharing instance.
GNU General Public License v3.0
2 stars 2 forks source link

get existing nodeIds if metadata.nodeId is undefined #15

Closed ffeyen closed 2 years ago

ffeyen commented 3 years ago

starting point: src/edu-sharing/create-folders-structure.js in error handling of function sendPostRequest in line if (error.response.status === 409) return true If this error code appears, the folder to create is already existing. If additionally `seriesData[0].nodeId === undefined' means there was an error saving the nodeId while creating an ES node (in this case: a folder).

Approach:

  1. http://localhost/edu-sharing/swagger/#!/NODE_v1/getMetadata http://localhost/edu-sharing/rest/node/v1/nodes/-home-/-userhome-/metadata get the nodeId of the folder -userhome- (main folder of a user)

  2. http://localhost/edu-sharing/swagger/#!/NODE_v1/getChildren http://localhost/edu-sharing/rest/node/v1/nodes/-home-/NODEID-FROM-REQUEST-ABOVE/children?maxItems=500&skipCount=0