Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Background

The textbook creator should be able to update the existing Text book unit attributes in the TOC by uploading the excel (CSV) file.

...

On click of ' Update TOC'  button user will be uploading the CSV file with updated Text book unit attributes.

Solution 1:

Text book creator should download the CSV file from the 'Download TOC' option,'Update Toc' button is updated in the 'sunbirdcommonheader' plugin, on click of the button, we are dispatching an event 'org.ekstep.uploadcsv:show' 

The plugin to upload the CSV file will listen to the event org.ekstep.uploadcsv:show

To provide the upload file with drag and drop feature, the library fineuploader used in the `org.ekstep.uploadcontent` plugin will be utilized, the suggested name of the plugin is `org.ekstep.uploadcsv-1.0` 

In the downloaded The CSV file , the user should update have the updated attributes like Name, Description, topics, keywords, DIAL code

Validate if the CSV file is uploaded else throw an error saying, and then click on 'Update TOC' to upload the CSV.uploaded_file_name has a invalid extension, Please enter a .CSV file.

the request of the api will be  request { data : [file] }

and notify the user if there are any errors from the error response and update the Text book unit attributes on success of api response

On success of the response update the attributes of the textbook unit.


Pros:

Plugin can be reused in multiple places like upload the CSV

Cons

Basic validations like empty record check is known after the api call.

Solution 2:

Provide the upload feature with out the plugin, provide the drag and drop / upload file in the 'sunbirdcommonheader' plugin. 

Validate if the CSV file is uploaded in front enduploaded else throw an error saying, uploaded_file_name has a invalid extension, Please enter a .CSV file.

the request of the api will be  request { data : [file] }

and notify the user if there are any errors from the error response and update the Text book unit attributes on success of api response

On success of the response update the attributes of the textbook unit.

Pros:

Front end parsing re-usability of the file is not requiredcode is limited to only 'sunbirdcommonheader' plugin.

Cons

Basic validations like empty record check is known after the api call.

...