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:

'Update Toc' button is updated in the 'sunbirdcommonheader' plugin, on click of the button, we are dispatching an event 'org.ekstep.uploadfile:

...

Text book creator should download the CSV file from the 'Download TOC' option,

In the downloaded CSV file he should update the show' 

The plugin to upload the CSV file(should be configurable) will listen to the event org.ekstep.uploadfile:show

The configurations for the plugin will be the title, description, file formats .

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.uploadfile-1.0` 

The CSV file should have the updated attributes like Name, Description, topics, keywords, and then click on 'Update TOC' to upload the CSV. Validate the CSV DIAL code

Validate if the CSV file is uploaded 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

To provide the upload file with drag and drop feature, the library fineuploader used in the On success of the response, read the getHeirarchy?mode=edit to get the updated attribute values of the textbook unit and assign it to data. 

Now dispatch the event `org.ekstep.uploadcontent` plugin will be utilized, the suggested name of the plugin is `org.ekstep.uploadcsv-1.0` 

Pros:

Cons

Solution 2:

To provide the upload file with drag and drop feature, the library fineuploader used in the uploadcontent plugin will be utilized, the suggested name of the plugin is `org.ekstep.uploadcsv-1.0` collectioneditor:content:update`, with data from the getHierarchy result, the org.ekstep.contentMeta plugin will listen to the event and update the attributes of TOC


Pros:

Plugin can be reused for any file upload.

Cons

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

Solution 2:

After upload of CSV using the 'org.ekstep.uploadfile' plugin, the request to send the CSV file will be { data : [file] }.

The settings of fineuploader plugin provides the option, 

request: {
endpoint: '/server/uploads'
}
The file is uploaded to the server, from server the file is been read for processing the file.

On success of the response, read the getHeirarchy?mode=edit to get the updated attribute values of the textbook unit and assign it to data. 

Now dispatch the event `org.ekstep.collectioneditor:content:update`, with data from the getHierarchy result, the org.ekstep.contentMeta plugin will listen to the event and update the attributes of TOC

 

Pros:


Cons

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