...
Plugin
Code Block | ||
---|---|---|
| ||
{ /*Below are different content status when the content is submitted for dowloadin plugin */ enum CONTENT_DOWNLOAD_STATUS { Submitted = "SUBMITTED", Extracted = "EXTRACTED", Indexed = "INDEXED" } init() { // register with SDK and get Managers instance // reconciliation() }/* This method will ensure that when the service is started/restarted process the content based on the content status Eg: if the content is extracted state then it will index the content */ reconciliation = function() { // Get the Submitted content status and if completed then state with extraction // Get the contents with Extracted state and index them database }; // listen to the events for content complete EventManager.on("sunbirded:download:complete", () => {// extract the content // index the content }) } |